Sha256: a8b3e62ed9b3843e26f047b62c9bff7c7d2f346cdee943cf69e8dec109116d79

Contents?: true

Size: 1.77 KB

Versions: 55

Compression:

Stored size: 1.77 KB

Contents

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

        # Modify db snapshot attributes
        #
        # ==== Parameters
        # * db_snapshot_identifier<~String> - Id of snapshot to modify
        # * attributes<~Hash>:
        #   * 'Add.MemberId'<~Array> - One or more account ids to grant rds create permission to
        #   * 'Remove.MemberId'<~Array> - One or more account ids to revoke rds create permission from
        #
        # {Amazon API Reference}[http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBSnapshotAttribute.html]
        #
        def modify_db_snapshot_attribute(db_snapshot_identifier, attributes)
          params = {}
          params.merge!(Fog::AWS.indexed_param('ValuesToAdd.member.%d', attributes['Add.MemberId'] || []))
          params.merge!(Fog::AWS.indexed_param('ValuesToRemove.member.%d', attributes['Remove.MemberId'] || []))
          request({
            'Action'        => 'ModifyDBSnapshotAttribute',
            'DBSnapshotIdentifier'    => db_snapshot_identifier,
            :idempotent     => true,
            'AttributeName' => "restore",
            :parser         => Fog::Parsers::AWS::RDS::ModifyDbSnapshotAttribute.new
          }.merge!(params))
        end
      end
      class Mock
        #
        # Usage
        #
        # Fog::AWS[:rds].modify_db_snapshot_attribute("snap-identifier", {"Add.MemberId"=>"389480430104"})
        #

        def modify_db_snapshot_attribute(db_snapshot_identifier, attributes)
          response = Excon::Response.new
          response.status = 200
          response.body = {
            'requestId' => Fog::AWS::Mock.request_id
          }.merge!(data)
          response
        end
      end
    end
  end
end

Version data entries

55 entries across 53 versions & 2 rubygems

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