get-network-device-list.py tabulate issue with switch stack
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2016 04:43 PM - edited 03-01-2019 04:27 AM
Hello,
I'm new to the world of coding but have an extensive background with Cisco. I've recently installed APIC-EM to see what it can do. I found the 'get-network-device-list.py' in the learning labs to be very practical. I tweaked the device_list within the python script to get '[item["hostname"],item["managementIpAddress"],item["serialNumber"],item["platformId"],item["softwareVersion"]' as these are values I'd like to see. Using tabulate makes this information easily transportable to an excel doc. I was really excited about this until I added a switch stack. No more nice columns. Each switch in the stack provides a "serialNumber" along with "platformId" for that one respective device item. This throws off the nice column flow.
I'm posting here to see if anyone has run into this yet and/or can offer some advice to get me going in the correct direction.
Thanks in advance for any assistance!
- Labels:
-
APIC

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2016 05:07 PM
Your code is fine, just resize you terminal window to make it wider

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2016 05:24 PM
Hmmm, I don't have a stack with which to test. Can you post the output of the APIC-EM JSON (maybe from Swagger under the "API" link at the top of the APIC-EM pages) for such a network-device? I think maybe you're saying the platformId is a list rather than one value? The resulting output of your script showing the stack output would also be helpful.
