1 class Arvados::V1::KeepDisksController < ApplicationController
2 skip_before_filter :require_auth_scope_all, :only => :ping
3 skip_before_filter :find_object_by_uuid, :only => :ping
5 def self._ping_requires_parameters
10 filesystem_uuid: false,
13 service_ssl_flag: true
17 @object = Node.where(uuid: (params[:id] || params[:uuid])).first
19 if current_user.andand.is_admin
20 @object = KeepDisk.new(filesystem_uuid: params[:filesystem_uuid])
23 # In the first ping from this new filesystem_uuid, we can't
24 # expect the keep node to know the ping_secret so we made sure
25 # we got an admin token. Here we add ping_secret to params so
26 # KeepNode.ping() understands this update is properly
28 params[:ping_secret] = @object.ping_secret
30 return render_not_found "object not found"
34 params[:service_host] ||= request.env['REMOTE_ADDR']
35 if not @object.ping params
36 return render_not_found "object not found"
38 render json: @object.as_api_response(:superuser)
41 def find_objects_for_index
42 # all users can list all keep disks
43 @objects = model_class.where('1=1')