manta_shared/types/api/runtime_configuration.rs
1//! HTTP request/response bodies for the runtime-configuration endpoint
2//! (`PUT /v2/runtime-configuration`).
3
4use serde::{Deserialize, Serialize};
5use utoipa::ToSchema;
6
7/// Request body for `PUT /v2/runtime-configuration`.
8///
9/// Assigns a CFS configuration as the `desired_configuration` on every
10/// CFS component matching `hosts_expression`, and sets the component's
11/// `enabled` flag. Idempotent: the same request repeated leaves the
12/// nodes in the same state.
13///
14/// # Wire shape
15///
16/// ```json
17/// {
18/// "cfs_configuration_name": "base-mc-compute-config-cscs-26.3.0-pa",
19/// "hosts_expression": "x8000c1s0b1n[0-3]",
20/// "enabled": true,
21/// "dry_run": false
22/// }
23/// ```
24#[derive(Debug, Serialize, Deserialize, ToSchema)]
25pub struct ApplyRuntimeConfigurationRequest {
26 /// CFS configuration name to write as each component's
27 /// `desired_configuration`. Must already exist in CFS.
28 pub cfs_configuration_name: String,
29 /// Hosts expression (xnames, NIDs, or hostlist notation) naming
30 /// the target nodes. HSM group names are not accepted here.
31 pub hosts_expression: String,
32 /// Value to set on each targeted CFS component's `enabled` flag.
33 /// `true` lets CFS reconfigure on its next pass; `false` stages
34 /// the desired configuration without triggering CFS.
35 pub enabled: bool,
36 /// When true, run all validations (hosts resolve, access check,
37 /// configuration existence) but skip the final CFS component
38 /// PATCH. The response still echoes the resolved xname list and
39 /// the configuration/enabled values that *would* have been
40 /// written, with `applied: false` and `dry_run: true`.
41 #[serde(default)]
42 pub dry_run: bool,
43}