You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Now we make a call towards the tenant class on the ACI fabric with the proper header value set.
64
-
# We leverage the .xml ending to receive the data back as XML. We're adding health and faults to the printout to ensure that we get levels of data back from the APIC
# Requests stores the text of the response in the .text attribute. Lets print it to see raw JSON
69
+
print(tenants.text)
70
+
```
70
71
There is a lot of manipulation going on with the top part of this script, but most of it deals with the methods needed to authenticate towards the ACI fabric, needing a username and password to authenticate, receive the response from the fabric and gather a token, then send this token in a subsequent call to the fabric to pull the ACI tenant information out in JSON format. However, this snippet:
71
72
72
73
- imported the `request` library to easily interact with the ACI fabric's REST APIs
@@ -76,8 +77,8 @@ There is a lot of manipulation going on with the top part of this script, but mo
76
77
77
78
4. Save the `get-tenant-json.py` file. To download or review the current code, you can get it from GitHub [here](https://github.com/CiscoDevNet/coding-skills-sample-code/blob/master/coding202-parsing-json/get-tenant-json-1.py).
0 commit comments