Class List Method List File List

# Class: Com::Vmware::Vcenter::Iso::Image

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

## Overview

Provides an interface to mount and unmount an ISO image on a virtual machine.

     This is an API that will let its client mount or unmount an ISO image on a virtual machine as a CD-ROM.

## Instance Method Summary (collapse)

- - (Image) initialize(config) constructor

  Constructs a new instance.

- - (String) mount(library_item, vm)

  Mounts an ISO image from a content library on a virtual machine.

- - (Void) unmount(vm, cdrom)

  Unmounts a previously mounted CD-ROM using an ISO image as a backing.

## Constructor Details

### - (`Image`) initialize(config)

Constructs a new instance.

Parameters:

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

  A hash with the api provider details.

    73
    74
    75
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/iso.rb', line 73

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

## Instance Method Details

### - (`String`) mount(library_item, vm)

Mounts an ISO image from a content library on a virtual machine.

Parameters:

- library_item (`String`) —

  The identifier of the library item having the ISO image to mount on the virtual machine.

- vm (`String`) —

  The identifier of the virtual machine where the specified ISO image will be mounted.

Returns:

- (`String`) —

  The identifier of the newly created virtual CD-ROM backed by the specified ISO image.

Raises:

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

  If either ``vm`` or the ``library_item`` is not found.

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

  If no .iso file is present on the library item.

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

  When the operation is not allowed on the virtual machine in its current state.

    92
    93
    94
    95
    96
    97
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/iso.rb', line 92

    def mount(library_item, vm)
        invoke_with_info(@@mount_info, {
            'library_item' => library_item,
            'vm' => vm,
        })
    end

### - (`Void`) unmount(vm, cdrom)

Unmounts a previously mounted CD-ROM using an ISO image as a backing.

Parameters:

- vm (`String`) —

  The identifier of the virtual machine from which to unmount the virtual CD-ROM.

- cdrom (`String`) —

  The device identifier of the CD-ROM.

Returns:

- (`Void`)

Raises:

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

  If the virtual machine identified by ``vm`` is not found or the ``cdrom`` does not identify a virtual CD-ROM in the virtual machine.

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

  When the operation is not allowed on the virtual machine in its current state.

    111
    112
    113
    114
    115
    116
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/iso.rb', line 111

    def unmount(vm, cdrom)
        invoke_with_info(@@unmount_info, {
            'vm' => vm,
            'cdrom' => cdrom,
        })
    end