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
7 skip_before_filter :find_object_by_uuid, only: [:current]
8 skip_before_filter :render_404_if_no_object, only: [:current]
11 if @object.locked_by_uuid != Thread.current[:api_client_authorization].uuid
12 raise ArvadosModel::PermissionDeniedError.new("Not locked by your token")
14 @object = @object.auth
18 # Updates use row locking to resolve races between multiple
19 # dispatchers trying to lock the same container.
37 if Thread.current[:api_client_authorization].nil?
38 send_error("Not logged in", status: 401)
40 c = Container.where(auth_uuid: Thread.current[:api_client_authorization].uuid).first
42 send_error("Token is not associated with a container.", status: 404)