Merge branch 'master' into 8650-container-work-unit
[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 child_summary
95     # summary status of any children of this work unit
96   end
97
98   def child_summary_str
99     # textual representation of child summary
100   end
101
102   def can_cancel?
103     # returns true if this work unit can be canceled
104   end
105
106   def readable?
107     # is the proxied object readable by current user?
108   end
109
110   def uri
111     # returns the uri for this work unit
112   end
113
114   def title
115     # title for the work unit
116   end
117
118   def has_unreadable_children
119     # accept it if you can't understand your own children
120   end
121
122   # view helper methods
123   def link_to_log
124     # display a link to log if present
125   end
126
127   def walltime
128     # return walltime for a running or completed work unit
129   end
130
131   def cputime
132     # return cputime for a running or completed work unit
133   end
134
135   def queuedtime
136     # return queued time if the work unit is queued
137   end
138
139   def is_running?
140     # is the work unit in running state?
141   end
142
143   def is_paused?
144     # is the work unit in paused state?
145   end
146
147   def is_finished?
148     # is the work unit in finished state?
149   end
150
151   def is_failed?
152     # is this work unit in failed state?
153   end
154 end