Exporting an Image
Function
This is an extended API used to export a private image to an OBS bucket.
Before exporting an image, ensure that you have Tenant Administrator permissions for OBS.
Constraints
| Item | Description |
|---|---|
| Region | An image can only be exported to a Standard bucket that is in the same region as the image. |
| Image type | The following private images cannot be exported:
NOTE:
|
| Image format |
|
| Image size | The image size must be less than 1 TiB. Images larger than 128 GiB and smaller than 1 TiB only support fast export. For details about the differences between standard and fast export, see What Are the Differences Between Standard and Fast Import/Export? NOTE: In some regions, an image larger than 128 GiB can be exported without enabling fast export. You can see on the console if such a large image can be exported in that way. |
| Time | The time required for exporting an image depends on the image size and the number of concurrent export tasks. |
| Billing | You will be billed for storing exported images in the OBS bucket. For details, see OBS Pricing Details. |
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}/file
| 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
bucket_url
Yes
String
Definition
URL of the image file in the format of Bucket name:File name.
Constraints
The storage class of the OBS bucket and image files in it must be Standard.
Range
N/A
Default Value
N/A
file_format
Yes
String
Definition
File format.
Constraints
N/A
Range
The value can be qcow2, vhd, zvhd, or vmdk.
Default Value
N/A
is_quick_export
No
Boolean
Definition
Whether to use fast export.
Constraints
If fast export is used, the file_format parameter cannot be specified. The exported image file is in the ZVHD2 format.
Range
The value can be true or false.
Default Value
false
Example Request
Exporting an image to a QCOW2 file (file address in the target OBS bucket: ims-image:centos7_5.qcow2)
1 2 3 4 5 6 | POST https://{Endpoint}/v1/cloudimages/d164b5df-1bc3-4c3f-893e-3e471fd16e64/file { "bucket_url": "ims-image:centos7_5.qcow2", "file_format": "qcow2", "is_quick_export": false } |
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 about the returned error code, 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