1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00
fog--fog-aws/lib/fog/aws/requests/rds/modify_db_snapshot_attribute.rb

32 lines
1.3 KiB
Ruby
Raw Normal View History

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
end
end
end