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:



1077
1078
1079
# File 'lib/rds/right_rds_interface.rb', line 1077

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

#tagend(name) ⇒ Object



1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
# File 'lib/rds/right_rds_interface.rb', line 1087

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 '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 '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



1080
1081
1082
1083
1084
1085
1086
# File 'lib/rds/right_rds_interface.rb', line 1080

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