cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1067
Views
1
Helpful
6
Replies

Swagger GET /network-device does not have filters

Nathan Sowatskey
Cisco Employee
Cisco Employee

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

no_filters.tiff

6 Replies 6

Geevarghese Cheria
Cisco Employee
Cisco Employee

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

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

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

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

yawming
Cisco Employee
Cisco Employee

Agree, it should be documented something like" "Get all network devices. You can filter by using IP, Mac....etc."

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