opEvents CLI
opEvents CLI is now able to dynamically update events using the act=set parameter.
PARAMETERS | Value |
---|---|
act | set |
event_id | event id of the given event |
entry.propproperty-name | value to be updated for the given event property |
Code Block |
---|
CLI command : /usr/local/omk/bin/opevents-cli.pl act=set event_id="672a9b95ad7949330256138a" entry.details="update event details" entry.level=Minor |
opEvents API
opEvents API is now able to dynamically update events using a PATCH request.
...
Code Block |
---|
Payload example: { "details" : "updating fake event with api 1110110details", "level" : "Minor" } |
This will update the Event with the given data.
Successful Response
HTTP Status | Body | Description |
---|---|---|
200 OK | JSON object with success message. | The success property is set to Event “Event successfully updated updated” and only if the request was successful. |
Bad Responses
...
HTTP Status | Payload |
---|
...
example |
---|
...
Body | Description | |
---|---|---|
400 Bad Request | /omk/opEvents/api/v1/events/672a9b95ad794933025xxxx | JSON object with error message. |
The error message is set to "Empty input: Please provide the necessary data in the request body."
HTTP Status | Payload example | Body | Description |
---|---|---|---|
400 Bad Request | /omk/opEvents/api/v1/events/672a9b95ad794933025xxxx | {"error":"Invalid event id :672a9b95ad7949330256138x is not a valid OID.\n"} | Invalid event id in API |
400 Bad Request | empty payload | JSON object with error message. | The error message is set to "Empty input: Please provide the necessary data in the request body." |
opEvents CLI and API Validations
The opEvents CLI and API both follow a set of validation rules to maintain data integrity:
Allowed Event Properties: There is a predefined set of properties that events can have. Any input that doesn’t match these predefined properties will not be accepted directly.
Custom Properties: To add custom properties, they must be prefixed with
"tag_"
. This convention helps the system distinguish custom properties from standard event properties and may prevent naming conflicts or unwanted data.System-Derived PropProperty-Names: The system automatically generates or recognises specific property names that can’t be altered, whether through a Command-Line Interface (CLI) or an API. These names are fixed and define the structure of allowed event properties.
Priority Validation: Another validation added on
time acknowledged priority
Time, Acknowledged and Priority must be a number.
Priority can only be a number between 0-10 decimal
List of default prop-property names which can not be modified.
...
Code Block |
---|
/opevents/opevents_list_default_properties : ["details","level","priority"] |
Invalid props properties example
Code Block |
---|
{ "node" : "xxxxx", "level" : "Minor" } |
HTTP Status | Body | Description |
---|---|---|
400 Bad Request | JSON object with error message. | The error message is set and will show the list of invalid propsproperties. |