Merge remote-tracking branch 'origin/master' into 3605-improved-dashboard
[arvados.git] / services / api / app / controllers / arvados / v1 / jobs_controller.rb
index a98ca7179a736ecd689b757f9e70400da9add47d..afb516bd48d89385d70f42922374359d7079b7e0 100644 (file)
@@ -71,7 +71,7 @@ class Arvados::V1::JobsController < ApplicationController
             # We'll use this if we don't find a job that has completed
             incomplete_job ||= j
           else
-            if Collection.readable_by(current_user).find_by_uuid(j.output)
+            if Collection.readable_by(current_user).find_by_portable_data_hash(j.output)
               # Record the first job in the list
               if !@object
                 @object = j
@@ -162,6 +162,10 @@ class Arvados::V1::JobsController < ApplicationController
     index
   end
 
+  def queue_size
+    render :json => {:queue_size => Job.queue.size}
+  end
+
   def self._create_requires_parameters
     (super rescue {}).
       merge({
@@ -214,7 +218,7 @@ class Arvados::V1::JobsController < ApplicationController
         search_list = filter[2].is_a?(Enumerable) ? filter[2] : [filter[2]]
         filter[2] = search_list.flat_map do |search_term|
           image_search, image_tag = search_term.split(':', 2)
-          Collection.uuids_for_docker_image(image_search, image_tag, @read_users)
+          Collection.find_all_for_docker_image(image_search, image_tag, @read_users).map(&:portable_data_hash)
         end
         true
       else