Sending a REST Query to filter for specific alarm types in CA Spectrum

book

Article ID: 129586

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

This KB will show you how to use a REST Client to send a query that would return a specific alarm ID that are current.

The example we will be using here is the "0x10701" Management Agent Lost Alarm
We will also be using Postman desktop application but this can be done using any REST Client, including "curl".
 

Environment

Postman 7.0.6
https://www.getpostman.com/

Spectrum 10.2.x
Spectrum 10.3.x

 

Resolution

  1. Open Postman

  2. Create a new request

  3. Use the following URL:

    http://hostname:port/spectrum/restful/alarms?symptoms=no

    Note: This will not show any symptom alarms, if applicable.

  4. Change type to "POST"



  5. Select the "Authorization" tab just below the URL.

  6. Change type to "Basic Auth"

  7. Fill in your Spectrum Admin user ID to be used and password.




  8. Now select the "Body" Tab.

  9. Change type to "Raw" and select "XML (application/xml)"

     

  10. The following example XML can be used (Verified working):
    <?xml version="1.0" encoding="UTF-8"?> 
    <!-- 
    
    
    CA Technologies a Broadcom Company
    One CA Plaza 
    Islandia, NY 11749 USA 
    
    Copyright (c) 2015 CA Technologies a Broadcom Company
    All rights reserved. 
    
    IN NO EVENT SHALL BROADCOM 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 "> 
    
    
    <rs:attribute-filter> 
    <search-criteria xmlns="http://www.ca.com/spectrum/restful/schema/filter"> 
    <filtered-models> 
    <and><or> 
    <equals> 
    <attribute id="0x11f50"> 
    <value>0x10701</value> 
    </attribute> 
    </equals> 
    </or></and> 
    </filtered-models> 
    </search-criteria> 
    </rs:attribute-filter> 
    
    <!-- Attributes of Interest --> 
    <rs:requested-attribute id="0x12b4c" /> <!-- Alarm Title --> 
    <rs:requested-attribute id="0x1006e" /> <!-- Model Name --> 
    <rs:requested-attribute id="0x1295d" /> <!-- ismanage (false when in maintanence mode) --> 
    <rs:requested-attribute id="0x129fa" /> <!-- model handle --> 
    
    </rs:alarm-request>


  11. Query is ready to send, click the "Send" button in the top right. Results will look like the following: 
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <alarm-response-list xmlns="http://www.ca.com/spectrum/restful/schema/response" error="EndOfResults" throttle="1" total-alarms="1">
        <alarm-responses>
            <alarm id="59a20b6b-2c38-1083-02b0-005056830acd">
                <attribute id="0x12b4c">MANAGEMENT AGENT LOST</attribute>
                <attribute id="0x1006e">Sim26259:BNCMAN-19EA-3750S01.net.bnc.ca</attribute>
                <attribute id="0x1295d">true</attribute>
                <attribute id="0x129fa">0x100c1c</attribute>
            </alarm>
        </alarm-responses>
    </alarm-response-list>



​​​

Attachments