Send Multiple Requests as Batch

June 18, 2020

by Chris Rasmussen

Intended Audience Level: Beginner/Intro

Code Sample Type: Snippet

Nutanix Technologies: Prism Central

Minimum Product Version: 5.15

Script/Code Language: JSON Payload

REST API Sample? Yes

REST API Version: v3

JSON payload to create a CentOS 7 disk image from the publicly available CentOS 7 Cloud Image.

Code Sample Details

Note this section may be empty, if additional code sample details are not available.

JSON payload to create a CentOS 7 disk image from the publicly available CentOS 7 Cloud Image.

Request Parameters

The below parameters should be used with the sample payload.

Please note you will need to alter {{placeholder}} values to match your environment, e.g. subnet name and UUID, cluster name and UUID.

Request URL:

https://[prism_central_ip_address]:9440/api/nutanix/v3/images

Request method:

POST

Payload

{
    "spec": {
        "name": "CentOS Cloud Image from centos.org",
        "resources": {
            "image_type": "DISK_IMAGE",
            "source_uri": "https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1905.qcow2"
        },
        "description": "Image created from CentOS cloud imaged, hosted on centos.org"
    },
    "api_version": "3.1.0",
    "metadata": {
        "kind": "image",
        "categories": {},
        "name": "CentOS Cloud Image from centos.org"
    }
}