CA Spectrum - Getting the alarms count via the REST API using Subscription ID
search cancel

CA Spectrum - Getting the alarms count via the REST API using Subscription ID

book

Article ID: 76433

calendar_today

Updated On:

Products

Spectrum Network Observability

Issue/Introduction

The Spectrum REST API allows a number of functions to be accessed. One of these is to get the Alarm count in Spectrum.

How can the alarm count be obtained via a Subscription ID using a POST call in CA Spectrum using REST API?

Environment

Spectrum :: All Supported Versions
All Platforms

Resolution

For Subscription model, please follow  below steps 

  1. Get the Subscription ID by using the URL;



http://<ONECLICK_HOST><:portnumber>/spectrum/restful/subscription

  • Example for Pull Alarms Subscription request available under $SPECROOT/RestfulExamples/xml/Alarms/PullAlarmsSubscription.xml
  • Add the following attribute to the request to get existing alarms in the first request;



send-preexisting-instances="true"
<rs:subscription-request 
  xmlns:rs="http://www.ca.com/spectrum/restful/schema/request" send-preexisting-instances="true"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../Rest.a/src/xsd/Request.xsd ">

  ---------
  -------- 



  • Set the pull-interval value as per desired requirement. For example;



<rs:pull-interval>30000</rs:pull-interval>



  1. Now, get the new alarms using the Subscription ID via the following URL;



http://<ONECLICK_HOST><:portnumber>/spectrum/restful/subscription/<subscription_ID>



 

Additional Information

Please reference the "subscription" section of the documentation for more information.

restful-resources-nouns/subscription