Class: RightAws::Ec2::QEc2RunInstancesParser

Inherits:
RightAWSParser show all
Defined in:
lib/ec2/right_ec2.rb

Overview

:nodoc:

Constant Summary

Constants inherited from RightAWSParser

RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAWSParser

#result, #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



1125
1126
1127
# File 'lib/ec2/right_ec2.rb', line 1125

def reset
  @result = []
end

#tagend(name) ⇒ Object



1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
# File 'lib/ec2/right_ec2.rb', line 1103

def tagend(name)
  case name 
    when 'reservationId' ; @reservation.reservationId   = @text
    when 'ownerId'       ; @reservation.ownerId         = @text
    when 'groupId'       ; @reservation.groupSet       << @text
    when 'instanceId'    ; @instance.instanceId         = @text
    when 'imageId'       ; @instance.imageId            = @text
    when 'dnsName'       ; @instance.dnsName            = @text
    when 'privateDnsName'; @instance.privateDnsName     = @text
    when 'reason'        ; @instance.reason             = @text
    when 'keyName'       ; @instance.keyName            = @text
    when 'amiLaunchIndex'; @instance.amiLaunchIndex     = @text
    when 'code'          ; @instance.instanceState.code = @text
    when 'name'          ; @instance.instanceState.name = @text
    when 'item'          
      @reservation.instancesSet << @instance if @xmlpath == 'RunInstancesResponse/instancesSet'
    when 'RunInstancesResponse'; @result << @reservation
    when 'productCode'   ; (@instance.productCodes ||= []) << @text
    when 'instanceType'  ; @instance.instanceType = @text
	  when 'launchTime'    ; @instance.launchTime = @text
  end
end

#tagstart(name, attributes) ⇒ Object



1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
# File 'lib/ec2/right_ec2.rb', line 1084

def tagstart(name, attributes)
  case name
    when 'RunInstancesResponse'
      @reservation = QEc2DescribeInstancesType.new 
      @reservation.groupSet     = []
      @reservation.instancesSet = []
    when 'item'
      if @xmlpath == 'RunInstancesResponse/instancesSet'
        @instance = QEc2RunningInstancesItemType.new
          # the optional params (sometimes are missing and we dont want them to be nil) 
        @instance.reason         = ''
        @instance.dnsName        = ''
        @instance.privateDnsName = ''
        @instance.amiLaunchIndex = ''
        @instance.keyName        = ''
        @instance.instanceState  = QEc2InstanceStateType.new
      end
   end
end