1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct StartRequest {
4 #[prost(string, repeated, tag = "1")]
5 pub mysqld_args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6}
7#[allow(clippy::derive_partial_eq_without_eq)]
8#[derive(Clone, PartialEq, ::prost::Message)]
9pub struct StartResponse {}
10#[allow(clippy::derive_partial_eq_without_eq)]
11#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct ShutdownRequest {
13 #[prost(bool, tag = "1")]
14 pub wait_for_mysqld: bool,
15}
16#[allow(clippy::derive_partial_eq_without_eq)]
17#[derive(Clone, PartialEq, ::prost::Message)]
18pub struct ShutdownResponse {}
19#[allow(clippy::derive_partial_eq_without_eq)]
20#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct RunMysqlUpgradeRequest {}
22#[allow(clippy::derive_partial_eq_without_eq)]
23#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct RunMysqlUpgradeResponse {}
25#[allow(clippy::derive_partial_eq_without_eq)]
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct ApplyBinlogFileRequest {
28 #[prost(string, tag = "1")]
29 pub binlog_file_name: ::prost::alloc::string::String,
30 #[prost(string, tag = "2")]
31 pub binlog_restore_position: ::prost::alloc::string::String,
32 #[prost(message, optional, tag = "3")]
33 pub binlog_restore_datetime: ::core::option::Option<super::vttime::Time>,
34}
35#[allow(clippy::derive_partial_eq_without_eq)]
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct ApplyBinlogFileResponse {}
38#[allow(clippy::derive_partial_eq_without_eq)]
39#[derive(Clone, PartialEq, ::prost::Message)]
40pub struct ReadBinlogFilesTimestampsRequest {
41 #[prost(string, repeated, tag = "1")]
42 pub binlog_file_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
43}
44#[allow(clippy::derive_partial_eq_without_eq)]
45#[derive(Clone, PartialEq, ::prost::Message)]
46pub struct ReadBinlogFilesTimestampsResponse {
47 #[prost(message, optional, tag = "1")]
49 pub first_timestamp: ::core::option::Option<super::vttime::Time>,
50 #[prost(string, tag = "2")]
52 pub first_timestamp_binlog: ::prost::alloc::string::String,
53 #[prost(message, optional, tag = "3")]
55 pub last_timestamp: ::core::option::Option<super::vttime::Time>,
56 #[prost(string, tag = "4")]
58 pub last_timestamp_binlog: ::prost::alloc::string::String,
59}
60#[allow(clippy::derive_partial_eq_without_eq)]
61#[derive(Clone, PartialEq, ::prost::Message)]
62pub struct ReinitConfigRequest {}
63#[allow(clippy::derive_partial_eq_without_eq)]
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct ReinitConfigResponse {}
66#[allow(clippy::derive_partial_eq_without_eq)]
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct RefreshConfigRequest {}
69#[allow(clippy::derive_partial_eq_without_eq)]
70#[derive(Clone, PartialEq, ::prost::Message)]
71pub struct RefreshConfigResponse {}
72#[allow(clippy::derive_partial_eq_without_eq)]
73#[derive(Clone, PartialEq, ::prost::Message)]
74pub struct VersionStringRequest {}
75#[allow(clippy::derive_partial_eq_without_eq)]
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct VersionStringResponse {
78 #[prost(string, tag = "1")]
79 pub version: ::prost::alloc::string::String,
80}
81#[allow(clippy::derive_partial_eq_without_eq)]
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct BackupInfo {
85 #[prost(string, tag = "1")]
86 pub name: ::prost::alloc::string::String,
87 #[prost(string, tag = "2")]
88 pub directory: ::prost::alloc::string::String,
89 #[prost(string, tag = "3")]
90 pub keyspace: ::prost::alloc::string::String,
91 #[prost(string, tag = "4")]
92 pub shard: ::prost::alloc::string::String,
93 #[prost(message, optional, tag = "5")]
94 pub tablet_alias: ::core::option::Option<super::topodata::TabletAlias>,
95 #[prost(message, optional, tag = "6")]
96 pub time: ::core::option::Option<super::vttime::Time>,
97 #[prost(string, tag = "7")]
100 pub engine: ::prost::alloc::string::String,
101 #[prost(enumeration = "backup_info::Status", tag = "8")]
102 pub status: i32,
103}
104pub mod backup_info {
106 #[derive(
108 Clone,
109 Copy,
110 Debug,
111 PartialEq,
112 Eq,
113 Hash,
114 PartialOrd,
115 Ord,
116 ::prost::Enumeration
117 )]
118 #[repr(i32)]
119 pub enum Status {
120 Unknown = 0,
121 Incomplete = 1,
122 Complete = 2,
123 Invalid = 3,
126 Valid = 4,
129 }
130 impl Status {
131 pub fn as_str_name(&self) -> &'static str {
136 match self {
137 Status::Unknown => "UNKNOWN",
138 Status::Incomplete => "INCOMPLETE",
139 Status::Complete => "COMPLETE",
140 Status::Invalid => "INVALID",
141 Status::Valid => "VALID",
142 }
143 }
144 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
146 match value {
147 "UNKNOWN" => Some(Self::Unknown),
148 "INCOMPLETE" => Some(Self::Incomplete),
149 "COMPLETE" => Some(Self::Complete),
150 "INVALID" => Some(Self::Invalid),
151 "VALID" => Some(Self::Valid),
152 _ => None,
153 }
154 }
155 }
156}
157pub mod mysql_ctl_client {
159 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
160 use tonic::codegen::*;
161 use tonic::codegen::http::Uri;
162 #[derive(Debug, Clone)]
164 pub struct MysqlCtlClient<T> {
165 inner: tonic::client::Grpc<T>,
166 }
167 impl MysqlCtlClient<tonic::transport::Channel> {
168 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
170 where
171 D: TryInto<tonic::transport::Endpoint>,
172 D::Error: Into<StdError>,
173 {
174 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
175 Ok(Self::new(conn))
176 }
177 }
178 impl<T> MysqlCtlClient<T>
179 where
180 T: tonic::client::GrpcService<tonic::body::BoxBody>,
181 T::Error: Into<StdError>,
182 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
183 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
184 {
185 pub fn new(inner: T) -> Self {
186 let inner = tonic::client::Grpc::new(inner);
187 Self { inner }
188 }
189 pub fn with_origin(inner: T, origin: Uri) -> Self {
190 let inner = tonic::client::Grpc::with_origin(inner, origin);
191 Self { inner }
192 }
193 pub fn with_interceptor<F>(
194 inner: T,
195 interceptor: F,
196 ) -> MysqlCtlClient<InterceptedService<T, F>>
197 where
198 F: tonic::service::Interceptor,
199 T::ResponseBody: Default,
200 T: tonic::codegen::Service<
201 http::Request<tonic::body::BoxBody>,
202 Response = http::Response<
203 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
204 >,
205 >,
206 <T as tonic::codegen::Service<
207 http::Request<tonic::body::BoxBody>,
208 >>::Error: Into<StdError> + Send + Sync,
209 {
210 MysqlCtlClient::new(InterceptedService::new(inner, interceptor))
211 }
212 #[must_use]
217 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
218 self.inner = self.inner.send_compressed(encoding);
219 self
220 }
221 #[must_use]
223 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
224 self.inner = self.inner.accept_compressed(encoding);
225 self
226 }
227 #[must_use]
231 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
232 self.inner = self.inner.max_decoding_message_size(limit);
233 self
234 }
235 #[must_use]
239 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
240 self.inner = self.inner.max_encoding_message_size(limit);
241 self
242 }
243 pub async fn start(
244 &mut self,
245 request: impl tonic::IntoRequest<super::StartRequest>,
246 ) -> std::result::Result<tonic::Response<super::StartResponse>, tonic::Status> {
247 self.inner
248 .ready()
249 .await
250 .map_err(|e| {
251 tonic::Status::new(
252 tonic::Code::Unknown,
253 format!("Service was not ready: {}", e.into()),
254 )
255 })?;
256 let codec = tonic::codec::ProstCodec::default();
257 let path = http::uri::PathAndQuery::from_static("/mysqlctl.MysqlCtl/Start");
258 let mut req = request.into_request();
259 req.extensions_mut().insert(GrpcMethod::new("mysqlctl.MysqlCtl", "Start"));
260 self.inner.unary(req, path, codec).await
261 }
262 pub async fn shutdown(
263 &mut self,
264 request: impl tonic::IntoRequest<super::ShutdownRequest>,
265 ) -> std::result::Result<
266 tonic::Response<super::ShutdownResponse>,
267 tonic::Status,
268 > {
269 self.inner
270 .ready()
271 .await
272 .map_err(|e| {
273 tonic::Status::new(
274 tonic::Code::Unknown,
275 format!("Service was not ready: {}", e.into()),
276 )
277 })?;
278 let codec = tonic::codec::ProstCodec::default();
279 let path = http::uri::PathAndQuery::from_static(
280 "/mysqlctl.MysqlCtl/Shutdown",
281 );
282 let mut req = request.into_request();
283 req.extensions_mut()
284 .insert(GrpcMethod::new("mysqlctl.MysqlCtl", "Shutdown"));
285 self.inner.unary(req, path, codec).await
286 }
287 pub async fn run_mysql_upgrade(
288 &mut self,
289 request: impl tonic::IntoRequest<super::RunMysqlUpgradeRequest>,
290 ) -> std::result::Result<
291 tonic::Response<super::RunMysqlUpgradeResponse>,
292 tonic::Status,
293 > {
294 self.inner
295 .ready()
296 .await
297 .map_err(|e| {
298 tonic::Status::new(
299 tonic::Code::Unknown,
300 format!("Service was not ready: {}", e.into()),
301 )
302 })?;
303 let codec = tonic::codec::ProstCodec::default();
304 let path = http::uri::PathAndQuery::from_static(
305 "/mysqlctl.MysqlCtl/RunMysqlUpgrade",
306 );
307 let mut req = request.into_request();
308 req.extensions_mut()
309 .insert(GrpcMethod::new("mysqlctl.MysqlCtl", "RunMysqlUpgrade"));
310 self.inner.unary(req, path, codec).await
311 }
312 pub async fn apply_binlog_file(
313 &mut self,
314 request: impl tonic::IntoRequest<super::ApplyBinlogFileRequest>,
315 ) -> std::result::Result<
316 tonic::Response<super::ApplyBinlogFileResponse>,
317 tonic::Status,
318 > {
319 self.inner
320 .ready()
321 .await
322 .map_err(|e| {
323 tonic::Status::new(
324 tonic::Code::Unknown,
325 format!("Service was not ready: {}", e.into()),
326 )
327 })?;
328 let codec = tonic::codec::ProstCodec::default();
329 let path = http::uri::PathAndQuery::from_static(
330 "/mysqlctl.MysqlCtl/ApplyBinlogFile",
331 );
332 let mut req = request.into_request();
333 req.extensions_mut()
334 .insert(GrpcMethod::new("mysqlctl.MysqlCtl", "ApplyBinlogFile"));
335 self.inner.unary(req, path, codec).await
336 }
337 pub async fn read_binlog_files_timestamps(
338 &mut self,
339 request: impl tonic::IntoRequest<super::ReadBinlogFilesTimestampsRequest>,
340 ) -> std::result::Result<
341 tonic::Response<super::ReadBinlogFilesTimestampsResponse>,
342 tonic::Status,
343 > {
344 self.inner
345 .ready()
346 .await
347 .map_err(|e| {
348 tonic::Status::new(
349 tonic::Code::Unknown,
350 format!("Service was not ready: {}", e.into()),
351 )
352 })?;
353 let codec = tonic::codec::ProstCodec::default();
354 let path = http::uri::PathAndQuery::from_static(
355 "/mysqlctl.MysqlCtl/ReadBinlogFilesTimestamps",
356 );
357 let mut req = request.into_request();
358 req.extensions_mut()
359 .insert(
360 GrpcMethod::new("mysqlctl.MysqlCtl", "ReadBinlogFilesTimestamps"),
361 );
362 self.inner.unary(req, path, codec).await
363 }
364 pub async fn reinit_config(
365 &mut self,
366 request: impl tonic::IntoRequest<super::ReinitConfigRequest>,
367 ) -> std::result::Result<
368 tonic::Response<super::ReinitConfigResponse>,
369 tonic::Status,
370 > {
371 self.inner
372 .ready()
373 .await
374 .map_err(|e| {
375 tonic::Status::new(
376 tonic::Code::Unknown,
377 format!("Service was not ready: {}", e.into()),
378 )
379 })?;
380 let codec = tonic::codec::ProstCodec::default();
381 let path = http::uri::PathAndQuery::from_static(
382 "/mysqlctl.MysqlCtl/ReinitConfig",
383 );
384 let mut req = request.into_request();
385 req.extensions_mut()
386 .insert(GrpcMethod::new("mysqlctl.MysqlCtl", "ReinitConfig"));
387 self.inner.unary(req, path, codec).await
388 }
389 pub async fn refresh_config(
390 &mut self,
391 request: impl tonic::IntoRequest<super::RefreshConfigRequest>,
392 ) -> std::result::Result<
393 tonic::Response<super::RefreshConfigResponse>,
394 tonic::Status,
395 > {
396 self.inner
397 .ready()
398 .await
399 .map_err(|e| {
400 tonic::Status::new(
401 tonic::Code::Unknown,
402 format!("Service was not ready: {}", e.into()),
403 )
404 })?;
405 let codec = tonic::codec::ProstCodec::default();
406 let path = http::uri::PathAndQuery::from_static(
407 "/mysqlctl.MysqlCtl/RefreshConfig",
408 );
409 let mut req = request.into_request();
410 req.extensions_mut()
411 .insert(GrpcMethod::new("mysqlctl.MysqlCtl", "RefreshConfig"));
412 self.inner.unary(req, path, codec).await
413 }
414 pub async fn version_string(
415 &mut self,
416 request: impl tonic::IntoRequest<super::VersionStringRequest>,
417 ) -> std::result::Result<
418 tonic::Response<super::VersionStringResponse>,
419 tonic::Status,
420 > {
421 self.inner
422 .ready()
423 .await
424 .map_err(|e| {
425 tonic::Status::new(
426 tonic::Code::Unknown,
427 format!("Service was not ready: {}", e.into()),
428 )
429 })?;
430 let codec = tonic::codec::ProstCodec::default();
431 let path = http::uri::PathAndQuery::from_static(
432 "/mysqlctl.MysqlCtl/VersionString",
433 );
434 let mut req = request.into_request();
435 req.extensions_mut()
436 .insert(GrpcMethod::new("mysqlctl.MysqlCtl", "VersionString"));
437 self.inner.unary(req, path, codec).await
438 }
439 }
440}