manta_shared/types/api/
analysis.rs

1//! Wire shape for `GET /api/v1/analysis/images`.
2//!
3//! Each `BackendSummary` is one row in an image-centric projection of
4//! the four backend resource lists. See the field-population rules in
5//! the implementation plan for how each column is derived.
6
7use serde::{Deserialize, Serialize};
8use utoipa::ToSchema;
9
10/// One row of the backend-data summary, anchored on an IMS image.
11///
12/// Every IMS image visible to the caller produces exactly one row.
13/// The row's `image_id` and `name` are always populated; the rest are
14/// `Option<String>` and are filled in only when the corresponding
15/// relation resolves.
16///
17/// See also [`super::configuration_analysis::ConfigurationAnalysis`]
18/// for the parallel configuration-centric projection.
19///
20/// # Wire shape
21///
22/// ```json
23/// {
24///   "image_id": "0a1b2c3d-...",
25///   "name": "compute-cos-2.5",
26///   "image_created": "2026-05-12T10:14:22Z",
27///   "configuration_name": "cos-2.5",
28///   "safe_to_delete": false
29/// }
30/// ```
31#[derive(Debug, Serialize, Deserialize, ToSchema)]
32pub struct BackendSummary {
33  /// IMS image id (`Image.id`). Row anchor.
34  pub image_id: String,
35  /// IMS image name (`Image.name`).
36  pub name: String,
37  /// IMS image `created` timestamp (`Image.created`).
38  pub image_created: Option<String>,
39  /// CFS configuration the image was built with
40  /// (`Image.configuration`).
41  pub configuration_name: Option<String>,
42  /// `true` if no BSS boot-parameter record references this image as
43  /// its boot image. An image referenced by BSS is currently booting
44  /// (or scheduled to boot) at least one node, so deleting it would
45  /// break that node's next boot.
46  pub safe_to_delete: bool,
47}