Skip to main content

POST – Submit a Test Event

Request

POST https://{{ip}}/redfish/v1/EventService/Actions/EventService.SubmitTestEvent
Content-Type: application/json
Table 1. Test Event Parameters

Name

Type

Optional

Description

EventId

String

Yes

  1. It will be ignored and replace it with its own.

  2. The value will be autogenerated Event Id.

EventTimestamp

String

Yes

Timestamp

MessageArgs

String

Yes

Refer to “NumberOfArgs” and “ParamTypes” of specific message key in JSON files

MessageId

String

No

Format

RegistryName.MajorVersion.MinorVersion.MessageKey

RegistryNameBase

https://{{ip}}/redfish/v1/Registries/Base.1.5.0.json

Security

https://{{ip}}/redfish/v1/Registries/Security.1.0.0.json

EventLog

https://{{ip}}/redfish/v1/Registries/EventLog.1.0.0.json

IPMI

https://{{ip}}/redfish/v1/Registries/IPMI.1.0.0.json

HttpStatus

https://{{ip}}/redfish/v1/Registries/HttpStatus.1.0.0.json

SyncAgent

https://{{ip}}/redfish/v1/Registries/SyncAgent.1.0.0.json

MajorVersion

https://{{ip}}/redfish/v1/Registries/{{Registry.Major.Minor.json}}

MinorVersion

MessageKey

Refer to “Messages” of JSON files

OriginOfCondition

String

Yes

A reference

Severity

String

Yes

Refer to “Severity” of specific message key in JSON files

Request example

Base

{
"EventTimestamp": "2019-09-20T23:04:09+02:00",
"EventId": "1531584914",
"OriginOfCondition": "/redfish/v1/Chassis/Self",
"MessageId": "Base.1.5.PropertyValueNotInList",
"MessageArgs": [
"Lit",
"IndicatorLED"
],
"Severity": "Warning"
}

Security

{
"EventTimestamp": "2019-09-20T23:04:09+02:00",
"EventId": "1531584914",
"OriginOfCondition": "/redfish/v1/Chassis/Self",
"MessageId": "Security.1.0.AccessDenied",
"MessageArgs": [
"Test"
],
"Severity": "Critical"
}

EventLog

{
"MessageId": "EventLog.1.0.ResourceAdded"
}

IPMI

{
"MessageId": "IPMI.1.0.CommandSpecific"
}

HttpStatus

{
"MessageId": HttpStatus.1.0.MethodNotAllowed"
}

SyncAgent

{
"MessageId": "SyncAgent.1.0.AddressOrigin"
}

Response

  1. The response status is 202 Accepted with the created Task Instance as the response body.

  2. For Error Responses, please refer to Error Response.

  3. Sample Response is as given below:

{
"@odata.context": "/redfish/v1/$metadata#Task.Task",
"@odata.id": "/redfish/v1/TaskService/Tasks/7",
"@odata.type": "#Task.v1_4_2.Task",
"Description": "Task for EventService SubmitTestEvent Action",
"Id": "7",
"Name": "EventService SubmitTestEvent Action",
"TaskState": "New",
"TaskStatus": "OK"
}

Behavior

The limitation applied to this resource is that only 3 concurrent requests can be currently executing for SubmitTestEvent Action, at a given time. To issue an additional request, we need to wait for at least one request to finish from the earlier issued ones and so on.

For SubmitTestEvent Action to return 202 Accepted with Task Instance in Response Body, the following programmatic flow comes into the picture:
  1. Validate all Request Body Properties.

    If Error exists, throw 400 Bad Request with corresponding error body. If success, go to Step 2.

  2. Check for the total count of current tasks.

    1. If count_of_current_tasks >= Maximum_Tasks_Limit(i.e. 15), then check for the value of CompletedTaskOverWritePolicy attribute.

    2. If the value of CompletedTaskOverWritePolicy attribute is anything other than "Overwrite", then throw 400 Bad Request with "CreateLimitReachedForResource" Error.

    3. If "Overwrite" is the value of CompletedTaskOverWritePolicy attribute, then check for any older tasks in the states "Completed" or "Cancelled" or "Exception". If so, then delete those tasks and create a Task and return 202 Accepted.

    4. If count_of_current_tasks < Maximum_Tasks_Limit, then create a Task and return 202 Accepted. In this scenario, only one task will be created, irrespective of the number of Active Subscriptions.

    5. This task will show the status of all the Failure/Success Event Destinations.

  3. Check created task.

    1. The User may then give a GET Request periodically to check the status of the created Task based on the Task Instance returned in Step 2.

    2. In the background, the created task will trigger the Task Daemon and it will execute a Lua File and pass the event related data as an argument to the file. The Lua File will run as a separate thread.

  4. Check active subscriptions.

    1. Inside the thread execution, we will get the list of Available Active Subscriptions first.

    2. Then we will get the list of Active Subscriptions who have "Event" as the "EventFormatType".

    3. If there are no Active Subscriptions itself, then the created task will have "NoActiveSubscriptionPresent" Error Message and the "TaskStatus" will be updated as "Warning" and "TaskState" as "Exception" and the thread will terminate.

    4. If there are no Active Subscriptions having "Event" as the "EventFormatType", then the created task will have "NoActiveSubscriptionOfFormatTypeEventPresent" Error Message and the "TaskStatus" will be updated as "Warning" and "TaskState" as "Exception" and the thread will terminate.

    5. If there are Active Subscriptions having "Event" as the "EventFormatType", Frame the Event Notification data and go to Step 5.

  5. Loop the Event Subscribers one by one, do some logical-checks-done-in-event-service-daemon.

    1. If at-least one logical-checks fail, add "SubmitTestEventPreconditionsFailed" Message to the response body and proceed to the next subscriber. If all logical-checks pass, try sending the event to the corresponding event destination.

    2. If Event Notification is delivered to the destination, add "Success" Message to the response body and proceed to the next subscriber.

    3. If Event Notification fails to be delivered to the destination, add the appropriate Message from among "CouldNotEstablishConnection" and "SourceDoesNotSupportProtocol" to the response body and proceed to the next subscriber.

    4. Continue the step until we are done with all the subscribers.

    5. If the Event Notification fails to be delivered to at-least one destination, then update "TaskStatus" as "Critical" and "TaskState" as "Exception".

    6. If the Event Notification is delivered to all destination, then update "TaskStatus" as "OK" and "TaskState" as "Completed".

    7. Finally set the collective response body to the Messages attribute of the created task instance.