The Sunfish library offers an interface that permits to handle Redfish objects via RESTful operations (read, write, put, patch and delete), and it manage the persistency of these objects. The interface has many implementations that manage different kinds of persistency. Current available persistency implementations:
The library requires:
We suggest using a Python virtual environment. To install the project requirements:
pip install -r requirements.txt
From the directory sunfish_library_reference
execute the following command:
make build
To test this Library you need pytest
to be installed.
To run the tests run the command
make test
To use sunfishcorelib you need to specify the configuration parameters into the conf.json file, an example could be:
{
"storage_backend": "FS",
"redfish_root": "/redfish/v1/",
"backend_conf" : {
"fs_root": "Resources",
"subscribers_root": "EventService/Subscriptions"
},
"handlers": {
"subscription_handler": "redfish",
"event_handler": "redfish"
}
}
where:
Sunfish should be installed and imported in an existing Python project. To use it:
sunfish.lib.exceptions.py
IMPORTANT: this Library assumes that the .json object are legal and well-formed according to the Redfish specification.
The code in this project is made available via the BSD 3-Clause License. See LICENSE to access the full license terms. This project adopts the Developer Certificate of Origin (DCO) to certify that each commit was written by the author, or that the author has the rights necessary to contribute the code. All commits must include a DCO which looks like this: Signed-off-by: Joe Smith joe.smith@email.com. Specifically, we utilize the [Developer Certificate of Origin Version 1.1] (https://github.com/OpenFabrics/sunfish_library_reference/blob/main/DCO). The project requires that the name used is your real name. Neither anonymous contributors nor those utilizing pseudonyms will be accepted.