Sha256: afa76bf13828cd09a2da939fab46479637880ec3790df39c1ade0e7696547209

Contents?: true

Size: 700 Bytes

Versions: 8

Compression:

Stored size: 700 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

8 entries across 6 versions & 2 rubygems

Version Path
fog-vsphere-2.5.0 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-2.4.0 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-2.3.0 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-vsphere-2.2.0/lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-vsphere-2.2.0/lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-vsphere-2.2.0/lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-2.2.0 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
fog-vsphere-1.7.0.1 lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb