nv-redfish-core-0.2.0 has been yanked.
nv-redfish
A modular Redfish client stack for Rust.
Repository structure
-
core: Semantic-unaware foundation used by code generated from CSDL
- Primitives and traits:
Bmc,EntityTypeRef,Expandable,NavProperty<T>,Action<T,R>,ODataId,ODataETag,EdmDateTimeOffset,EdmDuration,Empty - Optional HTTP client behind the
reqwestfeature (enabled by default) incore::http(ReqwestClient,HttpBmc) - Goal: provide the minimum building blocks for generated code; no service-specific logic
- Primitives and traits:
-
redfish: High-level ergonomic wrappers over generated Redfish schema types
- Feature-gated services (enable only what you need): e.g.,
accounts(implemented),events(planned) - OEM extensions planned, also under features
- Patch support (
redfish::patch_support) to handle vendor quirks while maintaining compatibility - Uses generated types included via
redfish::schema(autogenerated by the CSDL compiler)
- Feature-gated services (enable only what you need): e.g.,
-
csdl-compiler: CSDL (OData) schema compiler and Rust code generator
- Reads Redfish (and OEM) CSDL XML, compiles a subset, and generates Rust code
- Two primary compilation modes:
- Compile: compile a subset rooted at specific singletons (e.g.,
Service) - CompileOem: compile OEM schemas and include them in the root set
- Compile: compile a subset rooted at specific singletons (e.g.,
- Entity type inclusion can be controlled with wildcard patterns; only needed types are compiled
- The generator produces Rust modules and types consumed by the
redfishcrate - CLI:
csdl-compilerwith subcommands incsdl-compiler/src/commands.rs
How the pieces fit together
- Choose features in
redfish(services, OEM flags). The selected features determine which schemas to include (seefeatures.toml) and which high-level wrappers are built. - The build uses
csdl-compilerto generate only the required schema types into theredfishcrate (viabuild.rs), keeping the binary lightweight. - The high-level
redfishAPIs (e.g.,ServiceRoot,accounts) operate over the generated types and thecoreprimitives. - Provide a
Bmcimplementation. Withcore’sreqwestfeature, useHttpBmc<ReqwestClient>; otherwise, plug in your own transport.
Feature flags
- core:
reqwest(default): enables the HTTP client implementation
- redfish:
accounts: AccountService wrappers (implemented)events: Events service wrappers (planned)- OEM extensions: planned per vendor, also feature-gated
Example
Minimal shape (pseudocode):
use ;
use BmcCredentials;
use ServiceRoot;
use Arc;
use Url;
# async
Goals
- Be as lightweight as possible:
- Compile only schemas referenced by enabled features (
features.tomldriven). - Keep the core minimal and transport-agnostic.
- Compile only schemas referenced by enabled features (
- Support a variety of vendors compatibly:
- Feature-gated OEM extensions.
- Patch support for schema deviations in real-world BMCs.
License
See workspace Cargo.toml.
This project includes Redfish schema files as submodule from DMTF’s Redfish-Publications repository, licensed under the BSD-3-Clause license.
This project includes Swordfish schema files as submodule from SNIA’s Swordfish-Publications repository, licensed under the BSD-3-Clause license.
Contributing
Please see CONTRIBUTING.md for details.