restembedded-linuxopenbmc

Redfish structure implementation


How to add a a new structure or a API in redfish, for example:

redfish/v1/System/1 redfish/v1/System/2 redfish/v1/System/3

Do I need to do modify the code in bmcweb?

I could not find a fine document related to it, or any pointer is highly valuable. Thanks !!!


Solution

  • Yes, you would modify bmcweb code to return additional members.

    https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/systems.hpp#L1373 Something like this:

    res.jsonValue["Members"] = {
                {{"@odata.id", "/redfish/v1/Systems/system"},{"@odata.id", "/redfish/v1/Systems/system2"}}};
    res.jsonValue["Members@odata.count"] = 2;