1 class Arvados::V1::NodesController < ApplicationController
2 skip_before_filter :require_auth_scope_all, :only => :ping
7 @object.start!(lambda { |h| arvados_v1_ping_node_url(h) })
11 def self._ping_requires_parameters
15 @object.ping({ ip: params[:local_ipv4] || request.env['REMOTE_ADDR'],
16 ping_secret: params[:ping_secret],
17 ec2_instance_id: params[:instance_id] })
18 if @object.info[:ping_secret] == params[:ping_secret]
19 render json: @object.as_api_response(:superuser)
21 raise "Invalid ping_secret after ping"
25 def find_objects_for_index
26 if current_user.andand.is_admin || !current_user.andand.is_active
29 # active non-admin users can list nodes that are (or were
31 @objects = model_class.where('last_ping_at >= ?', Time.now - 1.hours)