Docker containers for the controller, running redfish and prometheus exporter
| app | ||
| exporter | ||
| rdc | ||
| .env | ||
| .env.example | ||
| docker-compose.yml | ||
| Dockerfile | ||
| README.md | ||
| requirements.txt | ||
Redfish API for Rear Door Cooler
A Redfish-compliant REST API for monitoring and controlling a rear door cooler system running on a WAGO controller.
Overview
This service provides a full Redfish service implementation that exposes:
- Chassis resources with thermal and power management
- Thermal resources with temperature sensors and fan monitoring
- Power resources with power supply status
- Actions for fan control, valve control, and system reset
The API reads sensor data from files in /tmp/rdc on the WAGO controller and provides write operations for control commands.
Features
- Full Redfish 1.20+ compliant API
- Basic HTTP authentication
- Read/write operations for sensor data and control commands
- Docker containerization for easy deployment
- Support for:
- 6 air-on temperature sensors
- 6 air-off temperature sensors
- 2 water temperature sensors (in/out)
- 2 cabinet temperature sensors
- 6 fans with RPM, voltage, current, and power monitoring
- 2 power supplies
- Pressure and valve feedback
- Leak detection
Quick Start
Using Docker Compose
-
Create a
.envfile from.env.example:cp .env.example .env -
Edit
.envand set your credentials:REDFISH_USERNAME=admin REDFISH_PASSWORD=your_secure_password -
Start the service:
docker-compose up -d -
Access the API:
- Service Root: http://localhost:8000/redfish/v1/
- API Documentation: http://localhost:8000/docs
Using Docker
docker build -t redfish-rdc .
docker run -d \
-p 8000:8000 \
-v /tmp/rdc:/tmp/rdc:ro \
-e REDFISH_USERNAME=admin \
-e REDFISH_PASSWORD=password \
--name redfish-rdc \
redfish-rdc
Local Development
-
Install dependencies:
pip install -r requirements.txt -
Set environment variables:
export REDFISH_USERNAME=admin export REDFISH_PASSWORD=password export RDC_PATH=/tmp/rdc -
Run the application:
uvicorn app.main:app --host 0.0.0.0 --port 8000
API Endpoints
Service Root
GET /redfish/v1/- Service root with links to all resources
Chassis
GET /redfish/v1/Chassis- Chassis collectionGET /redfish/v1/Chassis/RearDoorCooler- Main chassis instancePATCH /redfish/v1/Chassis/RearDoorCooler- Update chassis properties
Thermal
GET /redfish/v1/Chassis/RearDoorCooler/Thermal- Thermal resource with temperatures and fansPOST /redfish/v1/Chassis/RearDoorCooler/Thermal/Actions/Fan.SetSpeed- Set fan speedPOST /redfish/v1/Chassis/RearDoorCooler/Actions/Oem/FanControl- Enable/disable fan
Power
GET /redfish/v1/Chassis/RearDoorCooler/Power- Power resource with power supplies
Actions
POST /redfish/v1/Chassis/RearDoorCooler/Actions/Chassis.Reset- Reset chassisPOST /redfish/v1/Chassis/RearDoorCooler/Actions/Oem/ValveControl- Control valve
Authentication
The API uses Basic HTTP authentication. Include credentials in the Authorization header:
Authorization: Basic <base64(username:password)>
RDC File Structure
The service expects files in /tmp/rdc/ (or path specified by RDC_PATH):
Temperature Sensors
TEMP_AIR_ON_0_01_TEMPthroughTEMP_AIR_ON_0_06_TEMP- Air on temperaturesTEMP_AIR_ON_0_01_CONNthroughTEMP_AIR_ON_0_06_CONN- Air on connection statusTEMP_AIR_OFF_0_01_TEMPthroughTEMP_AIR_OFF_0_06_TEMP- Air off temperaturesTEMP_AIR_OFF_0_01_CONNthroughTEMP_AIR_OFF_0_06_CONN- Air off connection statusTEMP_WATER_IN_0_TEMP,TEMP_WATER_OUT_0_TEMP- Water temperaturesTEMP_WATER_IN_0_CONN,TEMP_WATER_OUT_0_CONN- Water connection statusTEMP_CAB_0_TEMP,TEMP_CAB_1_TEMP- Cabinet temperaturesTEMP_CAB_0_CONN,TEMP_CAB_1_CONN- Cabinet connection status
Fans (01-06)
FANS_XX_RPM- Fan RPMFANS_XX_V- Fan voltageFANS_XX_I- Fan currentFANS_XX_P- Fan powerFANS_XX_STATUS- Fan statusFANS_XX_ENABLED- Fan enabled (writable)FANS_XX_ONLINE- Fan online statusFANS_XX_CMD- Fan command/speed setpoint (writable)FANS_XX_SP- Fan setpoint
Power
A_POWER_STATUS- Power supply A statusB_POWER_STATUS- Power supply B status
Other
PRESSURE_FBK0- Pressure feedbackVALVE_FBK0- Valve feedbackVALVE_RAW- Valve command (writable)LEAK_DETECT- Leak detection statusFAN_SPEED_RAW- Raw fan speed
Environment Variables
REDFISH_USERNAME- Basic auth username (default: admin)REDFISH_PASSWORD- Basic auth password (default: password)REDFISH_PORT- API port (default: 8000)RDC_PATH- Path to RDC files directory (default: /tmp/rdc)
Development
Project Structure
redfish_docker/
├── app/
│ ├── main.py # FastAPI application
│ ├── auth.py # Authentication middleware
│ ├── models/ # Redfish data models
│ ├── routes/ # API route handlers
│ ├── data/ # Data access layer
│ └── utils/ # Utility functions
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── README.md