Using the API to retrieve alarms for a specific time period.
search cancel

Using the API to retrieve alarms for a specific time period.

book

Article ID: 367805

calendar_today

Updated On:

Products

DX Operational Intelligence

Issue/Introduction

How to employ the OI API to retrieve UIM alarms for various periods of time.

Resolution

In the original link sent  it had time examples

https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/dx-operational-intelligence-saas/SaaS/reference/DX-Operational-Intelligence-APIs/dx-operational-intelligence-query-apis.html


You can also provide the Time range in the query to filter based on any timestamp field instead of using timeFrom and timeTo values. For example, timestamp:[2021-08-30T11:00:17+0000 TO 2021-08-30T11:50:17+0000]
timefrom    Start time of the search in the ISO8601 format. This uses the last updated time of the alarm (timestamp field).
Default Value: None
2021-07-03T07:16:23Z
timeto    End time of the search in the ISO8601 format. This uses the last updated time of the alarm (timestamp field).
Default Value: None
2021-07-03T07:16:23Z

Other details:

This is a sample query string to get the last 1 day's open UIM alarms : https://<host>/oi/v2/aoanalytics/alarms/alarms_all/_search?q=product:UIM AND (status:NEW OR status:UPDATED) AND timestamp:[now-1d TO now]&from=0&size=100
"product", "status" and "timestamp" are the fields in the Alarm records. The complete list of fields are documented in the techdocs page
exact time ranges can also be provided in the query For example, timestamp:[2023-08-30T11:00:17+0000 TO 2023-08-30T11:50:17+0000]

Additional Information

 https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/dx-operational-intelligence-saas/SaaS/reference/DX-Operational-Intelligence-APIs/dx-operational-intelligence-query-apis.html

The Data Retrieval API queries and retrieves events and alarms data from DX Operational Intelligence. You can query the data using the permanent user token that you can generate on the Tokens page.

Examples can be found at 
https://knowledge.broadcom.com/external/article/226446

  • List past 200 alarms    curl -XGET 'http://<ES_ENDPOINT>:9200/*alarms_all*/_search?pretty'&sort=@timestamp:desc&size=200'
  • Query for a specific Alarm id in "alarms_all* indices    curl -XGET 'http://<ES_ENDPOINT>:9200/*alarms_all*/_search?pretty'&q=alarm_unique_id:<ALARM-ID>'
  • Query for specific alarm type    curl -XGET 'http://<ES_ENDPOINT>:9200/ao_itoa_alarms_all_1_1*/serch?pretty'&q=alarmType:Prediction'
  • Alarm details from alarms_all index for spectrum alarms    curl -XGET 'http://<ES_ENDPOINT>:9200/ao_itoa_alarms_all*/_search?q=alarm_unique_id:"spectrumAlarmId"&pretty'