2011-09-06 19:41:37 -04:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Vsphere
|
|
|
|
class Real
|
|
|
|
|
2011-09-10 16:27:52 -04:00
|
|
|
def vm_destroy(options = {})
|
|
|
|
raise ArgumentError, "instance_uuid is a required parameter" unless options.has_key? 'instance_uuid'
|
|
|
|
|
2012-11-14 08:31:02 -05:00
|
|
|
vm_mob_ref = get_vm_ref(options['instance_uuid'])
|
2011-09-10 16:27:52 -04:00
|
|
|
task = vm_mob_ref.Destroy_Task
|
2011-09-06 19:41:37 -04:00
|
|
|
task.wait_for_completion
|
2011-09-10 16:27:52 -04:00
|
|
|
{ 'task_state' => task.info.state }
|
2011-09-06 19:41:37 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
|
|
|
|
2011-09-10 16:27:52 -04:00
|
|
|
def vm_destroy(options = {})
|
|
|
|
raise ArgumentError, "instance_uuid is a required parameter" unless options.has_key? 'instance_uuid'
|
|
|
|
{ 'task_state' => 'success' }
|
2011-09-06 19:41:37 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|