Replicating an Image Within a Region
Function
This is an extended API used to replicate an image. When replicating an image, you can change the image attributes to meet the requirements of different scenarios.
This is an asynchronous API. If job_id is returned, the job is successfully delivered. You need to query the status of the asynchronous job. If the status is success, the job is successfully executed. If the status is failed, the job fails. For details about how to query an asynchronous job, see Querying the Progress of an Asynchronous Job.
Huawei Cloud has stopped providing Windows images. This API will no longer be used to replicate Windows images.
Constraints
- Full-ECS images cannot be replicated within the same region.
- Private images created using ISO files do not support in-region replication.
- The size of an image to be replicated within a region cannot be greater than 128 GiB.
Debugging
You can debug this API in API Explorer.
Authorization
Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned. For details about the required permissions, see Permissions and Supported Actions.
URI
POST /v1/cloudimages/{image_id}/copy
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| image_id | Yes | String | Definition Image ID. For details about how to obtain an image ID, see Querying Images. Constraints N/A Range N/A Default Value N/A |
Request
- Request parameters
Parameter
Mandatory
Type
Description
name
Yes
String
Definition
Image name. For details about name, see Image Attributes.
Constraints
A name cannot start or end with a space. The name length must be 1 to 128 characters.
Range
A name can contain only letters, digits, spaces, hyphens (-), underscores (_), and periods (.), and cannot start or end with a space.
Default Value
N/A
description
No
String
Definition
Image description. For details about description, see Image Attributes.
Constraints
The value contains a maximum of 1,024 characters, including letters and digits. Carriage returns and angle brackets (< >) are not allowed.
Range
N/A
Default Value
N/A
cmk_id
No
String
Definition
Encryption key.
Constraints
N/A
Range
N/A
Default Value
This parameter is left blank by default.
enterprise_project_id
No
String
Definition
Enterprise project that an image belongs to.
For more information about enterprise projects and how to obtain enterprise project IDs, see Enterprise Center.
Constraints
If only enterprise project authorization is used, the enterprise_project_id parameter must be specified. Otherwise, an error may occur, indicating that you do not have the required permissions.
Range
- If the value is 0 or left blank, an image belongs to the default enterprise project.
- If the value is a UUID, an image belongs to the enterprise project with this UUID.
Default Value
N/A
Example Request
Replicating an image (name: ims_encrypted_copy3) within a region
1 2 3 4 5 6 | POST https://{Endpoint}/v1/cloudimages/465076de-dc36-4aec-80f5-ef9d8009428f/copy { "name": "ims_encrypted_copy3", "description": "test copy", "cmk_id": "bd66288c-9081-460a-8227-4cbd0c814cb4" } |
Response
- Response parameters
Parameter
Type
Description
job_id
String
Definition
Asynchronous job ID.
For details, see Querying the Progress of an Asynchronous Job.
Range
N/A
- Example response
STATUS CODE 200
1 2 3
{ "job_id": "edc89b490d7d4392898e19b2deb34797" }
Returned Values
- Normal
- Abnormal
Returned Value
Description
400 Bad Request
Request error. For details, see Error Codes.
401 Unauthorized
Authentication failed.
403 Forbidden
Insufficient permissions.
404 Not Found
Requested resource not found.
500 Internal Server Error
Internal service error.
503 Service Unavailable
Service unavailable.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot