Content Library Item File get

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 requires System.Read.
Request
URI
GET
https://{api_host}/api/content/library/item/{libraryItemId}/file?name
COPY
Path Parameters
string
libraryItemId
Required

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.

Query Parameters
string
name
Required

Name of the file in the library item whose information should be returned.


Authentication
This operation uses the following authentication methods.
Responses
200

The Content Library Item File Info object with information on the specified file.

Returns Content Library Item File Info of type(s) application/json
{
    "checksum_info": {
        "algorithm": "string",
        "checksum": "string"
    },
    "name": "string",
    "size": 0,
    "cached": false,
    "version": "string",
    "file_download_endpoint": "string"
}
checksum_info
Optional

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.

string
name
Required

The name of the file.

This value will be unique within the library item for each file. It cannot be an empty string.

integer As int64 As int64
size
Required

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.

boolean
cached
Required

Indicates whether the file is on disk or not.

string
version
Required

The version of this file; incremented when a new copy of the file is uploaded.

string As uri As uri
file_download_endpoint
Optional

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)


400

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.

Returns Vapi Std Errors Unsupported of type(s) application/json
This response body class contains all of the following: InlineVapi Std Errors Unsupported0
"Vapi Std Errors Unsupported Object"

404

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.

Returns Vapi Std Errors NotFound of type(s) application/json
This response body class contains all of the following: InlineVapi Std Errors NotFound0
"Vapi Std Errors NotFound Object"

Code Samples
COPY
                    curl -H 'Authorization: <value>' https://{api_host}/api/content/library/item/{libraryItemId}/file?name?name=v