10-06-2016 10:15 PM - edited 03-01-2019 04:31 AM
How can devices or items be searched for using the APIC-EM API? In PI I use the contains("search_string") method in the URL but I can't find an equivalent in APIC-EM's API. I tried using "=@" and "*=" and the same as PI in case it was the same function but none work.
So if I wanted to search/filter for any devices that start with the IP address "10.20.30.", how do I do that? Or if I wanted to search for part of a MAC address for example? Or maybe want to search for any network devices that have a hostname starting with "AU".
How is this done using APIC-EM API? Thank you
10-07-2016 08:53 AM
For example you you like know the device with certain IP address you can use
This one is easier because there is an existing API, otherwise you can use
to get all network devices then depends on the key you like to search,
for example "serialNumber": "FGL1548S2YF" or "macAddress": "68:bc:0c:63:4a:b0",or "hostname": "Branch-Router1"
you iterate the entire response from the GET query to find the device ID
for the device then use
to get the detail of that device
Maybe there is other way but wonder if this can serve your need ?
10-07-2016 09:00 AM
You can also filter the results of, say, network-device:
https://apic-em/api/v1/network-device?managementIpAddress=10.20.30.
Properties like hostname, serialNumber and managementIpAddress can be used as query args. They will then do begins with searches. You can use '%' as a wildcard character to do contains searches:
https://apic-em/api/v1/network-device?managementIpAddress=%.20.%
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide