com.vmware.content.library package¶
Subpackages¶
Submodules¶
com.vmware.content.library.item_client module¶
The Content Library Item module provides classes and classes for managing files in a library item.
-
class
com.vmware.content.library.item_client.DownloadSession(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterfaceThe
DownloadSessionclass 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.Fileclass provides access to the download links.-
RESOURCE_TYPE= 'com.vmware.content.library.item.DownloadSession'¶ Resource type for a download session.
-
cancel(download_session_id)¶ 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.NotFoundif no download session with the given identifier exists.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the download session is not in theDownloadSessionModel.State.ACTIVEstate.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires
System.Anonymous.
- Method execution requires
-
create(create_spec, client_token=None)¶ Creates a new download session.
Parameters: - client_token (
strorNone) – A unique token generated by 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. - create_spec (
DownloadSessionModel) – Specification for the new download session to be created.
Return type: strReturns: 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.InvalidArgumentif the session specification is not valid.Raise: com.vmware.vapi.std.errors_client.InvalidArgumentformat.Raise: com.vmware.vapi.std.errors_client.NotFoundif the library item targeted by the download does not exist.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource
com.vmware.content.library.Itemreferenced by the attributeDownloadSessionModel.library_item_idrequiresContentLibrary.DownloadSession.
- client_token (
-
delete(download_session_id)¶ 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.NotFoundif the download session does not exist.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires
System.Anonymous.
- Method execution requires
-
fail(download_session_id, client_error_message)¶ 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: - download_session_id (
str) – Identifier of the download session to fail. The parameter must be an identifier for the resource type:com.vmware.content.library.item.DownloadSession. - client_error_message (
str) – Client side error message. This can be useful in providing some extra details about the client side failure. Note that the message won’t be translated to the user’s locale.
Raise: com.vmware.vapi.std.errors_client.NotFoundif the download session does not exist.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the download session is not in theDownloadSessionModel.State.ACTIVEstate.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires
System.Anonymous.
- download_session_id (
-
get(download_session_id)¶ 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
DownloadSessionModelinstance with the givendownload_session_id.Raise: com.vmware.vapi.std.errors_client.NotFoundif no download session with the givendownload_session_idexists.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires
System.Anonymous.
- Method execution requires
-
keep_alive(download_session_id, progress=None)¶ Keeps a download session alive. This operation is allowed only if the session is in the
DownloadSessionModel.State.ACTIVEstate.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: - download_session_id (
str) – Identifier of the download session whose lifetime should be extended. The parameter must be an identifier for the resource type:com.vmware.content.library.item.DownloadSession. - progress (
longorNone) – Optional update to the progress property of the session. If specified, the new progress should be greater then the current progress. SeeDownloadSessionModel.client_progress. If not specified the progress is not updated.
Raise: com.vmware.vapi.std.errors_client.NotFoundif no download session with the given identifier exists.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the download session is not in theDownloadSessionModel.State.ACTIVEstate.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires
System.Anonymous.
- download_session_id (
-
list(library_item_id=None)¶ Lists the identifiers of the download sessions created by the calling user. Optionally may filter by library item.
Parameters: library_item_id (
strorNone) – 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: listofstrReturns: The
listof 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.NotFoundif a library item identifier is given for an item which does not exist.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource
com.vmware.content.library.item.DownloadSessionreferenced by the parameterlibrary_item_idrequiresContentLibrary.DownloadSession.
- The resource
-
-
class
com.vmware.content.library.item_client.DownloadSessionModel(id=None, library_item_id=None, library_item_content_version=None, error_message=None, client_progress=None, state=None, expiration_time=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
DownloadSessionModelclass provides information on an activeDownloadSessionresource.Tip
The arguments are used to initialize data attributes with the same names.
-
class
State(string)¶ Bases:
vmware.vapi.bindings.enum.EnumThe 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.
-
ACTIVE= State(string='ACTIVE')¶ The session is active. Individual files may be in the process of being transferred and may become ready for download at different times.
-
CANCELED= State(string='CANCELED')¶ 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.
-
ERROR= State(string='ERROR')¶ Indicates there was an error during the session lifecycle.
-
-
class
-
class
com.vmware.content.library.item_client.File(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterfaceThe
Fileclass 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 theUpdateSessionandcom.vmware.content.library.item.updatesession_client.Fileclasses.-
class
ChecksumAlgorithm(string)¶ Bases:
vmware.vapi.bindings.enum.EnumThe
File.ChecksumAlgorithmclass 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.
-
MD5= ChecksumAlgorithm(string='MD5')¶ Checksum algorithm: MD5
-
SHA1= ChecksumAlgorithm(string='SHA1')¶ Checksum algorithm: SHA-1
-
-
class
ChecksumInfo(algorithm=None, checksum=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructProvides checksums for a
File.Infoobject.Tip
The arguments are used to initialize data attributes with the same names.
-
class
Info(checksum_info=None, name=None, size=None, cached=None, version=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
File.Infoclass 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.
-
get(library_item_id, name)¶ Retrieves the information for a single file in a library item by its name.
Parameters: - library_item_id (
str) – Identifier of the library item whose file information should be returned. The parameter must be an identifier for the resource type:com.vmware.content.library.Item. - name (
str) – Name of the file in the library item whose information should be returned.
Return type: Returns: The
File.Infoobject with information on the specified file.Raise: com.vmware.vapi.std.errors_client.NotFoundiflibrary_item_idrefers to a library item that does not exist.Raise: com.vmware.vapi.std.errors_client.NotFoundifnamerefers to a file that does not exist in the library item.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource
com.vmware.content.library.Itemreferenced by the parameterlibrary_item_idrequiresSystem.Read.
- library_item_id (
-
list(library_item_id)¶ 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
listof all of the files that are stored within the given library item.Raise: com.vmware.vapi.std.errors_client.NotFoundiflibrary_item_idrefers to a library item that does not exist.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource
com.vmware.content.library.Itemreferenced by the parameterlibrary_item_idrequiresSystem.Read.
- The resource
-
class
-
class
com.vmware.content.library.item_client.Storage(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterfaceStorageis a resource that represents a specific instance of a file stored on a storage backing. UnlikeFile, which is abstract, storage represents concrete files on the various storage backings. A file is only represented once inFile, but will be represented multiple times (once for each storage backing) inStorage. TheStorageclass 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.-
class
Info(storage_backing=None, storage_uris=None, checksum_info=None, name=None, size=None, cached=None, version=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Storage.Infoclass is the expanded form ofFile.Infothat 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.
-
get(library_item_id, file_name)¶ Retrieves the storage information for a specific file in a library item.
Parameters: - library_item_id (
str) – Identifier of the library item whose storage information should be retrieved. The parameter must be an identifier for the resource type:com.vmware.content.library.Item. - file_name (
str) – Name of the file for which the storage information should be listed.
Return type: listofStorage.InfoReturns: The
listof all the storage items for the given file within the given library item.Raise: com.vmware.vapi.std.errors_client.NotFoundif the specified library item does not exist.Raise: com.vmware.vapi.std.errors_client.NotFoundif the specified file does not exist in the given library item.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource
com.vmware.content.library.Itemreferenced by the parameterlibrary_item_idrequiresContentLibrary.ReadStorage.
- library_item_id (
-
list(library_item_id)¶ 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: listofStorage.InfoReturns: The
listof all storage items for a given library item.Raise: com.vmware.vapi.std.errors_client.NotFoundif the specified library item does not exist.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource
com.vmware.content.library.Itemreferenced by the parameterlibrary_item_idrequiresContentLibrary.ReadStorage.
- The resource
-
class
-
class
com.vmware.content.library.item_client.StubFactory(stub_config)¶ Bases:
vmware.vapi.bindings.stub.StubFactoryBase
-
class
com.vmware.content.library.item_client.TransferEndpoint(uri=None, ssl_certificate_thumbprint=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
TransferEndpointclass encapsulates a URI along with extra information about it.Tip
The arguments are used to initialize data attributes with the same names.
-
class
com.vmware.content.library.item_client.TransferStatus(string)¶ Bases:
vmware.vapi.bindings.enum.EnumThe
TransferStatusclass 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.
-
ERROR= TransferStatus(string='ERROR')¶ Indicates that there was an error transferring or validating the file.
-
READY= TransferStatus(string='READY')¶ Indicates that the file has been fully transferred and is ready to be used.
-
TRANSFERRING= TransferStatus(string='TRANSFERRING')¶ Indicates that data is being transferred to the file.
-
VALIDATING= TransferStatus(string='VALIDATING')¶ Indicates that the file is being validated (checksum, type adapters).
-
WAITING_FOR_TRANSFER= TransferStatus(string='WAITING_FOR_TRANSFER')¶ Indicates that a file has been defined for a library item and its content needs to be uploaded.
-
-
class
com.vmware.content.library.item_client.UpdateSession(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterfaceThe
UpdateSessionclass 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.Fileclass.-
RESOURCE_TYPE= 'com.vmware.content.library.item.UpdateSession'¶ Resource type for an update session.
-
cancel(update_session_id)¶ Cancels the update session and sets its state to
UpdateSessionModel.State.CANCELED. 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.NotFoundif no update session with the given identifier exists.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the update session is not in theUpdateSessionModel.State.ACTIVEstate.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires
System.Anonymous.
- Method execution requires
-
complete(update_session_id)¶ 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.ACTIVEstate.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.NotFoundif no update session with the given identifier exists.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the update session is not in theUpdateSessionModel.State.ACTIVEstate, or if some of the files that will be uploaded by the client aren’t received correctly.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires
System.Anonymous.
- Method execution requires
-
create(create_spec, client_token=None)¶ 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: - client_token (
strorNone) – Unique token generated by 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. - create_spec (
UpdateSessionModel) – Specification for the new update session to be created.
Return type: strReturns: 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.InvalidArgumentif the session specification is not valid.Raise: com.vmware.vapi.std.errors_client.InvalidArgumentif theclient_tokendoes not conform to the UUID format.Raise: com.vmware.vapi.std.errors_client.InvalidElementTypeif the update session is being created on a subscribed library item.Raise: com.vmware.vapi.std.errors_client.NotFoundif the item targeted for update does not exist.Raise: com.vmware.vapi.std.errors_client.ResourceBusyif there is another update session on the same library item.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource
com.vmware.content.library.Itemreferenced by the attributeUpdateSessionModel.library_item_idrequiresContentLibrary.UpdateSession.
- client_token (
-
delete(update_session_id)¶ 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.NotFoundif the update session does not exist.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the update session is in theUpdateSessionModel.State.ACTIVEstate.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires
System.Anonymous.
- Method execution requires
-
fail(update_session_id, client_error_message)¶ 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: - update_session_id (
str) – Identifier of the update session to fail. The parameter must be an identifier for the resource type:com.vmware.content.library.item.UpdateSession. - client_error_message (
str) – Client side error message. This can be useful in providing some extra details about the client side failure. Note that the message won’t be translated to the user’s locale.
Raise: com.vmware.vapi.std.errors_client.NotFoundif the update session does not exist.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the update session is not in theUpdateSessionModel.State.ACTIVEstate.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires
System.Anonymous.
- update_session_id (
-
get(update_session_id)¶ 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
UpdateSessionModelinstance with the givenupdate_session_id.Raise: com.vmware.vapi.std.errors_client.NotFoundif no update session with the given identifier exists.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires
System.Anonymous.
- Method execution requires
-
keep_alive(update_session_id, client_progress=None)¶ 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: - update_session_id (
str) – Identifier of the update session whose lifetime should be extended. The parameter must be an identifier for the resource type:com.vmware.content.library.item.UpdateSession. - client_progress (
longorNone) – Optional update to the progress property of the session. If specified, the new progress should be greater then the current progress. SeeUpdateSessionModel.client_progress. If not specified the progress is not updated.
Raise: com.vmware.vapi.std.errors_client.NotFoundif no update session with the given identifier exists.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the update session is not in theUpdateSessionModel.State.ACTIVEstate.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires
System.Anonymous.
- update_session_id (
-
list(library_item_id=None)¶ Lists the identifiers of the update session created by the calling user. Optionally may filter by library item.
Parameters: library_item_id (
strorNone) – 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: listofstrReturns: The
listof 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.NotFoundif a library item identifier is given for an item which does not exist.Raise: com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource
com.vmware.content.library.item.UpdateSessionreferenced by the parameterlibrary_item_idrequiresContentLibrary.UpdateSession.
- The resource
-
-
class
com.vmware.content.library.item_client.UpdateSessionModel(id=None, library_item_id=None, library_item_content_version=None, error_message=None, client_progress=None, state=None, expiration_time=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
UpdateSessionModelclass provides information on an activeUpdateSessionresource.Tip
The arguments are used to initialize data attributes with the same names.
-
class
State(string)¶ Bases:
vmware.vapi.bindings.enum.EnumThe 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.
-
ACTIVE= State(string='ACTIVE')¶ 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.
-
CANCELED= State(string='CANCELED')¶ The session has been canceled.
-
DONE= State(string='DONE')¶ The session is done and all its effects are now visible.
-
ERROR= State(string='ERROR')¶ There was an error during the session.
-
-
class