This API is used to create a data disk image from a data disk image file uploaded to the OBS bucket. The API is an asynchronous one. If it is successfully called, the cloud service system receives the request. However, you need to use the asynchronous job query API to query the image creation status. For details, see Asynchronous Job Query.
POST /v1/cloudimages/dataimages/action
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Specifies the image name. For detailed description, see Image Attributes. |
description |
No |
String |
Provides supplementary information about the image. For detailed description, see Image Attributes. The value contains a maximum of 1024 characters and consists of only letters and digits. Carriage returns and angle brackets (< >) are not allowed. This parameter is left blank by default. |
os_type |
No |
String |
Specifies the OS type. It can only be Windows or Linux. The default is Linux. |
image_url |
Yes |
String |
Specifies the URL of the external image file in the OBS bucket. The format is OBS bucket name:Image file name. NOTE:
The storage class of the OBS bucket must be Standard. |
min_disk |
Yes |
Integer |
Specifies the minimum size of the data disk. Value range: 40 GB to 2048 GB |
cmk_id |
No |
String |
Specifies the master key used for encrypting an image. For its value, see the Key Management Service User Guide. |
tags |
No |
Array of strings |
Specifies image tags. This parameter is left blank by default. For detailed parameter description, see Image Tag Data Formats. Use either tags or image_tags. |
image_tags |
No |
Array of ImageTag objects |
Lists the image tags. This parameter is left blank by default. Use either tags or image_tags. |
enterprise_project_id |
No |
String |
Specifies the enterprise project that the image belongs to.
|
POST https://{Endpoint}/v1/cloudimages/dataimages/action
1 2 3 4 5 6 7 8 9 10 11 | { "name": "fedora-data1", "image_url": "image-test:fedora_data1.qcow2", "description":"Data disk 1 of Fedora", "min_disk": 40, "tags": [ "aaa.111", "bbb.222" ], "os_type": "Linux" } |
POST https://{Endpoint}/v1/cloudimages/dataimages/action
1 2 3 4 5 6 7 8 | { "name": "fedora-data2", "image_url": "image-test:fedora_data1.qcow2", "description":"Data disk 2 of Fedora", "min_disk": 40, "image_tags": [{"key":"aaa","value":"111"},{"key":"bbb","value":"222"}], "os_type": "Linux" } |
Parameter |
Type |
Description |
---|---|---|
job_id |
String |
Specifies the asynchronous job ID. For details, see Asynchronous Job Query. |
STATUS CODE 200
1 2 3 | { "job_id": "4010a32b5f909853015f90aaa24b0015" } |
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. |
500 Internal Server Error |
Internal service error. |
503 Service Unavailable |
The service is unavailable. |