Use the REST API Explorer to retrieve and/or make changes to a cluster

REST API Methods

The HTTP verbs comprise a major portion of our “uniform interface” constraint and provide us the action counterpart to the noun-based resource. The primary or most-commonly-used HTTP verbs (or methods, as they are properly called) are POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete (or CRUD) operations, respectively. There are a number of other verbs, too, but are utilized less frequently. Of those less-frequent methods, OPTIONS and HEAD are used more often than others.

VerbCRUD
POSTCreate
GETRead
PUTUpdate/Replace
PATCHUpdate/Modify
DELETEDelete

The Nutanix REST APIs allow you to create scripts that run system administration commands against the Nutanix cluster. The API enables the use of HTTP requests to get information about the cluster as well as make changes to the configuration. Output from the commands are returned in JSON format.

There are two versions of the Nutanix REST API.

  • v1: The original Nutanix REST API.
  • v2: An update of the v1 API. Users of the v1 API are encouraged to migrate to v2.

The REST API Explorer displays a list of the cluster objects that can be managed by the API. Each line has four options:

  • Show/Hide: Expand or reduce the detail shown for the object
  • List Operations: Show all operations that can be run on this object
  • Expand Operations: Show the detailed view of the operations that can be run on this object
Nutanix REST API
Nutanix REST API
Nutanix REST API

REST API Status Codes

Status CodeDefinition
200The API request was successful and received a response.
201The API request was successful and created an object.
400The API request was malformed and could not be processed.
401You have no access and/or are not authorized.
403You are authorized but do not have the privileges for this API.
404The URL was not found.
405The called method is not allowed or is not supported.
408The request timed out (20 seconds maximum).
500The API request was received but there was a server error.
503Service unavailable at this time or too early to process.
505HTTP other than 1.1 not supported.

2 responses to “Use the REST API Explorer to retrieve and/or make changes to a cluster

  1. Do we get the metrics data_reduction.overall.saving_ratio_ppm, storage.capacity_bytes, storage.free_bytes from API version v1 ?

    1. Yes, I believe so. I was able to pull metrics such as storage.user_usage_bytes, storage.user_capacity_bytes, and storage.user_free_bytes via The Nutanix CMDlets, which leverages the REST API.

Leave a Reply

Your email address will not be published. Required fields are marked *