Sha256: 2b6879a8b63bede3d1e6efdabbf044d650d7b215e91c52a4612d4244947740d6

Contents?: true

Size: 1.99 KB

Versions: 98

Compression:

Stored size: 1.99 KB

Contents

module Fog
  module AWS
    class Elasticache
      class Real
        require 'fog/aws/parsers/elasticache/describe_cache_subnet_groups'

        # This API returns a list of CacheSubnetGroup descriptions. If a CacheSubnetGroupName is specified, the list will contain only
        # the descriptions of the specified CacheSubnetGroup
        # http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_DescribeCacheSubnetGroups.html
        # ==== Parameters
        # * CacheSubnetGroupName <~String> - The name of a specific database subnet group to return details for.
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        def describe_cache_subnet_groups(name = nil, opts = {})
          params = {}
          if opts[:marker]
            params['Marker'] = opts[:marker]
          end
          if name
            params['CacheSubnetGroupName'] = name
          end
          if opts[:max_records]
            params['MaxRecords'] = opts[:max_records]
          end

          request({
            'Action'  => 'DescribeCacheSubnetGroups',
            :parser   => Fog::Parsers::AWS::Elasticache::DescribeCacheSubnetGroups.new
          }.merge(params))
        end
      end

      class Mock
        def describe_cache_subnet_groups(name = nil, opts = {})
          response = Excon::Response.new

          subnet_group_set = []
          if name
            if subnet_group = self.data[:subnet_groups][name]
              subnet_group_set << subnet_group
            else
              raise Fog::AWS::Elasticache::NotFound.new("Subnet Group #{name} not found")
            end
          else
            subnet_group_set = self.data[:subnet_groups].values
          end

          response.status = 200
          response.body = {
            "ResponseMetadata"=>{ "RequestId"=> Fog::AWS::Mock.request_id },
            "DescribeCacheSubnetGroupsResult" => { "CacheSubnetGroups" => subnet_group_set }
          }
          response
        end
      end
    end
  end
end

Version data entries

98 entries across 96 versions & 6 rubygems

Version Path
fog-aws-3.30.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.29.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.28.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.27.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.26.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.25.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.24.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.23.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.22.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.21.1 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.21.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.20.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.19.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.18.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.17.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.16.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.15.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.14.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.13.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb
fog-aws-3.12.0 lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb