Search

v4 API: API Key Authentication (Python SDK)

This complete Python script demonstrates the use of IAM API key authentication, new in the Nutanix v4 GA APIs and SDKs. The script will create a service account specifically for testing API key authentication, create an API key for the new user and, finally, create an Authorization Policy specifically for this scenario.

Publication date:

January 20, 2025

Author:

Chris Rasmussen

Intended Audience Level:

Intermediate

Code Sample Type:

Complete Script

Nutanix Technology or Product:

Prism Central

Minimum Product Version:

pc.2024.3 and AOS 7.0

Script/Code Language:

Python

API Code Sample (yes/no):

Yes

REST API Version:

v4

Version Release Status:

GA

REST API or SDK:

Language-specific SDK

Code Sample Details

This code sample is intended to accompany the Nutanix v4 APIs: Using API Key Authentication article.

License

©2025 Nutanix, Inc. All rights reserved. Nutanix, the Nutanix logo and all Nutanix product and service names mentioned herein are registered trademarks or trademarks of Nutanix, Inc. in the United States and other countries. All other brand names mentioned herein are for identification purposes only and may be the trademarks of their respective holder(s).

Our decision to link to or reference 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 paper, they have not independently verified unless specifically stated, and we make no representation as to the adequacy, fairness, accuracy, or completeness of any information obtained from a third-party.

All code samples are unofficial, are unsupported and will require extensive modification before use in a production environment. This content may reflect an experiment in a test environment. Results, benefits, savings, or other outcomes described depend on a variety of factors including use case, individual requirements, and operating environments, and this publication should not be construed as a promise or obligation to deliver specific outcomes.

This content may reflect an experiment in a test environment. Results, benefits, savings, or other outcomes described depend on a variety of factors including use case, individual requirements, and operating environments, and this publication should not be construed as a promise or obligation to deliver specific outcomes.