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

[aws|elasticache] implement describe_cache_groups request

This commit is contained in:
Benton Roberts 2011-09-26 10:39:34 -04:00 committed by geemus
parent e6a7bff3fb
commit a73c5937bc
5 changed files with 69 additions and 4 deletions

View file

@ -22,7 +22,7 @@ module Fog
request :modify_cache_parameter_group
request :reset_cache_parameter_group
request :describe_engine_default_parameters
#request :describe_cache_parameters
request :describe_cache_parameters
request :create_cache_security_group
request :delete_cache_security_group

View file

@ -0,0 +1,22 @@
module Fog
module Parsers
module AWS
module Elasticache
require 'fog/aws/parsers/elasticache/engine_defaults_parser'
class DescribeCacheParameters < EngineDefaultsParser
def end_element(name)
case name
when 'DescribeCacheParametersResult'
@response[name] = @engine_defaults
reset_engine_defaults
else
super
end
end
end
end
end
end
end

View file

@ -0,0 +1,36 @@
module Fog
module AWS
class Elasticache
class Real
require 'fog/aws/parsers/elasticache/describe_cache_parameters'
# Returns a list of CacheParameterGroup descriptions
#
# === Parameters (optional)
# * name <~String> - The name of an existing cache parameter group
# * options <~Hash> (optional):
# * :marker <~String> - marker provided in the previous request
# * :max_records <~Integer> - the maximum number of records to include
# * :source <~String> - the parameter types to return.
def describe_cache_parameters(name = nil, options = {})
request({
'Action' => 'DescribeCacheParameters',
'CacheParameterGroupName' => name,
'Marker' => options[:marker],
'MaxRecords' => options[:max_records],
'Source' => options[:source],
:parser => Fog::Parsers::AWS::Elasticache::DescribeCacheParameters.new
})
end
end
class Mock
def describe_cache_parameters(name = nil, options = {})
Fog::Mock.not_implemented
end
end
end
end
end

View file

@ -25,12 +25,11 @@ class AWS
SINGLE_PARAMETER_GROUP = BASIC.merge('CacheParameterGroup' => PARAMETER_GROUP)
DESCRIBE_PARAMETER_GROUPS = BASIC.merge('CacheParameterGroups' => [PARAMETER_GROUP])
MODIFY_PARAMETER_GROUP = {'CacheParameterGroupName' => String }
ENGINE_DEFAULTS = {
'CacheParameterGroupFamily' => String,
PARAMETER_SET = {
'Parameters' => Array,
'CacheNodeTypeSpecificParameters' => Array,
}
ENGINE_DEFAULTS = PARAMETER_SET.merge('CacheParameterGroupFamily' => String)
# Cache Clusters - more parameters get added as the lifecycle progresses
CACHE_CLUSTER = {
'AutoMinorVersionUpgrade' => String, # actually TrueClass or FalseClass

View file

@ -26,6 +26,14 @@ Shindo.tests('AWS::Elasticache | parameter group requests', ['aws', 'elasticache
body
end
tests(
'#describe_cache_parameters'
).formats(AWS::Elasticache::Formats::PARAMETER_SET) do
response = AWS[:elasticache].describe_cache_parameters(name)
parameter_set = response.body['DescribeCacheParametersResult']
parameter_set
end
tests(
'#describe_cache_parameter_groups without options'
).formats(AWS::Elasticache::Formats::DESCRIBE_PARAMETER_GROUPS) do