1#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct ClientStatusRequest {
5 #[prost(message, repeated, tag = "1")]
8 pub node_matchers: ::prost::alloc::vec::Vec<
9 super::super::super::r#type::matcher::v3::NodeMatcher,
10 >,
11 #[prost(message, optional, tag = "2")]
13 pub node: ::core::option::Option<super::super::super::config::core::v3::Node>,
14 #[prost(bool, tag = "3")]
18 pub exclude_resource_contents: bool,
19}
20impl ::prost::Name for ClientStatusRequest {
21 const NAME: &'static str = "ClientStatusRequest";
22 const PACKAGE: &'static str = "envoy.service.status.v3";
23 fn full_name() -> ::prost::alloc::string::String {
24 "envoy.service.status.v3.ClientStatusRequest".into()
25 }
26 fn type_url() -> ::prost::alloc::string::String {
27 "type.googleapis.com/envoy.service.status.v3.ClientStatusRequest".into()
28 }
29}
30#[derive(Clone, PartialEq, ::prost::Message)]
33pub struct PerXdsConfig {
34 #[prost(enumeration = "ConfigStatus", tag = "1")]
37 pub status: i32,
38 #[deprecated]
47 #[prost(enumeration = "ClientConfigStatus", tag = "7")]
48 pub client_status: i32,
49 #[prost(oneof = "per_xds_config::PerXdsConfig", tags = "2, 3, 4, 5, 6")]
50 pub per_xds_config: ::core::option::Option<per_xds_config::PerXdsConfig>,
51}
52pub mod per_xds_config {
54 #[derive(Clone, PartialEq, ::prost::Oneof)]
55 pub enum PerXdsConfig {
56 #[prost(message, tag = "2")]
57 ListenerConfig(super::super::super::super::admin::v3::ListenersConfigDump),
58 #[prost(message, tag = "3")]
59 ClusterConfig(super::super::super::super::admin::v3::ClustersConfigDump),
60 #[prost(message, tag = "4")]
61 RouteConfig(super::super::super::super::admin::v3::RoutesConfigDump),
62 #[prost(message, tag = "5")]
63 ScopedRouteConfig(super::super::super::super::admin::v3::ScopedRoutesConfigDump),
64 #[prost(message, tag = "6")]
65 EndpointConfig(super::super::super::super::admin::v3::EndpointsConfigDump),
66 }
67}
68impl ::prost::Name for PerXdsConfig {
69 const NAME: &'static str = "PerXdsConfig";
70 const PACKAGE: &'static str = "envoy.service.status.v3";
71 fn full_name() -> ::prost::alloc::string::String {
72 "envoy.service.status.v3.PerXdsConfig".into()
73 }
74 fn type_url() -> ::prost::alloc::string::String {
75 "type.googleapis.com/envoy.service.status.v3.PerXdsConfig".into()
76 }
77}
78#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct ClientConfig {
81 #[prost(message, optional, tag = "1")]
83 pub node: ::core::option::Option<super::super::super::config::core::v3::Node>,
84 #[deprecated]
87 #[prost(message, repeated, tag = "2")]
88 pub xds_config: ::prost::alloc::vec::Vec<PerXdsConfig>,
89 #[prost(message, repeated, tag = "3")]
92 pub generic_xds_configs: ::prost::alloc::vec::Vec<client_config::GenericXdsConfig>,
93 #[prost(string, tag = "4")]
97 pub client_scope: ::prost::alloc::string::String,
98}
99pub mod client_config {
101 #[derive(Clone, PartialEq, ::prost::Message)]
106 pub struct GenericXdsConfig {
107 #[prost(string, tag = "1")]
110 pub type_url: ::prost::alloc::string::String,
111 #[prost(string, tag = "2")]
113 pub name: ::prost::alloc::string::String,
114 #[prost(string, tag = "3")]
118 pub version_info: ::prost::alloc::string::String,
119 #[prost(message, optional, tag = "4")]
121 pub xds_config: ::core::option::Option<
122 super::super::super::super::super::google::protobuf::Any,
123 >,
124 #[prost(message, optional, tag = "5")]
126 pub last_updated: ::core::option::Option<
127 super::super::super::super::super::google::protobuf::Timestamp,
128 >,
129 #[prost(enumeration = "super::ConfigStatus", tag = "6")]
132 pub config_status: i32,
133 #[prost(
135 enumeration = "super::super::super::super::admin::v3::ClientResourceStatus",
136 tag = "7"
137 )]
138 pub client_status: i32,
139 #[prost(message, optional, tag = "8")]
146 pub error_state: ::core::option::Option<
147 super::super::super::super::admin::v3::UpdateFailureState,
148 >,
149 #[prost(bool, tag = "9")]
152 pub is_static_resource: bool,
153 }
154 impl ::prost::Name for GenericXdsConfig {
155 const NAME: &'static str = "GenericXdsConfig";
156 const PACKAGE: &'static str = "envoy.service.status.v3";
157 fn full_name() -> ::prost::alloc::string::String {
158 "envoy.service.status.v3.ClientConfig.GenericXdsConfig".into()
159 }
160 fn type_url() -> ::prost::alloc::string::String {
161 "type.googleapis.com/envoy.service.status.v3.ClientConfig.GenericXdsConfig"
162 .into()
163 }
164 }
165}
166impl ::prost::Name for ClientConfig {
167 const NAME: &'static str = "ClientConfig";
168 const PACKAGE: &'static str = "envoy.service.status.v3";
169 fn full_name() -> ::prost::alloc::string::String {
170 "envoy.service.status.v3.ClientConfig".into()
171 }
172 fn type_url() -> ::prost::alloc::string::String {
173 "type.googleapis.com/envoy.service.status.v3.ClientConfig".into()
174 }
175}
176#[derive(Clone, PartialEq, ::prost::Message)]
177pub struct ClientStatusResponse {
178 #[prost(message, repeated, tag = "1")]
180 pub config: ::prost::alloc::vec::Vec<ClientConfig>,
181}
182impl ::prost::Name for ClientStatusResponse {
183 const NAME: &'static str = "ClientStatusResponse";
184 const PACKAGE: &'static str = "envoy.service.status.v3";
185 fn full_name() -> ::prost::alloc::string::String {
186 "envoy.service.status.v3.ClientStatusResponse".into()
187 }
188 fn type_url() -> ::prost::alloc::string::String {
189 "type.googleapis.com/envoy.service.status.v3.ClientStatusResponse".into()
190 }
191}
192#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
194#[repr(i32)]
195pub enum ConfigStatus {
196 Unknown = 0,
198 Synced = 1,
200 NotSent = 2,
202 Stale = 3,
205 Error = 4,
209}
210impl ConfigStatus {
211 pub fn as_str_name(&self) -> &'static str {
216 match self {
217 Self::Unknown => "UNKNOWN",
218 Self::Synced => "SYNCED",
219 Self::NotSent => "NOT_SENT",
220 Self::Stale => "STALE",
221 Self::Error => "ERROR",
222 }
223 }
224 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
226 match value {
227 "UNKNOWN" => Some(Self::Unknown),
228 "SYNCED" => Some(Self::Synced),
229 "NOT_SENT" => Some(Self::NotSent),
230 "STALE" => Some(Self::Stale),
231 "ERROR" => Some(Self::Error),
232 _ => None,
233 }
234 }
235}
236#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
238#[repr(i32)]
239pub enum ClientConfigStatus {
240 ClientUnknown = 0,
242 ClientRequested = 1,
245 ClientAcked = 2,
247 ClientNacked = 3,
251}
252impl ClientConfigStatus {
253 pub fn as_str_name(&self) -> &'static str {
258 match self {
259 Self::ClientUnknown => "CLIENT_UNKNOWN",
260 Self::ClientRequested => "CLIENT_REQUESTED",
261 Self::ClientAcked => "CLIENT_ACKED",
262 Self::ClientNacked => "CLIENT_NACKED",
263 }
264 }
265 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
267 match value {
268 "CLIENT_UNKNOWN" => Some(Self::ClientUnknown),
269 "CLIENT_REQUESTED" => Some(Self::ClientRequested),
270 "CLIENT_ACKED" => Some(Self::ClientAcked),
271 "CLIENT_NACKED" => Some(Self::ClientNacked),
272 _ => None,
273 }
274 }
275}
276pub mod client_status_discovery_service_client {
278 #![allow(
279 unused_variables,
280 dead_code,
281 missing_docs,
282 clippy::wildcard_imports,
283 clippy::let_unit_value,
284 )]
285 use tonic::codegen::*;
286 use tonic::codegen::http::Uri;
287 #[derive(Debug, Clone)]
291 pub struct ClientStatusDiscoveryServiceClient<T> {
292 inner: tonic::client::Grpc<T>,
293 }
294 impl<T> ClientStatusDiscoveryServiceClient<T>
295 where
296 T: tonic::client::GrpcService<tonic::body::BoxBody>,
297 T::Error: Into<StdError>,
298 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
299 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
300 {
301 pub fn new(inner: T) -> Self {
302 let inner = tonic::client::Grpc::new(inner);
303 Self { inner }
304 }
305 pub fn with_origin(inner: T, origin: Uri) -> Self {
306 let inner = tonic::client::Grpc::with_origin(inner, origin);
307 Self { inner }
308 }
309 pub fn with_interceptor<F>(
310 inner: T,
311 interceptor: F,
312 ) -> ClientStatusDiscoveryServiceClient<InterceptedService<T, F>>
313 where
314 F: tonic::service::Interceptor,
315 T::ResponseBody: Default,
316 T: tonic::codegen::Service<
317 http::Request<tonic::body::BoxBody>,
318 Response = http::Response<
319 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
320 >,
321 >,
322 <T as tonic::codegen::Service<
323 http::Request<tonic::body::BoxBody>,
324 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
325 {
326 ClientStatusDiscoveryServiceClient::new(
327 InterceptedService::new(inner, interceptor),
328 )
329 }
330 #[must_use]
335 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
336 self.inner = self.inner.send_compressed(encoding);
337 self
338 }
339 #[must_use]
341 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
342 self.inner = self.inner.accept_compressed(encoding);
343 self
344 }
345 #[must_use]
349 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
350 self.inner = self.inner.max_decoding_message_size(limit);
351 self
352 }
353 #[must_use]
357 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
358 self.inner = self.inner.max_encoding_message_size(limit);
359 self
360 }
361 pub async fn stream_client_status(
362 &mut self,
363 request: impl tonic::IntoStreamingRequest<
364 Message = super::ClientStatusRequest,
365 >,
366 ) -> std::result::Result<
367 tonic::Response<tonic::codec::Streaming<super::ClientStatusResponse>>,
368 tonic::Status,
369 > {
370 self.inner
371 .ready()
372 .await
373 .map_err(|e| {
374 tonic::Status::unknown(
375 format!("Service was not ready: {}", e.into()),
376 )
377 })?;
378 let codec = tonic::codec::ProstCodec::default();
379 let path = http::uri::PathAndQuery::from_static(
380 "/envoy.service.status.v3.ClientStatusDiscoveryService/StreamClientStatus",
381 );
382 let mut req = request.into_streaming_request();
383 req.extensions_mut()
384 .insert(
385 GrpcMethod::new(
386 "envoy.service.status.v3.ClientStatusDiscoveryService",
387 "StreamClientStatus",
388 ),
389 );
390 self.inner.streaming(req, path, codec).await
391 }
392 pub async fn fetch_client_status(
393 &mut self,
394 request: impl tonic::IntoRequest<super::ClientStatusRequest>,
395 ) -> std::result::Result<
396 tonic::Response<super::ClientStatusResponse>,
397 tonic::Status,
398 > {
399 self.inner
400 .ready()
401 .await
402 .map_err(|e| {
403 tonic::Status::unknown(
404 format!("Service was not ready: {}", e.into()),
405 )
406 })?;
407 let codec = tonic::codec::ProstCodec::default();
408 let path = http::uri::PathAndQuery::from_static(
409 "/envoy.service.status.v3.ClientStatusDiscoveryService/FetchClientStatus",
410 );
411 let mut req = request.into_request();
412 req.extensions_mut()
413 .insert(
414 GrpcMethod::new(
415 "envoy.service.status.v3.ClientStatusDiscoveryService",
416 "FetchClientStatus",
417 ),
418 );
419 self.inner.unary(req, path, codec).await
420 }
421 }
422}
423pub mod client_status_discovery_service_server {
425 #![allow(
426 unused_variables,
427 dead_code,
428 missing_docs,
429 clippy::wildcard_imports,
430 clippy::let_unit_value,
431 )]
432 use tonic::codegen::*;
433 #[async_trait]
435 pub trait ClientStatusDiscoveryService: std::marker::Send + std::marker::Sync + 'static {
436 type StreamClientStatusStream: tonic::codegen::tokio_stream::Stream<
438 Item = std::result::Result<super::ClientStatusResponse, tonic::Status>,
439 >
440 + std::marker::Send
441 + 'static;
442 async fn stream_client_status(
443 &self,
444 request: tonic::Request<tonic::Streaming<super::ClientStatusRequest>>,
445 ) -> std::result::Result<
446 tonic::Response<Self::StreamClientStatusStream>,
447 tonic::Status,
448 >;
449 async fn fetch_client_status(
450 &self,
451 request: tonic::Request<super::ClientStatusRequest>,
452 ) -> std::result::Result<
453 tonic::Response<super::ClientStatusResponse>,
454 tonic::Status,
455 >;
456 }
457 #[derive(Debug)]
461 pub struct ClientStatusDiscoveryServiceServer<T> {
462 inner: Arc<T>,
463 accept_compression_encodings: EnabledCompressionEncodings,
464 send_compression_encodings: EnabledCompressionEncodings,
465 max_decoding_message_size: Option<usize>,
466 max_encoding_message_size: Option<usize>,
467 }
468 impl<T> ClientStatusDiscoveryServiceServer<T> {
469 pub fn new(inner: T) -> Self {
470 Self::from_arc(Arc::new(inner))
471 }
472 pub fn from_arc(inner: Arc<T>) -> Self {
473 Self {
474 inner,
475 accept_compression_encodings: Default::default(),
476 send_compression_encodings: Default::default(),
477 max_decoding_message_size: None,
478 max_encoding_message_size: None,
479 }
480 }
481 pub fn with_interceptor<F>(
482 inner: T,
483 interceptor: F,
484 ) -> InterceptedService<Self, F>
485 where
486 F: tonic::service::Interceptor,
487 {
488 InterceptedService::new(Self::new(inner), interceptor)
489 }
490 #[must_use]
492 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
493 self.accept_compression_encodings.enable(encoding);
494 self
495 }
496 #[must_use]
498 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
499 self.send_compression_encodings.enable(encoding);
500 self
501 }
502 #[must_use]
506 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
507 self.max_decoding_message_size = Some(limit);
508 self
509 }
510 #[must_use]
514 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
515 self.max_encoding_message_size = Some(limit);
516 self
517 }
518 }
519 impl<T, B> tonic::codegen::Service<http::Request<B>>
520 for ClientStatusDiscoveryServiceServer<T>
521 where
522 T: ClientStatusDiscoveryService,
523 B: Body + std::marker::Send + 'static,
524 B::Error: Into<StdError> + std::marker::Send + 'static,
525 {
526 type Response = http::Response<tonic::body::BoxBody>;
527 type Error = std::convert::Infallible;
528 type Future = BoxFuture<Self::Response, Self::Error>;
529 fn poll_ready(
530 &mut self,
531 _cx: &mut Context<'_>,
532 ) -> Poll<std::result::Result<(), Self::Error>> {
533 Poll::Ready(Ok(()))
534 }
535 fn call(&mut self, req: http::Request<B>) -> Self::Future {
536 match req.uri().path() {
537 "/envoy.service.status.v3.ClientStatusDiscoveryService/StreamClientStatus" => {
538 #[allow(non_camel_case_types)]
539 struct StreamClientStatusSvc<T: ClientStatusDiscoveryService>(
540 pub Arc<T>,
541 );
542 impl<
543 T: ClientStatusDiscoveryService,
544 > tonic::server::StreamingService<super::ClientStatusRequest>
545 for StreamClientStatusSvc<T> {
546 type Response = super::ClientStatusResponse;
547 type ResponseStream = T::StreamClientStatusStream;
548 type Future = BoxFuture<
549 tonic::Response<Self::ResponseStream>,
550 tonic::Status,
551 >;
552 fn call(
553 &mut self,
554 request: tonic::Request<
555 tonic::Streaming<super::ClientStatusRequest>,
556 >,
557 ) -> Self::Future {
558 let inner = Arc::clone(&self.0);
559 let fut = async move {
560 <T as ClientStatusDiscoveryService>::stream_client_status(
561 &inner,
562 request,
563 )
564 .await
565 };
566 Box::pin(fut)
567 }
568 }
569 let accept_compression_encodings = self.accept_compression_encodings;
570 let send_compression_encodings = self.send_compression_encodings;
571 let max_decoding_message_size = self.max_decoding_message_size;
572 let max_encoding_message_size = self.max_encoding_message_size;
573 let inner = self.inner.clone();
574 let fut = async move {
575 let method = StreamClientStatusSvc(inner);
576 let codec = tonic::codec::ProstCodec::default();
577 let mut grpc = tonic::server::Grpc::new(codec)
578 .apply_compression_config(
579 accept_compression_encodings,
580 send_compression_encodings,
581 )
582 .apply_max_message_size_config(
583 max_decoding_message_size,
584 max_encoding_message_size,
585 );
586 let res = grpc.streaming(method, req).await;
587 Ok(res)
588 };
589 Box::pin(fut)
590 }
591 "/envoy.service.status.v3.ClientStatusDiscoveryService/FetchClientStatus" => {
592 #[allow(non_camel_case_types)]
593 struct FetchClientStatusSvc<T: ClientStatusDiscoveryService>(
594 pub Arc<T>,
595 );
596 impl<
597 T: ClientStatusDiscoveryService,
598 > tonic::server::UnaryService<super::ClientStatusRequest>
599 for FetchClientStatusSvc<T> {
600 type Response = super::ClientStatusResponse;
601 type Future = BoxFuture<
602 tonic::Response<Self::Response>,
603 tonic::Status,
604 >;
605 fn call(
606 &mut self,
607 request: tonic::Request<super::ClientStatusRequest>,
608 ) -> Self::Future {
609 let inner = Arc::clone(&self.0);
610 let fut = async move {
611 <T as ClientStatusDiscoveryService>::fetch_client_status(
612 &inner,
613 request,
614 )
615 .await
616 };
617 Box::pin(fut)
618 }
619 }
620 let accept_compression_encodings = self.accept_compression_encodings;
621 let send_compression_encodings = self.send_compression_encodings;
622 let max_decoding_message_size = self.max_decoding_message_size;
623 let max_encoding_message_size = self.max_encoding_message_size;
624 let inner = self.inner.clone();
625 let fut = async move {
626 let method = FetchClientStatusSvc(inner);
627 let codec = tonic::codec::ProstCodec::default();
628 let mut grpc = tonic::server::Grpc::new(codec)
629 .apply_compression_config(
630 accept_compression_encodings,
631 send_compression_encodings,
632 )
633 .apply_max_message_size_config(
634 max_decoding_message_size,
635 max_encoding_message_size,
636 );
637 let res = grpc.unary(method, req).await;
638 Ok(res)
639 };
640 Box::pin(fut)
641 }
642 _ => {
643 Box::pin(async move {
644 let mut response = http::Response::new(empty_body());
645 let headers = response.headers_mut();
646 headers
647 .insert(
648 tonic::Status::GRPC_STATUS,
649 (tonic::Code::Unimplemented as i32).into(),
650 );
651 headers
652 .insert(
653 http::header::CONTENT_TYPE,
654 tonic::metadata::GRPC_CONTENT_TYPE,
655 );
656 Ok(response)
657 })
658 }
659 }
660 }
661 }
662 impl<T> Clone for ClientStatusDiscoveryServiceServer<T> {
663 fn clone(&self) -> Self {
664 let inner = self.inner.clone();
665 Self {
666 inner,
667 accept_compression_encodings: self.accept_compression_encodings,
668 send_compression_encodings: self.send_compression_encodings,
669 max_decoding_message_size: self.max_decoding_message_size,
670 max_encoding_message_size: self.max_encoding_message_size,
671 }
672 }
673 }
674 pub const SERVICE_NAME: &str = "envoy.service.status.v3.ClientStatusDiscoveryService";
676 impl<T> tonic::server::NamedService for ClientStatusDiscoveryServiceServer<T> {
677 const NAME: &'static str = SERVICE_NAME;
678 }
679}