This API is an extension one and is used to copy an existing image to another image. When replicating an image, you can change the image attributes to meet the requirements of different scenarios.
This API is an asynchronous one. If job_id is returned, the task is successfully delivered. You need to query the status of the asynchronous task. If the status is success, the task is successfully executed. If the status is failed, the task fails. For details about how to query the status of an asynchronous task, see Asynchronous Job Query.
POST /v1/cloudimages/{image_id}/copy
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
image_id |
Yes |
String |
Specifies the image ID. For details about how to obtain the image ID, see Querying Images. |
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. |
cmk_id |
No |
String |
Specifies the encryption key. This parameter is left blank by default. |
enterprise_project_id |
No |
String |
Indicates the enterprise project that the image belongs to.
|
POST https://{Endpoint}/v1/cloudimages/465076de-dc36-4aec-80f5-ef9d8009428f/copy
1 2 3 4 5 | { "name": "ims_encrypted_copy3", "description": "test copy", "cmk_id": "bd66288c-9081-460a-8227-4cbd0c814cb4" } |
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": "edc89b490d7d4392898e19b2deb34797" } |
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. |
500 Internal Server Error |
Internal service error. |
503 Service Unavailable |
The service is unavailable. |