This API is used to upload a local image to the cloud platform. The image to be uploaded must be smaller than 128 GB.
For more information about how to use external files to create images, see sections "Creating a Private Windows Image Using an External Image File" and "Creating a Private Linux Image Using an External Image File" in Image Management Service User Guide.
The following describes how to use this API:
PUT /v2/images/{image_id}/file
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
image_id |
Yes |
String |
Specifies the image ID.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
image_file |
Yes |
file |
Specifies the local file to be uploaded. |
PUT https://{Endpoint}/v2/images/84ac7f2b-bf19-4efb-86a0-b5be8771b476/file
If you use the curl command to call the API, the example request is as follows:
curl -i --insecure 'https://IP/v2/images/84ac7f2b-bf19-4efb-86a0-b5be8771b476/file' -X PUT -H "X-Auth-Token: $mytoken" -H "Content-Type:application/octet-stream" -T /mnt/userdisk/images/suse.zvhd
Returned Value |
Description |
---|---|
400 Bad Request |
Request error. For details, see Error Codes. |
401 Unauthorized |
Authentication failed. |
403 Forbidden |
You do not have the rights to perform the operation. |
404 Not Found |
The requested resource was not found. |
409 Conflict |
Request conflict. |
500 System Error |
System error. |