The data you are looking for to fill the information between the {} is located in the contextTypes and contextValues object of the response. Basically have to map the contextTypes to the contextValues (they are in order) for each Alert.

So basically you get the Alert, then loop through the alert and for each contextType in the message you replace the Alarm message with.

To add slightly different detail to the very useful info provided by @rhunt, the data you're looking for can also be easily viewed by looking at the response in JSON Editor Online.

The screenshot below shows a request to https://:9440/api/nutanix/v2.0/alerts on my demo cluster. You'll see client_ip_address under context_types along with 10.133.16.152 in the context_values list.

Can I ask what you are developing your script/app with? Python? PowerShell? Something else? We have some examples of various languages uses over at the Nutanix Developer Portal, if you haven't seen it.

Cookie policy

Cookie settings

We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.