mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #2157 from rsalm/vcloud_director_delete_vapp
[vcloud_director] Added support for deleting vApps.
This commit is contained in:
commit
bf4c376256
3 changed files with 26 additions and 0 deletions
|
@ -105,6 +105,7 @@ module Fog
|
|||
request :get_vm
|
||||
request :post_task_cancel
|
||||
request :post_vapp_undeploy
|
||||
request :delete_vapp
|
||||
|
||||
class Model < Fog::Model
|
||||
def initialize(attrs={})
|
||||
|
|
|
@ -45,6 +45,11 @@ module Fog
|
|||
service.process_task(response.body)
|
||||
end
|
||||
|
||||
def destroy
|
||||
response = service.delete_vapp(id)
|
||||
service.process_task(response.body)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
20
lib/fog/vcloud_director/requests/compute/delete_vapp.rb
Normal file
20
lib/fog/vcloud_director/requests/compute/delete_vapp.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class VcloudDirector
|
||||
class Real
|
||||
|
||||
def delete_vapp(vapp_id)
|
||||
|
||||
request(
|
||||
:expects => 202,
|
||||
:method => 'DELETE',
|
||||
:parser => Fog::ToHashDocument.new,
|
||||
:path => "vApp/#{vapp_id}"
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in a new issue