Prism Element v2 REST API / Query single value | Nutanix Community
Skip to main content

Using cURL to get ‘/Cluster’ endpoint (ex. below). How do I structure my call to return single

attribute, like ‘name’ , ‘uuid’  or version . 

  1. API query outputs entire tree

     https://<IP>:9440/PrismGateway/services/rest/v2.0/cluster/'

        "id": "0005d918-7718-830d-60d0-ac1f6b3f9209::6976265073740190217",
        "uuid": "0005d918-7718-830d-60d0-ac1f6b3f9209",

        "cluster_incarnation_id": 1646073984090893,
        "cluster_uuid": "0005d918-7718-830d-60d0-ac1f6b3f9209",
         "name": "vaclevsh2100",
         "version": "6.1"

   2. Would like to query single attributes, something like:

       https://<IP>:9440/PrismGateway/services/rest/v2.0/cluster?name'

                                                    or

       https://<IP>:9440/PrismGateway/services/rest/v2.0/cluster?id'

In a first try, I would filter the output, using any *nix standard tools.

 

curl -ks  https://<IP>:9440/PrismGateway/services/rest/v2.0/cluster/  | jq | grep ‘“name”:’ 

 


Thanks for the reply.  I’m using the rest api calls from a commercial storage mgmt app (DellEMC SRM).

I’m developing a Nutanix collector which requires the url  calls to be embedded in an xml file. In other words, I don’t have an option to pre-process with any unix utilities . I would like to query individually 

“cluster”  end point  for “name”, “id”, “uuid” & “version” attributes. The values are concatenated  to form a unique device key. which then I can add related properties and metrics.

Is it possible to  perform  single queries for an endpoint ?    


I only use the rest API for processing JSON for my own needs. 

I have no idea for what your doing.  my bet is that you may need a language to manipulate json record.

regards.


Well thank you for your time, I’ll keep pursuing it, maybe api v3 or v4 will let me do these queries.

Currently, I only have Prism Element so I’m using api v2.


Reply