
# 查询指定ID的迁移任务 - ShowTask
#### 功能介绍
查询指定ID的迁移任务。
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-sms/sms_api_0007.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-sms/sms_api_8001.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                | 访问级别 | 资源类型（\*为必须） | 条件键                   | 别名                     | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | sms:server:getTask | Read | server \*   | -                     | sms:server:queryServer | -      |
  | sms:server:getTask | Read | -           | g:EnterpriseProjectId | sms:server:queryServer | -      |
     
  
 
#### URI
GET /v3/tasks/{task_id}
表1路径参数 
| 参数      | 是否必选 | 参数类型   | 描述                                                                                    |
|:---|:---|:---|:---|
| task_id | 是    | String | 迁移任务ID 最小长度：**1** 最大长度：**36** |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                      |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度：**1** 最大长度：**16384** |
   
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数                     | 参数类型                                                                                  | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|:---|:---|:---|
| name                   | String                                                                                | 任务名称（用户自定义） 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| type                   | String                                                                                | 任务类型，创建时必选，更新时可选 MIGRATE_FILE:文件级迁移 MIGRATE_BLOCK:块级迁移 最小长度：**0** 最大长度：**255** 枚举值： - **MIGRATE_FILE**   - **MIGRATE_BLOCK**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| os_type                | String                                                                                | 操作系统类型，分为WINDOWS和LINUX，创建时必选，更新时可选 枚举值： - **WINDOWS**   - **LINUX**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| id                     | String                                                                                | 迁移任务ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| priority               | Integer                                                                               | 进程优先级 0：低 1：标准（默认） 2：高 最小值：**0** 最大值：**2** 枚举值： - **0**   - **1**   - **2**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| speed_limit            | Integer                                                                               | 迁移限速 最小值：**0** 最大值：**65535**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| region_id              | String                                                                                | 目的端服务器的区域ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| start_target_server    | Boolean                                                                               | 迁移完成后是否启动目的端服务器 true：启动 false：停止 缺省值：**true**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| enterprise_project_id  | String                                                                                | 企业项目ID 最小长度：**1** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| migration_ip           | String                                                                                | 目的端服务器的IP地址。 公网迁移时请填写弹性IP地址 专线迁移时请填写私有IP地址 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| region_name            | String                                                                                | 目的端服务器的区域名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| project_name           | String                                                                                | 目的端服务器所在项目名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| project_id             | String                                                                                | 目的端服务器所在项目ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| vm_template_id         | String                                                                                | 模板ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| source_server          | [SourceServerResponse] object               | 返回源端服务器信息                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| target_server          | [TaskTargetServer] object                       | 目的端服务器                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| state                  | String                                                                                | 迁移任务状态 READY: 准备就绪 RUNNING: 迁移中 SYNCING: 同步中 MIGRATE_SUCCESS: 迁移成功 SYNC_SUCCESS: 同步成功 MIGRATE_FAIL: 失败 SYNC_FAIL: 同步失败 ABORTING: 中止中 ABORT: 中止 SKIPPING: 跳过中 DELETING: 删除中 RESETING: 回滚中 枚举值： - **READY**   - **RUNNING**   - **SYNCING**   - **MIGRATE_SUCCESS**   - **SYNC_SUCCESS**   - **MIGRATE_FAIL**   - **SYNC_FAIL**   - **ABORTING**   - **ABORT**   - **SKIPPING**   - **DELETING**   - **RESETING**    |
| estimate_complete_time | Long                                                                                  | 预估完成时间 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| connected              | Boolean                                                                               | 连接状态                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| create_date            | Long                                                                                  | 任务创建时间 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| start_date             | Long                                                                                  | 任务开始时间 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| finish_date            | Long                                                                                  | 任务结束时间 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| migrate_speed          | Double                                                                                | 迁移速率，单位：Mbit/s 最小值：**0** 最大值：**10000**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| compress_rate          | Double                                                                                | 压缩率 最小值：**0** 最大值：**10000**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| error_json             | String                                                                                | 错误信息 最小长度：**0** 最大长度：**1024**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| total_time             | Long                                                                                  | 任务总耗时 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| float_ip               | String                                                                                | 暂时保留float,兼容现网老版本的SMS-Agent 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| remain_seconds         | Long                                                                                  | 迁移剩余时间（秒） 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| target_snapshot_id     | String                                                                                | 目的端的快照ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| clone_server           | [CloneServer] object                                 | 克隆服务器类                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| sub_tasks              | Array of [SubTask] objects                               | 任务包含的子任务列表 数组长度：**0 - 65535**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| network_check_info     | [NetworkCheckInfoRequestBody] object | 网络检测相关信息                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| total_cpu_usage        | Double                                                                                | 主机的CPU使用率，单位是百分比 最小值：**0** 最大值：**100**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| agent_cpu_usage        | Double                                                                                | Agent的CPU使用率，单位是百分比 最小值：**0** 最大值：**100**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| total_mem_usage        | Double                                                                                | 主机的内存使用值，单位是MB 最小值：**0** 最大值：**1048576.0**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| agent_mem_usage        | Double                                                                                | Agent的内存使用值，单位是MB 最小值：**0** 最大值：**1048576.0**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| total_disk_io          | Double                                                                                | 主机的磁盘I/O值，单位是Mbit/s 最小值：**0** 最大值：**10000.0**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| agent_disk_io          | Double                                                                                | Agent的磁盘I/O值，单位是Mbit/s 最小值：**0** 最大值：**10000.0**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| need_migration_test    | Boolean                                                                               | 是否开启迁移演练                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| subtask_info           | String                                                                                | 当前子任务及进度 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   
 表4SourceServerResponse 
| 参数              | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|
| id              | String  | 源端在SMS数据库中的ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ip              | String  | 源端服务器ip，注册源端时必选，更新非必选 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| name            | String  | 用来区分不同源端服务器的名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| os_type         | String  | 源端服务器的OS类型，分为Windows和Linux，注册必选，更新非必选 最小长度：**0** 最大长度：**255** 枚举值： - **WINDOWS**   - **LINUX**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| os_version      | String  | 操作系统版本，注册必选，更新非必选 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| oem_system      | Boolean | 是否是OEM操作系统(Windows)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| state           | String  | 源端服务器状态 unavailable：环境校验不通过 waiting：等待 initialize：初始化 replicate：复制 syncing：持续同步 stopping：暂停中 stopped：已暂停 skipping：跳过中 deleting：删除中 clearing: 清理快照资源中 cleared：清理快照资源完成 clearfailed：清理快照资源失败 premigready：迁移演练就绪 premiged：迁移演练完成 premigfailed：迁移演练失败 cloning：等待克隆完成 cutovering：启动目的端中 finished：启动目的端完成 error：错误 枚举值： - **unavailable**   - **waiting**   - **initialize**   - **replicate**   - **syncing**   - **stopping**   - **stopped**   - **skipping**   - **deleting**   - **clearing**   - **cleared**   - **clearfailed**   - **premigready**   - **premiged**   - **premigfailed**   - **cloning**   - **cutovering**   - **finished**   - **error**    |
| migration_cycle | String  | 迁移周期 cutovering:启动目的端中 cutovered:启动目的端完成 checking:检查中 setting:设置中 replicating:复制中 syncing:同步中 最小长度：**0** 最大长度：**255** 枚举值： - **cutovering**   - **cutovered**   - **checking**   - **setting**   - **replicating**   - **syncing**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   
 表5TaskTargetServer 
| 参数                     | 参数类型                                                              | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|
| id                     | String                                                            | 目的端在SMS数据库中的ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                            |
| vm_id                  | String                                                            | 目的端服务器ID，自动创建虚拟机不需要这个参数 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                   |
| name                   | String                                                            | 目的端服务器的名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                 |
| ip                     | String                                                            | 目的端服务器IP 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                  |
| os_type                | String                                                            | 源端服务器的OS类型，分为Windows和Linux，注册必选，更新非必选 最小长度：**0** 最大长度：**255** 枚举值： - **WINDOWS**   - **LINUX**    |
| os_version             | String                                                            | 操作系统版本，注册必选，更新非必选 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                         |
| system_dir             | String                                                            | Windows必选，系统目录 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                            |
| disks                  | Array of [TargetDisk] objects     | 目的端磁盘信息，一般和源端保持一致 数组长度：**0 - 65535**                                                                                                                                                                                                                                                                                                                                                                                          |
| volume_groups          | Array of [VolumeGroups] objects | lvm信息，一般和源端保持一致 数组长度：**0 - 65535**                                                                                                                                                                                                                                                                                                                                                                                            |
| btrfs_list             | Array of strings                                                  | Linux 必选，源端的Btrfs信息。如果源端不存在Btrfs，则为\[\] 最小长度：**0** 最大长度：**255** 数组长度：**0 - 65535**                                                                                                                                                                                                                                                                                    |
| image_disk_id          | String                                                            | 目的端代理镜像磁盘ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                               |
| cutovered_snapshot_ids | String                                                            | 目的端回滚快照ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                 |
   
 表6TargetDisk 
| 参数               | 参数类型                                                                                | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|
| id               | Long                                                                                | 磁盘标识ID 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| device_use       | String                                                                              | 判断是普通分区，启动分区还是系统分区 BOOT：BOOT设备 OS：系统设备 NORMAL:平常 缺省值：**NORMAL** 枚举值： - **NORMAL**   - **OS**   - **BOOT**    |
| disk_id          | String                                                                              | 磁盘ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| name             | String                                                                              | 磁盘名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| physical_volumes | Array of [TargetPhysicalVolumes] objects | 逻辑卷信息 数组长度：**0 - 65535**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| size             | Long                                                                                | 大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| used_size        | Long                                                                                | 已使用大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| disk_index       | String                                                                              | 磁盘索引 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| os_disk          | Boolean                                                                             | 是否为系统盘                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| partition_style  | String                                                                              | 磁盘的分区类型，添加源端时源端磁盘必选 MBR：mbr格式 GPT：gpt格式 枚举值： - **MBR**   - **GPT**                                                                                                                                                                                                         |
| relation_name    | String                                                                              | Linux系统 目的端ECS中与源端关联的磁盘名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
   
 表7TargetPhysicalVolumes 
| 参数            | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|:---|:---|:---|
| id            | Long    | 逻辑卷ID 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| device_use    | String  | 分区类型 NORMAL:平常 OS：系统设备 BOOT：BOOT设备 缺省值：**NORMAL** 枚举值： - **NORMAL**   - **OS**   - **BOOT**    |
| file_system   | String  | 文件系统 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| index         | Integer | 编号 最小值：**0** 最大值：**2147483647**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| mount_point   | String  | 挂载点 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| name          | String  | 名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| size          | Long    | 大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| used_size     | Long    | 使用大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| uuid          | String  | uuid 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| relation_name | String  | Linux系统 目的端ECS中与源端关联的磁盘名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| free_size     | Long    | 分区空闲大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
   
 表8VolumeGroups 
| 参数              | 参数类型                                                                  | 描述                                                                                                 |
|:---|:---|:---|
| components      | String                                                                | Pv信息 最小长度：**0** 最大长度：**255**               |
| free_size       | Long                                                                  | 剩余空间 最小值：**0** 最大值：**9223372036854775807** |
| logical_volumes | Array of [LogicalVolumes] objects | lv信息 数组长度：**0 - 50**                                                   |
| name            | String                                                                | 名称 最小长度：**0** 最大长度：**255**                 |
| size            | Long                                                                  | 大小 最小值：**0** 最大值：**9223372036854775807**   |
   
 表9LogicalVolumes 
| 参数          | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                       |
|:---|:---|:---|
| block_count | Integer | 块数量 最小值：**0** 最大值：**2147483647** 缺省值：**0**                                                                                                                                                                                                                           |
| block_size  | Long    | 块大小 最小值：**0** 最大值：**1048576** 缺省值：**0**                                                                                                                                                                                                                              |
| file_system | String  | 文件系统 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                     |
| inode_size  | Integer | inode数量 最小值：**0** 最大值：**2147483647**                                                                                                                                                                                                                                                             |
| inode_nums  | Long    | inode节点数量 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                  |
| device_use  | String  | 分区类型 无强约束，可为空值，常见取值如下 NORMAL：平常 OS：系统设备 BOOT：BOOT设备 VOLUME_GROUP：VolumeGroup组成设备 BTRFS：BTRFS组成设备 最小长度：**0** 最大长度：**255** |
| mount_point | String  | 挂载点 最小长度：**0** 最大长度：**256**                                                                                                                                                                                                                                                                      |
| name        | String  | 名称 最小长度：**0** 最大长度：**1024**                                                                                                                                                                                                                                                                      |
| size        | Long    | 大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                         |
| used_size   | Long    | 使用大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                       |
| free_size   | Long    | 剩余空间 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                       |
   
 表10CloneServer 
| 参数          | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
|:---|:---|:---|
| vm_id       | String | 克隆服务器ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| name        | String | 克隆虚拟机的名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| clone_error | String | 克隆错误信息 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| clone_state | String | 克隆状态 NOT_READY: 未准备好 READY: 就绪 PREPARING: 准备创建中 CREATING: 创建中 ERROR: 克隆错误 FINISHED: 克隆结束 枚举值： - **NOT_READY**   - **READY**   - **PREPARING**   - **CREATING**   - **ERROR**   - **FINISHED**    |
| error_msg   | String | 克隆错误信息描述 最小长度：**0** 最大长度：**1024**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   
 表11SubTask 
| 参数            | 参数类型    | 描述                                                                                                                    |
|:---|:---|:---|
| id            | Long    | 子任务ID 最小值：**0** 最大值：**9223372036854775807**                   |
| name          | String  | 子任务名称 最小长度：**0** 最大长度：**255**                                 |
| progress      | Integer | 子任务的进度，取值为0-100之间的整数 最小值：**0** 最大值：**100**                    |
| start_date    | Long    | 子任务开始时间 最小值：**0** 最大值：**9223372036854775807**                 |
| end_date      | Long    | 子任务结束时间（如果子任务还没有结束，则为空） 最小值：**0** 最大值：**9223372036854775807** |
| migrate_speed | Double  | 迁移速率，Mbit/s 最小值：**0** 最大值：**10000**                           |
| user_op       | String  | 触发子任务的用户操作名称 最小长度：**0** 最大长度：**50**                           |
| process_trace | String  | 迁移或同步时，具体的迁移详情 最小长度：**0** 最大长度：**2048**                       |
   
 表12NetworkCheckInfoRequestBody 
| 参数                       | 参数类型    | 描述                                                                                           |
|:---|:---|:---|
| domain_connectivity      | Boolean | 域名连通性                                                                                        |
| destination_connectivity | Boolean | 目的端连通性                                                                                       |
| network_delay            | Double  | 网络时延（ms） 最小值：**0** 最大值：**10000.0**   |
| network_jitter           | Double  | 网络抖动（ms） 最小值：**0** 最大值：**10000**     |
| migration_speed          | Double  | 带宽速率（Mbit/s） 最小值：**0** 最大值：**10000** |
| loss_percentage          | Double  | 丢包率（%） 最小值：**0** 最大值：**100**         |
| cpu_usage                | Double  | CPU占用率（%） 最小值：**0** 最大值：**100**      |
| mem_usage                | Double  | 内存占用率（%） 最小值：**0** 最大值：**100**       |
| evaluation_result        | String  | 评估结果 最小长度：**5** 最大长度：**9**           |
   
**状态码：403**
表13响应Body参数 
| 参数                            | 参数类型                                                    | 描述                                                                                                                                 |
|:---|:---|:---|
| error_code                    | String                                                  | 错误代码 最小长度：**0** 最大长度：**255**                                               |
| error_msg                     | String                                                  | 错误信息 最小长度：**0** 最大长度：**255**                                               |
| encoded_authorization_message | String                                                  | 加密授权信息 最小长度：**0** 最大长度：**65535**                                           |
| error_param                   | Array of strings                                        | 错误参数 最小长度：**0** 最大长度：**65535** 数组长度：**1 - 20** |
| details                       | Array of [details] objects | 详细错误信息 数组长度：**1 - 20**                                                                                 |
   
 表14details 
| 参数         | 参数类型   | 描述                                                                                        |
|:---|:---|:---|
| error_code | String | SMS错误代码 最小长度：**0** 最大长度：**65535** |
| error_msg  | String | SMS错误信息 最小长度：**0** 最大长度：**65535** |
   
#### 请求示例
查询指定ID的迁移任务
```
GET https://{endpoint}/v3/tasks/ef3b9722-07a0-40ae-89b0-889ee96dfc56
```
#### 响应示例
**状态码：200**
查询指定ID的迁移任务成功
```
{
  "id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001",
  "name" : "MigrationTask",
  "type" : "MIGRATE_BLOCK",
  "os_type" : "WINDOWS",
  "state" : "RUNNING",
  "estimate_complete_time" : null,
  "create_date" : 1598435778000,
  "start_date" : 1598435784000,
  "finish_date" : null,
  "priority" : 1,
  "speed_limit" : 0,
  "migrate_speed" : 0.0,
  "start_target_server" : true,
  "error_json" : "",
  "total_time" : 115,
  "float_ip" : null,
  "migration_ip" : null,
  "vm_template_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001",
  "region_name" : "region name",
  "region_id" : "region id",
  "project_name" : "project name",
  "project_id" : "xxxxxxxxxxxxxxxxxxxxxxxx00000001",
  "sub_tasks" : [ {
    "id" : 7278,
    "name" : "CREATE_CLOUD_SERVER",
    "progress" : 0,
    "start_date" : 1598435802000,
    "end_date" : null,
    "user_op" : "REPLICATE",
    "process_trace" : null
  }, {
    "id" : 7279,
    "name" : "SSL_CONFIG",
    "progress" : 0,
    "start_date" : null,
    "end_date" : null,
    "user_op" : "REPLICATE",
    "process_trace" : null
  }, {
    "id" : 7280,
    "name" : "ATTACH_AGENT_IMAGE",
    "progress" : 0,
    "start_date" : null,
    "end_date" : null,
    "user_op" : "REPLICATE",
    "process_trace" : null
  }, {
    "id" : 7281,
    "name" : "FORMAT_DISK_WINDOWS",
    "progress" : 0,
    "start_date" : null,
    "end_date" : null,
    "user_op" : "REPLICATE",
    "process_trace" : null
  }, {
    "id" : 7282,
    "name" : "MIGRATE_WINDOWS_BLOCK",
    "progress" : 0,
    "start_date" : null,
    "end_date" : null,
    "user_op" : "REPLICATE",
    "process_trace" : null
  } ],
  "source_server" : {
    "id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001",
    "ip" : "192.168.0.154",
    "name" : "name-win16",
    "os_type" : "WINDOWS",
    "os_version" : "WINDOWS2016_64BIT",
    "oem_system" : false,
    "state" : "initialize",
    "migration_cycle" : "replicating"
  },
  "target_server" : {
    "id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001",
    "vm_id" : "",
    "name" : "",
    "ip" : null,
    "os_type" : "WINDOWS",
    "os_version" : "WINDOWS2016_64BIT",
    "system_dir" : "Y:\\Windows\\System32",
    "disks" : [ {
      "id" : 88008,
      "name" : "Disk 1",
      "relation_name" : null,
      "disk_id" : "0",
      "partition_style" : "MBR",
      "size" : 42949672960,
      "used_size" : 42947575808,
      "device_use" : "OS",
      "os_disk" : true,
      "physical_volumes" : [ {
        "id" : 135055,
        "uuid" : "\\\\?\\Volume{586b7157-0000-0000-0000-100000000000}\\",
        "index" : 1,
        "name" : "Z:",
        "relation_name" : null,
        "device_use" : "BOOT",
        "file_system" : "NTFS",
        "mount_point" : null,
        "size" : 524288000,
        "used_size" : 410275840,
        "free_size" : 114012160
      }, {
        "id" : 135056,
        "uuid" : "\\\\?\\Volume{586b7157-0000-0000-0000-501f00000000}\\",
        "index" : 2,
        "name" : "Y:",
        "relation_name" : null,
        "device_use" : "OS",
        "file_system" : "NTFS",
        "mount_point" : null,
        "size" : 42423287808,
        "used_size" : 23170301952,
        "free_size" : 19252985856
      } ],
      "disk_index" : "0"
    } ],
    "volume_groups" : [ ],
    "image_disk_id" : null,
    "cutovered_snapshot_ids" : null
  },
  "clone_server" : null
}
```
**状态码：403**
鉴权失败
```
{
  "error_code" : "SMS.9004",
  "error_msg" : "The current account does not have the permission to execute policy. You do not have permission to perform action XXX on resource XXX.",
  "encoded_authorization_message" : "XXXXXX",
  "error_param" : [ "You do not have permission to perform action XXX on resource XXX." ],
  "details" : [ {
    "error_code" : "SMS.9004",
    "error_msg" : "You do not have permission to perform action XXX on resource XXX."
  } ]
}
```
#### SDK代码示例
SDK代码示例如下。
- [Java]
  ```
  package com.huaweicloud.sdk.test;
  import com.huaweicloud.sdk.core.auth.ICredential;
  import com.huaweicloud.sdk.core.auth.GlobalCredentials;
  import com.huaweicloud.sdk.core.exception.ConnectionException;
  import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
  import com.huaweicloud.sdk.core.exception.ServiceResponseException;
  import com.huaweicloud.sdk.sms.v3.region.SmsRegion;
  import com.huaweicloud.sdk.sms.v3.*;
  import com.huaweicloud.sdk.sms.v3.model.*;
  public class ShowTaskSolution {
      public static void main(String[] args) {
          // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
          // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
          String ak = System.getenv("CLOUD_SDK_AK");
          String sk = System.getenv("CLOUD_SDK_SK");
          ICredential auth = new GlobalCredentials()
                  .withAk(ak)
                  .withSk(sk);
          SmsClient client = SmsClient.newBuilder()
                  .withCredential(auth)
                  .withRegion(SmsRegion.valueOf("<YOUR REGION>"))
                  .build();
          ShowTaskRequest request = new ShowTaskRequest();
          request.withTaskId("{task_id}");
          try {
              ShowTaskResponse response = client.showTask(request);
              System.out.println(response.toString());
          } catch (ConnectionException e) {
              e.printStackTrace();
          } catch (RequestTimeoutException e) {
              e.printStackTrace();
          } catch (ServiceResponseException e) {
              e.printStackTrace();
              System.out.println(e.getHttpStatusCode());
              System.out.println(e.getRequestId());
              System.out.println(e.getErrorCode());
              System.out.println(e.getErrorMsg());
          }
      }
  }
  ```
- [Python]
  ```
  # coding: utf-8
  import os
  from huaweicloudsdkcore.auth.credentials import GlobalCredentials
  from huaweicloudsdksms.v3.region.sms_region import SmsRegion
  from huaweicloudsdkcore.exceptions import exceptions
  from huaweicloudsdksms.v3 import *
  if __name__ == "__main__":
      # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak = os.environ["CLOUD_SDK_AK"]
      sk = os.environ["CLOUD_SDK_SK"]
      credentials = GlobalCredentials(ak, sk)
      client = SmsClient.new_builder() \
          .with_credentials(credentials) \
          .with_region(SmsRegion.value_of("<YOUR REGION>")) \
          .build()
      try:
          request = ShowTaskRequest()
          request.task_id = "{task_id}"
          response = client.show_task(request)
          print(response)
      except exceptions.ClientRequestException as e:
          print(e.status_code)
          print(e.request_id)
          print(e.error_code)
          print(e.error_msg)
  ```
- [Go]
  ```
  package main
  import (
  "fmt"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/global"
      sms "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/sms/v3"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/sms/v3/model"
      region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/sms/v3/region"
  )
  func main() {
      // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak := os.Getenv("CLOUD_SDK_AK")
      sk := os.Getenv("CLOUD_SDK_SK")
      auth, err := global.NewCredentialsBuilder().
          WithAk(ak).
          WithSk(sk).
          SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      hcClient, err := sms.SmsClientBuilder().
           WithRegion(region.ValueOf("<YOUR REGION>")).
           WithCredential(auth).
           SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      client := sms.NewSmsClient(hcClient)
      request := &model.ShowTaskRequest{}
  request.TaskId = "{task_id}"
  response, err := client.ShowTask(request)
  if err == nil {
          fmt.Printf("%+v\n", response)
      } else {
          fmt.Println(err)
      }
  }
  ```
- [更多]
  更多编程语言的SDK代码示例，请参见[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/SMS/sdk?api=ShowTask)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述            |
|:---|:---|
| 200 | 查询指定ID的迁移任务成功 |
| 403 | 鉴权失败          |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-sms/ErrorCode.html)。
