New Advanced Lab! Python HTML Report Generator

New Advanced Lab

Table of Contents

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!

© 2024 Nutanix, Inc. All rights reserved. Nutanix, the Nutanix logo and all Nutanix product, feature and service names mentioned herein are registered trademarks or trademarks of Nutanix, Inc. in the United States and other countries. Other brand names mentioned herein are for identification purposes only and may be the trademarks of their respective holder(s). This post may contain links to external websites that are not part of Nutanix.com. Nutanix does not control these sites and disclaims all responsibility for the content or accuracy of any external site. Our decision to link to an external site should not be considered an endorsement of any content on such a site. Certain information contained in this post may relate to or be based on studies, publications, surveys and other data obtained from third-party sources and our own internal estimates and research. While we believe these third-party studies, publications, surveys and other data are reliable as of the date of this post, they have not independently verified, and we make no representation as to the adequacy, fairness, accuracy, or completeness of any information obtained from third-party sources.