diff --git a/lib/fog/vcloud_director/compute.rb b/lib/fog/vcloud_director/compute.rb index 7d7eb123a..481928b7d 100644 --- a/lib/fog/vcloud_director/compute.rb +++ b/lib/fog/vcloud_director/compute.rb @@ -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={}) diff --git a/lib/fog/vcloud_director/models/compute/vapp.rb b/lib/fog/vcloud_director/models/compute/vapp.rb index 69bae1980..ad758b089 100644 --- a/lib/fog/vcloud_director/models/compute/vapp.rb +++ b/lib/fog/vcloud_director/models/compute/vapp.rb @@ -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 diff --git a/lib/fog/vcloud_director/requests/compute/delete_vapp.rb b/lib/fog/vcloud_director/requests/compute/delete_vapp.rb new file mode 100644 index 000000000..acf00b574 --- /dev/null +++ b/lib/fog/vcloud_director/requests/compute/delete_vapp.rb @@ -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 +