Class List Method List File List

# Class: Com::Vmware::Vcenter::Ovf::LibraryItem

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

## Overview

The ``Com::Vmware::Vcenter::Ovf::LibraryItem`` class provides methods to deploy virtual machines and virtual appliances from library items containing Open Virtualization Format (OVF) packages in content library, as well as methods to create library items in content library from virtual machines and virtual appliances.

     To deploy a virtual machine or a virtual appliance from a library item:

      #  Create a   :class:`Com::Vmware::Vcenter::Ovf::LibraryItem::DeploymentTarget`   to specify the target deployment type and target deployment designation.
       #  Create a   :class:`Com::Vmware::Vcenter::Ovf::LibraryItem::ResourcePoolDeploymentSpec`   to specify the parameters for the target deployment.
       #  Use the  ``deploy``   method  with the created target and parameter specifications, along with the identifier of the specified source content library item. See   :func:`Com::Vmware::Vcenter::Ovf::LibraryItem.deploy`  .

     To create a library item in content library from a virtual machine or virtual appliance:

      #  Create a   :class:`Com::Vmware::Vcenter::Ovf::LibraryItem::DeployableIdentity`   to specify the source virtual machine or virtual appliance to be used as the OVF template source.
       #  Create a   :class:`Com::Vmware::Vcenter::Ovf::LibraryItem::CreateTarget`   to specify the target library and library item.
       #  Create a   :class:`Com::Vmware::Vcenter::Ovf::LibraryItem::CreateSpec`   to specify the settings for the OVF package to be created.
       #  Use the  ``create``   method  with the created target and parameter specifications, along with the specified source entity. See   :func:`Com::Vmware::Vcenter::Ovf::LibraryItem.create`  .

## Defined Under Namespace

Classes: CreateResult, CreateSpec, CreateTarget, DeployableIdentity, DeploymentResult, DeploymentTarget, OvfSummary, ResourcePoolDeploymentSpec, ResultInfo, StorageGroupMapping

## Constant Summary

DEPLOYABLE =

      ['VirtualMachine', 'VirtualApp']

## Instance Method Summary (collapse)

- - (Com::Vmware::Vcenter::Ovf::LibraryItem::CreateResult) create(source, target, create_spec, client_token = nil)

  Creates a library item in content library from a virtual machine or virtual appliance.

- - (Com::Vmware::Vcenter::Ovf::LibraryItem::DeploymentResult) deploy(ovf_library_item_id, target, deployment_spec, client_token = nil)

  Deploys an OVF package stored in content library to a newly created virtual machine or virtual appliance.

- - (Com::Vmware::Vcenter::Ovf::LibraryItem::OvfSummary) filter(ovf_library_item_id, target)

  Queries an OVF package stored in content library to retrieve information to use when deploying the package.

- - (LibraryItem) initialize(config) constructor

  Constructs a new instance.

## Constructor Details

### - (`LibraryItem`) initialize(config)

Constructs a new instance.

Parameters:

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

  A hash with the api provider details.

    312
    313
    314
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/ovf.rb', line 312

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

## Instance Method Details

### - (`Com::Vmware::Vcenter::Ovf::LibraryItem::CreateResult`) create(source, target, create_spec, client_token = nil)

Creates a library item in content library from a virtual machine or virtual appliance.

     This  method  creates a library item in content library whose content is an OVF package derived from a source virtual machine or virtual appliance, using the supplied create specification. The OVF package may be stored as in a newly created library item or in an in an existing library item. For an existing library item whose content is updated by this  method , the original content is overwritten.

        If  nil , the server will create a token.

Parameters:

- client_token (`String`, `nil`) (defaults to: `nil`) —

  Client-generated token used to retry a request if the client fails to get a response from the server. If the original request succeeded, the result of that request will be returned, otherwise the operation will be retried.

- source (`Com::Vmware::Vcenter::Ovf::LibraryItem::DeployableIdentity`) —

  Identifier of the virtual machine or virtual appliance to use as the source.

- target (`Com::Vmware::Vcenter::Ovf::LibraryItem::CreateTarget`) —

  Specification of the target content library and library item.

- create_spec (`Com::Vmware::Vcenter::Ovf::LibraryItem::CreateSpec`) —

  Information used to create the OVF package from the source virtual machine or virtual appliance.

Returns:

- (`Com::Vmware::Vcenter::Ovf::LibraryItem::CreateResult`) —

  Information about the success or failure of the method , along with the details of the result or failure.

Raises:

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

  if ``create_spec`` contains invalid arguments.

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

  if ``source`` describes an unexpected resource type.

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

  if the virtual machine or virtual appliance specified by ``source`` does not exist.

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

  if the library or library item specified by ``target`` does not exist.

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

  if the operation cannot be performed because of the specified virtual machine or virtual appliance’s current state. For example, if the virtual machine configuration information is not available, or if the virtual appliance is running.

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

  if there was an error accessing a file from the source virtual machine or virtual appliance.

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

  if the specified virtual machine or virtual appliance is busy.

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

  If you do not have all of the privileges described in the following list:

  System.Read

    430
    431
    432
    433
    434
    435
    436
    437
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/ovf.rb', line 430

    def create(source, target, create_spec, client_token=nil)
        invoke_with_info(@@create_info, {
            'client_token' => client_token,
            'source' => source,
            'target' => target,
            'create_spec' => create_spec,
        })
    end

### - (`Com::Vmware::Vcenter::Ovf::LibraryItem::DeploymentResult`) deploy(ovf_library_item_id, target, deployment_spec, client_token = nil)

Deploys an OVF package stored in content library to a newly created virtual machine or virtual appliance.

     This  method  deploys an OVF package which is stored in the library item specified by  ``ovf_library_item_id`` . It uses the deployment specification in  ``deployment_spec``  to deploy the OVF package to the location specified by  ``target`` .

        If  nil , the server will create a token.

Parameters:

- client_token (`String`, `nil`) (defaults to: `nil`) —

  Client-generated token used to retry a request if the client fails to get a response from the server. If the original request succeeded, the result of that request will be returned, otherwise the operation will be retried.

- ovf_library_item_id (`String`) —

  Identifier of the content library item containing the OVF package to be deployed.

- target (`Com::Vmware::Vcenter::Ovf::LibraryItem::DeploymentTarget`) —

  Specification of the deployment target.

- deployment_spec (`Com::Vmware::Vcenter::Ovf::LibraryItem::ResourcePoolDeploymentSpec`) —

  Specification of how the OVF package should be deployed to the target.

Returns:

- (`Com::Vmware::Vcenter::Ovf::LibraryItem::DeploymentResult`) —

  Information about the success or failure of the method , along with the details of the result or failure.

Raises:

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

  if ``target`` contains invalid arguments.

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

  if ``deployment_spec`` contains invalid arguments or has fields that are inconsistent with ``target`` .

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

  if the library item specified by ``ovf_library_item_id`` does not exist.

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

  if any resource specified by a field of the :class:`Com::Vmware::Vcenter::Ovf::LibraryItem::DeploymentTarget` class , specified by ``target`` , does not exist.

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

  if there was an error accessing the OVF package stored in the library item specified by ``ovf_library_item_id`` .

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

  if you do not have all of the privileges described as follows :

       * Method  execution requires VirtualMachine.Config.AddNewDisk if the OVF descriptor has a disk drive (type 17) section.
        * Method  execution requires VirtualMachine.Config.AdvancedConfig if the OVF descriptor has an ExtraConfig section.
        * Method  execution requires Extension.Register for specified resource group if the OVF descriptor has a vServiceDependency section.
        * Method  execution requires Network.Assign for target network if specified.
        * Method  execution requires Datastore.AllocateSpace for target datastore if specified.

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

  If you do not have all of the privileges described in the following list:

  System.Read

    357
    358
    359
    360
    361
    362
    363
    364
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/ovf.rb', line 357

    def deploy(ovf_library_item_id, target, deployment_spec, client_token=nil)
        invoke_with_info(@@deploy_info, {
            'client_token' => client_token,
            'ovf_library_item_id' => ovf_library_item_id,
            'target' => target,
            'deployment_spec' => deployment_spec,
        })
    end

### - (`Com::Vmware::Vcenter::Ovf::LibraryItem::OvfSummary`) filter(ovf_library_item_id, target)

Queries an OVF package stored in content library to retrieve information to use when deploying the package. See :func:`Com::Vmware::Vcenter::Ovf::LibraryItem.deploy` .

     This  method  retrieves information from the descriptor of the OVF package stored in the library item specified by  ``ovf_library_item_id`` . The information returned by the  method  can be used to populate the deployment specification (see   :class:`Com::Vmware::Vcenter::Ovf::LibraryItem::ResourcePoolDeploymentSpec`   when deploying the OVF package to the deployment target specified by  ``target`` .

Parameters:

- ovf_library_item_id (`String`) —

  Identifier of the content library item containing the OVF package to query.

- target (`Com::Vmware::Vcenter::Ovf::LibraryItem::DeploymentTarget`) —

  Specification of the deployment target.

Returns:

- (`Com::Vmware::Vcenter::Ovf::LibraryItem::OvfSummary`) —

  Information that can be used to populate the deployment specification (see :class:`Com::Vmware::Vcenter::Ovf::LibraryItem::ResourcePoolDeploymentSpec` ) when deploying the OVF package to the deployment target specified by ``target`` .

Raises:

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

  if ``target`` contains invalid arguments.

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

  if the library item specified by ``ovf_library_item_id`` does not exist.

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

  if any resource specified by a field of the :class:`Com::Vmware::Vcenter::Ovf::LibraryItem::DeploymentTarget` class , specified by ``target`` , does not exist.

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

  if there was an error accessing the OVF package at the specified ``ovf_library_item_id`` .

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

  If you do not have all of the privileges described in the following list:

  System.Read

    389
    390
    391
    392
    393
    394
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/ovf.rb', line 389

    def filter(ovf_library_item_id, target)
        invoke_with_info(@@filter_info, {
            'ovf_library_item_id' => ovf_library_item_id,
            'target' => target,
        })
    end