The Content Library Item module provides classes and classes for managing files in a library item.
Bases: vmware.vapi.bindings.stub.VapiInterface
The DownloadSession class manipulates download sessions, which are used to download content from the Content Library Service.
A download session is an object that tracks the download of content (that is, downloading content from the Content Library Service) and acts as a lease to keep the download links available.
The com.vmware.content.library.item.downloadsession_client.File class provides access to the download links.
Parameters: | config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub. |
---|
Resource type for a download session.
Cancels the download session. This method will abort any ongoing transfers and invalidate transfer urls that the client may be downloading from.
Parameters: | download_session_id (str) – Identifer of the download session that should be canceled. The parameter must be an identifier for the resource type: com.vmware.content.library.item.DownloadSession. |
---|---|
Raise: | com.vmware.vapi.std.errors_client.NotFound if no download session with the given identifier exists. |
Raise: | com.vmware.vapi.std.errors_client.NotAllowedInCurrentState if the download session is not in the DownloadSessionModel.State.ACTIVE state. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Creates a new download session.
Parameters: |
|
---|---|
Return type: | str |
Returns: | Identifier of the new download session being created. The return value will be an identifier for the resource type: com.vmware.content.library.item.DownloadSession. |
Raise: | com.vmware.vapi.std.errors_client.InvalidArgument if the session specification is not valid. |
Raise: | com.vmware.vapi.std.errors_client.InvalidArgument format. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if the library item targeted by the download does not exist. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Deletes a download session. This removes the session and all information associated with it.
Removing a download session leaves any current transfers for that session in an indeterminate state (there is no guarantee that the transfers will be able to complete). However there will no longer be a means of inspecting the status of those downloads except by seeing the effect on the library item.
Download sessions for which there is no download activity or which are complete will automatically be expired and then deleted after a period of time.
Parameters: | download_session_id (str) – Identifier of the download session to be deleted. The parameter must be an identifier for the resource type: com.vmware.content.library.item.DownloadSession. |
---|---|
Raise: | com.vmware.vapi.std.errors_client.NotFound if the download session does not exist. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Terminates the download session with a client specified error message.
This is useful in transmitting client side failures (for example, not being able to download a file) to the server side.
Parameters: |
|
---|---|
Raise: | com.vmware.vapi.std.errors_client.NotFound if the download session does not exist. |
Raise: | com.vmware.vapi.std.errors_client.NotAllowedInCurrentState if the download session is not in the DownloadSessionModel.State.ACTIVE state. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Gets the download session with the specified identifier, including the most up-to-date status information for the session.
Parameters: | download_session_id (str) – Identifier of the download session to retrieve. The parameter must be an identifier for the resource type: com.vmware.content.library.item.DownloadSession. |
---|---|
Return type: | |
Returns: | The DownloadSessionModel instance with the given download_session_id. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if no download session with the given download_session_id exists. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Keeps a download session alive. This operation is allowed only if the session is in the DownloadSessionModel.State.ACTIVE state.
If there is no activity for a download session for a certain period of time, the download session will expire. The download session expiration timeout is configurable in the Content Library Service system configuration. The default is five minutes. Invoking this method enables a client to specifically extend the lifetime of an active download session.
Parameters: |
|
---|---|
Raise: | com.vmware.vapi.std.errors_client.NotFound if no download session with the given identifier exists. |
Raise: | com.vmware.vapi.std.errors_client.NotAllowedInCurrentState if the download session is not in the DownloadSessionModel.State.ACTIVE state. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Lists the identifiers of the download sessions created by the calling user. Optionally may filter by library item.
Parameters: | library_item_id (str or None) – Library item identifier on which to filter results. The parameter must be an identifier for the resource type: com.vmware.content.library.item.DownloadSession. If not specified all download session identifiers are listed. |
---|---|
Return type: | list of str |
Returns: | The list of identifiers of all download sessions created by the calling user. The return value will contain identifiers for the resource type: com.vmware.content.library.item.DownloadSession. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if a library item identifier is given for an item which does not exist. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Bases: vmware.vapi.bindings.struct.VapiStruct
The DownloadSessionModel class provides information on an active DownloadSession resource.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Bases: vmware.vapi.bindings.enum.Enum
The state of the download session.
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 State instance. |
---|
The session is active. Individual files may be in the process of being transferred and may become ready for download at different times.
The session has been canceled. On-going downloads may fail. The session will stay in this state until it is either deleted by the user or automatically cleaned up by the Content Library Service.
Indicates there was an error during the session lifecycle.
Bases: vmware.vapi.bindings.stub.VapiInterface
The File class can be used to query for information on the files within a library item. Files are objects which are added to a library item through the UpdateSession and com.vmware.content.library.item.updatesession_client.File classes.
Parameters: | config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub. |
---|
Bases: vmware.vapi.bindings.enum.Enum
The File.ChecksumAlgorithm class defines the valid checksum algorithms.
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 ChecksumAlgorithm instance. |
---|
Checksum algorithm: MD5
Checksum algorithm: SHA-1
Bases: vmware.vapi.bindings.struct.VapiStruct
Provides checksums for a File.Info object.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Bases: vmware.vapi.bindings.struct.VapiStruct
The File.Info class provides information about a file in Content Library Service storage.
A file is an actual stored object for a library item. An item will have zero files initially, but one or more can be uploaded to the item.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Retrieves the information for a single file in a library item by its name.
Parameters: |
|
---|---|
Return type: | |
Returns: | The File.Info object with information on the specified file. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if library_item_id refers to a library item that does not exist. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if name refers to a file that does not exist in the library item. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Lists all of the files that are stored within a given library item.
Parameters: | library_item_id (str) – Identifier of the library item whose files should be listed. The parameter must be an identifier for the resource type: com.vmware.content.library.Item. |
---|---|
Return type: | |
Returns: | The list of all of the files that are stored within the given library item. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if library_item_id refers to a library item that does not exist. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Bases: vmware.vapi.bindings.stub.VapiInterface
Storage is a resource that represents a specific instance of a file stored on a storage backing. Unlike File, which is abstract, storage represents concrete files on the various storage backings. A file is only represented once in File, but will be represented multiple times (once for each storage backing) in Storage. The Storage class provides information on the storage backing and the specific location of the file in that backing to privileged users who want direct access to the file on the storage medium.
Parameters: | config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub. |
---|
Bases: vmware.vapi.bindings.struct.VapiStruct
The Storage.Info class is the expanded form of File.Info that includes details about the storage backing for a file in a library item.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Retrieves the storage information for a specific file in a library item.
Parameters: |
|
---|---|
Return type: | list of Storage.Info |
Returns: | The list of all the storage items for the given file within the given library item. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if the specified library item does not exist. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if the specified file does not exist in the given library item. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Lists all storage items for a given library item.
Parameters: | library_item_id (str) – Identifier of the library item whose storage information should be listed. The parameter must be an identifier for the resource type: com.vmware.content.library.Item. |
---|---|
Return type: | list of Storage.Info |
Returns: | The list of all storage items for a given library item. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if the specified library item does not exist. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Bases: vmware.vapi.bindings.struct.VapiStruct
The TransferEndpoint class encapsulates a URI along with extra information about it.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Bases: vmware.vapi.bindings.enum.Enum
The TransferStatus class defines the transfer state of a 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 TransferStatus instance. |
---|
Indicates that there was an error transferring or validating the file.
Indicates that the file has been fully transferred and is ready to be used.
Indicates that data is being transferred to the file.
Indicates that the file is being validated (checksum, type adapters).
Indicates that a file has been defined for a library item and its content needs to be uploaded.
Bases: vmware.vapi.bindings.stub.VapiInterface
The UpdateSession class manipulates sessions that are used to upload content into the Content Library Service, and/or to remove files from a library item.
An update session is a resource which tracks changes to content. An update session is created with a set of files that are intended to be uploaded to a specific com.vmware.content.library_client.ItemModel, or removed from an item. The session object can be used to track the uploads and inspect the changes that are being made to the item by that upload. It can also serve as a channel to check on the result of the upload, and status messages such as errors and warnings for the upload.
Modifications are not visible to other clients unless the session is completed and all necessary files have been received.
The management of the files within the session is done through the com.vmware.content.library.item.updatesession_client.File class.
Parameters: | config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub. |
---|
Resource type for an update session.
Cancels the update session and deletes it. This method will free up any temporary resources currently associated with the session.
This method is not allowed if the session has been already completed.
Cancelling an update session will cancel any in progress transfers (either uploaded by the client or pulled by the server). Any content that has been already received will be scheduled for deletion.
Parameters: | update_session_id (str) – Identifier of the update session that should be canceled. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession. |
---|---|
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 UpdateSessionModel.State.ACTIVE state. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Completes the update session. This indicates that the client has finished making all the changes required to the underlying library item. If the client is pushing the content to the server, the library item will be updated once this call returns. If the server is pulling the content, the call may return before the changes become visible. In that case, the client can track the session to know when the server is done.
This method requires the session to be in the UpdateSessionModel.State.ACTIVE state.
Depending on the type of the library item associated with this session, a type adapter may be invoked to verify the validity of the files uploaded. The user can explicitly validate the session before completing the session by using the com.vmware.content.library.item.updatesession_client.File.validate() method.
Modifications are not visible to other clients unless the session is completed and all necessary files have been received.
Parameters: | update_session_id (str) – Identifier of the update session that should be completed. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession. |
---|---|
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 UpdateSessionModel.State.ACTIVE state, or if some of the files that will be uploaded by the client aren’t received correctly. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Creates a new update session. An update session is used to make modifications to a library item. Modifications are not visible to other clients unless the session is completed and all necessary files have been received.
Content Library Service allows only one single update session to be active for a specific library item.
Parameters: |
|
---|---|
Return type: | str |
Returns: | Identifier of the new update session being created. The return value will be an identifier for the resource type: com.vmware.content.library.item.UpdateSession. |
Raise: | com.vmware.vapi.std.errors_client.InvalidArgument if the session specification is not valid. |
Raise: | com.vmware.vapi.std.errors_client.InvalidArgument if the client_token does not conform to the UUID format. |
Raise: | com.vmware.vapi.std.errors_client.InvalidElementType if the update session is being created on a subscribed library item. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if the item targeted for update does not exist. |
Raise: | com.vmware.vapi.std.errors_client.ResourceBusy if there is another update session on the same library item. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Deletes an update session. This removes the session and all information associated with it.
Removing an update session leaves any current transfers for that session in an indeterminate state (there is no guarantee that the server will terminate the transfers, or that the transfers can be completed). However there will no longer be a means of inspecting the status of those uploads except by seeing the effect on the library item.
Update sessions for which there is no upload activity or which are complete will automatically be deleted after a period of time.
Parameters: | update_session_id (str) – Identifer of the update session to delete. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession. |
---|---|
Raise: | com.vmware.vapi.std.errors_client.NotFound if the update session does not exist. |
Raise: | com.vmware.vapi.std.errors_client.NotAllowedInCurrentState if the update session is in the UpdateSessionModel.State.ACTIVE state. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Terminates the update session with a client specified error message.
This is useful in transmitting client side failures (for example, not being able to access a file) to the server side.
Parameters: |
|
---|---|
Raise: | com.vmware.vapi.std.errors_client.NotFound if the update session does not exist. |
Raise: | com.vmware.vapi.std.errors_client.NotAllowedInCurrentState if the update session is not in the UpdateSessionModel.State.ACTIVE state. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Gets the update session with the specified identifier, including the most up-to-date status information for the session.
Parameters: | update_session_id (str) – Identifier of the update session to retrieve. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession. |
---|---|
Return type: | |
Returns: | The UpdateSessionModel instance with the given update_session_id. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if no update session with the given identifier exists. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Keeps an update session alive.
If there is no activity for an update session after a period of time, the update session will expire, then be deleted. The update session expiration timeout is configurable in the Content Library Service system configuration. The default is five minutes. Invoking this method enables a client to specifically extend the lifetime of the update session.
Parameters: |
|
---|---|
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 UpdateSessionModel.State.ACTIVE state. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Lists the identifiers of the update session created by the calling user. Optionally may filter by library item.
Parameters: | library_item_id (str or None) – Optional library item identifier on which to filter results. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession. If not specified the results are not filtered. |
---|---|
Return type: | list of str |
Returns: | The list of identifiers of all update sessions created by the calling user. The return value will contain identifiers for the resource type: com.vmware.content.library.item.UpdateSession. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if a library item identifier is given for an item which does not exist. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Bases: vmware.vapi.bindings.struct.VapiStruct
The UpdateSessionModel class provides information on an active UpdateSession resource.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Bases: vmware.vapi.bindings.enum.Enum
The state of an update session.
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 State instance. |
---|
The session is currently active. This is the initial state when the session is created. Files may be uploaded by the client or pulled by the Content Library Service at this stage.
The session has been canceled.
The session is done and all its effects are now visible.
There was an error during the session.