- 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 unable to find an equivalent in APIC-EM's API. Tried using "=@" and "*=" and the same as PI in case it was the same function but none work. How to search/filter for any devices that start with the IP address "10.20.30.". Or if 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.
For example you you like know the device with certain IP address you can use
GET /network-device/ip-address/{ipAddress} API
This one is easier because there is an existing API, otherwise you can use
GET /network-device
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
GET /network-device/{id}
to get the detail of that device
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.%
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comments
0 comments
Please sign in to leave a comment.