feat(faults): add global DELETE /api/v1/faults endpoint#228
Merged
mfaferek93 merged 7 commits intomainfrom Feb 19, 2026
Merged
Conversation
Add DELETE /faults to clear all faults system-wide regardless of entity ownership. Supports optional ?status= query parameter for filtering. Returns 204 No Content on success. Closes #226
a789ce4 to
075c729
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a global fault-management REST extension to allow clearing faults system-wide (not scoped to a specific entity), aligning with the existing convenience GET /api/v1/faults endpoint.
Changes:
- Registers
DELETE /api/v1/faultsand implements a handler that lists faults and clears them (optionally filtered by?status=). - Adds integration tests covering success responses for the new DELETE route and invalid
statushandling. - Documents the new global DELETE endpoint in the REST API docs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ros2_medkit_gateway/src/http/rest_server.cpp | Registers the new global DELETE /faults route. |
| src/ros2_medkit_gateway/src/http/handlers/fault_handlers.cpp | Implements global clear logic by listing faults and calling clear_fault() per code. |
| src/ros2_medkit_gateway/include/ros2_medkit_gateway/http/handlers/fault_handlers.hpp | Exposes the new handler method and updates the endpoint list comment. |
| src/ros2_medkit_gateway/test/test_integration.test.py | Adds integration coverage for the new DELETE endpoint (status code / invalid param). |
| docs/api/rest.rst | Documents DELETE /api/v1/faults as an extension endpoint. |
src/ros2_medkit_gateway/include/ros2_medkit_gateway/http/handlers/fault_handlers.hpp
Outdated
Show resolved
Hide resolved
"pending and confirmed" instead of ambiguous "active faults" (SOVD "active" means confirmed-only).
075c729 to
fefbbd0
Compare
…0->204 in docs
- Pass include_muted=true to list_faults() in handle_clear_all_faults_global()
so muted faults are also cleared by DELETE /faults
- Fix existing DELETE /{entity}/faults/{code} docs: 200 -> 204 to match impl
92cf9f9 to
9fa0342
Compare
bburda
reviewed
Feb 19, 2026
Collaborator
bburda
left a comment
There was a problem hiding this comment.
Solid change - mirrors the existing GET /api/v1/faults nicely, reuses parse_fault_status_param, correctly returns 204. The docs fix (200->204) for the existing single-fault DELETE also aligns with SOVD spec.
3 inline comments below.
postman/collections/ros2-medkit-gateway.postman_collection.json
Outdated
Show resolved
Hide resolved
bburda
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #226
Pull Request
Summary
Add
DELETE /api/v1/faultsto clear all faults system-wide regardless of entity ownership. Supports optional?status=query parameter for filtering. Returns 204 No Content on success.This is a ros2_medkit extension (not SOVD). Mirrors the existing
GET /api/v1/faultsconvenience endpoint.Issue
Type
Testing
?status=all, invalid status 400curl -X DELETE http://localhost:8080/api/v1/faultsreturns 204Checklist