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
|
|
|
|
# * attribute<~String> - Attribute to modify, in ['createVolumePermission']
|
|
|
|
# * operation_type<~String> - Operation to perform on attribute, in ['add', 'remove']
|
|
|
|
#
|
2011-05-19 12:31:56 -04:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifySnapshotAttribute.html]
|
|
|
|
#
|
2010-07-30 14:00:50 -04:00
|
|
|
def modify_snapshot_attribute(snapshot_id, attribute, operation_type, options = {})
|
|
|
|
params = {}
|
2011-06-16 19:28:54 -04:00
|
|
|
params.merge!(Fog::AWS.indexed_param('UserId', options['UserId']))
|
|
|
|
params.merge!(Fog::AWS.indexed_param('UserGroup', options['UserGroup']))
|
2010-07-30 14:00:50 -04:00
|
|
|
request({
|
|
|
|
'Action' => 'ModifySnapshotAttribute',
|
|
|
|
'Attribute' => attribute,
|
|
|
|
'SnapshotId' => snapshot_id,
|
|
|
|
'OperationType' => operation_type,
|
|
|
|
: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
|