Class: RightAws::RdsInterface::DescribeDbInstancesParser

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

Overview


DB Instances

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:



1051
1052
1053
# File 'lib/rds/right_rds_interface.rb', line 1051

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

#tagend(name) ⇒ Object



1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
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 1062

def tagend(name)
  case name
  when 'Marker'                                then @result[:marker]               = @text
  when 'MaxRecords'                            then @result[:max_records]          = @text.to_i
  when 'DBInstanceIdentifier'                  then @item[:aws_id]                 = @text
  when 'InstanceCreateTime'                    then @item[:create_time]            = @text
  when 'Engine'                                then @item[:engine]                 = @text
  when 'DBInstanceStatus'                      then @item[:status]                 = @text
  when 'Address'                               then @item[:endpoint_address]       = @text
  when 'Port'                                  then @item[:endpoint_port]          = @text.to_i
  when 'MasterUsername'                        then @item[:master_username]        = @text
  when 'AvailabilityZone'                      then @item[:availability_zone]      = @text
  when 'LatestRestorableTime'                  then @item[:latest_restorable_time] = @text
  when 'LicenseModel'                          then @item[:license_model]          = @text
  when 'DBName'                                then @item[:db_name]                = @text
  when 'ReadReplicaSourceDBInstanceIdentifier' then @item[:read_replica_source_db_instance_identifier] = @text
  when 'ReadReplicaDBInstanceIdentifier'       then @item[:read_replica_db_instance_identifiers]      << @text
  when 'DBSecurityGroupName'                   then @db_security_group[:name]             = @text
  when 'Status'                                then @db_security_group[:status]           = @text
  when 'DBParameterGroupName'                  then @db_parameter_group[:name]            = @text
  when 'ParameterApplyStatus'                  then @db_parameter_group[:status]          = @text
  when 'DBSecurityGroup'                       then @item[:db_security_groups] << @db_security_group
  when 'DBParameterGroup',
       'DBParameterGroupStatus'                then @item[:db_parameter_group] = @db_parameter_group
  when 'DBInstance'                            then @result[:db_instances]            << @item
  else
    case full_tag_name
    when %r{DBInstance/DBInstanceClass$}                       then @item[:instance_class]               = @text
    when %r{DBInstance/AllocatedStorage$}                      then @item[:allocated_storage]            = @text.to_i
    when %r{DBInstance/MultiAZ$}                               then @item[:multi_az]                     = (@text == 'true')
    when %r{DBInstance/BackupRetentionPeriod$}                 then @item[:backup_retention_period]      = @text.to_i
    when %r{DBInstance/PreferredMaintenanceWindow$}            then @item[:preferred_maintenance_window] = @text
    when %r{DBInstance/PreferredBackupWindow$}                 then @item[:preferred_backup_window]      = @text
    when %r{DBInstance/EngineVersion$}                         then @item[:engine_version]               = @text
    when %r{DBInstance/AutoMinorVersionUpgrade$}               then @item[:auto_minor_version_upgrade]   = (@text == 'true')
    when %r{DBInstance/AllowMajorVersionUpgrade$}              then @item[:allow_major_version_upgrade]  = (@text == 'true')
    when %r{PendingModifiedValues/DBInstanceClass$}            then @item[:pending_modified_values][:instance_class]               = @text
    when %r{PendingModifiedValues/AllocatedStorage$}           then @item[:pending_modified_values][:allocated_storage]            = @text.to_i
    when %r{PendingModifiedValues/MasterUserPassword$}         then @item[:pending_modified_values][:master_user_password]         = @text
    when %r{PendingModifiedValues/MultiAZ$}                    then @item[:pending_modified_values][:multi_az]                     = (@text == 'true')
    when %r{PendingModifiedValues/BackupRetentionPeriod$}      then @item[:pending_modified_values][:backup_retention_period]      = @text.to_i
    when %r{PendingModifiedValues/PreferredMaintenanceWindow$} then @item[:pending_modified_values][:preferred_maintenance_window] = @text
    when %r{PendingModifiedValues/PreferredBackupWindow$}      then @item[:pending_modified_values][:preferred_backup_window]      = @text
    when %r{PendingModifiedValues/EngineVersion$}              then @item[:pending_modified_values][:engine_version]               = @text
    when %r{PendingModifiedValues/AutoMinorVersionUpgrade$}    then @item[:pending_modified_values][:auto_minor_version_upgrade]   = (@text == 'true')
    when %r{PendingModifiedValues/AllowMajorVersionUpgrade$}   then @item[:pending_modified_values][:allow_major_version_upgrade]  = (@text == 'true')
    end
  end
end

#tagstart(name, attributes) ⇒ Object



1054
1055
1056
1057
1058
1059
1060
1061
# File 'lib/rds/right_rds_interface.rb', line 1054

def tagstart(name, attributes)
  case name
  when 'DBInstance'             then @item = { :db_security_groups => [], :pending_modified_values => {}, :read_replica_db_instance_identifiers => [] }
  when 'DBSecurityGroup'        then @db_security_group = {}
  when 'DBParameterGroup',
       'DBParameterGroupStatus' then @db_parameter_group = {}
  end
end