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

Merge pull request #2150 from rsalm/vcloud_director_poweroff

Vcloud director poweroff support
This commit is contained in:
Wesley Beary 2013-09-18 06:32:55 -07:00
commit ac1f61d16d
4 changed files with 34 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

@ -35,6 +35,16 @@ module Fog
service.process_task(response.body)
end
def power_on
response = service.post_vm_poweron(id)
service.process_task(response.body)
end
def power_off
response = service.post_vm_poweroff(id)
service.process_task(response.body)
end
end
end
end

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