Sha256: 6ee2557e2ba695e179b4a6341462a03ae44806393aaff0fd1302c3909f1991d7

Contents?: true

Size: 1.23 KB

Versions: 14

Compression:

Stored size: 1.23 KB

Contents

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_type,
            :parser         => Fog::Parsers::AWS::EC2::Basic.new
          }.merge!(params))
        end

      end

      class Mock

        def modify_image_attributes(image_id, attribute, operation_type, options = {})
          raise MockNotImplemented.new("Contributions welcome!")
        end

      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-0.1.1 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.1.0 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.0.100 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.0.99 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.0.98 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.0.97 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.0.96 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.0.95 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.0.94 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.0.93 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.0.92 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.0.91 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.0.90 lib/fog/aws/requests/ec2/modify_image_attributes.rb
fog-0.0.89 lib/fog/aws/requests/ec2/modify_image_attributes.rb