Content Library Item Downloadsession File prepare

Content Library Item Downloadsession File prepare

Requests a file to be prepared for download.

Returns an authorization error if you do not have all of the privileges described as follows:

  • Operation execution requires System.Anonymous.
Request
URI
POST
https://{api_host}/api/content/library/item/download-session/{downloadSessionId}/file?action=prepare
COPY
Path Parameters
string
downloadSessionId
Required

Identifier of the download session.

The parameter must be an identifier for the resource type: com.vmware.content.library.item.DownloadSession.


Request Body

Request body for invoking operation: prepare

Show optional properties

{
    "file_name": "string"
}
{
    "file_name": "string",
    "endpoint_type": "string"
}
string
file_name
Required

Name of the file requested for download.

string
endpoint_type
Optional

Endpoint type request, one of EndpointType. This will determine the type of the Content Library Item Downloadsession File Info.download_endpoint that is generated when the file is prepared. The Content Library Item Downloadsession File EndpointType.DIRECT is only available to users who have the ContentLibrary.ReadStorage privilege.

For more information see: Content Library Item Downloadsession File EndpointType.

If not specified the default is Content Library Item Downloadsession File EndpointType.HTTPS.

Authentication
This operation uses the following authentication methods.
Responses
200

File information containing the status of the request and the download link to the file.

Returns Content Library Item Downloadsession File Info of type(s) application/json
{
    "name": "string",
    "size": 0,
    "bytes_transferred": 0,
    "status": "string",
    "download_endpoint": {
        "uri": "string",
        "ssl_certificate_thumbprint": "string",
        "ssl_certificate": "string"
    },
    "checksum_info": {
        "algorithm": "string",
        "checksum": "string"
    },
    "error_message": {
        "id": "string",
        "default_message": "string",
        "args": [
            "string"
        ],
        "params": {
            "params": {
                "s": "string",
                "dt": "string",
                "i": 0,
                "d": "number",
                "l": "Vapi Std NestedLocalizableMessage Object",
                "format": "string",
                "precision": 0
            }
        },
        "localized": "string"
    }
}
string
name
Required

The name of the file.

integer As int64 As int64
size
Optional

The file size, in bytes.

This property may not be available immediately. It is guaranteed to be set when the client finishes downloading the file.

integer As int64 As int64
bytes_transferred
Required

The number of bytes that have been transferred by the server so far for making this file prepared for download. This value may stay at zero till the client starts downloading the file.

string
status
Required

The preparation status (PrepareStatus) of the file.

For more information see: Content Library Item Downloadsession File PrepareStatus.

download_endpoint
Optional

Endpoint at which the file is available for download. The value is valid only when the Content Library Item Downloadsession File Info.status is Content Library Item Downloadsession File PrepareStatus.PREPARED.

This property won't be set until the file status is Content Library Item Downloadsession File PrepareStatus.PREPARED.

checksum_info
Optional

The checksum information of the file. When the download is complete, you can retrieve the checksum from the GET /content/library/item/download-session/{downloadSessionId}/file?file_name operation to verify the checksum for the downloaded file.

The checksum is always calculated for the downloaded file, but this property won't be set until the download is complete.

error_message
Optional

Error message for a failed preparation when the prepare status is Content Library Item Downloadsession File PrepareStatus.ERROR.

This property won't be set unless there was an error with the file transfer.


400

if there is no file with the specified fileName.

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

403

if the the download session wasn't created with the ContentLibrary.ReadStorage privilege and the caller requested a Content Library Item Downloadsession File EndpointType.DIRECT endpoint type.

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

404

if the download session does not exist.

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 -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"file_name:"string"}' https://{api_host}/api/content/library/item/download-session/{downloadSessionId}/file?action=prepare