1#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Location {
5 #[prost(message, optional, tag = "1")]
6 pub region: ::core::option::Option<::prost::alloc::string::String>,
7 #[prost(message, optional, tag = "2")]
8 pub zone: ::core::option::Option<::prost::alloc::string::String>,
9 #[prost(message, optional, tag = "3")]
10 pub campus: ::core::option::Option<::prost::alloc::string::String>,
11}
12#[allow(clippy::derive_partial_eq_without_eq)]
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct MatchString {
15 #[prost(enumeration = "match_string::MatchStringType", tag = "1")]
16 pub r#type: i32,
17 #[prost(message, optional, tag = "2")]
18 pub value: ::core::option::Option<::prost::alloc::string::String>,
19 #[prost(enumeration = "match_string::ValueType", tag = "3")]
20 pub value_type: i32,
21}
22pub mod match_string {
24 #[derive(
25 Clone,
26 Copy,
27 Debug,
28 PartialEq,
29 Eq,
30 Hash,
31 PartialOrd,
32 Ord,
33 ::prost::Enumeration
34 )]
35 #[repr(i32)]
36 pub enum MatchStringType {
37 Exact = 0,
39 Regex = 1,
41 NotEquals = 2,
43 In = 3,
45 NotIn = 4,
47 Range = 5,
49 }
50 impl MatchStringType {
51 pub fn as_str_name(&self) -> &'static str {
56 match self {
57 MatchStringType::Exact => "EXACT",
58 MatchStringType::Regex => "REGEX",
59 MatchStringType::NotEquals => "NOT_EQUALS",
60 MatchStringType::In => "IN",
61 MatchStringType::NotIn => "NOT_IN",
62 MatchStringType::Range => "RANGE",
63 }
64 }
65 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
67 match value {
68 "EXACT" => Some(Self::Exact),
69 "REGEX" => Some(Self::Regex),
70 "NOT_EQUALS" => Some(Self::NotEquals),
71 "IN" => Some(Self::In),
72 "NOT_IN" => Some(Self::NotIn),
73 "RANGE" => Some(Self::Range),
74 _ => None,
75 }
76 }
77 }
78 #[derive(
79 Clone,
80 Copy,
81 Debug,
82 PartialEq,
83 Eq,
84 Hash,
85 PartialOrd,
86 Ord,
87 ::prost::Enumeration
88 )]
89 #[repr(i32)]
90 pub enum ValueType {
91 Text = 0,
92 Parameter = 1,
93 Variable = 2,
94 }
95 impl ValueType {
96 pub fn as_str_name(&self) -> &'static str {
101 match self {
102 ValueType::Text => "TEXT",
103 ValueType::Parameter => "PARAMETER",
104 ValueType::Variable => "VARIABLE",
105 }
106 }
107 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
109 match value {
110 "TEXT" => Some(Self::Text),
111 "PARAMETER" => Some(Self::Parameter),
112 "VARIABLE" => Some(Self::Variable),
113 _ => None,
114 }
115 }
116 }
117}
118#[allow(clippy::derive_partial_eq_without_eq)]
119#[derive(Clone, PartialEq, ::prost::Message)]
120pub struct StringList {
121 #[prost(string, repeated, tag = "1")]
122 pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
123}
124#[allow(clippy::derive_partial_eq_without_eq)]
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct Summary {
128 #[prost(uint32, tag = "1")]
130 pub total_service_count: u32,
131 #[prost(uint32, tag = "2")]
133 pub total_health_instance_count: u32,
134 #[prost(uint32, tag = "3")]
136 pub total_instance_count: u32,
137}
138#[allow(clippy::derive_partial_eq_without_eq)]
139#[derive(Clone, PartialEq, ::prost::Message)]
140pub struct ClientLabel {
141 #[prost(string, tag = "1")]
142 pub key: ::prost::alloc::string::String,
143 #[prost(message, optional, tag = "2")]
144 pub value: ::core::option::Option<MatchString>,
145}
146#[allow(clippy::derive_partial_eq_without_eq)]
148#[derive(Clone, PartialEq, ::prost::Message)]
149pub struct Api {
150 #[prost(string, tag = "1")]
152 pub protocol: ::prost::alloc::string::String,
153 #[prost(string, tag = "2")]
155 pub method: ::prost::alloc::string::String,
156 #[prost(message, optional, tag = "3")]
158 pub path: ::core::option::Option<MatchString>,
159}
160#[allow(clippy::derive_partial_eq_without_eq)]
161#[derive(Clone, PartialEq, ::prost::Message)]
162pub struct Service {
163 #[prost(message, optional, tag = "1")]
164 pub name: ::core::option::Option<::prost::alloc::string::String>,
165 #[prost(message, optional, tag = "2")]
166 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
167 #[prost(map = "string, string", tag = "3")]
168 pub metadata: ::std::collections::HashMap<
169 ::prost::alloc::string::String,
170 ::prost::alloc::string::String,
171 >,
172 #[prost(message, optional, tag = "4")]
173 pub ports: ::core::option::Option<::prost::alloc::string::String>,
174 #[prost(message, optional, tag = "5")]
175 pub business: ::core::option::Option<::prost::alloc::string::String>,
176 #[prost(message, optional, tag = "6")]
177 pub department: ::core::option::Option<::prost::alloc::string::String>,
178 #[prost(message, optional, tag = "7")]
179 pub cmdb_mod1: ::core::option::Option<::prost::alloc::string::String>,
180 #[prost(message, optional, tag = "8")]
181 pub cmdb_mod2: ::core::option::Option<::prost::alloc::string::String>,
182 #[prost(message, optional, tag = "9")]
183 pub cmdb_mod3: ::core::option::Option<::prost::alloc::string::String>,
184 #[prost(message, optional, tag = "10")]
185 pub comment: ::core::option::Option<::prost::alloc::string::String>,
186 #[prost(message, optional, tag = "11")]
187 pub owners: ::core::option::Option<::prost::alloc::string::String>,
188 #[prost(message, optional, tag = "12")]
189 pub token: ::core::option::Option<::prost::alloc::string::String>,
190 #[prost(message, optional, tag = "13")]
191 pub ctime: ::core::option::Option<::prost::alloc::string::String>,
192 #[prost(message, optional, tag = "14")]
193 pub mtime: ::core::option::Option<::prost::alloc::string::String>,
194 #[prost(message, optional, tag = "15")]
195 pub revision: ::core::option::Option<::prost::alloc::string::String>,
196 #[prost(message, optional, tag = "16")]
197 pub platform_id: ::core::option::Option<::prost::alloc::string::String>,
198 #[prost(message, optional, tag = "17")]
199 pub total_instance_count: ::core::option::Option<u32>,
200 #[prost(message, optional, tag = "18")]
201 pub healthy_instance_count: ::core::option::Option<u32>,
202 #[prost(message, repeated, tag = "19")]
203 pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
204 #[prost(message, repeated, tag = "20")]
205 pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
206 #[prost(message, repeated, tag = "22")]
207 pub remove_user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
208 #[prost(message, repeated, tag = "23")]
209 pub remove_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
210 #[prost(message, optional, tag = "21")]
211 pub id: ::core::option::Option<::prost::alloc::string::String>,
212 #[prost(message, optional, tag = "24")]
213 pub editable: ::core::option::Option<bool>,
214 #[prost(message, repeated, tag = "25")]
215 pub export_to: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
216 #[prost(message, optional, tag = "26")]
217 pub deleteable: ::core::option::Option<bool>,
218}
219#[allow(clippy::derive_partial_eq_without_eq)]
220#[derive(Clone, PartialEq, ::prost::Message)]
221pub struct ServiceAlias {
222 #[prost(message, optional, tag = "1")]
223 pub service: ::core::option::Option<::prost::alloc::string::String>,
224 #[prost(message, optional, tag = "2")]
225 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
226 #[prost(message, optional, tag = "3")]
227 pub alias: ::core::option::Option<::prost::alloc::string::String>,
228 #[prost(message, optional, tag = "4")]
229 pub alias_namespace: ::core::option::Option<::prost::alloc::string::String>,
230 #[prost(enumeration = "AliasType", tag = "5")]
231 pub r#type: i32,
232 #[prost(message, optional, tag = "6")]
233 pub owners: ::core::option::Option<::prost::alloc::string::String>,
234 #[prost(message, optional, tag = "7")]
235 pub comment: ::core::option::Option<::prost::alloc::string::String>,
236 #[prost(message, optional, tag = "8")]
237 pub service_token: ::core::option::Option<::prost::alloc::string::String>,
238 #[prost(message, optional, tag = "9")]
239 pub ctime: ::core::option::Option<::prost::alloc::string::String>,
240 #[prost(message, optional, tag = "10")]
241 pub mtime: ::core::option::Option<::prost::alloc::string::String>,
242 #[prost(message, optional, tag = "11")]
243 pub id: ::core::option::Option<::prost::alloc::string::String>,
244 #[prost(message, optional, tag = "12")]
245 pub editable: ::core::option::Option<bool>,
246 #[prost(message, optional, tag = "13")]
247 pub deleteable: ::core::option::Option<bool>,
248}
249#[allow(clippy::derive_partial_eq_without_eq)]
250#[derive(Clone, PartialEq, ::prost::Message)]
251pub struct Instance {
252 #[prost(message, optional, tag = "1")]
253 pub id: ::core::option::Option<::prost::alloc::string::String>,
254 #[prost(message, optional, tag = "2")]
255 pub service: ::core::option::Option<::prost::alloc::string::String>,
256 #[prost(message, optional, tag = "3")]
257 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
258 #[prost(message, optional, tag = "21")]
259 pub vpc_id: ::core::option::Option<::prost::alloc::string::String>,
260 #[prost(message, optional, tag = "4")]
261 pub host: ::core::option::Option<::prost::alloc::string::String>,
262 #[prost(message, optional, tag = "5")]
263 pub port: ::core::option::Option<u32>,
264 #[prost(message, optional, tag = "6")]
265 pub protocol: ::core::option::Option<::prost::alloc::string::String>,
266 #[prost(message, optional, tag = "7")]
267 pub version: ::core::option::Option<::prost::alloc::string::String>,
268 #[prost(message, optional, tag = "8")]
269 pub priority: ::core::option::Option<u32>,
270 #[prost(message, optional, tag = "9")]
271 pub weight: ::core::option::Option<u32>,
272 #[prost(message, optional, tag = "20")]
273 pub enable_health_check: ::core::option::Option<bool>,
274 #[prost(message, optional, tag = "10")]
275 pub health_check: ::core::option::Option<HealthCheck>,
276 #[prost(message, optional, tag = "11")]
277 pub healthy: ::core::option::Option<bool>,
278 #[prost(message, optional, tag = "12")]
279 pub isolate: ::core::option::Option<bool>,
280 #[prost(message, optional, tag = "13")]
281 pub location: ::core::option::Option<Location>,
282 #[prost(map = "string, string", tag = "14")]
283 pub metadata: ::std::collections::HashMap<
284 ::prost::alloc::string::String,
285 ::prost::alloc::string::String,
286 >,
287 #[prost(message, optional, tag = "15")]
288 pub logic_set: ::core::option::Option<::prost::alloc::string::String>,
289 #[prost(message, optional, tag = "16")]
290 pub ctime: ::core::option::Option<::prost::alloc::string::String>,
291 #[prost(message, optional, tag = "17")]
292 pub mtime: ::core::option::Option<::prost::alloc::string::String>,
293 #[prost(message, optional, tag = "18")]
294 pub revision: ::core::option::Option<::prost::alloc::string::String>,
295 #[prost(message, optional, tag = "19")]
296 pub service_token: ::core::option::Option<::prost::alloc::string::String>,
297}
298#[allow(clippy::derive_partial_eq_without_eq)]
299#[derive(Clone, PartialEq, ::prost::Message)]
300pub struct HealthCheck {
301 #[prost(enumeration = "health_check::HealthCheckType", tag = "1")]
302 pub r#type: i32,
303 #[prost(message, optional, tag = "2")]
304 pub heartbeat: ::core::option::Option<HeartbeatHealthCheck>,
305}
306pub mod health_check {
308 #[derive(
309 Clone,
310 Copy,
311 Debug,
312 PartialEq,
313 Eq,
314 Hash,
315 PartialOrd,
316 Ord,
317 ::prost::Enumeration
318 )]
319 #[repr(i32)]
320 pub enum HealthCheckType {
321 Unknown = 0,
322 Heartbeat = 1,
323 }
324 impl HealthCheckType {
325 pub fn as_str_name(&self) -> &'static str {
330 match self {
331 HealthCheckType::Unknown => "UNKNOWN",
332 HealthCheckType::Heartbeat => "HEARTBEAT",
333 }
334 }
335 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
337 match value {
338 "UNKNOWN" => Some(Self::Unknown),
339 "HEARTBEAT" => Some(Self::Heartbeat),
340 _ => None,
341 }
342 }
343 }
344}
345#[allow(clippy::derive_partial_eq_without_eq)]
346#[derive(Clone, PartialEq, ::prost::Message)]
347pub struct HeartbeatHealthCheck {
348 #[prost(message, optional, tag = "1")]
349 pub ttl: ::core::option::Option<u32>,
350}
351#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
352#[repr(i32)]
353pub enum AliasType {
354 Default = 0,
355 Cl5sid = 1,
356}
357impl AliasType {
358 pub fn as_str_name(&self) -> &'static str {
363 match self {
364 AliasType::Default => "DEFAULT",
365 AliasType::Cl5sid => "CL5SID",
366 }
367 }
368 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
370 match value {
371 "DEFAULT" => Some(Self::Default),
372 "CL5SID" => Some(Self::Cl5sid),
373 _ => None,
374 }
375 }
376}
377#[allow(clippy::derive_partial_eq_without_eq)]
379#[derive(Clone, PartialEq, ::prost::Message)]
380pub struct CircuitBreaker {
381 #[prost(message, optional, tag = "1")]
383 pub id: ::core::option::Option<::prost::alloc::string::String>,
384 #[prost(message, optional, tag = "2")]
387 pub version: ::core::option::Option<::prost::alloc::string::String>,
388 #[prost(message, optional, tag = "3")]
391 pub name: ::core::option::Option<::prost::alloc::string::String>,
392 #[prost(message, optional, tag = "4")]
395 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
396 #[prost(message, optional, tag = "5")]
398 pub service: ::core::option::Option<::prost::alloc::string::String>,
399 #[prost(message, optional, tag = "6")]
400 pub service_namespace: ::core::option::Option<::prost::alloc::string::String>,
401 #[prost(message, repeated, tag = "7")]
406 pub inbounds: ::prost::alloc::vec::Vec<CbRule>,
407 #[prost(message, repeated, tag = "8")]
409 pub outbounds: ::prost::alloc::vec::Vec<CbRule>,
410 #[prost(message, optional, tag = "9")]
412 pub token: ::core::option::Option<::prost::alloc::string::String>,
413 #[prost(message, optional, tag = "10")]
415 pub owners: ::core::option::Option<::prost::alloc::string::String>,
416 #[prost(message, optional, tag = "11")]
419 pub business: ::core::option::Option<::prost::alloc::string::String>,
420 #[prost(message, optional, tag = "12")]
423 pub department: ::core::option::Option<::prost::alloc::string::String>,
424 #[prost(message, optional, tag = "13")]
427 pub comment: ::core::option::Option<::prost::alloc::string::String>,
428 #[prost(message, optional, tag = "14")]
430 pub ctime: ::core::option::Option<::prost::alloc::string::String>,
431 #[prost(message, optional, tag = "15")]
433 pub mtime: ::core::option::Option<::prost::alloc::string::String>,
434 #[prost(message, optional, tag = "16")]
435 pub revision: ::core::option::Option<::prost::alloc::string::String>,
436 #[prost(message, repeated, tag = "21")]
438 pub rules: ::prost::alloc::vec::Vec<CircuitBreakerRule>,
439}
440#[allow(clippy::derive_partial_eq_without_eq)]
442#[derive(Clone, PartialEq, ::prost::Message)]
443pub struct SourceMatcher {
444 #[prost(message, optional, tag = "1")]
446 pub service: ::core::option::Option<::prost::alloc::string::String>,
447 #[prost(message, optional, tag = "2")]
448 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
449 #[prost(map = "string, message", tag = "3")]
451 pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
452}
453#[allow(clippy::derive_partial_eq_without_eq)]
455#[derive(Clone, PartialEq, ::prost::Message)]
456pub struct RecoverConfig {
457 #[prost(message, optional, tag = "1")]
459 pub sleep_window: ::core::option::Option<::prost_types::Duration>,
460 #[prost(message, optional, tag = "2")]
462 pub max_retry_after_half_open: ::core::option::Option<u32>,
463 #[prost(message, repeated, tag = "3")]
465 pub request_rate_after_half_open: ::prost::alloc::vec::Vec<u32>,
466 #[prost(message, optional, tag = "4")]
468 pub success_rate_to_close: ::core::option::Option<u32>,
469 #[prost(message, optional, tag = "5")]
471 pub request_count_after_half_open: ::core::option::Option<u32>,
472 #[prost(enumeration = "recover_config::OutlierDetectWhen", tag = "6")]
473 pub outlier_detect_when: i32,
474}
475pub mod recover_config {
477 #[derive(
479 Clone,
480 Copy,
481 Debug,
482 PartialEq,
483 Eq,
484 Hash,
485 PartialOrd,
486 Ord,
487 ::prost::Enumeration
488 )]
489 #[repr(i32)]
490 pub enum OutlierDetectWhen {
491 Never = 0,
493 OnRecover = 1,
495 Always = 2,
497 }
498 impl OutlierDetectWhen {
499 pub fn as_str_name(&self) -> &'static str {
504 match self {
505 OutlierDetectWhen::Never => "NEVER",
506 OutlierDetectWhen::OnRecover => "ON_RECOVER",
507 OutlierDetectWhen::Always => "ALWAYS",
508 }
509 }
510 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
512 match value {
513 "NEVER" => Some(Self::Never),
514 "ON_RECOVER" => Some(Self::OnRecover),
515 "ALWAYS" => Some(Self::Always),
516 _ => None,
517 }
518 }
519 }
520}
521#[allow(clippy::derive_partial_eq_without_eq)]
523#[derive(Clone, PartialEq, ::prost::Message)]
524pub struct CbPolicy {
525 #[prost(message, optional, tag = "1")]
526 pub error_rate: ::core::option::Option<cb_policy::ErrRateConfig>,
527 #[prost(message, optional, tag = "2")]
528 pub slow_rate: ::core::option::Option<cb_policy::SlowRateConfig>,
529 #[prost(message, optional, tag = "3")]
531 pub judge_duration: ::core::option::Option<::prost_types::Duration>,
532 #[prost(message, optional, tag = "4")]
534 pub max_ejection_percent: ::core::option::Option<u32>,
535 #[prost(message, optional, tag = "5")]
536 pub consecutive: ::core::option::Option<cb_policy::ConsecutiveErrConfig>,
537}
538pub mod cb_policy {
540 #[allow(clippy::derive_partial_eq_without_eq)]
542 #[derive(Clone, PartialEq, ::prost::Message)]
543 pub struct ErrRateConfig {
544 #[prost(message, optional, tag = "1")]
546 pub enable: ::core::option::Option<bool>,
547 #[prost(message, optional, tag = "2")]
549 pub request_volume_threshold: ::core::option::Option<u32>,
550 #[prost(message, optional, tag = "3")]
552 pub error_rate_to_preserved: ::core::option::Option<u32>,
553 #[prost(message, optional, tag = "4")]
555 pub error_rate_to_open: ::core::option::Option<u32>,
556 #[prost(message, repeated, tag = "5")]
557 pub specials: ::prost::alloc::vec::Vec<err_rate_config::SpecialConfig>,
558 }
559 pub mod err_rate_config {
561 #[allow(clippy::derive_partial_eq_without_eq)]
563 #[derive(Clone, PartialEq, ::prost::Message)]
564 pub struct SpecialConfig {
565 #[prost(message, optional, tag = "1")]
567 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
568 #[prost(message, repeated, tag = "2")]
569 pub error_codes: ::prost::alloc::vec::Vec<i64>,
570 #[prost(message, optional, tag = "3")]
571 pub error_rate_to_preserved: ::core::option::Option<u32>,
572 #[prost(message, optional, tag = "4")]
573 pub error_rate_to_open: ::core::option::Option<u32>,
574 }
575 }
576 #[allow(clippy::derive_partial_eq_without_eq)]
578 #[derive(Clone, PartialEq, ::prost::Message)]
579 pub struct SlowRateConfig {
580 #[prost(message, optional, tag = "1")]
582 pub enable: ::core::option::Option<bool>,
583 #[prost(message, optional, tag = "2")]
585 pub max_rt: ::core::option::Option<::prost_types::Duration>,
586 #[prost(message, optional, tag = "3")]
588 pub slow_rate_to_preserved: ::core::option::Option<u32>,
589 #[prost(message, optional, tag = "4")]
591 pub slow_rate_to_open: ::core::option::Option<u32>,
592 }
593 #[allow(clippy::derive_partial_eq_without_eq)]
595 #[derive(Clone, PartialEq, ::prost::Message)]
596 pub struct ConsecutiveErrConfig {
597 #[prost(message, optional, tag = "1")]
599 pub enable: ::core::option::Option<bool>,
600 #[prost(message, optional, tag = "2")]
602 pub consecutive_error_to_preserved: ::core::option::Option<u32>,
603 #[prost(message, optional, tag = "3")]
605 pub consecutive_error_to_open: ::core::option::Option<u32>,
606 }
607}
608#[allow(clippy::derive_partial_eq_without_eq)]
610#[derive(Clone, PartialEq, ::prost::Message)]
611pub struct DestinationSet {
612 #[prost(message, optional, tag = "1")]
614 pub service: ::core::option::Option<::prost::alloc::string::String>,
615 #[prost(message, optional, tag = "2")]
616 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
617 #[prost(map = "string, message", tag = "3")]
619 pub metadata: ::std::collections::HashMap<
620 ::prost::alloc::string::String,
621 MatchString,
622 >,
623 #[prost(enumeration = "destination_set::Resource", tag = "4")]
624 pub resource: i32,
625 #[prost(enumeration = "destination_set::Type", tag = "5")]
626 pub r#type: i32,
627 #[prost(enumeration = "destination_set::Scope", tag = "6")]
628 pub scope: i32,
629 #[prost(message, optional, tag = "7")]
632 pub metric_window: ::core::option::Option<::prost_types::Duration>,
633 #[prost(message, optional, tag = "8")]
636 pub metric_precision: ::core::option::Option<u32>,
637 #[prost(message, optional, tag = "9")]
639 pub update_interval: ::core::option::Option<::prost_types::Duration>,
640 #[prost(message, optional, tag = "10")]
642 pub recover: ::core::option::Option<RecoverConfig>,
643 #[prost(message, optional, tag = "11")]
645 pub policy: ::core::option::Option<CbPolicy>,
646 #[prost(message, optional, tag = "12")]
648 pub method: ::core::option::Option<MatchString>,
649 #[prost(message, repeated, tag = "13")]
651 pub error_codes: ::prost::alloc::vec::Vec<i64>,
652}
653pub mod destination_set {
655 #[derive(
658 Clone,
659 Copy,
660 Debug,
661 PartialEq,
662 Eq,
663 Hash,
664 PartialOrd,
665 Ord,
666 ::prost::Enumeration
667 )]
668 #[repr(i32)]
669 pub enum Resource {
670 Subset = 0,
672 Instance = 1,
674 }
675 impl Resource {
676 pub fn as_str_name(&self) -> &'static str {
681 match self {
682 Resource::Subset => "SUBSET",
683 Resource::Instance => "INSTANCE",
684 }
685 }
686 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
688 match value {
689 "SUBSET" => Some(Self::Subset),
690 "INSTANCE" => Some(Self::Instance),
691 _ => None,
692 }
693 }
694 }
695 #[derive(
698 Clone,
699 Copy,
700 Debug,
701 PartialEq,
702 Eq,
703 Hash,
704 PartialOrd,
705 Ord,
706 ::prost::Enumeration
707 )]
708 #[repr(i32)]
709 pub enum Type {
710 Global = 0,
711 Local = 1,
712 }
713 impl Type {
714 pub fn as_str_name(&self) -> &'static str {
719 match self {
720 Type::Global => "GLOBAL",
721 Type::Local => "LOCAL",
722 }
723 }
724 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
726 match value {
727 "GLOBAL" => Some(Self::Global),
728 "LOCAL" => Some(Self::Local),
729 _ => None,
730 }
731 }
732 }
733 #[derive(
735 Clone,
736 Copy,
737 Debug,
738 PartialEq,
739 Eq,
740 Hash,
741 PartialOrd,
742 Ord,
743 ::prost::Enumeration
744 )]
745 #[repr(i32)]
746 pub enum Scope {
747 All = 0,
749 Current = 1,
751 }
752 impl Scope {
753 pub fn as_str_name(&self) -> &'static str {
758 match self {
759 Scope::All => "ALL",
760 Scope::Current => "CURRENT",
761 }
762 }
763 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
765 match value {
766 "ALL" => Some(Self::All),
767 "CURRENT" => Some(Self::Current),
768 _ => None,
769 }
770 }
771 }
772}
773#[allow(clippy::derive_partial_eq_without_eq)]
775#[derive(Clone, PartialEq, ::prost::Message)]
776pub struct CbRule {
777 #[prost(message, repeated, tag = "1")]
780 pub sources: ::prost::alloc::vec::Vec<SourceMatcher>,
781 #[prost(message, repeated, tag = "2")]
782 pub destinations: ::prost::alloc::vec::Vec<DestinationSet>,
783}
784#[allow(clippy::derive_partial_eq_without_eq)]
785#[derive(Clone, PartialEq, ::prost::Message)]
786pub struct RuleMatcher {
787 #[prost(message, optional, tag = "1")]
788 pub source: ::core::option::Option<rule_matcher::SourceService>,
789 #[prost(message, optional, tag = "2")]
790 pub destination: ::core::option::Option<rule_matcher::DestinationService>,
791}
792pub mod rule_matcher {
794 #[allow(clippy::derive_partial_eq_without_eq)]
795 #[derive(Clone, PartialEq, ::prost::Message)]
796 pub struct SourceService {
797 #[prost(string, tag = "1")]
798 pub service: ::prost::alloc::string::String,
799 #[prost(string, tag = "2")]
800 pub namespace: ::prost::alloc::string::String,
801 }
802 #[allow(clippy::derive_partial_eq_without_eq)]
803 #[derive(Clone, PartialEq, ::prost::Message)]
804 pub struct DestinationService {
805 #[prost(string, tag = "1")]
806 pub service: ::prost::alloc::string::String,
807 #[prost(string, tag = "2")]
808 pub namespace: ::prost::alloc::string::String,
809 #[deprecated]
811 #[prost(message, optional, tag = "3")]
812 pub method: ::core::option::Option<super::MatchString>,
813 }
814}
815#[allow(clippy::derive_partial_eq_without_eq)]
817#[derive(Clone, PartialEq, ::prost::Message)]
818pub struct CircuitBreakerRule {
819 #[prost(string, tag = "1")]
820 pub id: ::prost::alloc::string::String,
821 #[prost(string, tag = "2")]
823 pub name: ::prost::alloc::string::String,
824 #[prost(string, tag = "3")]
826 pub namespace: ::prost::alloc::string::String,
827 #[prost(bool, tag = "4")]
829 pub enable: bool,
830 #[prost(string, tag = "5")]
832 pub revision: ::prost::alloc::string::String,
833 #[prost(string, tag = "6")]
835 pub ctime: ::prost::alloc::string::String,
836 #[prost(string, tag = "7")]
838 pub mtime: ::prost::alloc::string::String,
839 #[prost(string, tag = "8")]
841 pub etime: ::prost::alloc::string::String,
842 #[prost(string, tag = "9")]
844 pub description: ::prost::alloc::string::String,
845 #[prost(enumeration = "Level", tag = "21")]
847 pub level: i32,
848 #[prost(message, optional, tag = "22")]
850 pub rule_matcher: ::core::option::Option<RuleMatcher>,
851 #[deprecated]
853 #[prost(message, repeated, tag = "23")]
854 pub error_conditions: ::prost::alloc::vec::Vec<ErrorCondition>,
855 #[deprecated]
857 #[prost(message, repeated, tag = "24")]
858 pub trigger_condition: ::prost::alloc::vec::Vec<TriggerCondition>,
859 #[prost(uint32, tag = "25")]
861 pub max_ejection_percent: u32,
862 #[prost(message, optional, tag = "26")]
864 pub recover_condition: ::core::option::Option<RecoverCondition>,
865 #[prost(message, optional, tag = "27")]
867 pub fault_detect_config: ::core::option::Option<FaultDetectConfig>,
868 #[prost(message, optional, tag = "28")]
870 pub fallback_config: ::core::option::Option<FallbackConfig>,
871 #[prost(message, repeated, tag = "29")]
873 pub block_configs: ::prost::alloc::vec::Vec<BlockConfig>,
874 #[prost(uint32, tag = "30")]
876 pub priority: u32,
877 #[prost(map = "string, string", tag = "31")]
879 pub metadata: ::std::collections::HashMap<
880 ::prost::alloc::string::String,
881 ::prost::alloc::string::String,
882 >,
883 #[prost(bool, tag = "40")]
885 pub editable: bool,
886 #[prost(bool, tag = "41")]
887 pub deleteable: bool,
888}
889#[allow(clippy::derive_partial_eq_without_eq)]
891#[derive(Clone, PartialEq, ::prost::Message)]
892pub struct ErrorCondition {
893 #[prost(enumeration = "error_condition::InputType", tag = "1")]
894 pub input_type: i32,
895 #[prost(message, optional, tag = "2")]
896 pub condition: ::core::option::Option<MatchString>,
897}
898pub mod error_condition {
900 #[derive(
901 Clone,
902 Copy,
903 Debug,
904 PartialEq,
905 Eq,
906 Hash,
907 PartialOrd,
908 Ord,
909 ::prost::Enumeration
910 )]
911 #[repr(i32)]
912 pub enum InputType {
913 Unknown = 0,
914 RetCode = 1,
915 Delay = 2,
916 }
917 impl InputType {
918 pub fn as_str_name(&self) -> &'static str {
923 match self {
924 InputType::Unknown => "UNKNOWN",
925 InputType::RetCode => "RET_CODE",
926 InputType::Delay => "DELAY",
927 }
928 }
929 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
931 match value {
932 "UNKNOWN" => Some(Self::Unknown),
933 "RET_CODE" => Some(Self::RetCode),
934 "DELAY" => Some(Self::Delay),
935 _ => None,
936 }
937 }
938 }
939}
940#[allow(clippy::derive_partial_eq_without_eq)]
942#[derive(Clone, PartialEq, ::prost::Message)]
943pub struct TriggerCondition {
944 #[prost(enumeration = "trigger_condition::TriggerType", tag = "1")]
945 pub trigger_type: i32,
946 #[prost(uint32, tag = "2")]
947 pub error_count: u32,
948 #[prost(uint32, tag = "3")]
949 pub error_percent: u32,
950 #[prost(uint32, tag = "4")]
951 pub interval: u32,
952 #[prost(uint32, tag = "5")]
953 pub minimum_request: u32,
954}
955pub mod trigger_condition {
957 #[derive(
958 Clone,
959 Copy,
960 Debug,
961 PartialEq,
962 Eq,
963 Hash,
964 PartialOrd,
965 Ord,
966 ::prost::Enumeration
967 )]
968 #[repr(i32)]
969 pub enum TriggerType {
970 Unknown = 0,
971 ErrorRate = 1,
972 ConsecutiveError = 2,
973 }
974 impl TriggerType {
975 pub fn as_str_name(&self) -> &'static str {
980 match self {
981 TriggerType::Unknown => "UNKNOWN",
982 TriggerType::ErrorRate => "ERROR_RATE",
983 TriggerType::ConsecutiveError => "CONSECUTIVE_ERROR",
984 }
985 }
986 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
988 match value {
989 "UNKNOWN" => Some(Self::Unknown),
990 "ERROR_RATE" => Some(Self::ErrorRate),
991 "CONSECUTIVE_ERROR" => Some(Self::ConsecutiveError),
992 _ => None,
993 }
994 }
995 }
996}
997#[allow(clippy::derive_partial_eq_without_eq)]
999#[derive(Clone, PartialEq, ::prost::Message)]
1000pub struct RecoverCondition {
1001 #[prost(uint32, tag = "1")]
1003 pub sleep_window: u32,
1004 #[prost(uint32, tag = "2")]
1006 pub consecutive_success: u32,
1007}
1008#[allow(clippy::derive_partial_eq_without_eq)]
1010#[derive(Clone, PartialEq, ::prost::Message)]
1011pub struct FaultDetectConfig {
1012 #[prost(bool, tag = "1")]
1013 pub enable: bool,
1014}
1015#[allow(clippy::derive_partial_eq_without_eq)]
1017#[derive(Clone, PartialEq, ::prost::Message)]
1018pub struct BlockConfig {
1019 #[prost(string, tag = "1")]
1020 pub name: ::prost::alloc::string::String,
1021 #[prost(message, optional, tag = "2")]
1023 pub api: ::core::option::Option<Api>,
1024 #[prost(message, repeated, tag = "3")]
1026 pub error_conditions: ::prost::alloc::vec::Vec<ErrorCondition>,
1027 #[prost(message, repeated, tag = "4")]
1029 pub trigger_conditions: ::prost::alloc::vec::Vec<TriggerCondition>,
1030}
1031#[allow(clippy::derive_partial_eq_without_eq)]
1033#[derive(Clone, PartialEq, ::prost::Message)]
1034pub struct FallbackConfig {
1035 #[prost(bool, tag = "1")]
1036 pub enable: bool,
1037 #[prost(message, optional, tag = "2")]
1038 pub response: ::core::option::Option<FallbackResponse>,
1039}
1040#[allow(clippy::derive_partial_eq_without_eq)]
1042#[derive(Clone, PartialEq, ::prost::Message)]
1043pub struct FallbackResponse {
1044 #[prost(int32, tag = "1")]
1045 pub code: i32,
1046 #[prost(message, repeated, tag = "2")]
1047 pub headers: ::prost::alloc::vec::Vec<fallback_response::MessageHeader>,
1048 #[prost(string, tag = "3")]
1049 pub body: ::prost::alloc::string::String,
1050}
1051pub mod fallback_response {
1053 #[allow(clippy::derive_partial_eq_without_eq)]
1054 #[derive(Clone, PartialEq, ::prost::Message)]
1055 pub struct MessageHeader {
1056 #[prost(string, tag = "1")]
1057 pub key: ::prost::alloc::string::String,
1058 #[prost(string, tag = "2")]
1059 pub value: ::prost::alloc::string::String,
1060 }
1061}
1062#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1064#[repr(i32)]
1065pub enum Level {
1066 Unknown = 0,
1067 Service = 1,
1069 Method = 2,
1071 Group = 3,
1073 Instance = 4,
1075}
1076impl Level {
1077 pub fn as_str_name(&self) -> &'static str {
1082 match self {
1083 Level::Unknown => "UNKNOWN",
1084 Level::Service => "SERVICE",
1085 Level::Method => "METHOD",
1086 Level::Group => "GROUP",
1087 Level::Instance => "INSTANCE",
1088 }
1089 }
1090 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1092 match value {
1093 "UNKNOWN" => Some(Self::Unknown),
1094 "SERVICE" => Some(Self::Service),
1095 "METHOD" => Some(Self::Method),
1096 "GROUP" => Some(Self::Group),
1097 "INSTANCE" => Some(Self::Instance),
1098 _ => None,
1099 }
1100 }
1101}
1102#[allow(clippy::derive_partial_eq_without_eq)]
1103#[derive(Clone, PartialEq, ::prost::Message)]
1104pub struct ConfigRelease {
1105 #[prost(message, optional, tag = "1")]
1106 pub service: ::core::option::Option<Service>,
1107 #[prost(message, optional, tag = "2")]
1108 pub ctime: ::core::option::Option<::prost::alloc::string::String>,
1109 #[prost(message, optional, tag = "3")]
1110 pub mtime: ::core::option::Option<::prost::alloc::string::String>,
1111 #[prost(message, optional, tag = "4")]
1112 pub circuit_breaker: ::core::option::Option<CircuitBreaker>,
1113}
1114#[allow(clippy::derive_partial_eq_without_eq)]
1115#[derive(Clone, PartialEq, ::prost::Message)]
1116pub struct ConfigWithService {
1117 #[prost(message, repeated, tag = "1")]
1118 pub services: ::prost::alloc::vec::Vec<Service>,
1119 #[prost(message, optional, tag = "2")]
1120 pub circuit_breaker: ::core::option::Option<CircuitBreaker>,
1121}
1122#[allow(clippy::derive_partial_eq_without_eq)]
1123#[derive(Clone, PartialEq, ::prost::Message)]
1124pub struct ServiceContract {
1125 #[prost(string, tag = "1")]
1127 pub id: ::prost::alloc::string::String,
1128 #[prost(string, tag = "2")]
1131 pub name: ::prost::alloc::string::String,
1132 #[prost(string, tag = "3")]
1134 pub namespace: ::prost::alloc::string::String,
1135 #[prost(string, tag = "4")]
1137 pub service: ::prost::alloc::string::String,
1138 #[prost(string, tag = "5")]
1140 pub protocol: ::prost::alloc::string::String,
1141 #[prost(string, tag = "6")]
1143 pub version: ::prost::alloc::string::String,
1144 #[prost(string, tag = "7")]
1146 pub revision: ::prost::alloc::string::String,
1147 #[prost(string, tag = "8")]
1149 pub content: ::prost::alloc::string::String,
1150 #[prost(message, repeated, tag = "9")]
1152 pub interfaces: ::prost::alloc::vec::Vec<InterfaceDescriptor>,
1153 #[prost(string, tag = "10")]
1155 pub ctime: ::prost::alloc::string::String,
1156 #[prost(string, tag = "11")]
1158 pub mtime: ::prost::alloc::string::String,
1159 #[prost(string, tag = "12")]
1161 pub status: ::prost::alloc::string::String,
1162 #[prost(string, tag = "14")]
1164 pub r#type: ::prost::alloc::string::String,
1165 #[prost(map = "string, string", tag = "15")]
1167 pub metadata: ::std::collections::HashMap<
1168 ::prost::alloc::string::String,
1169 ::prost::alloc::string::String,
1170 >,
1171}
1172#[allow(clippy::derive_partial_eq_without_eq)]
1173#[derive(Clone, PartialEq, ::prost::Message)]
1174pub struct InterfaceDescriptor {
1175 #[prost(string, tag = "1")]
1177 pub id: ::prost::alloc::string::String,
1178 #[prost(string, tag = "2")]
1180 pub method: ::prost::alloc::string::String,
1181 #[prost(string, tag = "3")]
1183 pub path: ::prost::alloc::string::String,
1184 #[prost(string, tag = "4")]
1186 pub content: ::prost::alloc::string::String,
1187 #[prost(enumeration = "interface_descriptor::Source", tag = "5")]
1189 pub source: i32,
1190 #[prost(string, tag = "6")]
1192 pub revision: ::prost::alloc::string::String,
1193 #[prost(string, tag = "7")]
1195 pub ctime: ::prost::alloc::string::String,
1196 #[prost(string, tag = "8")]
1198 pub mtime: ::prost::alloc::string::String,
1199 #[prost(string, tag = "9")]
1202 pub name: ::prost::alloc::string::String,
1203 #[prost(string, tag = "10")]
1205 pub namespace: ::prost::alloc::string::String,
1206 #[prost(string, tag = "11")]
1208 pub service: ::prost::alloc::string::String,
1209 #[prost(string, tag = "12")]
1211 pub protocol: ::prost::alloc::string::String,
1212 #[prost(string, tag = "13")]
1214 pub version: ::prost::alloc::string::String,
1215 #[prost(string, tag = "14")]
1217 pub r#type: ::prost::alloc::string::String,
1218}
1219pub mod interface_descriptor {
1221 #[derive(
1222 Clone,
1223 Copy,
1224 Debug,
1225 PartialEq,
1226 Eq,
1227 Hash,
1228 PartialOrd,
1229 Ord,
1230 ::prost::Enumeration
1231 )]
1232 #[repr(i32)]
1233 pub enum Source {
1234 Unknown = 0,
1235 Manual = 1,
1236 Client = 2,
1237 }
1238 impl Source {
1239 pub fn as_str_name(&self) -> &'static str {
1244 match self {
1245 Source::Unknown => "UNKNOWN",
1246 Source::Manual => "Manual",
1247 Source::Client => "Client",
1248 }
1249 }
1250 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1252 match value {
1253 "UNKNOWN" => Some(Self::Unknown),
1254 "Manual" => Some(Self::Manual),
1255 "Client" => Some(Self::Client),
1256 _ => None,
1257 }
1258 }
1259 }
1260}
1261#[allow(clippy::derive_partial_eq_without_eq)]
1262#[derive(Clone, PartialEq, ::prost::Message)]
1263pub struct ConfigFileGroup {
1264 #[prost(message, optional, tag = "1")]
1265 pub id: ::core::option::Option<u64>,
1266 #[prost(message, optional, tag = "2")]
1267 pub name: ::core::option::Option<::prost::alloc::string::String>,
1268 #[prost(message, optional, tag = "3")]
1269 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
1270 #[prost(message, optional, tag = "4")]
1271 pub comment: ::core::option::Option<::prost::alloc::string::String>,
1272 #[prost(message, optional, tag = "5")]
1273 pub create_time: ::core::option::Option<::prost::alloc::string::String>,
1274 #[prost(message, optional, tag = "6")]
1275 pub create_by: ::core::option::Option<::prost::alloc::string::String>,
1276 #[prost(message, optional, tag = "7")]
1277 pub modify_time: ::core::option::Option<::prost::alloc::string::String>,
1278 #[prost(message, optional, tag = "8")]
1279 pub modify_by: ::core::option::Option<::prost::alloc::string::String>,
1280 #[prost(message, optional, tag = "9")]
1281 pub file_count: ::core::option::Option<u64>,
1282 #[prost(message, repeated, tag = "10")]
1283 pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1284 #[prost(message, repeated, tag = "11")]
1285 pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1286 #[prost(message, repeated, tag = "13")]
1287 pub remove_user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1288 #[prost(message, repeated, tag = "14")]
1289 pub remove_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1290 #[prost(message, optional, tag = "15")]
1291 pub editable: ::core::option::Option<bool>,
1292 #[prost(message, optional, tag = "16")]
1293 pub owner: ::core::option::Option<::prost::alloc::string::String>,
1294 #[prost(message, optional, tag = "17")]
1295 pub business: ::core::option::Option<::prost::alloc::string::String>,
1296 #[prost(message, optional, tag = "18")]
1297 pub department: ::core::option::Option<::prost::alloc::string::String>,
1298 #[prost(map = "string, string", tag = "19")]
1299 pub metadata: ::std::collections::HashMap<
1300 ::prost::alloc::string::String,
1301 ::prost::alloc::string::String,
1302 >,
1303 #[prost(message, optional, tag = "20")]
1305 pub deleteable: ::core::option::Option<bool>,
1306}
1307#[allow(clippy::derive_partial_eq_without_eq)]
1308#[derive(Clone, PartialEq, ::prost::Message)]
1309pub struct ConfigFile {
1310 #[prost(message, optional, tag = "1")]
1311 pub id: ::core::option::Option<u64>,
1312 #[prost(message, optional, tag = "2")]
1313 pub name: ::core::option::Option<::prost::alloc::string::String>,
1314 #[prost(message, optional, tag = "3")]
1315 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
1316 #[prost(message, optional, tag = "4")]
1317 pub group: ::core::option::Option<::prost::alloc::string::String>,
1318 #[prost(message, optional, tag = "5")]
1319 pub content: ::core::option::Option<::prost::alloc::string::String>,
1320 #[prost(message, optional, tag = "6")]
1321 pub format: ::core::option::Option<::prost::alloc::string::String>,
1322 #[prost(message, optional, tag = "7")]
1323 pub comment: ::core::option::Option<::prost::alloc::string::String>,
1324 #[prost(message, optional, tag = "8")]
1325 pub status: ::core::option::Option<::prost::alloc::string::String>,
1326 #[prost(message, repeated, tag = "9")]
1327 pub tags: ::prost::alloc::vec::Vec<ConfigFileTag>,
1328 #[prost(message, optional, tag = "10")]
1329 pub create_time: ::core::option::Option<::prost::alloc::string::String>,
1330 #[prost(message, optional, tag = "11")]
1331 pub create_by: ::core::option::Option<::prost::alloc::string::String>,
1332 #[prost(message, optional, tag = "12")]
1333 pub modify_time: ::core::option::Option<::prost::alloc::string::String>,
1334 #[prost(message, optional, tag = "13")]
1335 pub modify_by: ::core::option::Option<::prost::alloc::string::String>,
1336 #[prost(message, optional, tag = "14")]
1337 pub release_time: ::core::option::Option<::prost::alloc::string::String>,
1338 #[prost(message, optional, tag = "15")]
1339 pub release_by: ::core::option::Option<::prost::alloc::string::String>,
1340 #[prost(message, optional, tag = "16")]
1342 pub encrypted: ::core::option::Option<bool>,
1343 #[prost(message, optional, tag = "17")]
1345 pub encrypt_algo: ::core::option::Option<::prost::alloc::string::String>,
1346}
1347#[allow(clippy::derive_partial_eq_without_eq)]
1348#[derive(Clone, PartialEq, ::prost::Message)]
1349pub struct ConfigFileTag {
1350 #[prost(message, optional, tag = "1")]
1351 pub key: ::core::option::Option<::prost::alloc::string::String>,
1352 #[prost(message, optional, tag = "2")]
1353 pub value: ::core::option::Option<::prost::alloc::string::String>,
1354}
1355#[allow(clippy::derive_partial_eq_without_eq)]
1356#[derive(Clone, PartialEq, ::prost::Message)]
1357pub struct ConfigFileRelease {
1358 #[prost(message, optional, tag = "1")]
1359 pub id: ::core::option::Option<u64>,
1360 #[prost(message, optional, tag = "2")]
1361 pub name: ::core::option::Option<::prost::alloc::string::String>,
1362 #[prost(message, optional, tag = "3")]
1363 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
1364 #[prost(message, optional, tag = "4")]
1365 pub group: ::core::option::Option<::prost::alloc::string::String>,
1366 #[prost(message, optional, tag = "5")]
1367 pub file_name: ::core::option::Option<::prost::alloc::string::String>,
1368 #[prost(message, optional, tag = "6")]
1369 pub content: ::core::option::Option<::prost::alloc::string::String>,
1370 #[prost(message, optional, tag = "7")]
1371 pub comment: ::core::option::Option<::prost::alloc::string::String>,
1372 #[prost(message, optional, tag = "8")]
1373 pub md5: ::core::option::Option<::prost::alloc::string::String>,
1374 #[prost(message, optional, tag = "9")]
1375 pub version: ::core::option::Option<u64>,
1376 #[prost(message, optional, tag = "10")]
1377 pub create_time: ::core::option::Option<::prost::alloc::string::String>,
1378 #[prost(message, optional, tag = "11")]
1379 pub create_by: ::core::option::Option<::prost::alloc::string::String>,
1380 #[prost(message, optional, tag = "12")]
1381 pub modify_time: ::core::option::Option<::prost::alloc::string::String>,
1382 #[prost(message, optional, tag = "13")]
1383 pub modify_by: ::core::option::Option<::prost::alloc::string::String>,
1384 #[prost(message, repeated, tag = "14")]
1385 pub tags: ::prost::alloc::vec::Vec<ConfigFileTag>,
1386 #[prost(message, optional, tag = "15")]
1388 pub active: ::core::option::Option<bool>,
1389 #[prost(message, optional, tag = "16")]
1390 pub format: ::core::option::Option<::prost::alloc::string::String>,
1391 #[prost(message, optional, tag = "17")]
1392 pub release_description: ::core::option::Option<::prost::alloc::string::String>,
1393 #[prost(message, optional, tag = "18")]
1394 pub release_type: ::core::option::Option<::prost::alloc::string::String>,
1395 #[prost(message, repeated, tag = "19")]
1397 pub beta_labels: ::prost::alloc::vec::Vec<ClientLabel>,
1398}
1399#[allow(clippy::derive_partial_eq_without_eq)]
1400#[derive(Clone, PartialEq, ::prost::Message)]
1401pub struct ConfigFileReleaseHistory {
1402 #[prost(message, optional, tag = "1")]
1403 pub id: ::core::option::Option<u64>,
1404 #[prost(message, optional, tag = "2")]
1405 pub name: ::core::option::Option<::prost::alloc::string::String>,
1406 #[prost(message, optional, tag = "3")]
1407 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
1408 #[prost(message, optional, tag = "4")]
1409 pub group: ::core::option::Option<::prost::alloc::string::String>,
1410 #[prost(message, optional, tag = "5")]
1411 pub file_name: ::core::option::Option<::prost::alloc::string::String>,
1412 #[prost(message, optional, tag = "6")]
1413 pub content: ::core::option::Option<::prost::alloc::string::String>,
1414 #[prost(message, optional, tag = "7")]
1415 pub format: ::core::option::Option<::prost::alloc::string::String>,
1416 #[prost(message, optional, tag = "8")]
1417 pub comment: ::core::option::Option<::prost::alloc::string::String>,
1418 #[prost(message, optional, tag = "9")]
1419 pub md5: ::core::option::Option<::prost::alloc::string::String>,
1420 #[prost(message, optional, tag = "10")]
1421 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
1422 #[prost(message, optional, tag = "11")]
1423 pub status: ::core::option::Option<::prost::alloc::string::String>,
1424 #[prost(message, repeated, tag = "12")]
1425 pub tags: ::prost::alloc::vec::Vec<ConfigFileTag>,
1426 #[prost(message, optional, tag = "13")]
1427 pub create_time: ::core::option::Option<::prost::alloc::string::String>,
1428 #[prost(message, optional, tag = "14")]
1429 pub create_by: ::core::option::Option<::prost::alloc::string::String>,
1430 #[prost(message, optional, tag = "15")]
1431 pub modify_time: ::core::option::Option<::prost::alloc::string::String>,
1432 #[prost(message, optional, tag = "16")]
1433 pub modify_by: ::core::option::Option<::prost::alloc::string::String>,
1434 #[prost(message, optional, tag = "17")]
1436 pub reason: ::core::option::Option<::prost::alloc::string::String>,
1437 #[prost(message, optional, tag = "18")]
1438 pub release_description: ::core::option::Option<::prost::alloc::string::String>,
1439}
1440#[allow(clippy::derive_partial_eq_without_eq)]
1441#[derive(Clone, PartialEq, ::prost::Message)]
1442pub struct ConfigFileTemplate {
1443 #[prost(message, optional, tag = "1")]
1444 pub id: ::core::option::Option<u64>,
1445 #[prost(message, optional, tag = "2")]
1446 pub name: ::core::option::Option<::prost::alloc::string::String>,
1447 #[prost(message, optional, tag = "3")]
1448 pub content: ::core::option::Option<::prost::alloc::string::String>,
1449 #[prost(message, optional, tag = "4")]
1450 pub format: ::core::option::Option<::prost::alloc::string::String>,
1451 #[prost(message, optional, tag = "5")]
1452 pub comment: ::core::option::Option<::prost::alloc::string::String>,
1453 #[prost(message, optional, tag = "6")]
1454 pub create_time: ::core::option::Option<::prost::alloc::string::String>,
1455 #[prost(message, optional, tag = "7")]
1456 pub create_by: ::core::option::Option<::prost::alloc::string::String>,
1457 #[prost(message, optional, tag = "8")]
1458 pub modify_time: ::core::option::Option<::prost::alloc::string::String>,
1459 #[prost(message, optional, tag = "9")]
1460 pub modify_by: ::core::option::Option<::prost::alloc::string::String>,
1461}
1462#[allow(clippy::derive_partial_eq_without_eq)]
1463#[derive(Clone, PartialEq, ::prost::Message)]
1464pub struct ClientConfigFileInfo {
1465 #[prost(message, optional, tag = "1")]
1466 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
1467 #[prost(message, optional, tag = "2")]
1468 pub group: ::core::option::Option<::prost::alloc::string::String>,
1469 #[prost(message, optional, tag = "3")]
1470 pub file_name: ::core::option::Option<::prost::alloc::string::String>,
1471 #[prost(message, optional, tag = "4")]
1472 pub content: ::core::option::Option<::prost::alloc::string::String>,
1473 #[prost(message, optional, tag = "5")]
1474 pub version: ::core::option::Option<u64>,
1475 #[prost(message, optional, tag = "6")]
1476 pub md5: ::core::option::Option<::prost::alloc::string::String>,
1477 #[prost(message, repeated, tag = "7")]
1478 pub tags: ::prost::alloc::vec::Vec<ConfigFileTag>,
1479 #[prost(message, optional, tag = "8")]
1481 pub encrypted: ::core::option::Option<bool>,
1482 #[prost(message, optional, tag = "9")]
1484 pub public_key: ::core::option::Option<::prost::alloc::string::String>,
1485 #[prost(message, optional, tag = "10")]
1487 pub name: ::core::option::Option<::prost::alloc::string::String>,
1488 #[prost(message, optional, tag = "11")]
1490 pub release_time: ::core::option::Option<::prost::alloc::string::String>,
1491}
1492#[allow(clippy::derive_partial_eq_without_eq)]
1493#[derive(Clone, PartialEq, ::prost::Message)]
1494pub struct ClientWatchConfigFileRequest {
1495 #[prost(message, optional, tag = "1")]
1496 pub client_ip: ::core::option::Option<::prost::alloc::string::String>,
1497 #[prost(message, optional, tag = "2")]
1498 pub service_name: ::core::option::Option<::prost::alloc::string::String>,
1499 #[prost(message, repeated, tag = "3")]
1500 pub watch_files: ::prost::alloc::vec::Vec<ClientConfigFileInfo>,
1501}
1502#[allow(clippy::derive_partial_eq_without_eq)]
1503#[derive(Clone, PartialEq, ::prost::Message)]
1504pub struct ConfigFileExportRequest {
1505 #[prost(message, optional, tag = "1")]
1506 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
1507 #[prost(message, repeated, tag = "2")]
1508 pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1509 #[prost(message, repeated, tag = "3")]
1510 pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1511}
1512#[allow(clippy::derive_partial_eq_without_eq)]
1513#[derive(Clone, PartialEq, ::prost::Message)]
1514pub struct ConfigFilePublishInfo {
1515 #[prost(message, optional, tag = "1")]
1516 pub release_name: ::core::option::Option<::prost::alloc::string::String>,
1517 #[prost(message, optional, tag = "2")]
1518 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
1519 #[prost(message, optional, tag = "3")]
1520 pub group: ::core::option::Option<::prost::alloc::string::String>,
1521 #[prost(message, optional, tag = "4")]
1522 pub file_name: ::core::option::Option<::prost::alloc::string::String>,
1523 #[prost(message, optional, tag = "5")]
1524 pub content: ::core::option::Option<::prost::alloc::string::String>,
1525 #[prost(message, optional, tag = "6")]
1526 pub comment: ::core::option::Option<::prost::alloc::string::String>,
1527 #[prost(message, optional, tag = "7")]
1528 pub format: ::core::option::Option<::prost::alloc::string::String>,
1529 #[prost(message, optional, tag = "8")]
1530 pub release_description: ::core::option::Option<::prost::alloc::string::String>,
1531 #[prost(message, optional, tag = "11")]
1532 pub create_by: ::core::option::Option<::prost::alloc::string::String>,
1533 #[prost(message, optional, tag = "13")]
1534 pub modify_by: ::core::option::Option<::prost::alloc::string::String>,
1535 #[prost(message, repeated, tag = "14")]
1536 pub tags: ::prost::alloc::vec::Vec<ConfigFileTag>,
1537 #[prost(message, optional, tag = "15")]
1538 pub md5: ::core::option::Option<::prost::alloc::string::String>,
1539 #[prost(message, optional, tag = "16")]
1541 pub encrypted: ::core::option::Option<bool>,
1542 #[prost(message, optional, tag = "17")]
1544 pub encrypt_algo: ::core::option::Option<::prost::alloc::string::String>,
1545}
1546#[allow(clippy::derive_partial_eq_without_eq)]
1547#[derive(Clone, PartialEq, ::prost::Message)]
1548pub struct ConfigFileGroupRequest {
1549 #[prost(message, optional, tag = "1")]
1550 pub revision: ::core::option::Option<::prost::alloc::string::String>,
1551 #[prost(message, optional, tag = "2")]
1552 pub config_file_group: ::core::option::Option<ConfigFileGroup>,
1553 #[prost(map = "string, string", tag = "12")]
1555 pub client_labels: ::std::collections::HashMap<
1556 ::prost::alloc::string::String,
1557 ::prost::alloc::string::String,
1558 >,
1559}
1560#[allow(clippy::derive_partial_eq_without_eq)]
1561#[derive(Clone, PartialEq, ::prost::Message)]
1562pub struct ConfigDiscoverRequest {
1563 #[prost(
1564 enumeration = "config_discover_request::ConfigDiscoverRequestType",
1565 tag = "1"
1566 )]
1567 pub r#type: i32,
1568 #[prost(message, optional, tag = "2")]
1569 pub config_file: ::core::option::Option<ClientConfigFileInfo>,
1570 #[prost(string, tag = "3")]
1571 pub revision: ::prost::alloc::string::String,
1572}
1573pub mod config_discover_request {
1575 #[derive(
1576 Clone,
1577 Copy,
1578 Debug,
1579 PartialEq,
1580 Eq,
1581 Hash,
1582 PartialOrd,
1583 Ord,
1584 ::prost::Enumeration
1585 )]
1586 #[repr(i32)]
1587 pub enum ConfigDiscoverRequestType {
1588 Unknown = 0,
1589 ConfigFile = 1,
1590 ConfigFileNames = 2,
1591 ConfigFileGroups = 3,
1592 }
1593 impl ConfigDiscoverRequestType {
1594 pub fn as_str_name(&self) -> &'static str {
1599 match self {
1600 ConfigDiscoverRequestType::Unknown => "UNKNOWN",
1601 ConfigDiscoverRequestType::ConfigFile => "CONFIG_FILE",
1602 ConfigDiscoverRequestType::ConfigFileNames => "CONFIG_FILE_Names",
1603 ConfigDiscoverRequestType::ConfigFileGroups => "CONFIG_FILE_GROUPS",
1604 }
1605 }
1606 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1608 match value {
1609 "UNKNOWN" => Some(Self::Unknown),
1610 "CONFIG_FILE" => Some(Self::ConfigFile),
1611 "CONFIG_FILE_Names" => Some(Self::ConfigFileNames),
1612 "CONFIG_FILE_GROUPS" => Some(Self::ConfigFileGroups),
1613 _ => None,
1614 }
1615 }
1616 }
1617}
1618#[allow(clippy::derive_partial_eq_without_eq)]
1619#[derive(Clone, PartialEq, ::prost::Message)]
1620pub struct ConfigDiscoverResponse {
1621 #[prost(uint32, tag = "1")]
1622 pub code: u32,
1623 #[prost(string, tag = "2")]
1624 pub info: ::prost::alloc::string::String,
1625 #[prost(string, tag = "3")]
1626 pub revision: ::prost::alloc::string::String,
1627 #[prost(
1628 enumeration = "config_discover_response::ConfigDiscoverResponseType",
1629 tag = "4"
1630 )]
1631 pub r#type: i32,
1632 #[prost(message, optional, tag = "5")]
1633 pub config_file: ::core::option::Option<ClientConfigFileInfo>,
1634 #[prost(message, repeated, tag = "6")]
1635 pub config_file_names: ::prost::alloc::vec::Vec<ClientConfigFileInfo>,
1636 #[prost(message, repeated, tag = "7")]
1637 pub config_file_groups: ::prost::alloc::vec::Vec<ConfigFileGroup>,
1638}
1639pub mod config_discover_response {
1641 #[derive(
1642 Clone,
1643 Copy,
1644 Debug,
1645 PartialEq,
1646 Eq,
1647 Hash,
1648 PartialOrd,
1649 Ord,
1650 ::prost::Enumeration
1651 )]
1652 #[repr(i32)]
1653 pub enum ConfigDiscoverResponseType {
1654 Unknown = 0,
1655 ConfigFile = 1,
1656 ConfigFileNames = 2,
1657 ConfigFileGroups = 3,
1658 }
1659 impl ConfigDiscoverResponseType {
1660 pub fn as_str_name(&self) -> &'static str {
1665 match self {
1666 ConfigDiscoverResponseType::Unknown => "UNKNOWN",
1667 ConfigDiscoverResponseType::ConfigFile => "CONFIG_FILE",
1668 ConfigDiscoverResponseType::ConfigFileNames => "CONFIG_FILE_Names",
1669 ConfigDiscoverResponseType::ConfigFileGroups => "CONFIG_FILE_GROUPS",
1670 }
1671 }
1672 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1674 match value {
1675 "UNKNOWN" => Some(Self::Unknown),
1676 "CONFIG_FILE" => Some(Self::ConfigFile),
1677 "CONFIG_FILE_Names" => Some(Self::ConfigFileNames),
1678 "CONFIG_FILE_GROUPS" => Some(Self::ConfigFileGroups),
1679 _ => None,
1680 }
1681 }
1682 }
1683}
1684#[allow(clippy::derive_partial_eq_without_eq)]
1685#[derive(Clone, PartialEq, ::prost::Message)]
1686pub struct Client {
1687 #[prost(message, optional, tag = "1")]
1688 pub host: ::core::option::Option<::prost::alloc::string::String>,
1689 #[prost(enumeration = "client::ClientType", tag = "2")]
1690 pub r#type: i32,
1691 #[prost(message, optional, tag = "3")]
1692 pub version: ::core::option::Option<::prost::alloc::string::String>,
1693 #[prost(message, optional, tag = "4")]
1694 pub location: ::core::option::Option<Location>,
1695 #[prost(message, optional, tag = "5")]
1696 pub id: ::core::option::Option<::prost::alloc::string::String>,
1697 #[prost(message, repeated, tag = "6")]
1698 pub stat: ::prost::alloc::vec::Vec<StatInfo>,
1699 #[prost(message, optional, tag = "7")]
1700 pub ctime: ::core::option::Option<::prost::alloc::string::String>,
1701 #[prost(message, optional, tag = "8")]
1702 pub mtime: ::core::option::Option<::prost::alloc::string::String>,
1703}
1704pub mod client {
1706 #[derive(
1707 Clone,
1708 Copy,
1709 Debug,
1710 PartialEq,
1711 Eq,
1712 Hash,
1713 PartialOrd,
1714 Ord,
1715 ::prost::Enumeration
1716 )]
1717 #[repr(i32)]
1718 pub enum ClientType {
1719 Unknown = 0,
1720 Sdk = 1,
1721 Agent = 2,
1722 }
1723 impl ClientType {
1724 pub fn as_str_name(&self) -> &'static str {
1729 match self {
1730 ClientType::Unknown => "UNKNOWN",
1731 ClientType::Sdk => "SDK",
1732 ClientType::Agent => "AGENT",
1733 }
1734 }
1735 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1737 match value {
1738 "UNKNOWN" => Some(Self::Unknown),
1739 "SDK" => Some(Self::Sdk),
1740 "AGENT" => Some(Self::Agent),
1741 _ => None,
1742 }
1743 }
1744 }
1745}
1746#[allow(clippy::derive_partial_eq_without_eq)]
1747#[derive(Clone, PartialEq, ::prost::Message)]
1748pub struct StatInfo {
1749 #[prost(message, optional, tag = "1")]
1750 pub target: ::core::option::Option<::prost::alloc::string::String>,
1751 #[prost(message, optional, tag = "2")]
1752 pub port: ::core::option::Option<u32>,
1753 #[prost(message, optional, tag = "3")]
1754 pub path: ::core::option::Option<::prost::alloc::string::String>,
1755 #[prost(message, optional, tag = "4")]
1756 pub protocol: ::core::option::Option<::prost::alloc::string::String>,
1757}
1758#[allow(clippy::derive_partial_eq_without_eq)]
1759#[derive(Clone, PartialEq, ::prost::Message)]
1760pub struct DiscoverFilter {
1761 #[prost(bool, tag = "1")]
1762 pub only_healthy_instance: bool,
1763}
1764#[allow(clippy::derive_partial_eq_without_eq)]
1765#[derive(Clone, PartialEq, ::prost::Message)]
1766pub struct DiscoverRequest {
1767 #[prost(enumeration = "discover_request::DiscoverRequestType", tag = "1")]
1768 pub r#type: i32,
1769 #[prost(message, optional, tag = "2")]
1770 pub service: ::core::option::Option<Service>,
1771 #[prost(message, optional, tag = "30")]
1772 pub filter: ::core::option::Option<DiscoverFilter>,
1773}
1774pub mod discover_request {
1776 #[derive(
1777 Clone,
1778 Copy,
1779 Debug,
1780 PartialEq,
1781 Eq,
1782 Hash,
1783 PartialOrd,
1784 Ord,
1785 ::prost::Enumeration
1786 )]
1787 #[repr(i32)]
1788 pub enum DiscoverRequestType {
1789 Unknown = 0,
1790 Instance = 1,
1791 Cluster = 2,
1792 Routing = 3,
1793 RateLimit = 4,
1794 CircuitBreaker = 5,
1795 Services = 6,
1796 Namespaces = 12,
1797 FaultDetector = 13,
1798 Lane = 100,
1799 CustomRouteRule = 101,
1801 NearbyRouteRule = 102,
1803 Lossless = 103,
1805 BlockAllowRule = 104,
1807 }
1808 impl DiscoverRequestType {
1809 pub fn as_str_name(&self) -> &'static str {
1814 match self {
1815 DiscoverRequestType::Unknown => "UNKNOWN",
1816 DiscoverRequestType::Instance => "INSTANCE",
1817 DiscoverRequestType::Cluster => "CLUSTER",
1818 DiscoverRequestType::Routing => "ROUTING",
1819 DiscoverRequestType::RateLimit => "RATE_LIMIT",
1820 DiscoverRequestType::CircuitBreaker => "CIRCUIT_BREAKER",
1821 DiscoverRequestType::Services => "SERVICES",
1822 DiscoverRequestType::Namespaces => "NAMESPACES",
1823 DiscoverRequestType::FaultDetector => "FAULT_DETECTOR",
1824 DiscoverRequestType::Lane => "LANE",
1825 DiscoverRequestType::CustomRouteRule => "CUSTOM_ROUTE_RULE",
1826 DiscoverRequestType::NearbyRouteRule => "NEARBY_ROUTE_RULE",
1827 DiscoverRequestType::Lossless => "LOSSLESS",
1828 DiscoverRequestType::BlockAllowRule => "BLOCK_ALLOW_RULE",
1829 }
1830 }
1831 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1833 match value {
1834 "UNKNOWN" => Some(Self::Unknown),
1835 "INSTANCE" => Some(Self::Instance),
1836 "CLUSTER" => Some(Self::Cluster),
1837 "ROUTING" => Some(Self::Routing),
1838 "RATE_LIMIT" => Some(Self::RateLimit),
1839 "CIRCUIT_BREAKER" => Some(Self::CircuitBreaker),
1840 "SERVICES" => Some(Self::Services),
1841 "NAMESPACES" => Some(Self::Namespaces),
1842 "FAULT_DETECTOR" => Some(Self::FaultDetector),
1843 "LANE" => Some(Self::Lane),
1844 "CUSTOM_ROUTE_RULE" => Some(Self::CustomRouteRule),
1845 "NEARBY_ROUTE_RULE" => Some(Self::NearbyRouteRule),
1846 "LOSSLESS" => Some(Self::Lossless),
1847 "BLOCK_ALLOW_RULE" => Some(Self::BlockAllowRule),
1848 _ => None,
1849 }
1850 }
1851 }
1852}
1853#[allow(clippy::derive_partial_eq_without_eq)]
1854#[derive(Clone, PartialEq, ::prost::Message)]
1855pub struct Namespace {
1856 #[prost(message, optional, tag = "1")]
1857 pub name: ::core::option::Option<::prost::alloc::string::String>,
1858 #[prost(message, optional, tag = "2")]
1859 pub comment: ::core::option::Option<::prost::alloc::string::String>,
1860 #[prost(message, optional, tag = "3")]
1861 pub owners: ::core::option::Option<::prost::alloc::string::String>,
1862 #[prost(message, optional, tag = "4")]
1863 pub token: ::core::option::Option<::prost::alloc::string::String>,
1864 #[prost(message, optional, tag = "5")]
1865 pub ctime: ::core::option::Option<::prost::alloc::string::String>,
1866 #[prost(message, optional, tag = "6")]
1867 pub mtime: ::core::option::Option<::prost::alloc::string::String>,
1868 #[prost(message, optional, tag = "7")]
1869 pub total_service_count: ::core::option::Option<u32>,
1870 #[prost(message, optional, tag = "8")]
1871 pub total_health_instance_count: ::core::option::Option<u32>,
1872 #[prost(message, optional, tag = "9")]
1873 pub total_instance_count: ::core::option::Option<u32>,
1874 #[prost(message, repeated, tag = "10")]
1875 pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1876 #[prost(message, repeated, tag = "11")]
1877 pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1878 #[prost(message, repeated, tag = "13")]
1879 pub remove_user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1880 #[prost(message, repeated, tag = "14")]
1881 pub remove_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1882 #[prost(message, optional, tag = "12")]
1883 pub id: ::core::option::Option<::prost::alloc::string::String>,
1884 #[prost(message, optional, tag = "15")]
1885 pub editable: ::core::option::Option<bool>,
1886 #[prost(message, repeated, tag = "16")]
1887 pub service_export_to: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1888 #[prost(map = "string, string", tag = "17")]
1889 pub metadata: ::std::collections::HashMap<
1890 ::prost::alloc::string::String,
1891 ::prost::alloc::string::String,
1892 >,
1893 #[prost(message, optional, tag = "18")]
1894 pub deleteable: ::core::option::Option<bool>,
1895}
1896#[allow(clippy::derive_partial_eq_without_eq)]
1898#[derive(Clone, PartialEq, ::prost::Message)]
1899pub struct Routing {
1900 #[prost(message, optional, tag = "1")]
1901 pub service: ::core::option::Option<::prost::alloc::string::String>,
1902 #[prost(message, optional, tag = "2")]
1903 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
1904 #[prost(message, repeated, tag = "3")]
1907 pub inbounds: ::prost::alloc::vec::Vec<Route>,
1908 #[prost(message, repeated, tag = "4")]
1909 pub outbounds: ::prost::alloc::vec::Vec<Route>,
1910 #[prost(message, optional, tag = "5")]
1911 pub ctime: ::core::option::Option<::prost::alloc::string::String>,
1912 #[prost(message, optional, tag = "6")]
1913 pub mtime: ::core::option::Option<::prost::alloc::string::String>,
1914 #[prost(message, optional, tag = "7")]
1915 pub revision: ::core::option::Option<::prost::alloc::string::String>,
1916 #[prost(message, optional, tag = "8")]
1917 pub service_token: ::core::option::Option<::prost::alloc::string::String>,
1918 #[prost(message, repeated, tag = "21")]
1920 pub rules: ::prost::alloc::vec::Vec<RouteRule>,
1921}
1922#[allow(clippy::derive_partial_eq_without_eq)]
1924#[derive(Clone, PartialEq, ::prost::Message)]
1925pub struct Route {
1926 #[prost(message, repeated, tag = "1")]
1929 pub sources: ::prost::alloc::vec::Vec<Source>,
1930 #[prost(message, repeated, tag = "2")]
1931 pub destinations: ::prost::alloc::vec::Vec<Destination>,
1932 #[prost(map = "string, string", tag = "3")]
1935 pub extend_info: ::std::collections::HashMap<
1936 ::prost::alloc::string::String,
1937 ::prost::alloc::string::String,
1938 >,
1939}
1940#[allow(clippy::derive_partial_eq_without_eq)]
1942#[derive(Clone, PartialEq, ::prost::Message)]
1943pub struct Source {
1944 #[prost(message, optional, tag = "1")]
1946 pub service: ::core::option::Option<::prost::alloc::string::String>,
1947 #[prost(message, optional, tag = "2")]
1948 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
1949 #[prost(map = "string, message", tag = "3")]
1952 pub metadata: ::std::collections::HashMap<
1953 ::prost::alloc::string::String,
1954 MatchString,
1955 >,
1956}
1957#[allow(clippy::derive_partial_eq_without_eq)]
1959#[derive(Clone, PartialEq, ::prost::Message)]
1960pub struct Destination {
1961 #[prost(message, optional, tag = "1")]
1963 pub service: ::core::option::Option<::prost::alloc::string::String>,
1964 #[prost(message, optional, tag = "2")]
1965 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
1966 #[prost(map = "string, message", tag = "3")]
1969 pub metadata: ::std::collections::HashMap<
1970 ::prost::alloc::string::String,
1971 MatchString,
1972 >,
1973 #[prost(message, optional, tag = "4")]
1984 pub priority: ::core::option::Option<u32>,
1985 #[prost(message, optional, tag = "5")]
1986 pub weight: ::core::option::Option<u32>,
1987 #[prost(message, optional, tag = "6")]
1989 pub transfer: ::core::option::Option<::prost::alloc::string::String>,
1990 #[prost(message, optional, tag = "7")]
1992 pub isolate: ::core::option::Option<bool>,
1993 #[prost(message, optional, tag = "8")]
1995 pub name: ::core::option::Option<::prost::alloc::string::String>,
1996}
1997#[allow(clippy::derive_partial_eq_without_eq)]
1999#[derive(Clone, PartialEq, ::prost::Message)]
2000pub struct RouteRule {
2001 #[prost(string, tag = "1")]
2002 pub id: ::prost::alloc::string::String,
2003 #[prost(string, tag = "2")]
2005 pub name: ::prost::alloc::string::String,
2006 #[prost(string, tag = "3")]
2008 pub namespace: ::prost::alloc::string::String,
2009 #[prost(bool, tag = "4")]
2011 pub enable: bool,
2012 #[prost(enumeration = "RoutingPolicy", tag = "5")]
2014 pub routing_policy: i32,
2015 #[prost(message, optional, tag = "6")]
2017 pub routing_config: ::core::option::Option<::prost_types::Any>,
2018 #[prost(string, tag = "7")]
2020 pub revision: ::prost::alloc::string::String,
2021 #[prost(string, tag = "8")]
2023 pub ctime: ::prost::alloc::string::String,
2024 #[prost(string, tag = "9")]
2026 pub mtime: ::prost::alloc::string::String,
2027 #[prost(string, tag = "10")]
2029 pub etime: ::prost::alloc::string::String,
2030 #[prost(uint32, tag = "11")]
2032 pub priority: u32,
2033 #[prost(string, tag = "12")]
2035 pub description: ::prost::alloc::string::String,
2036 #[prost(map = "string, string", tag = "20")]
2040 pub extend_info: ::std::collections::HashMap<
2041 ::prost::alloc::string::String,
2042 ::prost::alloc::string::String,
2043 >,
2044 #[prost(map = "string, string", tag = "21")]
2046 pub metadata: ::std::collections::HashMap<
2047 ::prost::alloc::string::String,
2048 ::prost::alloc::string::String,
2049 >,
2050 #[prost(bool, tag = "30")]
2052 pub editable: bool,
2053 #[prost(bool, tag = "31")]
2054 pub deleteable: bool,
2055}
2056#[allow(clippy::derive_partial_eq_without_eq)]
2057#[derive(Clone, PartialEq, ::prost::Message)]
2058pub struct MetadataFailover {
2059 #[prost(enumeration = "metadata_failover::FailoverRange", tag = "1")]
2061 pub failover_range: i32,
2062 #[prost(map = "string, string", tag = "2")]
2064 pub labels: ::std::collections::HashMap<
2065 ::prost::alloc::string::String,
2066 ::prost::alloc::string::String,
2067 >,
2068}
2069pub mod metadata_failover {
2071 #[derive(
2072 Clone,
2073 Copy,
2074 Debug,
2075 PartialEq,
2076 Eq,
2077 Hash,
2078 PartialOrd,
2079 Ord,
2080 ::prost::Enumeration
2081 )]
2082 #[repr(i32)]
2083 pub enum FailoverRange {
2084 All = 0,
2086 Others = 1,
2088 OtherKeys = 2,
2090 }
2091 impl FailoverRange {
2092 pub fn as_str_name(&self) -> &'static str {
2097 match self {
2098 FailoverRange::All => "ALL",
2099 FailoverRange::Others => "OTHERS",
2100 FailoverRange::OtherKeys => "OTHER_KEYS",
2101 }
2102 }
2103 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2105 match value {
2106 "ALL" => Some(Self::All),
2107 "OTHERS" => Some(Self::Others),
2108 "OTHER_KEYS" => Some(Self::OtherKeys),
2109 _ => None,
2110 }
2111 }
2112 }
2113}
2114#[allow(clippy::derive_partial_eq_without_eq)]
2116#[derive(Clone, PartialEq, ::prost::Message)]
2117pub struct MetadataRoutingConfig {
2118 #[prost(string, tag = "1")]
2120 pub service: ::prost::alloc::string::String,
2121 #[prost(string, tag = "2")]
2123 pub namespace: ::prost::alloc::string::String,
2124 #[prost(map = "string, string", tag = "3")]
2125 pub labels: ::std::collections::HashMap<
2126 ::prost::alloc::string::String,
2127 ::prost::alloc::string::String,
2128 >,
2129 #[prost(message, optional, tag = "4")]
2131 pub failover: ::core::option::Option<MetadataFailover>,
2132}
2133#[allow(clippy::derive_partial_eq_without_eq)]
2135#[derive(Clone, PartialEq, ::prost::Message)]
2136pub struct NearbyRoutingConfig {
2137 #[prost(string, tag = "1")]
2139 pub service: ::prost::alloc::string::String,
2140 #[prost(string, tag = "2")]
2142 pub namespace: ::prost::alloc::string::String,
2143 #[prost(enumeration = "nearby_routing_config::LocationLevel", tag = "3")]
2145 pub match_level: i32,
2146 #[prost(enumeration = "nearby_routing_config::LocationLevel", tag = "4")]
2148 pub max_match_level: i32,
2149 #[prost(bool, tag = "5")]
2151 pub strict_nearby: bool,
2152}
2153pub mod nearby_routing_config {
2155 #[derive(
2156 Clone,
2157 Copy,
2158 Debug,
2159 PartialEq,
2160 Eq,
2161 Hash,
2162 PartialOrd,
2163 Ord,
2164 ::prost::Enumeration
2165 )]
2166 #[repr(i32)]
2167 pub enum LocationLevel {
2168 Unknown = 0,
2170 Campus = 1,
2172 Zone = 2,
2174 Region = 3,
2176 All = 4,
2178 }
2179 impl LocationLevel {
2180 pub fn as_str_name(&self) -> &'static str {
2185 match self {
2186 LocationLevel::Unknown => "UNKNOWN",
2187 LocationLevel::Campus => "CAMPUS",
2188 LocationLevel::Zone => "ZONE",
2189 LocationLevel::Region => "REGION",
2190 LocationLevel::All => "ALL",
2191 }
2192 }
2193 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2195 match value {
2196 "UNKNOWN" => Some(Self::Unknown),
2197 "CAMPUS" => Some(Self::Campus),
2198 "ZONE" => Some(Self::Zone),
2199 "REGION" => Some(Self::Region),
2200 "ALL" => Some(Self::All),
2201 _ => None,
2202 }
2203 }
2204 }
2205}
2206#[allow(clippy::derive_partial_eq_without_eq)]
2208#[derive(Clone, PartialEq, ::prost::Message)]
2209pub struct RuleRoutingConfig {
2210 #[deprecated]
2213 #[prost(message, repeated, tag = "1")]
2214 pub sources: ::prost::alloc::vec::Vec<SourceService>,
2215 #[deprecated]
2218 #[prost(message, repeated, tag = "2")]
2219 pub destinations: ::prost::alloc::vec::Vec<DestinationGroup>,
2220 #[prost(message, repeated, tag = "3")]
2222 pub rules: ::prost::alloc::vec::Vec<SubRuleRouting>,
2223}
2224#[allow(clippy::derive_partial_eq_without_eq)]
2226#[derive(Clone, PartialEq, ::prost::Message)]
2227pub struct SubRuleRouting {
2228 #[prost(string, tag = "1")]
2230 pub name: ::prost::alloc::string::String,
2231 #[prost(message, repeated, tag = "2")]
2233 pub sources: ::prost::alloc::vec::Vec<SourceService>,
2234 #[prost(message, repeated, tag = "3")]
2236 pub destinations: ::prost::alloc::vec::Vec<DestinationGroup>,
2237}
2238#[allow(clippy::derive_partial_eq_without_eq)]
2239#[derive(Clone, PartialEq, ::prost::Message)]
2240pub struct SourceService {
2241 #[prost(string, tag = "1")]
2243 pub service: ::prost::alloc::string::String,
2244 #[prost(string, tag = "2")]
2245 pub namespace: ::prost::alloc::string::String,
2246 #[prost(message, repeated, tag = "3")]
2249 pub arguments: ::prost::alloc::vec::Vec<SourceMatch>,
2250}
2251#[allow(clippy::derive_partial_eq_without_eq)]
2252#[derive(Clone, PartialEq, ::prost::Message)]
2253pub struct DestinationGroup {
2254 #[prost(string, tag = "1")]
2256 pub service: ::prost::alloc::string::String,
2257 #[prost(string, tag = "2")]
2258 pub namespace: ::prost::alloc::string::String,
2259 #[prost(map = "string, message", tag = "3")]
2262 pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
2263 #[prost(uint32, tag = "4")]
2275 pub priority: u32,
2276 #[prost(uint32, tag = "5")]
2277 pub weight: u32,
2278 #[prost(string, tag = "6")]
2280 pub transfer: ::prost::alloc::string::String,
2281 #[prost(bool, tag = "7")]
2283 pub isolate: bool,
2284 #[prost(string, tag = "8")]
2286 pub name: ::prost::alloc::string::String,
2287}
2288#[allow(clippy::derive_partial_eq_without_eq)]
2290#[derive(Clone, PartialEq, ::prost::Message)]
2291pub struct SourceMatch {
2292 #[prost(enumeration = "source_match::Type", tag = "1")]
2293 pub r#type: i32,
2294 #[prost(string, tag = "2")]
2296 pub key: ::prost::alloc::string::String,
2297 #[prost(message, optional, tag = "3")]
2299 pub value: ::core::option::Option<MatchString>,
2300}
2301pub mod source_match {
2303 #[derive(
2305 Clone,
2306 Copy,
2307 Debug,
2308 PartialEq,
2309 Eq,
2310 Hash,
2311 PartialOrd,
2312 Ord,
2313 ::prost::Enumeration
2314 )]
2315 #[repr(i32)]
2316 pub enum Type {
2317 Custom = 0,
2319 Method = 1,
2321 Header = 2,
2323 Query = 3,
2325 CallerIp = 4,
2327 Path = 5,
2329 Cookie = 6,
2331 CallerMetadata = 7,
2333 }
2334 impl Type {
2335 pub fn as_str_name(&self) -> &'static str {
2340 match self {
2341 Type::Custom => "CUSTOM",
2342 Type::Method => "METHOD",
2343 Type::Header => "HEADER",
2344 Type::Query => "QUERY",
2345 Type::CallerIp => "CALLER_IP",
2346 Type::Path => "PATH",
2347 Type::Cookie => "COOKIE",
2348 Type::CallerMetadata => "CALLER_METADATA",
2349 }
2350 }
2351 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2353 match value {
2354 "CUSTOM" => Some(Self::Custom),
2355 "METHOD" => Some(Self::Method),
2356 "HEADER" => Some(Self::Header),
2357 "QUERY" => Some(Self::Query),
2358 "CALLER_IP" => Some(Self::CallerIp),
2359 "PATH" => Some(Self::Path),
2360 "COOKIE" => Some(Self::Cookie),
2361 "CALLER_METADATA" => Some(Self::CallerMetadata),
2362 _ => None,
2363 }
2364 }
2365 }
2366}
2367#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2368#[repr(i32)]
2369pub enum RoutingPolicy {
2370 RulePolicy = 0,
2372 MetadataPolicy = 1,
2374 NearbyPolicy = 2,
2376}
2377impl RoutingPolicy {
2378 pub fn as_str_name(&self) -> &'static str {
2383 match self {
2384 RoutingPolicy::RulePolicy => "RulePolicy",
2385 RoutingPolicy::MetadataPolicy => "MetadataPolicy",
2386 RoutingPolicy::NearbyPolicy => "NearbyPolicy",
2387 }
2388 }
2389 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2391 match value {
2392 "RulePolicy" => Some(Self::RulePolicy),
2393 "MetadataPolicy" => Some(Self::MetadataPolicy),
2394 "NearbyPolicy" => Some(Self::NearbyPolicy),
2395 _ => None,
2396 }
2397 }
2398}
2399#[allow(clippy::derive_partial_eq_without_eq)]
2401#[derive(Clone, PartialEq, ::prost::Message)]
2402pub struct RateLimit {
2403 #[prost(message, repeated, tag = "1")]
2405 pub rules: ::prost::alloc::vec::Vec<Rule>,
2406 #[prost(message, optional, tag = "2")]
2408 pub revision: ::core::option::Option<::prost::alloc::string::String>,
2409}
2410#[allow(clippy::derive_partial_eq_without_eq)]
2412#[derive(Clone, PartialEq, ::prost::Message)]
2413pub struct Rule {
2414 #[prost(message, optional, tag = "1")]
2416 pub id: ::core::option::Option<::prost::alloc::string::String>,
2417 #[prost(message, optional, tag = "2")]
2419 pub service: ::core::option::Option<::prost::alloc::string::String>,
2420 #[prost(message, optional, tag = "3")]
2422 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
2423 #[prost(map = "string, message", tag = "4")]
2425 pub subset: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
2426 #[prost(message, optional, tag = "5")]
2428 pub priority: ::core::option::Option<u32>,
2429 #[prost(enumeration = "rule::Resource", tag = "6")]
2430 pub resource: i32,
2431 #[prost(enumeration = "rule::Type", tag = "7")]
2432 pub r#type: i32,
2433 #[prost(map = "string, message", tag = "8")]
2435 pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
2436 #[prost(message, repeated, tag = "9")]
2440 pub amounts: ::prost::alloc::vec::Vec<Amount>,
2441 #[prost(message, optional, tag = "10")]
2443 pub action: ::core::option::Option<::prost::alloc::string::String>,
2444 #[prost(message, optional, tag = "11")]
2446 pub disable: ::core::option::Option<bool>,
2447 #[prost(message, optional, tag = "12")]
2449 pub report: ::core::option::Option<Report>,
2450 #[prost(message, optional, tag = "13")]
2452 pub ctime: ::core::option::Option<::prost::alloc::string::String>,
2453 #[prost(message, optional, tag = "14")]
2455 pub mtime: ::core::option::Option<::prost::alloc::string::String>,
2456 #[prost(message, optional, tag = "15")]
2458 pub revision: ::core::option::Option<::prost::alloc::string::String>,
2459 #[prost(message, optional, tag = "16")]
2461 pub service_token: ::core::option::Option<::prost::alloc::string::String>,
2462 #[prost(message, optional, tag = "17")]
2464 pub adjuster: ::core::option::Option<AmountAdjuster>,
2465 #[prost(message, optional, tag = "18")]
2467 pub regex_combine: ::core::option::Option<bool>,
2468 #[prost(enumeration = "rule::AmountMode", tag = "19")]
2469 pub amount_mode: i32,
2470 #[prost(enumeration = "rule::FailoverType", tag = "20")]
2471 pub failover: i32,
2472 #[prost(message, optional, tag = "21")]
2474 pub cluster: ::core::option::Option<RateLimitCluster>,
2475 #[prost(message, optional, tag = "22")]
2477 pub method: ::core::option::Option<MatchString>,
2478 #[prost(message, repeated, tag = "23")]
2480 pub arguments: ::prost::alloc::vec::Vec<MatchArgument>,
2481 #[prost(message, optional, tag = "24")]
2483 pub name: ::core::option::Option<::prost::alloc::string::String>,
2484 #[prost(message, optional, tag = "25")]
2486 pub etime: ::core::option::Option<::prost::alloc::string::String>,
2487 #[prost(message, optional, tag = "26")]
2489 pub max_queue_delay: ::core::option::Option<u32>,
2490 #[prost(message, optional, tag = "27")]
2492 pub concurrency_amount: ::core::option::Option<ConcurrencyAmount>,
2493 #[prost(message, optional, tag = "28")]
2495 pub custom_response: ::core::option::Option<CustomResponse>,
2496 #[prost(map = "string, string", tag = "29")]
2498 pub metadata: ::std::collections::HashMap<
2499 ::prost::alloc::string::String,
2500 ::prost::alloc::string::String,
2501 >,
2502 #[prost(bool, tag = "30")]
2504 pub editable: bool,
2505 #[prost(bool, tag = "31")]
2506 pub deleteable: bool,
2507}
2508pub mod rule {
2510 #[derive(
2512 Clone,
2513 Copy,
2514 Debug,
2515 PartialEq,
2516 Eq,
2517 Hash,
2518 PartialOrd,
2519 Ord,
2520 ::prost::Enumeration
2521 )]
2522 #[repr(i32)]
2523 pub enum Resource {
2524 Qps = 0,
2526 Concurrency = 1,
2528 }
2529 impl Resource {
2530 pub fn as_str_name(&self) -> &'static str {
2535 match self {
2536 Resource::Qps => "QPS",
2537 Resource::Concurrency => "CONCURRENCY",
2538 }
2539 }
2540 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2542 match value {
2543 "QPS" => Some(Self::Qps),
2544 "CONCURRENCY" => Some(Self::Concurrency),
2545 _ => None,
2546 }
2547 }
2548 }
2549 #[derive(
2552 Clone,
2553 Copy,
2554 Debug,
2555 PartialEq,
2556 Eq,
2557 Hash,
2558 PartialOrd,
2559 Ord,
2560 ::prost::Enumeration
2561 )]
2562 #[repr(i32)]
2563 pub enum Type {
2564 Global = 0,
2565 Local = 1,
2566 }
2567 impl Type {
2568 pub fn as_str_name(&self) -> &'static str {
2573 match self {
2574 Type::Global => "GLOBAL",
2575 Type::Local => "LOCAL",
2576 }
2577 }
2578 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2580 match value {
2581 "GLOBAL" => Some(Self::Global),
2582 "LOCAL" => Some(Self::Local),
2583 _ => None,
2584 }
2585 }
2586 }
2587 #[derive(
2589 Clone,
2590 Copy,
2591 Debug,
2592 PartialEq,
2593 Eq,
2594 Hash,
2595 PartialOrd,
2596 Ord,
2597 ::prost::Enumeration
2598 )]
2599 #[repr(i32)]
2600 pub enum AmountMode {
2601 GlobalTotal = 0,
2603 ShareEqually = 1,
2605 }
2606 impl AmountMode {
2607 pub fn as_str_name(&self) -> &'static str {
2612 match self {
2613 AmountMode::GlobalTotal => "GLOBAL_TOTAL",
2614 AmountMode::ShareEqually => "SHARE_EQUALLY",
2615 }
2616 }
2617 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2619 match value {
2620 "GLOBAL_TOTAL" => Some(Self::GlobalTotal),
2621 "SHARE_EQUALLY" => Some(Self::ShareEqually),
2622 _ => None,
2623 }
2624 }
2625 }
2626 #[derive(
2628 Clone,
2629 Copy,
2630 Debug,
2631 PartialEq,
2632 Eq,
2633 Hash,
2634 PartialOrd,
2635 Ord,
2636 ::prost::Enumeration
2637 )]
2638 #[repr(i32)]
2639 pub enum FailoverType {
2640 FailoverLocal = 0,
2642 FailoverPass = 1,
2644 }
2645 impl FailoverType {
2646 pub fn as_str_name(&self) -> &'static str {
2651 match self {
2652 FailoverType::FailoverLocal => "FAILOVER_LOCAL",
2653 FailoverType::FailoverPass => "FAILOVER_PASS",
2654 }
2655 }
2656 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2658 match value {
2659 "FAILOVER_LOCAL" => Some(Self::FailoverLocal),
2660 "FAILOVER_PASS" => Some(Self::FailoverPass),
2661 _ => None,
2662 }
2663 }
2664 }
2665}
2666#[allow(clippy::derive_partial_eq_without_eq)]
2667#[derive(Clone, PartialEq, ::prost::Message)]
2668pub struct MatchArgument {
2669 #[prost(enumeration = "match_argument::Type", tag = "1")]
2670 pub r#type: i32,
2671 #[prost(string, tag = "2")]
2673 pub key: ::prost::alloc::string::String,
2674 #[prost(message, optional, tag = "3")]
2676 pub value: ::core::option::Option<MatchString>,
2677}
2678pub mod match_argument {
2680 #[derive(
2682 Clone,
2683 Copy,
2684 Debug,
2685 PartialEq,
2686 Eq,
2687 Hash,
2688 PartialOrd,
2689 Ord,
2690 ::prost::Enumeration
2691 )]
2692 #[repr(i32)]
2693 pub enum Type {
2694 Custom = 0,
2696 Method = 1,
2698 Header = 2,
2700 Query = 3,
2702 CallerService = 4,
2704 CallerIp = 5,
2706 CallerMetadata = 6,
2708 }
2709 impl Type {
2710 pub fn as_str_name(&self) -> &'static str {
2715 match self {
2716 Type::Custom => "CUSTOM",
2717 Type::Method => "METHOD",
2718 Type::Header => "HEADER",
2719 Type::Query => "QUERY",
2720 Type::CallerService => "CALLER_SERVICE",
2721 Type::CallerIp => "CALLER_IP",
2722 Type::CallerMetadata => "CALLER_METADATA",
2723 }
2724 }
2725 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2727 match value {
2728 "CUSTOM" => Some(Self::Custom),
2729 "METHOD" => Some(Self::Method),
2730 "HEADER" => Some(Self::Header),
2731 "QUERY" => Some(Self::Query),
2732 "CALLER_SERVICE" => Some(Self::CallerService),
2733 "CALLER_IP" => Some(Self::CallerIp),
2734 "CALLER_METADATA" => Some(Self::CallerMetadata),
2735 _ => None,
2736 }
2737 }
2738 }
2739}
2740#[allow(clippy::derive_partial_eq_without_eq)]
2742#[derive(Clone, PartialEq, ::prost::Message)]
2743pub struct ConcurrencyAmount {
2744 #[prost(uint32, tag = "1")]
2745 pub max_amount: u32,
2746}
2747#[allow(clippy::derive_partial_eq_without_eq)]
2749#[derive(Clone, PartialEq, ::prost::Message)]
2750pub struct CustomResponse {
2751 #[prost(string, tag = "3")]
2752 pub body: ::prost::alloc::string::String,
2753}
2754#[allow(clippy::derive_partial_eq_without_eq)]
2756#[derive(Clone, PartialEq, ::prost::Message)]
2757pub struct RateLimitCluster {
2758 #[prost(message, optional, tag = "1")]
2759 pub service: ::core::option::Option<::prost::alloc::string::String>,
2760 #[prost(message, optional, tag = "2")]
2762 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
2763}
2764#[allow(clippy::derive_partial_eq_without_eq)]
2766#[derive(Clone, PartialEq, ::prost::Message)]
2767pub struct Amount {
2768 #[prost(message, optional, tag = "1")]
2770 pub max_amount: ::core::option::Option<u32>,
2771 #[prost(message, optional, tag = "2")]
2773 pub valid_duration: ::core::option::Option<::prost_types::Duration>,
2774 #[prost(message, optional, tag = "3")]
2776 pub precision: ::core::option::Option<u32>,
2777 #[prost(message, optional, tag = "4")]
2779 pub start_amount: ::core::option::Option<u32>,
2780 #[prost(message, optional, tag = "5")]
2782 pub min_amount: ::core::option::Option<u32>,
2783}
2784#[allow(clippy::derive_partial_eq_without_eq)]
2786#[derive(Clone, PartialEq, ::prost::Message)]
2787pub struct Report {
2788 #[prost(message, optional, tag = "1")]
2790 pub interval: ::core::option::Option<::prost_types::Duration>,
2791 #[prost(message, optional, tag = "2")]
2793 pub amount_percent: ::core::option::Option<u32>,
2794}
2795#[allow(clippy::derive_partial_eq_without_eq)]
2797#[derive(Clone, PartialEq, ::prost::Message)]
2798pub struct AmountAdjuster {
2799 #[prost(message, optional, tag = "1")]
2800 pub climb: ::core::option::Option<ClimbConfig>,
2801}
2802#[allow(clippy::derive_partial_eq_without_eq)]
2804#[derive(Clone, PartialEq, ::prost::Message)]
2805pub struct ClimbConfig {
2806 #[prost(message, optional, tag = "1")]
2808 pub enable: ::core::option::Option<bool>,
2809 #[prost(message, optional, tag = "2")]
2811 pub metric: ::core::option::Option<climb_config::MetricConfig>,
2812 #[prost(message, optional, tag = "3")]
2814 pub policy: ::core::option::Option<climb_config::TriggerPolicy>,
2815 #[prost(message, optional, tag = "4")]
2817 pub throttling: ::core::option::Option<climb_config::ClimbThrottling>,
2818}
2819pub mod climb_config {
2821 #[allow(clippy::derive_partial_eq_without_eq)]
2823 #[derive(Clone, PartialEq, ::prost::Message)]
2824 pub struct MetricConfig {
2825 #[prost(message, optional, tag = "1")]
2827 pub window: ::core::option::Option<::prost_types::Duration>,
2828 #[prost(message, optional, tag = "2")]
2830 pub precision: ::core::option::Option<u32>,
2831 #[prost(message, optional, tag = "3")]
2833 pub report_interval: ::core::option::Option<::prost_types::Duration>,
2834 }
2835 #[allow(clippy::derive_partial_eq_without_eq)]
2837 #[derive(Clone, PartialEq, ::prost::Message)]
2838 pub struct TriggerPolicy {
2839 #[prost(message, optional, tag = "1")]
2841 pub error_rate: ::core::option::Option<trigger_policy::ErrorRate>,
2842 #[prost(message, optional, tag = "2")]
2844 pub slow_rate: ::core::option::Option<trigger_policy::SlowRate>,
2845 }
2846 pub mod trigger_policy {
2848 #[allow(clippy::derive_partial_eq_without_eq)]
2850 #[derive(Clone, PartialEq, ::prost::Message)]
2851 pub struct ErrorRate {
2852 #[prost(message, optional, tag = "1")]
2854 pub enable: ::core::option::Option<bool>,
2855 #[prost(message, optional, tag = "2")]
2857 pub request_volume_threshold: ::core::option::Option<u32>,
2858 #[prost(message, optional, tag = "3")]
2860 pub error_rate: ::core::option::Option<i32>,
2861 #[prost(message, repeated, tag = "4")]
2863 pub specials: ::prost::alloc::vec::Vec<error_rate::SpecialConfig>,
2864 }
2865 pub mod error_rate {
2867 #[allow(clippy::derive_partial_eq_without_eq)]
2869 #[derive(Clone, PartialEq, ::prost::Message)]
2870 pub struct SpecialConfig {
2871 #[prost(message, optional, tag = "1")]
2873 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
2874 #[prost(message, repeated, tag = "2")]
2876 pub error_codes: ::prost::alloc::vec::Vec<i64>,
2877 #[prost(message, optional, tag = "3")]
2879 pub error_rate: ::core::option::Option<i32>,
2880 }
2881 }
2882 #[allow(clippy::derive_partial_eq_without_eq)]
2884 #[derive(Clone, PartialEq, ::prost::Message)]
2885 pub struct SlowRate {
2886 #[prost(message, optional, tag = "1")]
2888 pub enable: ::core::option::Option<bool>,
2889 #[prost(message, optional, tag = "2")]
2891 pub max_rt: ::core::option::Option<::prost_types::Duration>,
2892 #[prost(message, optional, tag = "3")]
2894 pub slow_rate: ::core::option::Option<i32>,
2895 }
2896 }
2897 #[allow(clippy::derive_partial_eq_without_eq)]
2899 #[derive(Clone, PartialEq, ::prost::Message)]
2900 pub struct ClimbThrottling {
2901 #[prost(message, optional, tag = "1")]
2903 pub cold_below_tune_down_rate: ::core::option::Option<i32>,
2904 #[prost(message, optional, tag = "2")]
2906 pub cold_below_tune_up_rate: ::core::option::Option<i32>,
2907 #[prost(message, optional, tag = "3")]
2909 pub cold_above_tune_down_rate: ::core::option::Option<i32>,
2910 #[prost(message, optional, tag = "4")]
2912 pub cold_above_tune_up_rate: ::core::option::Option<i32>,
2913 #[prost(message, optional, tag = "5")]
2915 pub limit_threshold_to_tune_up: ::core::option::Option<i32>,
2916 #[prost(message, optional, tag = "6")]
2918 pub judge_duration: ::core::option::Option<::prost_types::Duration>,
2919 #[prost(message, optional, tag = "7")]
2921 pub tune_up_period: ::core::option::Option<i32>,
2922 #[prost(message, optional, tag = "8")]
2924 pub tune_down_period: ::core::option::Option<i32>,
2925 }
2926}
2927#[allow(clippy::derive_partial_eq_without_eq)]
2928#[derive(Clone, PartialEq, ::prost::Message)]
2929pub struct FaultDetector {
2930 #[prost(message, repeated, tag = "1")]
2932 pub rules: ::prost::alloc::vec::Vec<FaultDetectRule>,
2933 #[prost(string, tag = "2")]
2935 pub revision: ::prost::alloc::string::String,
2936}
2937#[allow(clippy::derive_partial_eq_without_eq)]
2938#[derive(Clone, PartialEq, ::prost::Message)]
2939pub struct FaultDetectRule {
2940 #[prost(string, tag = "1")]
2941 pub id: ::prost::alloc::string::String,
2942 #[prost(string, tag = "2")]
2944 pub name: ::prost::alloc::string::String,
2945 #[prost(string, tag = "3")]
2947 pub namespace: ::prost::alloc::string::String,
2948 #[prost(string, tag = "4")]
2950 pub revision: ::prost::alloc::string::String,
2951 #[prost(string, tag = "5")]
2953 pub ctime: ::prost::alloc::string::String,
2954 #[prost(string, tag = "6")]
2956 pub mtime: ::prost::alloc::string::String,
2957 #[prost(string, tag = "7")]
2959 pub description: ::prost::alloc::string::String,
2960 #[prost(message, optional, tag = "21")]
2962 pub target_service: ::core::option::Option<fault_detect_rule::DestinationService>,
2963 #[prost(uint32, tag = "22")]
2965 pub interval: u32,
2966 #[prost(uint32, tag = "23")]
2968 pub timeout: u32,
2969 #[prost(uint32, tag = "24")]
2971 pub port: u32,
2972 #[prost(enumeration = "fault_detect_rule::Protocol", tag = "25")]
2973 pub protocol: i32,
2974 #[prost(message, optional, tag = "26")]
2976 pub http_config: ::core::option::Option<HttpProtocolConfig>,
2977 #[prost(message, optional, tag = "27")]
2979 pub tcp_config: ::core::option::Option<TcpProtocolConfig>,
2980 #[prost(message, optional, tag = "28")]
2982 pub udp_config: ::core::option::Option<UdpProtocolConfig>,
2983 #[prost(uint32, tag = "29")]
2985 pub priority: u32,
2986 #[prost(map = "string, string", tag = "30")]
2988 pub metadata: ::std::collections::HashMap<
2989 ::prost::alloc::string::String,
2990 ::prost::alloc::string::String,
2991 >,
2992 #[prost(map = "string, string", tag = "31")]
2994 pub extend_info: ::std::collections::HashMap<
2995 ::prost::alloc::string::String,
2996 ::prost::alloc::string::String,
2997 >,
2998 #[prost(bool, tag = "40")]
3000 pub editable: bool,
3001 #[prost(bool, tag = "41")]
3002 pub deleteable: bool,
3003}
3004pub mod fault_detect_rule {
3006 #[allow(clippy::derive_partial_eq_without_eq)]
3007 #[derive(Clone, PartialEq, ::prost::Message)]
3008 pub struct DestinationService {
3009 #[prost(string, tag = "1")]
3010 pub service: ::prost::alloc::string::String,
3011 #[prost(string, tag = "2")]
3012 pub namespace: ::prost::alloc::string::String,
3013 #[deprecated]
3015 #[prost(message, optional, tag = "3")]
3016 pub method: ::core::option::Option<super::MatchString>,
3017 #[prost(message, optional, tag = "4")]
3018 pub api: ::core::option::Option<super::Api>,
3019 }
3020 #[derive(
3022 Clone,
3023 Copy,
3024 Debug,
3025 PartialEq,
3026 Eq,
3027 Hash,
3028 PartialOrd,
3029 Ord,
3030 ::prost::Enumeration
3031 )]
3032 #[repr(i32)]
3033 pub enum Protocol {
3034 Unknown = 0,
3035 Http = 1,
3036 Tcp = 2,
3037 Udp = 3,
3038 }
3039 impl Protocol {
3040 pub fn as_str_name(&self) -> &'static str {
3045 match self {
3046 Protocol::Unknown => "UNKNOWN",
3047 Protocol::Http => "HTTP",
3048 Protocol::Tcp => "TCP",
3049 Protocol::Udp => "UDP",
3050 }
3051 }
3052 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3054 match value {
3055 "UNKNOWN" => Some(Self::Unknown),
3056 "HTTP" => Some(Self::Http),
3057 "TCP" => Some(Self::Tcp),
3058 "UDP" => Some(Self::Udp),
3059 _ => None,
3060 }
3061 }
3062 }
3063}
3064#[allow(clippy::derive_partial_eq_without_eq)]
3065#[derive(Clone, PartialEq, ::prost::Message)]
3066pub struct HttpProtocolConfig {
3067 #[prost(string, tag = "1")]
3068 pub method: ::prost::alloc::string::String,
3069 #[prost(string, tag = "2")]
3070 pub url: ::prost::alloc::string::String,
3071 #[prost(message, repeated, tag = "3")]
3072 pub headers: ::prost::alloc::vec::Vec<http_protocol_config::MessageHeader>,
3073 #[prost(string, tag = "4")]
3074 pub body: ::prost::alloc::string::String,
3075}
3076pub mod http_protocol_config {
3078 #[allow(clippy::derive_partial_eq_without_eq)]
3079 #[derive(Clone, PartialEq, ::prost::Message)]
3080 pub struct MessageHeader {
3081 #[prost(string, tag = "1")]
3082 pub key: ::prost::alloc::string::String,
3083 #[prost(string, tag = "2")]
3084 pub value: ::prost::alloc::string::String,
3085 }
3086}
3087#[allow(clippy::derive_partial_eq_without_eq)]
3088#[derive(Clone, PartialEq, ::prost::Message)]
3089pub struct TcpProtocolConfig {
3090 #[prost(string, tag = "1")]
3091 pub send: ::prost::alloc::string::String,
3092 #[prost(string, repeated, tag = "2")]
3093 pub receive: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3094}
3095#[allow(clippy::derive_partial_eq_without_eq)]
3096#[derive(Clone, PartialEq, ::prost::Message)]
3097pub struct UdpProtocolConfig {
3098 #[prost(string, tag = "1")]
3099 pub send: ::prost::alloc::string::String,
3100 #[prost(string, repeated, tag = "2")]
3101 pub receive: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3102}
3103#[allow(clippy::derive_partial_eq_without_eq)]
3104#[derive(Clone, PartialEq, ::prost::Message)]
3105pub struct LoginRequest {
3106 #[prost(message, optional, tag = "1")]
3107 pub owner: ::core::option::Option<::prost::alloc::string::String>,
3108 #[prost(message, optional, tag = "2")]
3109 pub name: ::core::option::Option<::prost::alloc::string::String>,
3110 #[prost(message, optional, tag = "3")]
3111 pub password: ::core::option::Option<::prost::alloc::string::String>,
3112 #[prost(map = "string, string", tag = "4")]
3113 pub options: ::std::collections::HashMap<
3114 ::prost::alloc::string::String,
3115 ::prost::alloc::string::String,
3116 >,
3117}
3118#[allow(clippy::derive_partial_eq_without_eq)]
3119#[derive(Clone, PartialEq, ::prost::Message)]
3120pub struct LoginResponse {
3121 #[prost(message, optional, tag = "1")]
3122 pub user_id: ::core::option::Option<::prost::alloc::string::String>,
3123 #[prost(message, optional, tag = "2")]
3124 pub name: ::core::option::Option<::prost::alloc::string::String>,
3125 #[prost(message, optional, tag = "3")]
3126 pub role: ::core::option::Option<::prost::alloc::string::String>,
3127 #[prost(message, optional, tag = "4")]
3128 pub owner_id: ::core::option::Option<::prost::alloc::string::String>,
3129 #[prost(message, optional, tag = "5")]
3130 pub token: ::core::option::Option<::prost::alloc::string::String>,
3131 #[prost(map = "string, string", tag = "6")]
3132 pub options: ::std::collections::HashMap<
3133 ::prost::alloc::string::String,
3134 ::prost::alloc::string::String,
3135 >,
3136}
3137#[allow(clippy::derive_partial_eq_without_eq)]
3138#[derive(Clone, PartialEq, ::prost::Message)]
3139pub struct User {
3140 #[prost(message, optional, tag = "1")]
3141 pub id: ::core::option::Option<::prost::alloc::string::String>,
3142 #[prost(message, optional, tag = "2")]
3143 pub name: ::core::option::Option<::prost::alloc::string::String>,
3144 #[prost(message, optional, tag = "3")]
3145 pub password: ::core::option::Option<::prost::alloc::string::String>,
3146 #[prost(message, optional, tag = "4")]
3147 pub owner: ::core::option::Option<::prost::alloc::string::String>,
3148 #[prost(message, optional, tag = "5")]
3149 pub source: ::core::option::Option<::prost::alloc::string::String>,
3150 #[prost(message, optional, tag = "6")]
3151 pub auth_token: ::core::option::Option<::prost::alloc::string::String>,
3152 #[prost(message, optional, tag = "7")]
3153 pub token_enable: ::core::option::Option<bool>,
3154 #[prost(message, optional, tag = "8")]
3155 pub comment: ::core::option::Option<::prost::alloc::string::String>,
3156 #[prost(message, optional, tag = "9")]
3157 pub ctime: ::core::option::Option<::prost::alloc::string::String>,
3158 #[prost(message, optional, tag = "10")]
3159 pub mtime: ::core::option::Option<::prost::alloc::string::String>,
3160 #[prost(message, optional, tag = "11")]
3161 pub user_type: ::core::option::Option<::prost::alloc::string::String>,
3162 #[prost(message, optional, tag = "12")]
3163 pub mobile: ::core::option::Option<::prost::alloc::string::String>,
3164 #[prost(message, optional, tag = "13")]
3165 pub email: ::core::option::Option<::prost::alloc::string::String>,
3166 #[prost(map = "string, string", tag = "14")]
3167 pub metadata: ::std::collections::HashMap<
3168 ::prost::alloc::string::String,
3169 ::prost::alloc::string::String,
3170 >,
3171}
3172#[allow(clippy::derive_partial_eq_without_eq)]
3173#[derive(Clone, PartialEq, ::prost::Message)]
3174pub struct ModifyUserPassword {
3175 #[prost(message, optional, tag = "1")]
3176 pub id: ::core::option::Option<::prost::alloc::string::String>,
3177 #[prost(message, optional, tag = "2")]
3178 pub old_password: ::core::option::Option<::prost::alloc::string::String>,
3179 #[prost(message, optional, tag = "3")]
3180 pub new_password: ::core::option::Option<::prost::alloc::string::String>,
3181}
3182#[allow(clippy::derive_partial_eq_without_eq)]
3183#[derive(Clone, PartialEq, ::prost::Message)]
3184pub struct UserGroupRelation {
3185 #[prost(message, optional, tag = "1")]
3186 pub group_id: ::core::option::Option<::prost::alloc::string::String>,
3187 #[prost(message, repeated, tag = "2")]
3188 pub users: ::prost::alloc::vec::Vec<User>,
3189}
3190#[allow(clippy::derive_partial_eq_without_eq)]
3191#[derive(Clone, PartialEq, ::prost::Message)]
3192pub struct UserGroup {
3193 #[prost(message, optional, tag = "1")]
3194 pub id: ::core::option::Option<::prost::alloc::string::String>,
3195 #[prost(message, optional, tag = "2")]
3196 pub name: ::core::option::Option<::prost::alloc::string::String>,
3197 #[prost(message, optional, tag = "3")]
3198 pub owner: ::core::option::Option<::prost::alloc::string::String>,
3199 #[prost(message, optional, tag = "4")]
3200 pub auth_token: ::core::option::Option<::prost::alloc::string::String>,
3201 #[prost(message, optional, tag = "5")]
3202 pub token_enable: ::core::option::Option<bool>,
3203 #[prost(message, optional, tag = "6")]
3204 pub comment: ::core::option::Option<::prost::alloc::string::String>,
3205 #[prost(message, optional, tag = "7")]
3206 pub ctime: ::core::option::Option<::prost::alloc::string::String>,
3207 #[prost(message, optional, tag = "8")]
3208 pub mtime: ::core::option::Option<::prost::alloc::string::String>,
3209 #[prost(message, optional, tag = "9")]
3210 pub relation: ::core::option::Option<UserGroupRelation>,
3211 #[prost(message, optional, tag = "10")]
3212 pub user_count: ::core::option::Option<u32>,
3213 #[prost(message, optional, tag = "11")]
3214 pub source: ::core::option::Option<::prost::alloc::string::String>,
3215 #[prost(map = "string, string", tag = "12")]
3216 pub metadata: ::std::collections::HashMap<
3217 ::prost::alloc::string::String,
3218 ::prost::alloc::string::String,
3219 >,
3220}
3221#[allow(clippy::derive_partial_eq_without_eq)]
3222#[derive(Clone, PartialEq, ::prost::Message)]
3223pub struct ModifyUserGroup {
3224 #[prost(message, optional, tag = "1")]
3225 pub id: ::core::option::Option<::prost::alloc::string::String>,
3226 #[prost(message, optional, tag = "2")]
3227 pub owner: ::core::option::Option<::prost::alloc::string::String>,
3228 #[prost(message, optional, tag = "3")]
3229 pub name: ::core::option::Option<::prost::alloc::string::String>,
3230 #[prost(message, optional, tag = "4")]
3231 pub auth_token: ::core::option::Option<::prost::alloc::string::String>,
3232 #[prost(message, optional, tag = "5")]
3233 pub token_enable: ::core::option::Option<bool>,
3234 #[prost(message, optional, tag = "6")]
3235 pub comment: ::core::option::Option<::prost::alloc::string::String>,
3236 #[prost(message, optional, tag = "7")]
3237 pub add_relations: ::core::option::Option<UserGroupRelation>,
3238 #[prost(message, optional, tag = "8")]
3239 pub remove_relations: ::core::option::Option<UserGroupRelation>,
3240 #[prost(map = "string, string", tag = "9")]
3241 pub metadata: ::std::collections::HashMap<
3242 ::prost::alloc::string::String,
3243 ::prost::alloc::string::String,
3244 >,
3245 #[prost(message, optional, tag = "10")]
3246 pub source: ::core::option::Option<::prost::alloc::string::String>,
3247}
3248#[allow(clippy::derive_partial_eq_without_eq)]
3249#[derive(Clone, PartialEq, ::prost::Message)]
3250pub struct Role {
3251 #[prost(string, tag = "1")]
3252 pub id: ::prost::alloc::string::String,
3253 #[prost(string, tag = "2")]
3254 pub name: ::prost::alloc::string::String,
3255 #[prost(string, tag = "4")]
3256 pub owner: ::prost::alloc::string::String,
3257 #[prost(string, tag = "5")]
3258 pub source: ::prost::alloc::string::String,
3259 #[prost(bool, tag = "6")]
3260 pub default_role: bool,
3261 #[prost(map = "string, string", tag = "7")]
3262 pub metadata: ::std::collections::HashMap<
3263 ::prost::alloc::string::String,
3264 ::prost::alloc::string::String,
3265 >,
3266 #[prost(string, tag = "8")]
3267 pub comment: ::prost::alloc::string::String,
3268 #[prost(string, tag = "9")]
3269 pub ctime: ::prost::alloc::string::String,
3270 #[prost(string, tag = "10")]
3271 pub mtime: ::prost::alloc::string::String,
3272 #[prost(message, repeated, tag = "20")]
3273 pub users: ::prost::alloc::vec::Vec<User>,
3274 #[prost(message, repeated, tag = "21")]
3275 pub user_groups: ::prost::alloc::vec::Vec<UserGroup>,
3276}
3277#[allow(clippy::derive_partial_eq_without_eq)]
3278#[derive(Clone, PartialEq, ::prost::Message)]
3279pub struct Principal {
3280 #[prost(message, optional, tag = "1")]
3281 pub id: ::core::option::Option<::prost::alloc::string::String>,
3282 #[prost(message, optional, tag = "2")]
3283 pub name: ::core::option::Option<::prost::alloc::string::String>,
3284}
3285#[allow(clippy::derive_partial_eq_without_eq)]
3286#[derive(Clone, PartialEq, ::prost::Message)]
3287pub struct Principals {
3288 #[prost(message, repeated, tag = "1")]
3289 pub users: ::prost::alloc::vec::Vec<Principal>,
3290 #[prost(message, repeated, tag = "2")]
3291 pub groups: ::prost::alloc::vec::Vec<Principal>,
3292 #[prost(message, repeated, tag = "3")]
3293 pub roles: ::prost::alloc::vec::Vec<Principal>,
3294}
3295#[allow(clippy::derive_partial_eq_without_eq)]
3296#[derive(Clone, PartialEq, ::prost::Message)]
3297pub struct StrategyResourceEntry {
3298 #[prost(message, optional, tag = "1")]
3299 pub id: ::core::option::Option<::prost::alloc::string::String>,
3300 #[prost(message, optional, tag = "2")]
3301 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
3302 #[prost(message, optional, tag = "3")]
3303 pub name: ::core::option::Option<::prost::alloc::string::String>,
3304}
3305#[allow(clippy::derive_partial_eq_without_eq)]
3306#[derive(Clone, PartialEq, ::prost::Message)]
3307pub struct StrategyResources {
3308 #[prost(message, optional, tag = "1")]
3309 pub strategy_id: ::core::option::Option<::prost::alloc::string::String>,
3310 #[prost(message, repeated, tag = "2")]
3311 pub namespaces: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3312 #[prost(message, repeated, tag = "3")]
3313 pub services: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3314 #[prost(message, repeated, tag = "4")]
3315 pub config_groups: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3316 #[prost(message, repeated, tag = "5")]
3317 pub route_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3318 #[prost(message, repeated, tag = "6")]
3319 pub ratelimit_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3320 #[prost(message, repeated, tag = "7")]
3321 pub circuitbreaker_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3322 #[prost(message, repeated, tag = "8")]
3323 pub faultdetect_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3324 #[prost(message, repeated, tag = "9")]
3325 pub lane_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3326 #[prost(message, repeated, tag = "21")]
3327 pub users: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3328 #[prost(message, repeated, tag = "22")]
3329 pub user_groups: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3330 #[prost(message, repeated, tag = "23")]
3331 pub roles: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3332 #[prost(message, repeated, tag = "24")]
3333 pub auth_policies: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3334}
3335#[allow(clippy::derive_partial_eq_without_eq)]
3336#[derive(Clone, PartialEq, ::prost::Message)]
3337pub struct StrategyResourceLabel {
3338 #[prost(string, tag = "1")]
3339 pub key: ::prost::alloc::string::String,
3340 #[prost(string, tag = "2")]
3341 pub value: ::prost::alloc::string::String,
3342 #[prost(string, tag = "3")]
3343 pub compare_type: ::prost::alloc::string::String,
3344}
3345#[allow(clippy::derive_partial_eq_without_eq)]
3346#[derive(Clone, PartialEq, ::prost::Message)]
3347pub struct AuthStrategy {
3348 #[prost(message, optional, tag = "1")]
3349 pub id: ::core::option::Option<::prost::alloc::string::String>,
3350 #[prost(message, optional, tag = "2")]
3351 pub name: ::core::option::Option<::prost::alloc::string::String>,
3352 #[prost(message, optional, tag = "3")]
3353 pub principals: ::core::option::Option<Principals>,
3354 #[prost(message, optional, tag = "4")]
3355 pub resources: ::core::option::Option<StrategyResources>,
3356 #[prost(enumeration = "AuthAction", tag = "5")]
3357 pub action: i32,
3358 #[prost(message, optional, tag = "6")]
3359 pub comment: ::core::option::Option<::prost::alloc::string::String>,
3360 #[prost(message, optional, tag = "7")]
3361 pub owner: ::core::option::Option<::prost::alloc::string::String>,
3362 #[prost(message, optional, tag = "8")]
3363 pub ctime: ::core::option::Option<::prost::alloc::string::String>,
3364 #[prost(message, optional, tag = "9")]
3365 pub mtime: ::core::option::Option<::prost::alloc::string::String>,
3366 #[prost(message, optional, tag = "10")]
3367 pub auth_token: ::core::option::Option<::prost::alloc::string::String>,
3368 #[prost(message, optional, tag = "11")]
3369 pub default_strategy: ::core::option::Option<bool>,
3370 #[prost(map = "string, string", tag = "12")]
3371 pub metadata: ::std::collections::HashMap<
3372 ::prost::alloc::string::String,
3373 ::prost::alloc::string::String,
3374 >,
3375 #[prost(message, optional, tag = "13")]
3376 pub source: ::core::option::Option<::prost::alloc::string::String>,
3377 #[prost(string, repeated, tag = "14")]
3378 pub functions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3379 #[prost(message, repeated, tag = "15")]
3380 pub resource_labels: ::prost::alloc::vec::Vec<StrategyResourceLabel>,
3381}
3382#[allow(clippy::derive_partial_eq_without_eq)]
3383#[derive(Clone, PartialEq, ::prost::Message)]
3384pub struct ModifyAuthStrategy {
3385 #[prost(message, optional, tag = "1")]
3386 pub id: ::core::option::Option<::prost::alloc::string::String>,
3387 #[prost(message, optional, tag = "2")]
3388 pub name: ::core::option::Option<::prost::alloc::string::String>,
3389 #[prost(message, optional, tag = "3")]
3390 pub add_principals: ::core::option::Option<Principals>,
3391 #[prost(message, optional, tag = "4")]
3392 pub remove_principals: ::core::option::Option<Principals>,
3393 #[prost(message, optional, tag = "5")]
3394 pub add_resources: ::core::option::Option<StrategyResources>,
3395 #[prost(message, optional, tag = "6")]
3396 pub remove_resources: ::core::option::Option<StrategyResources>,
3397 #[prost(enumeration = "AuthAction", tag = "7")]
3398 pub action: i32,
3399 #[prost(message, optional, tag = "8")]
3400 pub comment: ::core::option::Option<::prost::alloc::string::String>,
3401 #[prost(message, optional, tag = "9")]
3402 pub owner: ::core::option::Option<::prost::alloc::string::String>,
3403 #[prost(map = "string, string", tag = "12")]
3404 pub metadata: ::std::collections::HashMap<
3405 ::prost::alloc::string::String,
3406 ::prost::alloc::string::String,
3407 >,
3408 #[prost(message, optional, tag = "13")]
3409 pub source: ::core::option::Option<::prost::alloc::string::String>,
3410 #[prost(string, repeated, tag = "14")]
3411 pub functions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3412 #[prost(message, repeated, tag = "15")]
3413 pub resource_labels: ::prost::alloc::vec::Vec<StrategyResourceLabel>,
3414}
3415#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3416#[repr(i32)]
3417pub enum AuthAction {
3418 OnlyRead = 0,
3420 ReadWrite = 1,
3422 Allow = 10,
3423 Deny = 11,
3424}
3425impl AuthAction {
3426 pub fn as_str_name(&self) -> &'static str {
3431 match self {
3432 AuthAction::OnlyRead => "ONLY_READ",
3433 AuthAction::ReadWrite => "READ_WRITE",
3434 AuthAction::Allow => "ALLOW",
3435 AuthAction::Deny => "DENY",
3436 }
3437 }
3438 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3440 match value {
3441 "ONLY_READ" => Some(Self::OnlyRead),
3442 "READ_WRITE" => Some(Self::ReadWrite),
3443 "ALLOW" => Some(Self::Allow),
3444 "DENY" => Some(Self::Deny),
3445 _ => None,
3446 }
3447 }
3448}
3449#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3450#[repr(i32)]
3451pub enum ResourceType {
3452 Namespaces = 0,
3453 Services = 1,
3454 ConfigGroups = 2,
3455 RouteRules = 3,
3456 RateLimitRules = 4,
3457 CircuitBreakerRules = 5,
3458 FaultDetectRules = 6,
3459 LaneRules = 7,
3460 Users = 20,
3461 UserGroups = 21,
3462 Roles = 22,
3463 PolicyRules = 23,
3464}
3465impl ResourceType {
3466 pub fn as_str_name(&self) -> &'static str {
3471 match self {
3472 ResourceType::Namespaces => "Namespaces",
3473 ResourceType::Services => "Services",
3474 ResourceType::ConfigGroups => "ConfigGroups",
3475 ResourceType::RouteRules => "RouteRules",
3476 ResourceType::RateLimitRules => "RateLimitRules",
3477 ResourceType::CircuitBreakerRules => "CircuitBreakerRules",
3478 ResourceType::FaultDetectRules => "FaultDetectRules",
3479 ResourceType::LaneRules => "LaneRules",
3480 ResourceType::Users => "Users",
3481 ResourceType::UserGroups => "UserGroups",
3482 ResourceType::Roles => "Roles",
3483 ResourceType::PolicyRules => "PolicyRules",
3484 }
3485 }
3486 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3488 match value {
3489 "Namespaces" => Some(Self::Namespaces),
3490 "Services" => Some(Self::Services),
3491 "ConfigGroups" => Some(Self::ConfigGroups),
3492 "RouteRules" => Some(Self::RouteRules),
3493 "RateLimitRules" => Some(Self::RateLimitRules),
3494 "CircuitBreakerRules" => Some(Self::CircuitBreakerRules),
3495 "FaultDetectRules" => Some(Self::FaultDetectRules),
3496 "LaneRules" => Some(Self::LaneRules),
3497 "Users" => Some(Self::Users),
3498 "UserGroups" => Some(Self::UserGroups),
3499 "Roles" => Some(Self::Roles),
3500 "PolicyRules" => Some(Self::PolicyRules),
3501 _ => None,
3502 }
3503 }
3504}
3505#[allow(clippy::derive_partial_eq_without_eq)]
3507#[derive(Clone, PartialEq, ::prost::Message)]
3508pub struct TrafficEntry {
3509 #[prost(string, tag = "1")]
3514 pub r#type: ::prost::alloc::string::String,
3515 #[prost(message, optional, tag = "2")]
3516 pub selector: ::core::option::Option<::prost_types::Any>,
3517}
3518#[allow(clippy::derive_partial_eq_without_eq)]
3520#[derive(Clone, PartialEq, ::prost::Message)]
3521pub struct ServiceGatewaySelector {
3522 #[prost(string, tag = "1")]
3523 pub namespace: ::prost::alloc::string::String,
3524 #[prost(string, tag = "2")]
3525 pub service: ::prost::alloc::string::String,
3526 #[prost(map = "string, message", tag = "3")]
3528 pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
3529}
3530#[allow(clippy::derive_partial_eq_without_eq)]
3532#[derive(Clone, PartialEq, ::prost::Message)]
3533pub struct ServiceSelector {
3534 #[prost(string, tag = "1")]
3535 pub namespace: ::prost::alloc::string::String,
3536 #[prost(string, tag = "2")]
3537 pub service: ::prost::alloc::string::String,
3538 #[prost(map = "string, message", tag = "3")]
3540 pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
3541}
3542#[allow(clippy::derive_partial_eq_without_eq)]
3544#[derive(Clone, PartialEq, ::prost::Message)]
3545pub struct LaneGroup {
3546 #[prost(string, tag = "1")]
3548 pub id: ::prost::alloc::string::String,
3549 #[prost(string, tag = "2")]
3551 pub name: ::prost::alloc::string::String,
3552 #[prost(message, repeated, tag = "3")]
3554 pub entries: ::prost::alloc::vec::Vec<TrafficEntry>,
3555 #[prost(message, repeated, tag = "4")]
3557 pub destinations: ::prost::alloc::vec::Vec<DestinationGroup>,
3558 #[prost(string, tag = "7")]
3560 pub revision: ::prost::alloc::string::String,
3561 #[prost(string, tag = "8")]
3563 pub description: ::prost::alloc::string::String,
3564 #[prost(string, tag = "9")]
3566 pub ctime: ::prost::alloc::string::String,
3567 #[prost(string, tag = "10")]
3569 pub mtime: ::prost::alloc::string::String,
3570 #[prost(message, repeated, tag = "11")]
3572 pub rules: ::prost::alloc::vec::Vec<LaneRule>,
3573 #[prost(map = "string, string", tag = "12")]
3575 pub metadata: ::std::collections::HashMap<
3576 ::prost::alloc::string::String,
3577 ::prost::alloc::string::String,
3578 >,
3579 #[prost(bool, tag = "20")]
3581 pub editable: bool,
3582 #[prost(bool, tag = "21")]
3583 pub deleteable: bool,
3584}
3585#[allow(clippy::derive_partial_eq_without_eq)]
3587#[derive(Clone, PartialEq, ::prost::Message)]
3588pub struct TrafficMatchRule {
3589 #[prost(message, repeated, tag = "4")]
3591 pub arguments: ::prost::alloc::vec::Vec<SourceMatch>,
3592 #[prost(enumeration = "traffic_match_rule::TrafficMatchMode", tag = "14")]
3593 pub match_mode: i32,
3594}
3595pub mod traffic_match_rule {
3597 #[derive(
3599 Clone,
3600 Copy,
3601 Debug,
3602 PartialEq,
3603 Eq,
3604 Hash,
3605 PartialOrd,
3606 Ord,
3607 ::prost::Enumeration
3608 )]
3609 #[repr(i32)]
3610 pub enum TrafficMatchMode {
3611 And = 0,
3613 Or = 1,
3615 }
3616 impl TrafficMatchMode {
3617 pub fn as_str_name(&self) -> &'static str {
3622 match self {
3623 TrafficMatchMode::And => "AND",
3624 TrafficMatchMode::Or => "OR",
3625 }
3626 }
3627 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3629 match value {
3630 "AND" => Some(Self::And),
3631 "OR" => Some(Self::Or),
3632 _ => None,
3633 }
3634 }
3635 }
3636}
3637#[allow(clippy::derive_partial_eq_without_eq)]
3639#[derive(Clone, PartialEq, ::prost::Message)]
3640pub struct LaneRule {
3641 #[prost(string, tag = "1")]
3642 pub id: ::prost::alloc::string::String,
3643 #[prost(string, tag = "2")]
3644 pub name: ::prost::alloc::string::String,
3645 #[prost(string, tag = "3")]
3647 pub group_name: ::prost::alloc::string::String,
3648 #[prost(message, optional, tag = "4")]
3650 pub traffic_match_rule: ::core::option::Option<TrafficMatchRule>,
3651 #[prost(string, tag = "5")]
3653 pub default_label_value: ::prost::alloc::string::String,
3654 #[prost(bool, tag = "6")]
3656 pub enable: bool,
3657 #[prost(enumeration = "lane_rule::LaneMatchMode", tag = "7")]
3658 pub match_mode: i32,
3659 #[prost(string, tag = "8")]
3661 pub revision: ::prost::alloc::string::String,
3662 #[prost(string, tag = "9")]
3664 pub ctime: ::prost::alloc::string::String,
3665 #[prost(string, tag = "10")]
3667 pub mtime: ::prost::alloc::string::String,
3668 #[prost(string, tag = "11")]
3670 pub etime: ::prost::alloc::string::String,
3671 #[prost(uint32, tag = "12")]
3673 pub priority: u32,
3674 #[prost(string, tag = "13")]
3676 pub description: ::prost::alloc::string::String,
3677 #[prost(string, tag = "14")]
3679 pub label_key: ::prost::alloc::string::String,
3680}
3681pub mod lane_rule {
3683 #[derive(
3684 Clone,
3685 Copy,
3686 Debug,
3687 PartialEq,
3688 Eq,
3689 Hash,
3690 PartialOrd,
3691 Ord,
3692 ::prost::Enumeration
3693 )]
3694 #[repr(i32)]
3695 pub enum LaneMatchMode {
3696 Strict = 0,
3698 Permissive = 1,
3700 }
3701 impl LaneMatchMode {
3702 pub fn as_str_name(&self) -> &'static str {
3707 match self {
3708 LaneMatchMode::Strict => "STRICT",
3709 LaneMatchMode::Permissive => "PERMISSIVE",
3710 }
3711 }
3712 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3714 match value {
3715 "STRICT" => Some(Self::Strict),
3716 "PERMISSIVE" => Some(Self::Permissive),
3717 _ => None,
3718 }
3719 }
3720 }
3721}
3722#[allow(clippy::derive_partial_eq_without_eq)]
3724#[derive(Clone, PartialEq, ::prost::Message)]
3725pub struct LosslessRule {
3726 #[prost(string, tag = "1")]
3728 pub id: ::prost::alloc::string::String,
3729 #[prost(string, tag = "2")]
3731 pub service: ::prost::alloc::string::String,
3732 #[prost(string, tag = "3")]
3734 pub namespace: ::prost::alloc::string::String,
3735 #[prost(string, tag = "4")]
3737 pub revision: ::prost::alloc::string::String,
3738 #[prost(string, tag = "5")]
3740 pub ctime: ::prost::alloc::string::String,
3741 #[prost(string, tag = "6")]
3743 pub mtime: ::prost::alloc::string::String,
3744 #[prost(message, optional, tag = "7")]
3746 pub lossless_online: ::core::option::Option<LosslessOnline>,
3747 #[prost(message, optional, tag = "8")]
3749 pub lossless_offline: ::core::option::Option<LosslessOffline>,
3750 #[prost(map = "string, string", tag = "9")]
3752 pub metadata: ::std::collections::HashMap<
3753 ::prost::alloc::string::String,
3754 ::prost::alloc::string::String,
3755 >,
3756 #[prost(bool, tag = "30")]
3758 pub editable: bool,
3759 #[prost(bool, tag = "31")]
3760 pub deleteable: bool,
3761}
3762#[allow(clippy::derive_partial_eq_without_eq)]
3763#[derive(Clone, PartialEq, ::prost::Message)]
3764pub struct LosslessOnline {
3765 #[prost(message, optional, tag = "1")]
3767 pub delay_register: ::core::option::Option<DelayRegister>,
3768 #[prost(message, optional, tag = "2")]
3770 pub warmup: ::core::option::Option<Warmup>,
3771 #[prost(message, optional, tag = "3")]
3773 pub readiness: ::core::option::Option<Readiness>,
3774}
3775#[allow(clippy::derive_partial_eq_without_eq)]
3776#[derive(Clone, PartialEq, ::prost::Message)]
3777pub struct DelayRegister {
3778 #[prost(bool, tag = "1")]
3780 pub enable: bool,
3781 #[prost(enumeration = "delay_register::DelayStrategy", tag = "2")]
3783 pub strategy: i32,
3784 #[prost(int32, tag = "3")]
3786 pub interval_second: i32,
3787 #[prost(string, tag = "4")]
3789 pub health_check_protocol: ::prost::alloc::string::String,
3790 #[prost(string, tag = "5")]
3792 pub health_check_method: ::prost::alloc::string::String,
3793 #[prost(string, tag = "6")]
3795 pub health_check_path: ::prost::alloc::string::String,
3796 #[prost(string, tag = "7")]
3798 pub health_check_interval_second: ::prost::alloc::string::String,
3799}
3800pub mod delay_register {
3802 #[derive(
3803 Clone,
3804 Copy,
3805 Debug,
3806 PartialEq,
3807 Eq,
3808 Hash,
3809 PartialOrd,
3810 Ord,
3811 ::prost::Enumeration
3812 )]
3813 #[repr(i32)]
3814 pub enum DelayStrategy {
3815 DelayByTime = 0,
3817 DelayByHealthCheck = 1,
3819 }
3820 impl DelayStrategy {
3821 pub fn as_str_name(&self) -> &'static str {
3826 match self {
3827 DelayStrategy::DelayByTime => "DELAY_BY_TIME",
3828 DelayStrategy::DelayByHealthCheck => "DELAY_BY_HEALTH_CHECK",
3829 }
3830 }
3831 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3833 match value {
3834 "DELAY_BY_TIME" => Some(Self::DelayByTime),
3835 "DELAY_BY_HEALTH_CHECK" => Some(Self::DelayByHealthCheck),
3836 _ => None,
3837 }
3838 }
3839 }
3840}
3841#[allow(clippy::derive_partial_eq_without_eq)]
3842#[derive(Clone, PartialEq, ::prost::Message)]
3843pub struct Warmup {
3844 #[prost(bool, tag = "1")]
3846 pub enable: bool,
3847 #[prost(int32, tag = "2")]
3849 pub interval_second: i32,
3850 #[prost(bool, tag = "3")]
3852 pub enable_overload_protection: bool,
3853 #[prost(int32, tag = "4")]
3855 pub overload_protection_threshold: i32,
3856 #[prost(int32, tag = "5")]
3858 pub curvature: i32,
3859}
3860#[allow(clippy::derive_partial_eq_without_eq)]
3861#[derive(Clone, PartialEq, ::prost::Message)]
3862pub struct Readiness {
3863 #[prost(bool, tag = "1")]
3865 pub enable: bool,
3866}
3867#[allow(clippy::derive_partial_eq_without_eq)]
3868#[derive(Clone, PartialEq, ::prost::Message)]
3869pub struct LosslessOffline {
3870 #[prost(bool, tag = "1")]
3872 pub enable: bool,
3873}
3874#[allow(clippy::derive_partial_eq_without_eq)]
3875#[derive(Clone, PartialEq, ::prost::Message)]
3876pub struct BlockAllowListRule {
3877 #[prost(string, tag = "1")]
3879 pub id: ::prost::alloc::string::String,
3880 #[prost(string, tag = "2")]
3882 pub name: ::prost::alloc::string::String,
3883 #[prost(map = "string, string", tag = "3")]
3885 pub metadata: ::std::collections::HashMap<
3886 ::prost::alloc::string::String,
3887 ::prost::alloc::string::String,
3888 >,
3889 #[prost(string, tag = "4")]
3891 pub namespace: ::prost::alloc::string::String,
3892 #[prost(string, tag = "5")]
3894 pub service: ::prost::alloc::string::String,
3895 #[prost(string, tag = "6")]
3897 pub description: ::prost::alloc::string::String,
3898 #[prost(uint32, tag = "7")]
3900 pub priority: u32,
3901 #[prost(bool, tag = "8")]
3903 pub enable: bool,
3904 #[prost(string, tag = "9")]
3906 pub ctime: ::prost::alloc::string::String,
3907 #[prost(string, tag = "10")]
3909 pub mtime: ::prost::alloc::string::String,
3910 #[prost(string, tag = "11")]
3912 pub etime: ::prost::alloc::string::String,
3913 #[prost(message, repeated, tag = "12")]
3915 pub block_allow_config: ::prost::alloc::vec::Vec<BlockAllowConfig>,
3916}
3917#[allow(clippy::derive_partial_eq_without_eq)]
3918#[derive(Clone, PartialEq, ::prost::Message)]
3919pub struct BlockAllowConfig {
3920 #[prost(message, optional, tag = "1")]
3922 pub api: ::core::option::Option<Api>,
3923 #[prost(message, repeated, tag = "2")]
3925 pub arguments: ::prost::alloc::vec::Vec<block_allow_config::MatchArgument>,
3926 #[prost(enumeration = "block_allow_config::BlockAllowPolicy", tag = "3")]
3928 pub block_allow_policy: i32,
3929}
3930pub mod block_allow_config {
3932 #[allow(clippy::derive_partial_eq_without_eq)]
3933 #[derive(Clone, PartialEq, ::prost::Message)]
3934 pub struct MatchArgument {
3935 #[prost(enumeration = "match_argument::Type", tag = "1")]
3936 pub r#type: i32,
3937 #[prost(string, tag = "2")]
3939 pub key: ::prost::alloc::string::String,
3940 #[prost(message, optional, tag = "3")]
3942 pub value: ::core::option::Option<super::MatchString>,
3943 }
3944 pub mod match_argument {
3946 #[derive(
3948 Clone,
3949 Copy,
3950 Debug,
3951 PartialEq,
3952 Eq,
3953 Hash,
3954 PartialOrd,
3955 Ord,
3956 ::prost::Enumeration
3957 )]
3958 #[repr(i32)]
3959 pub enum Type {
3960 Custom = 0,
3962 Header = 1,
3964 Query = 2,
3966 CallerService = 3,
3968 CallerIp = 4,
3970 CallerMetadata = 5,
3972 CalleeMetadata = 6,
3974 }
3975 impl Type {
3976 pub fn as_str_name(&self) -> &'static str {
3981 match self {
3982 Type::Custom => "CUSTOM",
3983 Type::Header => "HEADER",
3984 Type::Query => "QUERY",
3985 Type::CallerService => "CALLER_SERVICE",
3986 Type::CallerIp => "CALLER_IP",
3987 Type::CallerMetadata => "CALLER_METADATA",
3988 Type::CalleeMetadata => "CALLEE_METADATA",
3989 }
3990 }
3991 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3993 match value {
3994 "CUSTOM" => Some(Self::Custom),
3995 "HEADER" => Some(Self::Header),
3996 "QUERY" => Some(Self::Query),
3997 "CALLER_SERVICE" => Some(Self::CallerService),
3998 "CALLER_IP" => Some(Self::CallerIp),
3999 "CALLER_METADATA" => Some(Self::CallerMetadata),
4000 "CALLEE_METADATA" => Some(Self::CalleeMetadata),
4001 _ => None,
4002 }
4003 }
4004 }
4005 }
4006 #[derive(
4007 Clone,
4008 Copy,
4009 Debug,
4010 PartialEq,
4011 Eq,
4012 Hash,
4013 PartialOrd,
4014 Ord,
4015 ::prost::Enumeration
4016 )]
4017 #[repr(i32)]
4018 pub enum BlockAllowPolicy {
4019 AllowList = 0,
4020 BlockList = 1,
4021 }
4022 impl BlockAllowPolicy {
4023 pub fn as_str_name(&self) -> &'static str {
4028 match self {
4029 BlockAllowPolicy::AllowList => "ALLOW_LIST",
4030 BlockAllowPolicy::BlockList => "BLOCK_LIST",
4031 }
4032 }
4033 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4035 match value {
4036 "ALLOW_LIST" => Some(Self::AllowList),
4037 "BLOCK_LIST" => Some(Self::BlockList),
4038 _ => None,
4039 }
4040 }
4041 }
4042}
4043#[allow(clippy::derive_partial_eq_without_eq)]
4044#[derive(Clone, PartialEq, ::prost::Message)]
4045pub struct Response {
4046 #[prost(message, optional, tag = "1")]
4047 pub code: ::core::option::Option<u32>,
4048 #[prost(message, optional, tag = "2")]
4049 pub info: ::core::option::Option<::prost::alloc::string::String>,
4050 #[prost(message, optional, tag = "3")]
4051 pub client: ::core::option::Option<Client>,
4052 #[prost(message, optional, tag = "4")]
4053 pub namespace: ::core::option::Option<Namespace>,
4054 #[prost(message, optional, tag = "5")]
4055 pub service: ::core::option::Option<Service>,
4056 #[prost(message, optional, tag = "6")]
4057 pub instance: ::core::option::Option<Instance>,
4058 #[prost(message, optional, tag = "7")]
4059 pub routing: ::core::option::Option<Routing>,
4060 #[prost(message, optional, tag = "8")]
4061 pub alias: ::core::option::Option<ServiceAlias>,
4062 #[prost(message, optional, tag = "9")]
4063 pub rate_limit: ::core::option::Option<Rule>,
4064 #[prost(message, optional, tag = "10")]
4065 pub circuit_breaker: ::core::option::Option<CircuitBreaker>,
4066 #[prost(message, optional, tag = "11")]
4067 pub config_release: ::core::option::Option<ConfigRelease>,
4068 #[prost(message, optional, tag = "19")]
4069 pub user: ::core::option::Option<User>,
4070 #[prost(message, optional, tag = "20")]
4071 pub user_group: ::core::option::Option<UserGroup>,
4072 #[prost(message, optional, tag = "21")]
4073 pub auth_strategy: ::core::option::Option<AuthStrategy>,
4074 #[prost(message, optional, tag = "22")]
4075 pub relation: ::core::option::Option<UserGroupRelation>,
4076 #[prost(message, optional, tag = "23")]
4077 pub login_response: ::core::option::Option<LoginResponse>,
4078 #[prost(message, optional, tag = "24")]
4079 pub modify_auth_strategy: ::core::option::Option<ModifyAuthStrategy>,
4080 #[prost(message, optional, tag = "25")]
4081 pub modify_user_group: ::core::option::Option<ModifyUserGroup>,
4082 #[prost(message, optional, tag = "26")]
4083 pub resources: ::core::option::Option<StrategyResources>,
4084 #[prost(message, optional, tag = "27")]
4085 pub option_switch: ::core::option::Option<OptionSwitch>,
4086 #[prost(message, optional, tag = "28")]
4087 pub instance_labels: ::core::option::Option<InstanceLabels>,
4088 #[prost(message, optional, tag = "29")]
4089 pub data: ::core::option::Option<::prost_types::Any>,
4090 #[prost(message, optional, tag = "30")]
4091 pub service_contract: ::core::option::Option<ServiceContract>,
4092}
4093#[allow(clippy::derive_partial_eq_without_eq)]
4094#[derive(Clone, PartialEq, ::prost::Message)]
4095pub struct BatchWriteResponse {
4096 #[prost(message, optional, tag = "1")]
4097 pub code: ::core::option::Option<u32>,
4098 #[prost(message, optional, tag = "2")]
4099 pub info: ::core::option::Option<::prost::alloc::string::String>,
4100 #[prost(message, optional, tag = "3")]
4101 pub size: ::core::option::Option<u32>,
4102 #[prost(message, repeated, tag = "4")]
4103 pub responses: ::prost::alloc::vec::Vec<Response>,
4104}
4105#[allow(clippy::derive_partial_eq_without_eq)]
4106#[derive(Clone, PartialEq, ::prost::Message)]
4107pub struct BatchQueryResponse {
4108 #[prost(message, optional, tag = "1")]
4109 pub code: ::core::option::Option<u32>,
4110 #[prost(message, optional, tag = "2")]
4111 pub info: ::core::option::Option<::prost::alloc::string::String>,
4112 #[prost(message, optional, tag = "3")]
4113 pub amount: ::core::option::Option<u32>,
4114 #[prost(message, optional, tag = "4")]
4115 pub size: ::core::option::Option<u32>,
4116 #[prost(message, repeated, tag = "5")]
4117 pub namespaces: ::prost::alloc::vec::Vec<Namespace>,
4118 #[prost(message, repeated, tag = "6")]
4119 pub services: ::prost::alloc::vec::Vec<Service>,
4120 #[prost(message, repeated, tag = "7")]
4121 pub instances: ::prost::alloc::vec::Vec<Instance>,
4122 #[prost(message, repeated, tag = "8")]
4123 pub routings: ::prost::alloc::vec::Vec<Routing>,
4124 #[prost(message, repeated, tag = "9")]
4125 pub aliases: ::prost::alloc::vec::Vec<ServiceAlias>,
4126 #[prost(message, repeated, tag = "10")]
4127 pub rate_limits: ::prost::alloc::vec::Vec<Rule>,
4128 #[prost(message, repeated, tag = "11")]
4129 pub config_with_services: ::prost::alloc::vec::Vec<ConfigWithService>,
4130 #[prost(message, repeated, tag = "18")]
4131 pub users: ::prost::alloc::vec::Vec<User>,
4132 #[prost(message, repeated, tag = "19")]
4133 pub user_groups: ::prost::alloc::vec::Vec<UserGroup>,
4134 #[prost(message, repeated, tag = "20")]
4135 pub auth_strategies: ::prost::alloc::vec::Vec<AuthStrategy>,
4136 #[prost(message, repeated, tag = "21")]
4137 pub clients: ::prost::alloc::vec::Vec<Client>,
4138 #[prost(message, repeated, tag = "22")]
4139 pub data: ::prost::alloc::vec::Vec<::prost_types::Any>,
4140 #[prost(message, optional, tag = "23")]
4141 pub summary: ::core::option::Option<Summary>,
4142}
4143#[allow(clippy::derive_partial_eq_without_eq)]
4144#[derive(Clone, PartialEq, ::prost::Message)]
4145pub struct DiscoverResponse {
4146 #[prost(message, optional, tag = "1")]
4147 pub code: ::core::option::Option<u32>,
4148 #[prost(message, optional, tag = "2")]
4149 pub info: ::core::option::Option<::prost::alloc::string::String>,
4150 #[prost(enumeration = "discover_response::DiscoverResponseType", tag = "3")]
4151 pub r#type: i32,
4152 #[prost(message, optional, tag = "4")]
4153 pub service: ::core::option::Option<Service>,
4154 #[prost(message, repeated, tag = "5")]
4155 pub instances: ::prost::alloc::vec::Vec<Instance>,
4156 #[prost(message, optional, tag = "6")]
4157 pub routing: ::core::option::Option<Routing>,
4158 #[prost(message, optional, tag = "7")]
4159 pub rate_limit: ::core::option::Option<RateLimit>,
4160 #[prost(message, optional, tag = "8")]
4161 pub circuit_breaker: ::core::option::Option<CircuitBreaker>,
4162 #[prost(message, repeated, tag = "9")]
4163 pub services: ::prost::alloc::vec::Vec<Service>,
4164 #[prost(message, repeated, tag = "10")]
4165 pub namespaces: ::prost::alloc::vec::Vec<Namespace>,
4166 #[prost(message, optional, tag = "11")]
4167 pub fault_detector: ::core::option::Option<FaultDetector>,
4168 #[prost(message, optional, tag = "21")]
4169 pub alias_for: ::core::option::Option<Service>,
4170 #[prost(message, repeated, tag = "22")]
4171 pub lanes: ::prost::alloc::vec::Vec<LaneGroup>,
4172 #[prost(message, repeated, tag = "23")]
4174 pub custom_route_rules: ::prost::alloc::vec::Vec<RouteRule>,
4175 #[prost(message, repeated, tag = "24")]
4177 pub nearby_route_rules: ::prost::alloc::vec::Vec<RouteRule>,
4178 #[prost(message, repeated, tag = "25")]
4180 pub lossless_rules: ::prost::alloc::vec::Vec<LosslessRule>,
4181 #[prost(message, repeated, tag = "26")]
4183 pub block_allow_list_rule: ::prost::alloc::vec::Vec<BlockAllowListRule>,
4184}
4185pub mod discover_response {
4187 #[derive(
4188 Clone,
4189 Copy,
4190 Debug,
4191 PartialEq,
4192 Eq,
4193 Hash,
4194 PartialOrd,
4195 Ord,
4196 ::prost::Enumeration
4197 )]
4198 #[repr(i32)]
4199 pub enum DiscoverResponseType {
4200 Unknown = 0,
4201 Instance = 1,
4202 Cluster = 2,
4203 Routing = 3,
4204 RateLimit = 4,
4205 CircuitBreaker = 5,
4206 Services = 6,
4207 Namespaces = 12,
4208 FaultDetector = 13,
4209 Lane = 100,
4210 CustomRouteRule = 101,
4212 NearbyRouteRule = 102,
4214 Lossless = 103,
4216 BlockAllowRule = 104,
4218 }
4219 impl DiscoverResponseType {
4220 pub fn as_str_name(&self) -> &'static str {
4225 match self {
4226 DiscoverResponseType::Unknown => "UNKNOWN",
4227 DiscoverResponseType::Instance => "INSTANCE",
4228 DiscoverResponseType::Cluster => "CLUSTER",
4229 DiscoverResponseType::Routing => "ROUTING",
4230 DiscoverResponseType::RateLimit => "RATE_LIMIT",
4231 DiscoverResponseType::CircuitBreaker => "CIRCUIT_BREAKER",
4232 DiscoverResponseType::Services => "SERVICES",
4233 DiscoverResponseType::Namespaces => "NAMESPACES",
4234 DiscoverResponseType::FaultDetector => "FAULT_DETECTOR",
4235 DiscoverResponseType::Lane => "LANE",
4236 DiscoverResponseType::CustomRouteRule => "CUSTOM_ROUTE_RULE",
4237 DiscoverResponseType::NearbyRouteRule => "NEARBY_ROUTE_RULE",
4238 DiscoverResponseType::Lossless => "LOSSLESS",
4239 DiscoverResponseType::BlockAllowRule => "BLOCK_ALLOW_RULE",
4240 }
4241 }
4242 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4244 match value {
4245 "UNKNOWN" => Some(Self::Unknown),
4246 "INSTANCE" => Some(Self::Instance),
4247 "CLUSTER" => Some(Self::Cluster),
4248 "ROUTING" => Some(Self::Routing),
4249 "RATE_LIMIT" => Some(Self::RateLimit),
4250 "CIRCUIT_BREAKER" => Some(Self::CircuitBreaker),
4251 "SERVICES" => Some(Self::Services),
4252 "NAMESPACES" => Some(Self::Namespaces),
4253 "FAULT_DETECTOR" => Some(Self::FaultDetector),
4254 "LANE" => Some(Self::Lane),
4255 "CUSTOM_ROUTE_RULE" => Some(Self::CustomRouteRule),
4256 "NEARBY_ROUTE_RULE" => Some(Self::NearbyRouteRule),
4257 "LOSSLESS" => Some(Self::Lossless),
4258 "BLOCK_ALLOW_RULE" => Some(Self::BlockAllowRule),
4259 _ => None,
4260 }
4261 }
4262 }
4263}
4264#[allow(clippy::derive_partial_eq_without_eq)]
4265#[derive(Clone, PartialEq, ::prost::Message)]
4266pub struct OptionSwitch {
4267 #[prost(map = "string, string", tag = "1")]
4268 pub options: ::std::collections::HashMap<
4269 ::prost::alloc::string::String,
4270 ::prost::alloc::string::String,
4271 >,
4272}
4273#[allow(clippy::derive_partial_eq_without_eq)]
4274#[derive(Clone, PartialEq, ::prost::Message)]
4275pub struct InstanceLabels {
4276 #[prost(map = "string, message", tag = "1")]
4277 pub labels: ::std::collections::HashMap<::prost::alloc::string::String, StringList>,
4278 #[prost(string, tag = "2")]
4279 pub namespace: ::prost::alloc::string::String,
4280 #[prost(string, tag = "3")]
4281 pub service: ::prost::alloc::string::String,
4282 #[prost(string, tag = "4")]
4283 pub service_id: ::prost::alloc::string::String,
4284}
4285#[allow(clippy::derive_partial_eq_without_eq)]
4286#[derive(Clone, PartialEq, ::prost::Message)]
4287pub struct HeartbeatRecord {
4288 #[prost(string, tag = "1")]
4289 pub instance_id: ::prost::alloc::string::String,
4290 #[prost(int64, tag = "6")]
4291 pub last_heartbeat_sec: i64,
4292 #[prost(bool, tag = "7")]
4293 pub exist: bool,
4294}
4295#[allow(clippy::derive_partial_eq_without_eq)]
4296#[derive(Clone, PartialEq, ::prost::Message)]
4297pub struct InstanceHeartbeat {
4298 #[prost(string, tag = "1")]
4299 pub instance_id: ::prost::alloc::string::String,
4300 #[prost(string, tag = "2")]
4301 pub service: ::prost::alloc::string::String,
4302 #[prost(string, tag = "3")]
4303 pub namespace: ::prost::alloc::string::String,
4304 #[prost(string, tag = "4")]
4305 pub host: ::prost::alloc::string::String,
4306 #[prost(uint32, tag = "5")]
4307 pub port: u32,
4308}
4309#[allow(clippy::derive_partial_eq_without_eq)]
4310#[derive(Clone, PartialEq, ::prost::Message)]
4311pub struct HeartbeatsRequest {
4312 #[prost(message, repeated, tag = "1")]
4313 pub heartbeats: ::prost::alloc::vec::Vec<InstanceHeartbeat>,
4314}
4315#[allow(clippy::derive_partial_eq_without_eq)]
4316#[derive(Clone, PartialEq, ::prost::Message)]
4317pub struct HeartbeatsResponse {}
4318#[allow(clippy::derive_partial_eq_without_eq)]
4319#[derive(Clone, PartialEq, ::prost::Message)]
4320pub struct GetHeartbeatsRequest {
4321 #[prost(string, repeated, tag = "1")]
4322 pub instance_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
4323}
4324#[allow(clippy::derive_partial_eq_without_eq)]
4325#[derive(Clone, PartialEq, ::prost::Message)]
4326pub struct GetHeartbeatsResponse {
4327 #[prost(message, repeated, tag = "1")]
4328 pub records: ::prost::alloc::vec::Vec<HeartbeatRecord>,
4329}
4330#[allow(clippy::derive_partial_eq_without_eq)]
4331#[derive(Clone, PartialEq, ::prost::Message)]
4332pub struct DelHeartbeatsRequest {
4333 #[prost(string, repeated, tag = "1")]
4334 pub instance_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
4335}
4336#[allow(clippy::derive_partial_eq_without_eq)]
4337#[derive(Clone, PartialEq, ::prost::Message)]
4338pub struct DelHeartbeatsResponse {
4339 #[prost(uint32, tag = "1")]
4340 pub code: u32,
4341 #[prost(string, tag = "2")]
4342 pub info: ::prost::alloc::string::String,
4343}
4344pub mod polaris_grpc_client {
4346 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
4347 use tonic::codegen::*;
4348 use tonic::codegen::http::Uri;
4349 #[derive(Debug, Clone)]
4350 pub struct PolarisGrpcClient<T> {
4351 inner: tonic::client::Grpc<T>,
4352 }
4353 impl PolarisGrpcClient<tonic::transport::Channel> {
4354 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4356 where
4357 D: TryInto<tonic::transport::Endpoint>,
4358 D::Error: Into<StdError>,
4359 {
4360 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4361 Ok(Self::new(conn))
4362 }
4363 }
4364 impl<T> PolarisGrpcClient<T>
4365 where
4366 T: tonic::client::GrpcService<tonic::body::BoxBody>,
4367 T::Error: Into<StdError>,
4368 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
4369 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
4370 {
4371 pub fn new(inner: T) -> Self {
4372 let inner = tonic::client::Grpc::new(inner);
4373 Self { inner }
4374 }
4375 pub fn with_origin(inner: T, origin: Uri) -> Self {
4376 let inner = tonic::client::Grpc::with_origin(inner, origin);
4377 Self { inner }
4378 }
4379 pub fn with_interceptor<F>(
4380 inner: T,
4381 interceptor: F,
4382 ) -> PolarisGrpcClient<InterceptedService<T, F>>
4383 where
4384 F: tonic::service::Interceptor,
4385 T::ResponseBody: Default,
4386 T: tonic::codegen::Service<
4387 http::Request<tonic::body::BoxBody>,
4388 Response = http::Response<
4389 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
4390 >,
4391 >,
4392 <T as tonic::codegen::Service<
4393 http::Request<tonic::body::BoxBody>,
4394 >>::Error: Into<StdError> + Send + Sync,
4395 {
4396 PolarisGrpcClient::new(InterceptedService::new(inner, interceptor))
4397 }
4398 #[must_use]
4403 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4404 self.inner = self.inner.send_compressed(encoding);
4405 self
4406 }
4407 #[must_use]
4409 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4410 self.inner = self.inner.accept_compressed(encoding);
4411 self
4412 }
4413 #[must_use]
4417 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4418 self.inner = self.inner.max_decoding_message_size(limit);
4419 self
4420 }
4421 #[must_use]
4425 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4426 self.inner = self.inner.max_encoding_message_size(limit);
4427 self
4428 }
4429 pub async fn report_client(
4431 &mut self,
4432 request: impl tonic::IntoRequest<super::Client>,
4433 ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4434 self.inner
4435 .ready()
4436 .await
4437 .map_err(|e| {
4438 tonic::Status::new(
4439 tonic::Code::Unknown,
4440 format!("Service was not ready: {}", e.into()),
4441 )
4442 })?;
4443 let codec = tonic::codec::ProstCodec::default();
4444 let path = http::uri::PathAndQuery::from_static(
4445 "/v1.PolarisGRPC/ReportClient",
4446 );
4447 let mut req = request.into_request();
4448 req.extensions_mut()
4449 .insert(GrpcMethod::new("v1.PolarisGRPC", "ReportClient"));
4450 self.inner.unary(req, path, codec).await
4451 }
4452 pub async fn register_instance(
4454 &mut self,
4455 request: impl tonic::IntoRequest<super::Instance>,
4456 ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4457 self.inner
4458 .ready()
4459 .await
4460 .map_err(|e| {
4461 tonic::Status::new(
4462 tonic::Code::Unknown,
4463 format!("Service was not ready: {}", e.into()),
4464 )
4465 })?;
4466 let codec = tonic::codec::ProstCodec::default();
4467 let path = http::uri::PathAndQuery::from_static(
4468 "/v1.PolarisGRPC/RegisterInstance",
4469 );
4470 let mut req = request.into_request();
4471 req.extensions_mut()
4472 .insert(GrpcMethod::new("v1.PolarisGRPC", "RegisterInstance"));
4473 self.inner.unary(req, path, codec).await
4474 }
4475 pub async fn deregister_instance(
4477 &mut self,
4478 request: impl tonic::IntoRequest<super::Instance>,
4479 ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4480 self.inner
4481 .ready()
4482 .await
4483 .map_err(|e| {
4484 tonic::Status::new(
4485 tonic::Code::Unknown,
4486 format!("Service was not ready: {}", e.into()),
4487 )
4488 })?;
4489 let codec = tonic::codec::ProstCodec::default();
4490 let path = http::uri::PathAndQuery::from_static(
4491 "/v1.PolarisGRPC/DeregisterInstance",
4492 );
4493 let mut req = request.into_request();
4494 req.extensions_mut()
4495 .insert(GrpcMethod::new("v1.PolarisGRPC", "DeregisterInstance"));
4496 self.inner.unary(req, path, codec).await
4497 }
4498 pub async fn discover(
4500 &mut self,
4501 request: impl tonic::IntoStreamingRequest<Message = super::DiscoverRequest>,
4502 ) -> std::result::Result<
4503 tonic::Response<tonic::codec::Streaming<super::DiscoverResponse>>,
4504 tonic::Status,
4505 > {
4506 self.inner
4507 .ready()
4508 .await
4509 .map_err(|e| {
4510 tonic::Status::new(
4511 tonic::Code::Unknown,
4512 format!("Service was not ready: {}", e.into()),
4513 )
4514 })?;
4515 let codec = tonic::codec::ProstCodec::default();
4516 let path = http::uri::PathAndQuery::from_static("/v1.PolarisGRPC/Discover");
4517 let mut req = request.into_streaming_request();
4518 req.extensions_mut().insert(GrpcMethod::new("v1.PolarisGRPC", "Discover"));
4519 self.inner.streaming(req, path, codec).await
4520 }
4521 pub async fn heartbeat(
4523 &mut self,
4524 request: impl tonic::IntoRequest<super::Instance>,
4525 ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4526 self.inner
4527 .ready()
4528 .await
4529 .map_err(|e| {
4530 tonic::Status::new(
4531 tonic::Code::Unknown,
4532 format!("Service was not ready: {}", e.into()),
4533 )
4534 })?;
4535 let codec = tonic::codec::ProstCodec::default();
4536 let path = http::uri::PathAndQuery::from_static("/v1.PolarisGRPC/Heartbeat");
4537 let mut req = request.into_request();
4538 req.extensions_mut().insert(GrpcMethod::new("v1.PolarisGRPC", "Heartbeat"));
4539 self.inner.unary(req, path, codec).await
4540 }
4541 }
4542}
4543pub mod polaris_heartbeat_grpc_client {
4545 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
4546 use tonic::codegen::*;
4547 use tonic::codegen::http::Uri;
4548 #[derive(Debug, Clone)]
4549 pub struct PolarisHeartbeatGrpcClient<T> {
4550 inner: tonic::client::Grpc<T>,
4551 }
4552 impl PolarisHeartbeatGrpcClient<tonic::transport::Channel> {
4553 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4555 where
4556 D: TryInto<tonic::transport::Endpoint>,
4557 D::Error: Into<StdError>,
4558 {
4559 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4560 Ok(Self::new(conn))
4561 }
4562 }
4563 impl<T> PolarisHeartbeatGrpcClient<T>
4564 where
4565 T: tonic::client::GrpcService<tonic::body::BoxBody>,
4566 T::Error: Into<StdError>,
4567 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
4568 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
4569 {
4570 pub fn new(inner: T) -> Self {
4571 let inner = tonic::client::Grpc::new(inner);
4572 Self { inner }
4573 }
4574 pub fn with_origin(inner: T, origin: Uri) -> Self {
4575 let inner = tonic::client::Grpc::with_origin(inner, origin);
4576 Self { inner }
4577 }
4578 pub fn with_interceptor<F>(
4579 inner: T,
4580 interceptor: F,
4581 ) -> PolarisHeartbeatGrpcClient<InterceptedService<T, F>>
4582 where
4583 F: tonic::service::Interceptor,
4584 T::ResponseBody: Default,
4585 T: tonic::codegen::Service<
4586 http::Request<tonic::body::BoxBody>,
4587 Response = http::Response<
4588 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
4589 >,
4590 >,
4591 <T as tonic::codegen::Service<
4592 http::Request<tonic::body::BoxBody>,
4593 >>::Error: Into<StdError> + Send + Sync,
4594 {
4595 PolarisHeartbeatGrpcClient::new(InterceptedService::new(inner, interceptor))
4596 }
4597 #[must_use]
4602 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4603 self.inner = self.inner.send_compressed(encoding);
4604 self
4605 }
4606 #[must_use]
4608 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4609 self.inner = self.inner.accept_compressed(encoding);
4610 self
4611 }
4612 #[must_use]
4616 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4617 self.inner = self.inner.max_decoding_message_size(limit);
4618 self
4619 }
4620 #[must_use]
4624 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4625 self.inner = self.inner.max_encoding_message_size(limit);
4626 self
4627 }
4628 pub async fn batch_heartbeat(
4630 &mut self,
4631 request: impl tonic::IntoStreamingRequest<Message = super::HeartbeatsRequest>,
4632 ) -> std::result::Result<
4633 tonic::Response<tonic::codec::Streaming<super::HeartbeatsResponse>>,
4634 tonic::Status,
4635 > {
4636 self.inner
4637 .ready()
4638 .await
4639 .map_err(|e| {
4640 tonic::Status::new(
4641 tonic::Code::Unknown,
4642 format!("Service was not ready: {}", e.into()),
4643 )
4644 })?;
4645 let codec = tonic::codec::ProstCodec::default();
4646 let path = http::uri::PathAndQuery::from_static(
4647 "/v1.PolarisHeartbeatGRPC/BatchHeartbeat",
4648 );
4649 let mut req = request.into_streaming_request();
4650 req.extensions_mut()
4651 .insert(GrpcMethod::new("v1.PolarisHeartbeatGRPC", "BatchHeartbeat"));
4652 self.inner.streaming(req, path, codec).await
4653 }
4654 pub async fn batch_get_heartbeat(
4656 &mut self,
4657 request: impl tonic::IntoRequest<super::GetHeartbeatsRequest>,
4658 ) -> std::result::Result<
4659 tonic::Response<super::GetHeartbeatsResponse>,
4660 tonic::Status,
4661 > {
4662 self.inner
4663 .ready()
4664 .await
4665 .map_err(|e| {
4666 tonic::Status::new(
4667 tonic::Code::Unknown,
4668 format!("Service was not ready: {}", e.into()),
4669 )
4670 })?;
4671 let codec = tonic::codec::ProstCodec::default();
4672 let path = http::uri::PathAndQuery::from_static(
4673 "/v1.PolarisHeartbeatGRPC/BatchGetHeartbeat",
4674 );
4675 let mut req = request.into_request();
4676 req.extensions_mut()
4677 .insert(GrpcMethod::new("v1.PolarisHeartbeatGRPC", "BatchGetHeartbeat"));
4678 self.inner.unary(req, path, codec).await
4679 }
4680 pub async fn batch_del_heartbeat(
4682 &mut self,
4683 request: impl tonic::IntoRequest<super::DelHeartbeatsRequest>,
4684 ) -> std::result::Result<
4685 tonic::Response<super::DelHeartbeatsResponse>,
4686 tonic::Status,
4687 > {
4688 self.inner
4689 .ready()
4690 .await
4691 .map_err(|e| {
4692 tonic::Status::new(
4693 tonic::Code::Unknown,
4694 format!("Service was not ready: {}", e.into()),
4695 )
4696 })?;
4697 let codec = tonic::codec::ProstCodec::default();
4698 let path = http::uri::PathAndQuery::from_static(
4699 "/v1.PolarisHeartbeatGRPC/BatchDelHeartbeat",
4700 );
4701 let mut req = request.into_request();
4702 req.extensions_mut()
4703 .insert(GrpcMethod::new("v1.PolarisHeartbeatGRPC", "BatchDelHeartbeat"));
4704 self.inner.unary(req, path, codec).await
4705 }
4706 }
4707}
4708pub mod polaris_service_contract_grpc_client {
4710 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
4711 use tonic::codegen::*;
4712 use tonic::codegen::http::Uri;
4713 #[derive(Debug, Clone)]
4714 pub struct PolarisServiceContractGrpcClient<T> {
4715 inner: tonic::client::Grpc<T>,
4716 }
4717 impl PolarisServiceContractGrpcClient<tonic::transport::Channel> {
4718 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4720 where
4721 D: TryInto<tonic::transport::Endpoint>,
4722 D::Error: Into<StdError>,
4723 {
4724 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4725 Ok(Self::new(conn))
4726 }
4727 }
4728 impl<T> PolarisServiceContractGrpcClient<T>
4729 where
4730 T: tonic::client::GrpcService<tonic::body::BoxBody>,
4731 T::Error: Into<StdError>,
4732 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
4733 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
4734 {
4735 pub fn new(inner: T) -> Self {
4736 let inner = tonic::client::Grpc::new(inner);
4737 Self { inner }
4738 }
4739 pub fn with_origin(inner: T, origin: Uri) -> Self {
4740 let inner = tonic::client::Grpc::with_origin(inner, origin);
4741 Self { inner }
4742 }
4743 pub fn with_interceptor<F>(
4744 inner: T,
4745 interceptor: F,
4746 ) -> PolarisServiceContractGrpcClient<InterceptedService<T, F>>
4747 where
4748 F: tonic::service::Interceptor,
4749 T::ResponseBody: Default,
4750 T: tonic::codegen::Service<
4751 http::Request<tonic::body::BoxBody>,
4752 Response = http::Response<
4753 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
4754 >,
4755 >,
4756 <T as tonic::codegen::Service<
4757 http::Request<tonic::body::BoxBody>,
4758 >>::Error: Into<StdError> + Send + Sync,
4759 {
4760 PolarisServiceContractGrpcClient::new(
4761 InterceptedService::new(inner, interceptor),
4762 )
4763 }
4764 #[must_use]
4769 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4770 self.inner = self.inner.send_compressed(encoding);
4771 self
4772 }
4773 #[must_use]
4775 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4776 self.inner = self.inner.accept_compressed(encoding);
4777 self
4778 }
4779 #[must_use]
4783 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4784 self.inner = self.inner.max_decoding_message_size(limit);
4785 self
4786 }
4787 #[must_use]
4791 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4792 self.inner = self.inner.max_encoding_message_size(limit);
4793 self
4794 }
4795 pub async fn report_service_contract(
4797 &mut self,
4798 request: impl tonic::IntoRequest<super::ServiceContract>,
4799 ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4800 self.inner
4801 .ready()
4802 .await
4803 .map_err(|e| {
4804 tonic::Status::new(
4805 tonic::Code::Unknown,
4806 format!("Service was not ready: {}", e.into()),
4807 )
4808 })?;
4809 let codec = tonic::codec::ProstCodec::default();
4810 let path = http::uri::PathAndQuery::from_static(
4811 "/v1.PolarisServiceContractGRPC/ReportServiceContract",
4812 );
4813 let mut req = request.into_request();
4814 req.extensions_mut()
4815 .insert(
4816 GrpcMethod::new(
4817 "v1.PolarisServiceContractGRPC",
4818 "ReportServiceContract",
4819 ),
4820 );
4821 self.inner.unary(req, path, codec).await
4822 }
4823 pub async fn get_service_contract(
4825 &mut self,
4826 request: impl tonic::IntoRequest<super::ServiceContract>,
4827 ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4828 self.inner
4829 .ready()
4830 .await
4831 .map_err(|e| {
4832 tonic::Status::new(
4833 tonic::Code::Unknown,
4834 format!("Service was not ready: {}", e.into()),
4835 )
4836 })?;
4837 let codec = tonic::codec::ProstCodec::default();
4838 let path = http::uri::PathAndQuery::from_static(
4839 "/v1.PolarisServiceContractGRPC/GetServiceContract",
4840 );
4841 let mut req = request.into_request();
4842 req.extensions_mut()
4843 .insert(
4844 GrpcMethod::new(
4845 "v1.PolarisServiceContractGRPC",
4846 "GetServiceContract",
4847 ),
4848 );
4849 self.inner.unary(req, path, codec).await
4850 }
4851 }
4852}
4853pub mod polaris_grpc_server {
4855 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
4856 use tonic::codegen::*;
4857 #[async_trait]
4859 pub trait PolarisGrpc: Send + Sync + 'static {
4860 async fn report_client(
4862 &self,
4863 request: tonic::Request<super::Client>,
4864 ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
4865 async fn register_instance(
4867 &self,
4868 request: tonic::Request<super::Instance>,
4869 ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
4870 async fn deregister_instance(
4872 &self,
4873 request: tonic::Request<super::Instance>,
4874 ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
4875 type DiscoverStream: tonic::codegen::tokio_stream::Stream<
4877 Item = std::result::Result<super::DiscoverResponse, tonic::Status>,
4878 >
4879 + Send
4880 + 'static;
4881 async fn discover(
4883 &self,
4884 request: tonic::Request<tonic::Streaming<super::DiscoverRequest>>,
4885 ) -> std::result::Result<tonic::Response<Self::DiscoverStream>, tonic::Status>;
4886 async fn heartbeat(
4888 &self,
4889 request: tonic::Request<super::Instance>,
4890 ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
4891 }
4892 #[derive(Debug)]
4893 pub struct PolarisGrpcServer<T: PolarisGrpc> {
4894 inner: _Inner<T>,
4895 accept_compression_encodings: EnabledCompressionEncodings,
4896 send_compression_encodings: EnabledCompressionEncodings,
4897 max_decoding_message_size: Option<usize>,
4898 max_encoding_message_size: Option<usize>,
4899 }
4900 struct _Inner<T>(Arc<T>);
4901 impl<T: PolarisGrpc> PolarisGrpcServer<T> {
4902 pub fn new(inner: T) -> Self {
4903 Self::from_arc(Arc::new(inner))
4904 }
4905 pub fn from_arc(inner: Arc<T>) -> Self {
4906 let inner = _Inner(inner);
4907 Self {
4908 inner,
4909 accept_compression_encodings: Default::default(),
4910 send_compression_encodings: Default::default(),
4911 max_decoding_message_size: None,
4912 max_encoding_message_size: None,
4913 }
4914 }
4915 pub fn with_interceptor<F>(
4916 inner: T,
4917 interceptor: F,
4918 ) -> InterceptedService<Self, F>
4919 where
4920 F: tonic::service::Interceptor,
4921 {
4922 InterceptedService::new(Self::new(inner), interceptor)
4923 }
4924 #[must_use]
4926 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4927 self.accept_compression_encodings.enable(encoding);
4928 self
4929 }
4930 #[must_use]
4932 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4933 self.send_compression_encodings.enable(encoding);
4934 self
4935 }
4936 #[must_use]
4940 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4941 self.max_decoding_message_size = Some(limit);
4942 self
4943 }
4944 #[must_use]
4948 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4949 self.max_encoding_message_size = Some(limit);
4950 self
4951 }
4952 }
4953 impl<T, B> tonic::codegen::Service<http::Request<B>> for PolarisGrpcServer<T>
4954 where
4955 T: PolarisGrpc,
4956 B: Body + Send + 'static,
4957 B::Error: Into<StdError> + Send + 'static,
4958 {
4959 type Response = http::Response<tonic::body::BoxBody>;
4960 type Error = std::convert::Infallible;
4961 type Future = BoxFuture<Self::Response, Self::Error>;
4962 fn poll_ready(
4963 &mut self,
4964 _cx: &mut Context<'_>,
4965 ) -> Poll<std::result::Result<(), Self::Error>> {
4966 Poll::Ready(Ok(()))
4967 }
4968 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4969 let inner = self.inner.clone();
4970 match req.uri().path() {
4971 "/v1.PolarisGRPC/ReportClient" => {
4972 #[allow(non_camel_case_types)]
4973 struct ReportClientSvc<T: PolarisGrpc>(pub Arc<T>);
4974 impl<T: PolarisGrpc> tonic::server::UnaryService<super::Client>
4975 for ReportClientSvc<T> {
4976 type Response = super::Response;
4977 type Future = BoxFuture<
4978 tonic::Response<Self::Response>,
4979 tonic::Status,
4980 >;
4981 fn call(
4982 &mut self,
4983 request: tonic::Request<super::Client>,
4984 ) -> Self::Future {
4985 let inner = Arc::clone(&self.0);
4986 let fut = async move {
4987 <T as PolarisGrpc>::report_client(&inner, request).await
4988 };
4989 Box::pin(fut)
4990 }
4991 }
4992 let accept_compression_encodings = self.accept_compression_encodings;
4993 let send_compression_encodings = self.send_compression_encodings;
4994 let max_decoding_message_size = self.max_decoding_message_size;
4995 let max_encoding_message_size = self.max_encoding_message_size;
4996 let inner = self.inner.clone();
4997 let fut = async move {
4998 let inner = inner.0;
4999 let method = ReportClientSvc(inner);
5000 let codec = tonic::codec::ProstCodec::default();
5001 let mut grpc = tonic::server::Grpc::new(codec)
5002 .apply_compression_config(
5003 accept_compression_encodings,
5004 send_compression_encodings,
5005 )
5006 .apply_max_message_size_config(
5007 max_decoding_message_size,
5008 max_encoding_message_size,
5009 );
5010 let res = grpc.unary(method, req).await;
5011 Ok(res)
5012 };
5013 Box::pin(fut)
5014 }
5015 "/v1.PolarisGRPC/RegisterInstance" => {
5016 #[allow(non_camel_case_types)]
5017 struct RegisterInstanceSvc<T: PolarisGrpc>(pub Arc<T>);
5018 impl<T: PolarisGrpc> tonic::server::UnaryService<super::Instance>
5019 for RegisterInstanceSvc<T> {
5020 type Response = super::Response;
5021 type Future = BoxFuture<
5022 tonic::Response<Self::Response>,
5023 tonic::Status,
5024 >;
5025 fn call(
5026 &mut self,
5027 request: tonic::Request<super::Instance>,
5028 ) -> Self::Future {
5029 let inner = Arc::clone(&self.0);
5030 let fut = async move {
5031 <T as PolarisGrpc>::register_instance(&inner, request).await
5032 };
5033 Box::pin(fut)
5034 }
5035 }
5036 let accept_compression_encodings = self.accept_compression_encodings;
5037 let send_compression_encodings = self.send_compression_encodings;
5038 let max_decoding_message_size = self.max_decoding_message_size;
5039 let max_encoding_message_size = self.max_encoding_message_size;
5040 let inner = self.inner.clone();
5041 let fut = async move {
5042 let inner = inner.0;
5043 let method = RegisterInstanceSvc(inner);
5044 let codec = tonic::codec::ProstCodec::default();
5045 let mut grpc = tonic::server::Grpc::new(codec)
5046 .apply_compression_config(
5047 accept_compression_encodings,
5048 send_compression_encodings,
5049 )
5050 .apply_max_message_size_config(
5051 max_decoding_message_size,
5052 max_encoding_message_size,
5053 );
5054 let res = grpc.unary(method, req).await;
5055 Ok(res)
5056 };
5057 Box::pin(fut)
5058 }
5059 "/v1.PolarisGRPC/DeregisterInstance" => {
5060 #[allow(non_camel_case_types)]
5061 struct DeregisterInstanceSvc<T: PolarisGrpc>(pub Arc<T>);
5062 impl<T: PolarisGrpc> tonic::server::UnaryService<super::Instance>
5063 for DeregisterInstanceSvc<T> {
5064 type Response = super::Response;
5065 type Future = BoxFuture<
5066 tonic::Response<Self::Response>,
5067 tonic::Status,
5068 >;
5069 fn call(
5070 &mut self,
5071 request: tonic::Request<super::Instance>,
5072 ) -> Self::Future {
5073 let inner = Arc::clone(&self.0);
5074 let fut = async move {
5075 <T as PolarisGrpc>::deregister_instance(&inner, request)
5076 .await
5077 };
5078 Box::pin(fut)
5079 }
5080 }
5081 let accept_compression_encodings = self.accept_compression_encodings;
5082 let send_compression_encodings = self.send_compression_encodings;
5083 let max_decoding_message_size = self.max_decoding_message_size;
5084 let max_encoding_message_size = self.max_encoding_message_size;
5085 let inner = self.inner.clone();
5086 let fut = async move {
5087 let inner = inner.0;
5088 let method = DeregisterInstanceSvc(inner);
5089 let codec = tonic::codec::ProstCodec::default();
5090 let mut grpc = tonic::server::Grpc::new(codec)
5091 .apply_compression_config(
5092 accept_compression_encodings,
5093 send_compression_encodings,
5094 )
5095 .apply_max_message_size_config(
5096 max_decoding_message_size,
5097 max_encoding_message_size,
5098 );
5099 let res = grpc.unary(method, req).await;
5100 Ok(res)
5101 };
5102 Box::pin(fut)
5103 }
5104 "/v1.PolarisGRPC/Discover" => {
5105 #[allow(non_camel_case_types)]
5106 struct DiscoverSvc<T: PolarisGrpc>(pub Arc<T>);
5107 impl<
5108 T: PolarisGrpc,
5109 > tonic::server::StreamingService<super::DiscoverRequest>
5110 for DiscoverSvc<T> {
5111 type Response = super::DiscoverResponse;
5112 type ResponseStream = T::DiscoverStream;
5113 type Future = BoxFuture<
5114 tonic::Response<Self::ResponseStream>,
5115 tonic::Status,
5116 >;
5117 fn call(
5118 &mut self,
5119 request: tonic::Request<
5120 tonic::Streaming<super::DiscoverRequest>,
5121 >,
5122 ) -> Self::Future {
5123 let inner = Arc::clone(&self.0);
5124 let fut = async move {
5125 <T as PolarisGrpc>::discover(&inner, request).await
5126 };
5127 Box::pin(fut)
5128 }
5129 }
5130 let accept_compression_encodings = self.accept_compression_encodings;
5131 let send_compression_encodings = self.send_compression_encodings;
5132 let max_decoding_message_size = self.max_decoding_message_size;
5133 let max_encoding_message_size = self.max_encoding_message_size;
5134 let inner = self.inner.clone();
5135 let fut = async move {
5136 let inner = inner.0;
5137 let method = DiscoverSvc(inner);
5138 let codec = tonic::codec::ProstCodec::default();
5139 let mut grpc = tonic::server::Grpc::new(codec)
5140 .apply_compression_config(
5141 accept_compression_encodings,
5142 send_compression_encodings,
5143 )
5144 .apply_max_message_size_config(
5145 max_decoding_message_size,
5146 max_encoding_message_size,
5147 );
5148 let res = grpc.streaming(method, req).await;
5149 Ok(res)
5150 };
5151 Box::pin(fut)
5152 }
5153 "/v1.PolarisGRPC/Heartbeat" => {
5154 #[allow(non_camel_case_types)]
5155 struct HeartbeatSvc<T: PolarisGrpc>(pub Arc<T>);
5156 impl<T: PolarisGrpc> tonic::server::UnaryService<super::Instance>
5157 for HeartbeatSvc<T> {
5158 type Response = super::Response;
5159 type Future = BoxFuture<
5160 tonic::Response<Self::Response>,
5161 tonic::Status,
5162 >;
5163 fn call(
5164 &mut self,
5165 request: tonic::Request<super::Instance>,
5166 ) -> Self::Future {
5167 let inner = Arc::clone(&self.0);
5168 let fut = async move {
5169 <T as PolarisGrpc>::heartbeat(&inner, request).await
5170 };
5171 Box::pin(fut)
5172 }
5173 }
5174 let accept_compression_encodings = self.accept_compression_encodings;
5175 let send_compression_encodings = self.send_compression_encodings;
5176 let max_decoding_message_size = self.max_decoding_message_size;
5177 let max_encoding_message_size = self.max_encoding_message_size;
5178 let inner = self.inner.clone();
5179 let fut = async move {
5180 let inner = inner.0;
5181 let method = HeartbeatSvc(inner);
5182 let codec = tonic::codec::ProstCodec::default();
5183 let mut grpc = tonic::server::Grpc::new(codec)
5184 .apply_compression_config(
5185 accept_compression_encodings,
5186 send_compression_encodings,
5187 )
5188 .apply_max_message_size_config(
5189 max_decoding_message_size,
5190 max_encoding_message_size,
5191 );
5192 let res = grpc.unary(method, req).await;
5193 Ok(res)
5194 };
5195 Box::pin(fut)
5196 }
5197 _ => {
5198 Box::pin(async move {
5199 Ok(
5200 http::Response::builder()
5201 .status(200)
5202 .header("grpc-status", "12")
5203 .header("content-type", "application/grpc")
5204 .body(empty_body())
5205 .unwrap(),
5206 )
5207 })
5208 }
5209 }
5210 }
5211 }
5212 impl<T: PolarisGrpc> Clone for PolarisGrpcServer<T> {
5213 fn clone(&self) -> Self {
5214 let inner = self.inner.clone();
5215 Self {
5216 inner,
5217 accept_compression_encodings: self.accept_compression_encodings,
5218 send_compression_encodings: self.send_compression_encodings,
5219 max_decoding_message_size: self.max_decoding_message_size,
5220 max_encoding_message_size: self.max_encoding_message_size,
5221 }
5222 }
5223 }
5224 impl<T: PolarisGrpc> Clone for _Inner<T> {
5225 fn clone(&self) -> Self {
5226 Self(Arc::clone(&self.0))
5227 }
5228 }
5229 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
5230 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5231 write!(f, "{:?}", self.0)
5232 }
5233 }
5234 impl<T: PolarisGrpc> tonic::server::NamedService for PolarisGrpcServer<T> {
5235 const NAME: &'static str = "v1.PolarisGRPC";
5236 }
5237}
5238pub mod polaris_heartbeat_grpc_server {
5240 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
5241 use tonic::codegen::*;
5242 #[async_trait]
5244 pub trait PolarisHeartbeatGrpc: Send + Sync + 'static {
5245 type BatchHeartbeatStream: tonic::codegen::tokio_stream::Stream<
5247 Item = std::result::Result<super::HeartbeatsResponse, tonic::Status>,
5248 >
5249 + Send
5250 + 'static;
5251 async fn batch_heartbeat(
5253 &self,
5254 request: tonic::Request<tonic::Streaming<super::HeartbeatsRequest>>,
5255 ) -> std::result::Result<
5256 tonic::Response<Self::BatchHeartbeatStream>,
5257 tonic::Status,
5258 >;
5259 async fn batch_get_heartbeat(
5261 &self,
5262 request: tonic::Request<super::GetHeartbeatsRequest>,
5263 ) -> std::result::Result<
5264 tonic::Response<super::GetHeartbeatsResponse>,
5265 tonic::Status,
5266 >;
5267 async fn batch_del_heartbeat(
5269 &self,
5270 request: tonic::Request<super::DelHeartbeatsRequest>,
5271 ) -> std::result::Result<
5272 tonic::Response<super::DelHeartbeatsResponse>,
5273 tonic::Status,
5274 >;
5275 }
5276 #[derive(Debug)]
5277 pub struct PolarisHeartbeatGrpcServer<T: PolarisHeartbeatGrpc> {
5278 inner: _Inner<T>,
5279 accept_compression_encodings: EnabledCompressionEncodings,
5280 send_compression_encodings: EnabledCompressionEncodings,
5281 max_decoding_message_size: Option<usize>,
5282 max_encoding_message_size: Option<usize>,
5283 }
5284 struct _Inner<T>(Arc<T>);
5285 impl<T: PolarisHeartbeatGrpc> PolarisHeartbeatGrpcServer<T> {
5286 pub fn new(inner: T) -> Self {
5287 Self::from_arc(Arc::new(inner))
5288 }
5289 pub fn from_arc(inner: Arc<T>) -> Self {
5290 let inner = _Inner(inner);
5291 Self {
5292 inner,
5293 accept_compression_encodings: Default::default(),
5294 send_compression_encodings: Default::default(),
5295 max_decoding_message_size: None,
5296 max_encoding_message_size: None,
5297 }
5298 }
5299 pub fn with_interceptor<F>(
5300 inner: T,
5301 interceptor: F,
5302 ) -> InterceptedService<Self, F>
5303 where
5304 F: tonic::service::Interceptor,
5305 {
5306 InterceptedService::new(Self::new(inner), interceptor)
5307 }
5308 #[must_use]
5310 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5311 self.accept_compression_encodings.enable(encoding);
5312 self
5313 }
5314 #[must_use]
5316 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5317 self.send_compression_encodings.enable(encoding);
5318 self
5319 }
5320 #[must_use]
5324 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5325 self.max_decoding_message_size = Some(limit);
5326 self
5327 }
5328 #[must_use]
5332 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5333 self.max_encoding_message_size = Some(limit);
5334 self
5335 }
5336 }
5337 impl<T, B> tonic::codegen::Service<http::Request<B>>
5338 for PolarisHeartbeatGrpcServer<T>
5339 where
5340 T: PolarisHeartbeatGrpc,
5341 B: Body + Send + 'static,
5342 B::Error: Into<StdError> + Send + 'static,
5343 {
5344 type Response = http::Response<tonic::body::BoxBody>;
5345 type Error = std::convert::Infallible;
5346 type Future = BoxFuture<Self::Response, Self::Error>;
5347 fn poll_ready(
5348 &mut self,
5349 _cx: &mut Context<'_>,
5350 ) -> Poll<std::result::Result<(), Self::Error>> {
5351 Poll::Ready(Ok(()))
5352 }
5353 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5354 let inner = self.inner.clone();
5355 match req.uri().path() {
5356 "/v1.PolarisHeartbeatGRPC/BatchHeartbeat" => {
5357 #[allow(non_camel_case_types)]
5358 struct BatchHeartbeatSvc<T: PolarisHeartbeatGrpc>(pub Arc<T>);
5359 impl<
5360 T: PolarisHeartbeatGrpc,
5361 > tonic::server::StreamingService<super::HeartbeatsRequest>
5362 for BatchHeartbeatSvc<T> {
5363 type Response = super::HeartbeatsResponse;
5364 type ResponseStream = T::BatchHeartbeatStream;
5365 type Future = BoxFuture<
5366 tonic::Response<Self::ResponseStream>,
5367 tonic::Status,
5368 >;
5369 fn call(
5370 &mut self,
5371 request: tonic::Request<
5372 tonic::Streaming<super::HeartbeatsRequest>,
5373 >,
5374 ) -> Self::Future {
5375 let inner = Arc::clone(&self.0);
5376 let fut = async move {
5377 <T as PolarisHeartbeatGrpc>::batch_heartbeat(
5378 &inner,
5379 request,
5380 )
5381 .await
5382 };
5383 Box::pin(fut)
5384 }
5385 }
5386 let accept_compression_encodings = self.accept_compression_encodings;
5387 let send_compression_encodings = self.send_compression_encodings;
5388 let max_decoding_message_size = self.max_decoding_message_size;
5389 let max_encoding_message_size = self.max_encoding_message_size;
5390 let inner = self.inner.clone();
5391 let fut = async move {
5392 let inner = inner.0;
5393 let method = BatchHeartbeatSvc(inner);
5394 let codec = tonic::codec::ProstCodec::default();
5395 let mut grpc = tonic::server::Grpc::new(codec)
5396 .apply_compression_config(
5397 accept_compression_encodings,
5398 send_compression_encodings,
5399 )
5400 .apply_max_message_size_config(
5401 max_decoding_message_size,
5402 max_encoding_message_size,
5403 );
5404 let res = grpc.streaming(method, req).await;
5405 Ok(res)
5406 };
5407 Box::pin(fut)
5408 }
5409 "/v1.PolarisHeartbeatGRPC/BatchGetHeartbeat" => {
5410 #[allow(non_camel_case_types)]
5411 struct BatchGetHeartbeatSvc<T: PolarisHeartbeatGrpc>(pub Arc<T>);
5412 impl<
5413 T: PolarisHeartbeatGrpc,
5414 > tonic::server::UnaryService<super::GetHeartbeatsRequest>
5415 for BatchGetHeartbeatSvc<T> {
5416 type Response = super::GetHeartbeatsResponse;
5417 type Future = BoxFuture<
5418 tonic::Response<Self::Response>,
5419 tonic::Status,
5420 >;
5421 fn call(
5422 &mut self,
5423 request: tonic::Request<super::GetHeartbeatsRequest>,
5424 ) -> Self::Future {
5425 let inner = Arc::clone(&self.0);
5426 let fut = async move {
5427 <T as PolarisHeartbeatGrpc>::batch_get_heartbeat(
5428 &inner,
5429 request,
5430 )
5431 .await
5432 };
5433 Box::pin(fut)
5434 }
5435 }
5436 let accept_compression_encodings = self.accept_compression_encodings;
5437 let send_compression_encodings = self.send_compression_encodings;
5438 let max_decoding_message_size = self.max_decoding_message_size;
5439 let max_encoding_message_size = self.max_encoding_message_size;
5440 let inner = self.inner.clone();
5441 let fut = async move {
5442 let inner = inner.0;
5443 let method = BatchGetHeartbeatSvc(inner);
5444 let codec = tonic::codec::ProstCodec::default();
5445 let mut grpc = tonic::server::Grpc::new(codec)
5446 .apply_compression_config(
5447 accept_compression_encodings,
5448 send_compression_encodings,
5449 )
5450 .apply_max_message_size_config(
5451 max_decoding_message_size,
5452 max_encoding_message_size,
5453 );
5454 let res = grpc.unary(method, req).await;
5455 Ok(res)
5456 };
5457 Box::pin(fut)
5458 }
5459 "/v1.PolarisHeartbeatGRPC/BatchDelHeartbeat" => {
5460 #[allow(non_camel_case_types)]
5461 struct BatchDelHeartbeatSvc<T: PolarisHeartbeatGrpc>(pub Arc<T>);
5462 impl<
5463 T: PolarisHeartbeatGrpc,
5464 > tonic::server::UnaryService<super::DelHeartbeatsRequest>
5465 for BatchDelHeartbeatSvc<T> {
5466 type Response = super::DelHeartbeatsResponse;
5467 type Future = BoxFuture<
5468 tonic::Response<Self::Response>,
5469 tonic::Status,
5470 >;
5471 fn call(
5472 &mut self,
5473 request: tonic::Request<super::DelHeartbeatsRequest>,
5474 ) -> Self::Future {
5475 let inner = Arc::clone(&self.0);
5476 let fut = async move {
5477 <T as PolarisHeartbeatGrpc>::batch_del_heartbeat(
5478 &inner,
5479 request,
5480 )
5481 .await
5482 };
5483 Box::pin(fut)
5484 }
5485 }
5486 let accept_compression_encodings = self.accept_compression_encodings;
5487 let send_compression_encodings = self.send_compression_encodings;
5488 let max_decoding_message_size = self.max_decoding_message_size;
5489 let max_encoding_message_size = self.max_encoding_message_size;
5490 let inner = self.inner.clone();
5491 let fut = async move {
5492 let inner = inner.0;
5493 let method = BatchDelHeartbeatSvc(inner);
5494 let codec = tonic::codec::ProstCodec::default();
5495 let mut grpc = tonic::server::Grpc::new(codec)
5496 .apply_compression_config(
5497 accept_compression_encodings,
5498 send_compression_encodings,
5499 )
5500 .apply_max_message_size_config(
5501 max_decoding_message_size,
5502 max_encoding_message_size,
5503 );
5504 let res = grpc.unary(method, req).await;
5505 Ok(res)
5506 };
5507 Box::pin(fut)
5508 }
5509 _ => {
5510 Box::pin(async move {
5511 Ok(
5512 http::Response::builder()
5513 .status(200)
5514 .header("grpc-status", "12")
5515 .header("content-type", "application/grpc")
5516 .body(empty_body())
5517 .unwrap(),
5518 )
5519 })
5520 }
5521 }
5522 }
5523 }
5524 impl<T: PolarisHeartbeatGrpc> Clone for PolarisHeartbeatGrpcServer<T> {
5525 fn clone(&self) -> Self {
5526 let inner = self.inner.clone();
5527 Self {
5528 inner,
5529 accept_compression_encodings: self.accept_compression_encodings,
5530 send_compression_encodings: self.send_compression_encodings,
5531 max_decoding_message_size: self.max_decoding_message_size,
5532 max_encoding_message_size: self.max_encoding_message_size,
5533 }
5534 }
5535 }
5536 impl<T: PolarisHeartbeatGrpc> Clone for _Inner<T> {
5537 fn clone(&self) -> Self {
5538 Self(Arc::clone(&self.0))
5539 }
5540 }
5541 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
5542 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5543 write!(f, "{:?}", self.0)
5544 }
5545 }
5546 impl<T: PolarisHeartbeatGrpc> tonic::server::NamedService
5547 for PolarisHeartbeatGrpcServer<T> {
5548 const NAME: &'static str = "v1.PolarisHeartbeatGRPC";
5549 }
5550}
5551pub mod polaris_service_contract_grpc_server {
5553 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
5554 use tonic::codegen::*;
5555 #[async_trait]
5557 pub trait PolarisServiceContractGrpc: Send + Sync + 'static {
5558 async fn report_service_contract(
5560 &self,
5561 request: tonic::Request<super::ServiceContract>,
5562 ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
5563 async fn get_service_contract(
5565 &self,
5566 request: tonic::Request<super::ServiceContract>,
5567 ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
5568 }
5569 #[derive(Debug)]
5570 pub struct PolarisServiceContractGrpcServer<T: PolarisServiceContractGrpc> {
5571 inner: _Inner<T>,
5572 accept_compression_encodings: EnabledCompressionEncodings,
5573 send_compression_encodings: EnabledCompressionEncodings,
5574 max_decoding_message_size: Option<usize>,
5575 max_encoding_message_size: Option<usize>,
5576 }
5577 struct _Inner<T>(Arc<T>);
5578 impl<T: PolarisServiceContractGrpc> PolarisServiceContractGrpcServer<T> {
5579 pub fn new(inner: T) -> Self {
5580 Self::from_arc(Arc::new(inner))
5581 }
5582 pub fn from_arc(inner: Arc<T>) -> Self {
5583 let inner = _Inner(inner);
5584 Self {
5585 inner,
5586 accept_compression_encodings: Default::default(),
5587 send_compression_encodings: Default::default(),
5588 max_decoding_message_size: None,
5589 max_encoding_message_size: None,
5590 }
5591 }
5592 pub fn with_interceptor<F>(
5593 inner: T,
5594 interceptor: F,
5595 ) -> InterceptedService<Self, F>
5596 where
5597 F: tonic::service::Interceptor,
5598 {
5599 InterceptedService::new(Self::new(inner), interceptor)
5600 }
5601 #[must_use]
5603 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5604 self.accept_compression_encodings.enable(encoding);
5605 self
5606 }
5607 #[must_use]
5609 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5610 self.send_compression_encodings.enable(encoding);
5611 self
5612 }
5613 #[must_use]
5617 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5618 self.max_decoding_message_size = Some(limit);
5619 self
5620 }
5621 #[must_use]
5625 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5626 self.max_encoding_message_size = Some(limit);
5627 self
5628 }
5629 }
5630 impl<T, B> tonic::codegen::Service<http::Request<B>>
5631 for PolarisServiceContractGrpcServer<T>
5632 where
5633 T: PolarisServiceContractGrpc,
5634 B: Body + Send + 'static,
5635 B::Error: Into<StdError> + Send + 'static,
5636 {
5637 type Response = http::Response<tonic::body::BoxBody>;
5638 type Error = std::convert::Infallible;
5639 type Future = BoxFuture<Self::Response, Self::Error>;
5640 fn poll_ready(
5641 &mut self,
5642 _cx: &mut Context<'_>,
5643 ) -> Poll<std::result::Result<(), Self::Error>> {
5644 Poll::Ready(Ok(()))
5645 }
5646 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5647 let inner = self.inner.clone();
5648 match req.uri().path() {
5649 "/v1.PolarisServiceContractGRPC/ReportServiceContract" => {
5650 #[allow(non_camel_case_types)]
5651 struct ReportServiceContractSvc<T: PolarisServiceContractGrpc>(
5652 pub Arc<T>,
5653 );
5654 impl<
5655 T: PolarisServiceContractGrpc,
5656 > tonic::server::UnaryService<super::ServiceContract>
5657 for ReportServiceContractSvc<T> {
5658 type Response = super::Response;
5659 type Future = BoxFuture<
5660 tonic::Response<Self::Response>,
5661 tonic::Status,
5662 >;
5663 fn call(
5664 &mut self,
5665 request: tonic::Request<super::ServiceContract>,
5666 ) -> Self::Future {
5667 let inner = Arc::clone(&self.0);
5668 let fut = async move {
5669 <T as PolarisServiceContractGrpc>::report_service_contract(
5670 &inner,
5671 request,
5672 )
5673 .await
5674 };
5675 Box::pin(fut)
5676 }
5677 }
5678 let accept_compression_encodings = self.accept_compression_encodings;
5679 let send_compression_encodings = self.send_compression_encodings;
5680 let max_decoding_message_size = self.max_decoding_message_size;
5681 let max_encoding_message_size = self.max_encoding_message_size;
5682 let inner = self.inner.clone();
5683 let fut = async move {
5684 let inner = inner.0;
5685 let method = ReportServiceContractSvc(inner);
5686 let codec = tonic::codec::ProstCodec::default();
5687 let mut grpc = tonic::server::Grpc::new(codec)
5688 .apply_compression_config(
5689 accept_compression_encodings,
5690 send_compression_encodings,
5691 )
5692 .apply_max_message_size_config(
5693 max_decoding_message_size,
5694 max_encoding_message_size,
5695 );
5696 let res = grpc.unary(method, req).await;
5697 Ok(res)
5698 };
5699 Box::pin(fut)
5700 }
5701 "/v1.PolarisServiceContractGRPC/GetServiceContract" => {
5702 #[allow(non_camel_case_types)]
5703 struct GetServiceContractSvc<T: PolarisServiceContractGrpc>(
5704 pub Arc<T>,
5705 );
5706 impl<
5707 T: PolarisServiceContractGrpc,
5708 > tonic::server::UnaryService<super::ServiceContract>
5709 for GetServiceContractSvc<T> {
5710 type Response = super::Response;
5711 type Future = BoxFuture<
5712 tonic::Response<Self::Response>,
5713 tonic::Status,
5714 >;
5715 fn call(
5716 &mut self,
5717 request: tonic::Request<super::ServiceContract>,
5718 ) -> Self::Future {
5719 let inner = Arc::clone(&self.0);
5720 let fut = async move {
5721 <T as PolarisServiceContractGrpc>::get_service_contract(
5722 &inner,
5723 request,
5724 )
5725 .await
5726 };
5727 Box::pin(fut)
5728 }
5729 }
5730 let accept_compression_encodings = self.accept_compression_encodings;
5731 let send_compression_encodings = self.send_compression_encodings;
5732 let max_decoding_message_size = self.max_decoding_message_size;
5733 let max_encoding_message_size = self.max_encoding_message_size;
5734 let inner = self.inner.clone();
5735 let fut = async move {
5736 let inner = inner.0;
5737 let method = GetServiceContractSvc(inner);
5738 let codec = tonic::codec::ProstCodec::default();
5739 let mut grpc = tonic::server::Grpc::new(codec)
5740 .apply_compression_config(
5741 accept_compression_encodings,
5742 send_compression_encodings,
5743 )
5744 .apply_max_message_size_config(
5745 max_decoding_message_size,
5746 max_encoding_message_size,
5747 );
5748 let res = grpc.unary(method, req).await;
5749 Ok(res)
5750 };
5751 Box::pin(fut)
5752 }
5753 _ => {
5754 Box::pin(async move {
5755 Ok(
5756 http::Response::builder()
5757 .status(200)
5758 .header("grpc-status", "12")
5759 .header("content-type", "application/grpc")
5760 .body(empty_body())
5761 .unwrap(),
5762 )
5763 })
5764 }
5765 }
5766 }
5767 }
5768 impl<T: PolarisServiceContractGrpc> Clone for PolarisServiceContractGrpcServer<T> {
5769 fn clone(&self) -> Self {
5770 let inner = self.inner.clone();
5771 Self {
5772 inner,
5773 accept_compression_encodings: self.accept_compression_encodings,
5774 send_compression_encodings: self.send_compression_encodings,
5775 max_decoding_message_size: self.max_decoding_message_size,
5776 max_encoding_message_size: self.max_encoding_message_size,
5777 }
5778 }
5779 }
5780 impl<T: PolarisServiceContractGrpc> Clone for _Inner<T> {
5781 fn clone(&self) -> Self {
5782 Self(Arc::clone(&self.0))
5783 }
5784 }
5785 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
5786 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5787 write!(f, "{:?}", self.0)
5788 }
5789 }
5790 impl<T: PolarisServiceContractGrpc> tonic::server::NamedService
5791 for PolarisServiceContractGrpcServer<T> {
5792 const NAME: &'static str = "v1.PolarisServiceContractGRPC";
5793 }
5794}
5795#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5796#[repr(i32)]
5797pub enum Code {
5798 Unknown = 0,
5800 ExecuteSuccess = 200000,
5801 DataNoChange = 200001,
5802 NoNeedUpdate = 200002,
5803 BadRequest = 400000,
5804 ParseException = 400001,
5805 EmptyRequest = 400002,
5806 BatchSizeOverLimit = 400003,
5807 InvalidDiscoverResource = 400004,
5808 InvalidRequestId = 400100,
5809 InvalidUserName = 400101,
5810 InvalidUserToken = 400102,
5811 InvalidParameter = 400103,
5812 EmptyQueryParameter = 400104,
5813 InvalidQueryInsParameter = 400105,
5814 InvalidNamespaceName = 400110,
5815 InvalidNamespaceOwners = 400111,
5816 InvalidNamespaceToken = 400112,
5817 InvalidServiceName = 400120,
5818 InvalidServiceOwners = 400121,
5819 InvalidServiceToken = 400122,
5820 InvalidServiceMetadata = 400123,
5821 InvalidServicePorts = 400124,
5822 InvalidServiceBusiness = 400125,
5823 InvalidServiceDepartment = 400126,
5824 InvalidServiceCmdb = 400127,
5825 InvalidServiceComment = 400128,
5826 InvalidServiceAliasComment = 400129,
5827 InvalidInstanceId = 400130,
5828 InvalidInstanceHost = 400131,
5829 InvalidInstancePort = 400132,
5830 InvalidServiceAlias = 400133,
5831 InvalidNamespaceWithAlias = 400134,
5832 InvalidServiceAliasOwners = 400135,
5833 InvalidInstanceProtocol = 400136,
5834 InvalidInstanceVersion = 400137,
5835 InvalidInstanceLogicSet = 400138,
5836 InvalidInstanceIsolate = 400139,
5837 HealthCheckNotOpen = 400140,
5838 HeartbeatOnDisabledIns = 400141,
5839 HeartbeatExceedLimit = 400142,
5840 HeartbeatTypeNotFound = 400143,
5841 InvalidMetadata = 400150,
5842 InvalidRateLimitId = 400151,
5843 InvalidRateLimitLabels = 400152,
5844 InvalidRateLimitAmounts = 400153,
5845 InvalidRateLimitName = 400154,
5846 InvalidCircuitBreakerId = 400160,
5847 InvalidCircuitBreakerVersion = 400161,
5848 InvalidCircuitBreakerName = 400162,
5849 InvalidCircuitBreakerNamespace = 400163,
5850 InvalidCircuitBreakerOwners = 400164,
5851 InvalidCircuitBreakerToken = 400165,
5852 InvalidCircuitBreakerBusiness = 400166,
5853 InvalidCircuitBreakerDepartment = 400167,
5854 InvalidCircuitBreakerComment = 400168,
5855 CircuitBreakerRuleExisted = 400169,
5856 InvalidRoutingId = 400700,
5857 InvalidRoutingPolicy = 400701,
5858 InvalidRoutingName = 400702,
5859 InvalidRoutingPriority = 400703,
5860 InvalidFaultDetectId = 400900,
5861 InvalidFaultDetectName = 400901,
5862 InvalidFaultDetectNamespace = 400902,
5863 FaultDetectRuleExisted = 400903,
5864 InvalidMatchRule = 400904,
5865 ServicesExistedMesh = 400170,
5867 ResourcesExistedMesh = 400171,
5868 InvalidMeshParameter = 400172,
5869 InvalidPlatformId = 400180,
5871 InvalidPlatformName = 400181,
5872 InvalidPlatformDomain = 400182,
5873 InvalidPlatformQps = 400183,
5874 InvalidPlatformToken = 400184,
5875 InvalidPlatformOwner = 400185,
5876 InvalidPlatformDepartment = 400186,
5877 InvalidPlatformComment = 400187,
5878 NotFoundPlatform = 400188,
5879 InvalidFluxRateLimitId = 400190,
5881 InvalidFluxRateLimitQps = 400191,
5882 InvalidFluxRateLimitSetKey = 400192,
5883 ExistedResource = 400201,
5884 NotFoundResource = 400202,
5885 NamespaceExistedServices = 400203,
5886 ServiceExistedInstances = 400204,
5887 ServiceExistedRoutings = 400205,
5888 ServiceExistedRateLimits = 400206,
5889 ExistReleasedConfig = 400207,
5890 SameInstanceRequest = 400208,
5891 ServiceExistedCircuitBreakers = 400209,
5892 ServiceExistedAlias = 400210,
5893 NamespaceExistedMeshResources = 400211,
5894 NamespaceExistedCircuitBreakers = 400212,
5895 ServiceSubscribedByMeshes = 400213,
5896 ServiceExistedFluxRateLimits = 400214,
5897 NamespaceExistedConfigGroups = 400219,
5898 NotFoundService = 400301,
5899 NotFoundRouting = 400302,
5900 NotFoundInstance = 400303,
5901 NotFoundServiceAlias = 400304,
5902 NotFoundNamespace = 400305,
5903 NotFoundSourceService = 400306,
5904 NotFoundRateLimit = 400307,
5905 NotFoundCircuitBreaker = 400308,
5906 NotFoundMasterConfig = 400309,
5907 NotFoundTagConfig = 400310,
5908 NotFoundTagConfigOrService = 400311,
5909 ClientApiNotOpen = 400401,
5910 NotAllowBusinessService = 400402,
5911 NotAllowAliasUpdate = 400501,
5912 NotAllowAliasCreateInstance = 400502,
5913 NotAllowAliasCreateRouting = 400503,
5914 NotAllowCreateAliasForAlias = 400504,
5915 NotAllowAliasCreateRateLimit = 400505,
5916 NotAllowAliasBindRule = 400506,
5917 NotAllowDifferentNamespaceBindRule = 400507,
5918 Unauthorized = 401000,
5919 NotAllowedAccess = 401001,
5920 CmdbNotFindHost = 404001,
5921 DataConflict = 409000,
5922 InstanceTooManyRequests = 429001,
5923 IpRateLimit = 429002,
5924 ApiRateLimit = 403003,
5925 ExecuteException = 500000,
5926 StoreLayerException = 500001,
5927 CmdbPluginException = 500002,
5928 ParseRoutingException = 500004,
5929 ParseRateLimitException = 500005,
5930 ParseCircuitBreakerException = 500006,
5931 HeartbeatException = 500007,
5932 InstanceRegisTimeout = 500008,
5933 InvalidConfigFileGroupName = 400801,
5935 InvalidConfigFileName = 400802,
5936 InvalidConfigFileContentLength = 400803,
5937 InvalidConfigFileFormat = 400804,
5938 InvalidConfigFileTags = 400805,
5939 InvalidWatchConfigFileFormat = 400806,
5940 NotFoundResourceConfigFile = 400807,
5941 InvalidConfigFileTemplateName = 400808,
5942 EncryptConfigFileException = 400809,
5943 GroupExistActiveRelease = 400810,
5944 DecryptConfigFileException = 400811,
5945 InvalidUserOwners = 400410,
5947 InvalidUserId = 400411,
5948 InvalidUserPassword = 400412,
5949 InvalidUserMobile = 400413,
5950 InvalidUserEmail = 400414,
5951 InvalidUserGroupOwners = 400420,
5952 InvalidUserGroupId = 400421,
5953 InvalidAuthStrategyOwners = 400430,
5954 InvalidAuthStrategyName = 400431,
5955 InvalidAuthStrategyId = 400432,
5956 InvalidPrincipalType = 400440,
5957 UserExisted = 400215,
5958 UserGroupExisted = 400216,
5959 AuthStrategyRuleExisted = 400217,
5960 SubAccountExisted = 400218,
5961 NotFoundUser = 400312,
5962 NotFoundOwnerUser = 400313,
5963 NotFoundUserGroup = 400314,
5964 NotFoundAuthStrategyRule = 400315,
5965 NotAllowModifyDefaultStrategyPrincipal = 400508,
5966 NotAllowModifyOwnerDefaultStrategy = 400509,
5967 EmptyAutToken = 401002,
5968 TokenDisabled = 401003,
5969 TokenNotExisted = 401004,
5970 AuthTokenForbidden = 403001,
5971 OperationRoleForbidden = 403002,
5972}
5973impl Code {
5974 pub fn as_str_name(&self) -> &'static str {
5979 match self {
5980 Code::Unknown => "Unknown",
5981 Code::ExecuteSuccess => "ExecuteSuccess",
5982 Code::DataNoChange => "DataNoChange",
5983 Code::NoNeedUpdate => "NoNeedUpdate",
5984 Code::BadRequest => "BadRequest",
5985 Code::ParseException => "ParseException",
5986 Code::EmptyRequest => "EmptyRequest",
5987 Code::BatchSizeOverLimit => "BatchSizeOverLimit",
5988 Code::InvalidDiscoverResource => "InvalidDiscoverResource",
5989 Code::InvalidRequestId => "InvalidRequestID",
5990 Code::InvalidUserName => "InvalidUserName",
5991 Code::InvalidUserToken => "InvalidUserToken",
5992 Code::InvalidParameter => "InvalidParameter",
5993 Code::EmptyQueryParameter => "EmptyQueryParameter",
5994 Code::InvalidQueryInsParameter => "InvalidQueryInsParameter",
5995 Code::InvalidNamespaceName => "InvalidNamespaceName",
5996 Code::InvalidNamespaceOwners => "InvalidNamespaceOwners",
5997 Code::InvalidNamespaceToken => "InvalidNamespaceToken",
5998 Code::InvalidServiceName => "InvalidServiceName",
5999 Code::InvalidServiceOwners => "InvalidServiceOwners",
6000 Code::InvalidServiceToken => "InvalidServiceToken",
6001 Code::InvalidServiceMetadata => "InvalidServiceMetadata",
6002 Code::InvalidServicePorts => "InvalidServicePorts",
6003 Code::InvalidServiceBusiness => "InvalidServiceBusiness",
6004 Code::InvalidServiceDepartment => "InvalidServiceDepartment",
6005 Code::InvalidServiceCmdb => "InvalidServiceCMDB",
6006 Code::InvalidServiceComment => "InvalidServiceComment",
6007 Code::InvalidServiceAliasComment => "InvalidServiceAliasComment",
6008 Code::InvalidInstanceId => "InvalidInstanceID",
6009 Code::InvalidInstanceHost => "InvalidInstanceHost",
6010 Code::InvalidInstancePort => "InvalidInstancePort",
6011 Code::InvalidServiceAlias => "InvalidServiceAlias",
6012 Code::InvalidNamespaceWithAlias => "InvalidNamespaceWithAlias",
6013 Code::InvalidServiceAliasOwners => "InvalidServiceAliasOwners",
6014 Code::InvalidInstanceProtocol => "InvalidInstanceProtocol",
6015 Code::InvalidInstanceVersion => "InvalidInstanceVersion",
6016 Code::InvalidInstanceLogicSet => "InvalidInstanceLogicSet",
6017 Code::InvalidInstanceIsolate => "InvalidInstanceIsolate",
6018 Code::HealthCheckNotOpen => "HealthCheckNotOpen",
6019 Code::HeartbeatOnDisabledIns => "HeartbeatOnDisabledIns",
6020 Code::HeartbeatExceedLimit => "HeartbeatExceedLimit",
6021 Code::HeartbeatTypeNotFound => "HeartbeatTypeNotFound",
6022 Code::InvalidMetadata => "InvalidMetadata",
6023 Code::InvalidRateLimitId => "InvalidRateLimitID",
6024 Code::InvalidRateLimitLabels => "InvalidRateLimitLabels",
6025 Code::InvalidRateLimitAmounts => "InvalidRateLimitAmounts",
6026 Code::InvalidRateLimitName => "InvalidRateLimitName",
6027 Code::InvalidCircuitBreakerId => "InvalidCircuitBreakerID",
6028 Code::InvalidCircuitBreakerVersion => "InvalidCircuitBreakerVersion",
6029 Code::InvalidCircuitBreakerName => "InvalidCircuitBreakerName",
6030 Code::InvalidCircuitBreakerNamespace => "InvalidCircuitBreakerNamespace",
6031 Code::InvalidCircuitBreakerOwners => "InvalidCircuitBreakerOwners",
6032 Code::InvalidCircuitBreakerToken => "InvalidCircuitBreakerToken",
6033 Code::InvalidCircuitBreakerBusiness => "InvalidCircuitBreakerBusiness",
6034 Code::InvalidCircuitBreakerDepartment => "InvalidCircuitBreakerDepartment",
6035 Code::InvalidCircuitBreakerComment => "InvalidCircuitBreakerComment",
6036 Code::CircuitBreakerRuleExisted => "CircuitBreakerRuleExisted",
6037 Code::InvalidRoutingId => "InvalidRoutingID",
6038 Code::InvalidRoutingPolicy => "InvalidRoutingPolicy",
6039 Code::InvalidRoutingName => "InvalidRoutingName",
6040 Code::InvalidRoutingPriority => "InvalidRoutingPriority",
6041 Code::InvalidFaultDetectId => "InvalidFaultDetectID",
6042 Code::InvalidFaultDetectName => "InvalidFaultDetectName",
6043 Code::InvalidFaultDetectNamespace => "InvalidFaultDetectNamespace",
6044 Code::FaultDetectRuleExisted => "FaultDetectRuleExisted",
6045 Code::InvalidMatchRule => "InvalidMatchRule",
6046 Code::ServicesExistedMesh => "ServicesExistedMesh",
6047 Code::ResourcesExistedMesh => "ResourcesExistedMesh",
6048 Code::InvalidMeshParameter => "InvalidMeshParameter",
6049 Code::InvalidPlatformId => "InvalidPlatformID",
6050 Code::InvalidPlatformName => "InvalidPlatformName",
6051 Code::InvalidPlatformDomain => "InvalidPlatformDomain",
6052 Code::InvalidPlatformQps => "InvalidPlatformQPS",
6053 Code::InvalidPlatformToken => "InvalidPlatformToken",
6054 Code::InvalidPlatformOwner => "InvalidPlatformOwner",
6055 Code::InvalidPlatformDepartment => "InvalidPlatformDepartment",
6056 Code::InvalidPlatformComment => "InvalidPlatformComment",
6057 Code::NotFoundPlatform => "NotFoundPlatform",
6058 Code::InvalidFluxRateLimitId => "InvalidFluxRateLimitId",
6059 Code::InvalidFluxRateLimitQps => "InvalidFluxRateLimitQps",
6060 Code::InvalidFluxRateLimitSetKey => "InvalidFluxRateLimitSetKey",
6061 Code::ExistedResource => "ExistedResource",
6062 Code::NotFoundResource => "NotFoundResource",
6063 Code::NamespaceExistedServices => "NamespaceExistedServices",
6064 Code::ServiceExistedInstances => "ServiceExistedInstances",
6065 Code::ServiceExistedRoutings => "ServiceExistedRoutings",
6066 Code::ServiceExistedRateLimits => "ServiceExistedRateLimits",
6067 Code::ExistReleasedConfig => "ExistReleasedConfig",
6068 Code::SameInstanceRequest => "SameInstanceRequest",
6069 Code::ServiceExistedCircuitBreakers => "ServiceExistedCircuitBreakers",
6070 Code::ServiceExistedAlias => "ServiceExistedAlias",
6071 Code::NamespaceExistedMeshResources => "NamespaceExistedMeshResources",
6072 Code::NamespaceExistedCircuitBreakers => "NamespaceExistedCircuitBreakers",
6073 Code::ServiceSubscribedByMeshes => "ServiceSubscribedByMeshes",
6074 Code::ServiceExistedFluxRateLimits => "ServiceExistedFluxRateLimits",
6075 Code::NamespaceExistedConfigGroups => "NamespaceExistedConfigGroups",
6076 Code::NotFoundService => "NotFoundService",
6077 Code::NotFoundRouting => "NotFoundRouting",
6078 Code::NotFoundInstance => "NotFoundInstance",
6079 Code::NotFoundServiceAlias => "NotFoundServiceAlias",
6080 Code::NotFoundNamespace => "NotFoundNamespace",
6081 Code::NotFoundSourceService => "NotFoundSourceService",
6082 Code::NotFoundRateLimit => "NotFoundRateLimit",
6083 Code::NotFoundCircuitBreaker => "NotFoundCircuitBreaker",
6084 Code::NotFoundMasterConfig => "NotFoundMasterConfig",
6085 Code::NotFoundTagConfig => "NotFoundTagConfig",
6086 Code::NotFoundTagConfigOrService => "NotFoundTagConfigOrService",
6087 Code::ClientApiNotOpen => "ClientAPINotOpen",
6088 Code::NotAllowBusinessService => "NotAllowBusinessService",
6089 Code::NotAllowAliasUpdate => "NotAllowAliasUpdate",
6090 Code::NotAllowAliasCreateInstance => "NotAllowAliasCreateInstance",
6091 Code::NotAllowAliasCreateRouting => "NotAllowAliasCreateRouting",
6092 Code::NotAllowCreateAliasForAlias => "NotAllowCreateAliasForAlias",
6093 Code::NotAllowAliasCreateRateLimit => "NotAllowAliasCreateRateLimit",
6094 Code::NotAllowAliasBindRule => "NotAllowAliasBindRule",
6095 Code::NotAllowDifferentNamespaceBindRule => {
6096 "NotAllowDifferentNamespaceBindRule"
6097 }
6098 Code::Unauthorized => "Unauthorized",
6099 Code::NotAllowedAccess => "NotAllowedAccess",
6100 Code::CmdbNotFindHost => "CMDBNotFindHost",
6101 Code::DataConflict => "DataConflict",
6102 Code::InstanceTooManyRequests => "InstanceTooManyRequests",
6103 Code::IpRateLimit => "IPRateLimit",
6104 Code::ApiRateLimit => "APIRateLimit",
6105 Code::ExecuteException => "ExecuteException",
6106 Code::StoreLayerException => "StoreLayerException",
6107 Code::CmdbPluginException => "CMDBPluginException",
6108 Code::ParseRoutingException => "ParseRoutingException",
6109 Code::ParseRateLimitException => "ParseRateLimitException",
6110 Code::ParseCircuitBreakerException => "ParseCircuitBreakerException",
6111 Code::HeartbeatException => "HeartbeatException",
6112 Code::InstanceRegisTimeout => "InstanceRegisTimeout",
6113 Code::InvalidConfigFileGroupName => "InvalidConfigFileGroupName",
6114 Code::InvalidConfigFileName => "InvalidConfigFileName",
6115 Code::InvalidConfigFileContentLength => "InvalidConfigFileContentLength",
6116 Code::InvalidConfigFileFormat => "InvalidConfigFileFormat",
6117 Code::InvalidConfigFileTags => "InvalidConfigFileTags",
6118 Code::InvalidWatchConfigFileFormat => "InvalidWatchConfigFileFormat",
6119 Code::NotFoundResourceConfigFile => "NotFoundResourceConfigFile",
6120 Code::InvalidConfigFileTemplateName => "InvalidConfigFileTemplateName",
6121 Code::EncryptConfigFileException => "EncryptConfigFileException",
6122 Code::GroupExistActiveRelease => "GroupExistActiveRelease",
6123 Code::DecryptConfigFileException => "DecryptConfigFileException",
6124 Code::InvalidUserOwners => "InvalidUserOwners",
6125 Code::InvalidUserId => "InvalidUserID",
6126 Code::InvalidUserPassword => "InvalidUserPassword",
6127 Code::InvalidUserMobile => "InvalidUserMobile",
6128 Code::InvalidUserEmail => "InvalidUserEmail",
6129 Code::InvalidUserGroupOwners => "InvalidUserGroupOwners",
6130 Code::InvalidUserGroupId => "InvalidUserGroupID",
6131 Code::InvalidAuthStrategyOwners => "InvalidAuthStrategyOwners",
6132 Code::InvalidAuthStrategyName => "InvalidAuthStrategyName",
6133 Code::InvalidAuthStrategyId => "InvalidAuthStrategyID",
6134 Code::InvalidPrincipalType => "InvalidPrincipalType",
6135 Code::UserExisted => "UserExisted",
6136 Code::UserGroupExisted => "UserGroupExisted",
6137 Code::AuthStrategyRuleExisted => "AuthStrategyRuleExisted",
6138 Code::SubAccountExisted => "SubAccountExisted",
6139 Code::NotFoundUser => "NotFoundUser",
6140 Code::NotFoundOwnerUser => "NotFoundOwnerUser",
6141 Code::NotFoundUserGroup => "NotFoundUserGroup",
6142 Code::NotFoundAuthStrategyRule => "NotFoundAuthStrategyRule",
6143 Code::NotAllowModifyDefaultStrategyPrincipal => {
6144 "NotAllowModifyDefaultStrategyPrincipal"
6145 }
6146 Code::NotAllowModifyOwnerDefaultStrategy => {
6147 "NotAllowModifyOwnerDefaultStrategy"
6148 }
6149 Code::EmptyAutToken => "EmptyAutToken",
6150 Code::TokenDisabled => "TokenDisabled",
6151 Code::TokenNotExisted => "TokenNotExisted",
6152 Code::AuthTokenForbidden => "AuthTokenForbidden",
6153 Code::OperationRoleForbidden => "OperationRoleForbidden",
6154 }
6155 }
6156 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6158 match value {
6159 "Unknown" => Some(Self::Unknown),
6160 "ExecuteSuccess" => Some(Self::ExecuteSuccess),
6161 "DataNoChange" => Some(Self::DataNoChange),
6162 "NoNeedUpdate" => Some(Self::NoNeedUpdate),
6163 "BadRequest" => Some(Self::BadRequest),
6164 "ParseException" => Some(Self::ParseException),
6165 "EmptyRequest" => Some(Self::EmptyRequest),
6166 "BatchSizeOverLimit" => Some(Self::BatchSizeOverLimit),
6167 "InvalidDiscoverResource" => Some(Self::InvalidDiscoverResource),
6168 "InvalidRequestID" => Some(Self::InvalidRequestId),
6169 "InvalidUserName" => Some(Self::InvalidUserName),
6170 "InvalidUserToken" => Some(Self::InvalidUserToken),
6171 "InvalidParameter" => Some(Self::InvalidParameter),
6172 "EmptyQueryParameter" => Some(Self::EmptyQueryParameter),
6173 "InvalidQueryInsParameter" => Some(Self::InvalidQueryInsParameter),
6174 "InvalidNamespaceName" => Some(Self::InvalidNamespaceName),
6175 "InvalidNamespaceOwners" => Some(Self::InvalidNamespaceOwners),
6176 "InvalidNamespaceToken" => Some(Self::InvalidNamespaceToken),
6177 "InvalidServiceName" => Some(Self::InvalidServiceName),
6178 "InvalidServiceOwners" => Some(Self::InvalidServiceOwners),
6179 "InvalidServiceToken" => Some(Self::InvalidServiceToken),
6180 "InvalidServiceMetadata" => Some(Self::InvalidServiceMetadata),
6181 "InvalidServicePorts" => Some(Self::InvalidServicePorts),
6182 "InvalidServiceBusiness" => Some(Self::InvalidServiceBusiness),
6183 "InvalidServiceDepartment" => Some(Self::InvalidServiceDepartment),
6184 "InvalidServiceCMDB" => Some(Self::InvalidServiceCmdb),
6185 "InvalidServiceComment" => Some(Self::InvalidServiceComment),
6186 "InvalidServiceAliasComment" => Some(Self::InvalidServiceAliasComment),
6187 "InvalidInstanceID" => Some(Self::InvalidInstanceId),
6188 "InvalidInstanceHost" => Some(Self::InvalidInstanceHost),
6189 "InvalidInstancePort" => Some(Self::InvalidInstancePort),
6190 "InvalidServiceAlias" => Some(Self::InvalidServiceAlias),
6191 "InvalidNamespaceWithAlias" => Some(Self::InvalidNamespaceWithAlias),
6192 "InvalidServiceAliasOwners" => Some(Self::InvalidServiceAliasOwners),
6193 "InvalidInstanceProtocol" => Some(Self::InvalidInstanceProtocol),
6194 "InvalidInstanceVersion" => Some(Self::InvalidInstanceVersion),
6195 "InvalidInstanceLogicSet" => Some(Self::InvalidInstanceLogicSet),
6196 "InvalidInstanceIsolate" => Some(Self::InvalidInstanceIsolate),
6197 "HealthCheckNotOpen" => Some(Self::HealthCheckNotOpen),
6198 "HeartbeatOnDisabledIns" => Some(Self::HeartbeatOnDisabledIns),
6199 "HeartbeatExceedLimit" => Some(Self::HeartbeatExceedLimit),
6200 "HeartbeatTypeNotFound" => Some(Self::HeartbeatTypeNotFound),
6201 "InvalidMetadata" => Some(Self::InvalidMetadata),
6202 "InvalidRateLimitID" => Some(Self::InvalidRateLimitId),
6203 "InvalidRateLimitLabels" => Some(Self::InvalidRateLimitLabels),
6204 "InvalidRateLimitAmounts" => Some(Self::InvalidRateLimitAmounts),
6205 "InvalidRateLimitName" => Some(Self::InvalidRateLimitName),
6206 "InvalidCircuitBreakerID" => Some(Self::InvalidCircuitBreakerId),
6207 "InvalidCircuitBreakerVersion" => Some(Self::InvalidCircuitBreakerVersion),
6208 "InvalidCircuitBreakerName" => Some(Self::InvalidCircuitBreakerName),
6209 "InvalidCircuitBreakerNamespace" => {
6210 Some(Self::InvalidCircuitBreakerNamespace)
6211 }
6212 "InvalidCircuitBreakerOwners" => Some(Self::InvalidCircuitBreakerOwners),
6213 "InvalidCircuitBreakerToken" => Some(Self::InvalidCircuitBreakerToken),
6214 "InvalidCircuitBreakerBusiness" => Some(Self::InvalidCircuitBreakerBusiness),
6215 "InvalidCircuitBreakerDepartment" => {
6216 Some(Self::InvalidCircuitBreakerDepartment)
6217 }
6218 "InvalidCircuitBreakerComment" => Some(Self::InvalidCircuitBreakerComment),
6219 "CircuitBreakerRuleExisted" => Some(Self::CircuitBreakerRuleExisted),
6220 "InvalidRoutingID" => Some(Self::InvalidRoutingId),
6221 "InvalidRoutingPolicy" => Some(Self::InvalidRoutingPolicy),
6222 "InvalidRoutingName" => Some(Self::InvalidRoutingName),
6223 "InvalidRoutingPriority" => Some(Self::InvalidRoutingPriority),
6224 "InvalidFaultDetectID" => Some(Self::InvalidFaultDetectId),
6225 "InvalidFaultDetectName" => Some(Self::InvalidFaultDetectName),
6226 "InvalidFaultDetectNamespace" => Some(Self::InvalidFaultDetectNamespace),
6227 "FaultDetectRuleExisted" => Some(Self::FaultDetectRuleExisted),
6228 "InvalidMatchRule" => Some(Self::InvalidMatchRule),
6229 "ServicesExistedMesh" => Some(Self::ServicesExistedMesh),
6230 "ResourcesExistedMesh" => Some(Self::ResourcesExistedMesh),
6231 "InvalidMeshParameter" => Some(Self::InvalidMeshParameter),
6232 "InvalidPlatformID" => Some(Self::InvalidPlatformId),
6233 "InvalidPlatformName" => Some(Self::InvalidPlatformName),
6234 "InvalidPlatformDomain" => Some(Self::InvalidPlatformDomain),
6235 "InvalidPlatformQPS" => Some(Self::InvalidPlatformQps),
6236 "InvalidPlatformToken" => Some(Self::InvalidPlatformToken),
6237 "InvalidPlatformOwner" => Some(Self::InvalidPlatformOwner),
6238 "InvalidPlatformDepartment" => Some(Self::InvalidPlatformDepartment),
6239 "InvalidPlatformComment" => Some(Self::InvalidPlatformComment),
6240 "NotFoundPlatform" => Some(Self::NotFoundPlatform),
6241 "InvalidFluxRateLimitId" => Some(Self::InvalidFluxRateLimitId),
6242 "InvalidFluxRateLimitQps" => Some(Self::InvalidFluxRateLimitQps),
6243 "InvalidFluxRateLimitSetKey" => Some(Self::InvalidFluxRateLimitSetKey),
6244 "ExistedResource" => Some(Self::ExistedResource),
6245 "NotFoundResource" => Some(Self::NotFoundResource),
6246 "NamespaceExistedServices" => Some(Self::NamespaceExistedServices),
6247 "ServiceExistedInstances" => Some(Self::ServiceExistedInstances),
6248 "ServiceExistedRoutings" => Some(Self::ServiceExistedRoutings),
6249 "ServiceExistedRateLimits" => Some(Self::ServiceExistedRateLimits),
6250 "ExistReleasedConfig" => Some(Self::ExistReleasedConfig),
6251 "SameInstanceRequest" => Some(Self::SameInstanceRequest),
6252 "ServiceExistedCircuitBreakers" => Some(Self::ServiceExistedCircuitBreakers),
6253 "ServiceExistedAlias" => Some(Self::ServiceExistedAlias),
6254 "NamespaceExistedMeshResources" => Some(Self::NamespaceExistedMeshResources),
6255 "NamespaceExistedCircuitBreakers" => {
6256 Some(Self::NamespaceExistedCircuitBreakers)
6257 }
6258 "ServiceSubscribedByMeshes" => Some(Self::ServiceSubscribedByMeshes),
6259 "ServiceExistedFluxRateLimits" => Some(Self::ServiceExistedFluxRateLimits),
6260 "NamespaceExistedConfigGroups" => Some(Self::NamespaceExistedConfigGroups),
6261 "NotFoundService" => Some(Self::NotFoundService),
6262 "NotFoundRouting" => Some(Self::NotFoundRouting),
6263 "NotFoundInstance" => Some(Self::NotFoundInstance),
6264 "NotFoundServiceAlias" => Some(Self::NotFoundServiceAlias),
6265 "NotFoundNamespace" => Some(Self::NotFoundNamespace),
6266 "NotFoundSourceService" => Some(Self::NotFoundSourceService),
6267 "NotFoundRateLimit" => Some(Self::NotFoundRateLimit),
6268 "NotFoundCircuitBreaker" => Some(Self::NotFoundCircuitBreaker),
6269 "NotFoundMasterConfig" => Some(Self::NotFoundMasterConfig),
6270 "NotFoundTagConfig" => Some(Self::NotFoundTagConfig),
6271 "NotFoundTagConfigOrService" => Some(Self::NotFoundTagConfigOrService),
6272 "ClientAPINotOpen" => Some(Self::ClientApiNotOpen),
6273 "NotAllowBusinessService" => Some(Self::NotAllowBusinessService),
6274 "NotAllowAliasUpdate" => Some(Self::NotAllowAliasUpdate),
6275 "NotAllowAliasCreateInstance" => Some(Self::NotAllowAliasCreateInstance),
6276 "NotAllowAliasCreateRouting" => Some(Self::NotAllowAliasCreateRouting),
6277 "NotAllowCreateAliasForAlias" => Some(Self::NotAllowCreateAliasForAlias),
6278 "NotAllowAliasCreateRateLimit" => Some(Self::NotAllowAliasCreateRateLimit),
6279 "NotAllowAliasBindRule" => Some(Self::NotAllowAliasBindRule),
6280 "NotAllowDifferentNamespaceBindRule" => {
6281 Some(Self::NotAllowDifferentNamespaceBindRule)
6282 }
6283 "Unauthorized" => Some(Self::Unauthorized),
6284 "NotAllowedAccess" => Some(Self::NotAllowedAccess),
6285 "CMDBNotFindHost" => Some(Self::CmdbNotFindHost),
6286 "DataConflict" => Some(Self::DataConflict),
6287 "InstanceTooManyRequests" => Some(Self::InstanceTooManyRequests),
6288 "IPRateLimit" => Some(Self::IpRateLimit),
6289 "APIRateLimit" => Some(Self::ApiRateLimit),
6290 "ExecuteException" => Some(Self::ExecuteException),
6291 "StoreLayerException" => Some(Self::StoreLayerException),
6292 "CMDBPluginException" => Some(Self::CmdbPluginException),
6293 "ParseRoutingException" => Some(Self::ParseRoutingException),
6294 "ParseRateLimitException" => Some(Self::ParseRateLimitException),
6295 "ParseCircuitBreakerException" => Some(Self::ParseCircuitBreakerException),
6296 "HeartbeatException" => Some(Self::HeartbeatException),
6297 "InstanceRegisTimeout" => Some(Self::InstanceRegisTimeout),
6298 "InvalidConfigFileGroupName" => Some(Self::InvalidConfigFileGroupName),
6299 "InvalidConfigFileName" => Some(Self::InvalidConfigFileName),
6300 "InvalidConfigFileContentLength" => {
6301 Some(Self::InvalidConfigFileContentLength)
6302 }
6303 "InvalidConfigFileFormat" => Some(Self::InvalidConfigFileFormat),
6304 "InvalidConfigFileTags" => Some(Self::InvalidConfigFileTags),
6305 "InvalidWatchConfigFileFormat" => Some(Self::InvalidWatchConfigFileFormat),
6306 "NotFoundResourceConfigFile" => Some(Self::NotFoundResourceConfigFile),
6307 "InvalidConfigFileTemplateName" => Some(Self::InvalidConfigFileTemplateName),
6308 "EncryptConfigFileException" => Some(Self::EncryptConfigFileException),
6309 "GroupExistActiveRelease" => Some(Self::GroupExistActiveRelease),
6310 "DecryptConfigFileException" => Some(Self::DecryptConfigFileException),
6311 "InvalidUserOwners" => Some(Self::InvalidUserOwners),
6312 "InvalidUserID" => Some(Self::InvalidUserId),
6313 "InvalidUserPassword" => Some(Self::InvalidUserPassword),
6314 "InvalidUserMobile" => Some(Self::InvalidUserMobile),
6315 "InvalidUserEmail" => Some(Self::InvalidUserEmail),
6316 "InvalidUserGroupOwners" => Some(Self::InvalidUserGroupOwners),
6317 "InvalidUserGroupID" => Some(Self::InvalidUserGroupId),
6318 "InvalidAuthStrategyOwners" => Some(Self::InvalidAuthStrategyOwners),
6319 "InvalidAuthStrategyName" => Some(Self::InvalidAuthStrategyName),
6320 "InvalidAuthStrategyID" => Some(Self::InvalidAuthStrategyId),
6321 "InvalidPrincipalType" => Some(Self::InvalidPrincipalType),
6322 "UserExisted" => Some(Self::UserExisted),
6323 "UserGroupExisted" => Some(Self::UserGroupExisted),
6324 "AuthStrategyRuleExisted" => Some(Self::AuthStrategyRuleExisted),
6325 "SubAccountExisted" => Some(Self::SubAccountExisted),
6326 "NotFoundUser" => Some(Self::NotFoundUser),
6327 "NotFoundOwnerUser" => Some(Self::NotFoundOwnerUser),
6328 "NotFoundUserGroup" => Some(Self::NotFoundUserGroup),
6329 "NotFoundAuthStrategyRule" => Some(Self::NotFoundAuthStrategyRule),
6330 "NotAllowModifyDefaultStrategyPrincipal" => {
6331 Some(Self::NotAllowModifyDefaultStrategyPrincipal)
6332 }
6333 "NotAllowModifyOwnerDefaultStrategy" => {
6334 Some(Self::NotAllowModifyOwnerDefaultStrategy)
6335 }
6336 "EmptyAutToken" => Some(Self::EmptyAutToken),
6337 "TokenDisabled" => Some(Self::TokenDisabled),
6338 "TokenNotExisted" => Some(Self::TokenNotExisted),
6339 "AuthTokenForbidden" => Some(Self::AuthTokenForbidden),
6340 "OperationRoleForbidden" => Some(Self::OperationRoleForbidden),
6341 _ => None,
6342 }
6343 }
6344}
6345#[allow(clippy::derive_partial_eq_without_eq)]
6346#[derive(Clone, PartialEq, ::prost::Message)]
6347pub struct ConfigSimpleResponse {
6348 #[prost(message, optional, tag = "1")]
6349 pub code: ::core::option::Option<u32>,
6350 #[prost(message, optional, tag = "2")]
6351 pub info: ::core::option::Option<::prost::alloc::string::String>,
6352}
6353#[allow(clippy::derive_partial_eq_without_eq)]
6354#[derive(Clone, PartialEq, ::prost::Message)]
6355pub struct ConfigResponse {
6356 #[prost(message, optional, tag = "1")]
6357 pub code: ::core::option::Option<u32>,
6358 #[prost(message, optional, tag = "2")]
6359 pub info: ::core::option::Option<::prost::alloc::string::String>,
6360 #[prost(message, optional, tag = "3")]
6361 pub config_file_group: ::core::option::Option<ConfigFileGroup>,
6362 #[prost(message, optional, tag = "4")]
6363 pub config_file: ::core::option::Option<ConfigFile>,
6364 #[prost(message, optional, tag = "5")]
6365 pub config_file_release: ::core::option::Option<ConfigFileRelease>,
6366 #[prost(message, optional, tag = "6")]
6367 pub config_file_release_history: ::core::option::Option<ConfigFileReleaseHistory>,
6368 #[prost(message, optional, tag = "7")]
6369 pub config_file_template: ::core::option::Option<ConfigFileTemplate>,
6370}
6371#[allow(clippy::derive_partial_eq_without_eq)]
6372#[derive(Clone, PartialEq, ::prost::Message)]
6373pub struct ConfigBatchWriteResponse {
6374 #[prost(message, optional, tag = "1")]
6375 pub code: ::core::option::Option<u32>,
6376 #[prost(message, optional, tag = "2")]
6377 pub info: ::core::option::Option<::prost::alloc::string::String>,
6378 #[prost(message, optional, tag = "3")]
6379 pub total: ::core::option::Option<u32>,
6380 #[prost(message, repeated, tag = "4")]
6381 pub responses: ::prost::alloc::vec::Vec<ConfigResponse>,
6382}
6383#[allow(clippy::derive_partial_eq_without_eq)]
6384#[derive(Clone, PartialEq, ::prost::Message)]
6385pub struct ConfigBatchQueryResponse {
6386 #[prost(message, optional, tag = "1")]
6387 pub code: ::core::option::Option<u32>,
6388 #[prost(message, optional, tag = "2")]
6389 pub info: ::core::option::Option<::prost::alloc::string::String>,
6390 #[prost(message, optional, tag = "3")]
6391 pub total: ::core::option::Option<u32>,
6392 #[prost(message, repeated, tag = "4")]
6393 pub config_file_groups: ::prost::alloc::vec::Vec<ConfigFileGroup>,
6394 #[prost(message, repeated, tag = "5")]
6395 pub config_files: ::prost::alloc::vec::Vec<ConfigFile>,
6396 #[prost(message, repeated, tag = "6")]
6397 pub config_file_releases: ::prost::alloc::vec::Vec<ConfigFileRelease>,
6398 #[prost(message, repeated, tag = "7")]
6399 pub config_file_release_histories: ::prost::alloc::vec::Vec<
6400 ConfigFileReleaseHistory,
6401 >,
6402 #[prost(message, repeated, tag = "8")]
6403 pub config_file_templates: ::prost::alloc::vec::Vec<ConfigFileTemplate>,
6404}
6405#[allow(clippy::derive_partial_eq_without_eq)]
6406#[derive(Clone, PartialEq, ::prost::Message)]
6407pub struct ConfigClientResponse {
6408 #[prost(message, optional, tag = "1")]
6409 pub code: ::core::option::Option<u32>,
6410 #[prost(message, optional, tag = "2")]
6411 pub info: ::core::option::Option<::prost::alloc::string::String>,
6412 #[prost(message, optional, tag = "3")]
6413 pub config_file: ::core::option::Option<ClientConfigFileInfo>,
6414}
6415#[allow(clippy::derive_partial_eq_without_eq)]
6416#[derive(Clone, PartialEq, ::prost::Message)]
6417pub struct ConfigImportResponse {
6418 #[prost(message, optional, tag = "1")]
6419 pub code: ::core::option::Option<u32>,
6420 #[prost(message, optional, tag = "2")]
6421 pub info: ::core::option::Option<::prost::alloc::string::String>,
6422 #[prost(message, repeated, tag = "3")]
6423 pub create_config_files: ::prost::alloc::vec::Vec<ConfigFile>,
6424 #[prost(message, repeated, tag = "4")]
6425 pub skip_config_files: ::prost::alloc::vec::Vec<ConfigFile>,
6426 #[prost(message, repeated, tag = "5")]
6427 pub overwrite_config_files: ::prost::alloc::vec::Vec<ConfigFile>,
6428}
6429#[allow(clippy::derive_partial_eq_without_eq)]
6430#[derive(Clone, PartialEq, ::prost::Message)]
6431pub struct ConfigExportResponse {
6432 #[prost(message, optional, tag = "1")]
6433 pub code: ::core::option::Option<u32>,
6434 #[prost(message, optional, tag = "2")]
6435 pub info: ::core::option::Option<::prost::alloc::string::String>,
6436 #[prost(message, optional, tag = "3")]
6437 pub data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
6438}
6439#[allow(clippy::derive_partial_eq_without_eq)]
6440#[derive(Clone, PartialEq, ::prost::Message)]
6441pub struct ConfigEncryptAlgorithmResponse {
6442 #[prost(message, optional, tag = "1")]
6443 pub code: ::core::option::Option<u32>,
6444 #[prost(message, optional, tag = "2")]
6445 pub info: ::core::option::Option<::prost::alloc::string::String>,
6446 #[prost(message, repeated, tag = "3")]
6447 pub algorithms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6448}
6449#[allow(clippy::derive_partial_eq_without_eq)]
6450#[derive(Clone, PartialEq, ::prost::Message)]
6451pub struct ConfigClientListResponse {
6452 #[prost(message, optional, tag = "1")]
6453 pub code: ::core::option::Option<u32>,
6454 #[prost(message, optional, tag = "2")]
6455 pub info: ::core::option::Option<::prost::alloc::string::String>,
6456 #[prost(message, optional, tag = "3")]
6457 pub revision: ::core::option::Option<::prost::alloc::string::String>,
6458 #[prost(string, tag = "4")]
6459 pub namespace: ::prost::alloc::string::String,
6460 #[prost(string, tag = "5")]
6461 pub group: ::prost::alloc::string::String,
6462 #[prost(message, repeated, tag = "6")]
6463 pub config_file_infos: ::prost::alloc::vec::Vec<ClientConfigFileInfo>,
6464}
6465pub mod polaris_config_grpc_client {
6467 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
6468 use tonic::codegen::*;
6469 use tonic::codegen::http::Uri;
6470 #[derive(Debug, Clone)]
6471 pub struct PolarisConfigGrpcClient<T> {
6472 inner: tonic::client::Grpc<T>,
6473 }
6474 impl PolarisConfigGrpcClient<tonic::transport::Channel> {
6475 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6477 where
6478 D: TryInto<tonic::transport::Endpoint>,
6479 D::Error: Into<StdError>,
6480 {
6481 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6482 Ok(Self::new(conn))
6483 }
6484 }
6485 impl<T> PolarisConfigGrpcClient<T>
6486 where
6487 T: tonic::client::GrpcService<tonic::body::BoxBody>,
6488 T::Error: Into<StdError>,
6489 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
6490 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
6491 {
6492 pub fn new(inner: T) -> Self {
6493 let inner = tonic::client::Grpc::new(inner);
6494 Self { inner }
6495 }
6496 pub fn with_origin(inner: T, origin: Uri) -> Self {
6497 let inner = tonic::client::Grpc::with_origin(inner, origin);
6498 Self { inner }
6499 }
6500 pub fn with_interceptor<F>(
6501 inner: T,
6502 interceptor: F,
6503 ) -> PolarisConfigGrpcClient<InterceptedService<T, F>>
6504 where
6505 F: tonic::service::Interceptor,
6506 T::ResponseBody: Default,
6507 T: tonic::codegen::Service<
6508 http::Request<tonic::body::BoxBody>,
6509 Response = http::Response<
6510 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
6511 >,
6512 >,
6513 <T as tonic::codegen::Service<
6514 http::Request<tonic::body::BoxBody>,
6515 >>::Error: Into<StdError> + Send + Sync,
6516 {
6517 PolarisConfigGrpcClient::new(InterceptedService::new(inner, interceptor))
6518 }
6519 #[must_use]
6524 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6525 self.inner = self.inner.send_compressed(encoding);
6526 self
6527 }
6528 #[must_use]
6530 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6531 self.inner = self.inner.accept_compressed(encoding);
6532 self
6533 }
6534 #[must_use]
6538 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6539 self.inner = self.inner.max_decoding_message_size(limit);
6540 self
6541 }
6542 #[must_use]
6546 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6547 self.inner = self.inner.max_encoding_message_size(limit);
6548 self
6549 }
6550 pub async fn get_config_file(
6552 &mut self,
6553 request: impl tonic::IntoRequest<super::ClientConfigFileInfo>,
6554 ) -> std::result::Result<
6555 tonic::Response<super::ConfigClientResponse>,
6556 tonic::Status,
6557 > {
6558 self.inner
6559 .ready()
6560 .await
6561 .map_err(|e| {
6562 tonic::Status::new(
6563 tonic::Code::Unknown,
6564 format!("Service was not ready: {}", e.into()),
6565 )
6566 })?;
6567 let codec = tonic::codec::ProstCodec::default();
6568 let path = http::uri::PathAndQuery::from_static(
6569 "/v1.PolarisConfigGRPC/GetConfigFile",
6570 );
6571 let mut req = request.into_request();
6572 req.extensions_mut()
6573 .insert(GrpcMethod::new("v1.PolarisConfigGRPC", "GetConfigFile"));
6574 self.inner.unary(req, path, codec).await
6575 }
6576 pub async fn create_config_file(
6578 &mut self,
6579 request: impl tonic::IntoRequest<super::ConfigFile>,
6580 ) -> std::result::Result<
6581 tonic::Response<super::ConfigClientResponse>,
6582 tonic::Status,
6583 > {
6584 self.inner
6585 .ready()
6586 .await
6587 .map_err(|e| {
6588 tonic::Status::new(
6589 tonic::Code::Unknown,
6590 format!("Service was not ready: {}", e.into()),
6591 )
6592 })?;
6593 let codec = tonic::codec::ProstCodec::default();
6594 let path = http::uri::PathAndQuery::from_static(
6595 "/v1.PolarisConfigGRPC/CreateConfigFile",
6596 );
6597 let mut req = request.into_request();
6598 req.extensions_mut()
6599 .insert(GrpcMethod::new("v1.PolarisConfigGRPC", "CreateConfigFile"));
6600 self.inner.unary(req, path, codec).await
6601 }
6602 pub async fn update_config_file(
6604 &mut self,
6605 request: impl tonic::IntoRequest<super::ConfigFile>,
6606 ) -> std::result::Result<
6607 tonic::Response<super::ConfigClientResponse>,
6608 tonic::Status,
6609 > {
6610 self.inner
6611 .ready()
6612 .await
6613 .map_err(|e| {
6614 tonic::Status::new(
6615 tonic::Code::Unknown,
6616 format!("Service was not ready: {}", e.into()),
6617 )
6618 })?;
6619 let codec = tonic::codec::ProstCodec::default();
6620 let path = http::uri::PathAndQuery::from_static(
6621 "/v1.PolarisConfigGRPC/UpdateConfigFile",
6622 );
6623 let mut req = request.into_request();
6624 req.extensions_mut()
6625 .insert(GrpcMethod::new("v1.PolarisConfigGRPC", "UpdateConfigFile"));
6626 self.inner.unary(req, path, codec).await
6627 }
6628 pub async fn publish_config_file(
6630 &mut self,
6631 request: impl tonic::IntoRequest<super::ConfigFileRelease>,
6632 ) -> std::result::Result<
6633 tonic::Response<super::ConfigClientResponse>,
6634 tonic::Status,
6635 > {
6636 self.inner
6637 .ready()
6638 .await
6639 .map_err(|e| {
6640 tonic::Status::new(
6641 tonic::Code::Unknown,
6642 format!("Service was not ready: {}", e.into()),
6643 )
6644 })?;
6645 let codec = tonic::codec::ProstCodec::default();
6646 let path = http::uri::PathAndQuery::from_static(
6647 "/v1.PolarisConfigGRPC/PublishConfigFile",
6648 );
6649 let mut req = request.into_request();
6650 req.extensions_mut()
6651 .insert(GrpcMethod::new("v1.PolarisConfigGRPC", "PublishConfigFile"));
6652 self.inner.unary(req, path, codec).await
6653 }
6654 pub async fn upsert_and_publish_config_file(
6656 &mut self,
6657 request: impl tonic::IntoRequest<super::ConfigFilePublishInfo>,
6658 ) -> std::result::Result<
6659 tonic::Response<super::ConfigClientResponse>,
6660 tonic::Status,
6661 > {
6662 self.inner
6663 .ready()
6664 .await
6665 .map_err(|e| {
6666 tonic::Status::new(
6667 tonic::Code::Unknown,
6668 format!("Service was not ready: {}", e.into()),
6669 )
6670 })?;
6671 let codec = tonic::codec::ProstCodec::default();
6672 let path = http::uri::PathAndQuery::from_static(
6673 "/v1.PolarisConfigGRPC/UpsertAndPublishConfigFile",
6674 );
6675 let mut req = request.into_request();
6676 req.extensions_mut()
6677 .insert(
6678 GrpcMethod::new("v1.PolarisConfigGRPC", "UpsertAndPublishConfigFile"),
6679 );
6680 self.inner.unary(req, path, codec).await
6681 }
6682 pub async fn watch_config_files(
6684 &mut self,
6685 request: impl tonic::IntoRequest<super::ClientWatchConfigFileRequest>,
6686 ) -> std::result::Result<
6687 tonic::Response<super::ConfigClientResponse>,
6688 tonic::Status,
6689 > {
6690 self.inner
6691 .ready()
6692 .await
6693 .map_err(|e| {
6694 tonic::Status::new(
6695 tonic::Code::Unknown,
6696 format!("Service was not ready: {}", e.into()),
6697 )
6698 })?;
6699 let codec = tonic::codec::ProstCodec::default();
6700 let path = http::uri::PathAndQuery::from_static(
6701 "/v1.PolarisConfigGRPC/WatchConfigFiles",
6702 );
6703 let mut req = request.into_request();
6704 req.extensions_mut()
6705 .insert(GrpcMethod::new("v1.PolarisConfigGRPC", "WatchConfigFiles"));
6706 self.inner.unary(req, path, codec).await
6707 }
6708 pub async fn get_config_file_metadata_list(
6710 &mut self,
6711 request: impl tonic::IntoRequest<super::ConfigFileGroupRequest>,
6712 ) -> std::result::Result<
6713 tonic::Response<super::ConfigClientListResponse>,
6714 tonic::Status,
6715 > {
6716 self.inner
6717 .ready()
6718 .await
6719 .map_err(|e| {
6720 tonic::Status::new(
6721 tonic::Code::Unknown,
6722 format!("Service was not ready: {}", e.into()),
6723 )
6724 })?;
6725 let codec = tonic::codec::ProstCodec::default();
6726 let path = http::uri::PathAndQuery::from_static(
6727 "/v1.PolarisConfigGRPC/GetConfigFileMetadataList",
6728 );
6729 let mut req = request.into_request();
6730 req.extensions_mut()
6731 .insert(
6732 GrpcMethod::new("v1.PolarisConfigGRPC", "GetConfigFileMetadataList"),
6733 );
6734 self.inner.unary(req, path, codec).await
6735 }
6736 pub async fn discover(
6738 &mut self,
6739 request: impl tonic::IntoStreamingRequest<
6740 Message = super::ConfigDiscoverRequest,
6741 >,
6742 ) -> std::result::Result<
6743 tonic::Response<tonic::codec::Streaming<super::ConfigDiscoverResponse>>,
6744 tonic::Status,
6745 > {
6746 self.inner
6747 .ready()
6748 .await
6749 .map_err(|e| {
6750 tonic::Status::new(
6751 tonic::Code::Unknown,
6752 format!("Service was not ready: {}", e.into()),
6753 )
6754 })?;
6755 let codec = tonic::codec::ProstCodec::default();
6756 let path = http::uri::PathAndQuery::from_static(
6757 "/v1.PolarisConfigGRPC/Discover",
6758 );
6759 let mut req = request.into_streaming_request();
6760 req.extensions_mut()
6761 .insert(GrpcMethod::new("v1.PolarisConfigGRPC", "Discover"));
6762 self.inner.streaming(req, path, codec).await
6763 }
6764 }
6765}
6766pub mod polaris_config_grpc_server {
6768 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
6769 use tonic::codegen::*;
6770 #[async_trait]
6772 pub trait PolarisConfigGrpc: Send + Sync + 'static {
6773 async fn get_config_file(
6775 &self,
6776 request: tonic::Request<super::ClientConfigFileInfo>,
6777 ) -> std::result::Result<
6778 tonic::Response<super::ConfigClientResponse>,
6779 tonic::Status,
6780 >;
6781 async fn create_config_file(
6783 &self,
6784 request: tonic::Request<super::ConfigFile>,
6785 ) -> std::result::Result<
6786 tonic::Response<super::ConfigClientResponse>,
6787 tonic::Status,
6788 >;
6789 async fn update_config_file(
6791 &self,
6792 request: tonic::Request<super::ConfigFile>,
6793 ) -> std::result::Result<
6794 tonic::Response<super::ConfigClientResponse>,
6795 tonic::Status,
6796 >;
6797 async fn publish_config_file(
6799 &self,
6800 request: tonic::Request<super::ConfigFileRelease>,
6801 ) -> std::result::Result<
6802 tonic::Response<super::ConfigClientResponse>,
6803 tonic::Status,
6804 >;
6805 async fn upsert_and_publish_config_file(
6807 &self,
6808 request: tonic::Request<super::ConfigFilePublishInfo>,
6809 ) -> std::result::Result<
6810 tonic::Response<super::ConfigClientResponse>,
6811 tonic::Status,
6812 >;
6813 async fn watch_config_files(
6815 &self,
6816 request: tonic::Request<super::ClientWatchConfigFileRequest>,
6817 ) -> std::result::Result<
6818 tonic::Response<super::ConfigClientResponse>,
6819 tonic::Status,
6820 >;
6821 async fn get_config_file_metadata_list(
6823 &self,
6824 request: tonic::Request<super::ConfigFileGroupRequest>,
6825 ) -> std::result::Result<
6826 tonic::Response<super::ConfigClientListResponse>,
6827 tonic::Status,
6828 >;
6829 type DiscoverStream: tonic::codegen::tokio_stream::Stream<
6831 Item = std::result::Result<super::ConfigDiscoverResponse, tonic::Status>,
6832 >
6833 + Send
6834 + 'static;
6835 async fn discover(
6837 &self,
6838 request: tonic::Request<tonic::Streaming<super::ConfigDiscoverRequest>>,
6839 ) -> std::result::Result<tonic::Response<Self::DiscoverStream>, tonic::Status>;
6840 }
6841 #[derive(Debug)]
6842 pub struct PolarisConfigGrpcServer<T: PolarisConfigGrpc> {
6843 inner: _Inner<T>,
6844 accept_compression_encodings: EnabledCompressionEncodings,
6845 send_compression_encodings: EnabledCompressionEncodings,
6846 max_decoding_message_size: Option<usize>,
6847 max_encoding_message_size: Option<usize>,
6848 }
6849 struct _Inner<T>(Arc<T>);
6850 impl<T: PolarisConfigGrpc> PolarisConfigGrpcServer<T> {
6851 pub fn new(inner: T) -> Self {
6852 Self::from_arc(Arc::new(inner))
6853 }
6854 pub fn from_arc(inner: Arc<T>) -> Self {
6855 let inner = _Inner(inner);
6856 Self {
6857 inner,
6858 accept_compression_encodings: Default::default(),
6859 send_compression_encodings: Default::default(),
6860 max_decoding_message_size: None,
6861 max_encoding_message_size: None,
6862 }
6863 }
6864 pub fn with_interceptor<F>(
6865 inner: T,
6866 interceptor: F,
6867 ) -> InterceptedService<Self, F>
6868 where
6869 F: tonic::service::Interceptor,
6870 {
6871 InterceptedService::new(Self::new(inner), interceptor)
6872 }
6873 #[must_use]
6875 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6876 self.accept_compression_encodings.enable(encoding);
6877 self
6878 }
6879 #[must_use]
6881 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6882 self.send_compression_encodings.enable(encoding);
6883 self
6884 }
6885 #[must_use]
6889 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6890 self.max_decoding_message_size = Some(limit);
6891 self
6892 }
6893 #[must_use]
6897 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6898 self.max_encoding_message_size = Some(limit);
6899 self
6900 }
6901 }
6902 impl<T, B> tonic::codegen::Service<http::Request<B>> for PolarisConfigGrpcServer<T>
6903 where
6904 T: PolarisConfigGrpc,
6905 B: Body + Send + 'static,
6906 B::Error: Into<StdError> + Send + 'static,
6907 {
6908 type Response = http::Response<tonic::body::BoxBody>;
6909 type Error = std::convert::Infallible;
6910 type Future = BoxFuture<Self::Response, Self::Error>;
6911 fn poll_ready(
6912 &mut self,
6913 _cx: &mut Context<'_>,
6914 ) -> Poll<std::result::Result<(), Self::Error>> {
6915 Poll::Ready(Ok(()))
6916 }
6917 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6918 let inner = self.inner.clone();
6919 match req.uri().path() {
6920 "/v1.PolarisConfigGRPC/GetConfigFile" => {
6921 #[allow(non_camel_case_types)]
6922 struct GetConfigFileSvc<T: PolarisConfigGrpc>(pub Arc<T>);
6923 impl<
6924 T: PolarisConfigGrpc,
6925 > tonic::server::UnaryService<super::ClientConfigFileInfo>
6926 for GetConfigFileSvc<T> {
6927 type Response = super::ConfigClientResponse;
6928 type Future = BoxFuture<
6929 tonic::Response<Self::Response>,
6930 tonic::Status,
6931 >;
6932 fn call(
6933 &mut self,
6934 request: tonic::Request<super::ClientConfigFileInfo>,
6935 ) -> Self::Future {
6936 let inner = Arc::clone(&self.0);
6937 let fut = async move {
6938 <T as PolarisConfigGrpc>::get_config_file(&inner, request)
6939 .await
6940 };
6941 Box::pin(fut)
6942 }
6943 }
6944 let accept_compression_encodings = self.accept_compression_encodings;
6945 let send_compression_encodings = self.send_compression_encodings;
6946 let max_decoding_message_size = self.max_decoding_message_size;
6947 let max_encoding_message_size = self.max_encoding_message_size;
6948 let inner = self.inner.clone();
6949 let fut = async move {
6950 let inner = inner.0;
6951 let method = GetConfigFileSvc(inner);
6952 let codec = tonic::codec::ProstCodec::default();
6953 let mut grpc = tonic::server::Grpc::new(codec)
6954 .apply_compression_config(
6955 accept_compression_encodings,
6956 send_compression_encodings,
6957 )
6958 .apply_max_message_size_config(
6959 max_decoding_message_size,
6960 max_encoding_message_size,
6961 );
6962 let res = grpc.unary(method, req).await;
6963 Ok(res)
6964 };
6965 Box::pin(fut)
6966 }
6967 "/v1.PolarisConfigGRPC/CreateConfigFile" => {
6968 #[allow(non_camel_case_types)]
6969 struct CreateConfigFileSvc<T: PolarisConfigGrpc>(pub Arc<T>);
6970 impl<
6971 T: PolarisConfigGrpc,
6972 > tonic::server::UnaryService<super::ConfigFile>
6973 for CreateConfigFileSvc<T> {
6974 type Response = super::ConfigClientResponse;
6975 type Future = BoxFuture<
6976 tonic::Response<Self::Response>,
6977 tonic::Status,
6978 >;
6979 fn call(
6980 &mut self,
6981 request: tonic::Request<super::ConfigFile>,
6982 ) -> Self::Future {
6983 let inner = Arc::clone(&self.0);
6984 let fut = async move {
6985 <T as PolarisConfigGrpc>::create_config_file(
6986 &inner,
6987 request,
6988 )
6989 .await
6990 };
6991 Box::pin(fut)
6992 }
6993 }
6994 let accept_compression_encodings = self.accept_compression_encodings;
6995 let send_compression_encodings = self.send_compression_encodings;
6996 let max_decoding_message_size = self.max_decoding_message_size;
6997 let max_encoding_message_size = self.max_encoding_message_size;
6998 let inner = self.inner.clone();
6999 let fut = async move {
7000 let inner = inner.0;
7001 let method = CreateConfigFileSvc(inner);
7002 let codec = tonic::codec::ProstCodec::default();
7003 let mut grpc = tonic::server::Grpc::new(codec)
7004 .apply_compression_config(
7005 accept_compression_encodings,
7006 send_compression_encodings,
7007 )
7008 .apply_max_message_size_config(
7009 max_decoding_message_size,
7010 max_encoding_message_size,
7011 );
7012 let res = grpc.unary(method, req).await;
7013 Ok(res)
7014 };
7015 Box::pin(fut)
7016 }
7017 "/v1.PolarisConfigGRPC/UpdateConfigFile" => {
7018 #[allow(non_camel_case_types)]
7019 struct UpdateConfigFileSvc<T: PolarisConfigGrpc>(pub Arc<T>);
7020 impl<
7021 T: PolarisConfigGrpc,
7022 > tonic::server::UnaryService<super::ConfigFile>
7023 for UpdateConfigFileSvc<T> {
7024 type Response = super::ConfigClientResponse;
7025 type Future = BoxFuture<
7026 tonic::Response<Self::Response>,
7027 tonic::Status,
7028 >;
7029 fn call(
7030 &mut self,
7031 request: tonic::Request<super::ConfigFile>,
7032 ) -> Self::Future {
7033 let inner = Arc::clone(&self.0);
7034 let fut = async move {
7035 <T as PolarisConfigGrpc>::update_config_file(
7036 &inner,
7037 request,
7038 )
7039 .await
7040 };
7041 Box::pin(fut)
7042 }
7043 }
7044 let accept_compression_encodings = self.accept_compression_encodings;
7045 let send_compression_encodings = self.send_compression_encodings;
7046 let max_decoding_message_size = self.max_decoding_message_size;
7047 let max_encoding_message_size = self.max_encoding_message_size;
7048 let inner = self.inner.clone();
7049 let fut = async move {
7050 let inner = inner.0;
7051 let method = UpdateConfigFileSvc(inner);
7052 let codec = tonic::codec::ProstCodec::default();
7053 let mut grpc = tonic::server::Grpc::new(codec)
7054 .apply_compression_config(
7055 accept_compression_encodings,
7056 send_compression_encodings,
7057 )
7058 .apply_max_message_size_config(
7059 max_decoding_message_size,
7060 max_encoding_message_size,
7061 );
7062 let res = grpc.unary(method, req).await;
7063 Ok(res)
7064 };
7065 Box::pin(fut)
7066 }
7067 "/v1.PolarisConfigGRPC/PublishConfigFile" => {
7068 #[allow(non_camel_case_types)]
7069 struct PublishConfigFileSvc<T: PolarisConfigGrpc>(pub Arc<T>);
7070 impl<
7071 T: PolarisConfigGrpc,
7072 > tonic::server::UnaryService<super::ConfigFileRelease>
7073 for PublishConfigFileSvc<T> {
7074 type Response = super::ConfigClientResponse;
7075 type Future = BoxFuture<
7076 tonic::Response<Self::Response>,
7077 tonic::Status,
7078 >;
7079 fn call(
7080 &mut self,
7081 request: tonic::Request<super::ConfigFileRelease>,
7082 ) -> Self::Future {
7083 let inner = Arc::clone(&self.0);
7084 let fut = async move {
7085 <T as PolarisConfigGrpc>::publish_config_file(
7086 &inner,
7087 request,
7088 )
7089 .await
7090 };
7091 Box::pin(fut)
7092 }
7093 }
7094 let accept_compression_encodings = self.accept_compression_encodings;
7095 let send_compression_encodings = self.send_compression_encodings;
7096 let max_decoding_message_size = self.max_decoding_message_size;
7097 let max_encoding_message_size = self.max_encoding_message_size;
7098 let inner = self.inner.clone();
7099 let fut = async move {
7100 let inner = inner.0;
7101 let method = PublishConfigFileSvc(inner);
7102 let codec = tonic::codec::ProstCodec::default();
7103 let mut grpc = tonic::server::Grpc::new(codec)
7104 .apply_compression_config(
7105 accept_compression_encodings,
7106 send_compression_encodings,
7107 )
7108 .apply_max_message_size_config(
7109 max_decoding_message_size,
7110 max_encoding_message_size,
7111 );
7112 let res = grpc.unary(method, req).await;
7113 Ok(res)
7114 };
7115 Box::pin(fut)
7116 }
7117 "/v1.PolarisConfigGRPC/UpsertAndPublishConfigFile" => {
7118 #[allow(non_camel_case_types)]
7119 struct UpsertAndPublishConfigFileSvc<T: PolarisConfigGrpc>(
7120 pub Arc<T>,
7121 );
7122 impl<
7123 T: PolarisConfigGrpc,
7124 > tonic::server::UnaryService<super::ConfigFilePublishInfo>
7125 for UpsertAndPublishConfigFileSvc<T> {
7126 type Response = super::ConfigClientResponse;
7127 type Future = BoxFuture<
7128 tonic::Response<Self::Response>,
7129 tonic::Status,
7130 >;
7131 fn call(
7132 &mut self,
7133 request: tonic::Request<super::ConfigFilePublishInfo>,
7134 ) -> Self::Future {
7135 let inner = Arc::clone(&self.0);
7136 let fut = async move {
7137 <T as PolarisConfigGrpc>::upsert_and_publish_config_file(
7138 &inner,
7139 request,
7140 )
7141 .await
7142 };
7143 Box::pin(fut)
7144 }
7145 }
7146 let accept_compression_encodings = self.accept_compression_encodings;
7147 let send_compression_encodings = self.send_compression_encodings;
7148 let max_decoding_message_size = self.max_decoding_message_size;
7149 let max_encoding_message_size = self.max_encoding_message_size;
7150 let inner = self.inner.clone();
7151 let fut = async move {
7152 let inner = inner.0;
7153 let method = UpsertAndPublishConfigFileSvc(inner);
7154 let codec = tonic::codec::ProstCodec::default();
7155 let mut grpc = tonic::server::Grpc::new(codec)
7156 .apply_compression_config(
7157 accept_compression_encodings,
7158 send_compression_encodings,
7159 )
7160 .apply_max_message_size_config(
7161 max_decoding_message_size,
7162 max_encoding_message_size,
7163 );
7164 let res = grpc.unary(method, req).await;
7165 Ok(res)
7166 };
7167 Box::pin(fut)
7168 }
7169 "/v1.PolarisConfigGRPC/WatchConfigFiles" => {
7170 #[allow(non_camel_case_types)]
7171 struct WatchConfigFilesSvc<T: PolarisConfigGrpc>(pub Arc<T>);
7172 impl<
7173 T: PolarisConfigGrpc,
7174 > tonic::server::UnaryService<super::ClientWatchConfigFileRequest>
7175 for WatchConfigFilesSvc<T> {
7176 type Response = super::ConfigClientResponse;
7177 type Future = BoxFuture<
7178 tonic::Response<Self::Response>,
7179 tonic::Status,
7180 >;
7181 fn call(
7182 &mut self,
7183 request: tonic::Request<super::ClientWatchConfigFileRequest>,
7184 ) -> Self::Future {
7185 let inner = Arc::clone(&self.0);
7186 let fut = async move {
7187 <T as PolarisConfigGrpc>::watch_config_files(
7188 &inner,
7189 request,
7190 )
7191 .await
7192 };
7193 Box::pin(fut)
7194 }
7195 }
7196 let accept_compression_encodings = self.accept_compression_encodings;
7197 let send_compression_encodings = self.send_compression_encodings;
7198 let max_decoding_message_size = self.max_decoding_message_size;
7199 let max_encoding_message_size = self.max_encoding_message_size;
7200 let inner = self.inner.clone();
7201 let fut = async move {
7202 let inner = inner.0;
7203 let method = WatchConfigFilesSvc(inner);
7204 let codec = tonic::codec::ProstCodec::default();
7205 let mut grpc = tonic::server::Grpc::new(codec)
7206 .apply_compression_config(
7207 accept_compression_encodings,
7208 send_compression_encodings,
7209 )
7210 .apply_max_message_size_config(
7211 max_decoding_message_size,
7212 max_encoding_message_size,
7213 );
7214 let res = grpc.unary(method, req).await;
7215 Ok(res)
7216 };
7217 Box::pin(fut)
7218 }
7219 "/v1.PolarisConfigGRPC/GetConfigFileMetadataList" => {
7220 #[allow(non_camel_case_types)]
7221 struct GetConfigFileMetadataListSvc<T: PolarisConfigGrpc>(
7222 pub Arc<T>,
7223 );
7224 impl<
7225 T: PolarisConfigGrpc,
7226 > tonic::server::UnaryService<super::ConfigFileGroupRequest>
7227 for GetConfigFileMetadataListSvc<T> {
7228 type Response = super::ConfigClientListResponse;
7229 type Future = BoxFuture<
7230 tonic::Response<Self::Response>,
7231 tonic::Status,
7232 >;
7233 fn call(
7234 &mut self,
7235 request: tonic::Request<super::ConfigFileGroupRequest>,
7236 ) -> Self::Future {
7237 let inner = Arc::clone(&self.0);
7238 let fut = async move {
7239 <T as PolarisConfigGrpc>::get_config_file_metadata_list(
7240 &inner,
7241 request,
7242 )
7243 .await
7244 };
7245 Box::pin(fut)
7246 }
7247 }
7248 let accept_compression_encodings = self.accept_compression_encodings;
7249 let send_compression_encodings = self.send_compression_encodings;
7250 let max_decoding_message_size = self.max_decoding_message_size;
7251 let max_encoding_message_size = self.max_encoding_message_size;
7252 let inner = self.inner.clone();
7253 let fut = async move {
7254 let inner = inner.0;
7255 let method = GetConfigFileMetadataListSvc(inner);
7256 let codec = tonic::codec::ProstCodec::default();
7257 let mut grpc = tonic::server::Grpc::new(codec)
7258 .apply_compression_config(
7259 accept_compression_encodings,
7260 send_compression_encodings,
7261 )
7262 .apply_max_message_size_config(
7263 max_decoding_message_size,
7264 max_encoding_message_size,
7265 );
7266 let res = grpc.unary(method, req).await;
7267 Ok(res)
7268 };
7269 Box::pin(fut)
7270 }
7271 "/v1.PolarisConfigGRPC/Discover" => {
7272 #[allow(non_camel_case_types)]
7273 struct DiscoverSvc<T: PolarisConfigGrpc>(pub Arc<T>);
7274 impl<
7275 T: PolarisConfigGrpc,
7276 > tonic::server::StreamingService<super::ConfigDiscoverRequest>
7277 for DiscoverSvc<T> {
7278 type Response = super::ConfigDiscoverResponse;
7279 type ResponseStream = T::DiscoverStream;
7280 type Future = BoxFuture<
7281 tonic::Response<Self::ResponseStream>,
7282 tonic::Status,
7283 >;
7284 fn call(
7285 &mut self,
7286 request: tonic::Request<
7287 tonic::Streaming<super::ConfigDiscoverRequest>,
7288 >,
7289 ) -> Self::Future {
7290 let inner = Arc::clone(&self.0);
7291 let fut = async move {
7292 <T as PolarisConfigGrpc>::discover(&inner, request).await
7293 };
7294 Box::pin(fut)
7295 }
7296 }
7297 let accept_compression_encodings = self.accept_compression_encodings;
7298 let send_compression_encodings = self.send_compression_encodings;
7299 let max_decoding_message_size = self.max_decoding_message_size;
7300 let max_encoding_message_size = self.max_encoding_message_size;
7301 let inner = self.inner.clone();
7302 let fut = async move {
7303 let inner = inner.0;
7304 let method = DiscoverSvc(inner);
7305 let codec = tonic::codec::ProstCodec::default();
7306 let mut grpc = tonic::server::Grpc::new(codec)
7307 .apply_compression_config(
7308 accept_compression_encodings,
7309 send_compression_encodings,
7310 )
7311 .apply_max_message_size_config(
7312 max_decoding_message_size,
7313 max_encoding_message_size,
7314 );
7315 let res = grpc.streaming(method, req).await;
7316 Ok(res)
7317 };
7318 Box::pin(fut)
7319 }
7320 _ => {
7321 Box::pin(async move {
7322 Ok(
7323 http::Response::builder()
7324 .status(200)
7325 .header("grpc-status", "12")
7326 .header("content-type", "application/grpc")
7327 .body(empty_body())
7328 .unwrap(),
7329 )
7330 })
7331 }
7332 }
7333 }
7334 }
7335 impl<T: PolarisConfigGrpc> Clone for PolarisConfigGrpcServer<T> {
7336 fn clone(&self) -> Self {
7337 let inner = self.inner.clone();
7338 Self {
7339 inner,
7340 accept_compression_encodings: self.accept_compression_encodings,
7341 send_compression_encodings: self.send_compression_encodings,
7342 max_decoding_message_size: self.max_decoding_message_size,
7343 max_encoding_message_size: self.max_encoding_message_size,
7344 }
7345 }
7346 }
7347 impl<T: PolarisConfigGrpc> Clone for _Inner<T> {
7348 fn clone(&self) -> Self {
7349 Self(Arc::clone(&self.0))
7350 }
7351 }
7352 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
7353 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7354 write!(f, "{:?}", self.0)
7355 }
7356 }
7357 impl<T: PolarisConfigGrpc> tonic::server::NamedService
7358 for PolarisConfigGrpcServer<T> {
7359 const NAME: &'static str = "v1.PolarisConfigGRPC";
7360 }
7361}