mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|acs] Update CacheSecurityGroup API to public beta 2011-07-15
This commit is contained in:
parent
580d49e8ff
commit
8b1e2f5199
6 changed files with 7 additions and 7 deletions
|
@ -55,7 +55,7 @@ module Fog
|
||||||
options[:region] ||= 'us-east-1'
|
options[:region] ||= 'us-east-1'
|
||||||
@host = options[:host] || case options[:region]
|
@host = options[:host] || case options[:region]
|
||||||
when 'us-east-1'
|
when 'us-east-1'
|
||||||
'acsvc.us-east-1.amazonaws.com'
|
'elasticache.us-east-1.amazonaws.com'
|
||||||
#TODO: Support other regions
|
#TODO: Support other regions
|
||||||
else
|
else
|
||||||
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
||||||
|
@ -105,7 +105,7 @@ module Fog
|
||||||
when 'CacheSecurityGroupAlreadyExists'
|
when 'CacheSecurityGroupAlreadyExists'
|
||||||
raise Fog::AWS::ACS::IdentifierTaken
|
raise Fog::AWS::ACS::IdentifierTaken
|
||||||
when 'InvalidParameterValue'
|
when 'InvalidParameterValue'
|
||||||
raise Fog::AWS::ACE::InvalidInstance
|
raise Fog::AWS::ACS::InvalidInstance
|
||||||
else
|
else
|
||||||
raise
|
raise
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ module Fog
|
||||||
class SecurityGroup < Fog::Model
|
class SecurityGroup < Fog::Model
|
||||||
|
|
||||||
identity :id, :aliases => 'CacheSecurityGroupName'
|
identity :id, :aliases => 'CacheSecurityGroupName'
|
||||||
attribute :description, :aliases => 'CacheSecurityGroupDescription'
|
attribute :description, :aliases => 'Description'
|
||||||
attribute :ec2_groups, :aliases => 'EC2SecurityGroups', :type => :array
|
attribute :ec2_groups, :aliases => 'EC2SecurityGroups', :type => :array
|
||||||
attribute :owner_id, :aliases => 'OwnerId'
|
attribute :owner_id, :aliases => 'OwnerId'
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Fog
|
||||||
|
|
||||||
def end_element(name)
|
def end_element(name)
|
||||||
case name
|
case name
|
||||||
when 'CacheSecurityGroupDescription', 'CacheSecurityGroupName', 'OwnerId'
|
when 'Description', 'CacheSecurityGroupName', 'OwnerId'
|
||||||
@security_group[name] = value
|
@security_group[name] = value
|
||||||
when 'EC2SecurityGroup'
|
when 'EC2SecurityGroup'
|
||||||
@security_group["#{name}s"] << @ec2_group unless @ec2_group.empty?
|
@security_group["#{name}s"] << @ec2_group unless @ec2_group.empty?
|
||||||
|
|
|
@ -17,7 +17,7 @@ module Fog
|
||||||
request({
|
request({
|
||||||
'Action' => 'CreateCacheSecurityGroup',
|
'Action' => 'CreateCacheSecurityGroup',
|
||||||
'CacheSecurityGroupName' => name,
|
'CacheSecurityGroupName' => name,
|
||||||
'CacheSecurityGroupDescription' => description,
|
'Description' => description,
|
||||||
:parser => Fog::Parsers::AWS::ACS::SingleSecurityGroup.new
|
:parser => Fog::Parsers::AWS::ACS::SingleSecurityGroup.new
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ class AWS
|
||||||
SECURITY_GROUP = {
|
SECURITY_GROUP = {
|
||||||
'EC2SecurityGroups' => Array,
|
'EC2SecurityGroups' => Array,
|
||||||
'CacheSecurityGroupName' => String,
|
'CacheSecurityGroupName' => String,
|
||||||
'CacheSecurityGroupDescription' => String,
|
'Description' => String,
|
||||||
'OwnerId' => String
|
'OwnerId' => String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ Shindo.tests('AWS::ACS | security group requests', ['aws', 'acs']) do
|
||||||
body = AWS[:acs].create_cache_security_group(name, description).body
|
body = AWS[:acs].create_cache_security_group(name, description).body
|
||||||
group = body['CacheSecurityGroup']
|
group = body['CacheSecurityGroup']
|
||||||
returns(name) { group['CacheSecurityGroupName'] }
|
returns(name) { group['CacheSecurityGroupName'] }
|
||||||
returns(description) { group['CacheSecurityGroupDescription'] }
|
returns(description) { group['Description'] }
|
||||||
returns([], "no authorized security group") { group['EC2SecurityGroups'] }
|
returns([], "no authorized security group") { group['EC2SecurityGroups'] }
|
||||||
body
|
body
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue