RESTful Call For Alarms By Model Handle Returns No Results
book
Article ID: 204761
calendar_today
Updated On:
Products
CA Spectrum
DX NetOps
Show More
Show Less
Issue/Introduction
When trying to use the api to get alarms by mh, the result has 0 alarms.
This worked in 10.2
EndPoint: http://OneClickServer:port/spectrum/restful/alarms Method: POST Body: GetAlarmsByModelHandles.xml
< rs:alarm-request throttlesize = "10" xmlns:rs = "http://www.ca.com/spectrum/restful/schema/request" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd " >
<!-- This xml can be posted to the Alarms URL to obtain all alarms on the specified models -->
<!-- Attributes of Interest -->< rs:requested-attribute id = "0x11f53" / > < rs:requested-attribute id = "0x10000" / > < rs:requested-attribute id = "0x11f56" / > < rs:requested-attribute id = "0x12b4c" / > < rs:requested-attribute id = "0x11f4d" / >
<!-- Models of Interest --> < rs:target-models > < rs:model mh = "0x100144d" / > </ rs:target-models >
</ rs:alarm-request >
Result: No Alarms Returned
<? xml version = "1.0" encoding = "UTF-8" standalone = "yes" ?> < alarm-response-list xmlns = "http://www.ca.com/spectrum/restful/schema/response" total-alarms = "0" throttle = "0" error = "EndOfResults" > < alarm-responses/ > </ alarm-response-list > Even Though Alarms are present on the Device
Environment
DX NetOps Spectrum Release : 10.4.2+
Cause
Starting in Spectrum 10.4.2 when requesting alarms filtered by model_handle it is now required to have the model_handle 0x129fa as one of the requested attributes for performance reasons.
Resolution
Include the model_handle attribute in the requested attributes section
< rs:alarm-request throttlesize = "10" xmlns:rs = "http://www.ca.com/spectrum/restful/schema/request"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd " >
< rs:requested-attribute id = "0x10000" / > <!--Model Type Name--> < rs:requested-attribute id = "0x10001" / > <!--Model Type of Alarmed Model--> < rs:requested-attribute id = "0x11f50" / > <!--Cause Code--> < rs:requested-attribute id = "0x12b4c" / > <!--Alarm Title--> < rs:requested-attribute id = "0x11f56" / > <!-- Alarm Severity--> < rs:requested-attribute id = "0x1006e" / > <!--Model Name--> < rs:requested-attribute id = "0x11ee8" / > <!--Model Class--> < rs:requested-attribute id = "0x11f57" / > <!--Assignment--> < rs:requested-attribute id = "0x1296e" / > <!--Originating Event--> < rs:requested-attribute id = "0x129fa" / > <!-- Model Handle -->
<!-- Models of Interest --> < rs:target-models > < rs:model mh = "0x100144d" / > </ rs:target-models >
</ rs:alarm-request >
Example
Additional Information
The $SPECROOT/ RestfulExamples/xml/Alarms/GetAlarmsByModelHandles.xml file will be updated to include the model handle in a future release.
Feedback
thumb_up
Yes
thumb_down
No