dora_message/
cli_to_coordinator.rs

1use std::{collections::BTreeMap, path::PathBuf, time::Duration};
2
3use uuid::Uuid;
4
5use crate::{
6    common::GitSource,
7    descriptor::Descriptor,
8    id::{NodeId, OperatorId},
9    BuildId, SessionId,
10};
11
12#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
13pub enum ControlRequest {
14    Build {
15        session_id: SessionId,
16        dataflow: Descriptor,
17        git_sources: BTreeMap<NodeId, GitSource>,
18        prev_git_sources: BTreeMap<NodeId, GitSource>,
19        /// Allows overwriting the base working dir when CLI and daemon are
20        /// running on the same machine.
21        ///
22        /// Must not be used for multi-machine dataflows.
23        ///
24        /// Note that nodes with git sources still use a subdirectory of
25        /// the base working dir.
26        local_working_dir: Option<PathBuf>,
27        uv: bool,
28    },
29    WaitForBuild {
30        build_id: BuildId,
31    },
32    Start {
33        build_id: Option<BuildId>,
34        session_id: SessionId,
35        dataflow: Descriptor,
36        name: Option<String>,
37        /// Allows overwriting the base working dir when CLI and daemon are
38        /// running on the same machine.
39        ///
40        /// Must not be used for multi-machine dataflows.
41        ///
42        /// Note that nodes with git sources still use a subdirectory of
43        /// the base working dir.
44        local_working_dir: Option<PathBuf>,
45        uv: bool,
46    },
47    WaitForSpawn {
48        dataflow_id: Uuid,
49    },
50    Reload {
51        dataflow_id: Uuid,
52        node_id: NodeId,
53        operator_id: Option<OperatorId>,
54    },
55    Check {
56        dataflow_uuid: Uuid,
57    },
58    Stop {
59        dataflow_uuid: Uuid,
60        grace_duration: Option<Duration>,
61    },
62    StopByName {
63        name: String,
64        grace_duration: Option<Duration>,
65    },
66    Logs {
67        uuid: Option<Uuid>,
68        name: Option<String>,
69        node: String,
70    },
71    Destroy,
72    List,
73    DaemonConnected,
74    ConnectedMachines,
75    LogSubscribe {
76        dataflow_id: Uuid,
77        level: log::LevelFilter,
78    },
79    BuildLogSubscribe {
80        build_id: BuildId,
81        level: log::LevelFilter,
82    },
83    CliAndDefaultDaemonOnSameMachine,
84}