Skip to main content

manta_shared/shared/params/
sat_file.rs

1//! Parameters for `POST /sat-file`.
2
3/// Parameters for applying a SAT file.
4//
5// Seven bools — `reboot`, `watch_logs`, `timestamps`, `image_only`,
6// `session_template_only`, `overwrite`, `dry_run`. `image_only` and
7// `session_template_only` are mutually exclusive and could be a
8// 3-variant enum, but doing so would break the HTTP request body and
9// the CLI flag surface; the rest are independent. Tracked as a future
10// API refactor — for now silence the `struct_excessive_bools` lint.
11#[allow(clippy::struct_excessive_bools)]
12pub struct ApplySatFileParams<'a> {
13  /// Raw YAML body of the SAT file. May contain Jinja2 syntax that
14  /// the service layer renders against `values` and
15  /// `values_file_content` before parsing.
16  pub sat_file_content: &'a str,
17  /// Inline JSON object of Jinja2 variable overrides. Merged on top
18  /// of `values_file_content` when both are supplied.
19  pub values: Option<&'a serde_json::Value>,
20  /// YAML body of a separate values file, supplying the lower-priority
21  /// half of the Jinja2 variable set.
22  pub values_file_content: Option<&'a str>,
23  /// Ansible verbosity level (0–4) passed to any CFS sessions
24  /// created by this SAT file.
25  pub ansible_verbosity: Option<u8>,
26  /// Extra arguments forwarded verbatim to `ansible-playbook`.
27  pub ansible_passthrough: Option<&'a str>,
28  /// When true, reboot affected nodes after the session templates
29  /// are applied.
30  pub reboot: bool,
31  /// When true, stream CFS session logs to the caller as part of
32  /// the response.
33  pub watch_logs: bool,
34  /// When true, prefix each streamed log line with its timestamp.
35  pub timestamps: bool,
36  /// Process only the `images` section of the SAT file; skip
37  /// session templates.
38  pub image_only: bool,
39  /// Process only the `session_templates` section; skip image
40  /// builds.
41  pub session_template_only: bool,
42  /// Overwrite existing CFS configurations or IMS images instead
43  /// of erroring on conflict.
44  pub overwrite: bool,
45  /// Render and validate the SAT file without creating any
46  /// resources.
47  pub dry_run: bool,
48}