manta_shared/types/wire/session.rs
1//! Wire types for `POST /api/v1/sessions` (create a CFS session from
2//! one or more git repositories).
3
4use serde::{Deserialize, Serialize};
5use utoipa::ToSchema;
6
7/// Request body for `POST /api/v1/sessions`.
8///
9/// The CLI submits this when the user runs `manta run session`; the
10/// server deserialises it in `handlers::session::create_session`.
11/// `repo_names` and `repo_last_commit_ids` are parallel-indexed —
12/// `repo_last_commit_ids[i]` is the commit SHA for `repo_names[i]`.
13#[derive(Debug, Serialize, Deserialize, ToSchema)]
14pub struct CreateSessionRequest {
15 /// Explicit name for the CFS session and configuration;
16 /// auto-generated when absent.
17 pub cfs_conf_sess_name: Option<String>,
18 /// Ansible playbook filename inside the repository.
19 pub playbook_yaml_file_name: Option<String>,
20 /// Target HSM group name.
21 pub hsm_group: Option<String>,
22 /// Git repository names (parallel-indexed with
23 /// `repo_last_commit_ids`).
24 pub repo_names: Vec<String>,
25 /// Git commit SHAs matching each entry in `repo_names`.
26 pub repo_last_commit_ids: Vec<String>,
27 /// Ansible `--limit` expression restricting which xnames are
28 /// targeted (the service-layer authz check rejects group names —
29 /// pre-resolve them client-side).
30 pub ansible_limit: Option<String>,
31 /// Ansible verbosity level (e.g. `"-v"`, `"-vvv"`).
32 pub ansible_verbosity: Option<String>,
33 /// Extra arguments forwarded verbatim to `ansible-playbook`.
34 pub ansible_passthrough: Option<String>,
35}