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

[vcloud_director] Add power_off for vm

This commit is contained in:
rsalm 2013-09-17 14:51:19 +03:00
parent 0dbf5432f3
commit 471b331a67
3 changed files with 24 additions and 0 deletions

View file

@ -98,6 +98,7 @@ module Fog
request :put_metadata_value
request :delete_metadata
request :post_vm_poweron
request :post_vm_poweroff
request :get_request # this is used for manual testing
request :get_href # this is used for manual testing
request :get_vms_by_metadata

View file

@ -48,6 +48,11 @@ module Fog
service.process_task(response.body)
end
def power_off
response = service.post_vm_poweroff(id)
service.process_task(response.body)
end
def tags
requires :id
service.tags(:vm => self)

View file

@ -0,0 +1,18 @@
module Fog
module Compute
class VcloudDirector
class Real
def post_vm_poweroff(vm_id)
request(
:expects => 202,
:method => 'POST',
:parser => Fog::ToHashDocument.new,
:path => "vApp/#{vm_id}/power/action/powerOff"
)
end
end
end
end
end