manta_shared/types/api/configuration_analysis.rs
1//! Wire shape for `GET /api/v1/configurations`.
2//!
3//! One row per CFS configuration, carrying the full
4//! `CfsConfigurationResponse` and a `safe_to_delete` verdict derived
5//! from CFS components (a configuration is unsafe iff some component
6//! lists it as `desired_config`).
7
8use manta_backend_dispatcher::types::cfs::cfs_configuration_response::CfsConfigurationResponse;
9use serde::{Deserialize, Serialize};
10use utoipa::ToSchema;
11
12/// One row of the configuration-deletion-safety analysis.
13#[derive(Debug, Serialize, Deserialize, ToSchema)]
14pub struct ConfigurationAnalysis {
15 /// Full CFS configuration record as returned by CFS. `CfsConfigurationResponse`
16 /// lives in `manta-backend-dispatcher` (third-party, no ToSchema), so the
17 /// OpenAPI schema falls back to `serde_json::Value`.
18 #[schema(value_type = serde_json::Value)]
19 pub configuration: CfsConfigurationResponse,
20 /// `true` if no CFS component lists this configuration as its
21 /// `desired_config`. The verdict is components-only; deletion may
22 /// still be unsafe if a BSS-referenced image was built from this
23 /// configuration — that fuller check isn't surfaced on this wire
24 /// shape.
25 pub safe_to_delete: bool,
26}