Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Rules can be managed using REST API.

Rule creation

A new rule can be created with REST API query /api/rule/create

Code Block
languagejs
themeRDark
https://hostname:8090/api/rule/create
{
  "type": "0",
  "name": "rule1",
  "value": ".*",
  "profiles": ["14", "17"]
}

Where:

  • type – rule type:
    • 0 – stream name template
    • 1 - reserved
  • name – rule name
  • value – rule value (template for type 0)
  • profiles – profile identifies list of identifiers of profiles, to which the rule shoud should be applied

Rule changing

The A rule can be changed with REST API query /api/rule/update

Code Block
languagejs
themeRDark
https://hostname:8090/api/rule/update
{
  "id": "13",
  "type": "0",
  "name": "rule1",
  "value": ".*",
  "profiles": ["14", "17"]
}

Where:

  • id – rule identifier
  • type – rule type (0 or 1)
  • name – rule name
  • value – rule value (template for type 0)
  • profiles – profile identifies list of identifiers of profiles, to which the rule shoud should be applied

Rule deletion

The A rule can be deleted with REST API query /api/rule/delete

Code Block
languagejs
themeRDark
https://hostname:8090/api/rule/delete
{
  "id": "13"
}

Where:

  • id – rule identifier

Obtaining rule information

The A rule information can be obtained with REST API query /api/rule/list

Code Block
languagejs
themeRDark
https://hostname:8090/api/rule/list
{
  "id": "13",
  "profile": "17"
}

Where:

  • id – rule identifier
  • profile - profile identifier

If rule Id is set, the response will contain this rule information only. If profile Id is set, the response will contain information about rules applied to this profile metrics only. If none of Ids is set, the response will contain contain list with all the rules list on backend server.

The response contains the same fields for every a rule as /api/rule/update query.