Migration Service APIs
GetZMigrateGatewayVmInstances
API Request
URLs
GET zstack/v1/zmigrate/vm-instancesHeaders
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zmigrate/vm-instancesParameters
| Name | Type | Location | Description | Optional Values | Since |
|---|---|---|---|---|---|
| systemTags (Optional) | List | query | System tags | 5.0.0 | |
| userTags (Optional) | List | query | User tags | 5.0.0 |
API Response
Response Example
{
"managementVmInstanceUuid": "ff04e1736ec6391f9a1f023b524d0a00",
"gatewayVmInstances": [
{
"uuid": "ff01ec80fd11327cba7519b66119d900",
"name": "ZMigrateGatewayVmInstance",
"description": "ZMigrate gateway vm instance for test"
}
]
}| Name | Type | Description | Since |
|---|---|---|---|
| managementVmInstanceUuid | String | The management VM instance UUID. | 5.0.0 |
| gatewayVmInstances | List | The gateway VM instances. | 5.0.0 |
| success | boolean | Whether the operation succeeded. | 5.0.0 |
| error | ErrorCode | For details, see error | 5.0.0 |
#error
| Name | Type | Description | Since |
|---|---|---|---|
| ode | String | Error code, which is the globally unique identifier of the error, such as SYS.1000 or HOST.1001 | 0.6 |
| description | String | Summary description of the error | 0.6 |
| details | String | Detailed information about the error | 0.6 |
| elaboration | String | Reserved field. The default value is null. | 0.6 |
| opaque | LinkedHashMap | Reserved field. The default value is null. | 0.6 |
| cause | ErrorCode | Root error that caused the current error. If there is no original error, this field is null. | 0.6 |
SDK Example
Java SDK
GetZMigrateGatewayVmInstancesAction action = new GetZMigrateGatewayVmInstancesAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetZMigrateGatewayVmInstancesAction.Result res = action.call();Python SDK
action = GetZMigrateGatewayVmInstancesAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()GetZMigrateImages
API Request
URLs
GET zstack/v1/zmigrate/imagesHeaders
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zmigrate/imagesParameters
| Name | Type | Location | Description | Optional Values | Since |
|---|---|---|---|---|---|
| systemTags (Optional) | List | query | System tags | 5.0.0 | |
| userTags (Optional) | List | query | User tags | 5.0.0 |
API Response
Response Example
{
"images": {
"ZMigrateGatewayImage": {
"uuid": "32b618f43799325988e3a376fa65bfc1",
"name": "test-image",
"description": "test image for zmigrate"
}
}
}#images
| Name | Type | Description | Since |
|---|---|---|---|
| uuid | String | Resource UUID, which uniquely identifies the resource | 0.6 |
| name | String | Resource name | 0.6 |
| description | String | Detailed description of the resource | 0.6 |
| state | String | Image state | 0.6 |
| status | String | Image readiness status | 0.6 |
| size | Long | Image size | 0.6 |
| actualSize | Long | Actual image size | 0.6 |
| md5Sum | String | MD5 value of the image | 0.6 |
| url | String | URL of the image | 0.6 |
| mediaType | String | Image type | 0.6 |
| guestOsType | String | Guest operating system type corresponding to the image | 0.6 |
| type | String | Field for internal use | 0.6 |
| platform | String | System platform of the image | 0.6 |
| format | String | Image format, for example, raw | 0.6 |
| system | Boolean | Indicates whether the image is a system image | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| backupStorageRefs | List | For details, see backupStorageRefs | 0.6 |
#backupStorageRefs
| Name | Type | Description | Since |
|---|---|---|---|
| imageUuid | String | Image UUID | 0.6 |
| backupStorageUuid | String | Backup storage UUID | 0.6 |
| installPath | String | Installation path on the image server | 0.6 |
| exportUrl | String | URL of the exported image | 3.9.0 |
| exportMd5Sum | String | MD5 value of the exported image | 3.9.0 |
| status | String | Image readiness status | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
#error
| Name | Type | Description | Since |
|---|---|---|---|
| ode | String | Error code, which is the globally unique identifier of the error, such as SYS.1000 or HOST.1001 | 0.6 |
| description | String | Summary description of the error | 0.6 |
| details | String | Detailed information about the error | 0.6 |
| elaboration | String | Reserved field. The default value is null. | 0.6 |
| opaque | LinkedHashMap | Reserved field. The default value is null. | 0.6 |
| cause | ErrorCode | Root error that caused the current error. If there is no original error, this field is null. | 0.6 |
SDK Example
Java SDK
GetZMigrateImagesAction action = new GetZMigrateImagesAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetZMigrateImagesAction.Result res = action.call();Python SDK
action = GetZMigrateImagesAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()GetZMigrateInfos
Get Z Migrate Infos
API Request
URLs
GET zstack/v1/zmigrate/management/infos
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X GET http://localhost:8080/zstack/v1/zmigrate/management/infos?
Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (Optional) | List | query | System tags | 5.0.0 | |
| userTags (Optional) | List | query | User tags | 5.0.0 |
API Response
Response Example
{
"zmigrateVmInstanceStatus": "Running",
"version": "1.0.0",
"platformsCount": 3,
"gatewaysCount": 2,
"migrateJobsCount": 5,
"zmigrateStartTime": 1785995392577
}
| Name | Type | Description | Starting Version |
|---|---|---|---|
| zmigrateVmInstanceStatus | String | ZMigrate virtual machine instance status | 5.0.0 |
| version | String | ZMigrate version | 5.0.0 |
| platformsCount | long | Number of ZMigrate platforms | 5.0.0 |
| gatewaysCount | long | Number of ZMigrate gateways | 5.0.0 |
| migrateJobsCount | long | Number of ZMigrate migration jobs | 5.0.0 |
| zmigrateStartTime | long | ZMigrate management node startup time | 5.0.0 |
| success | boolean | Whether the operation succeeded. | 5.0.0 |
| error | ErrorCode | For details, see error | 5.0.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, which globally and uniquely identifies the error, for example, SYS.1000 or HOST.1001 | 0.6 |
| description | String | Summary description of the error | 0.6 |
| details | String | Details of the error | 0.6 |
| elaboration | String | Reserved field. The default value is null | 0.6 |
| opaque | LinkedHashMap | Reserved field. The default value is null | 0.6 |
| cause | ErrorCode | Root error that caused the current error. This field is null if there is no source error | 0.6 |
SDK Examples
Java SDK
GetZMigrateInfosAction action = new GetZMigrateInfosAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetZMigrateInfosAction.Result res = action.call();
Python SDK
action = GetZMigrateInfosAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
