The Content Library Item Download Session module provides classes and classes for downloading files in a session.
Bases: vmware.vapi.bindings.stub.VapiInterface
The File class provides methods for accessing files within a download session.
After a download session is created against a library item, the File class can be used to retrieve all downloadable content within the library item. Since the content may not be available immediately in a downloadable form on the server side, the client will have to prepare the file and wait for the file status to become File.PrepareStatus.PREPARED.
Parameters: | config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub. |
---|
Bases: vmware.vapi.bindings.enum.Enum
The File.EndpointType class defines the types of endpoints used to download the file.
Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: | string (str) – String value for the EndpointType instance. |
---|
A direct download endpoint indicating the location of the file on storage. The caller is responsible for retrieving the file from the storage location directly.
An https download endpoint.
Bases: vmware.vapi.bindings.struct.VapiStruct
The File.Info class defines the downloaded file.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Bases: vmware.vapi.bindings.enum.Enum
The File.PrepareStatus class defines the state of the file in preparation for download.
Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: | string (str) – String value for the PrepareStatus instance. |
---|
Prepare failed.
Prepare succeeded. The file is ready for download.
A prepare has been requested, however the server hasn’t started the preparation yet.
A prepare has been requested and the file is in the process of being prepared.
The file hasn’t been requested for preparation.
Retrieves file download information for a specific file.
Parameters: |
|
---|---|
Return type: | |
Returns: | The File.Info instance containing the status of the file and its download link if available. |
Raise : | com.vmware.vapi.std.errors_client.NotFound if the download session associated with download_session_id does not exist. |
Raise : | com.vmware.vapi.std.errors_client.InvalidArgument if there is no file with the specified file_name. |
Raise : | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Lists the information of all the files in the library item associated with the download session.
Parameters: | download_session_id (str) – Identifier of the download session. The parameter must be an identifier for the resource type: com.vmware.content.library.item.DownloadSession. |
---|---|
Return type: | |
Returns: | |
Raise : | com.vmware.vapi.std.errors_client.NotFound if the download session associated with download_session_id doesn’t exist. |
Raise : | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Requests a file to be prepared for download.
Parameters: |
|
---|---|
Return type: | |
Returns: | File information containing the status of the request and the download link to the file. |
Raise : | com.vmware.vapi.std.errors_client.NotFound if the download session does not exist. |
Raise : | com.vmware.vapi.std.errors_client.InvalidArgument if there is no file with the specified file_name. |
Raise : | com.vmware.vapi.std.errors_client.Unauthorized if the the download session wasn’t created with the ContentLibrary.ReadStorage privilege and the caller requested a File.EndpointType.DIRECT endpoint type. |
The Content Library Item Update Session module provides classes and classes for updating files in a session.
Bases: vmware.vapi.bindings.stub.VapiInterface
The File class provides methods for accessing files within an update session.
After an update session is created against a library item, the File class 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 com.vmware.content.library.item_client.UpdateSession.
Parameters: | config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub. |
---|
Bases: vmware.vapi.bindings.struct.VapiStruct
The File.AddSpec class describes the properties of the file to be uploaded.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Bases: vmware.vapi.bindings.struct.VapiStruct
The File.Info class defines the uploaded file.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Bases: vmware.vapi.bindings.enum.Enum
The File.SourceType class defines how the file content is retrieved.
Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: | string (str) – String value for the SourceType instance. |
---|
No source type has been requested.
The server is pulling content from a URL. The URL scheme can be http, https, file, or ds.
The client is uploading content using HTTP(S) PUT requests.
Bases: vmware.vapi.bindings.struct.VapiStruct
The File.ValidationError class defines the validation error of a file in the session.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Bases: vmware.vapi.bindings.struct.VapiStruct
The File.ValidationResult class defines the result of validating the files in the session.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
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.
Parameters: |
|
---|---|
Return type: | |
Returns: | An File.Info class containing upload links as well as server side state tracking the transfer of the file. |
Raise : | com.vmware.vapi.std.errors_client.InvalidArgument if the file_spec is invalid. |
Raise : | com.vmware.vapi.std.errors_client.NotFound if the update session doesn’t exist. |
Raise : | com.vmware.vapi.std.errors_client.Unauthorized if the caller doesn’t have ContentLibrary.ReadStorage privilege on the library item of the update session and source type File.SourceType.PULL is requested for a file or datastore source endpoint (that is, not HTTP or HTTPs based endpoint). |
Retrieves information about a specific file in the snapshot of the library item at the time when the update session was created.
Parameters: |
|
---|---|
Return type: | |
Returns: | Information about the file. |
Raise : | com.vmware.vapi.std.errors_client.NotFound if the update session doesn’t exist. |
Raise : | com.vmware.vapi.std.errors_client.InvalidArgument if the file doesn’t exist in the library item associated with the update session. |
Raise : | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Lists all files in the library item associated with the update session.
Parameters: | update_session_id (str) – Identifier of the update session. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession. |
---|---|
Return type: | |
Returns: | 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). |
Raise : | com.vmware.vapi.std.errors_client.NotFound if the update session doesn’t exist. |
Raise : | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Requests a file to be removed. The file will only be effectively removed when the update session is completed.
Parameters: |
|
---|---|
Raise : | com.vmware.vapi.std.errors_client.NotFound if the update session doesn’t exist. |
Raise : | com.vmware.vapi.std.errors_client.InvalidArgument if the file doesn’t exist in the library item associated with the update session. |
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 File.ValidationResult.missing_files set. The user can add the missing files and try re-validating. For other type of errors, File.ValidationResult.invalid_files will contain the list of invalid files.
Parameters: | update_session_id (str) – Identifier of the update session to validate. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession. |
---|---|
Return type: | File.ValidationResult |
Returns: | A validation result containing missing files or invalid files and the reason why they are invalid. |
Raise : | com.vmware.vapi.std.errors_client.NotFound if no update session with the given identifier exists. |
Raise : | com.vmware.vapi.std.errors_client.NotAllowedInCurrentState if the update session is not in the com.vmware.content.library.item_client.UpdateSessionModel.State.ACTIVE state, or if some of the files that will be uploaded by the client aren’t received correctly. |