2010-07-22 21:52:27 -07:00
|
|
|
module Fog
|
2011-06-16 16:28:54 -07:00
|
|
|
module Compute
|
|
|
|
class AWS
|
2010-07-22 21:52:27 -07:00
|
|
|
class Real
|
|
|
|
|
2011-01-07 16:52:09 -08:00
|
|
|
require 'fog/compute/parsers/aws/start_stop_instances'
|
2010-07-22 21:52:27 -07:00
|
|
|
|
|
|
|
# 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
|
2011-05-19 09:31:56 -07:00
|
|
|
#
|
|
|
|
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-StopInstances.html]
|
2010-07-22 21:52:27 -07:00
|
|
|
def stop_instances(instance_id)
|
2011-06-20 13:49:37 -07:00
|
|
|
params = Fog::AWS.indexed_param('InstanceId', instance_id)
|
2010-07-22 21:52:27 -07:00
|
|
|
request({
|
|
|
|
'Action' => 'StopInstances',
|
|
|
|
:idempotent => true,
|
2011-06-16 16:28:54 -07:00
|
|
|
:parser => Fog::Parsers::Compute::AWS::StartStopInstances.new
|
2010-07-22 21:52:27 -07:00
|
|
|
}.merge!(params))
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|