Merge branch '8650-container-work-unit' into 9318-dashboard-uses-work-units
[arvados.git] / apps / workbench / app / models / work_unit.rb
1 class WorkUnit
2   # This is an abstract class that documents the WorkUnit interface
3
4   def label
5     # returns the label that was assigned when creating the work unit
6   end
7
8   def uuid
9     # returns the arvados UUID of the underlying object
10   end
11
12   def children
13     # returns an array of child work units
14   end
15
16   def modified_by_user_uuid
17     # returns uuid of the user who modified this work unit most recently
18   end
19
20   def created_at
21     # returns created_at timestamp
22   end
23
24   def started_at
25     # returns started_at timestamp for this work unit
26   end
27
28   def finished_at
29     # returns finished_at timestamp
30   end
31
32   def state_label
33     # returns a string representing state of the work unit
34   end
35
36   def state_bootstrap_class
37     # returns a class like "danger", "success", or "warning" that a view can use directly to make a display class
38   end
39
40   def success?
41     # returns true if the work unit finished successfully,
42     # false if it has a permanent failure,
43     # and nil if the final state is not determined.
44   end
45
46   def progress
47     # returns a number between 0 and 1
48   end
49
50   def log_collection
51     # returns uuid or pdh with saved log data, if any
52   end
53
54   def parameters
55     # returns work unit parameters, if any
56   end
57
58   def script
59     # returns script for this work unit, if any
60   end
61
62   def repository
63     # returns this work unit's script repository, if any
64   end
65
66   def script_version
67     # returns this work unit's script_version, if any
68   end
69
70   def supplied_script_version
71     # returns this work unit's supplied_script_version, if any
72   end
73
74   def docker_image
75     # returns this work unit's docker_image, if any
76   end
77
78   def runtime_constraints
79     # returns this work unit's runtime_constraints, if any
80   end
81
82   def priority
83     # returns this work unit's priority, if any
84   end
85
86   def nondeterministic
87     # returns if this is nondeterministic
88   end
89
90   def output
91     # returns uuid or pdh of output data, if any
92   end
93
94   def outputs
95     # returns array containing uuid or pdh of output data of all children
96     # if no children, return output data if any
97   end
98
99   def child_summary
100     # summary status of any children of this work unit
101   end
102
103   def child_summary_str
104     # textual representation of child summary
105   end
106
107   def can_cancel?
108     # returns true if this work unit can be canceled
109   end
110
111   def readable?
112     # is the proxied object readable by current user?
113   end
114
115   def uri
116     # returns the uri for this work unit
117   end
118
119   def title
120     # title for the work unit
121   end
122
123   def has_unreadable_children
124     # accept it if you can't understand your own children
125   end
126
127   # view helper methods
128   def link_to_log
129     # display a link to log if present
130   end
131
132   def walltime
133     # return walltime for a running or completed work unit
134   end
135
136   def cputime
137     # return cputime for a running or completed work unit
138   end
139
140   def queuedtime
141     # return queued time if the work unit is queued
142   end
143
144   def is_running?
145     # is the work unit in running state?
146   end
147
148   def is_paused?
149     # is the work unit in paused state?
150   end
151
152   def is_finished?
153     # is the work unit in finished state?
154   end
155
156   def is_failed?
157     # is this work unit in failed state?
158   end
159 end