vitess_grpc/generated/
automation.rs

1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct ClusterOperation {
4    #[prost(string, tag = "1")]
5    pub id: ::prost::alloc::string::String,
6    /// TaskContainer are processed sequentially, one at a time.
7    #[prost(message, repeated, tag = "2")]
8    pub serial_tasks: ::prost::alloc::vec::Vec<TaskContainer>,
9    /// Cached value. This has to be re-evaluated e.g. after a checkpoint load because running tasks may have already finished.
10    #[prost(enumeration = "ClusterOperationState", tag = "3")]
11    pub state: i32,
12    /// Error of the first task which failed. Set after state advanced to CLUSTER_OPERATION_DONE. If empty, all tasks succeeded. Cached value, see state above.
13    #[prost(string, tag = "4")]
14    pub error: ::prost::alloc::string::String,
15}
16/// TaskContainer holds one or more task which may be executed in parallel.
17/// "concurrency", if > 0, limits the amount of concurrently executed tasks.
18#[allow(clippy::derive_partial_eq_without_eq)]
19#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct TaskContainer {
21    #[prost(message, repeated, tag = "1")]
22    pub parallel_tasks: ::prost::alloc::vec::Vec<Task>,
23    #[prost(int32, tag = "2")]
24    pub concurrency: i32,
25}
26/// Task represents a specific task which should be automatically executed.
27#[allow(clippy::derive_partial_eq_without_eq)]
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct Task {
30    /// Task specification.
31    #[prost(string, tag = "1")]
32    pub name: ::prost::alloc::string::String,
33    #[prost(map = "string, string", tag = "2")]
34    pub parameters: ::std::collections::HashMap<
35        ::prost::alloc::string::String,
36        ::prost::alloc::string::String,
37    >,
38    /// Runtime data.
39    #[prost(string, tag = "3")]
40    pub id: ::prost::alloc::string::String,
41    #[prost(enumeration = "TaskState", tag = "4")]
42    pub state: i32,
43    /// Set after state advanced to DONE.
44    #[prost(string, tag = "5")]
45    pub output: ::prost::alloc::string::String,
46    /// Set after state advanced to DONE. If empty, the task did succeed.
47    #[prost(string, tag = "6")]
48    pub error: ::prost::alloc::string::String,
49}
50#[allow(clippy::derive_partial_eq_without_eq)]
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct EnqueueClusterOperationRequest {
53    #[prost(string, tag = "1")]
54    pub name: ::prost::alloc::string::String,
55    #[prost(map = "string, string", tag = "2")]
56    pub parameters: ::std::collections::HashMap<
57        ::prost::alloc::string::String,
58        ::prost::alloc::string::String,
59    >,
60}
61#[allow(clippy::derive_partial_eq_without_eq)]
62#[derive(Clone, PartialEq, ::prost::Message)]
63pub struct EnqueueClusterOperationResponse {
64    #[prost(string, tag = "1")]
65    pub id: ::prost::alloc::string::String,
66}
67#[allow(clippy::derive_partial_eq_without_eq)]
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct GetClusterOperationStateRequest {
70    #[prost(string, tag = "1")]
71    pub id: ::prost::alloc::string::String,
72}
73#[allow(clippy::derive_partial_eq_without_eq)]
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct GetClusterOperationStateResponse {
76    #[prost(enumeration = "ClusterOperationState", tag = "1")]
77    pub state: i32,
78}
79#[allow(clippy::derive_partial_eq_without_eq)]
80#[derive(Clone, PartialEq, ::prost::Message)]
81pub struct GetClusterOperationDetailsRequest {
82    #[prost(string, tag = "1")]
83    pub id: ::prost::alloc::string::String,
84}
85#[allow(clippy::derive_partial_eq_without_eq)]
86#[derive(Clone, PartialEq, ::prost::Message)]
87pub struct GetClusterOperationDetailsResponse {
88    /// Full snapshot of the execution e.g. including output of each task.
89    #[prost(message, optional, tag = "2")]
90    pub cluster_op: ::core::option::Option<ClusterOperation>,
91}
92#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
93#[repr(i32)]
94pub enum ClusterOperationState {
95    UnknownClusterOperationState = 0,
96    ClusterOperationNotStarted = 1,
97    ClusterOperationRunning = 2,
98    ClusterOperationDone = 3,
99}
100impl ClusterOperationState {
101    /// String value of the enum field names used in the ProtoBuf definition.
102    ///
103    /// The values are not transformed in any way and thus are considered stable
104    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
105    pub fn as_str_name(&self) -> &'static str {
106        match self {
107            ClusterOperationState::UnknownClusterOperationState => {
108                "UNKNOWN_CLUSTER_OPERATION_STATE"
109            }
110            ClusterOperationState::ClusterOperationNotStarted => {
111                "CLUSTER_OPERATION_NOT_STARTED"
112            }
113            ClusterOperationState::ClusterOperationRunning => "CLUSTER_OPERATION_RUNNING",
114            ClusterOperationState::ClusterOperationDone => "CLUSTER_OPERATION_DONE",
115        }
116    }
117    /// Creates an enum from field names used in the ProtoBuf definition.
118    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
119        match value {
120            "UNKNOWN_CLUSTER_OPERATION_STATE" => Some(Self::UnknownClusterOperationState),
121            "CLUSTER_OPERATION_NOT_STARTED" => Some(Self::ClusterOperationNotStarted),
122            "CLUSTER_OPERATION_RUNNING" => Some(Self::ClusterOperationRunning),
123            "CLUSTER_OPERATION_DONE" => Some(Self::ClusterOperationDone),
124            _ => None,
125        }
126    }
127}
128#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
129#[repr(i32)]
130pub enum TaskState {
131    UnknownTaskState = 0,
132    NotStarted = 1,
133    Running = 2,
134    Done = 3,
135}
136impl TaskState {
137    /// String value of the enum field names used in the ProtoBuf definition.
138    ///
139    /// The values are not transformed in any way and thus are considered stable
140    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
141    pub fn as_str_name(&self) -> &'static str {
142        match self {
143            TaskState::UnknownTaskState => "UNKNOWN_TASK_STATE",
144            TaskState::NotStarted => "NOT_STARTED",
145            TaskState::Running => "RUNNING",
146            TaskState::Done => "DONE",
147        }
148    }
149    /// Creates an enum from field names used in the ProtoBuf definition.
150    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
151        match value {
152            "UNKNOWN_TASK_STATE" => Some(Self::UnknownTaskState),
153            "NOT_STARTED" => Some(Self::NotStarted),
154            "RUNNING" => Some(Self::Running),
155            "DONE" => Some(Self::Done),
156            _ => None,
157        }
158    }
159}