2011-07-13 17:18:58 -04:00
|
|
|
require 'fog/core/collection'
|
2011-09-27 11:03:11 -04:00
|
|
|
require 'fog/aws/models/elasticache/security_group'
|
2011-07-13 17:18:58 -04:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module AWS
|
2011-09-27 11:03:11 -04:00
|
|
|
class Elasticache
|
2011-07-13 17:18:58 -04:00
|
|
|
|
|
|
|
class SecurityGroups < Fog::Collection
|
2011-09-27 11:03:11 -04:00
|
|
|
model Fog::AWS::Elasticache::SecurityGroup
|
2011-07-13 17:18:58 -04:00
|
|
|
|
|
|
|
def all
|
2011-09-02 12:49:21 -04:00
|
|
|
load(
|
|
|
|
connection.describe_cache_security_groups.body['CacheSecurityGroups']
|
|
|
|
)
|
2011-07-13 17:18:58 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def get(identity)
|
2011-09-02 12:49:21 -04:00
|
|
|
new(
|
|
|
|
connection.describe_cache_security_groups(
|
|
|
|
'CacheSecurityGroupName' => identity
|
|
|
|
).body['CacheSecurityGroups'].first
|
|
|
|
)
|
2011-09-27 11:03:11 -04:00
|
|
|
rescue Fog::AWS::Elasticache::NotFound
|
2011-07-13 17:18:58 -04:00
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|