brokkr-broker::api::v1::diagnostics
Rust
Diagnostics API endpoints.
This module provides routes and handlers for on-demand diagnostic requests. Operators can request diagnostics for specific deployment objects, and agents pick up and execute these requests, returning detailed diagnostic data.
Structs
Section titled “Structs”struct CreateDiagnosticRequest
Section titled “struct CreateDiagnosticRequest”pub
Derives: Debug, Clone, Serialize, Deserialize, utoipa::ToSchema
Request body for creating a diagnostic request.
Fields
Section titled “Fields”| Name | Type | Description |
|---|---|---|
agent_id |
Uuid |
The agent that should handle this request. |
requested_by |
Option<String> |
Who is requesting the diagnostics (optional). |
retention_minutes |
Option<i64> |
How long the request should be retained in minutes (default 60, max 1440). |
struct DiagnosticResponse
Section titled “struct DiagnosticResponse”pub
Derives: Debug, Clone, Serialize, Deserialize, utoipa::ToSchema
Response containing a diagnostic request with optional result.
Fields
Section titled “Fields”| Name | Type | Description |
|---|---|---|
request |
DiagnosticRequest |
The diagnostic request. |
result |
Option<DiagnosticResult> |
The diagnostic result, if completed. |
struct SubmitDiagnosticResult
Section titled “struct SubmitDiagnosticResult”pub
Derives: Debug, Clone, Serialize, Deserialize, utoipa::ToSchema
Request body for submitting diagnostic results.
Fields
Section titled “Fields”| Name | Type | Description |
|---|---|---|
pod_statuses |
String |
JSON-encoded pod statuses. |
events |
String |
JSON-encoded Kubernetes events. |
log_tails |
Option<String> |
JSON-encoded log tails (optional). |
collected_at |
DateTime<Utc> |
When the diagnostics were collected. |
Functions
Section titled “Functions”fn routes
Section titled “fn routes”pub
fn routes() -> Router<DAL>Creates and returns the router for diagnostic endpoints.
Source
pub fn routes() -> Router<DAL> { info!("Setting up diagnostic routes"); Router::new() .route( "/deployment-objects/:id/diagnostics", post(create_diagnostic_request), ) .route("/diagnostics/:id", get(get_diagnostic)) .route( "/agents/:id/diagnostics/pending", get(get_pending_diagnostics), ) .route("/diagnostics/:id/claim", post(claim_diagnostic)) .route("/diagnostics/:id/result", post(submit_diagnostic_result))}