VMware vSphere Automation SDK Perl
The VMware vSphere Automation SDK for Perl supports the client-side vSphere Automation API for access to vSphere services and capabilities
 All Classes Files Functions
Classes | List of all members
Com::Vmware::Content::Library::Item Class Reference
Inheritance diagram for Com::Vmware::Content::Library::Item:
Com::Vmware::Vapi::Bindings::VapiInterface

Classes

class  FindSpec
 

Avaliable Methods

public method create ()
 
public method find ()
 
public method copy ()
 
public method delete ()
 
public method get ()
 
public method new ()
 
public method update ()
 
public method list ()
 

Detailed Description

The Com::Vmware::Content::Library::Item interface provides methods for managing library items. Constant String::RESOURCE_TYPE # Resource type for item.

Member Function Documentation

public method Com::Vmware::Content::Library::Item::copy ( )

Copies a library item.

Copying a library item allows a duplicate to be made within the same or different library. The copy occurs by first creating a new library item, whose identifier is returned. The content of the library item is then copied asynchronously. This copy can be tracked as a task.

If the copy fails, Content Library Service will roll back the copy by deleting any content that was already copied, and removing the new library item. A failure during rollback may require manual cleanup by an administrator.

A library item cannot be copied into a subscribed library.

Parameters
client_token[OPTIONAL] A unique token generated on the client for each copy request. The token should be a universally unique identifier (UUID), for example: b8a2a2e3-2314-43cd-a871-6ede0f429751 . This token can be used to guarantee idempotent copy. If not specified copy is not idempotent. . The value must be String or None.
source_library_item_id[REQUIRED] Identifier of the existing library item from which the content will be copied. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.Item). . The value must be str.
destination_create_spec[REQUIRED] Specification for the new library item to be created. . The value must be Com::Vmware::Content::Library::ItemModel.
Return values
Theidentifier of the new library item into which the content is being copied. The value will be an identifier for the resource type getQualifiedName(com.vmware.content.library.Item). The return type will be str
Exceptions
Com::Vmware::Vapi::Std::Errors::NotFoundif the library item with source_library_item_id does not exist, or if the library referenced by the :attr:Com::Vmware::Content::Library::ItemModel.library_id property of destination_create_spec does not exist.
Com::Vmware::Vapi::Std::Errors::InvalidArgumentif one of the following is true for the new library item:
  • name is empty
  • name exceeds 80 characters
  • description exceeds 1024 characters
Com::Vmware::Vapi::Std::Errors::InvalidArgumentif the client_token does not conform to the UUID format.
Com::Vmware::Vapi::Std::Errors::InvalidElementTypeif the :attr:Com::Vmware::Content::Library::ItemModel.library_id property of destination_create_spec refers to a subscribed library.
Com::Vmware::Vapi::Std::Errors::ResourceInaccessibleif the copy operation failed because the source or destination library item is not accessible.
Code:
click to view
public method Com::Vmware::Content::Library::Item::create ( )

Creates a new library item.

A new library item is created without any content. After creation, content can be added through the class Com::Vmware::Content::Library::Item::UpdateSession and class Com::Vmware::Content::Library::Item::Updatesession::File interfaces .

A library item cannot be created in a subscribed library.

Parameters
client_token[OPTIONAL] A unique token generated on the client for each creation request. The token should be a universally unique identifier (UUID), for example: b8a2a2e3-2314-43cd-a871-6ede0f429751 . This token can be used to guarantee idempotent creation. If not specified creation is not idempotent. . The value must be String or None.
create_spec[REQUIRED] Specification that defines the properties of the new library item. . The value must be Com::Vmware::Content::Library::ItemModel.
Return values
Identifierof the new library item. The value will be an identifier for the resource type getQualifiedName(com.vmware.content.library.Item). The return type will be str
Exceptions
Com::Vmware::Vapi::Std::Errors::NotFoundif the :attr:Com::Vmware::Content::Library::ItemModel.library_id property of create_spec refers to a library that does not exist.
Com::Vmware::Vapi::Std::Errors::InvalidArgumentif one of the following is true for the new library item:
  • name is empty
  • name exceeds 80 characters
  • description exceeds 1024 characters
Com::Vmware::Vapi::Std::Errors::InvalidArgumentif the client_token does not conform to the UUID format.
Com::Vmware::Vapi::Std::Errors::InvalidElementTypeif the :attr:Com::Vmware::Content::Library::ItemModel.library_id property of destinationCreateSpec refers to a subscribed library.
Code:
click to view
public method Com::Vmware::Content::Library::Item::delete ( )

Deletes a library item.

This method will immediately remove the item from the library that owns it. The content of the item will be asynchronously removed from the storage backings. The content deletion can be tracked with a task. In the event that the task fails, an administrator may need to manually remove the files from the storage backing.

This method cannot be used to delete a library item that is a member of a subscribed library. Removing an item from a subscribed library requires deleting the item from the original published local library and syncing the subscribed library.

Parameters
library_item_id[REQUIRED] Identifier of the library item to delete. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.Item). . The value must be str.
Exceptions
Com::Vmware::Vapi::Std::Errors::InvalidElementTypeif the library item with the given library_item_id is a member of a subscribed library.
Com::Vmware::Vapi::Std::Errors::NotFoundif the library item with the specified library_item_id does not exist.
Code:
click to view
public method Com::Vmware::Content::Library::Item::find ( )

Returns identifiers of all the visible (as determined by authorization policy) library items matching the requested class Com::Vmware::Content::Library::Item::FindSpec .

Parameters
spec[REQUIRED] Specification describing what properties to filter on. . The value must be Com::Vmware::Content::Library::Item::FindSpec.
Return values
Thelist of identifiers of all the visible library items matching the given spec . The value will be an identifier for the resource type getQualifiedName(com.vmware.content.library.Item). The return type will be Array of str
Exceptions
Com::Vmware::Vapi::Std::Errors::InvalidArgumentif no properties are specified in the spec .
Code:
click to view
public method Com::Vmware::Content::Library::Item::get ( )

Returns the class Com::Vmware::Content::Library::ItemModel with the given identifier.

Parameters
library_item_id[REQUIRED] Identifier of the library item to return. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.Item). . The value must be str.
Return values
Theclass Com::Vmware::Content::Library::ItemModel instance with the given library_item_id . The return type will be Com::Vmware::Content::Library::ItemModel
Exceptions
Com::Vmware::Vapi::Std::Errors::NotFoundif no item with the given library_item_id exists.
Code:
click to view
public method Com::Vmware::Content::Library::Item::list ( )

Returns the identifiers of all items in the given library.

Parameters
library_id[REQUIRED] Identifier of the library whose items should be returned. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.Library). . The value must be str.
Return values
Thelist of identifiers of the items in the library specified by library_id . The value will be an identifier for the resource type getQualifiedName(com.vmware.content.library.Item). The return type will be Array of str
Exceptions
Com::Vmware::Vapi::Std::Errors::NotFoundif the library associated with library_id does not exist.
Code:
click to view
public method Com::Vmware::Content::Library::Item::new ( )

Constructor to initialize the object

Parameters
api_provider- protocol connection to use with stubs created by this factory
StubConfig- Stub's additional configuration
Return values
Blessedobject
Code:
click to view
public method Com::Vmware::Content::Library::Item::update ( )

Updates the specified properties of a library item.

This is an incremental update to the library item. Fields that are null in the update specification are left unchanged.

This method cannot update a library item that is a member of a subscribed library. Those items must be updated in the source published library and synchronized to the subscribed library.

Parameters
library_item_id[REQUIRED] Identifier of the library item to update. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.Item). . The value must be str.
update_spec[REQUIRED] Specification of the properties to set. . The value must be Com::Vmware::Content::Library::ItemModel.
Exceptions
Com::Vmware::Vapi::Std::Errors::NotFoundif the library item specified by library_item_id does not exist.
Com::Vmware::Vapi::Std::Errors::InvalidElementTypeif the library item corresponding to library_item_id is a member of a subscribed library.
Com::Vmware::Vapi::Std::Errors::InvalidArgumentif one of the following is true for the update_spec :
  • name is empty
  • name exceeds 80 characters
  • description exceeds 1024 characters
  • version is not equal to the current version of the library item
Code:
click to view

The documentation for this class was generated from the following file: