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