When speaking with customers and partners, particularly those teams tasked with monitoring various systems, the following question comes up:
Can I use the Nutanix APIs to monitor my clusters?– Mrs Jane Customer
The answer, as you’d expect, is YES! Of course you can. However, there is a large list of scripting technologies and programming languages that can be used to accomplish the task.
After various surveys and looking at some industry data, the most common and increasingly popular language is Python 3.
With that in mind, the Nutanix Developer Marketing team has created a very in-depth and more advanced-level lab that accomplishes a few key tasks.
- Sets up a connection to a Nutanix Prism Central instance
- Configures environment-specific settings
- Constructs multiple REST API requests to gather a large amount of Nutanix Prism Central environment information
- Publishes that information into an HTML document that can be easily modified for use on any web-publishing platform
- Accomplishes all the above while using many Python best-practices, e.g. a selection of recommendations from various PEP specifications & well-known industry experts such as Python Core Developer Raymond Hettinger
Please note, however, that the lab is not intended to teach readers to become Python programmers. Sorry. 🙂
You may ask, then, why is this an advanced lab? As the script and its dependencies are built, every part of the environment setup, the script itself and the output is explained in detail. The idea behind doing the lab this way is so that you, our valuable developer community members, can use the material to build your own scripts and tools using similar methods, if you wish.
Below is a preview of how the resulting HTML report will look, assuming you use the lab’s included HTML template.
With all that said, the Python API Reporter Lab 1.0 lab is now live and has been published on the Nutanix.dev Labs page. Please do check it out and, if you find it useful, we’d love to hear about it! Enjoy!