Add Status and List APIs for participants #2
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.
This PR introduces a new Status API that allows programmatic querying of participant provisioning status, eliminating the need to manually inspect Kubernetes logs. In order to resolve that i've added two new REST endpoints that provide status information:
1. Get Participant Status
Returns detailed status including:
2. List All Participants
Returns paginated list of all participants with:
Examples
Get Participant Status
Response:
{ "participantName": "aruba07", "status": "READY", "lastUpdated": "2025-01-15T10:30:00Z", "components": { "controlplane": { "status": "Running", "ready": true, "replicas": {"desired": 1, "current": 1, "ready": 1} }, "dataplane": { "status": "Running", "ready": true, "replicas": {"desired": 1, "current": 1, "ready": 1} } }, "message": "All components are running and ready", "events": [ { "timestamp": "2025-01-15T10:25:00Z", "type": "Info", "message": "Deployment controlplane ready" } ] }List Participants with Pagination
curl 'http://localhost:9999/api/v1/resources?status=READY&page=1&limit=5'Response Headers:
Response Body:
[ { "participantName": "aruba01", "status": "READY", "lastUpdated": "2025-01-15T10:30:00Z" }, { "participantName": "aruba02", "status": "READY", "lastUpdated": "2025-01-15T10:25:00Z" } ]For simplicity, an in-memory cache has been implemented to avoid overloading the cluster with unnecessary requests. In a production environment or other contexts, an external cache solution (such as Redis) would be more appropriate for scalability and persistence across service restarts.
Thanks.