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:
parent
0dbf5432f3
commit
471b331a67
3 changed files with 24 additions and 0 deletions
|
@ -98,6 +98,7 @@ module Fog
|
||||||
request :put_metadata_value
|
request :put_metadata_value
|
||||||
request :delete_metadata
|
request :delete_metadata
|
||||||
request :post_vm_poweron
|
request :post_vm_poweron
|
||||||
|
request :post_vm_poweroff
|
||||||
request :get_request # this is used for manual testing
|
request :get_request # this is used for manual testing
|
||||||
request :get_href # this is used for manual testing
|
request :get_href # this is used for manual testing
|
||||||
request :get_vms_by_metadata
|
request :get_vms_by_metadata
|
||||||
|
|
|
@ -48,6 +48,11 @@ module Fog
|
||||||
service.process_task(response.body)
|
service.process_task(response.body)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def power_off
|
||||||
|
response = service.post_vm_poweroff(id)
|
||||||
|
service.process_task(response.body)
|
||||||
|
end
|
||||||
|
|
||||||
def tags
|
def tags
|
||||||
requires :id
|
requires :id
|
||||||
service.tags(:vm => self)
|
service.tags(:vm => self)
|
||||||
|
|
18
lib/fog/vcloud_director/requests/compute/post_vm_poweroff.rb
Normal file
18
lib/fog/vcloud_director/requests/compute/post_vm_poweroff.rb
Normal 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
|
Loading…
Reference in a new issue