|
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 | AddSpec |
| class | Info |
| class | SourceType |
| class | ValidationError |
| class | ValidationResult |
Avaliable Methods | |
| public method | remove () |
| public method | add () |
| public method | get () |
| public method | new () |
| public method | list () |
| public method | validate () |
The Com::Vmware::Content::Library::Item::Updatesession::File interface provides methods for accessing files within an update session.
After an update session is created against a library item, the Com::Vmware::Content::Library::Item::Updatesession::File interface can be used to make changes to the underlying library item metadata as well as the content of the files. The following changes can be made:
The above changes are not applied or visible until the session is completed. See class Com::Vmware::Content::Library::Item::UpdateSession .
| public method Com::Vmware::Content::Library::Item::Updatesession::File::add | ( | ) |
Requests file content to be changed (either created, or updated). Depending on the source type of the file, this method will either return an upload endpoint where the client can push the content, or the server will pull from the provided source endpoint. If a file with the same name already exists in this session, this method will be used to update the content of the existing file.
When importing a file directly from storage, where the source endpoint is a file or datastore URI, you will need to have the ContentLibrary.ReadStorage privilege on the library item. If the file is located in the same directory as the library storage backing folder, the server will move the file instead of copying it, thereby allowing instantaneous import of files for efficient backup and restore scenarios. In all other cases, a copy is performed rather than a move.
| update_session_id | [REQUIRED] Identifier of the update session to be modified. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). . The value must be str. |
| file_spec | [REQUIRED] Specification for the file that needs to be added or updated. This includes whether the client wants to push the content or have the server pull it. . The value must be Com::Vmware::Content::Library::Item::Updatesession::File::AddSpec. |
| An | class Com::Vmware::Content::Library::Item::Updatesession::File::Info class containing upload links as well as server side state tracking the transfer of the file. The return type will be Com::Vmware::Content::Library::Item::Updatesession::File::Info |
| Com::Vmware::Vapi::Std::Errors::InvalidArgument | if the file_spec is invalid. |
| Com::Vmware::Vapi::Std::Errors::NotFound | if the update session doesn't exist. |
| Com::Vmware::Vapi::Std::Errors::Unauthorized | if the caller doesn't have ContentLibrary.ReadStorage privilege on the library item of the update session and source type :attr:Com::Vmware::Content::Library::Item::Updatesession::File::SourceType.PULL is requested for a file or datastore source endpoint (that is, not HTTP or HTTPs based endpoint). |
Code:
| public method Com::Vmware::Content::Library::Item::Updatesession::File::get | ( | ) |
Retrieves information about a specific file in the snapshot of the library item at the time when the update session was created.
| update_session_id | [REQUIRED] Identifier of the update session. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). . The value must be str. |
| file_name | [REQUIRED] Name of the file. . The value must be String. |
| Information | about the file. The return type will be Com::Vmware::Content::Library::Item::Updatesession::File::Info |
| Com::Vmware::Vapi::Std::Errors::NotFound | if the update session doesn't exist. |
| Com::Vmware::Vapi::Std::Errors::InvalidArgument | if the file doesn't exist in the library item associated with the update session. |
Code:
| public method Com::Vmware::Content::Library::Item::Updatesession::File::list | ( | ) |
Lists all files in the library item associated with the update session.
| update_session_id | [REQUIRED] Identifier of the update session. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). . The value must be str. |
| The | list of the files in the library item associated with the update session. This list* may be empty if the caller has removed all the files as part of this session (in which case completing the update session will result in an empty library item). The return type will be Array of Com::Vmware::Content::Library::Item::Updatesession::File::Info |
| Com::Vmware::Vapi::Std::Errors::NotFound | if the update session doesn't exist. |
Code:
| public method Com::Vmware::Content::Library::Item::Updatesession::File::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::Updatesession::File::remove | ( | ) |
Requests a file to be removed. The file will only be effectively removed when the update session is completed.
| update_session_id | [REQUIRED] Identifier of the update session. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). . The value must be str. |
| file_name | [REQUIRED] Name of the file to be removed. . The value must be String. |
| Com::Vmware::Vapi::Std::Errors::NotFound | if the update session doesn't exist. |
| Com::Vmware::Vapi::Std::Errors::InvalidArgument | if the file doesn't exist in the library item associated with the update session. |
Code:
| public method Com::Vmware::Content::Library::Item::Updatesession::File::validate | ( | ) |
Validates the files in the update session with the referenced identifier and ensures all necessary files are received. In the case where a file is missing, this method will return its name in the :attr:Com::Vmware::Content::Library::Item::Updatesession::File::ValidationResult.missing_files set. The user can add the missing files and try re-validating. For other type of errors, :attr:Com::Vmware::Content::Library::Item::Updatesession::File::ValidationResult.invalid_files will contain the list of invalid files.
| update_session_id | [REQUIRED] Identifier of the update session to validate. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). . The value must be str. |
| A | validation result containing missing files or invalid files and the reason why they are invalid. The return type will be Com::Vmware::Content::Library::Item::Updatesession::File::ValidationResult |
| Com::Vmware::Vapi::Std::Errors::NotFound | if no update session with the given identifier exists. |
| Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the update session is not in the :attr:Com::Vmware::Content::Library::Item::UpdateSessionModel::State.ACTIVE state, or if some of the files that will be uploaded by the client aren't received correctly. |
Code: