Content Library Item File get
Retrieves the information for a single file in a library item by its name.
Returns an authorization error if you do not have all of the privileges described as follows:
- The resource
com.vmware.content.library.Item
referenced by the parameter libraryItemId requiresSystem.Read
.
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 of the file in the library item whose information should be returned.
The Content Library Item File Info object with information on the specified file.
{
"checksum_info": {
"algorithm": "string",
"checksum": "string"
},
"name": "string",
"size": 0,
"cached": false,
"version": "string",
"file_download_endpoint": "string"
}
A checksum for validating the content of the file.
This value can be used to verify that a transfer was completed without errors.
A checksum cannot always be calculated, and the value will be missing or null
if the file does not have content.
The name of the file.
This value will be unique within the library item for each file. It cannot be an empty string.
The file size, in bytes. The file size is the storage used and not the uploaded or provisioned size. For example, when uploading a disk to a datastore, the amount of storage that the disk consumes may be different from the disk file size. When the file is not cached, the size is 0.
Indicates whether the file is on disk or not.
The version of this file; incremented when a new copy of the file is uploaded.
The URL endpoint that can be used to download the file.
Eg URL: https://{vc}/cls/static/{libraryId}/{itemId}/{fileName}?version={version} Content Library Item File Info.version query param in the URL specifies the latest version of the file present in storage. When URL is hit with version query param, the file version specified in version query param is downloaded. The download will fail with 404 not found error if the specified version is no longer present in storage. If URL is hit without version query param, the latest file version present in storage is downloaded.
It is expected to provide API session i.e. vmware-api-session-id in header while using the URL to download the file. vmware-api-session-id can be obtained from POST /session operation Eg: wget --header="vmware-api-session-id: {sessionId}" fileDownloadEndpoint
This property was added in vSphere API 9.0.0.0.
missing or null
if the file is not present in storage i.e Content Library Item File Info.cached is False or library item is of VMTX Template type (as download of VMTX template is not supported currently)
if Content Library Item File Info.file_download_endpoint URI cannot be constructed for the file due to unsupported characters in file name.
This error was added in vSphere API 9.0.0.0.
"Vapi Std Errors Unsupported Object"
if libraryItemId refers to a library item that does not exist.
if name refers to a file that does not exist in the library item.
"Vapi Std Errors NotFound Object"
curl -H 'Authorization: <value>' https://{api_host}/api/content/library/item/{libraryItemId}/file?name?name=v