Sha256: 653691491ed6d69c75db2ae7c6084f58da571d5bbbd0dc840c2c408c819a69e3

Contents?: true

Size: 1.93 KB

Versions: 72

Compression:

Stored size: 1.93 KB

Contents

module Fog
  module AWS
    class RDS
      class Real

        require 'fog/aws/parsers/rds/describe_db_subnet_groups'

        # This API returns a list of DBSubnetGroup descriptions. If a DBSubnetGroupName is specified, the list will contain only
        # the descriptions of the specified DBSubnetGroup
        # http://docs.amazonwebservices.com/AmazonRDS/2012-01-15/APIReference/API_DescribeDBSubnetGroups.html
        # ==== Parameters
        # * DBSubnetGroupName <~String> - The name of a specific database subnet group to return details for.
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        def describe_db_subnet_groups(name = nil, opts = {})
          params = {}
          if opts[:marker]
            params['Marker'] = opts[:marker]
          end
          if name
            params['DBSubnetGroupName'] = name
          end
          if opts[:max_records]
            params['MaxRecords'] = opts[:max_records]
          end

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

      end

      class Mock

        def describe_db_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::RDS::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 },
            "DescribeDBSubnetGroupsResult" => { "DBSubnetGroups" => subnet_group_set }
          }
          response
        end
      end

    end
  end
end

Version data entries

72 entries across 72 versions & 9 rubygems

Version Path
fog-1.22.0 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-1.21.0 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-1.20.0 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-1.19.0 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/aws/requests/rds/describe_db_subnet_groups.rb