Using Get tunneling with REST to filter results from the Data Aggregator

Document ID : KB000035733
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction:

Get Tunneling is where we "Post" some XML to the WebServices on the Data Aggregator which defines a "query". This query specifically includes or excludes data to ensure only the data you want returned is actually returned by the data aggregator web services. This can be useful when you have a large number of items and want to restrict the data being returned by the system to a specific subset to both speed up the query AND simplify the data response.

This applies to ALL web services under to <DA_HOST>:8581/rest endpoint

Instructions:

1. You must use the POST method to send XML to the following endpoint: <DA_HOST>:8581/rest/<specific_endpoint>/filtered
   The format of the XML sent is very specific

2. The GetTunneling XML that you post has two distinct sections.

The first section, called the "Filter" section, is used to filter or restrict the number of ITEMs returned from the web service call. You can either specify the IDs of the items you want returned directly, OR, specify a dynamic list by querying specific attributes and comparing them to desired values.

The second section, called the "Select" section, is used to filter or restrict the attributes returned for ALL desired items, allowing your returned XML to have simple detail such as an ID, or as much detail as possible including all attributes.

In both cases, it is important to know that the more items, and the more attributes you include, the longer it will take to render and the more the DA will be impact. To ensure that the DA is not overloaded, there is a restriction on the number of items/attributes that can be returned.


Example XML:

The following XML selects all communication profiles (i.e. SNMP profiles) which have "SNMP" in the name OR ( are ranked 3rd or lower AND have an SNMP port of 161). Once found, only the CommunityName, and the generic CommunicationProfile details are returned.

<FilterSelect xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="filter.xsd">
    <Filter>
        <Or>
            <CommunicationProfile.ProfileName type="CONTAINS">SNMP</CommunicationProfile.ProfileName>
            <And>
               <CommunicationProfile.Rank type="LESS_OR_EQUAL">3</CommunicationProfile.Rank>
               <SNMPv1Profile.PortNumber type="EQUAL">161</SNMPv1Profile.PortNumber>
            </And>
       </Or>
    </Filter>
    <Select use="exclude" isa="exclude">
       <SNMPv1Profile use="exclude">
          <CommunityName use="include"/>
       </SNMPv1Profile>
       <CommunicationProfile use="include" />
    </Select>
</FilterSelect>