Method: Fog::Compute::AWS::Real#modify_image_attributes

Defined in:
lib/fog/compute/requests/aws/modify_image_attributes.rb

#modify_image_attributes(image_id, attribute, operation_type, options = {}) ⇒ Object

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’]

Amazon API Reference



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fog/compute/requests/aws/modify_image_attributes.rb', line 19

def modify_image_attributes(image_id, attribute, operation_type, options = {})
  params = {}
  params.merge!(Fog::AWS.indexed_param('UserId', options['UserId']))
  params.merge!(Fog::AWS.indexed_param('UserGroup', options['UserGroup']))
  params.merge!(Fog::AWS.indexed_param('ProductCode', options['ProductCode']))
  request({
    'Action'        => 'ModifyImageAttribute',
    'Attribute'     => attribute,
    'ImageId'       => image_id,
    'OperationType' => operation_type,
    :idempotent     => true,
    :parser         => Fog::Parsers::Compute::AWS::Basic.new
  }.merge!(params))
end