UIMAPI 20.40 - /alarms/create return code 204
search cancel

UIMAPI 20.40 - /alarms/create return code 204

book

Article ID: 247303

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM) CA Unified Infrastructure Management On-Premise (Nimsoft / UIM) CA Unified Infrastructure Management SaaS (Nimsoft / UIM)

Issue/Introduction

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?

Environment

  • Release: UIM 20.4 CU2 and CU3
  • Component: UIM - API
  • robot 9.35
  • nisapi_wasp 20.41
  • uimapi 20.40
  • ump 20.43
  • ump_operatorconsole 20.43
  • wasp 20.43

Cause

- Unclear documentation

Resolution

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:

  1. "met_id"
  2. "robot"
  3. "level"
  4. "origin"
  5. "domain"
  6. "hub"
  7. "source" (but we recommend its use in the alarm)

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:

Additional Information

"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.