The UpdateSession namespace 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 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 File namespace.
List of commands:
dcli com vmware content library item updatesession create
Description
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.
Options
Option Name | Type | Required | Description |
---|---|---|---|
client‑token |
string | No | 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. |
library‑item‑id |
string | No | The identifier of the library item to which content will be uploaded or removed. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: com.vmware.content.library.Item. When commands return a value of this class as a output, the option will be an identifier for the resource type: com.vmware.content.library.Item. This option must be provided for the create command. It will always be present in the output of the get or list commands. It is not used for the update command. |
Example
dcli com vmware content library item updatesession create
dcli com vmware content library item updatesession get
Description
Gets the update session with the specified identifier, including the most up-to-date status information for the session.
Options
Option Name | Type | Required | Description |
---|---|---|---|
update‑session‑id |
string | Yes | Identifier of the update session to retrieve. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession. |
Example
dcli com vmware content library item updatesession get --update-session-id testId
dcli com vmware content library item updatesession list
Description
Lists the identifiers of the update session created by the calling user. Optionally may filter by library item.
Options
Option Name | Type | Required | Description |
---|---|---|---|
library‑item‑id |
string | No | 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. |
Example
dcli com vmware content library item updatesession list
dcli com vmware content library item updatesession complete
Description
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 command requires the session to be in the 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 File.validate command. Modifications are not visible to other clients unless the session is completed and all necessary files have been received.
Options
Option Name | Type | Required | Description |
---|---|---|---|
update‑session‑id |
string | Yes | 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. |
Example
dcli com vmware content library item updatesession complete --update-session-id testId
dcli com vmware content library item updatesession keepalive
Description
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 command enables a client to specifically extend the lifetime of the update session.
Options
Option Name | Type | Required | Description |
---|---|---|---|
update‑session‑id |
string | Yes | 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 |
int | No | Optional update to the progress property of the session. If specified, the new progress should be greater then the current progress. See UpdateSessionModel.client-progress. If not specified the progress is not updated. |
Example
dcli com vmware content library item updatesession keepalive --update-session-id testId
dcli com vmware content library item updatesession cancel
Description
Cancels the update session and sets its state to CANCELED. This command will free up any temporary resources currently associated with the session. This command 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.
Options
Option Name | Type | Required | Description |
---|---|---|---|
update‑session‑id |
string | Yes | 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. |
Example
dcli com vmware content library item updatesession cancel --update-session-id testId
dcli com vmware content library item updatesession fail
Description
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.
Options
Option Name | Type | Required | Description |
---|---|---|---|
update‑session‑id |
string | Yes | 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 |
string | Yes | 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. |
Example
dcli com vmware content library item updatesession fail --update-session-id testId --client-error-message testString
dcli com vmware content library item updatesession delete
Description
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.
Options
Option Name | Type | Required | Description |
---|---|---|---|
update‑session‑id |
string | Yes | Identifer of the update session to delete. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession. |
Example
dcli com vmware content library item updatesession delete --update-session-id testId