Prepare Item Downloadsession File
Requests a file to be prepared for download. if you do not have all of the privileges described as follows: - Operation execution requires System.Anonymous.
Request
URLURL
Path Parameters
Path Parameters
Identifier of the download session. The parameter must be an identifier for the resource type: com.vmware.content.library.item.DownloadSession.
Header Parameters
Header Parameters
Required session ID, acquired from Create Session API under CIS product
vmware-api-session-id example
"b00db39f948d13ea1e59b4d6fce56389"
Request Body
This is a request body class for an operation.
{
"file_name": "string"
}
Name of the file requested for download.
The File.EndpointType enumerated type defines the types of endpoints used to download the file.
HTTPS : An https download endpoint.
DIRECT : A direct download endpoint indicating the location of the file on storage. The caller is responsible for retrieving the file from the storage location directly.
Possible values are: HTTPS , DIRECT
Authentication
Response
Response BodyResponse Body
File information containing the status of the request and the download link to the file.
{
"bytes_transferred": 0,
"checksum_info": {
"algorithm": "SHA1",
"checksum": "string"
},
"download_endpoint": {
"ssl_certificate_thumbprint": "string",
"uri": "string"
},
"error_message": {
"args": [
"string"
],
"default_message": "string",
"id": "string",
"localized": "string",
"params": {
"key": {
"d": 0,
"dt": "string",
"format": "SHORT_DATE",
"i": 0,
"l": {
"id": "string",
"params": "StdLocalizationParam Object"
},
"precision": 0,
"s": "string"
}
}
},
"name": "string",
"size": 0,
"status": "UNPREPARED"
}
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.
The name of the file.
The File.PrepareStatus enumerated type defines the state of the file in preparation for download.
UNPREPARED : The file hasn’t been requested for preparation.
PREPARE_REQUESTED : A prepare has been requested, however the server hasn’t started the preparation yet.
PREPARING : A prepare has been requested and the file is in the process of being prepared.
PREPARED : Prepare succeeded. The file is ready for download.
ERROR : Prepare failed.
Possible values are: UNPREPARED , PREPARE_REQUESTED , PREPARING , PREPARED , ERROR
The checksum information of the file. When the download is complete, you can retrieve the checksum from the File.get operation to verify the checksum for the downloaded file. The checksum is always calculated for the downloaded file, but this field won’t be set until the download is complete.
Endpoint at which the file is available for download. The value is valid only when the File.Info.status is PREPARED. This field won’t be set until the file status is PREPARED.
Error message for a failed preparation when the prepare status is ERROR. This field won’t be set unless there was an error with the file transfer.
The file size, in bytes. This field may not be available immediately. It is guaranteed to be set when the client finishes downloading the file.
Errors
com.vmware.vapi.std.errors.invalid_argument : if there is no file with the specified fileName.
com.vmware.vapi.std.errors.unauthorized : if the the download session wasn’t created with the ContentLibrary.ReadStorage privilege and the caller requested a DIRECT endpoint type.
‘Default’ means this response is used for all HTTP codes that are not covered individually for this operation.
Code Samples
PowerCLI Client SDK Example
PowerCLI Client SDK All Parameters Example
cURL Command
Vendor Extensions
x-vmw-doc-deprecated-method: post
x-vmw-doc-deprecated-path: /rest/com/vmware/content/library/item/downloadsession/file/id:{download_session_id}?~action=prepare
x-vmw-doc-operation: prepare