DX NetOps

  • 1.  Filter interfaces by IP Address using RESTFul

    Posted Mar 05, 2015 11:18 AM

    Has anyone been able to filter specific interfaces by network addresses using RESTFul?

     

    I've tried the 'has-pcre' to filter based on IP's starting with e.g. 192.168.* but this doesn't seem to work.

     

                <has-pcre>

                  <attribute id="0x12dbb">

                    <value>^192.168\..*$</value>

                  </attribute>

                </has-pcre>

     

    Has anyone been able to filter interface models by using attribute "0x12dbb" (ip_Address)?

     

    Further investigation indicates that the IP address is stored internally as an integer or something non-string, as you can't use pcre when creating filters in the Locator.

     

    Any ideas on how to achieve this? I can get all of the interfaces for the device, but seems counter-productive to get them all and filter them out using a script afterwards. I'd rather get filter to do the work for me.

     

    Regards,

     

    Frank



  • 2.  Re: Filter interfaces by IP Address using RESTFul

    Posted Mar 06, 2015 05:05 PM

    I would try combining "greater-than" and "less-than", or save the default By IP Address Range OneClick search into a new search, then reference that search in your API call.



  • 3.  Re: Filter interfaces by IP Address using RESTFul

    Posted Mar 11, 2015 07:31 AM

    I've tried but I think it stores the ip-address value as a non-string. I think the search you refer to uses custom code. I had a look at it and it references java functions.

     

    I think I'll have to just harvest attribute 0x5b60004 (USMOtherIPAddresses) for all devices and extract the info I need using scripts.

     

    Thanks again,


    Frank