This API is used to register an image file as an uninitialized private image on the cloud platform.
The following describes how to use this API:
For details about how to query the status of an asynchronous task, see Asynchronous Job Query.
Before registering an image file, ensure that you have the Tenant Administrator permission for OBS.
PUT /v1/cloudimages/{image_id}/upload
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
image_id |
Yes |
String |
Specifies the image ID.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
image_url |
Yes |
String |
Specifies the URL of the image file in the format of Bucket name:File name. Image files in the bucket can be in ZVHD, QCOW2, VHD, RAW, VHDX, QED, VDI, QCOW, ZVHD2, or VMDK format. NOTE:
The storage class of the OBS bucket must be Standard. |
PUT https://{Endpoint}/v1/cloudimages/4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba86/upload
1 2 3 | { "image_url": "bucketname:Centos6.5-disk1.vmdk" } |
Parameter |
Type |
Description |
---|---|---|
job_id |
String |
Specifies the asynchronous job ID. For details, see Asynchronous Job Query. |
HTTP/1.1 200
1 2 3 | { "job_id":" b912fb4a4c464b568ecfca1071b21b10" } |
Returned Value |
Description |
---|---|
400 Bad Request |
Request error. For details about the returned error code, 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. |