1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00

Merge pull request #96 from fcheung/elasticache_config_endpoint

Parse elasticache configuration endpoint from response
This commit is contained in:
Wesley Beary 2015-04-27 10:43:10 -05:00
commit 3958e09ba5
2 changed files with 16 additions and 3 deletions

View file

@ -23,6 +23,7 @@ module Fog
attribute :cache_subnet_group_name, :aliases => 'CacheSubnetGroupName' attribute :cache_subnet_group_name, :aliases => 'CacheSubnetGroupName'
attribute :vpc_security_groups, :aliases => 'VpcSecurityGroups', :type => :array attribute :vpc_security_groups, :aliases => 'VpcSecurityGroups', :type => :array
attribute :s3_snapshot_location, :aliases => 'SnapshotArns', :type => :array attribute :s3_snapshot_location, :aliases => 'SnapshotArns', :type => :array
attribute :configuration_endpoint, :aliases => 'ConfigurationEndpoint'
attr_accessor :parameter_group_name attr_accessor :parameter_group_name

View file

@ -14,7 +14,8 @@ module Fog
@cache_cluster = { @cache_cluster = {
'CacheSecurityGroups' => [], 'CacheSecurityGroups' => [],
'CacheNodes' => [], 'CacheNodes' => [],
'CacheParameterGroup' => {} 'CacheParameterGroup' => {},
'ConfigurationEndpoint' => {}
} }
end end
@ -24,6 +25,7 @@ module Fog
when 'CacheSecurityGroup'; then @security_group = {} when 'CacheSecurityGroup'; then @security_group = {}
when 'CacheNode'; then @cache_node = {} when 'CacheNode'; then @cache_node = {}
when 'PendingModifiedValues'; then @pending_values = {} when 'PendingModifiedValues'; then @pending_values = {}
when 'ConfigurationEndpoint'; then @configuration_endpoint = {}
end end
end end
@ -49,6 +51,8 @@ module Fog
@cache_cluster[name] = DateTime.parse(value) @cache_cluster[name] = DateTime.parse(value)
when 'CacheSecurityGroup' when 'CacheSecurityGroup'
@cache_cluster["#{name}s"] << @security_group unless @security_group.empty? @cache_cluster["#{name}s"] << @security_group unless @security_group.empty?
when 'ConfigurationEndpoint'
@cache_cluster['ConfigurationEndpoint'] = @configuration_endpoint
when 'CacheSecurityGroupName', 'Status', 'CacheSubnetGroupName' when 'CacheSecurityGroupName', 'Status', 'CacheSubnetGroupName'
@cache_cluster[name] = value @cache_cluster[name] = value
when 'CacheNode' when 'CacheNode'
@ -57,8 +61,16 @@ module Fog
when'PendingModifiedValues' when'PendingModifiedValues'
@cache_cluster[name] = @pending_values @cache_cluster[name] = @pending_values
@pending_values = nil @pending_values = nil
when 'CacheNodeCreateTime', 'CacheNodeStatus', 'Address', when 'Port', 'Address'
'ParameterGroupStatus', 'Port', 'CacheNodeId' if @cache_node
@cache_node[name] = value ? value.strip : name
elsif @pending_values
@pending_values[name] = value ? value.strip : name
elsif @configuration_endpoint
@configuration_endpoint[name] = value ? value.strip : name
end
when 'CacheNodeCreateTime', 'CacheNodeStatus',
'ParameterGroupStatus', 'CacheNodeId'
if @cache_node if @cache_node
@cache_node[name] = value ? value.strip : name @cache_node[name] = value ? value.strip : name
elsif @pending_values elsif @pending_values