|
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
|
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 () |
The Com::Vmware::Content::Library::Item interface provides methods for managing library items. Constant String::RESOURCE_TYPE # Resource type for item.
| 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.
| 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. |
| The | identifier 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 |
| Com::Vmware::Vapi::Std::Errors::NotFound | if 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::InvalidArgument | if one of the following is true for the new library item:
|
| Com::Vmware::Vapi::Std::Errors::InvalidArgument | if the client_token does not conform to the UUID format. |
| Com::Vmware::Vapi::Std::Errors::InvalidElementType | if the :attr:Com::Vmware::Content::Library::ItemModel.library_id property of destination_create_spec refers to a subscribed library. |
| Com::Vmware::Vapi::Std::Errors::ResourceInaccessible | if the copy operation failed because the source or destination library item is not accessible. |
Code:
| 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.
| 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. |
| Identifier | of 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 |
| Com::Vmware::Vapi::Std::Errors::NotFound | if 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::InvalidArgument | if one of the following is true for the new library item:
|
| Com::Vmware::Vapi::Std::Errors::InvalidArgument | if the client_token does not conform to the UUID format. |
| Com::Vmware::Vapi::Std::Errors::InvalidElementType | if the :attr:Com::Vmware::Content::Library::ItemModel.library_id property of destinationCreateSpec refers to a subscribed library. |
Code:
| 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.
| 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. |
| Com::Vmware::Vapi::Std::Errors::InvalidElementType | if the library item with the given library_item_id is a member of a subscribed library. |
| Com::Vmware::Vapi::Std::Errors::NotFound | if the library item with the specified library_item_id does not exist. |
Code:
| 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 .
| spec | [REQUIRED] Specification describing what properties to filter on. . The value must be Com::Vmware::Content::Library::Item::FindSpec. |
| The | list 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 |
| Com::Vmware::Vapi::Std::Errors::InvalidArgument | if no properties are specified in the spec . |
Code:
| public method Com::Vmware::Content::Library::Item::get | ( | ) |
Returns the class Com::Vmware::Content::Library::ItemModel with the given identifier.
| 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. |
| The | class Com::Vmware::Content::Library::ItemModel instance with the given library_item_id . The return type will be Com::Vmware::Content::Library::ItemModel |
| Com::Vmware::Vapi::Std::Errors::NotFound | if no item with the given library_item_id exists. |
Code:
| public method Com::Vmware::Content::Library::Item::list | ( | ) |
Returns the identifiers of all items in the given library.
| 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. |
| The | list 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 |
| Com::Vmware::Vapi::Std::Errors::NotFound | if the library associated with library_id does not exist. |
Code:
| public method Com::Vmware::Content::Library::Item::new | ( | ) |
Constructor to initialize the object
| api_provider | - protocol connection to use with stubs created by this factory |
| StubConfig | - Stub's additional configuration |
| Blessed | object |
Code:
| 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.
| 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. |
| Com::Vmware::Vapi::Std::Errors::NotFound | if the library item specified by library_item_id does not exist. |
| Com::Vmware::Vapi::Std::Errors::InvalidElementType | if the library item corresponding to library_item_id is a member of a subscribed library. |
| Com::Vmware::Vapi::Std::Errors::InvalidArgument | if one of the following is true for the update_spec :
|
Code: