I want to use the Web Services API to allow a hypervisor to query Spectrum to retrieve the alarms. I have created alarm filters in Spectrum to target the alerts I want to see back to the hypervisor.
To test the REST APIs, I use the Postman tool and test simple queries to validate the operation.
I'm having trouble viewing answers when I test the following query:
GET http://my server:8080/spectrum/restful/alarms/filters
I do not get the expected return with Postman and even with IE or Chrome. I only have the first two lines of the expected answer while I have six alarm filters.
<? xml version = "1.0" encoding = "UTF-8" standalone = "yes"?>
<alarmfilters-response xmlns = "http://www.ca.com/spectrum/restful/schema/response" />
I have one exception with Firefox that returns the correct answer:
<Alarmfilters-response>
<Alarmfilter> LAN-Control </ alarmfilter>
<alarmfilter> AllAlarms </ alarmfilter>
<alarmfilter> Severity </ alarmfilter>
<Alarmfilter> MAN-Control </ alarmfilter>
<Alarmfilter> Alarms-Control </ alarmfilter>
<Alarmfilter> WAN-Control </ alarmfilter>
</ Alarmfilters-response>
My goal is then to use a POST command that will allow me to select one of the alarm filters to retrieve the alarms with details of them.
Here is the model I want to use:
POST /spectrum/restful/alarms/filter?name=Alarmes-Control HTTP/1.1
Host: myserver:8080
Content-Type: application/xml,application/json
Authorization: Basic YmNpdC1waWwxOnBpbG90ZTE=
cache-control: no-cache
Postman-Token: fb894bff-2f1d-413f-8782-f6501b37f0f7
<?xml version="1.0" encoding="UTF-8"?>
<rs:alarm-request throttlesize="100"
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 ">
<!-- Attributes of Interest -->
<rs:requested-attribute id="0x10000"/>
<!--Model Type Name-->
<rs:requested-attribute id="0x10001"/>
<!--Model Type of Alarmed Model-->
<rs:requested-attribute id="0x12adb"/>
<!--Collection-->
<rs:requested-attribute id="0x1000a"/>
<!--Condition-->
<rs:requested-attribute id="0x1006e"/>
<!--Model Name-->
<rs:requested-attribute id="0x12b4c"/>
<!--Alarm Title-->
</rs:alarm-request>
When I test this query, I get the following answer:
<? xml version = "1.0" encoding = "UTF-8" standalone = "yes"?>
<alarm-response-list xmlns = "http://www.ca.com/spectrum/restful/schema/response" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: nil = "true" />
Which also corresponds to the first two lines of the answer.
Can someone explain to me why? Thanks for your help.#