Method: Fog::Compute::AWS::Real#terminate_instances

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

#terminate_instances(instance_id) ⇒ Object

Terminate specified instances

Parameters

  • instance_id<~Array> - Ids of instances to terminates

Returns

# * response<~Excon::Response>:

* body<~Hash>:
  * 'requestId'<~String> - Id of request
  * 'instancesSet'<~Array>:
    * 'instanceId'<~String> - id of the terminated instance
    * 'previousState'<~Hash>: previous state of instance
      * 'code'<~Integer> - previous status code
      * 'name'<~String> - name of previous state
    * 'shutdownState'<~Hash>: shutdown state of instance
      * 'code'<~Integer> - current status code
      * 'name'<~String> - name of current state

Amazon API Reference



27
28
29
30
31
32
33
34
# File 'lib/fog/compute/requests/aws/terminate_instances.rb', line 27

def terminate_instances(instance_id)
  params = Fog::AWS.indexed_param('InstanceId', instance_id)
  request({
    'Action'    => 'TerminateInstances',
    :idempotent => true,
    :parser     => Fog::Parsers::Compute::AWS::TerminateInstances.new
  }.merge!(params))
end