Rule management¶
Rules can be managed using Websocket API or REST API.
Rule creation¶
A new rule can be created with /api/rule/create
request
API | Request | Response | Response status |
---|---|---|---|
WS API | 200 OK 400 Object not found 500 Persist exception | ||
REST API | 200 OK 400 Object not found 500 Persist exception |
Where
type
– rule type:0
– stream name template1
- media session id template
name
– rule namevalue
– rule value (template)profiles
– list of identifiers of profiles, to which the rule should be applied
Rule changing¶
A rule can be changed with /api/rule/update
request
API | Request | Response | Response status |
---|---|---|---|
WS API | 200 OK 400 Object not found 500 Persist exception | ||
REST API | 200 OK 400 Object not found 500 Persist exception |
Where
id
– rule identifiertype
– rule type (0
or1
)name
– rule namevalue
– rule value (template)profiles
– list of identifiers of profiles, to which the rule should be applied
Rule deletion¶
A rule can be deleted with /api/rule/delete
request:
API | Request | Response | Response status |
---|---|---|---|
WS API | 200 OK 400 Object not found 500 Persist exception | ||
REST API | 200 OK 400 Object not found 500 Persist exception |
Where
id
– rule identifier
Obtaining rule information¶
A rule information can be obtained with /api/rule/list
request:
Where
id
– rule identifierprofile
- profile identifiertype
– rule type (0
or1
)name
– rule namevalue
– rule value (template)profiles
– list of identifiers of profiles, to which the rule should be applied
If rule Id is set, the response will contain only that rule information. If profile Id is set, the response will contain information only about the rules applied to that profile metrics. If none of Ids is set, the response will contain list with all the rules on backend server.
For every rule, the response contains the same fields as /api/rule/update
request.