Class List Method List File List

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

Inherits:
  VAPI::Bindings::VapiService
  - Object
  - VAPI::Bindings::VapiService
  - Com::Vmware::Vcenter::Vm::Hardware::Ethernet
  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::Ethernet`` class provides methods for configuring the virtual Ethernet adapters of a virtual machine.

## Defined Under Namespace

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

## Constant Summary

RESOURCE_TYPE =

      'com.vmware.vcenter.vm.hardware.Ethernet'

## Instance Method Summary (collapse)

- - (Void) connect(vm, nic)

  Connects a virtual Ethernet adapter of a powered-on virtual machine to its backing.

- - (String) create(vm, spec)

  Adds a virtual Ethernet adapter to the virtual machine.

- - (Void) delete(vm, nic)

  Removes a virtual Ethernet adapter from the virtual machine.

- - (Void) disconnect(vm, nic)

  Disconnects a virtual Ethernet adapter of a powered-on virtual machine from its backing.

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

  Returns information about a virtual Ethernet adapter.

- - (Ethernet) initialize(config) constructor

  Constructs a new instance.

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

  Returns commonly used information about the virtual Ethernet adapters belonging to the virtual machine.

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

  Updates the configuration of a virtual Ethernet adapter.

## Constructor Details

### - (`Ethernet`) initialize(config)

Constructs a new instance.

Parameters:

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

  A hash with the api provider details.

    2483
    2484
    2485
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 2483

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

## Instance Method Details

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

Connects a virtual Ethernet adapter 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::Ethernet.update`    method  may be used to configure the virtual Ethernet adapter to start in the connected state when the virtual machine is powered on.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- nic (`String`) —

  Virtual Ethernet adapter 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 Ethernet adapter is not found.

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

  if the virtual Ethernet adapter 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.

    2671
    2672
    2673
    2674
    2675
    2676
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 2671

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

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

Adds a virtual Ethernet adapter to the virtual machine.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

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

  Specification for the new virtual Ethernet adapter.

Returns:

- (`String`) —

  Virtual Ethernet adapter identifier.

Raises:

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

  if the system reported that the Ethernet adapter was created but was unable to confirm the creation because the identifier of the new adapter 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 or network backing is not found.

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

  if the virtual machine already has the maximum number of supported Ethernet adapters.

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

  if the specified PCI address is out of bounds, HOST_DEVICE is specified as the type, or a backing cannot be found in the case that backing is left nil .

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

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

  if the guest operating system of the virtual machine is not supported and spec includes nil fields that default to guest-specific values.

    2573
    2574
    2575
    2576
    2577
    2578
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 2573

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

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

Removes a virtual Ethernet adapter from the virtual machine.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- nic (`String`) —

  Virtual Ethernet adapter 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 Ethernet adapter is not found.

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

    2636
    2637
    2638
    2639
    2640
    2641
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 2636

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

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

Disconnects a virtual Ethernet adapter 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 Ethernet adapter is not connected to its backing resource.

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

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- nic (`String`) —

  Virtual Ethernet adapter 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 Ethernet adapter is not found.

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

  if the virtual Ethernet adapter 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.

    2706
    2707
    2708
    2709
    2710
    2711
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 2706

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

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

Returns information about a virtual Ethernet adapter.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- nic (`String`) —

  Virtual Ethernet adapter identifier.

Returns:

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

  Information about the specified virtual Ethernet adapter.

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 Ethernet adapter 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.

    2535
    2536
    2537
    2538
    2539
    2540
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 2535

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

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

Returns commonly used information about the virtual Ethernet adapters belonging to the virtual machine.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

Returns:

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

  List of commonly used information about virtual Ethernet adapters.

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.

    2508
    2509
    2510
    2511
    2512
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 2508

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

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

Updates the configuration of a virtual Ethernet adapter.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- nic (`String`) —

  Virtual Ethernet adapter identifier.

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

  Specification for updating the virtual Ethernet adapter.

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

  if HOST_DEVICE is specified as the type.

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

  if the virtual machine, virtual Ethernet adapter, or backing network is not found.

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

    2606
    2607
    2608
    2609
    2610
    2611
    2612
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 2606

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