[Airship-discuss] Redfish Golibrary Findings

Kanwar Saad kanwar.sbl at gmail.com
Thu Sep 5 12:33:00 UTC 2019


Hi,

I spent some time on generating go client code for redfish spec using
openapi generator. But it is failing to generate code for that. I guess
code generator do not cover all scenarios of openapi. The redfish openapi
specification is huge(around 1200 documents) and it is failing for few
hundred. I dont want to spend time investigating that because that is
another rabbit hole. In that case we are left with these options.

*Gofish:*
- only contains functions for getting redfish resources but not setting.
- The resources we want like virtualmedia is not even supported for reading.
- It is not very well maintained.
- Extending It is not feasible since they create all datastructures by hand
and then we have to create Marshall/Unmarshall functions for each
datastructure.

*GoRackHD:*
- It is made to work with Dell's RackHD.
- Last commit was done in 2016.
- They have used a similar approach which I was trying. They created their
own subset of swagger specification and generate client code using that
swagger spec. The spec is old and do not support virtualmedia actions which
we want.
- Extending this is complicated since we dont know whether that will be
compatible with RackHD(or we need to make a fork continue ourself).
Secondly, it uses old swagger spec than openapi and conversion to openapi
is not straightforward.

*Use Containerized Tool:*

One option is to use a well tested, well maintained redfish client in any
language in a container just like isogen. this option also requires writing
wrappers around that library inside contianer.

*Create our own redfish go client :*

1. We can use a similar approach as of goRackHD. We can create our own
openapi spec for redfish only for the resources which we need in the start
and extend later. And generate client code using that. This might also
require maintaining the openapi spec parallel to the redfish standard spec
but since the redfish spec is not changing too fast so we can live with it.

2. Second option is to create a really lightweight utility functions which
will just perform the operations which we want using standard http library.
Since we might not need too much redfish functions so it could be a viable
option. If we want to rely heavily on redfish for validations(i have not
seen what kind of validations you want so its vague for me), then this
option might not work very well.


Br,
Kanwar Saad
Ericsson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.airshipit.org/pipermail/airship-discuss/attachments/20190905/df450278/attachment.html>


More information about the Airship-discuss mailing list