How can I use REST API (Java WebServices) to pull alarms from OneClick using an Alarm Filter?
Release: Any
For Spectrum 10.4.0, 21.2, 22.2
Using a Webservices REST Client under String Body using application/xml, charset=UTF-8
You will not include the filtername in the URL, but it will be included in the header body instead:
http://<server:port>/spectrum/restful/alarms/filter
Webservices Post with the header info of:
<?xml version="1.0" encoding="UTF-8"?>
<rs:alarm-request throttlesize="5"
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
attributes on the specified alarms
-->
<!-- Attributes of Interest -->
<!-- -->
<rs:requested-attribute id="0x1006e" />
<rs:requested-attribute id="0x129fa" />
<rs:requested-attribute id="0x11ee8" />
<rs:requested-attribute id="0x12d7f" />
<rs:requested-attribute id="0x10000"/> <!--Model Type Name-->
<rs:requested-attribute id="0x10001"/> <!--Model Type of Alarmed Model-->
<rs:requested-attribute id="0x10009"/> <!--Security String-->
<rs:requested-attribute id="0x1000a"/> <!--Condition-->
<rs:requested-attribute id="0x1006e"/> <!--Model Name-->
<rs:requested-attribute id="0x11ee8"/> <!--Model Class-->
<rs:alarm-filter name="filter_name"/>
</rs:alarm-request>
For Spectrum 10.1.0 through 10.1.3, 10.2.0 and 10.2.1 with PTF_10.2.185
Using a Webservices REST Client under String Body using application/xml, charset=UTF-8
http://<OneClick server>:<Port>/spectrum/restful/alarms/filter?name=<Filter name>
Webservices Post with the header info of the following under String Body
<?xml version="1.0" encoding="UTF-8"?>
<rs:alarm-request throttlesize="5"
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
attributes on the specified alarms
-->
<!-- Attributes of Interest -->
<!-- -->
<rs:requested-attribute id="0x1006e" />
<rs:requested-attribute id="0x129fa" />
<rs:requested-attribute id="0x11ee8" />
<rs:requested-attribute id="0x12d7f" />
<rs:requested-attribute id="0x10000"/> <!--Model Type Name-->
<rs:requested-attribute id="0x10001"/> <!--Model Type of Alarmed Model-->
<rs:requested-attribute id="0x10009"/> <!--Security String-->
<rs:requested-attribute id="0x1000a"/> <!--Condition-->
<rs:requested-attribute id="0x1006e"/> <!--Model Name-->
<rs:requested-attribute id="0x11ee8"/> <!--Model Class-->
</rs:alarm-request>
The alarm filter through WebServices is broken in Spectrum 10.2.1, but a fix exists in PTF_10.2.185.