5.6.5 JP1 Event converter
- Description
-
The event information notified by the external system is converted into a JP1 event and issued.
The event information notified by the external system is passed to the product plug-in, and the JP1 event is issued according to the returned JP1 event information.
- Execution permissions
-
None
- API version
-
v1
- Format
-
- Request line
POST /im/api/v1/events/transform HTTP/1.1
- Request header
-
Header name
Setting value
Authorization
Do not set it.
If message body of the request is in JSON format, the other request headers are the same as Common spec of API. For the request header of Common spec of API, see the explanation of the request header in 5.2.3 Request format.
- Request message body
-
You can send it in JSON format. The data structure of the object is arbitrary (using the unique format of each product plug-in).
JP1/IM - For all product plug-ins set in Manager, if the data cannot be converted to JP1 events, try to convert to JP1 events in the following format.
[ { "eventId":event-ID, "message":message, "attrs":{extended-attribute-name:extended-attribute-value, ...} }, ... ] - Response message body
{ "eventSeqNo":[serial-number-in-the-DB-of-the-issued-event, ...] "exceeddJp1eventMaxDetected":detection-of-exceeding-the-upper-limit-of-the-number-of-converted-JP1-events, "messages":[ { "messageId":"message-ID", "message":"message-body" }, ... ] }
- Parameters
-
Here are the parameters that you specify for message body of the request:
No.
Parameters
Data type
Description
1
eventId#
string
Specifies the event ID to be published.
2
message#
string
Specifies the message text that describes the content of the event.
3
attrs#
Array
Specifies extended attributes.
- #
-
For details on the contents to be specified for each item, see the parameters of 5.6.4 Event generation.
- Status codes
-
The following table describes the status codes that are returned as a response to the request:
Status code
Message
Description
200
--
API processing succeeded.
KAJY67002-W
Communication with JP1/Base Events Service failed.
KAJY67003-W
More than 100 JP1 events were converted.
KAJY67000-W
The retrieved data did not contain the event ID.
The retrieved data did not contain a message.
Invalid extension attribute specification.
The extended attribute name exceeds 32 bytes.
The sum of the extended attribute values exceeds 10000 bytes.
406
KAJY67001-E
The JP1 event data was not returned from each linked product plug-in, and the data format was not the default format.
The following information with JSON format is returned in the response body if the status code is 200:
No.
Member name
Data type
Description
1
eventSeqNo
Object[]
Returns the DB serial number of the issued event as a string type array.
2
exceedJp1eventMaxDetected
boolean
Whether or not it is detected that the number of converted JP1 events has exceeded the upper limit.
-
true: Detected
-
false: Do not detect
3
messages
object[]
An array of messages to be notified.
If there is no message to be notified, it is omitted.
4
messageId
string
The message ID. If there is no message to be notified, it is omitted.
5
message
string
The message body. The language used is determined by the Accept-Language property specified in the HTTP request header. If there is no message to be notified, it is omitted.
-
- Examples
-
The following is an example of using this API using the OSS curl command.
>curl -i --header "Accept-Language: ja" --header "Content-Type: application/json" --request POST --data @c:\\work\\request.json "http://localhost:20703/im/api/v1/events/transform"
- request.json
{ "receiver":"JP1IMDD", "status":"firing", "alerts": [ { "status":"firing", "labels": { "alertname":"jp1_pc_exporter_healthcheck", "instance":"win2016:20717", "job":"jpc_windows", "jp1_pc_eventid":"0002", "jp1_pc_exporter":"JPC Windows exporter", "jp1_pc_metricname":"up", "jp1_pc_nodelabel":"Windows exporter", "jp1_pc_product_name":"/HITACHI/JP1/JPCCS", "jp1_pc_prome_hostname":"win2016", "jp1_pc_severity":"Error" }, "annotations": { "jp1_pc_description":"Exporter is down." }, "startsAt":"2021-12-17T07:46:20.027Z", "endsAt":"0001-01-01T00:00:00Z", "generatorURL":"http://win2016:20713/graph?g0.expr=up%7Bjp1_pc_remote_monitor_instance%3D%22%22%7D+%3D%3D+0+or+label_replace%28sum+by%28jp1_pc_remote_monitor_instance%2C+jp1_pc_exporter%29+%28up%7Bjp1_pc_remote_monitor_instance%21%3D%22%22%7D%29%2C+%22jp1_pc_nodelabel%22%2C+%22%24%7B1%7D%22%2C+%22jp1_pc_remote_monitor_instance%22%2C+%22%5E%5B%5E%3A%5D%2A%3A%28%5B%5E%3A%5D%2A%29%24%22%29+%3D%3D+0\u0026g0.tab=1", "fingerprint":"430af6034503a24d" } ], "groupLabels": { "alertname":"jp1_pc_exporter_healthcheck", "instance":"win2016:20717", "job":"jpc_windows", "jp1_pc_eventid":"0002", "jp1_pc_exporter":"JPC Windows exporter", "jp1_pc_metricname":"up", "jp1_pc_nodelabel":"Windows exporter", "jp1_pc_product_name":"/HITACHI/JP1/JPCCS", "jp1_pc_prome_hostname":"win2016", "jp1_pc_severity":"Error" }, "commonLabels": { "alertname":"jp1_pc_exporter_healthcheck", "instance":"win2016:20717", "job":"jpc_windows", "jp1_pc_eventid":"0002", "jp1_pc_exporter":"JPC Windows exporter", "jp1_pc_metricname":"up", "jp1_pc_nodelabel":"Windows exporter", "jp1_pc_product_name":"/HITACHI/JP1/JPCCS", "jp1_pc_prome_hostname":"win2016", "jp1_pc_severity":"Error" }, "commonAnnotations": { "jp1_pc_description":"Exporter is down." }, "externalURL":"http://win2016:20714", "version":"4", "groupKey":"{}:{alertname=\"jp1_pc_exporter_healthcheck\", instance=\"win2016:20717\", job=\"jpc_windows\", jp1_pc_eventid=\"0002\", jp1_pc_exporter=\"JPC Windows exporter\", jp1_pc_metricname=\"up\", jp1_pc_nodelabel=\"Windows exporter\", jp1_pc_product_name=\"/HITACHI/JP1/JPCCS\", jp1_pc_prome_hostname=\"win2016\", jp1_pc_severity=\"Error\"}", "truncatedAlerts":0 }- Example of response:
{"eventSeqNo":["19"],"exceedJp1eventMaxDetected":false}