A comprehensive Redfish API simulator for BMC development, testing, and integration using Redfish mockups.
Based on DMTF Redfish-Mockup-Server
Copyright 2016-2020 DMTF. All rights reserved.
The Redfish Dev Server is a powerful, feature-rich Redfish API simulator designed specifically for Baseboard Management Controller (BMC) development, testing, and integration workflows. It enables you to create and manage Redfish mockups - virtual BMC environments that simulate real hardware without requiring physical servers. Built upon the robust DMTF Redfish-Mockup-Server foundation, it provides:
- π§ Three Server Variants: Choose from modular, enhanced, or platform-specific implementations
- π Comprehensive Client Library: Full-featured Python client with examples and tools
- π¨ Modular Architecture: Clean separation of concerns with handlers, services, and models
- β‘ Enhanced Features: Advanced logging, event management, message handling, and platform simulation
- π Extensive Documentation: Complete Wiki system, developer guides, and API references
- π§ͺ Testing Framework: Built-in demos, test suites, and validation tools
- Serve Redfish requests against Redfish mockup data at configurable IP/port (default:
127.0.0.1:8000) - Simulate real BMC behavior with persistent state, event generation, and resource management
- Support for multiple platform types (rackmount, blade, modular) with custom mockup configurations
- DMTF-compliant message registry integration and standardized ExtendedInfo responses
- Docker support for containerized deployment and testing
- SSL/HTTPS support with custom certificates
- DMTF mockup Data: All Published Versions of DSP2043
- Create mockups: Redfish-Mockup-Creator
- Redfish Standard: DMTF Redfish Specification
This project has been organized for better maintainability and ease of use:
π redfish-dev-server/
βββ π docs/ # π Complete documentation
β βββ guides/ # π§ Setup and development guides
β βββ specs/ # π Technical specifications
β βββ wiki/ # π Wiki content
βββ π src/ # ποΈ Core source code
βββ π servers/ # π₯οΈ Server implementations
βββ π scripts/ # β‘ Utility scripts
βββ π tests/ # π§ͺ Test suite
βββ π examples/ # π‘ Demos and samples
βββ π config/ # βοΈ Configuration files
βββ π [other dirs] # Additional components
π See DIRECTORY_STRUCTURE.md for complete organization details
- Python 3.7+: Download Python
- pip: Package installer (usually included with Python)
- Dependencies: Install via
pip install -r requirements.txt
- Docker: Get Docker
- Linux (Ubuntu, RHEL, CentOS, Debian)
- macOS
- Windows (with WSL2 recommended)
- Docker containers (platform-independent)
# Clone the repository
git clone https://github.com/microsoft/redfish-dev-server.git
cd redfish-dev-server
# Install Python dependencies
pip install -r requirements.txtBasic usage (default mockup, localhost:8000):
python servers/redfishMockupServer_modular.pyCustom mockup directory:
python servers/redfishMockupServer_modular.py -D /path/to/your/mockup-dataWith SSL/HTTPS:
python servers/redfishMockupServer_modular.py -s --cert server.crt --key server.key# Test basic connectivity
curl http://127.0.0.1:8000/redfish/v1
# Use the Python client library
python -m redfish_client.examples.basic_operationsThe mockups/ directory contains several pre-configured Redfish mockup datasets that simulate different BMC hardware configurations:
public-rackmount1/- DMTF standard rackmount server mockup- Complete system with Chassis, Systems, Managers resources
- Full BMC simulation with event and logging services
- Includes thermal, power, and storage subsystems
FullBMCMockup.tgz- Comprehensive BMC simulation mockup datasetRASMockup.tgz- Reliability, Availability, Serviceability focused mockupsample_mockup.tgz- Minimal example mockup for development
# Use the default public-rackmount1 mockup
python servers/redfishMockupServer_modular.py -D mockups/public-rackmount1
# Extract and use archived mockups
tar -xzf mockups/FullBMCMockup.tgz -C mockups/
python servers/redfishMockupServer_modular.py -D mockups/FullBMCMockup
# Create your own custom mockup directory
mkdir -p mockups/my-custom-bmc
# Add your JSON resources and use:
python servers/redfishMockupServer_modular.py -D mockups/my-custom-bmcNote: Directory is named
mockups/for backward compatibility with DMTF tools. These are Redfish mockup data directories.
See the mockup Data Management training module for detailed guidance on creating and customizing Redfish mockup data.
The Redfish Dev Server provides three server implementations for different use cases:
Best for: General development and testing
python servers/redfishMockupServer_modular.py -D mockup-data-dir -p 8000Features:
- Clean modular architecture with handlers, services, and models
- Persistent state management with JSON storage
- Enhanced error handling and DMTF message registry
- Resource lifecycle management (POST/PATCH/DELETE)
- Built-in logging and audit trails
Best for: Advanced mockup simulation
python servers/redfishMockupServer_enhanced.py -D mockup-data-dir --enhanced-responsesFeatures:
- Advanced event management with real-time subscriptions
- Comprehensive logging (Event, Audit, Security logs)
- Automatic event generation from operations
- Extended message responses with full ExtendedInfo
- Background event delivery system
Best for: Platform-specific mockup testing
python servers/redfishMockupServer_platform.py --platform rackmount --config platform-config.jsonFeatures:
- Platform-specific configurations (rackmount, blade, modular)
- Custom resource types and behaviors
- Platform capability simulation
- Advanced sensor and metric emulation
- Multi-chassis and multi-node support
New! Complete RAS plugin for error detection, analysis, and remediation workflows.
# Start server with RAS-enabled mockup
python servers/redfishMockupServer_platform.py -D mockups/ras_gen10 -p 8000
# Run the parity demo
python examples/ras_plugin_parity_demo.py
# Or use the tmux launcher for full demo
./scripts/run_ras_demo.sh- CPAD Submission: Submit Corrective Platform Action Descriptors via SubmitCPAD action
- CPER Generation: Template-based Common Platform Error Record generation using libcper
- Policy Engine: Trust-based validation with TRUSTED_CREATORS, KNOWN_ACTIONS, KNOWN_PLATFORMS
- LogService: Redfish-compliant RAS log entries with CPER data
- EventService: Event subscription and notification for RAS alerts
- Analytics: Error pattern analysis and trend detection
- Remediation: Policy-based automated remediation with rate limiting
- RAS Plugin Documentation - Complete plugin reference
- Plugin SDK Guide - How to develop plugins
- Documentation Index - Navigation guide
New! Comprehensive web interfaces for server management and client operations.
# Install Web UI dependencies
pip install -r webui/requirements_webui.txt
# Launch with quick start script
./webui/quickstart.sh
# Or launch individually
python webui/webui_launcher.py both # Launch both UIs
python webui/webui_launcher.py server # Server UI only
python webui/webui_launcher.py client # Client UI onlyControl Panel for managing the Redfish mockup simulator server
- ποΈ Server Control: Start/Stop/Restart mockup server with one click
- π Live Monitoring: Real-time status, logs, and statistics
- βοΈ Configuration: Set host, port, mockup directory, platform type
- π Log Viewer: Filter logs by level (info/success/warning/error)
Access at: http://127.0.0.1:5000/
Interactive interface for Redfish mockup operations and analysis
- π Connection Manager: Manage multiple Redfish server connections
- π― Operations: GET/POST/PATCH/DELETE requests with JSON payload editor
- π Discovery: Automatically discover all server resources
- π Analysis: Analyze server capabilities and features
- π History: Track all requests with timestamps and response times
Access at: http://127.0.0.1:5001/
See Web UI Documentation for full details.
Redfish Dev Server, version 2.0.0
usage: redfishMockupServer.py [-h] [-H HOST] [-p PORT] [-D DIR] [-E] [-X]
[-t TIME] [-T] [-s] [--cert CERT] [--key KEY]
[-S] [-P]
optional arguments:
-h, --help show this help message and exit
-H HOST, --host HOST hostname or IP address (default: 127.0.0.1)
-p PORT, --port PORT host port (default: 8000)
-D DIR, --dir DIR path to mockup data directory (may be relative to CWD)
-E, --test-etag etag testing (unimplemented)
-X, --headers load headers from headers.json files in mockup
-t TIME, --time TIME delay in seconds added to responses (float or int)
-T delay response based on times in time.json files
-s, --ssl enable SSL (HTTPS) mode; requires cert and key
--cert CERT certificate file for SSL
--key KEY private key file for SSL
-S, --short-form apply short form to mockup (omit /redfish/v1 prefix)
-P, --ssdp make mockup SSDP discoverable
Notes:
- If the mockup lacks the
/redfishresource, use--short-form - If no mockup is specified, DMTF's
public-rackmount1mockup is used - SSL mode requires both certificate and key files
docker build -t redfish-dev-server:latest .docker run --rm -p 8000:8000 redfish-dev-server:latestdocker run --rm -p 8000:8000 \
-v /path/to/mockup-data:/mockup \
redfish-dev-server:latest -D /mockupdocker run --rm -p 8443:8443 \
-v /path/to/certs:/certs \
redfish-dev-server:latest -s --cert /certs/server.crt --key /certs/server.key -p 8443Message Handling
- Standardized Redfish ExtendedInfo in all responses
- DMTF Base Message Registry (Base.1.5.0) integration
- Consistent error handling across all endpoints
- Proper HTTP status codes with corresponding messages
Logging System
- Multiple log types: Event, Audit, and Security
- JSON-based persistent storage
- Automatic CRUD operation tracking
- Property change audit trails
- Authentication event logging
Event Management
- Real-time event subscriptions with filtering
- Automatic event generation from POST/PATCH operations
- Multiple event types: ResourceAdded, ResourceUpdated, Alert, StatusChange
- Background non-blocking event delivery
- SSE (Server-Sent Events) support
State Management
- Persistent resource state across server restarts
- Transaction logging and rollback support
- Resource lifecycle management
- Dynamic mockup updates
Comprehensive Redfish client with:
- Synchronous and asynchronous operations
- Session management and authentication
- Resource discovery and navigation
- Event subscription handling
- Command-line tools and utilities
- Extensive examples and documentation
Example usage:
from redfish_client import RedfishClient
# Connect to Redfish mockup simulator
client = RedfishClient('http://127.0.0.1:8000', username='admin', password='password')
# Get system information from mockup
systems = client.get('/redfish/v1/Systems')
print(systems.json())
# Update a resource in the mockup
client.patch('/redfish/v1/Systems/1', {'AssetTag': 'MyServer'})
# Subscribe to mockup events
client.create_event_subscription('http://my-listener/events')redfish-dev-server/
βββ src/ # Core source code
β βββ handlers/ # Request handlers (GET, POST, PATCH, DELETE)
β βββ services/ # Business logic (state, events, logging)
β βββ models/ # Data models and schemas
β βββ config/ # Configuration management
β βββ plugins/ # Extensible plugin system
βββ redfish_client/ # Python client library
β βββ client.py # Main client class
β βββ session.py # Session management
β βββ examples/ # Usage examples
β βββ tools/ # Command-line utilities
βββ platforms/ # Platform-specific configurations
βββ examples/ # Demo scripts and tutorials
βββ tests/ # Test suites
Quick feature demo:
python examples/quick_enhanced_demo.pyComprehensive system demo:
python examples/demo_enhanced_redfish_system.pyComplete BMC simulator showcase:
python examples/bmc_simulator_demo.py# Basic operations
python -m redfish_client.examples.basic_operations
# Event subscriptions
python -m redfish_client.examples.event_subscriptions
# Resource management
python -m redfish_client.examples.resource_management# Run unit tests
python -m pytest tests/
# Run integration tests
python -m pytest tests/integration/
# Run with coverage
python -m pytest --cov=src tests/- π Project Structure - Complete directory organization
- β‘ Quick Start - Get up and running in minutes
- π§ Developer Guide - Comprehensive development docs
- π Wiki Hub - Complete documentation portal
- π Migration Guide - Migrating from legacy servers
- ποΈ Platform Development - Custom platform development
- βοΈ Architecture - Platform architecture details
- π Action Handlers - Handler implementation
- π Schema Validation - Validation guidelines
- π API Reference - DMTF Redfish specification
- π Examples Directory - All demo implementations
- π§ͺ Test Suite - Complete test examples
- β‘ Utility Scripts - Helper tools and utilities
- Redfish-Mockup-Creator - Create mockup data from live Redfish services
- Redfish-Service-Validator - Validate Redfish service conformance
- Redfish-Mockup-Server - Original DMTF mockup server
We welcome contributions! Please see our contributing guidelines for details:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the BSD 3-Clause License - see the LICENSE.md file for details.
Based on DMTF Redfish-Mockup-Server
Copyright 2016-2020 DMTF. All rights reserved.
- DMTF - For the Redfish specification and original Mockup Server
- Original Authors - Paul Vancil and contributors to Redfish-Mockup-Server
- Community - All contributors and users of this project
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Wiki: Project Wiki
- Go to the "Actions" page
- Select the "Release and Publish" workflow
- Click "Run workflow"
- Fill out the form
- Click "Run workflow"
Version: 2.0.0
Status: Active Development
Last Updated: November 2024