1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/aws/requests/redshift/authorize_snapshot_access.rb
Paul Thornthwaite 2e0b7e545a Standardise empty lines throughout codebase
Done with `rubocop --auto-correct --only EmptyLineBetweenDefs,EmptyLines,EmptyLinesAroundBody`
2014-05-26 14:20:02 +01:00

42 lines
1.7 KiB
Ruby

module Fog
module AWS
class Redshift
class Real
require 'fog/aws/parsers/redshift/cluster_snapshot'
# ==== Parameters
#
# @param [Hash] options
# * :snapshot_identifier - required - (String)
# The identifier of the snapshot the account is authorized to restore.
# * :snapshot_cluster_identifier - (String)
# * :account_with_restore_access - required - (String)
# The identifier of the AWS customer account authorized to restore the specified snapshot. #
#
# ==== See Also
# http://docs.aws.amazon.com/redshift/latest/APIReference/API_CopyClusterSnapshot.html
def authorize_snapshot_access(options = {})
snapshot_identifier = options[:snapshot_identifier]
snapshot_cluster_identifier = options[:snapshot_cluster_identifier]
account_with_restore_access = options[:account_with_restore_access]
path = "/"
params = {
:headers => {},
:path => path,
:method => :put,
:query => {},
:parser => Fog::Parsers::Redshift::AWS::ClusterSnapshot.new
}
params[:query]['Action'] = 'AuthorizeSnapshotAccess'
params[:query]['SnapshotIdentifier'] = snapshot_identifier if snapshot_identifier
params[:query]['SnapshotClusterIdentifier'] = snapshot_cluster_identifier if snapshot_cluster_identifier
params[:query]['AccountWithRestoreAccess'] = account_with_restore_access if account_with_restore_access
request(params)
end
end
end
end
end