This API is used to create a full-ECS image from an ECS, Cloud Server Backup Service (CSBS) backup, or Cloud Backup and Recovery (CBR) backup. The API is an asynchronous one. If it is successfully called, the cloud system receives the request to create a full-ECS image. However, you need to use the asynchronous job query API to query the image creation status. For details, see Asynchronous Job Query.
Windows has three types of SAN policies: OnlineAll, OfflineShared, and OfflineInternal.
Type |
Description |
---|---|
OnlineAll |
All newly detected disks are automatically brought online. |
OfflineShared |
All disks on sharable buses, such as iSCSI and FC, are left offline by default, while disks on non-sharable buses are kept online. |
OfflineInternal |
All newly detected disks are left offline. |
diskpart
san policy=onlineall
POST /v1/cloudimages/wholeimages/action
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. |
tags |
No |
Array of strings |
Lists the image tags. The value is left blank by default. Use either tags or image_tags. |
image_tags |
No |
Array of objects |
Lists the image tags. The value is left blank by default. Use either tags or image_tags. |
instance_id |
Yes |
String |
Specifies the ECS ID. This parameter is required when an ECS is used to create a full-ECS image. To obtain the ECS ID, perform the following operations:
|
enterprise_project_id |
No |
String |
Specifies the enterprise project that the image belongs to.
|
max_ram |
No |
Integer |
Specifies the maximum memory of the image in the unit of MB. This parameter is not configured by default. |
min_ram |
No |
Integer |
Specifies the minimum memory of the image in the unit of MB. The default value is 0. |
vault_id |
No |
String |
Specifies the ID of the vault to which an ECS is to be added or has been added. To create a full-ECS image from an ECS, create a backup from the ECS and then use the backup to create a full-ECS image. If a CBR backup is created, vault_id is mandatory. If a CSBS backup is created, vault_id is optional. You can obtain the vault ID from the CBR console or section "Querying the Vault List" in Cloud Backup and Recovery API Reference. |
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. |
tags |
No |
Array of strings |
Lists the image tags. The value is left blank by default. Use either tags or image_tags. |
image_tags |
No |
Array of objects |
Lists the image tags. The value is left blank by default. Use either tags or image_tags. |
backup_id |
Yes |
String |
Specifies the CSBS backup ID or CBR backup ID. To obtain the CSBS backup ID, perform the following operations:
To obtain the CBR backup ID, perform the following operations:
|
enterprise_project_id |
No |
String |
Specifies the enterprise project that the image belongs to.
|
max_ram |
No |
Integer |
Specifies the maximum memory of the image in the unit of MB. This parameter is not configured by default. |
min_ram |
No |
Integer |
Specifies the minimum memory of the image in the unit of MB. The default value is 0, indicating that the memory is not restricted. |
whole_image_type |
No |
String |
Specifies the method of creating a full-ECS image.
|
POST https://{Endpoint}/v1/cloudimages/wholeimages/action
If parameter tags is used:
1 2 3 4 5 6 7 8 9 10 11 | { "name": "instance_whole_image", "description": "creating an image from an ECS", "instance_id": "877a2cda-ba63-4e1e-b95f-e67e48b6129a", "vault_id": "de9fcf45-11b2-432c-8562-5c5428574600", "tags": [ "aaa.111", "bbb.333", "ccc.444" ] } |
If parameter image_tags is used:
1 2 3 4 5 6 7 | { "name": "instance_whole_image", "description": "creating an image from an ECS", "instance_id": "877a2cda-ba63-4e1e-b95f-e67e48b6129a", "vault_id": "de9fcf45-11b2-432c-8562-5c5428574600", "image_tags": [{"key":"key2","value":"value2"},{"key":"key1","value":"value1"}] } |
POST https://{Endpoint}/v1/cloudimages/wholeimages/action
If parameter tags is used:
1 2 3 4 5 6 7 8 9 10 11 | { "name": "backup_whole_image", "description": "Creating a full-ECS image from a CBR backup", "backup_id": "9b27efab-4a17-4c06-bfa2-3e0cf021d3c3", "whole_image_type": "CBR", "tags": [ "aaa.111", "bbb.333", "ccc.444" ] } |
If parameter image_tags is used:
1 2 3 4 5 6 7 | { "name": "backup_whole_image", "description": "Creating a full-ECS image from a CBR backup", "backup_id": "9b27efab-4a17-4c06-bfa2-3e0cf021d3c3", "whole_image_type": "CBR", "image_tags": [{"key":"key2","value":"value2"},{"key":"key1","value":"value1"}] } |
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": "4010a32b5f909853015f90aaa24b0015" } |
Returned Value |
Description |
---|---|
400 Bad Request |
Request error. For details about the returned error code, 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. |