-
Notifications
You must be signed in to change notification settings - Fork 2
#97 feat(gateway): add GET /api/v1/faults endpoint for system-wide fa… #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 94/topicBasedComponentDiscovery
Are you sure you want to change the base?
Conversation
…ult retrieval Add convenience API endpoint that returns all faults across the system without requiring iteration over individual components. Supports status filtering via query parameter (?status=pending|confirmed|cleared|all).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new convenience endpoint GET /api/v1/faults that retrieves all faults across the entire system without requiring iteration over individual components. The endpoint supports optional status filtering via query parameter (?status=pending|confirmed|cleared|all).
Key changes:
- Added system-wide fault retrieval endpoint for dashboard/monitoring use cases
- Implemented status filtering with default behavior (pending + confirmed, excluding cleared)
- Added integration tests validating the endpoint's basic functionality and status filtering
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
src/ros2_medkit_gateway/include/ros2_medkit_gateway/rest_server.hpp |
Declared new handle_list_all_faults handler method |
src/ros2_medkit_gateway/src/rest_server.cpp |
Implemented GET /api/v1/faults endpoint with status filtering, added route registration, and updated root endpoint documentation |
src/ros2_medkit_gateway/test/test_integration.test.py |
Added integration tests for global fault listing and status filtering, updated root endpoint test to verify new endpoint is advertised |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
2966fdb to
10a0844
Compare
Address code review feedback: - Extract FaultStatusFilter struct and parse_fault_status_param() helper to eliminate code duplication between fault listing functions - Return 400 Bad Request for invalid status parameter values - Add tests for invalid status handling (test_61, test_62) - Extend test_60 to cover all valid status values - Document Faults Endpoints section in README.md - Add system-wide faults requests to Postman collection
10a0844 to
dd454fb
Compare
Pull Request
Summary
add GET /api/v1/faults endpoint for system-wide fault retrieval
Add convenience API endpoint that returns all faults across the system
without requiring iteration over individual components. Supports status
filtering via query parameter (?status=pending|confirmed|cleared|all).
Issue
Link the related issue (required):
Type
Testing
How was this tested / how should reviewers verify it?
Checklist