Event Service

The event service is an alert mechanism for Redfish. This alert will be sent out through HTTP or HTTPS to a web service that is subscribed to the service.

Adding a Subscription

Edit a subscription to configure alerts/events.

URI: /redfish/v1/EventService/Subscriptions/[id]

Method: PATCH

Payload:

{

"Destination": "example@main.com",

"Context": "user1_test",

"EventTypes":["Alert","StatusChange"],

"Protocol": "SMTP",

"Oem":{"Supermicro":{

"Severity": "Information",

"EnableSubscription": true}}

}

Response: 200

Destination: Value shall contain a URI or email to the destination where the events will be sent.

Context: Value is a client-supplied string that is stored with the event destination subscription.

EnableSubscription: Enable or Disable subscription by setting the value to be true or false.

Protocol: This property shall contain the protocol type that the event will use for sending the event to the destination. A value of Redfish shall be used to indicate that the event type shall adhere to that defined in the Redfish specification.

Allowable values:

  • SNMPv1

  • SMTP

  • Redfish

  • SNMPv3

EventTypes: This property shall contain the types of events you want to receive.

Allowable values:

  • StatusChange

  • ResourceUpdated

  • ResourceAdded

  • ResourceRemoved

  • Alert

Severity: This property shall contain the severity of the event that you want to configure.

Allowable values:

  • Information

  • Warning

  • Critical

Viewing All Subscriptions

To view all subscriptions, follow these steps.

URI: /redfish/v1/EventService/Subscriptions

Method: GET

{

"@odata.type": "#EventDestinationCollection.EventDestinationCollection",

"@odata.id": "/redfish/v1/EventService/Subscriptions",

"Name": "Event Subscriptions Collection",

"Members": [

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/1"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/2"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/3"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/4"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/5"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/6"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/7"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/8"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/9"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/10"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/11"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/12"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/13"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/14"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/15"

},

{

"@odata.id": "/redfish/v1/EventService/Subscriptions/16"

}

],

"Members@odata.count": 16

}

Deleting a Subscription

You can delete or erase a subscription.

URI: /redfish/v1/EventService/Subscriptions/[num]

Method: DELETE

Testing an Event Subscription

You can send a test event with “SendTestEvent” or generate an event in the BMC, Redfish will then automatically send event alerts to the subscriber(s).

URI: /redfish/v1/EventService/Actions/EventService.SubmitTestEvent

Payload: <be>

{

"MessageId": "SMC.v1.0 TestAlert"

}

You need to implement a RESTful event listener that can receive HTTP or HTTPS POST data that describes the Redfish event format. It can also subscribe to multiple services.

Refer to the Redfish-Event-Listener project page at GitHub to test Event Subscriptions or setup a Redfish Event Listener.

Example of data from Redfish Event Listener:

Time:Tue Feb 12 16:49:28 2019 Count:1

Host IP:('BMC_IP', 38486)

Event Details:{'@odata.context':

'/redfish/v1/$metadata#EventService/Members/Events/58', '@odata.id':

'/redfish/v1/EventService/Events/58', '@odata.type':

'#EventService.v1_0_0.Event', 'Id': '58', 'Name': 'Event Array',

'Events': [{'EventType': 'Alert', 'Severity': 'OK', 'EventTimestamp':

'2019/02/13 00:49:04', 'Message': 'Submit Test Event', 'MessageArgs':

['/redfish/v1/EventService/Actions'], 'MessageId': '0',

'OriginOfCondition': {'@odata.id': '/redfish/v1/EventService'},

'Context': 'Public'}]}

 

Time:Tue Feb 12 16:52:24 2019 Count:2

Host IP:('BMC_IP', 38500)

Event Details:{'@odata.context':

'/redfish/v1/$metadata#EventService/Members/Events/59', '@odata.id':

'/redfish/v1/EventService/Events/59', '@odata.type':

'#EventService.v1_0_0.Event', 'Id': '59', 'Name': 'Event Array',

'Events': [{'EventType': 'Alert', 'Severity': 'Info',

'EventTimestamp': '2019/02/13 00:52:00', 'Message': 'Web login was

successful.', 'MessageArgs': [], 'MessageId': 'Alert.1.0.LoginWeb',

'OriginOfCondition': {}, 'Context': 'Public'}]}