CA Spectrum - rest API alarms count is remains same even the value is changed

Document ID : KB000076433
Last Modified Date : 13/04/2018
Show Technical Document Details
Question:
How can I  get a subscription ID  using POST call In CA Spectrum using REST API?
Environment:
Spectrum version 10.x.x
All Platforms
Answer:
For Subscription model, please follow  below steps 

1.    Get the Subscription ID
http://<hostname><:portnumber>/spectrum/restful/subscription
Reference: https://docops.ca.com/ca-spectrum/10-2-3/en/programming/web-services-api-reference/how-to-use-the-ca-spectrum-web-services-api/restful-resources-nouns/subscription#subscription-POSTSubscription

a.    Example for Pull Alarms Subscription request available at C:\win32app\Spectrum\RestfulExamples\xml\Alarms\PullAlarmsSubscription.xml
b.    Please add below 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 ">
  ---------
  -------- 
c.    Set the pull-interval value as per requirement as below
           <rs:pull-interval>30000</rs:pull-interval>

2.    Get the new alarms with Subscription ID
http://<hostnumber><:portnumber>/spectrum/restful/subscription/<subscription_ID>

 
Additional Information:
Reference : https://docops.ca.com/ca-spectrum/10-2-3/en/programming/web-services-api-reference/how-to-use-the-ca-spectrum-web-services-api/restful-resources-nouns/subscription#subscription-GETSubscription