Skip to content

Conversation

@nmgaston
Copy link
Collaborator

@nmgaston nmgaston commented Oct 7, 2025

Implement Complete Redfish ComputerSystem.Reset with Full Error Handling

 Overview

This PR implements a production-ready, fully Redfish DMTF-compliant ComputerSystem.Reset endpoint with comprehensive error handling, authentication, and extensive test coverage.

 Key Features

Redfish DMTF Compliance

  • ✅ Full Base Registry v1.11.0 compliance
  • ✅ Proper OData headers and JSON-LD structure
  • ✅ Standardized error messages and resolution guidance
  • ✅ Complete HTTP method handling (POST allowed, GET/PUT/PATCH/DELETE return 405)

Comprehensive Error Handling

  • 400 Bad Request: Malformed JSON, missing properties, invalid enum values
  • 401 Unauthorized: Missing/invalid JWT authentication
  • 403 Forbidden: Insufficient privileges (future-ready)
  • 404 Not Found: Device not found in database
  • 405 Method Not Allowed: Wrong HTTP method with proper Allow headers
  • 409 Conflict: Power state conflicts (e.g., powering on device already on)
  • 500 Internal Server Error: Application/database errors
  • 502 Bad Gateway: Upstream device communication failures (AMT/WSMAN unreachable)
  • 503 Service Unavailable: Service overload/maintenance with Retry-After header

Intelligent Error Detection

// Detects network/device communication issues → 502
isUpstreamCommunicationError() 

// Detects service overload conditions → 503  
isServiceTemporarilyUnavailable()

@nmgaston nmgaston changed the title Add redfish documentation and system.go changes Redish Compliance for ComputerSystem.Reset endpoint Oct 8, 2025
- Add Redfish v1.11.0 Base Registry compliant error responses
- Implement ComputerSystem.Reset endpoint with proper HTTP status codes
- Add power state conflict detection (409 responses for redundant operations)
- Create reusable error handling functions for Base Registry messages
- Implement proper API versioning structure (/redfish/v1/)
- Add comprehensive Redfish documentation and examples
- Remove build artifacts and update .gitignore

This implementation provides a fully compliant Redfish API v1 endpoint
that follows DMTF specifications and industry best practices.
@nmgaston nmgaston marked this pull request as draft October 8, 2025 21:54
- Implement 405 Method Not Allowed with proper Allow headers
- Add Redfish-compliant authentication error responses (401/403)
- Create RedfishJWTAuthMiddleware for proper Base Registry error handling
- Update resolution text to match Redfish Base Registry v1.11.0 specification
- Add NoValidSessionError and InsufficientPrivilegeError functions
- Apply Redfish authentication to both Systems and Service Root endpoints

All error responses now follow DMTF Redfish Base Message Registry v1.11.0
- Add ServiceUnavailableError (502) for upstream device communication failures
- Add ServiceTemporarilyUnavailableError (503) for service overload/maintenance
- Implement isUpstreamCommunicationError() detection for network/AMT/WSMAN errors
- Implement isServiceTemporarilyUnavailable() detection for overload conditions
- Add comprehensive error handling hierarchy: 404 -> 503 -> 502 -> 500
- Include Retry-After header for 503 responses
- Add extensive test coverage for all error scenarios
- Maintain 100% test coverage with 193+ test cases
- Full Redfish DMTF Base Registry v1.11.0 compliance
@nmgaston nmgaston marked this pull request as ready for review October 9, 2025 22:48
…with full error handling

- Add DMTF-compliant ServiceRoot endpoint with proper UUID generation
- Implement comprehensive HTTP error handling (401, 405, 406, 500, 502, 503)
- Add Redfish Base Registry v1.11.0 compliant error responses
- Implement service health monitoring with extensible health check functions
- Add proper Accept header validation and 406 Not Acceptable responses
- Implement HTTP method restrictions with proper 405 Method Not Allowed responses
- Add RedfishRecoveryMiddleware for panic recovery with 500 error responses
- Extend SessionService and Sessions collection endpoints with proper error handling
- Add comprehensive test suite (486 lines) covering all endpoints and error conditions
- Include UUID v4 generation with cryptographic randomness and fallback
- Add extensible health check framework for future 502/503 error detection
- Implement proper OData headers and DMTF specification compliance
- Add detailed error messages with resolution guidance per Base Registry

This implementation provides a production-ready, fully DMTF-compliant Redfish service
root that handles all error conditions gracefully and provides comprehensive logging
and monitoring capabilities for enterprise deployment.
@nmgaston
Copy link
Collaborator Author

Moved changes to PR #13

@nmgaston nmgaston closed this Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant