1 class Arvados::V1::VirtualMachinesController < ApplicationController
2 skip_before_filter :find_object_by_uuid, :only => :get_all_logins
3 skip_before_filter :render_404_if_no_object, :only => :get_all_logins
4 before_filter(:admin_required,
5 :only => [:logins, :get_all_logins])
13 User.includes(:authorized_keys).all.each do |u|
17 @vms = VirtualMachine.includes(:login_permissions)
19 @vms = @vms.where('uuid=?', @object.uuid)
24 vm.login_permissions.each do |perm|
25 user_uuid = perm.tail_uuid
26 @users[user_uuid].andand.authorized_keys.andand.each do |ak|
27 username = perm.properties.andand['username']
31 hostname: vm.hostname,
32 public_key: ak.public_key,
34 virtual_machine_uuid: vm.uuid,
35 authorized_key_uuid: ak.uuid
41 render json: { kind: "arvados#HashList", items: @response }