Sha256: b848aae97e85e6413a018f01f4f56a2e2eb00828ebe4f2fa243beb6e5e5138c2

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

module Fog
  module Compute
    class AWS
      class Real

        require 'fog/compute/parsers/aws/basic'

        # Modify instance attributes
        #
        # ==== Parameters
        # * image_id<~String> - Id of machine image to modify
        # * attributes<~Hash>:
        #   'InstanceType.Value'<~String> - New instance type
        #   'Kernel.Value'<~String> - New kernel value
        #   'Ramdisk.Value'<~String> - New ramdisk value
        #   'UserData.Value'<~String> - New userdata value
        #   'DisableApiTermination.Value'<~Boolean> - Change api termination value
        #   'InstanceInitiatedShutdownBehavior.Value'<~String> - New instance initiated shutdown behaviour, in ['stop', 'terminate']
        #   'SourceDestCheck.Value'<~Boolean> - New sourcedestcheck value
        #   'GroupId'<~Array> - One or more groups to add instance to (VPC only)
        #
        # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyInstanceAttribute.html]
        #
        def modify_instance_attributes(image_id, attributes)
          params = {}
          params.merge!(Fog::AWS.indexed_param('GroupId', attributes['GroupId'] || []))
          request({
            'Action'        => 'ModifyInstanceAttribute',
            :idempotent     => true,
            :parser         => Fog::Parsers::Compute::AWS::Basic.new
          }.merge!(params))
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-0.11.0 lib/fog/compute/requests/aws/modify_instance_attribute.rb