diff --git a/lib/fog/aws/ec2.rb b/lib/fog/aws/ec2.rb index 21eb408a3..6794273f3 100644 --- a/lib/fog/aws/ec2.rb +++ b/lib/fog/aws/ec2.rb @@ -1,4 +1,4 @@ -module Fog + module Fog module AWS module EC2 extend Fog::Service @@ -54,6 +54,7 @@ module Fog request 'disassociate_address' request 'get_console_output' request 'modify_image_attributes' + request 'modify_snapshot_attribute' request 'reboot_instances' request 'release_address' request 'revoke_security_group_ingress' diff --git a/lib/fog/aws/requests/ec2/modify_snapshot_attribute.rb b/lib/fog/aws/requests/ec2/modify_snapshot_attribute.rb new file mode 100644 index 000000000..298be6e84 --- /dev/null +++ b/lib/fog/aws/requests/ec2/modify_snapshot_attribute.rb @@ -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