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:



1143
1144
1145
# File 'lib/rds/right_rds_interface.rb', line 1143

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

#tagend(name) ⇒ Object



1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
# File 'lib/rds/right_rds_interface.rb', line 1153

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



1146
1147
1148
1149
1150
1151
1152
# File 'lib/rds/right_rds_interface.rb', line 1146

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