5.6.4. TaskResume

Description

Tasks resumption.

Request

{
  "user_id":(number),
  "methods":[
    {
      "method":"TaskResume",
      "params":{
        "project_id":(number),
        "task_ids":' id1 | [id1,id2] '
      }
    }
  ]
}
  • user_id - an integer value, a user identifier;

  • project_id - an integer value, a user project identifier;

  • task_ids - task identifiers, the field can be specified in one of the following formats:
    id1 - an integer value, a task identifier;
    [id1,id2] - an array of integer values, task identifiers.

Reply

{
  "reply":[
    {
      "method":"TaskResume",
      "result":[
        {
          "task_id":(number),
          "status":"Scheduled"
        }
      ]
    }
  ]
}
  • task_id - an integer value, a task identifier;

  • status - a string, a task status:
    Scheduled - start of a task is planned. The state is assigned to tasks set via API. Further, the state changes to a one of the described below depending on the success of a task starting;
    Started - a task is in progress;
    Stopped - a task is stopped;
    Stalled - a task is incorrectly stopped. The server doesn’t receive the analysis task data although the task stop command has not been received. The main reason is usually loss of connection to the server by the probe or the incorrect termination of the probe operation;
    Rejected - start of a task was rejected. Reasons can be found in the task Event journal in the web interface.

Example

Request by the cURL utility
#1. Request to resume one task
  curl http://172.16.11.111/ctrl_api/v1/json \
   -H "Content-Type: application/json" \
   --data '{"user_id":4,"methods":[{"method":"TaskResume", "params":{"project_id":23,"task_ids":241555}}]}'

#2. Request to resume several tasks
  curl http://172.16.11.111/ctrl_api/v1/json \
   -H "Content-Type: application/json" \
   --data '{"user_id":4,"methods":[{"method":"TaskResume", "params":{"project_id":23,"task_ids":[241458,241456]}}]}'
Reply to a request to resume one task
 {
   "reply":[
     {
       "method":"TaskResume",
       "result":[
         {
           "task_id":241555,
           "status":"Scheduled"
         }
       ]
     }
   ]
 }