mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
Parse elasticache configuration endpoint from response
This commit is contained in:
parent
377d74b0ca
commit
9f0ba1ce30
2 changed files with 16 additions and 3 deletions
|
@ -23,6 +23,7 @@ module Fog
|
|||
attribute :cache_subnet_group_name, :aliases => 'CacheSubnetGroupName'
|
||||
attribute :vpc_security_groups, :aliases => 'VpcSecurityGroups', :type => :array
|
||||
attribute :s3_snapshot_location, :aliases => 'SnapshotArns', :type => :array
|
||||
attribute :configuration_endpoint, :aliases => 'ConfigurationEndpoint'
|
||||
|
||||
attr_accessor :parameter_group_name
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@ module Fog
|
|||
@cache_cluster = {
|
||||
'CacheSecurityGroups' => [],
|
||||
'CacheNodes' => [],
|
||||
'CacheParameterGroup' => {}
|
||||
'CacheParameterGroup' => {},
|
||||
'ConfigurationEndpoint' => {}
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -24,6 +25,7 @@ module Fog
|
|||
when 'CacheSecurityGroup'; then @security_group = {}
|
||||
when 'CacheNode'; then @cache_node = {}
|
||||
when 'PendingModifiedValues'; then @pending_values = {}
|
||||
when 'ConfigurationEndpoint'; then @configuration_endpoint = {}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -49,6 +51,8 @@ module Fog
|
|||
@cache_cluster[name] = DateTime.parse(value)
|
||||
when 'CacheSecurityGroup'
|
||||
@cache_cluster["#{name}s"] << @security_group unless @security_group.empty?
|
||||
when 'ConfigurationEndpoint'
|
||||
@cache_cluster['ConfigurationEndpoint'] = @configuration_endpoint
|
||||
when 'CacheSecurityGroupName', 'Status', 'CacheSubnetGroupName'
|
||||
@cache_cluster[name] = value
|
||||
when 'CacheNode'
|
||||
|
@ -57,8 +61,16 @@ module Fog
|
|||
when'PendingModifiedValues'
|
||||
@cache_cluster[name] = @pending_values
|
||||
@pending_values = nil
|
||||
when 'CacheNodeCreateTime', 'CacheNodeStatus', 'Address',
|
||||
'ParameterGroupStatus', 'Port', 'CacheNodeId'
|
||||
when 'Port', 'Address'
|
||||
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
|
||||
@cache_node[name] = value ? value.strip : name
|
||||
elsif @pending_values
|
||||
|
|
Loading…
Reference in a new issue