How to query the CAPM to get a list of devices and the current device state.

Document ID : KB000114727
Last Modified Date : 14/09/2018
Show Technical Document Details
Introduction:
How to use the DA REST api to query the database for a list of devices and the current state of the devices in CAPM.
Background:
This customer was looking for a way to query the CAPM database using the REST api to get a list of devices and the current state of the devices for automation purposes.
Environment:
CAPM 3.6
Instructions:
Use the following URL with the http "POST" method.

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

Use the following XML post body with the above URL.


<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>