Spectrum REST query to gather Impacted Devices list for active alarms
search cancel

Spectrum REST query to gather Impacted Devices list for active alarms

book

Article ID: 420900

calendar_today

Updated On:

Products

Spectrum Network Observability

Issue/Introduction

Get Impacted devices list for alarms via REST

We see Alarms in Spectrum that have a list of impacted devices. How can we use REST to export the impacted devices list along with the rest of the alarms attributes?

Environment

All supported Network Observability DX NetOps Spectrum releases

Resolution

Here we see a sample alarm where the Impact tab for the alarm shows two devices associated to the alarm.

Use the following REST call, done using the ARC API in this example, which will return those two devices.

  • Request type: POST
  • Request URL: https://<oc-host:port>/spectrum/restful/alarms
  • Request Body:
    • The 0x12dc7 attribute ID represents the Impact attribute that'll pull in the target devices.
    • The alarms id value string is for the target alarm(s). Update with that alarm as needed. Currently showing sample from our lab.

      <?xml version="1.0" encoding="UTF-8"?>
      
      <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:requested-attribute id="0x11f53" />
          <rs:requested-attribute id="0x10000" />
          <rs:requested-attribute id="0x11f56" />
          <rs:requested-attribute id="0x12b4c" />
          <rs:requested-attribute id="0x11f4d"/>
          <rs:requested-attribute id="0x12dc7"/>
      
          <rs:alarms id="68c852f4-5f92-1028-03e0-42010afc1741" />
      
      </rs:alarm-request>

When that call is run we receive the following in return. This matches the UI's devices seen in the Impact tab.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alarm-response-list xmlns="http://www.ca.com/spectrum/restful/schema/response"
                     total-alarms="1"
                     throttle="1"
                     error="EndOfResults">
	<alarm-responses>
		<alarm id="68cbfbec-7765-1000-0e72-008010fd8210">
			<attribute id="0x11f53">0x10000c6</attribute>
			<attribute id="0x10000">Rtr_Cisco</attribute>
			<attribute id="0x11f56">3</attribute>
			<attribute id="0x12b4c">UNRESOLVED FAULT DETECTED</attribute>
			<attribute id="0x11f4d">false</attribute>
			<attribute id="0x12dc7">
R1.mydomain.com (0x10000c6,Critical)
R2.mydomain.com (0x10000c9,Suppressed)</attribute>
		</alarm>
	</alarm-responses>
</alarm-response-list>