Class: ForemanPatch::Invocation
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- ForemanPatch::Invocation
- Includes:
- ForemanTasks::Concerns::ActionSubject
- Defined in:
- app/models/foreman_patch/invocation.rb
Defined Under Namespace
Classes: Jail
Instance Method Summary collapse
- #complete? ⇒ Boolean
- #events ⇒ Object
- #failed? ⇒ Boolean
- #phases ⇒ Object
- #success? ⇒ Boolean
- #to_action_input ⇒ Object
- #warning? ⇒ Boolean
Instance Method Details
#complete? ⇒ Boolean
37 38 39 |
# File 'app/models/foreman_patch/invocation.rb', line 37 def complete? ['success', 'warning', 'failed', 'cancelled'].include? status end |
#events ⇒ Object
33 34 35 |
# File 'app/models/foreman_patch/invocation.rb', line 33 def events task&.main_action&.live_output || [] end |
#failed? ⇒ Boolean
45 46 47 |
# File 'app/models/foreman_patch/invocation.rb', line 45 def failed? status == 'error' end |
#phases ⇒ Object
29 30 31 |
# File 'app/models/foreman_patch/invocation.rb', line 29 def phases task&.main_action&.planned_actions || [] end |
#success? ⇒ Boolean
49 50 51 |
# File 'app/models/foreman_patch/invocation.rb', line 49 def success? status == 'success' end |
#to_action_input ⇒ Object
53 54 55 56 57 58 |
# File 'app/models/foreman_patch/invocation.rb', line 53 def to_action_input { id: id, name: host.name } end |
#warning? ⇒ Boolean
41 42 43 |
# File 'app/models/foreman_patch/invocation.rb', line 41 def warning? status == 'warning' end |