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:
commit
65719c6549
2 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue