VMware

File Namespace

The File namespace provides commands for accessing files within an update session. After an update session is created against a library item, the File namespace 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 UpdateSession.

List of commands:



Validate Command

dcli com vmware content library item updatesession file validate

Description

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 command 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.

Options

Option Name Type Required Description
update‑session‑id string Yes Identifier of the update session to validate. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession.

Example

dcli com vmware content library item updatesession file validate --update-session-id testId


Add Command

dcli com vmware content library item updatesession file add

Description

Requests file content to be changed (either created, or updated). Depending on the source type of the file, this command 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 command 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.

Options

Option Name Type Required Description
update‑session‑id string Yes Identifier of the update session to be modified. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession.
name string Yes The name of the file being uploaded.
source‑type string Yes The source type (NONE, PUSH, PULL) from which the file content will be retrieved. Valid values are: {NONE, PUSH, PULL}
source‑endpoint‑uri string No Transfer endpoint URI. The supported URI schemes are: http, https, file, and ds. An endpoint URI with the ds scheme specifies the location of the file on the datastore. The format of the datastore URI is:
  • ds:///vmfs/volumes/uuid/path
Some examples of valid file URI formats are:
  • file:///path
  • file:///C:/path
  • file://unc-server/path
When the transfer endpoint is a file or datastore location, the server can import the file directly from the storage backing without the overhead of streaming over HTTP.
source‑endpoint‑ssl‑certificate‑thumbprint string No Thumbprint of the expected SSL certificate for this endpoint. Only used for HTTPS connections. The thumbprint is the SHA-1 hash of the DER encoding of the remote endpoint's SSL certificate. If set, the remote endpoint's SSL certificate is only accepted if it matches this thumbprint, and no other certificate validation is performed. If not specified, standard certificate validation is performed.
size int No The file size, in bytes. If specified the server will verify it received the correct size.
checksum‑info‑algorithm string No The checksum algorithm (SHA1, MD5) used to calculate the checksum. If not specified the default checksum algorithm is SHA1. Valid values are: {SHA1, MD5}
checksum‑info‑checksum string No The checksum value calculated with File.ChecksumInfo.algorithm.

Example

dcli com vmware content library item updatesession file add --update-session-id testId --name testString --source-type test


Remove Command

dcli com vmware content library item updatesession file remove

Description

Requests a file to be removed. The file will only be effectively removed when the update session is completed.

Options

Option Name Type Required Description
update‑session‑id string Yes Identifier of the update session. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession.
file‑name string Yes Name of the file to be removed.

Example

dcli com vmware content library item updatesession file remove --update-session-id testId --file-name testString


List Command

dcli com vmware content library item updatesession file list

Description

Lists all files in the library item associated with the update session.

Options

Option Name Type Required Description
update‑session‑id string Yes Identifier of the update session. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession.

Example

dcli com vmware content library item updatesession file list --update-session-id testId


Get Command

dcli com vmware content library item updatesession file get

Description

Retrieves information about a specific file in the snapshot of the library item at the time when the update session was created.

Options

Option Name Type Required Description
update‑session‑id string Yes Identifier of the update session. The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession.
file‑name string Yes Name of the file.

Example

dcli com vmware content library item updatesession file get --update-session-id testId --file-name testString