TIX 6 Alarm API
The TIX Alarm API provides functionality for setting, getting and removing alarms. Alarm API allows you to schedule actions (like sending mail) when a import of a EPCISDocument meets a set of alarm conditions (triggers).
POST /alarm - create new alarm
Create a new alarm by uploading a DRL (Drools Rule File), see Rule Language Reference for more details about the DRL. See Alarms, triggers and actions for details about the triggers and actions available for the alarm system.
rule "name" attributes when LHS then RHSendGET /alarm - get alarms
Get details about one or more alarms created by the authenticated user
Parameter | Description |
|
|---|---|---|
| The id(s) to get details about, optional | query |
| Specifies how many alarms to include on each page, optional | query |
| Specifies which page to retrieve. If not specified it returns the first page. Counting from 1 to Integer.MAX_VALUE / pageSize, optional | query |
| The username(s) to get details about, optional, reserved for ADMIN users | query |
<?xml version="1.0" encoding="UTF-8"?><ns3:rules xmlns:ns3="urn:epcglobal:epcis-query:xsd:1"> <rule> <id>#{ID}</id> <created>2013-07-23T10:01:05.827+02:00</created> <username>administrator</username> <node>0800000024000011</node> <drl>package com.tracetracker.tix.alarms.process rule "Send mail when ADD action events are imported" when $bn : DomContext( xpath("//ObjectEvent/action" ).stringValue() <= "ADD") then $bn.mail().send( "user@domain.com", "Action ADD", "Add Events imported" ) end </drl> </rule></ns3:rules>DELETE /alarm - delete alarms
Delete one or more alarms created by authenticated user
Parameter | Description |
|
|---|---|---|
| Id(s) of the alarm to remove, required | query |
| The username (owner) of the alarms, optional, reserved for ADMIN users | query |
<?xml version="1.0" encoding="UTF-8"?><ns3:rules xmlns:ns3="urn:epcglobal:epcis-query:xsd:1" />POST /alarm/validate - validate alarm
Validate a alarm without adding it to the TIX.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><epcisq:rules> <rule> <created>2013-07-23T13:46:43.216+02:00</created> <username>administrator</username> <node>0800000033000013</node> <drl>package com.tracetracker.tix.alarms.processrule "Send mail when ADD action events are imported" when $bn : DomContext( xpath("//ObjectEvent/action" ).stringValue() <= "ADD" ) then $bn.mail().send( "user@domain.com", "Action ADD", "Add Events imported" ) end</drl> </rule> <error> <serverity>ERROR</serverity> <message>Rule Compilation error Syntax error, insert ";" to complete Statement</message> <lines>[3]</lines> </error></epcisq:rules>GET /alarm/log - alarm action log
Get the action log for one or more rules. The action log contains details about what alarm rule triggered the action, the time it was completed and the status.
Parameter | Description |
| ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| The id(s) to get log details about, optional | query | ||||||||||||||
| Filter when the action was triggered, greater or equal, optional | query | ||||||||||||||
| Filter when the action was trigger, less or equal, optional | query | ||||||||||||||
| Filter when the action was completed, greater or equal, optional | query | ||||||||||||||
| Filter when the action was completed, less or equal, optional | query | ||||||||||||||
| Specify how many log entries to include on one page, optional | query | ||||||||||||||
| Specifies which page to retrieve. If not specified it returns the first page. Counting from | query | ||||||||||||||
| The field to order the result by, default is
| query | ||||||||||||||
asc | Ordering will be ascending if true, default is false, optional | query | ||||||||||||||
| The username (owner) of the alarms, optional, reserved for | query |