xds_api/generated/
envoy.config.overload.v3.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct ResourceMonitor {
4    /// The name of the resource monitor to instantiate. Must match a registered
5    /// resource monitor type.
6    /// See the :ref:`extensions listed in typed_config below <extension_category_envoy.resource_monitors>` for the default list of available resource monitor.
7    #[prost(string, tag = "1")]
8    pub name: ::prost::alloc::string::String,
9    /// Configuration for the resource monitor being instantiated.
10    /// \[#extension-category: envoy.resource_monitors\]
11    #[prost(oneof = "resource_monitor::ConfigType", tags = "3")]
12    pub config_type: ::core::option::Option<resource_monitor::ConfigType>,
13}
14/// Nested message and enum types in `ResourceMonitor`.
15pub mod resource_monitor {
16    /// Configuration for the resource monitor being instantiated.
17    /// \[#extension-category: envoy.resource_monitors\]
18    #[derive(Clone, PartialEq, ::prost::Oneof)]
19    pub enum ConfigType {
20        #[prost(message, tag = "3")]
21        TypedConfig(super::super::super::super::super::google::protobuf::Any),
22    }
23}
24impl ::prost::Name for ResourceMonitor {
25    const NAME: &'static str = "ResourceMonitor";
26    const PACKAGE: &'static str = "envoy.config.overload.v3";
27    fn full_name() -> ::prost::alloc::string::String {
28        "envoy.config.overload.v3.ResourceMonitor".into()
29    }
30    fn type_url() -> ::prost::alloc::string::String {
31        "type.googleapis.com/envoy.config.overload.v3.ResourceMonitor".into()
32    }
33}
34#[derive(Clone, Copy, PartialEq, ::prost::Message)]
35pub struct ThresholdTrigger {
36    /// If the resource pressure is greater than or equal to this value, the trigger
37    /// will enter saturation.
38    #[prost(double, tag = "1")]
39    pub value: f64,
40}
41impl ::prost::Name for ThresholdTrigger {
42    const NAME: &'static str = "ThresholdTrigger";
43    const PACKAGE: &'static str = "envoy.config.overload.v3";
44    fn full_name() -> ::prost::alloc::string::String {
45        "envoy.config.overload.v3.ThresholdTrigger".into()
46    }
47    fn type_url() -> ::prost::alloc::string::String {
48        "type.googleapis.com/envoy.config.overload.v3.ThresholdTrigger".into()
49    }
50}
51#[derive(Clone, Copy, PartialEq, ::prost::Message)]
52pub struct ScaledTrigger {
53    /// If the resource pressure is greater than this value, the trigger will be in the
54    /// :ref:`scaling <arch_overview_overload_manager-triggers-state>` state with value
55    /// ``(pressure - scaling_threshold) / (saturation_threshold - scaling_threshold)``.
56    #[prost(double, tag = "1")]
57    pub scaling_threshold: f64,
58    /// If the resource pressure is greater than this value, the trigger will enter saturation.
59    #[prost(double, tag = "2")]
60    pub saturation_threshold: f64,
61}
62impl ::prost::Name for ScaledTrigger {
63    const NAME: &'static str = "ScaledTrigger";
64    const PACKAGE: &'static str = "envoy.config.overload.v3";
65    fn full_name() -> ::prost::alloc::string::String {
66        "envoy.config.overload.v3.ScaledTrigger".into()
67    }
68    fn type_url() -> ::prost::alloc::string::String {
69        "type.googleapis.com/envoy.config.overload.v3.ScaledTrigger".into()
70    }
71}
72#[derive(Clone, PartialEq, ::prost::Message)]
73pub struct Trigger {
74    /// The name of the resource this is a trigger for.
75    #[prost(string, tag = "1")]
76    pub name: ::prost::alloc::string::String,
77    #[prost(oneof = "trigger::TriggerOneof", tags = "2, 3")]
78    pub trigger_oneof: ::core::option::Option<trigger::TriggerOneof>,
79}
80/// Nested message and enum types in `Trigger`.
81pub mod trigger {
82    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
83    pub enum TriggerOneof {
84        #[prost(message, tag = "2")]
85        Threshold(super::ThresholdTrigger),
86        #[prost(message, tag = "3")]
87        Scaled(super::ScaledTrigger),
88    }
89}
90impl ::prost::Name for Trigger {
91    const NAME: &'static str = "Trigger";
92    const PACKAGE: &'static str = "envoy.config.overload.v3";
93    fn full_name() -> ::prost::alloc::string::String {
94        "envoy.config.overload.v3.Trigger".into()
95    }
96    fn type_url() -> ::prost::alloc::string::String {
97        "type.googleapis.com/envoy.config.overload.v3.Trigger".into()
98    }
99}
100/// Typed configuration for the "envoy.overload_actions.reduce_timeouts" action. See
101/// :ref:`the docs <config_overload_manager_reducing_timeouts>` for an example of how to configure
102/// the action with different timeouts and minimum values.
103#[derive(Clone, PartialEq, ::prost::Message)]
104pub struct ScaleTimersOverloadActionConfig {
105    /// A set of timer scaling rules to be applied.
106    #[prost(message, repeated, tag = "1")]
107    pub timer_scale_factors: ::prost::alloc::vec::Vec<
108        scale_timers_overload_action_config::ScaleTimer,
109    >,
110}
111/// Nested message and enum types in `ScaleTimersOverloadActionConfig`.
112pub mod scale_timers_overload_action_config {
113    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
114    pub struct ScaleTimer {
115        /// The type of timer this minimum applies to.
116        #[prost(enumeration = "TimerType", tag = "1")]
117        pub timer: i32,
118        #[prost(oneof = "scale_timer::OverloadAdjust", tags = "2, 3")]
119        pub overload_adjust: ::core::option::Option<scale_timer::OverloadAdjust>,
120    }
121    /// Nested message and enum types in `ScaleTimer`.
122    pub mod scale_timer {
123        #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
124        pub enum OverloadAdjust {
125            /// Sets the minimum duration as an absolute value.
126            #[prost(message, tag = "2")]
127            MinTimeout(
128                super::super::super::super::super::super::google::protobuf::Duration,
129            ),
130            /// Sets the minimum duration as a percentage of the maximum value.
131            #[prost(message, tag = "3")]
132            MinScale(super::super::super::super::super::r#type::v3::Percent),
133        }
134    }
135    impl ::prost::Name for ScaleTimer {
136        const NAME: &'static str = "ScaleTimer";
137        const PACKAGE: &'static str = "envoy.config.overload.v3";
138        fn full_name() -> ::prost::alloc::string::String {
139            "envoy.config.overload.v3.ScaleTimersOverloadActionConfig.ScaleTimer".into()
140        }
141        fn type_url() -> ::prost::alloc::string::String {
142            "type.googleapis.com/envoy.config.overload.v3.ScaleTimersOverloadActionConfig.ScaleTimer"
143                .into()
144        }
145    }
146    #[derive(
147        Clone,
148        Copy,
149        Debug,
150        PartialEq,
151        Eq,
152        Hash,
153        PartialOrd,
154        Ord,
155        ::prost::Enumeration
156    )]
157    #[repr(i32)]
158    pub enum TimerType {
159        /// Unsupported value; users must explicitly specify the timer they want scaled.
160        Unspecified = 0,
161        /// Adjusts the idle timer for downstream HTTP connections that takes effect when there are no active streams.
162        /// This affects the value of :ref:`HttpConnectionManager.common_http_protocol_options.idle_timeout
163        /// <envoy_v3_api_field_config.core.v3.HttpProtocolOptions.idle_timeout>`
164        HttpDownstreamConnectionIdle = 1,
165        /// Adjusts the idle timer for HTTP streams initiated by downstream clients.
166        /// This affects the value of :ref:`RouteAction.idle_timeout <envoy_v3_api_field_config.route.v3.RouteAction.idle_timeout>` and
167        /// :ref:`HttpConnectionManager.stream_idle_timeout
168        /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_idle_timeout>`
169        HttpDownstreamStreamIdle = 2,
170        /// Adjusts the timer for how long downstream clients have to finish transport-level negotiations
171        /// before the connection is closed.
172        /// This affects the value of
173        /// :ref:`FilterChain.transport_socket_connect_timeout <envoy_v3_api_field_config.listener.v3.FilterChain.transport_socket_connect_timeout>`.
174        TransportSocketConnect = 3,
175    }
176    impl TimerType {
177        /// String value of the enum field names used in the ProtoBuf definition.
178        ///
179        /// The values are not transformed in any way and thus are considered stable
180        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
181        pub fn as_str_name(&self) -> &'static str {
182            match self {
183                Self::Unspecified => "UNSPECIFIED",
184                Self::HttpDownstreamConnectionIdle => "HTTP_DOWNSTREAM_CONNECTION_IDLE",
185                Self::HttpDownstreamStreamIdle => "HTTP_DOWNSTREAM_STREAM_IDLE",
186                Self::TransportSocketConnect => "TRANSPORT_SOCKET_CONNECT",
187            }
188        }
189        /// Creates an enum from field names used in the ProtoBuf definition.
190        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
191            match value {
192                "UNSPECIFIED" => Some(Self::Unspecified),
193                "HTTP_DOWNSTREAM_CONNECTION_IDLE" => {
194                    Some(Self::HttpDownstreamConnectionIdle)
195                }
196                "HTTP_DOWNSTREAM_STREAM_IDLE" => Some(Self::HttpDownstreamStreamIdle),
197                "TRANSPORT_SOCKET_CONNECT" => Some(Self::TransportSocketConnect),
198                _ => None,
199            }
200        }
201    }
202}
203impl ::prost::Name for ScaleTimersOverloadActionConfig {
204    const NAME: &'static str = "ScaleTimersOverloadActionConfig";
205    const PACKAGE: &'static str = "envoy.config.overload.v3";
206    fn full_name() -> ::prost::alloc::string::String {
207        "envoy.config.overload.v3.ScaleTimersOverloadActionConfig".into()
208    }
209    fn type_url() -> ::prost::alloc::string::String {
210        "type.googleapis.com/envoy.config.overload.v3.ScaleTimersOverloadActionConfig"
211            .into()
212    }
213}
214#[derive(Clone, PartialEq, ::prost::Message)]
215pub struct OverloadAction {
216    /// The name of the overload action. This is just a well-known string that listeners can
217    /// use for registering callbacks. Custom overload actions should be named using reverse
218    /// DNS to ensure uniqueness.
219    #[prost(string, tag = "1")]
220    pub name: ::prost::alloc::string::String,
221    /// A set of triggers for this action. The state of the action is the maximum
222    /// state of all triggers, which can be scalar values between 0 and 1 or
223    /// saturated. Listeners are notified when the overload action changes state.
224    /// An overload manager action can only have one trigger for a given resource
225    /// e.g. :ref:`Trigger.name
226    /// <envoy_v3_api_field_config.overload.v3.Trigger.name>` must be unique
227    /// in this list.
228    #[prost(message, repeated, tag = "2")]
229    pub triggers: ::prost::alloc::vec::Vec<Trigger>,
230    /// Configuration for the action being instantiated.
231    #[prost(message, optional, tag = "3")]
232    pub typed_config: ::core::option::Option<
233        super::super::super::super::google::protobuf::Any,
234    >,
235}
236impl ::prost::Name for OverloadAction {
237    const NAME: &'static str = "OverloadAction";
238    const PACKAGE: &'static str = "envoy.config.overload.v3";
239    fn full_name() -> ::prost::alloc::string::String {
240        "envoy.config.overload.v3.OverloadAction".into()
241    }
242    fn type_url() -> ::prost::alloc::string::String {
243        "type.googleapis.com/envoy.config.overload.v3.OverloadAction".into()
244    }
245}
246/// A point within the connection or request lifecycle that provides context on
247/// whether to shed load at that given stage for the current entity at the
248/// point.
249#[derive(Clone, PartialEq, ::prost::Message)]
250pub struct LoadShedPoint {
251    /// This is just a well-known string for the LoadShedPoint.
252    /// Deployment specific LoadShedPoints e.g. within a custom extension should
253    /// be prefixed by the company / deployment name to avoid colliding with any
254    /// open source LoadShedPoints.
255    #[prost(string, tag = "1")]
256    pub name: ::prost::alloc::string::String,
257    /// A set of triggers for this LoadShedPoint. The LoadShedPoint will use the
258    /// the maximum state of all triggers, which can be scalar values between 0 and
259    /// 1 or saturated. A LoadShedPoint can only have one trigger for a given
260    /// resource e.g. :ref:`Trigger.name
261    /// <envoy_v3_api_field_config.overload.v3.Trigger.name>` must be unique in
262    /// this list.
263    #[prost(message, repeated, tag = "2")]
264    pub triggers: ::prost::alloc::vec::Vec<Trigger>,
265}
266impl ::prost::Name for LoadShedPoint {
267    const NAME: &'static str = "LoadShedPoint";
268    const PACKAGE: &'static str = "envoy.config.overload.v3";
269    fn full_name() -> ::prost::alloc::string::String {
270        "envoy.config.overload.v3.LoadShedPoint".into()
271    }
272    fn type_url() -> ::prost::alloc::string::String {
273        "type.googleapis.com/envoy.config.overload.v3.LoadShedPoint".into()
274    }
275}
276/// Configuration for which accounts the WatermarkBuffer Factories should
277/// track.
278#[derive(Clone, Copy, PartialEq, ::prost::Message)]
279pub struct BufferFactoryConfig {
280    /// The minimum power of two at which Envoy starts tracking an account.
281    ///
282    /// Envoy has 8 power of two buckets starting with the provided exponent below.
283    /// Concretely the 1st bucket contains accounts for streams that use
284    /// [2^minimum_account_to_track_power_of_two,
285    /// 2^(minimum_account_to_track_power_of_two + 1)) bytes.
286    /// With the 8th bucket tracking accounts
287    /// >= 128 * 2^minimum_account_to_track_power_of_two.
288    ///
289    /// The maximum value is 56, since we're using uint64_t for bytes counting,
290    /// and that's the last value that would use the 8 buckets. In practice,
291    /// we don't expect the proxy to be holding 2^56 bytes.
292    ///
293    /// If omitted, Envoy should not do any tracking.
294    #[prost(uint32, tag = "1")]
295    pub minimum_account_to_track_power_of_two: u32,
296}
297impl ::prost::Name for BufferFactoryConfig {
298    const NAME: &'static str = "BufferFactoryConfig";
299    const PACKAGE: &'static str = "envoy.config.overload.v3";
300    fn full_name() -> ::prost::alloc::string::String {
301        "envoy.config.overload.v3.BufferFactoryConfig".into()
302    }
303    fn type_url() -> ::prost::alloc::string::String {
304        "type.googleapis.com/envoy.config.overload.v3.BufferFactoryConfig".into()
305    }
306}
307/// \[#next-free-field: 6\]
308#[derive(Clone, PartialEq, ::prost::Message)]
309pub struct OverloadManager {
310    /// The interval for refreshing resource usage.
311    #[prost(message, optional, tag = "1")]
312    pub refresh_interval: ::core::option::Option<
313        super::super::super::super::google::protobuf::Duration,
314    >,
315    /// The set of resources to monitor.
316    #[prost(message, repeated, tag = "2")]
317    pub resource_monitors: ::prost::alloc::vec::Vec<ResourceMonitor>,
318    /// The set of overload actions.
319    #[prost(message, repeated, tag = "3")]
320    pub actions: ::prost::alloc::vec::Vec<OverloadAction>,
321    /// The set of load shed points.
322    #[prost(message, repeated, tag = "5")]
323    pub loadshed_points: ::prost::alloc::vec::Vec<LoadShedPoint>,
324    /// Configuration for buffer factory.
325    #[prost(message, optional, tag = "4")]
326    pub buffer_factory_config: ::core::option::Option<BufferFactoryConfig>,
327}
328impl ::prost::Name for OverloadManager {
329    const NAME: &'static str = "OverloadManager";
330    const PACKAGE: &'static str = "envoy.config.overload.v3";
331    fn full_name() -> ::prost::alloc::string::String {
332        "envoy.config.overload.v3.OverloadManager".into()
333    }
334    fn type_url() -> ::prost::alloc::string::String {
335        "type.googleapis.com/envoy.config.overload.v3.OverloadManager".into()
336    }
337}