# Query Task Status

__*Using DM*__
__*DM to view task status*__

+ Example

```8
query-status test

{
    "result": true,
    "msg": "",
    "tasks": [
        {
            "taskName": "test",
            "taskStatus": "Running", 
            "sources": [  
               "mysql-replica-01",
                "mysql-replica-02"
            ]
        },
        {
            "taskName": "test2",
            "taskStatus": "Paused",
            "sources": [
                "mysql-replica-01",
                "mysql-replica-02"
            ]
        }
    ]
}
```
-------------------------------------------------------------
The recommended way to query the task status is: use `query-status` to check the status for each task. If you find a problem with one of the tasks, use `query-status <taskname>` to get more detailed error information.

Status description:
- `New`: The initial state. If there are no errors in the subtask, the status switches to Running, otherwise it switches to Paused.
- `Running`: The normal operational status.
- `Paused`: Suspended state. An error occurred in the subtask, and the status changed to Paused. If you execute the `pause-task` command while the subtask is running, the task status will change to `Paused`. If the subtask is in this state, you can use the `resume-task` command to resume the task.
- `Stopped`: Stopped state. If you execute the `stop-task` command while the subtask is in the `Running` or `Paused` state, the task status changes to `Stopped`. You cannot use the `resume-task` command to resume the task in this state.
- `Finished`: The completion status of the task. The task switches to this state only when the task with full task mode completes successfully.

For example:

```
query-status test

{
    "result": true,
    "msg": "",
    "tasks": [
        {
            "taskName": "test",
            "taskStatus": "Running", 
            "sources": [  
               "mysql-replica-01",
                "mysql-replica-02"
            ]
        },
        {
            "taskName": "test2",
            "taskStatus": "Paused",
            "sources": [
                "mysql-replica-01",
                "mysql-replica-02"
            ]
        }
    ]
}
```
