Redfish is an experimental, dependency-free Go library for serving a DMTF Redfish API, generated directly from the normative CSDL schema and aimed at bare-metal BMC firmware.
Part of the Kyanite stack.
Status: experimental — expect breaking changes.
- Parses the DMTF DSP8010 CSDL (OData EDMX) schema bundle and resolves versioned entity, complex, enum, and type-definition references.
- Generates Go source for an explicit list of resources only, plus the complex and enum types they transitively need.
- Emits reflection-free models with explicit marshalers; no
reflector reflection-basedencoding/jsonin the serving path. - Emits one opt-in
Register*function per resource, so anything a binary does not register is removed by the linker. - Uses
net/http.ServeMuxmethod+pattern routing; no third-party router. - Covers the OData surface a Redfish service needs:
- trimmed
$metadata(EDMX) for the generated types and the OData service document @odata.id,@odata.type,@odata.context, and@odata.etaginjection- collections (
Members,Members@odata.count), including AutoExpand collections - standard Redfish error bodies
- trimmed
- Supports sparse
PATCHon writable properties withETag/If-Matchchecks, and bound actions such asComputerSystem.Resetthat complete synchronously or asynchronously as tasks. - Lets providers return a
server.Errorto choose the HTTP status and base message of an error response. - Serves the
UpdateServicewith firmware and software inventory,SimpleUpdate, multipart HTTP push updates, andActivateon top of a pluggable, OS-independent update backend. - Ships an in-memory example BMC that passes the DMTF Redfish Service Validator and the Interop Validator against the OCP Baseline Hardware Management profile v1.1.1.
- No authentication or session handling;
SessionServiceis modelled but sessions are not enforced. $expand,$select, and other query parameters are not implemented.- No
Allowresponse header yet, so validators cannot test writable properties. - Only the resources listed in
gen/doc.goare generated; other resources need to be added there and regenerated. - Only a subset of the DSP8011 base messages is used, and message registries are not served.
- The example uses static fixtures. The RAUC update backend drives the
rauccommand line tool but has not been tested on hardware yet; the Intel RSU backend is a stub.
internal/csdl: CSDL/EDMX model, parser, and schema bundle resolution.internal/gen: resource resolution,$metadataconstruction, and Go source rendering.cmd/redfishgen: generator command.odata: hand-written JSON builder and OData payload helpers used by generated code.server: response, ETag, and error helpers used by generated handlers.gen: generated models, marshalers, andRegister*functions for the baseline BMC resource set.task: runs long-running operations as Redfish tasks and serves the TaskService and task monitors.update: serves the UpdateService and firmware/software inventory on top of an update backend.update/rauc: update backend for Linux systems updated with RAUC, using therauccommand line tool.update/rsu: update backend for Intel (Altera) RSU (stub).examples/bmc: minimal in-memory Redfish service built ongen.schema/csdl: vendored CSDL from DMTF DSP8010 (version inschema/VERSION).
PATCH and action bodies are parsed with encoding/json/jsontext, which currently needs the JSON v2 experiment:
export GOEXPERIMENT=jsonv2
go build ./...
go test ./...Regenerate the resource package after changing the target list in gen/doc.go:
go generate ./genRun the example service on :8080:
go run ./examples/bmcscripts/validate.sh boots the example and runs the DMTF
Redfish-Service-Validator and
Redfish-Interop-Validator. It expects both validators cloned under
third_party/ with a Python venv at third_party/.venv, the extracted DSP8010 schema files in SchemaFiles/, and the
OCP profile at profiles/OCPBaselineHardwareManagement.v1_1_1.json.
Design notes are in docs/design.html. Implementation status is tracked in ROADMAP.md.
See the org-wide CONTRIBUTING guide. Contributions are dual-licensed.
See the org-wide SECURITY policy.
Dual-licensed under either of Apache-2.0 (LICENSE-APACHE) or MIT (LICENSE-MIT) at your option.
The CSDL schema files under schema/csdl are copyright DMTF and distributed under the
DMTF copyright policy.