1

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 !!!

user73636
  • 79
  • 6

1 Answers1

1

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;
  • Excellent !!! Can it be used to specify 2 or more CPU's or I/O modules – user73636 Jan 09 '20 at 04:55
  • CPU's and I/O modules should dynamically just show up if you put them under the correct D-Bus interfaces that bmcweb queries. i.e. https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/cpudimm.hpp#L510 – Andrew Geissler Jan 10 '20 at 14:59
  • Great and Thank you. Finally, I assume from class ProcessorCollection. Do I need to modify the below Node(app, "/redfish/v1/Systems/system/Processors/") Replace with Node(app, "/redfish/v1/Systems/1/Processors/") Accordingly, need to do for others too i.e., MemoryCollection ( such as memory) Node(app, "/redfish/v1/Systems/1/Memory/") – user73636 Jan 13 '20 at 11:23
  • Currently bmcweb hard codes the fact there is only a single system so you would need to modify the doGet for /redfish/v1/Systems/system/ to be a bit more dynamic. Something like https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/cpudimm.hpp#L535 where the last part of the string is a and read as a parameter. Then you would return the appropriate info for that system instance. – Andrew Geissler Jan 14 '20 at 21:52
  • Well said and Thank you, and looks like need to modify in many places where ever I see system such as "/redfish/v1/Systems/system/Processors", "/redfish/v1/Systems/system/Memory", "/redfish/v1/Systems/system/Storage". Replace system with param[0]. Additionally do we need to modify or add xml or json under /bmcweb/static/redfish/v1/. Thanks in advance and sorry for asking repeatedly. – user73636 Jan 15 '20 at 14:53
  • Since the Redfish specification supports multiple instances, no change to the schema files is needed. The community would definitely be interested in discussing your changes and seeing the support be upstreamed. Please feel free to contact the community (https://github.com/openbmc/openbmc#contact) with what you are planning. – Andrew Geissler Jan 16 '20 at 16:43
  • Thank you very much for your great support. Double Satisfied with your answers. – user73636 Jan 17 '20 at 03:29