1 class Arvados::V1::ContainersController < ApplicationController
2 accept_attribute_as_json :environment, Hash
3 accept_attribute_as_json :mounts, Hash
4 accept_attribute_as_json :runtime_constraints, Hash
5 accept_attribute_as_json :command, Array
6 accept_attribute_as_json :scheduling_parameters, Hash
8 skip_before_filter :find_object_by_uuid, only: [:current]
9 skip_before_filter :render_404_if_no_object, only: [:current]
12 if @object.locked_by_uuid != Thread.current[:api_client_authorization].uuid
13 raise ArvadosModel::PermissionDeniedError.new("Not locked by your token")
15 @object = @object.auth
19 # Updates use row locking to resolve races between multiple
20 # dispatchers trying to lock the same container.
38 if Thread.current[:api_client_authorization].nil?
39 send_error("Not logged in", status: 401)
41 c = Container.where(auth_uuid: Thread.current[:api_client_authorization].uuid).first
43 send_error("Token is not associated with a container.", status: 404)