• Image Management Service

ims
  1. Help Center
  2. Image Management Service
  3. API Reference
  4. APIs
  5. Image Replication (Extension API)
  6. Replicating an Image Within a Region

Replicating an Image Within a Region

Function

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.

URI

  • URI format

    POST /v1/cloudimages/{image_id}/copy

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    image_id

    Yes

    string

    Specifies the image ID.

Constraints

You can replicate private images in Normal or Normal (Uninitialized) state.

Full-ECS images cannot be replicated.

Request

  • Parameter description

    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.

  • Example request
    POST /v1/cloudimages/465076de-dc36-4aec-80f5-ef9d8009428f/copy
    {
        "name": "ims_encrypted_copy3",
        "description": "test copy",
        "cmk_id": "bd66288c-9081-460a-8227-4cbd0c814cb4"
    }

Response

  • Parameter description

    Name

    Type

    Description

    job_id

    string

    Specifies the asynchronous job ID.

  • Example response
    STATUS CODE 200
    {
        "job_id": "edc89b490d7d4392898e19b2deb34797"
    }

Returned Values

  • Normal

    200

  • Abnormal

    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.