1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 require 'update_priorities'
7 class Arvados::V1::ContainerRequestsController < ApplicationController
8 accept_attribute_as_json :environment, Hash
9 accept_attribute_as_json :mounts, Hash
10 accept_attribute_as_json :runtime_constraints, Hash
11 accept_attribute_as_json :command, Array
12 accept_attribute_as_json :filters, Array
13 accept_attribute_as_json :scheduling_parameters, Hash
14 accept_attribute_as_json :secret_mounts, Hash
16 def self._index_requires_parameters
20 type: 'boolean', required: false, default: false, description: "Include container requests whose owner project is trashed.",
25 def self._show_requires_parameters
29 type: 'boolean', required: false, default: false, description: "Show container request even if its owner project is trashed.",
35 if (resource_attrs.keys.map(&:to_sym) - [:owner_uuid, :name, :description, :properties]).empty? or @object.container_uuid.nil?
36 # If no attributes are being updated besides these, there are no
37 # cascading changes to other rows/tables, the only lock will be
38 # the single row lock on SQL UPDATE.
41 # Get locks ahead of time to avoid deadlock in cascading priority
43 Container.transaction do
44 row_lock_for_priority_update @object.container_uuid