New Advanced Lab! Python HTML Report Generator

New Advanced Lab

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.

Sample of how the resulting HTML page will look

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!

SSH PUBLIC KEY

Copy the SSH public key below.  In BASH shell environments, for example, this file could be saved to ~/.ssh/nutanix_demo.pub

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCm+7N2tjmJw5jhPmD8MS6urZQJB42ABh73ffGQSJ0XUHgdEDfjUDFkLK0wyJCe0sF5QJnh07UQn0F0BUnBi+VwehPGeODh6S43OP5YS/14L0fyntFI06B9lckx/ygRNu82sHxXCX+6VVUFPOPC+sz6j1DQswKY9d4cEYnaMBGSzqRxrqAIf6aWIKTJTYKPFY0zaUZ6ow2iwS0Nlh5EqaXsEBWkqMmr7/auP9GV/adUgzFrGLJklYBdfH575SIK6/PZL6wNT0jE9LmFlEm7dI01ZWPclBuV16FzRyrnzmWr/ebY62A04vYBtR0vyfEfsW2ZgxgD6aAE6+ytj0v19y0elRtOaeTySN/HlXh7owKWCHnlXNpTUiSDP8SQ8LRARkhQu3KEDL0ppGCrSF87oFkp1gPzf92U+UK3LaNMMjZXMOy0zLoLEdLtbQo6S8iHggDoX4NI4sWWxcX0mtadvjy/nIOvskk9IXasQh0u0MT9ARQY5VXPluKDtEVdeow9UbvgJ1xxNkphUgsWjCiy+sjgapsuZvWqKM6TPT1i24XYaau+/Fa0vhjLb8vCMWrrtkRwGt4re243NDYcYWTzVZUFuUK0w1wqt77KgjCCeyJdsZNwrh15v780Fjqpec3EGVA0xyNbF0jn/tsnYy9jPh/6Cv767EratI97JhUxoB4gXw== no-reply@acme.com