Class: RightAws::RdsInterface::DescribeDbSecurityGroupsParser

Inherits:
RightAws::RightAWSParser show all
Defined in:
lib/rds/right_rds_interface.rb

Overview


DB Security Groups

Constant Summary

Constants inherited from RightAws::RightAWSParser

RightAws::RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAws::RightAWSParser

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

Instance Method Summary collapse

Methods inherited from RightAws::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

:nodoc:



1347
1348
1349
# File 'lib/rds/right_rds_interface.rb', line 1347

def reset
  @result = { :db_security_groups => [] }
end

#tagend(name) ⇒ Object



1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
# File 'lib/rds/right_rds_interface.rb', line 1357

def tagend(name)
  case name
  when 'Marker'                     then @result[:marker]               = @text
  when 'MaxRecords'                 then @result[:max_records]          = @text.to_i
  when 'DBSecurityGroupDescription' then @item[:description ]           = @text
  when 'OwnerId'                    then @item[:owner_id]               = @text
  when 'DBSecurityGroupName'        then @item[:name]                   = @text
  when 'EC2SecurityGroupId'         then @ec2_security_group[:group_id] = @text
  when 'EC2SecurityGroupName'       then @ec2_security_group[:name]     = @text
  when 'EC2SecurityGroupOwnerId'    then @ec2_security_group[:owner_id] = @text
  when 'CIDRIP'                     then @ip_range[:cidrip]             = @text
  when 'IPRange'                    then @item[:ip_ranges]             << @ip_range
  when 'EC2SecurityGroup'           then @item[:ec2_security_groups]   << @ec2_security_group
  when 'VpcId'                      then @item[:vpc_id]                 = @text
  when 'DBSecurityGroup'
    # Sort the ip_ranges and ec2_security_groups
    @item[:ip_ranges].sort!{ |i1,i2| "#{i1[:cidrip]}" <=> "#{i2[:cidrip]}" }
    @item[:ec2_security_groups].sort!{ |i1,i2| "#{i1[:owner_id]}#{i1[:name]}" <=> "#{i2[:owner_id]}#{i2[:name]}" }
    @result[:db_security_groups] << @item
  else
    case full_tag_name
    when %r{IPRange/Status$}          then @ip_range[:status]           = @text
    when %r{EC2SecurityGroup/Status$} then @ec2_security_group[:status] = @text
    end
  end
end

#tagstart(name, attributes) ⇒ Object



1350
1351
1352
1353
1354
1355
1356
# File 'lib/rds/right_rds_interface.rb', line 1350

def tagstart(name, attributes)
  case name
  when 'DBSecurityGroup'  then @item               = { :ec2_security_groups => [], :ip_ranges => [] }
  when 'IPRange'          then @ip_range           = {}
  when 'EC2SecurityGroup' then @ec2_security_group = {}
  end
end