How can the DA REST API be used to query the database for a list of devices and their current state in CAPM?
DX NetOps CAPM all currently supported releases
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):