1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[ec2] - add modify_snapshot_attribute call

This commit is contained in:
Caleb Tennis 2010-07-31 02:00:50 +08:00 committed by Wesley Beary
parent 0270dcef0f
commit 60ebfd67f8
2 changed files with 40 additions and 1 deletions

View file

@ -1,4 +1,4 @@
module Fog module Fog
module AWS module AWS
module EC2 module EC2
extend Fog::Service extend Fog::Service
@ -54,6 +54,7 @@ module Fog
request 'disassociate_address' request 'disassociate_address'
request 'get_console_output' request 'get_console_output'
request 'modify_image_attributes' request 'modify_image_attributes'
request 'modify_snapshot_attribute'
request 'reboot_instances' request 'reboot_instances'
request 'release_address' request 'release_address'
request 'revoke_security_group_ingress' request 'revoke_security_group_ingress'

View file

@ -0,0 +1,38 @@
module Fog
module AWS
module EC2
class Real
# 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']
#
def modify_snapshot_attribute(snapshot_id, attribute, operation_type, options = {})
params = {}
params.merge!(AWS.indexed_param('UserId', options['UserId']))
params.merge!(AWS.indexed_param('UserGroup', options['UserGroup']))
request({
'Action' => 'ModifySnapshotAttribute',
'Attribute' => attribute,
'SnapshotId' => snapshot_id,
'OperationType' => operation_type,
:idempotent => true,
:parser => Fog::Parsers::AWS::EC2::Basic.new
}.merge!(params))
end
end
class Mock
def modify_snapshot_attribute(snapshot_id, attribute, operation_type, options = {})
Fog::Mock.not_implemented
end
end
end
end
end