2010-07-30 14:00:50 -04:00
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
class AWS
|
2010-07-30 14:00:50 -04:00
|
|
|
class Real
|
2011-02-22 22:05:14 -05:00
|
|
|
|
|
|
|
require 'fog/compute/parsers/aws/basic'
|
2010-07-30 14:00:50 -04:00
|
|
|
|
|
|
|
# Modify snapshot attributes
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * snapshot_id<~String> - Id of snapshot to modify
|
2011-08-04 11:12:02 -04:00
|
|
|
# * attributes<~Hash>:
|
|
|
|
# * 'Add.Group'<~Array> - One or more groups to grant volume create permission to
|
|
|
|
# * 'Add.UserId'<~Array> - One or more account ids to grant volume create permission to
|
|
|
|
# * 'Remove.Group'<~Array> - One or more groups to revoke volume create permission from
|
|
|
|
# * 'Remove.UserId'<~Array> - One or more account ids to revoke volume create permission from
|
2011-05-19 12:31:56 -04:00
|
|
|
#
|
|
|
|
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifySnapshotAttribute.html]
|
|
|
|
#
|
2011-08-04 11:12:02 -04:00
|
|
|
def modify_snapshot_attribute(snapshot_id, attributes)
|
2010-07-30 14:00:50 -04:00
|
|
|
params = {}
|
2011-08-04 11:12:02 -04:00
|
|
|
params.merge!(Fog::AWS.indexed_param('CreateVolumePermission.Add.%d.Group', attributes['Add.Group'] || []))
|
|
|
|
params.merge!(Fog::AWS.indexed_param('CreateVolumePermission.Add.%d.UserId', attributes['Add.UserId'] || []))
|
|
|
|
params.merge!(Fog::AWS.indexed_param('CreateVolumePermission.Remove.%d.Group', attributes['Remove.Group'] || []))
|
|
|
|
params.merge!(Fog::AWS.indexed_param('CreateVolumePermission.Remove.%d.UserId', attributes['Remove.UserId'] || []))
|
2010-07-30 14:00:50 -04:00
|
|
|
request({
|
|
|
|
'Action' => 'ModifySnapshotAttribute',
|
|
|
|
:idempotent => true,
|
2011-06-16 19:28:54 -04:00
|
|
|
:parser => Fog::Parsers::Compute::AWS::Basic.new
|
2010-07-30 14:00:50 -04:00
|
|
|
}.merge!(params))
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|