2026-03-09 08:48:05 +01:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
2026-03-10 11:08:17 +01:00
|
|
|
use crate::NodeArtifactFile;
|
2026-03-09 08:48:05 +01:00
|
|
|
|
|
|
|
|
/// Top-level cfgsync bundle containing per-node file payloads.
|
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
2026-03-10 11:08:17 +01:00
|
|
|
pub struct NodeArtifactsBundle {
|
|
|
|
|
pub nodes: Vec<NodeArtifactsBundleEntry>,
|
2026-03-09 08:48:05 +01:00
|
|
|
}
|
|
|
|
|
|
2026-03-10 11:08:17 +01:00
|
|
|
impl NodeArtifactsBundle {
|
2026-03-09 08:48:05 +01:00
|
|
|
#[must_use]
|
2026-03-10 11:08:17 +01:00
|
|
|
pub fn new(nodes: Vec<NodeArtifactsBundleEntry>) -> Self {
|
2026-03-09 08:48:05 +01:00
|
|
|
Self { nodes }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Artifact set for a single node resolved by identifier.
|
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
2026-03-10 11:08:17 +01:00
|
|
|
pub struct NodeArtifactsBundleEntry {
|
2026-03-09 08:48:05 +01:00
|
|
|
/// Stable node identifier used by cfgsync lookup.
|
|
|
|
|
pub identifier: String,
|
|
|
|
|
/// Files that should be materialized for the node.
|
|
|
|
|
#[serde(default)]
|
2026-03-10 11:08:17 +01:00
|
|
|
pub files: Vec<NodeArtifactFile>,
|
2026-03-09 08:48:05 +01:00
|
|
|
}
|