Sha256: 80f0c48ba244cd6362a1d0fbd96697f2c9eb12661badd75a73a1647d1b05afe7

Contents?: true

Size: 840 Bytes

Versions: 14

Compression:

Stored size: 840 Bytes

Contents

module Fog
  module Compute
    class Vsphere
      class Real
        def vm_power_on(options = {})
          raise ArgumentError, "instance_uuid is a required parameter" unless options.key? 'instance_uuid'

          search_filter = { :uuid => options['instance_uuid'], 'vmSearch' => true, 'instanceUuid' => true }
          vm_mob_ref = connection.searchIndex.FindAllByUuid(search_filter).first

          task = vm_mob_ref.PowerOnVM_Task
          task.wait_for_completion
          # 'success', 'running', 'queued', 'error'
          { 'task_state' => task.info.state }
        end
      end

      class Mock
        def vm_power_on(options = {})
          raise ArgumentError, "instance_uuid is a required parameter" unless options.key? 'instance_uuid'
          { 'task_state' => 'success' }
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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