• Image Management Service

ims
  1. Help Center
  2. Image Management Service
  3. API Reference
  4. APIs
  5. Image (Extension APIs)
  6. Exporting an Image

Exporting an Image

Function

This is an extension API and used to export a private image to an OBS bucket.

NOTE:

Before exporting an image, ensure that you have the Tenant Administrator permission of OBS.

Constraints

  • Images can only be exported to standard OBS buckets.
  • You can export private images in the Normal or Normal (Uninitialized) status.
  • You cannot export public images containing a Windows, SUSE, Red Hat Linux, Oracle Linux, or Ubuntu OS, or private images created from these public images.
  • Full-ECS images cannot be exported.
  • You can only export system disk images smaller than 128 GB. The disk size cannot be greater than 1024 GB.
  • You can only export data disk images smaller than 128 GB. The disk size cannot be greater than 2048 GB.
  • You can export images only in the format of VMDK, VHD, QCOW2, or ZVHD.
  • You cannot export images created using CSBS backups.

URI

  • URI format

    POST /v1/cloudimages/{image_id}/file

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    image_id

    Yes

    String

    Specifies the image ID.

Request

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    bucket_url

    Yes

    String

    Specifies the URL of the image file in the format of Bucket name:File name.

    NOTICE:

    The storage class of the OBS bucket must be Standard.

    file_format

    Yes

    String

    Specifies the file format. The value can be qcow2, vhd, zvhd, or vmdk.

  • Example request
    POST /v1/cloudimages/d164b5df-1bc3-4c3f-893e-3e471fd16e64/file
    {
       "bucket_url":"ims-image:centos7_5.qcow2",
       "file_format":"qcow2"
    }

Response

  • Parameter description

    Parameter

    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.