Sha256: 560ff38fac4fb92b8acbe7881415c97054a30aad4db74be17bbb46fc830875cc

Contents?: true

Size: 701 Bytes

Versions: 11

Compression:

Stored size: 701 Bytes

Contents

module Fog
  module Compute
    class Vsphere
      class Real
        def vm_remove_snapshot(vm_id, snapshot_id, remove_children = false)
          vm = servers.get(vm_id)
          snapshot = vm.snapshots.get(snapshot_id).mo_ref
          task = snapshot.RemoveSnapshot_Task(:removeChildren => remove_children)

          task.wait_for_completion

          {
            'task_state' => task.info.state,
            'was_cancelled' => task.info.cancelled
          }
        end
      end

      class Mock
        def vm_remove_snapshot(vm_id, snapshot_id)
          {
            'task_state' => 'success',
            'was_cancelled' => false
          }
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fog-vsphere-2.1.1 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-2.1.0 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-2.0.1 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-2.0.0 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-1.13.1 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-1.13.0 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-1.12.0 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-1.11.3 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-1.11.2 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-1.11.1 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-1.11.0 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb