How to query the CA Performance Management (CAPM) to get a list of devices and the current device state.
search cancel

How to query the CA Performance Management (CAPM) to get a list of devices and the current device state.

book

Article ID: 114727

calendar_today

Updated On:

Products

CA Performance Management Network Observability

Issue/Introduction

How can the DA REST API be used to query the database for a list of devices and their current state in CAPM?

Environment

DX NetOps CAPM all currently supported releases 

Resolution

You can use a REST API client to the following to Query body, or curl where you place it in an xml file (for example - /tmp/filter.xml):

<FilterSelect xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="filter.xsd"> 
<Filter> 
      <Device.ContactStatus type="EQUAL">DOWN</Device.ContactStatus> 
</Filter> 
<Select use="exclude" isa="exclude"> 
      <Item use="exclude"> 
            <Name use="include"/> 
            <CreateTime use="include"/> 
            <MDRItemID use="include"/> 
      </Item> 
      <Device use="exclude"> 
            <PrimaryIPAddress use="include"/> 
            <DiscProfileID use="include"/> 
            <ContactStatus use="include"/> 
      </Device> 
      <ManageableDevice> 
            <SNMPProfileID use="include"/> 
      </ManageableDevice> 
</Select> 
</FilterSelect>

 

Then use the following URL, which allows for filtering on device attributes, with the http "POST" method:

http://DAHost:8581/rest/devices/manageable/filtered

Using curl, you can run it on the command line (by referencing the file with the above filter, which in this example, is /tmp/filter.xml):