I'm using the UIMAPI to create an alarm but no matter what I setup in the Json content I still have return code 204.
I have checked and there are no errors in the logs.
I tested with this basic payload:
{
"severity":"critical",
"robot":"serverxxx",
"visible":true,
"hub":"xxxhub",
"level":4,
"domain":"<domain>",
"metid":"MF6BD871398D986B5DE188A8B1851433E",
"message":"NOTICKET - 446577"
}
Can you help me to find a solution to create an alarm ticket from UIMAPI?
- Unclear documentation
HTTP Status 204 (No Content) indicates that the server has successfully fulfilled the request and that there is no content to send in the response payload body.
As there is absolutely nothing to return in response after successful execution, then the webserver returns this status code.
By using our POST /alarms/create endpoint, we are successfully creating an alarm but as a response, we are not returning back anything so we are getting 204.
I've requested that the UIMAPI documentation be updated to reflect this information on the 204 error code.
Tested in UIM v20.4 CU3.
To successfully create an alarm, using the createAlarm POST API call please refer to the section below
POST /alarms/create
Creates a new USM alarm and sends it across the bus, here are some variations and optional fields:
Working example with sensitive data removed:
{
"domain": "example_domain",
"hub": "example_hub",
"origin":"example_hub",
"level":"5",
"severity":"Critical",
"message": "NO TICKET - 12345678A",
"robot": "example_robot",
"met_id": "null",
"visible": true
}
Test results prove that the following fields are optional:
Other alarm fields may be used and tested for individual purposes.
Mandatory fields as per testing to create an alarm include the following:
{
"severity":"<severity_name>",
"message": "NO TICKET - 12345678A9BXXX",
"visible": true
}
Alarm:
"source" if not defined, is the UIMAPI node (e.g., OC Robot machine IP Address).
The issue was caused by a nas preprocessing profile -> script, now a ticket can be successfully generated.
Customer needed to set a value in the suppressionKey in the JSON and then everything worked and the alarm was created.