How to get a list of Critical and Major alarms using the Rest API
search cancel

How to get a list of Critical and Major alarms using the Rest API

book

Article ID: 194661

calendar_today

Updated On:

Products

CA Spectrum DX NetOps

Issue/Introduction

How to use the Spectrum Web Services to export a list of Critical and Major alarms from Spectrum.

Environment

Release : 10.4

Component : Spectrum Core / SpectroSERVER

Resolution

You can use the POST alarms web service URL;

http://<OCSERVER>:<Port>/spectrum/restful/alarms

This uses the HTTP POST method and requires the following XML body. 

 

<?xml version="1.0" encoding="UTF-8"?>
<!--


   CA Technologies, Inc.
   One CA Plaza
   Islandia, NY 11749 USA

   Copyright (c) 2012 CA Technologies, Inc.
   All rights reserved.

   IN NO EVENT SHALL CA TECHNOLOGIES INCORPORATED BE LIABLE FOR
   ANY INCIDENTAL, INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES
   WHATSOEVER (INCLUDING BUT NOT LIMITED TO LOST PROFITS) ARISING OUT
   OF OR RELATED TO THIS SOFTWARE, EVEN IF CA TECHNOLOGIES INCORPORATED
   HAS BEEN ADVISED OF, KNOWN, OR SHOULD HAVE KNOWN, THE POSSIBILITY OF
   SUCH DAMAGES.


-->

<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 
         attributes on the specified alarms
      -->

  <!-- Attributes of Interest -->
  <rs:attribute-filter>
    <search-criteria xmlns="http://www.ca.com/spectrum/restful/schema/filter">
    <filtered-models>
     <or>
      <equals>
        <attribute id="0x11f56">
          <value>2</value>
        </attribute>
      </equals>
      <equals>
        <attribute id="0x11f56">
          <value>3</value>
        </attribute>
      </equals>
      </or>
      </filtered-models>
    </search-criteria>
  </rs:attribute-filter>
  <!-- Alarms of Interest -->

<rs:requested-attribute id="0x11f9c" />
    <rs:requested-attribute id="0x1006e" />
    <rs:requested-attribute id="0x12d7f" />
    <rs:requested-attribute id="0x10000" />
    <rs:requested-attribute id="0x11f4e"/>
    <rs:requested-attribute id="0x11f56"/>
    <rs:requested-attribute id="0x12b4c"/>
</rs:alarm-request>

Additional Information

Alarm count mismatch between Spectrum OneClick Alarms tab and REST API
https://knowledge.broadcom.com/external/article?articleId=190598

REST API Alarm count mismatch Oneclick Alarm count
https://knowledge.broadcom.com/external/article?articleId=232064