Class: Elasticity::JobFlow

Inherits:
Object
  • Object
show all
Defined in:
lib/elasticity/job_flow.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeJobFlow

Returns a new instance of JobFlow.



16
17
18
# File 'lib/elasticity/job_flow.rb', line 16

def initialize
  @steps = []
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



9
10
11
# File 'lib/elasticity/job_flow.rb', line 9

def created_at
  @created_at
end

#instance_countObject

Returns the value of attribute instance_count.



12
13
14
# File 'lib/elasticity/job_flow.rb', line 12

def instance_count
  @instance_count
end

#jobflow_idObject

Returns the value of attribute jobflow_id.



6
7
8
# File 'lib/elasticity/job_flow.rb', line 6

def jobflow_id
  @jobflow_id
end

#master_instance_typeObject

Returns the value of attribute master_instance_type.



13
14
15
# File 'lib/elasticity/job_flow.rb', line 13

def master_instance_type
  @master_instance_type
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/elasticity/job_flow.rb', line 5

def name
  @name
end

#ready_atObject

Returns the value of attribute ready_at.



11
12
13
# File 'lib/elasticity/job_flow.rb', line 11

def ready_at
  @ready_at
end

#slave_instance_typeObject

Returns the value of attribute slave_instance_type.



14
15
16
# File 'lib/elasticity/job_flow.rb', line 14

def slave_instance_type
  @slave_instance_type
end

#started_atObject

Returns the value of attribute started_at.



10
11
12
# File 'lib/elasticity/job_flow.rb', line 10

def started_at
  @started_at
end

#stateObject

Returns the value of attribute state.



7
8
9
# File 'lib/elasticity/job_flow.rb', line 7

def state
  @state
end

#stepsObject

Returns the value of attribute steps.



8
9
10
# File 'lib/elasticity/job_flow.rb', line 8

def steps
  @steps
end

Class Method Details

.from_member_element(xml_element) ⇒ Object

Create a jobflow from an AWS <member> (Nokogiri::XML::Element):

/DescribeJobFlowsResponse/DescribeJobFlowsResult/JobFlows/member


24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/elasticity/job_flow.rb', line 24

def from_member_element(xml_element)
  jobflow = JobFlow.new
  jobflow.name = xml_element.xpath("./Name").text.strip
  jobflow.jobflow_id = xml_element.xpath("./JobFlowId").text.strip
  jobflow.state = xml_element.xpath("./ExecutionStatusDetail/State").text.strip
  jobflow.steps = JobFlowStep.from_members_nodeset(xml_element.xpath("./Steps/member"))
  jobflow.created_at = xml_element.xpath("./ExecutionStatusDetail/CreationDateTime").text.strip
  jobflow.started_at = xml_element.xpath("./ExecutionStatusDetail/StartDateTime").text.strip
  jobflow.ready_at = xml_element.xpath("./ExecutionStatusDetail/ReadyDateTime").text.strip
  jobflow.instance_count = xml_element.xpath("./Instances/InstanceCount").text.strip
  jobflow.master_instance_type = xml_element.xpath("./Instances/MasterInstanceType").text.strip
  jobflow.slave_instance_type = xml_element.xpath("./Instances/SlaveInstanceType").text.strip
  jobflow
end

.from_members_nodeset(members_nodeset) ⇒ Object

Create JobFlows from a collection of AWS <member> nodes (Nokogiri::XML::NodeSet):

/DescribeJobFlowsResponse/DescribeJobFlowsResult/JobFlows


41
42
43
44
45
46
47
# File 'lib/elasticity/job_flow.rb', line 41

def from_members_nodeset(members_nodeset)
  jobflows = []
  members_nodeset.each do |member|
    jobflows << from_member_element(member)
  end
  jobflows
end