Class List Method List File List

# Class: Com::Vmware::Vcenter::Vm::HardwareService

Inherits:
  VAPI::Bindings::VapiService
  - Object
  - VAPI::Bindings::VapiService
  - Com::Vmware::Vcenter::Vm::HardwareService
  show all
Defined in:
  /build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm.rb

## Overview

The ``Com::Vmware::Vcenter::Vm::Hardware`` class provides methods for configuring the virtual hardware of a virtual machine.

## Defined Under Namespace

Classes: Info, UpdateSpec, UpgradePolicy, UpgradeStatus, Version

## Instance Method Summary (collapse)

- - (Com::Vmware::Vcenter::Vm::Hardware::Info) get(vm)

  Returns the virtual hardware settings of a virtual machine.

- - (HardwareService) initialize(config) constructor

  Constructs a new instance.

- - (Void) update(vm, spec)

  Updates the virtual hardware settings of a virtual machine.

- - (Void) upgrade(vm, version = nil)

  Upgrades the virtual machine to a newer virtual hardware version.

## Constructor Details

### - (`HardwareService`) initialize(config)

Constructs a new instance.

Parameters:

- config (`VAPI::Bindings::StubConfig`) —

  A hash with the api provider details.

    104
    105
    106
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm.rb', line 104

    def initialize(config)
        super(config, @@service_info)
    end

## Instance Method Details

### - (`Com::Vmware::Vcenter::Vm::Hardware::Info`) get(vm)

Returns the virtual hardware settings of a virtual machine.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

Returns:

- (`Com::Vmware::Vcenter::Vm::Hardware::Info`) —

  Virtual hardware settings of the virtual machine.

Raises:

- (`Com::Vmware::Vapi::Std::Errors::Error`) —

  if the system reports an error while responding to the request.

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the virtual machine is not found.

- (`Com::Vmware::Vapi::Std::Errors::ResourceInaccessible`) —

  if the virtual machine’s configuration state cannot be accessed.

- (`Com::Vmware::Vapi::Std::Errors::ServiceUnavailable`) —

  if the system is unable to communicate with a service to complete the request.

- (`Com::Vmware::Vapi::Std::Errors::Unauthenticated`) —

  if the user can not be authenticated.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if the user doesn’t have the required privileges.

    127
    128
    129
    130
    131
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm.rb', line 127

    def get(vm)
        invoke_with_info(@@get_info, {
            'vm' => vm,
        })
    end

### - (`Void`) update(vm, spec)

Updates the virtual hardware settings of a virtual machine.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- spec (`Com::Vmware::Vcenter::Vm::Hardware::UpdateSpec`) —

  Specification for updating the virtual hardware settings of the virtual machine.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::Error`) —

  if the system reports an error while responding to the request.

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the virtual machine is not found.

- (`Com::Vmware::Vapi::Std::Errors::AlreadyInDesiredState`) —

  if the virtual machine is already configured for the desired hardware version.

- (`Com::Vmware::Vapi::Std::Errors::InvalidArgument`) —

  if the requested virtual hardware version is not newer than the current version.

- (`Com::Vmware::Vapi::Std::Errors::Unsupported`) —

  if the requested virtual hardware version is not supported by the server.

- (`Com::Vmware::Vapi::Std::Errors::ResourceBusy`) —

  if the virtual machine is busy performing another operation.

- (`Com::Vmware::Vapi::Std::Errors::ResourceInaccessible`) —

  if the virtual machine’s configuration state cannot be accessed.

- (`Com::Vmware::Vapi::Std::Errors::ServiceUnavailable`) —

  if the system is unable to communicate with a service to complete the request.

- (`Com::Vmware::Vapi::Std::Errors::Unauthenticated`) —

  if the user can not be authenticated.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if the user doesn’t have the required privileges.

    161
    162
    163
    164
    165
    166
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm.rb', line 161

    def update(vm, spec)
        invoke_with_info(@@update_info, {
            'vm' => vm,
            'spec' => spec,
        })
    end

### - (`Void`) upgrade(vm, version = nil)

Upgrades the virtual machine to a newer virtual hardware version.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- version (`Com::Vmware::Vcenter::Vm::Hardware::Version`, `nil`) (defaults to: `nil`) —

  New virtual machine version. If nil , defaults to the most recent virtual hardware version supported by the server.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::Error`) —

  if the system reports an error while responding to the request.

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the virtual machine is not found.

- (`Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState`) —

  if the virtual machine is not powered off.

- (`Com::Vmware::Vapi::Std::Errors::AlreadyInDesiredState`) —

  if the virtual machine is already configured for the desired hardware version.

- (`Com::Vmware::Vapi::Std::Errors::InvalidArgument`) —

  if ``version`` is older than the current virtual hardware version.

- (`Com::Vmware::Vapi::Std::Errors::Unsupported`) —

  if ``version`` is not supported by the server.

- (`Com::Vmware::Vapi::Std::Errors::ResourceBusy`) —

  if the virtual machine is busy performing another operation.

- (`Com::Vmware::Vapi::Std::Errors::ResourceInaccessible`) —

  if the virtual machine’s configuration state cannot be accessed.

- (`Com::Vmware::Vapi::Std::Errors::ServiceUnavailable`) —

  if the system is unable to communicate with a service to complete the request.

- (`Com::Vmware::Vapi::Std::Errors::Unauthenticated`) —

  if the user can not be authenticated.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if the user doesn’t have the required privileges.

    199
    200
    201
    202
    203
    204
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm.rb', line 199

    def upgrade(vm, version=nil)
        invoke_with_info(@@upgrade_info, {
            'vm' => vm,
            'version' => version,
        })
    end