Class: RightAws::EmrInterface::DescribeJobFlowsParser

Inherits:
RightAWSParser
  • Object
show all
Defined in:
lib/emr/right_emr_interface.rb

Overview


PARSERS: Describe Job Flows

Constant Summary

Constants inherited from RightAWSParser

RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAWSParser

#full_tag_name, #result, #tag, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from RightAWSParser

#initialize, #method_missing, #parse, #tag_end, #tag_start, #tagtext, #text, xml_lib, xml_lib=

Constructor Details

This class inherits a constructor from RightAws::RightAWSParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightAws::RightAWSParser

Instance Method Details

#resetObject



707
708
709
# File 'lib/emr/right_emr_interface.rb', line 707

def reset
  @result = []
end

#tagend(name) ⇒ Object



617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
# File 'lib/emr/right_emr_interface.rb', line 617

def tagend(name)
  case full_tag_name
  when %r{/BootstrapActionConfig} # no trailing $
    case name
    when 'Name'
      @bootstrap_action[:name] = @text
    when 'ScriptBootstrapAction'
      @bootstrap_action[:script_bootstrap_action] = @text
    when 'BootstrapActionConfig'
      @step[:bootstrap_actions] << @bootstrap_action
    end
  when %r{/InstanceGroups/member} # no trailing $
    case name
    when 'BidPrice' then @instance_group[:bid_price] = @text
    when 'CreationDateTime' then @instance_group[:creation_date_time] = @text
    when 'EndDateTime' then @instance_group[:end_date_time] = @text
    when 'InstanceGroupId' then @instance_group[:instance_group_id] = @text
    when 'InstanceRequestCount' then @instance_group[:instance_request_count] = @text.to_i
    when 'InstanceRole' then @instance_group[:instance_role] = @text
    when 'InstanceRunningCount' then @instance_group[:instance_running_count] = @text.to_i
    when 'InstanceType' then @instance_group[:instance_type] = @text
    when 'LastStateChangeReason' then @instance_group[:last_state_change_reason] = @text
    when 'Market' then @instance_group[:market] = @text
    when 'Name' then @instance_group[:name] = @text
    when 'ReadyDateTime' then @instance_group[:ready_date_time] = @text
    when 'StartDateTime' then @instance_group[:start_date_time] = @text
    when 'State' then @instance_group[:state] = @text
    when 'member' then @item[:instance_groups]        << @instance_group
    end
  when %r{/Steps/member/StepConfig/HadoopJarStep/Args/member}
    @step[:args] << @text
  when %r{/Steps/member/StepConfig/HadoopJarStep/Properties$}
      @step[:properties][@key] = @value
  when %r{/Steps/member/StepConfig/HadoopJarStep/Properties}
    case name
    when 'Key'
      @key = @text
    when 'Value'
      @value = @text
    end
  when %r{/Steps/member$}
    @item[:steps] << @step
  when %r{/Steps/member} # no trailing $
    case name
    # ExecutionStatusDetail
    when 'CreationDateTime' then @step[:creation_date_time] = @text
    when 'EndDateTime' then @step[:end_date_time] = @text
    when 'LastStateChangeReason' then @step[:last_state_change_reason] = @text
    when 'StartDateTime' then @step[:start_date_time] = @text
    when 'State' then @step[:state] = @text
    # StepConfig
    when 'ActionOnFailure' then @step[:action_on_failure] = @text
    when 'Name' then @step[:name] = @text
    # HadoopJarStepConfig
    when 'Jar' then @step[:jar] = @text
    when 'MainClass' then @step[:main_class] = @text
    end
  when %r{/JobFlows/member$}
    @result << @item
  else
    case name
    when 'AmiVersion' then @item[:ami_version] = @text
    when 'JobFlowId' then @item[:job_flow_id] = @text
    when 'LogUri' then @item[:log_uri] = @text
    when 'Name' then @item[:name] = @text
    
    # JobFlowExecutionStatusDetail
    when 'CreationDateTime' then @item[:creation_date_time] = @text
    when 'EndDateTime' then @item[:end_date_time] = @text
    when 'LastStateChangeReason' then @item[:last_state_change_reason] = @text
    when 'ReadyDateTime' then @item[:ready_date_time] = @text
    when 'StartDateTime' then @item[:start_date_time] = @text
    when 'State' then @item[:state] = @text
    
    # JobFlowInstancesDetail
    when 'Ec2KeyName' then @item[:ec2_key_name] = @text
    when 'HadoopVersion' then @item[:hadoop_version] = @text
    when 'InstanceCount' then @item[:instance_count] = @text.to_i
    when 'KeepJobFlowAliveWhenNoSteps' then @item[:keep_job_flow_alive_when_no_steps] = case @text when 'true' then true when 'false' then false else @text end
    when 'MasterInstanceId' then @item[:master_instance_id] = @text
    when 'MasterInstanceType' then @item[:master_instance_type] = @text
    when 'MasterPublicDnsName' then @item[:master_public_dns_name] = @text
    when 'NormalizedInstanceHours' then @item[:normalized_instance_hours] = @text.to_i
    # Placement
    when 'AvailabilityZone' then @item[:availability_zone] = @text
    when 'SlaveInstanceType' then @item[:slave_instance_type] = @text
    when 'TerminationProtected' then @item[:termination_protected] = case @text when 'true' then true when 'false' then false else @text end
    end
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
# File 'lib/emr/right_emr_interface.rb', line 602

def tagstart(name, attributes)
  case full_tag_name
  when %r{/JobFlows/member$}
    @item = { :instance_groups => [],
              :steps       => [],
              :bootstrap_actions => [] }
  when %r{/BootstrapActionConfig$}
    @bootstrap_action = {}
  when %r{/InstanceGroups/member$}
    @instance_group = {}
  when %r{/Steps/member$}
    @step = { :args => [],
              :properties => {} }
  end
end