Querying the List of Migration Tasks
Function
This API is used to query the migration task list.
URI
GET /v1/sms/tasks
Request
Request parameters
For details about the request parameters, see Table 1.
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| state | No | String | Specifies the task status. |
| name | No | String | Specifies the task name. |
| id | No | String | Specifies the task ID. |
| source_server_id | No | String | Specifies the source server ID. |
| vm_id | No | String | Specifies the target ECS ID. |
| num_per_page | No | int | Specifies the number of tasks recorded on each page. |
| page_num | No | int | Specifies the page number (starting from 0). |
Response
Response parameters
For details about the response parameters, see Table 2.
| Parameter | Type | Description |
|---|---|---|
| count | int | Specifies the total number of tasks that meet the query criteria. |
| tasks | JSON array | Specifies the task list. For details, see Table 3. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Specifies the task ID. |
| name | String | Specifies the task name. |
| type | String | Specifies the task type.
|
| os_type | String |
|
| state | String | Specifies the task status. The value can be any of the following:
|
| connected | Boolean | Specifies the connection status.
|
| estimate_complete_time | long | Specifies the estimated completion time. |
| create_date | long | Specifies the task creation time. |
| priority | int | Specifies the process priority.
|
| speed_limit | int | Specifies the migration rate limit (in MB). The default value is 0, indicating that the migration rate is not limited. |
| migrate_speed | float | Specifies the migration rate. |
| start_target_server | Boolean | Specifies the status of the target ECS after the migration is complete.
|
| total_time | long | Specifies the total task duration (in ms). |
| sub_tasks | JSON array | Specifies the list of sub tasks. For details, see Table 4. |
| log_collect_status | String | Specifies the log collection operating status. INIT: indicates that the system is ready to collect logs. TELL_AGENT_TO_COLLECT: indicates that the system is instructing the migration Agent to collect logs. WAIT_AGENT_COLLECT_ACK: indicates that the system is waiting for the migration Agent to feed back the collection result. AGENT_COLLECT_FAIL: indicates that the migration Agent fails to collect logs. AGENT_COLLECT_SUCCESS: indicates that the migration Agent succeeds in collecting logs. WAIT_SERVER_COLLECT: indicates that the system is waiting for SMS to dump logs. SERVER_COLLECT_FAIL: indicates that SMS fails to dump logs. SERVER_COLLECT_SUCCESS: indicates that SMS succeeds in dumping logs. TELL_AGENT_RESET_ACL: indicates that the system is instructing the migration Agent to cancel authorization granted to the SMS service to access logs. WAIT_AGENT_RESET_ACL_ACK: indicates that the system is waiting for the migration Agent to confirm. SUCCESS: indicates that log collection is completed. |
| source_server | JSON | Specifies the source server information. For details, see Table 5. |
| target_server | JSON | Specifies the target ECS information. For details, see Table 6. |
| Parameter | Type | Description |
|---|---|---|
| id | long | Specifies the subtask ID. |
| name | String | Specifies the subtask name.
|
| progress | int | Specifies the sub task progress. |
| start_date | long | Specifies the sub task start time. |
| end_date | long | Specifies the sub task end time. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Specifies the ID of the source server in SMS. |
| ip | String | Specifies the IP address of the source server. |
| name | String | Specifies the name of the source server. You can change the name after adding it. The default value is the same as that of hostname. |
| add_date | long | Specifies the time duration used for adding information about the source server to SMS. The unit is ms. |
| os_type | String |
|
| os_version | String | Specifies the OS version. For example, the version can be WINDOWS7_64BIT. |
| oem_system | Boolean | Specifies whether the OS of the source server is an OEM OS. |
| state | String | Specifies the check status of the source server.
|
| Parameter | Type | Description |
|---|---|---|
| id | String | Specifies the ID of the source server in SMS. |
| vm_id | String | Specifies the ID of the target ECS. |
| name | String | Specifies the name of the target ECS. |
| ip | String | Specifies the private IP address of the target ECS. |
| os_type | String | Specifies the OS type of the target ECS.
|
| os_version | String | Specifies the OS version of the target ECS. For example, the version can be WINDOWS7_64BIT. |
Example
- Example request
GET v1/sms/tasks
- Example response
{ "count":1, "tasks":[{ "id": "90c950d7-d184-4b5e-87c0-f0bd09dfa0c1", "name": "taskName", "type": "MIGRATE_BLOCK", "os_type": "WINDOWS", "state": "RUNNING", "connected": true, "consume_time": 12733551760, "estimate_complete_time": 1519733551760, "create_date": 1519733551760, "auto_install_pvdriver": false, "allow_sync": true, "final_sync": false, "priority": 1, "speed_limit": 0, "migrate_speed": 9.644518, "start_target_server": true, "total_time": 175848, "source_server": { "id": "b6bbff1f-9b43-4c60-8030-d4e1e576fea8", "ip": "10.159.219.7", "hostname": null, "addDate": 1519722504092, "os_type": "WINDOWS", "os_version": "WINDOWS2012_64BIT", "oem_system": false, "state": "AVAILABLE" }, "target_server": { "id": "7f40e37c-c883-4583-afe9-4e5026f336a7", "ip": "x.x.x.x", "vm_id": "2c44c00e-6354-49e2-b36f-151284a91f6c", "name": "windows", "port": 8899, "os_type": "WINDOWS", "os_version": "WINDOWS2012_64BIT", }, "sub_tasks": [{ "id": 143, "name": "ATTACH_AGENT_IMAGE", "progress": 100, "start_date": 1519733559435, "end_date": 1519733715574, "totalTime": 156139 }, { "id": 144, "name": "FORMAT_DISK_WINDOWS", "progress": 100, "start_date": 1519733715589, "end_date": 1519733735298, "totalTime": 19709 }, { "id": 145, "name": "MIGRATE_WINDOWS_BLOCK", "progress": 41, "start_date": 1519733735314, "end_date": null, "totalTime": 0 }, { "id": 146, "name": "CONFIGURE_WINDOWS", "progress": 0, "start_date": null, "end_date": null, "totalTime": 0 }, { "id": 147, "name": "DETTACH_AGENT_IMAGE", "progress": 0, "start_date": null, "end_date": null, "totalTime": 0 } ], } ]
Status Code
For details about the status code, see Status Code.
Error Code
For details, see Error Code.
Last Article: Uploading Migration Logs
Next Article: Querying a Migration Task by Task ID
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.