API endpoint base: @https://xyzzy.arvados.org/arvados/v1/jobs@
-h2. Additional parameters for "Create" method
+h3. Additional parameters for "Create" method
table(table table-bordered table-condensed).
|*Parameter name*|*Type*|*Description*|
|allow_duplicate|boolean|If true, a new job is submitted even if an identical job has already been submitted (and has not failed). If false or not supplied, a new job will _not_ be submitted and the existing job will be returned in the API response.|
+h3. Queue
+
+<pre>
+GET https://xyzzy.arvados.org/arvados/v1/jobs/queue
+
+POST https://xyzzy.arvados.org/arvados/v1/jobs/queue
+_method=GET
+where[owner]=xyzzy-tpzed-a4lcehql0dv2u25
+</pre>
+
+→ Job resource list
+
+This method is equivalent to the "index method":methods.html#index, except that the results are restricted to queued jobs (i.e., jobs that have not yet been started or cancelled) and order defaults to queue priority.
+
h2. Resource
Each job has, in addition to the usual "attributes of Arvados resources":resources.html:
(using Group as an example)
-h2. Index, list, search
+h2(#index). Index, list, search
<pre>
GET https://xyzzy.arvados.org/arvados/v1/groups?where[owner]=xyzzy-tpzed-a4lcehql0dv2u25
before_filter :login_required, :except => :render_not_found
before_filter :catch_redirect_hint
+ before_filter :load_where_param, :only => :index
before_filter :find_objects_for_index, :only => :index
before_filter :find_object_by_uuid, :except => [:index, :create]
protected
+ def load_where_param
+ @where = params[:where] || {}
+ @where = Oj.load(@where) if @where.is_a?(String)
+ end
+
def find_objects_for_index
uuid_list = [current_user.uuid, *current_user.groups_i_can(:read)]
sanitized_uuid_list = uuid_list.
true, current_user.is_admin,
uuid_list,
current_user.uuid)
- @where = params[:where] || {}
- @where = Oj.load(@where) if @where.is_a?(String)
- if params[:where]
+ if !@where.empty?
conditions = ['1=1']
@where.each do |attr,value|
if attr == 'any'
accept_attribute_as_json :script_parameters, Hash
accept_attribute_as_json :resource_limits, Hash
accept_attribute_as_json :tasks_summary, Hash
+ skip_before_filter :find_object_by_uuid, :only => :queue
def index
want_ancestor = @where[:script_version_descends_from]
end
super
end
+
+ def queue
+ load_where_param
+ @where.merge!({
+ started_at: nil,
+ is_locked_by: nil,
+ cancelled_at: nil
+ })
+ params[:order] ||= 'priority desc, created_at'
+ find_objects_for_index
+ index
+ end
end
match '/keep_disks/ping' => 'keep_disks#ping', :as => :ping_keep_disk
match '/links/from/:tail_uuid' => 'links#index', :as => :arvados_v1_links_from
match '/users/current' => 'users#current'
+ match '/jobs/queue' => 'jobs#queue'
resources :collections
resources :links
resources :nodes