Class: Elasticity::ClusterStepStatus
- Inherits:
-
Object
- Object
- Elasticity::ClusterStepStatus
- Defined in:
- lib/elasticity/cluster_step_status.rb
Instance Attribute Summary collapse
-
#action_on_failure ⇒ Object
Returns the value of attribute action_on_failure.
-
#args ⇒ Object
Returns the value of attribute args.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#ended_at ⇒ Object
Returns the value of attribute ended_at.
-
#jar ⇒ Object
Returns the value of attribute jar.
-
#main_class ⇒ Object
Returns the value of attribute main_class.
-
#name ⇒ Object
Returns the value of attribute name.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
-
#state ⇒ Object
Returns the value of attribute state.
-
#state_change_reason ⇒ Object
Returns the value of attribute state_change_reason.
-
#state_change_reason_message ⇒ Object
Returns the value of attribute state_change_reason_message.
-
#step_id ⇒ Object
Returns the value of attribute step_id.
Class Method Summary collapse
-
.from_aws_list_data(cluster_step_data) ⇒ Object
Constructed from docs.aws.amazon.com/ElasticMapReduce/latest/API/API_ListSteps.html.
- .installed_steps(cluster_step_statuses) ⇒ Object
Instance Attribute Details
#action_on_failure ⇒ Object
Returns the value of attribute action_on_failure.
5 6 7 |
# File 'lib/elasticity/cluster_step_status.rb', line 5 def action_on_failure @action_on_failure end |
#args ⇒ Object
Returns the value of attribute args.
6 7 8 |
# File 'lib/elasticity/cluster_step_status.rb', line 6 def args @args end |
#created_at ⇒ Object
Returns the value of attribute created_at.
15 16 17 |
# File 'lib/elasticity/cluster_step_status.rb', line 15 def created_at @created_at end |
#ended_at ⇒ Object
Returns the value of attribute ended_at.
17 18 19 |
# File 'lib/elasticity/cluster_step_status.rb', line 17 def ended_at @ended_at end |
#jar ⇒ Object
Returns the value of attribute jar.
7 8 9 |
# File 'lib/elasticity/cluster_step_status.rb', line 7 def jar @jar end |
#main_class ⇒ Object
Returns the value of attribute main_class.
8 9 10 |
# File 'lib/elasticity/cluster_step_status.rb', line 8 def main_class @main_class end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/elasticity/cluster_step_status.rb', line 11 def name @name end |
#properties ⇒ Object
Returns the value of attribute properties.
9 10 11 |
# File 'lib/elasticity/cluster_step_status.rb', line 9 def properties @properties end |
#started_at ⇒ Object
Returns the value of attribute started_at.
16 17 18 |
# File 'lib/elasticity/cluster_step_status.rb', line 16 def started_at @started_at end |
#state ⇒ Object
Returns the value of attribute state.
12 13 14 |
# File 'lib/elasticity/cluster_step_status.rb', line 12 def state @state end |
#state_change_reason ⇒ Object
Returns the value of attribute state_change_reason.
13 14 15 |
# File 'lib/elasticity/cluster_step_status.rb', line 13 def state_change_reason @state_change_reason end |
#state_change_reason_message ⇒ Object
Returns the value of attribute state_change_reason_message.
14 15 16 |
# File 'lib/elasticity/cluster_step_status.rb', line 14 def @state_change_reason_message end |
#step_id ⇒ Object
Returns the value of attribute step_id.
10 11 12 |
# File 'lib/elasticity/cluster_step_status.rb', line 10 def step_id @step_id end |
Class Method Details
.from_aws_list_data(cluster_step_data) ⇒ Object
Constructed from docs.aws.amazon.com/ElasticMapReduce/latest/API/API_ListSteps.html
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/elasticity/cluster_step_status.rb', line 20 def self.from_aws_list_data(cluster_step_data) cluster_step_data['Steps'].map do |s| ClusterStepStatus.new.tap do |c| c.action_on_failure = s['ActionOnFailure'] c.args = s['Config']['Args'] c.jar = s['Config']['Jar'] c.main_class = s['Config']['MainClass'] c.properties = s['Config']['Properties'] c.step_id = s['Id'] c.name = s['Name'] c.state = s['Status']['State'] c.state_change_reason = s['Status']['StateChangeReason']['Code'] c. = s['Status']['StateChangeReason']['Message'] c.created_at = Time.at(s['Status']['Timeline']['CreationDateTime']) c.started_at = s['Status']['Timeline']['StartDateTime'] ? Time.at(s['Status']['Timeline']['StartDateTime']) : nil c.ended_at = s['Status']['Timeline']['EndDateTime'] ? Time.at(s['Status']['Timeline']['EndDateTime']) : nil end end end |
.installed_steps(cluster_step_statuses) ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/elasticity/cluster_step_status.rb', line 40 def self.installed_steps(cluster_step_statuses) step_names = cluster_step_statuses.map(&:name) installed_steps = [] Elasticity::JobFlowStep.steps_requiring_installation.each do |step| installed_steps << step if step_names.include?(step.aws_installation_step_name) end installed_steps end |