迁移服务相关接口
获取ZMigrate网关虚拟机实例(GetZMigrateGatewayVmInstances)
API请求
URLs
GET zstack/v1/zmigrate/vm-instancesHeaders
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zmigrate/vm-instances参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| systemTags (可选) | List | query | 系统标签 | 5.0.0 | |
| userTags (可选) | List | query | 用户标签 | 5.0.0 |
API返回
返回示例
{
"managementVmInstanceUuid": "ff04e1736ec6391f9a1f023b524d0a00",
"gatewayVmInstances": [
{
"uuid": "ff01ec80fd11327cba7519b66119d900",
"name": "ZMigrateGatewayVmInstance",
"description": "ZMigrate gateway vm instance for test"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| managementVmInstanceUuid | String | 5.0.0 | |
| gatewayVmInstances | List | 5.0.0 | |
| success | boolean | 5.0.0 | |
| error | ErrorCode | 详情参考error | 5.0.0 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| ode | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
| description | String | 错误的概要描述 | 0.6 |
| details | String | 错误的详细信息 | 0.6 |
| elaboration | String | 保留字段,默认为null | 0.6 |
| opaque | LinkedHashMap | 保留字段,默认为null | 0.6 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 0.6 |
SDK示例
Java SDK
GetZMigrateGatewayVmInstancesAction action = new GetZMigrateGatewayVmInstancesAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetZMigrateGatewayVmInstancesAction.Result res = action.call();Python SDK
action = GetZMigrateGatewayVmInstancesAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()获取ZMigrate网关镜像(GetZMigrateImages)
API请求
URLs
GET zstack/v1/zmigrate/imagesHeaders
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zmigrate/images参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| systemTags (可选) | List | query | 系统标签 | 5.0.0 | |
| userTags (可选) | List | query | 用户标签 | 5.0.0 |
API返回
返回示例
{
"images": {
"ZMigrateGatewayImage": {
"uuid": "32b618f43799325988e3a376fa65bfc1",
"name": "test-image",
"description": "test image for zmigrate"
}
}
}#images
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| name | String | 资源名称 | 0.6 |
| description | String | 资源的详细描述 | 0.6 |
| state | String | 镜像的启动状态 | 0.6 |
| status | String | 镜像的就绪状态 | 0.6 |
| size | Long | 镜像大小 | 0.6 |
| actualSize | Long | 镜像真实容量 | 0.6 |
| md5Sum | String | 镜像的md5值 | 0.6 |
| url | String | 镜像的URL地址 | 0.6 |
| mediaType | String | 镜像的类型 | 0.6 |
| guestOsType | String | 镜像对应的客户机操作系统类型 | 0.6 |
| type | String | 内部使用字段 | 0.6 |
| platform | String | 镜像的系统平台 | 0.6 |
| format | String | 镜像的格式,比如:raw | 0.6 |
| system | Boolean | 标识是否为系统镜像 | 0.6 |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
| backupStorageRefs | List | 详情参考backupStorageRefs | 0.6 |
#backupStorageRefs
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| imageUuid | String | 镜像UUID | 0.6 |
| backupStorageUuid | String | 镜像存储UUID | 0.6 |
| installPath | String | 在镜像服务器上的安装路径 | 0.6 |
| exportUrl | String | 导出镜像的url | 3.9.0 |
| exportMd5Sum | String | 导出镜像的md5值 | 3.9.0 |
| status | String | 镜像就绪状态 | 0.6 |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| ode | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
| description | String | 错误的概要描述 | 0.6 |
| details | String | 错误的详细信息 | 0.6 |
| elaboration | String | 保留字段,默认为null | 0.6 |
| opaque | LinkedHashMap | 保留字段,默认为null | 0.6 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 0.6 |
SDK示例
Java SDK
GetZMigrateImagesAction action = new GetZMigrateImagesAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetZMigrateImagesAction.Result res = action.call();Python SDK
action = GetZMigrateImagesAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()获取ZMigrate管理节点信息(GetZMigrateInfos)
获取ZMigrate管理节点信息
API请求
URLs
GET zstack/v1/zmigrate/management/infosHeaders
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X GET http://localhost:8080/zstack/v1/zmigrate/management/infos?参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| systemTags (可选) | List | query | 系统标签 | 5.0.0 | |
| userTags (可选) | List | query | 用户标签 | 5.0.0 |
API返回
返回示例
{
"zmigrateVmInstanceStatus": "Running",
"version": "1.0.0",
"platformsCount": 3,
"gatewaysCount": 2,
"migrateJobsCount": 5,
"zmigrateStartTime": 1785995392577
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| zmigrateVmInstanceStatus | String | ZMigrate虚拟机实例状态 | 5.0.0 |
| version | String | ZMigrate版本 | 5.0.0 |
| platformsCount | long | ZMigrate平台数量 | 5.0.0 |
| gatewaysCount | long | ZMigrate网关数量 | 5.0.0 |
| migrateJobsCount | long | ZMigrate迁移任务数量 | 5.0.0 |
| zmigrateStartTime | long | ZMigrate管理节点启动时间 | 5.0.0 |
| success | boolean | 5.0.0 | |
| error | ErrorCode | 详情参考error | 5.0.0 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
| description | String | 错误的概要描述 | 0.6 |
| details | String | 错误的详细信息 | 0.6 |
| elaboration | String | 保留字段,默认为null | 0.6 |
| opaque | LinkedHashMap | 保留字段,默认为null | 0.6 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 0.6 |
SDK示例
Java SDK
GetZMigrateInfosAction action = new GetZMigrateInfosAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetZMigrateInfosAction.Result res = action.call();Python SDK
action = GetZMigrateInfosAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()