Add Notes to Alerts in vRealize Operations via REST API
As part of a larger project for a customer, I needed to add Notes to Alerts in vRealize Operations, via the REST API.
According to the REST API documentation of vRealize Operations, found at:
|
|
The request should be a POST against:
|
|
Where {id} is the ID of the Alert, you want to add the Note to.
But the vRealize Operations REST API documentation is faulty, which made using it somewhat difficult.
According to documentation, the body content of the request can either be en JSON format or XML format.
JSON sample according to documentation:
|
|
XML sample according to documenation:
|
|
There are at least two issues with these samples.
- How would I know the ID of the Note I am adding, before I have added it?
- They do not work at all.
Because the REST API calls not working, I reached out to Alan Renouf, Senior Product Manager for API/SDK/CLI at VMware, via Twitter and VMware {code} Slack.
Alan Renouf did not have the answers to these failing REST API calls him self, but managed to find some engineers who did work on this REST API.
So now I was in contact with 2 engineers, Nandu Mallapragada who had priviously work on this REST API and Suren Balikyan, who currently works on this REST API.
With there help we figured out what the correct body content of the REST API Request should be.
Correct JSON body content:
|
|
Correct XML body content:
|
|
Nice and simple, but best of all, actually working :-)
A big thanks to Alan Renouf, Nandu Mallapragada and Suren Balikyan.