5.5.4. AppStoppedTasks

Description

List of stopped probe tasks and detailed information about their settings. The request is addressed for only one probe. Repeat the query to poll the next probe.

Request

{
  "user_id":(number),
  "methods":[
    {
      "method":"AppStoppedTasks",
      "params":{
        "project_id":(number),
        "app_id":(number),
        "limit_value":(number),
        "page":(number)
      }
    }
  ]
}
  • user_id - an integer value, a user identifier;

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

  • app_id - an integer value, a probe identifier;

  • limit_value (optional field) - an integer value, a maximum number of projects in a reply. It allows splitting the result list into several pages. Default value is 25;

  • page (optional field) - an integer value, allows selecting a result page. Default value is 1.

Reply

{
  "reply":[
    {
      "method":"AppStoppedTasks",
      "result":{
        "app_id":(number),
        "page":(number),
        "limit_value":(number),
        "total_pages":(number),
        "stopped_tasks":[
          {
            "id":(number),
            "app_id":(number),
            "name":(string),
            "uri":(string),
            "start":(string),
            "start_f":(number),
            "status":(string),
            "end":(string),
            "end_f":(number),
            "profiles":{
              "alarm":[(number)],
              "email":[(number)],
              "threshold":[(number)],
              "pagerduty":[(number)],
              "record":[(number)],
              "snmp":[(number)],
              "webhook":[(number)],
              "telegram":[(number)],
              "kpi":[(number)]
            },
            "service":(string),
            "tags":(string),
            "config":{
              ...
            }
          }
        ]
      }
    }
  ]
}
  • app_id - an integer value, a probe identifier;

  • page - an integer value, a displayed result page;

  • limit_value - an integer value, a maximum number of projects in a reply;

  • total_pages - an integer value, a total number of result pages with limit_value specified;

  • id - an integer value, a task identifier;

  • app_id - an integer value, a probe identifier;

  • name - a string, a stream name (e.g. a channel name);

  • uri - a string, a path to an analysed stream (a service, a file);

  • start - a string, a task creation date and time;

  • start_f - a real number, a task creation date in the format of Unix time with a fractional part (to increase the accuracy);

  • status - a string, a task status. Stopped - a task is stopped;

  • end - a string, a task stop date and time;

  • end_f - a real number, a task stop date in the format of Unix time with a fractional part;

  • profiles - an object, a list of profile identifiers of the notification system, record settings and service availability:
    • alarm - an array of integer values, an identifier of the Alarm notification triggers profile. The current implementation supports using only one profile of this type;

    • email - an array of integer values, identifiers of the E-mail notification triggers profiles;

    • threshold - an array of integer values, an identifier of a settings profile and thresholds. The current implementation supports using only one profile of this type;

    • pagerduty - an array of integer values, the profile identifiers of notification triggers to the PagerDuty system;

    • record - an array of integer values, identifiers of a record settings profiles;

    • snmp - an array of integer values, identifiers of the SNMP notification triggers profiles;

    • webhook - an array of integer values, identifiers of the Webhook notification triggers profiles;

    • telegram - an array of integer values, profile identifiers of notification triggers to the Telegram messenger;

    • kpi - an array of integer values, a profile identifier of service availability profile. The current implementation supports using only one profile of this type.

  • service - a string, a service (channel) identification name used to consolidate service states and errors from different monitoring points. This field binds the project tasks from different probes to be displayed in MosaicView;

  • tags - a string, a list of tags separated by commas. Tags are used to filter displaying on different views;

  • config - an object, an additional information about a task and task settings. The structure is described in more detail in the section Task Configuration 1.

1

The structures of the task configuration received in API request and the configuration in the monitor.cfg file are similar.

Example

Request by the cURL utility
curl http://172.16.11.111/ctrl_api/v1/json \
   -H "Content-Type: application/json" \
   --data '{"user_id":4,"methods":[{"method":"AppStoppedTasks", "params":{"project_id":23,"app_id":702, "limit_value": 2, "page":1}}]}'
Part of a reply to information request
{
  "reply":[
    {
      "method":"AppStoppedTasks",
      "result":{
        "app_id":702,
        "page":1,
        "limit_value":1,
        "total_pages":43,
        "stopped_tasks":[
          {
            "id":236701,
            "app_id":702,
            "name":"HD_HLS",
            "uri":"http://10.10.30.53:8080/BOROhd.m3u8",
            "start":"2020-02-27 21:47:15 +0700",
            "start_f":1582814835.807791,
            "status":"Stopped",
            "end":"2020-02-27 21:48:20 +0700",
            "end_f":1582814900.807791,
            "profiles":{
              "alarm":[
                79
              ],
              "email":[
                95
              ],
              "threshold":[
                98
              ]
            },
            "service":"HDchannel",
            "tags":"OTT,HLS,HD",
            "config":{
              ...
            }
          }
        ]
      }
    }
  ]
}