API Reference

Last updated: 04-23-2024

Nutanix Cloud Clusters API Reference (v2)

Download OpenAPI specification:Download

NC2 Introduction

Nutanix Cloud Clusters (NC2) delivers the promise of a hybrid multicloud platform designed to run applications in private or multiple public clouds. NC2 operates as an extension of on-prem data centers and provides a hybrid cloud architecture that spans private and public clouds, operated as a single cloud.

nc2-architecture.png

This document covers the NC2 version 2 (v2) APIs. These APIs allow you to create and manage Azure and AWS clusters on the cloud. The v2 APIs are compliant with the Open API Specification (OAS3) 3.0 standards.

The NC2 version1 (v1) APIs were mainly used for internal purposes and are not generally available. Nutanix recommends all its customers using v1 APIs to manually migrate to the latest v2 GA APIs.

For more information on NC2, see Nutanix user guide for AWS, and Azure.

Leveraging NC2 V2 APIs to Create a 3-Node AWS Cluster

This topic serves as a roadmap, guiding users through the process of leveraging these APIs to create a 3-node AWS cluster efficiently.

Prerequisites

Before you begin, ensure that Python 3.x is installed on your system. If not, you may need to install Python 3.x before proceeding further with utilizing the NC2 V2 APIs.

# Check python version

!python3 --version

Installation

Install the necessary Python packages using a package manager called pip.

pip3 install requests pyjwt pytz

  1. requests: This package is commonly used for making HTTP requests in Python.
  2. pyjwt: PyJWT is a Python library that provides functionality for encoding and decoding JSON Web Tokens (JWTs).
  3. pytz: Pytz is a Python library that provides functionality for working with time zones.

Variable Configuration

Define variables necessary for specifying authentication credentials and other parameters essential for interacting with the NC2 V2 APIs effectively, such as API_KEY and KEY_ID.

To create a MyNutanix API Key (refer to the NC2 Azure user guide and NC2 AWS user guide).

# Constants and Configurations

API_KEY = 'YOUR_API_KEY'                                       
KEY_ID = 'YOUR_KEY_ID'
ISSUER = 'RANDOM_UUID'                                          # A unique issuer uuid

NC2_BASE_URL = 'https://cloud.nutanix.com/api/v2'
CREATE_CLUSTER_URL = '/clusters/aws'
HIBERNATE_CLUSTER_URL = '/clusters/{cluster_id}/hibernate'
RESUME_CLUSTER_URL = '/clusters/{cluster_id}/resume'
TERMINATE_CLUSTER_URL = '/clusters/{cluster_id}/terminate'

GET_TASK_URL = '/tasks/{task_id}'
MAX_TIMEOUT = 7200                                              # Maximum timeout of 2 hours (in seconds)
POLLING_INTERVAL = 60                                           # Initial polling interval (in seconds)
MYNUTANIX_API_KEYS_URL = 'https://apikeys.nutanix.com'          # MyNutanix API Keys URL

Log Configuration

By configuring logs, you can ensure that relevant information and errors are captured systematically, enabling you to monitor the execution of their scripts effectively and troubleshoot any issues that may arise.

# Configure Logs
import logging

logging.basicConfig(
    level=logging.DEBUG, # set log level to debug
    format='%(asctime)s - %(levelname)s - %(message)s',
    # filename='api_interaction.log'                               # Alternatively, write logs to the file if filename param is passed
)

Authentication

Authentication involves two key steps:

import jwt
import datetime
import time
import hmac
import hashlib
import base64
import pytz
import uuid


# Create a JWT token
def create_jwt():
    """
    Create a JWT token using the provided API key and key ID.

    Returns:
        The JWT token and it's expiry if successful, None otherwise.
    """
    
    try:
        curr_time = datetime.datetime.utcnow()
        payload = {
            "aud": MYNUTANIX_API_KEYS_URL,
            "iat": curr_time,
            "exp": curr_time + datetime.timedelta(seconds=300),     # Nutanix recommends a 5 minute expiry
            "iss": ISSUER,
            "metadata": {
                "reason": "NC2 AWS Cluster Quick Starter"
            },
            "context": {}
        }
        body = "{}".format(KEY_ID)
        signature = base64.b64encode(
            hmac.new(bytes(API_KEY , 'latin-1'),
            bytes(body , 'latin-1'),
            digestmod=hashlib.sha512).digest()
        )
        token = jwt.encode(
            payload,
            signature,
            algorithm='HS512',
            headers={"kid": KEY_ID}
        )
        logging.debug("Token: {}" .format(token))

        return token, payload["exp"]

    except Exception as e:
        logging.error(f"JWT generation failed: {str(e)}")
        return None, None
    
create_jwt()

We will utilize the curl command to execute an API call, fetching the organizations by employing the JWT token that has been recently generated.

# List organizations

!curl --location 'https://cloud.nutanix.com/api/v2/organizations' --header 'Authorization: Bearer {{token}}'

We now proceed with another API call to retrieve the list of cloud accounts within an organization. You can choose any organization from the available options if you have access to multiple organizations. Please note that if five minutes have passed since the creation of the JWT token, you will need to generate a new one.

# List cloud accounts under an organization

!curl --location 'https://cloud.nutanix.com/api/v2/organizations/{{organization_id}}/cloud-accounts' --header 'Authorization: Bearer {{token}}'

ORGANIZATION_ID = "YOUR_ORGANIZATION_ID" # Fetched using the List Organizations API

CLOUD_ACCOUNT_ID = "YOUR_CLOUD_ACCOUNT_ID" # Fetched using the List Cloud Account API

Usage

In this section, we will see how to utilize the NC2 V2 APIs for creating a 3-node AWS cluster within a new Virtual Private Cloud (VPC). In this usage example, we demonstrate the creation of a 3-node AWS cluster within a freshly created Virtual Private Cloud (VPC). The API call will return a task when initiating the cluster creation process. It's important to note that long-running NC2 V2 API operations, including cluster creation, termination, hibernation, and resumption, will similarly return a task. To monitor the progress and status of these tasks, users can periodically poll the task endpoint using a GET request.

import requests
import json

def create_cluster(jwt):
    """
    Create an AWS cluster using the provided JWT token.

    Args:
        jwt (pair(jwt_token, jwt_expiry)): The JWT token and it's expiry time.

    Returns:
        The task object for cluster creation if successful, None otherwise.
    """
    try:

        # Define headers with JWT token for authentication
        jwt_token, _ = jwt
        headers = {
            'Authorization': f'Bearer {jwt_token}',
            'Content-Type': 'application/json',
            'Accept': 'application/json',
        }

        logging.debug(headers)
        
        # Below is payload for creating an aws cluster (adjust as needed)
        # More information on the api specification for create aws cluster can be found here,
        # https://www.nutanix.dev/api_references/nc2/#/6lo1uf2bcd4bv-create-aws-cluster
        payload = {
            "data": {
                "use_case": "general",
                "organization_id": ORGANIZATION_ID,
                "name": "nc2-v2-apis-quick-starter",
                "cloud_account_id": CLOUD_ACCOUNT_ID,
                "region": "eu-central-1",                             # eu-central-1 represents Frankfurt region. Given region mentioned for reference. 
                "host_access_ssh_key": "SSH_KEY_NAME",                # Can be generated on AWS -'KEY PAIRS' or UI.
                "license": "aos",
                "aos_version": "6.7",
                "software_tier": "pro",                               
                "capacity": [
                    {
                        "host_type": "z1d.metal",                     # Only for reference. For allowed values check API documentation.
                        "number_of_hosts": 3
                    }
                ],
                "redundancy": {
                    "factor": 2                                        
                },
                "network": {
                    "mode": "new",                                     
                    "availability_zone": "eu-central-1a",               
                    "vpc_cidr": "192.10.0.0/16",                        
                    "management_services_access_policy": {
                        "mode": "restricted",
                        "ip_addresses": [
                            "192.10.0.0/16"
                        ]
                    },
                    "prism_element_access_policy": {
                        "mode": "restricted",   
                        "ip_addresses": [
                            "192.10.0.0/16"
                        ]
                    }
                }
            }
        }

        # Send a POST request to create the cluster
        response = requests.post(NC2_BASE_URL + CREATE_CLUSTER_URL, json=payload, headers=headers)

        if response.status_code == 202:
            return response.json()
        else:
            raise Exception(f"Cluster creation failed with status code {response.status_code}, error {response.text}")

    except Exception as e:
        raise Exception(f"Error creating cluster: {str(e)}")

We will monitor a task by polling it every 60 seconds to check its status. We will keep polling until the task reaches a terminal status or until the maximum timeout of 7200 seconds (2 hours) is reached. Additionally, we'll ensure token validity by checking for expiry and generating a new token if needed.

# Function to poll the status of a task with maximum timeout

terminal_status_list = [
    "done",
    "failed",
    "cancelled"
]

def poll_task_status(jwt, task_id):

    start_time = time.time()
    
    while True:

        # Check if the JWT token is expired and create a new one if needed
        jwt_token, jwt_expiry = jwt
        if jwt_token is not None and datetime.datetime.now() >= jwt_expiry:
            jwt_token, jwt_expiry = create_jwt()
            
        headers = {
            'Authorization': f'Bearer {jwt_token}'
        }

        task_status_url = NC2_BASE_URL + GET_TASK_URL.format(task_id=task_id)
        response = requests.get(task_status_url, headers=headers)
        if response.status_code == 200:
            task_status = response.json()['data']['status']
            logging.info(f"Task status: {task_status}")
            if task_status in terminal_status_list:
                logging.debug(f"Task done!")
                return task_status
        else:
            logging.error(f"Error polling task status with status code: {response.status_code}")

        elapsed_time = time.time() - start_time
        if elapsed_time < MAX_TIMEOUT:
            sleep_time = min(POLLING_INTERVAL, MAX_TIMEOUT - elapsed_time)
            time.sleep(sleep_time)
            logging.debug(f"Sleeping for {sleep_time} ..")
        else:
            raise("Polling reached maximum timeout.")

We will combine these steps to create a 3-node AWS cluster in a new VPC and monitor the task status by polling. Upon completion of the task, we will print the cluster UUID.

# First we create a JWT token
jwt = create_jwt()

logging.debug(jwt)

# Let's create a cluster create task
task = create_cluster(jwt)
if task != None :
    task_id = task['data']['id']

    # Poll the status of the task
    if task_id is not None:
        logging.info(f"Task ID: {task_id}")
        task_status = poll_task_status(jwt, task_id)

    # Check if the task was successful
    if task_status == "success":
        logging.info("Cluster creation successful!")
        logging.info("Cluster ID: {}".format(task.get('cluster_id')))
    else:
        logging.error("Cluster creation failed!")
else:
    logging.error("Cluster creation task could not be created!")

Below are sample functions for hibernating, resuming, and terminating a cluster. Similar to the create cluster API call, these functions also return a task. We can employ the same mechanism used for polling the status to monitor these tasks.

def hibernate_cluster(cluster_id, jwt):
    """
    Hibernate a cluster.

    Args:
        cluster_id (str): The UUID of the cluster to hibernate.

    Returns:
        str: The task ID for hibernating a cluster if request is accepted, None otherwise.
    """
    try:

        # Define headers with JWT token for authentication
        jwt_token, _ = jwt
        headers = {
            'Authorization': f'Bearer {jwt_token}',
            'Content-Type': 'application/json',
        }

        # Send a POST request to hibernate the cluster
        hibernate_payload = {}
        response = requests.post(
            NC2_BASE_URL + HIBERNATE_CLUSTER_URL.format(cluster_id = cluster_id), 
            json=hibernate_payload, 
            headers=headers
        )

        logging.debug(f"Response: {response.json()}")
        if response.status_code >= 200 and response.status_code <= 299:
            # Extract the task ID from the response
            task_id = response.json()['data']['id']
            return task_id

        else:
            logging.error(f"Cluster hibernating failed with status code {response.status_code}")
            return None

    except Exception as e:
        logging.error(f"Error hibernating cluster: {str(e)}")
        return None
def resume_cluster(cluster_id, jwt):
    """
    Resume a cluster.

    Args:
        cluster_id (str): The UUID of the cluster to resume.

    Returns:
        str: The task ID for resuming a cluster if request is accepted, None otherwise.
    """
    try:

        # Define headers with JWT token for authentication
        jwt_token, _ = jwt
        headers = {
            'Authorization': f'Bearer {jwt_token}',
            'Content-Type': 'application/json',
        }

        # Send a POST request to resume the cluster
        resume_payload = {}
        response = requests.post(
            NC2_BASE_URL + RESUME_CLUSTER_URL.format(cluster_id = cluster_id), 
            json=resume_payload, 
            headers=headers
        )

        logging.debug(f"Response: {response.json()}")
        if response.status_code >= 200 and response.status_code <= 299:
            # Extract the task ID from the response
            task_id = response.json()['data']['id']
            return task_id

        else:
            print(f"Cluster resume failed with status code {response.status_code}")
            return None

    except Exception as e:
        print(f"Error resuming cluster: {str(e)}")
        return None
def terminate_cluster(cluster_id, jwt):
    """
    Terminate a cluster.

    Args:
        cluster_id (str): The UUID of the cluster to terminate.

    Returns:
        str: The task ID for terminating a cluster if request is accepted, None otherwise.
    """
    try:

        # Define headers with JWT token for authentication
        jwt_token, _ = jwt
        headers = {
            'Authorization': f'Bearer {jwt_token}',
            'Content-Type': 'application/json',
        }

        # Send a POST request to resume the cluster
        terminate_payload = {}
        response = requests.post(
            NC2_BASE_URL + TERMINATE_CLUSTER_URL.format(cluster_id = cluster_id), 
            json=terminate_payload, 
            headers=headers
        )

        logging.debug(f"Response: {response.json()}")
        if response.status_code >= 200 and response.status_code <= 299:
            # Extract the task ID from the response
            task_id = response.json()['data']['id']
            return task_id

        else:
            print(f"Cluster terminate failed with status code {response.status_code}")
            return None

    except Exception as e:
        print(f"Error terminating cluster: {str(e)}")
        return None

Note: After completing this example, it is recommended to delete the created cluster to prevent any additional costs. Additionally, if the API key was generated solely for this walkthrough, consider deleting it as well.

Authentication

NC2 uses JSON Web Token (JWT) based bearer authentication. The JWT can be generated using MyNutanix API keys.

For detailed information on how to generate API keys and JWT tokens, refer to the NC2 Azure user guide and NC2 AWS user guide.

Best Practice

It is advisable to keep your JWT short lived, Nutanix recommends a maximum of 5 minutes as the JWT token lifespan.

Error Codes

List of HTTP status codes returned by the NC2 APIs

Error codes Messages
200 Successful
201 Created
202 Accepted
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
406 Not Acceptable
500 Internal Server Error

cloud resources

List cloud resources

This list shows only cloud resources that NC2 has created in the cloud account connected to this cluster. Cloud resources that have not been created by NC2 will not appear in this list.

Authorizations:
bearerAuth
path Parameters
cluster_id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the cluster.

Responses

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/clusters/{cluster_id}/cloud-resources \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": [
    ]
}

cloud_accounts

Get cloud account

The request retrieves the specified cloud account.

Authorizations:
bearerAuth
path Parameters
id
required
any

The ID of the cloud account.

Responses

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/cloud-accounts/{id} \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": {
    }
}

List SSH keys for a given cloud account

The request retrieves the list of SSH keys associated with a cloud account, including any applied filters.

Authorizations:
bearerAuth
path Parameters
id
required
any

The ID of the cloud account.

Responses

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/cloud-accounts/{cloud_account_id}/regions/{id}/ssh-keys \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": [
    ]
}

List VNets for a cloud account

The request retrieves the list of VNets associated with a cloud account, including any applied filters.

Authorizations:
bearerAuth
path Parameters
cloud_account_id
required
any

The ID of the cloud account.

id
required
string

The region of VNets.

Responses

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/cloud-accounts/{cloud_account_id}/regions/{id}/vnets \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": [
    ]
}

List VPCs for a cloud account

The request retrieves the list of VPCs associated with a cloud account, including any applied filters.

Authorizations:
bearerAuth
path Parameters
cloud_account_id
required
any

The ID of the cloud account.

id
required
string

The region of VPCs.

Responses

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/cloud-accounts/{cloud_account_id}/regions/{id}/vpcs \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Update cloud account

Update an existing cloud account.

Authorizations:
bearerAuth
path Parameters
id
required
any

The ID of the cloud account.

Request Body schema: application/json
required
required
object

Responses

Request samples

curl --request PATCH \
    --url https://cloud.nutanix.com/api/v2/cloud-accounts/{id} \
    --header 'Accept: application/json' \
    --data '{
    "data": {
        "active": true
    }
}'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update cloud account

Update an existing cloud account.

Authorizations:
bearerAuth
path Parameters
id
required
any

The ID of the cloud account.

Request Body schema: application/json
required
required
object

Responses

Request samples

curl --request PUT \
    --url https://cloud.nutanix.com/api/v2/cloud-accounts/{id} \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --data '{
    "data": {
        "active": true
    }
}'

Response samples

Content type
application/json
{
  • "data": {
    }
}

clusters

Condemn cluster host

You can perform a condemn host operation using the hostname for the existing cluster.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the cluster.

Request Body schema: application/json
required
required
object

Responses

Request samples

curl --request POST \
    --url https://cloud.nutanix.com/api/v2/clusters/{id}/condemn-host \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --data '{
    "data": {
        "name": "string",
        "reason": "string"
    }
}'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Create AWS cluster

Creates an AWS cluster with the provided configuration.

Authorizations:
bearerAuth
Request Body schema: application/json
required
aos_version
required
string

The AOS version of the cluster.

Array of objects (Cluster capacity)
cloud_account_id
any

The ID of the cloud account.

host_access_ssh_key
string

The name of the SSH key.

license
required
string

The license type of the cluster.

name
required
string

The name of the cluster.

object (AWSNetwork)
organization_id
required
any

The ID of the organization.

object (Cluster redundancy)
region
required
string

The region of the cluster.

software_tier
string

The software tier of the cluster.

use_case
required
string (Cluster use-case)
Enum: "general" "vdi"

The use-case for the cluster.

Responses

Request samples

curl --request POST \
    --url https://cloud.nutanix.com/api/v2/clusters/aws \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --data '{
    "aos_version": "string",
    "capacity": [
        {
            "host_type": "string",
            "number_of_hosts": 0
        }
    ],
    "cloud_account_id": null,
    "host_access_ssh_key": "string",
    "license": "string",
    "name": "string",
    "network": {
        "availability_zone": "string",
        "management_services_access_policy": {
            "ip_addresses": [
                "10.0.0.0/16"
            ],
            "mode": "string"
        },
        "mode": "string",
        "prism_element_access_policy": {
            "ip_addresses": [
                "10.0.0.0/16"
            ],
            "mode": "string"
        },
        "test_network_connectivity": true,
        "vpc_cidr": "10.0.0.0/16"
    },
    "organization_id": null,
    "redundancy": {
        "factor": 0
    },
    "region": "string",
    "software_tier": "string",
    "use_case": "general"
}'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Create Azure cluster

Creates an Azure cluster with the provided configuration.

Authorizations:
bearerAuth
Request Body schema: application/json
required
aos_version
string

The AOS version of the cluster.

Array of objects (Cluster capacity)
customer_id
required
any

The ID of the customer.

id
any

The ID of the Azure cluster.

license
string

The license type of the cluster.

name
required
string

The name of the cluster.

required
object (AzureNetwork)
organization_id
required
any

The ID of the organization.

required
object (AzurePrismCentral)
required
object (Cluster redundancy)
region
string

The region of the cluster.

software_tier
string

The software tier of the cluster.

use_case
string (Cluster use-case)
Enum: "general" "vdi"

The use-case for the cluster.

Responses

Request samples

curl --request POST \
    --url https://cloud.nutanix.com/api/v2/clusters/azure \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --data '{
    "aos_version": "string",
    "capacity": [
        {
            "host_type": "string",
            "number_of_hosts": 0
        }
    ],
    "customer_id": null,
    "id": null,
    "license": "string",
    "name": "string",
    "network": {
        "dns_servers": [
            "string"
        ],
        "management_subnet": "string",
        "mode": "string",
        "resource_group": "string",
        "vnet": "string",
        "vnet_cidr": "10.0.0.0/16"
    },
    "organization_id": null,
    "prism_central": {
        "flow_gateway": {
            "ssh_key": "string",
            "ssh_key_resource_group": "string",
            "vm_size": "string"
        },
        "mode": "string",
        "resource_group": "string",
        "version": "string",
        "vnet_cidr": "10.0.0.0/16",
        "vnet_mode": "string"
    },
    "redundancy": {
        "factor": 0
    },
    "region": "string",
    "software_tier": "string",
    "use_case": "general"
}'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get cluster

The request retrieves the specified cluster.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the cluster.

Responses

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/clusters/{id} \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": {
    }
}

Hibernate cluster

After you hibernate a cluster that is in a running state, your data will be stored in an Amazon S3 bucket, and the AWS bare-metal nodes will be stopped.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the cluster.

Responses

Request samples

curl --request POST \
    --url https://cloud.nutanix.com/api/v2/clusters/{id}/hibernate \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
     

Response samples

Content type
application/json
{
  • "data": {
    }
}

Resume cluster

After you resume a cluster in a hibernated state, your data is recovered from the Amazon S3 bucket in the same state before you hibernated it.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the cluster.

Responses

Request samples

curl --request POST \
    --url https://cloud.nutanix.com/api/v2/clusters/{id}/resume \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
     

Response samples

Content type
application/json
{
  • "data": {
    }
}

Terminate cluster

You can terminate an NC2 cluster if you do not want to use the cluster anymore.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the cluster.

Responses

Request samples

curl --request POST \
    --url https://cloud.nutanix.com/api/v2/clusters/{id}/terminate \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
     

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update cluster

You can update the description, URL slug, or status to failed to initiate the recovery process when a protected AWS cluster fails.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the cluster.

Request Body schema: application/json
required
required
object

Responses

Request samples

curl --request PATCH \
    --url https://cloud.nutanix.com/api/v2/clusters/{id} \
    --header 'Accept: application/json' \
    --data '{
    "data": {
        "description": "string",
        "status": "failed",
        "url_slug": "string"
    }
}'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update cluster

You can update the description, URL slug, or status to failed to initiate the recovery process when a protected AWS cluster fails.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the cluster.

Request Body schema: application/json
required
required
object

Responses

Request samples

curl --request PUT \
    --url https://cloud.nutanix.com/api/v2/clusters/{id} \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --data '{
    "data": {
        "description": "string",
        "status": "failed",
        "url_slug": "string"
    }
}'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update cluster capacity

You can add more nodes to the cluster to expand or remove nodes to shrink the cluster.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the cluster.

Request Body schema: application/json
required
required
Array of objects (Cluster capacity)

Responses

Request samples

curl --request POST \
    --url https://cloud.nutanix.com/api/v2/clusters/{id}/update-capacity \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --data '{
    "data": [
        {
            "host_type": "string",
            "number_of_hosts": 0
        }
    ]
}'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update cluster license

You can update the license of an existing cluster.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the cluster.

Request Body schema: application/json
required
object

Responses

Request samples

curl --request POST \
    --url https://cloud.nutanix.com/api/v2/clusters/{id}/update-license \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --data '{
    "data": {
        "aos_tier": "string",
        "consumption_method": {
            "max_concurrent_users": 0,
            "type": "string"
        },
        "files_capacity": 0,
        "files_dedicated_cluster": true,
        "license": "string"
    }
}'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Upgrade cluster flow gateway

Upgrade the flow gateway version for an existing Azure cluster.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the cluster.

Request Body schema: application/json
required
required
object

Responses

Request samples

curl --request POST \
    --url https://cloud.nutanix.com/api/v2/clusters/{id}/upgrade-fgw \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --data '{
    "data": {
        "version": "string"
    }
}'

Response samples

Content type
application/json
{
  • "data": {
    }
}

notifications

List notifications

The request retrieves the list of notifications, including any applied filters.

Authorizations:
bearerAuth
query Parameters
acknowledged
boolean

If true, only acknowledged notifications are returned.

cluster_id
string <uuid> (UUID)
Example: cluster_id=6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of a related cluster.

from
string <date-time>

Returns only those notifications that are created after the given date-time.

order
string (Order)
Default: "asc"
Enum: "asc" "desc"

Sorts the returned notifications in ascending or descending order.

order_by
string
Default: "created_at"
Enum: "acknowledged" "created_at" "severity"

Sorts the returned notifications by a specified property.

organization_id
string <uuid> (UUID)
Example: organization_id=6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of a related organization.

severity
string
Enum: "error" "info" "warning"

Returns notifications with given severity.

to
string <date-time>

Returns notifications that are created before the given date-time.

Responses

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/notifications \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Update notification

To acknowledge a notification, set the acknowledged flag to true.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the notification.

Request Body schema: application/json
required
required
object

Responses

Request samples

curl --request PATCH \
    --url https://cloud.nutanix.com/api/v2/notifications/{id} \
    --header 'Accept: application/json' \
    --data '{
    "data": {
        "acknowledged": true
    }
}'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update notification

To acknowledge a notification, set the acknowledged flag to true.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the notification.

Request Body schema: application/json
required
required
object

Responses

Request samples

curl --request PUT \
    --url https://cloud.nutanix.com/api/v2/notifications/{id} \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --data '{
    "data": {
        "acknowledged": true
    }
}'

Response samples

Content type
application/json
{
  • "data": {
    }
}

organizations

Create an organization

Create an organization for a customer.

Authorizations:
bearerAuth
query Parameters
customer_id
string <uuid> (UUID)
Example: customer_id=6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of a related customer.

Responses

Request samples

curl --request POST \
    --url https://cloud.nutanix.com/api/v2/organizations \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
     

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get organization

The request retrieves the specified organization.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the organization.

Responses

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/organizations/{id} \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": {
    }
}

List cloud accounts

The request retrieves the list of cloud accounts, including any applied filters.

Authorizations:
bearerAuth
path Parameters
id
required
string

The ID of the organization.

query Parameters
cloud_provider
string

The name of the cloud provider.

name
string

The name of the cloud account.

active
boolean

Is the cloud account active?

status
string

The status of the cloud account.

Responses

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/organizations/{id}/cloud-accounts \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": [
    ]
}

List organizations

The request retrieves the list of organizations, including any applied filters.

Authorizations:
bearerAuth
query Parameters
active
boolean

If true, only active organizations are returned.

customer_id
string <uuid> (UUID)
Example: customer_id=6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of a related customer.

name
string

The name of the organization.

order
string (Order)
Default: "asc"
Enum: "asc" "desc"

Sorts the returned organizations in ascending or descending order.

order_by
string
Default: "created_at"
Value: "created_at"

Sorts the returned organizations by a specified property.

Responses

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/organizations \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Organization audit trail

The request retrieves the list of actions performed on the organization

Authorizations:
bearerAuth
path Parameters
id
required
string

The ID of the organization.

Responses

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/organizations/{id}/audit-trails \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Terminate an organization

Terminate an organization for a customer.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the organization.

Responses

Request samples

curl --request PATCH \
    --url https://cloud.nutanix.com/api/v2/organizations/{id}/terminate \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update an organization

Update an organization for a customer.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the organization.

Responses

Request samples

curl --request PATCH \
    --url https://cloud.nutanix.com/api/v2/organizations/{id} \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update an organization

Update an organization for a customer.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the organization.

Responses

Request samples

curl --request PUT \
    --url https://cloud.nutanix.com/api/v2/organizations/{id} \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
     

Response samples

Content type
application/json
{
  • "data": {
    }
}

tasks

Get task

The request retrieves the specified task.

Authorizations:
bearerAuth
path Parameters
id
required
string <uuid> (UUID)
Example: 6ddad15e-9607-42fd-809e-729f6ac1e633

The ID of the task.

Responses

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/tasks/{id} \
    --header 'Accept: application/json' \
     

Response samples

Content type
application/json
{
  • "data": {
    }
}

List tasks

The request retrieves the list of tasks, including any applied filters.

Authorizations:
bearerAuth

Request samples

curl --request GET \
    --url https://cloud.nutanix.com/api/v2/tasks \
    --header 'Accept: application/json' \