1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #462 from johnf/master

Add force stop functionality to AWS Instance
This commit is contained in:
Wesley Beary 2011-08-08 08:58:15 -07:00
commit 65719c6549
2 changed files with 4 additions and 3 deletions

View file

@ -222,9 +222,9 @@ module Fog
true
end
def stop
def stop(force = false)
requires :id
connection.stop_instances(id)
connection.stop_instances(id, force)
true
end

View file

@ -17,8 +17,9 @@ module Fog
# * TODO: fill in the blanks
#
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-StopInstances.html]
def stop_instances(instance_id)
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,