Method: Fog::Compute::AWS::Real#stop_instances

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

#stop_instances(instance_id, force = false) ⇒ Object

Stop specified instance

Parameters

  • instance_id<~Array> - Id of instance to start

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘requestId’<~String> - Id of request

      • TODO: fill in the blanks

Amazon API Reference

[View source]

20
21
22
23
24
25
26
27
28
# File 'lib/fog/aws/requests/compute/stop_instances.rb', line 20

def stop_instances(instance_id, force = false)
  params = Fog::AWS.indexed_param('InstanceId', instance_id)
  params.merge!('Force' => 'true') if force
  request({
    'Action'    => 'StopInstances',
    :idempotent => true,
    :parser     => Fog::Parsers::Compute::AWS::StartStopInstances.new
  }.merge!(params))
end