Skip to main content
5-Regular Member
July 31, 2018
Solved

How to create a Anomaly alert using REST call to AddOrUpdateAlert?

  • July 31, 2018
  • 5 replies
  • 2078 views

I am trying to create a Anomaly type of alert on a Thing/ThingTemplate using REST call to AddOrUpdateAlert.

But there is no way to set "Outbound Anomaly Rate", "Min Data Collection Time", "Certainty" and "Priority" properties, required for creating a Anomaly alert, through this API. I guess it must be through the "attributes" InfoTable input, but I am not sure how to pass these variables in this InfoTable. I couldn't find documentation also for the same.

Could anyone please help on this?

Best answer by cmorfin

Hi Priyankar

 

Actually some of the fields in the datashape are not really used. 

The only ones you need to care about are:

modelID: STRING
anomalyDetectionRate: INTEGER
trainingTime: INTEGER
certainty: NUMBER

 

If you do not specify the modelID, then a new alert is created that will go through the calibrating and training phase to create the new model.

This is the most likely use of it.

if you do specify modelID, then an alert will be created but the specified model will be used, so the alert will not go through calibrating and training  but use the model and goes to buffering.

 

Kind rgeards

Christophe

 

5 replies

19-Tanzanite
July 31, 2018

Hi

 

I think this article https://www.ptc.com/en/support/article?n=CS230216 can help.

Also, the datashape for anomaly looks as below

 

AnomalyDataShape.png

 

 

Hope this helps

Kind regards

Christophe

5-Regular Member
August 1, 2018

Hi Christophe,

 

I am able to create an Anomaly alert from my Java code by creating a InfoTable with below data-shape and passing this InfoTable to REST call to AddOrUpdateAlert. Thanks for that!

I still have a question. What should be probable values for modelID and secondaryProperties values? I am trying to create this alert on a ThingTemplate.

 

Regards,

Priyankar

cmorfin19-TanzaniteAnswer
19-Tanzanite
August 2, 2018

Hi Priyankar

 

Actually some of the fields in the datashape are not really used. 

The only ones you need to care about are:

modelID: STRING
anomalyDetectionRate: INTEGER
trainingTime: INTEGER
certainty: NUMBER

 

If you do not specify the modelID, then a new alert is created that will go through the calibrating and training phase to create the new model.

This is the most likely use of it.

if you do specify modelID, then an alert will be created but the specified model will be used, so the alert will not go through calibrating and training  but use the model and goes to buffering.

 

Kind rgeards

Christophe