1 class Job < ArvadosBase
2 def self.goes_in_projects?
10 def attribute_editable? attr, *args
11 if attr.to_sym == :description
12 super && attr.to_sym == :description
24 x = "\"#{script}\" job"
29 x += " finished #{finished_at.strftime('%b %-d')}"
31 x += " started #{started_at.strftime('%b %-d')}"
33 x += " submitted #{created_at.strftime('%b %-d')}"
38 arvados_api_client.api "jobs/#{self.uuid}/", "cancel", {}
42 arvados_api_client.api("jobs/", "queue_size", {"_method"=> "GET"})[:queue_size] rescue 0
46 arvados_api_client.unpack_api_response arvados_api_client.api("jobs/", "queue", {"_method"=> "GET"})
49 # The 'job' parameter can be either a Job model object, or a hash containing
50 # the same fields as a Job object (such as the :job entry of a pipeline
53 # This has a valid state method on it so call that
54 if job.respond_to? :state and job.state
58 # Figure out the state based on the other fields.
61 elsif job[:success] == false
63 elsif job[:success] == true
65 elsif job[:running] == true
72 def textile_attributes