dora_message/
cli_to_coordinator.rs

1use std::{collections::BTreeMap, path::PathBuf, time::Duration};
2
3use uuid::Uuid;
4
5use crate::{
6    BuildId, SessionId,
7    common::GitSource,
8    descriptor::Descriptor,
9    id::{NodeId, OperatorId},
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        write_events_to: Option<PathBuf>,
47    },
48    WaitForSpawn {
49        dataflow_id: Uuid,
50    },
51    Reload {
52        dataflow_id: Uuid,
53        node_id: NodeId,
54        operator_id: Option<OperatorId>,
55    },
56    Check {
57        dataflow_uuid: Uuid,
58    },
59    Stop {
60        dataflow_uuid: Uuid,
61        grace_duration: Option<Duration>,
62        #[serde(default)]
63        force: bool,
64    },
65    StopByName {
66        name: String,
67        grace_duration: Option<Duration>,
68        #[serde(default)]
69        force: bool,
70    },
71    Logs {
72        uuid: Option<Uuid>,
73        name: Option<String>,
74        node: String,
75        tail: Option<usize>,
76    },
77    Destroy,
78    List,
79    Info {
80        dataflow_uuid: Uuid,
81    },
82    DaemonConnected,
83    ConnectedMachines,
84    LogSubscribe {
85        dataflow_id: Uuid,
86        level: log::LevelFilter,
87    },
88    BuildLogSubscribe {
89        build_id: BuildId,
90        level: log::LevelFilter,
91    },
92    CliAndDefaultDaemonOnSameMachine,
93    GetNodeInfo,
94}