Hello Again,
So I have looked into the resources you provided, and then some... I feel like I am really close to success! But that I'm just missing something...
Main question is I'm able to subscribe to events, but I'm not able to ever see any events occur.
Let me explain where I'm at and how I have gotten to where I am.
1. I am using the Redfish Emulator to locally host Redfish on my PC via a git bash terminal, I can use GET/Patch operations via python scripts to interact with this emulator successfully.
2. The emulator only has what ever Redfish Schemas I populate into it, and it only has some basic Redfish API files that are either already existing by default or are manually generated/edited.
I don't think I can share pictures here, but luckily a lot of this is just Text so please bear with the copy paste items below, which give a 'snapshot' of what I am seeing.
I have a python script that is Posting to the emulator, in order to subscribe to events.
Here is the emulator output in a git bash terminal that shows a POST happened.
-------------------------------------------------------------
INFO:root:SubscriptionCollectionAPI init called
INFO:root:SubscriptionCollectionAPI POST called
INFO:werkzeug:127.0.0.1 - - [08/Nov/2023 14:29:46] "POST /redfish/v1/EventService/Subscriptions HTTP/1.1" 201 -
-------------------------------------------------------------
Next up, here is what the Redfish Instance looks like afterwards
"Event Service"
---------------------------------------------------------------
/redfish/v1EventService
{
"@redfish.Copyright": "Copyright 2014-2019 DMTF. All rights reserved.",
"@odata.context": "/redfish/v1/$metadata#EventService.EventService",
"@odata.type": "#EventService.v1_0_0.EventService",
@odata.id: /redfish/v1/EventService
"Id": "EventService",
"Name": "Event Service",
"Status": {
"State": "Enabled",
"Health": "OK"
},
"ServiceEnabled": true,
"DeliveryRetryAttempts": 3,
"DeliveryRetryIntervalSeconds": 60,
"EventTypesForSubscription": [
"StatusChange",
"ResourceUpdated",
"ResourceAdded",
"ResourceRemoved",
"Alert"
],
"Subscriptions": {
@odata.id: /redfish/v1/EventService/Subscriptions
},
"Actions": {
"#EventService.SubmitTestEvent": {
"target": "/redfish/v1/EventService/Actions/EventService.SubmitTestEvent",
"EventType@Redfish.AllowableValues": [
"StatusChange",
"ResourceUpdated",
"ResourceAdded",
"ResourceRemoved",
"Alert"
]
}
}
}
-----------------------------------------------------------------
"Subscriptions"
-----------------------------------------------------------------
{
@odata.id: /redfish/v1/EventService/Subscriptions
"@odata.type": "#EventDestinationCollection.EventDestinationCollection",
"Name": "Event Destination Collection",
"Links": {
"Members@odata.count": 1,
"Members": [
{
@odata.id: /redfish/v1/EventService/Subscriptions/4b4fedf8-20df-4afb-8e69-1ac0bc6ca107
}
]
}
}
----------------------------------------------------------------------------------------------------------
"Specific Subscription ID, that I just posted to RedFish"
----------------------------------------------------------------------------------------------------------
{
"Id": "4b4fedf8-20df-4afb-8e69-1ac0bc6ca107",
"Destination": "http://127.0.0.1:5001/event_listener",
"EventTypes": [
"StatusChange",
"ResourceUpdated",
"ResourceAdded",
"ResourceRemoved",
"Alert"
],
"Context": "SystemAdmin",
"Protocol": "Redfish",
"SubscriptionType": "RedfishEvent",
@odata.id: /redfish/v1/EventService/Subscriptions/4b4fedf8-20df-4afb-8e69-1ac0bc6ca107
}
So, if I have not lost you yet, at this point I should be all subscribed up and ready to receive an event from Redfish to my listener, or at least that was my hope.
In order to trigger an event, I execute another python script that will make a patch operation and change a value under Chassis/Temperature, which I assumed would trigger redfish to trigger an event
Below is what the terminal output looks like on the emulator when I do this
---------------------------------------------------------------------------
INFO:root:ThermalAPI init called
INFO:root:ThermalAPI PATCH called
INFO:root:{'Temperatures': [{'MemberId': '0', 'ReadingCelsius': 1234}]}
INFO:werkzeug:127.0.0.1 - - [08/Nov/2023 14:37:58] "PATCH /redfish/v1/Chassis/Chassis-1/Thermal HTTP/1.1" 200 -
-------------------------------------------------------------------------------
And that's all it does for now. I was expecting that after I saw the "Patch" operation I would then just magically see Redfish have another kind of "Post/Patch" notification to my listener URL but I don't see that
I'm on the edge of information overload, so maybe I'm missing something obvious.
My best guess is either of the below, or a combination of the below
1. I need to physically write an API in redfish that will catch a "Patch" operation on an object, and then manually write the API code to then Notify my listener? (For some reason I was thinking this would just "magically work" but maybe I need to actually write the code for it)
2. I need to configure some kind of "Events" list? Is there another schema that is needed in order to get this all to work?
3. My listener is just invalid, and therefore Redfish isn't even going to try to notify it because the syntax is wrong?
4. It is not possible to get redfish events to work on an emulator (even though the documentation has it listed as a resource, and that it should be so simple)?
From looking at the redfish mockups, (link below) it's great to see the front end objects that a user can interact with....but I'm not sure if the magic just happens, or if for events to work there is a lot of extra code that needs to be manually written to capture specific changes to resources within the Redfish Instance. Maybe there is an example 'backed implementation' or 'redfish api code magic' example that I can use for reference if I am suppose to be writing the custom event behavior in redfish?
redfish.dmtf.org/redfish/mockups/v1/1379This is like a Hail Mary pass into the darkness, so if anyone has any helpful ideas or tips I'll take any and all of them!