mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
add modify_image_attributes
This commit is contained in:
parent
01c2a29a49
commit
a1b0e5dd63
2 changed files with 39 additions and 0 deletions
|
@ -66,6 +66,7 @@ module Fog
|
||||||
require 'fog/aws/requests/ec2/detach_volume'
|
require 'fog/aws/requests/ec2/detach_volume'
|
||||||
require 'fog/aws/requests/ec2/disassociate_address'
|
require 'fog/aws/requests/ec2/disassociate_address'
|
||||||
require 'fog/aws/requests/ec2/get_console_output'
|
require 'fog/aws/requests/ec2/get_console_output'
|
||||||
|
require 'fog/aws/requests/ec2/modify_image_attributes'
|
||||||
require 'fog/aws/requests/ec2/reboot_instances'
|
require 'fog/aws/requests/ec2/reboot_instances'
|
||||||
require 'fog/aws/requests/ec2/release_address'
|
require 'fog/aws/requests/ec2/release_address'
|
||||||
require 'fog/aws/requests/ec2/revoke_security_group_ingress'
|
require 'fog/aws/requests/ec2/revoke_security_group_ingress'
|
||||||
|
|
38
lib/fog/aws/requests/ec2/modify_image_attributes.rb
Normal file
38
lib/fog/aws/requests/ec2/modify_image_attributes.rb
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
module Fog
|
||||||
|
module AWS
|
||||||
|
module EC2
|
||||||
|
class Real
|
||||||
|
|
||||||
|
# Modify image attributes
|
||||||
|
#
|
||||||
|
# ==== Parameters
|
||||||
|
# * image_id<~String> - Id of machine image to modify
|
||||||
|
# * attribute<~String> - Attribute to modify, in ['launchPermission', 'productCodes']
|
||||||
|
# * operation_type<~String> - Operation to perform on attribute, in ['add', 'remove']
|
||||||
|
#
|
||||||
|
def modify_image_attributes(image_id, attribute, operation_type, options = {})
|
||||||
|
params = {}
|
||||||
|
params.merge!(AWS.indexed_param('UserId', options['UserId']))
|
||||||
|
params.merge!(AWS.indexed_param('UserGroup', options['UserGroup']))
|
||||||
|
params.merge!(AWS.indexed_param('ProductCode', options['ProductCode']))
|
||||||
|
request({
|
||||||
|
'Action' => 'ModifyImageAttribute',
|
||||||
|
'Attribute' => attribute,
|
||||||
|
'ImageId' => image_id,
|
||||||
|
'OperationType' => operation,
|
||||||
|
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||||
|
}.merge!(params))
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
class Mock
|
||||||
|
|
||||||
|
def modify_image_attributes(image_id, user_id, options = {})
|
||||||
|
raise MockNotImplemented.new("Contributions welcome!")
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Reference in a new issue