Class: Aws::Ec2::QEc2DescribeSecurityGroupsParser

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

Overview

:nodoc:

Constant Summary

Constants inherited from AwsParser

AwsParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from AwsParser

#result, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from AwsParser

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

Constructor Details

This class inherits a constructor from Aws::AwsParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Aws::AwsParser

Instance Method Details

#resetObject



1421
1422
1423
# File 'lib/ec2/right_ec2.rb', line 1421

def reset
  @result = []
end

#tagend(name) ⇒ Object



1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
# File 'lib/ec2/right_ec2.rb', line 1396

def tagend(name)
  case name
    when 'ownerId'          then @group.ownerId   = @text
    when 'groupDescription' then @group.groupDescription = @text
    when 'groupName'
      if @xmlpath=='DescribeSecurityGroupsResponse/securityGroupInfo/item'
        @group.groupName  = @text
      elsif @xmlpath=='DescribeSecurityGroupsResponse/securityGroupInfo/item/ipPermissions/item/groups/item'
        @sgroup.groupName = @text
      end
    when 'ipProtocol'       then @perm.ipProtocol = @text
    when 'fromPort'         then @perm.fromPort   = @text
    when 'toPort'           then @perm.toPort     = @text
    when 'userId'           then @sgroup.userId   = @text
    when 'cidrIp'           then @perm.ipRanges  << @text
    when 'item'
      if @xmlpath=='DescribeSecurityGroupsResponse/securityGroupInfo/item/ipPermissions/item/groups'
        @perm.groups << @sgroup
      elsif @xmlpath=='DescribeSecurityGroupsResponse/securityGroupInfo/item/ipPermissions'
        @group.ipPermissions << @perm
      elsif @xmlpath=='DescribeSecurityGroupsResponse/securityGroupInfo'
        @result << @group
      end
  end
end

#tagstart(name, attributes) ⇒ Object



1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
# File 'lib/ec2/right_ec2.rb', line 1381

def tagstart(name, attributes)
  case name
    when 'item'
      if @xmlpath=='DescribeSecurityGroupsResponse/securityGroupInfo'
        @group = QEc2SecurityGroupItemType.new
        @group.ipPermissions = []
      elsif @xmlpath=='DescribeSecurityGroupsResponse/securityGroupInfo/item/ipPermissions'
        @perm = QEc2IpPermissionType.new
        @perm.ipRanges = []
        @perm.groups   = []
      elsif @xmlpath=='DescribeSecurityGroupsResponse/securityGroupInfo/item/ipPermissions/item/groups'
        @sgroup = QEc2UserIdGroupPairType.new
      end
  end
end