Sha256: 56e96563b112a07e047efbbf3ec523ce2651a4dfbc2ed756ae97b4cd420ce8c3

Contents?: true

Size: 1.71 KB

Versions: 60

Compression:

Stored size: 1.71 KB

Contents

module Fog
  module AWS
    class RDS
      class Real
        require 'fog/aws/parsers/rds/describe_db_clusters'

        # Describe all or specified db clusters
        # http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBClusters.html
        #
        # ==== Parameters ====
        # * DBClusterIdentifier<~String> - The user-supplied DB cluster identifier
        #
        # ==== Returns ====
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        def describe_db_clusters(identifier=nil, opts={})
          params = {}
          params['DBClusterIdentifier'] = identifier         if identifier
          params['Marker']              = opts[:marker]      if opts[:marker]
          params['MaxRecords']          = opts[:max_records] if opts[:max_records]

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

      class Mock
        def describe_db_clusters(identifier=nil, opts={})
          response    = Excon::Response.new
          cluster_set = []

          if identifier
            if cluster = self.data[:clusters][identifier]
              cluster_set << cluster
            else
              raise Fog::AWS::RDS::NotFound.new("DBCluster #{identifier} not found")
            end
          else
            cluster_set = self.data[:clusters].values
          end

          response.status = 200
          response.body = {
            "ResponseMetadata"         => { "RequestId"  => Fog::AWS::Mock.request_id },
            "DescribeDBClustersResult" => { "DBClusters" => cluster_set }
          }
          response
        end
      end
    end
  end
end

Version data entries

60 entries across 58 versions & 2 rubygems

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