Gofish - A golang client library for Redfish and Swordfish

3 minute read

One of the things I have been looking in to for the OpenSDS project is adding support for the Swordfish API standard. I believe by OpenSDS providing a standardized API it could both make it attractive for storage vendors to natively integrate with OpenSDS - with one integration they would pick up support for CSI, Cinder, Swordfish, and other integration points - as well as make OpenSDS an interesting option for those needing to manage a heterogenous mix of storage devices in their data center in a common, single pane of glass, way.

We are still looking at how this could be integrated and how much focus it should have. But it became clear to me that we would need a good way to exercise this API if/when it is in place.

We are also considering southbound integration in OpenSDS to be able to manage Swordfish-enabled storage. This would enable OpenSDS support for storage without needing to write any custom code if they have already made the investment in exposing a Swordfish API. If we were to do that, we would need a client library that would allow us to easily interact with these devices.

So between the two approaches being considered, along with wanting to get a little more time and experience with golang, I decided to start implementation on an open library for Redfish and Swordfish. I’ve just pushed up a very rudementary start with the Gofish library.

What is Swordfish

The DMTF released the first Redfish standard in 2015. The goal of Redfish was to replace IPMI and other proprietary APIs for managing data center devices with a simple, standard, RESTful API that would provide consistency and ease of use across physical, hybrid, and virtual IT devices.

For years, the Storage Network Industry Association (SNIA) had been working on SMI-S as a standard storage management protocol. There was industry adoption, but there was still a general sense that SMI-S was too big and too complex for both implementors and consumers of the API.

SNIA recognized the simplicity and ease of use of the Redfish specification and chose to extend the DMTF spec with storage related objects and capabilities. These additions can be seen (at a high level) with the purple objects in this model from a presentation by Richelle Ahlvers, the chair of the Scalable Storage Management Technical Working Group (SSM TWG):

Object model

Introducing Gofish

To start, I just used the API responses from the Swordfish API emulator as a reference to get a very basic client library working which I have called Gofish. Cause I’m just so clever and witty like that.

This is very, very rudimentary at this point. There is no authentication mechanism yet, something that any real Redfish or Swordfish provider will surely require. The object model is also very limited and incomplete. Luckily all of the Redfish and Swordfish schemas are published in easy to consume yaml or json formats that should make it easy to script up the generation of the rest of the schema.

Even in its basic state, I did want to get this out there in case anyone else is interested. I’ve published this under the Apache 2 license in a public GitHub repo, so anyone that is interested in contributing, feel free to propose pull requests and try out the code.

I am hoping to work on this as time permits to get it more full featured and robust. I am limited by my access to Redfish and Sworfish enabled devices, so I may be constrained until I can track down something more than the emulator to use for testing. But hopefully this project evolves into something useful as more devices implement this support and more management tools are developed to take advantage of it.