07-20-2016 02:41 AM - edited 03-01-2019 04:29 AM
The GET /network-device API is documented as: "Retrieves the network devices by filters.".
The attached image from the Swagger page does not show any filters.
Regards
Nathan
07-20-2016 03:23 AM
Hi Nathan,
Did you had chance to check out the blog from Adam-Five APIC-EM API to improve network engineer productivity – part 1
Also can you try on scope field instead of all as 1-5 to see the first five network device. or 1 . I think this is what filtering the output. Not sure.
Please let me know if iam wrong.
Thanks and Regards,
Geevarghese
07-20-2016 05:25 AM
Geevarghese
Thank you for following up.
I have seen Adam's blog. Which aspect were you thinking of exactly?
With respect to the scope, I tried your suggestion of using "1-5", and I tried "1" and I tried "D". None of which seemed to make any difference at all to the response. The scope field has to have a value, else the "Ty it out!" button won't send the request, but it is not clear that it matters at all what that value actually is.
This is even weirder than I thought.
Regards
Nathan
07-20-2016 11:52 PM
Hi Nathan,
Many thanks for your guidance. Another thought I had is to try the same function call using POSTMAN . what I was trying was GET http://<APIC-EMController>/api/v1/network-device/1/2. Even though it doesn't answer to Swagger issue what I feel is in the Things to Try section of this url-coding-series-learning-labs/8.md at master · CiscoDevNet/coding-series-learning-labs · GitHub will shed some light.
Thanks and Regards,
Geevarghese
07-21-2016 03:50 AM
Geevarghese
I shall work on the Python code aspects next, and I shall use Adam's blog for reference.
Meanwhile, there is some bugs to report here, in that the Swagger API pages say one thing and do another. One aspect of that is the scope, which seems not to work as expected. Another is the lack of filter fields in the API page that are documented to exists: "Gets the list of network devices filtered using management IP address, mac address, hostname and location name.".
I should explain that this is not a show stopper per se, but it definitely is confusing for people trying to use the Swagger pages as a means to understand the APIs. Having something that is wrong is almost worse than not having anything at all.
Regards
Nathan
07-21-2016 08:32 AM
Agree, it should be documented something like" "Get all network devices. You can filter by using IP, Mac....etc."
07-21-2016 10:24 PM
Hi Yawchen
The API description should only refer to filters if the API actually supports them. It is not clear that this API does support filters.
Regards
Nathan
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