manta_shared/types/api/
migrate.rs

1//! Wire types for the `POST /api/v1/migrate/*` endpoints.
2
3use serde::{Deserialize, Serialize};
4use utoipa::ToSchema;
5
6/// Request body for `POST /api/v1/migrate/nodes`.
7#[derive(Debug, Serialize, Deserialize, ToSchema)]
8pub struct MigrateNodesRequest {
9  /// Destination HSM group names to move nodes into.
10  pub target_hsm_names: Vec<String>,
11  /// Source HSM group names the nodes currently belong to.
12  pub parent_hsm_names: Vec<String>,
13  /// Node-set expression (xnames, NIDs, or hostlist notation)
14  /// selecting which nodes to migrate.
15  pub hosts_expression: String,
16  /// When true, validate the migration plan without modifying any
17  /// group membership.
18  #[serde(default)]
19  pub dry_run: bool,
20  /// Create the target HSM group if it does not already exist.
21  #[serde(default)]
22  pub create_hsm_group: bool,
23}
24
25/// Request body for `POST /api/v1/migrate/backup`.
26#[derive(Debug, Serialize, Deserialize, ToSchema)]
27pub struct MigrateBackupRequest {
28  /// BOS session template name (or filter) to back up.
29  pub bos: Option<String>,
30  /// Filesystem path where backup files will be written.
31  pub destination: Option<String>,
32}
33
34/// Request body for `POST /api/v1/migrate/restore`.
35#[derive(Debug, Serialize, Deserialize, ToSchema)]
36pub struct MigrateRestoreRequest {
37  /// Path to the BOS session template backup file.
38  pub bos_file: Option<String>,
39  /// Path to the CFS configuration backup file.
40  pub cfs_file: Option<String>,
41  /// Path to the HSM group backup file.
42  pub hsm_file: Option<String>,
43  /// Path to the IMS image metadata backup file.
44  pub ims_file: Option<String>,
45  /// Directory containing the image layer tarballs.
46  pub image_dir: Option<String>,
47  /// When true, overwrite existing resources that conflict with the
48  /// backup.
49  #[serde(default)]
50  pub overwrite: bool,
51}