Class: ForemanAnsibleDirector::Parsers::Proxy::Dynflow::TaskStatusParser
- Inherits:
-
DynflowResponse
- Object
- DynflowResponse
- ForemanAnsibleDirector::Parsers::Proxy::Dynflow::TaskStatusParser
show all
- Defined in:
- app/lib/foreman_ansible_director/parsers/proxy/dynflow/task_status_parser.rb
Constant Summary
collapse
- SCHEDULED =
'scheduled'
- STOPPED =
'stopped'
- PAUSED =
'paused'
- PENDING =
'pending'
- SUCCESS =
'success'
- ERROR =
'error'
- FINISHED_STATES =
[STOPPED].freeze
- SUCCESS_STATES =
[SUCCESS].freeze
Instance Attribute Summary
#raw_response
Instance Method Summary
collapse
#initialize
Instance Method Details
#external_output ⇒ Object
32
33
34
35
36
37
38
39
|
# File 'app/lib/foreman_ansible_director/parsers/proxy/dynflow/task_status_parser.rb', line 32
def external_output
build_action = @parsed_response['actions'][1]
build_action['output']
end
|
#progress ⇒ Object
27
28
29
30
|
# File 'app/lib/foreman_ansible_director/parsers/proxy/dynflow/task_status_parser.rb', line 27
def progress
return 1 if task_completed?
0
end
|
#success? ⇒ Boolean
23
24
25
|
# File 'app/lib/foreman_ansible_director/parsers/proxy/dynflow/task_status_parser.rb', line 23
def success?
SUCCESS_STATES.include? @parsed_response['result']
end
|
#task_completed? ⇒ Boolean
19
20
21
|
# File 'app/lib/foreman_ansible_director/parsers/proxy/dynflow/task_status_parser.rb', line 19
def task_completed?
FINISHED_STATES.include? @parsed_response['state']
end
|