Class List Method List File List

# Class: Com::Vmware::Vcenter::Vm::Hardware::Serial

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

## Overview

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

## Defined Under Namespace

Classes: BackingInfo, BackingSpec, BackingType, CreateSpec, Info, Summary, UpdateSpec

## Constant Summary

RESOURCE_TYPE =

      'com.vmware.vcenter.vm.hardware.SerialPort'

## Instance Method Summary (collapse)

- - (Void) connect(vm, port)

  Connects a virtual serial port of a powered-on virtual machine to its backing.

- - (String) create(vm, spec)

  Adds a virtual serial port to the virtual machine.

- - (Void) delete(vm, port)

  Removes a virtual serial port from the virtual machine.

- - (Void) disconnect(vm, port)

  Disconnects a virtual serial port of a powered-on virtual machine from its backing.

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

  Returns information about a virtual serial port.

- - (Serial) initialize(config) constructor

  Constructs a new instance.

- - (Array<Com::Vmware::Vcenter::Vm::Hardware::Serial::Summary>) list(vm)

  Returns commonly used information about the virtual serial ports belonging to the virtual machine.

- - (Void) update(vm, port, spec)

  Updates the configuration of a virtual serial port.

## Constructor Details

### - (`Serial`) initialize(config)

Constructs a new instance.

Parameters:

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

  A hash with the api provider details.

    5141
    5142
    5143
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 5141

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

## Instance Method Details

### - (`Void`) connect(vm, port)

Connects a virtual serial port of a powered-on virtual machine to its backing. Connecting the virtual device makes the backing accessible from the perspective of the guest operating system.

     For a powered-off virtual machine, the   :func:`Com::Vmware::Vcenter::Vm::Hardware::Serial.update`    method  may be used to configure the virtual serial port to start in the connected state when the virtual machine is powered on.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- port (`String`) —

  Virtual serial port identifier.

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 or virtual serial port is not found.

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

  if the virtual serial port is already connected.

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

  if the virtual machine is not powered on.

- (`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.

    5329
    5330
    5331
    5332
    5333
    5334
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 5329

    def connect(vm, port)
        invoke_with_info(@@connect_info, {
            'vm' => vm,
            'port' => port,
        })
    end

### - (`String`) create(vm, spec)

Adds a virtual serial port to the virtual machine.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

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

  Specification for the new virtual serial port.

Returns:

- (`String`) —

  Virtual serial port identifier.

Raises:

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

  if the system reported that the serial port device was created but was unable to confirm the creation because the identifier of the new device could not be determined.

- (`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::UnableToAllocateResource`) —

  if the virtual machine already has the maximum number of supported serial ports.

- (`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.

    5229
    5230
    5231
    5232
    5233
    5234
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 5229

    def create(vm, spec)
        invoke_with_info(@@create_info, {
            'vm' => vm,
            'spec' => spec,
        })
    end

### - (`Void`) delete(vm, port)

Removes a virtual serial port from the virtual machine.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- port (`String`) —

  Virtual serial port identifier.

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 or virtual serial port is not found.

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

  if the virtual machine is not powered off.

- (`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.

    5294
    5295
    5296
    5297
    5298
    5299
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 5294

    def delete(vm, port)
        invoke_with_info(@@delete_info, {
            'vm' => vm,
            'port' => port,
        })
    end

### - (`Void`) disconnect(vm, port)

Disconnects a virtual serial port of a powered-on virtual machine from its backing. The virtual device is still present and its backing configuration is unchanged, but from the perspective of the guest operating system, the serial port is not connected to its backing.

     For a powered-off virtual machine, the   :func:`Com::Vmware::Vcenter::Vm::Hardware::Serial.update`    method  may be used to configure the virtual serial port to start in the disconnected state when the virtual machine is powered on.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- port (`String`) —

  Virtual serial port identifier.

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 or virtual serial port is not found.

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

  if the virtual serial port is already disconnected.

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

  if the virtual machine is not powered on.

- (`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.

    5364
    5365
    5366
    5367
    5368
    5369
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 5364

    def disconnect(vm, port)
        invoke_with_info(@@disconnect_info, {
            'vm' => vm,
            'port' => port,
        })
    end

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

Returns information about a virtual serial port.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- port (`String`) —

  Virtual serial port identifier.

Returns:

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

  Information about the specified virtual serial port.

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 or virtual serial port 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.

    5193
    5194
    5195
    5196
    5197
    5198
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 5193

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

### - (`Array<Com::Vmware::Vcenter::Vm::Hardware::Serial::Summary>`) list(vm)

Returns commonly used information about the virtual serial ports belonging to the virtual machine.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

Returns:

- (`Array<Com::Vmware::Vcenter::Vm::Hardware::Serial::Summary>`) —

  List of commonly used information about virtual serial ports.

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.

    5166
    5167
    5168
    5169
    5170
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 5166

    def list(vm)
        invoke_with_info(@@list_info, {
            'vm' => vm,
        })
    end

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

Updates the configuration of a virtual serial port.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- port (`String`) —

  Virtual serial port identifier.

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

  Specification for updating the virtual serial port.

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 or virtual serial port is not found.

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

  if one or more of the fields specified in the ``spec`` parameter cannot be modified due to the current power state of the virtual machine or the connection state of the virtual serial port.

- (`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.

    5262
    5263
    5264
    5265
    5266
    5267
    5268
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 5262

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