java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
io.envoyproxy.envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit
All Implemented Interfaces:
com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, LocalRateLimitOrBuilder, Serializable

public final class LocalRateLimit extends com.google.protobuf.GeneratedMessageV3 implements LocalRateLimitOrBuilder
 [#next-free-field: 19]
 
Protobuf type envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit
See Also:
  • Field Details

    • STAT_PREFIX_FIELD_NUMBER

      public static final int STAT_PREFIX_FIELD_NUMBER
      See Also:
    • STATUS_FIELD_NUMBER

      public static final int STATUS_FIELD_NUMBER
      See Also:
    • TOKEN_BUCKET_FIELD_NUMBER

      public static final int TOKEN_BUCKET_FIELD_NUMBER
      See Also:
    • FILTER_ENABLED_FIELD_NUMBER

      public static final int FILTER_ENABLED_FIELD_NUMBER
      See Also:
    • FILTER_ENFORCED_FIELD_NUMBER

      public static final int FILTER_ENFORCED_FIELD_NUMBER
      See Also:
    • REQUEST_HEADERS_TO_ADD_WHEN_NOT_ENFORCED_FIELD_NUMBER

      public static final int REQUEST_HEADERS_TO_ADD_WHEN_NOT_ENFORCED_FIELD_NUMBER
      See Also:
    • RESPONSE_HEADERS_TO_ADD_FIELD_NUMBER

      public static final int RESPONSE_HEADERS_TO_ADD_FIELD_NUMBER
      See Also:
    • DESCRIPTORS_FIELD_NUMBER

      public static final int DESCRIPTORS_FIELD_NUMBER
      See Also:
    • STAGE_FIELD_NUMBER

      public static final int STAGE_FIELD_NUMBER
      See Also:
    • LOCAL_RATE_LIMIT_PER_DOWNSTREAM_CONNECTION_FIELD_NUMBER

      public static final int LOCAL_RATE_LIMIT_PER_DOWNSTREAM_CONNECTION_FIELD_NUMBER
      See Also:
    • LOCAL_CLUSTER_RATE_LIMIT_FIELD_NUMBER

      public static final int LOCAL_CLUSTER_RATE_LIMIT_FIELD_NUMBER
      See Also:
    • ENABLE_X_RATELIMIT_HEADERS_FIELD_NUMBER

      public static final int ENABLE_X_RATELIMIT_HEADERS_FIELD_NUMBER
      See Also:
    • VH_RATE_LIMITS_FIELD_NUMBER

      public static final int VH_RATE_LIMITS_FIELD_NUMBER
      See Also:
    • ALWAYS_CONSUME_DEFAULT_TOKEN_BUCKET_FIELD_NUMBER

      public static final int ALWAYS_CONSUME_DEFAULT_TOKEN_BUCKET_FIELD_NUMBER
      See Also:
    • RATE_LIMITED_AS_RESOURCE_EXHAUSTED_FIELD_NUMBER

      public static final int RATE_LIMITED_AS_RESOURCE_EXHAUSTED_FIELD_NUMBER
      See Also:
    • RATE_LIMITS_FIELD_NUMBER

      public static final int RATE_LIMITS_FIELD_NUMBER
      See Also:
    • MAX_DYNAMIC_DESCRIPTORS_FIELD_NUMBER

      public static final int MAX_DYNAMIC_DESCRIPTORS_FIELD_NUMBER
      See Also:
  • Method Details

    • newInstance

      protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
      Overrides:
      newInstance in class com.google.protobuf.GeneratedMessageV3
    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
    • getStatPrefix

      public String getStatPrefix()
       The human readable prefix to use when emitting stats.
       
      string stat_prefix = 1 [(.validate.rules) = { ... }
      Specified by:
      getStatPrefix in interface LocalRateLimitOrBuilder
      Returns:
      The statPrefix.
    • getStatPrefixBytes

      public com.google.protobuf.ByteString getStatPrefixBytes()
       The human readable prefix to use when emitting stats.
       
      string stat_prefix = 1 [(.validate.rules) = { ... }
      Specified by:
      getStatPrefixBytes in interface LocalRateLimitOrBuilder
      Returns:
      The bytes for statPrefix.
    • hasStatus

      public boolean hasStatus()
       This field allows for a custom HTTP response status code to the downstream client when
       the request has been rate limited.
       Defaults to 429 (TooManyRequests).
      
       .. note::
         If this is set to < 400, 429 will be used instead.
       
      .envoy.type.v3.HttpStatus status = 2;
      Specified by:
      hasStatus in interface LocalRateLimitOrBuilder
      Returns:
      Whether the status field is set.
    • getStatus

      public HttpStatus getStatus()
       This field allows for a custom HTTP response status code to the downstream client when
       the request has been rate limited.
       Defaults to 429 (TooManyRequests).
      
       .. note::
         If this is set to < 400, 429 will be used instead.
       
      .envoy.type.v3.HttpStatus status = 2;
      Specified by:
      getStatus in interface LocalRateLimitOrBuilder
      Returns:
      The status.
    • getStatusOrBuilder

      public HttpStatusOrBuilder getStatusOrBuilder()
       This field allows for a custom HTTP response status code to the downstream client when
       the request has been rate limited.
       Defaults to 429 (TooManyRequests).
      
       .. note::
         If this is set to < 400, 429 will be used instead.
       
      .envoy.type.v3.HttpStatus status = 2;
      Specified by:
      getStatusOrBuilder in interface LocalRateLimitOrBuilder
    • hasTokenBucket

      public boolean hasTokenBucket()
       The token bucket configuration to use for rate limiting requests that are processed by this
       filter. Each request processed by the filter consumes a single token. If the token is available,
       the request will be allowed. If no tokens are available, the request will receive the configured
       rate limit status.
      
       .. note::
         It's fine for the token bucket to be unset for the global configuration since the rate limit
         can be applied at a the virtual host or route level. Thus, the token bucket must be set
         for the per route configuration otherwise the config will be rejected.
      
       .. note::
         When using per route configuration, the bucket becomes unique to that route.
      
       .. note::
         In the current implementation the token bucket's :ref:`fill_interval
         <envoy_v3_api_field_type.v3.TokenBucket.fill_interval>` must be >= 50ms to avoid too aggressive
         refills.
       
      .envoy.type.v3.TokenBucket token_bucket = 3;
      Specified by:
      hasTokenBucket in interface LocalRateLimitOrBuilder
      Returns:
      Whether the tokenBucket field is set.
    • getTokenBucket

      public TokenBucket getTokenBucket()
       The token bucket configuration to use for rate limiting requests that are processed by this
       filter. Each request processed by the filter consumes a single token. If the token is available,
       the request will be allowed. If no tokens are available, the request will receive the configured
       rate limit status.
      
       .. note::
         It's fine for the token bucket to be unset for the global configuration since the rate limit
         can be applied at a the virtual host or route level. Thus, the token bucket must be set
         for the per route configuration otherwise the config will be rejected.
      
       .. note::
         When using per route configuration, the bucket becomes unique to that route.
      
       .. note::
         In the current implementation the token bucket's :ref:`fill_interval
         <envoy_v3_api_field_type.v3.TokenBucket.fill_interval>` must be >= 50ms to avoid too aggressive
         refills.
       
      .envoy.type.v3.TokenBucket token_bucket = 3;
      Specified by:
      getTokenBucket in interface LocalRateLimitOrBuilder
      Returns:
      The tokenBucket.
    • getTokenBucketOrBuilder

      public TokenBucketOrBuilder getTokenBucketOrBuilder()
       The token bucket configuration to use for rate limiting requests that are processed by this
       filter. Each request processed by the filter consumes a single token. If the token is available,
       the request will be allowed. If no tokens are available, the request will receive the configured
       rate limit status.
      
       .. note::
         It's fine for the token bucket to be unset for the global configuration since the rate limit
         can be applied at a the virtual host or route level. Thus, the token bucket must be set
         for the per route configuration otherwise the config will be rejected.
      
       .. note::
         When using per route configuration, the bucket becomes unique to that route.
      
       .. note::
         In the current implementation the token bucket's :ref:`fill_interval
         <envoy_v3_api_field_type.v3.TokenBucket.fill_interval>` must be >= 50ms to avoid too aggressive
         refills.
       
      .envoy.type.v3.TokenBucket token_bucket = 3;
      Specified by:
      getTokenBucketOrBuilder in interface LocalRateLimitOrBuilder
    • hasFilterEnabled

      public boolean hasFilterEnabled()
       If set, this will enable -- but not necessarily enforce -- the rate limit for the given
       fraction of requests.
       Defaults to 0% of requests for safety.
       
      .envoy.config.core.v3.RuntimeFractionalPercent filter_enabled = 4;
      Specified by:
      hasFilterEnabled in interface LocalRateLimitOrBuilder
      Returns:
      Whether the filterEnabled field is set.
    • getFilterEnabled

      public RuntimeFractionalPercent getFilterEnabled()
       If set, this will enable -- but not necessarily enforce -- the rate limit for the given
       fraction of requests.
       Defaults to 0% of requests for safety.
       
      .envoy.config.core.v3.RuntimeFractionalPercent filter_enabled = 4;
      Specified by:
      getFilterEnabled in interface LocalRateLimitOrBuilder
      Returns:
      The filterEnabled.
    • getFilterEnabledOrBuilder

      public RuntimeFractionalPercentOrBuilder getFilterEnabledOrBuilder()
       If set, this will enable -- but not necessarily enforce -- the rate limit for the given
       fraction of requests.
       Defaults to 0% of requests for safety.
       
      .envoy.config.core.v3.RuntimeFractionalPercent filter_enabled = 4;
      Specified by:
      getFilterEnabledOrBuilder in interface LocalRateLimitOrBuilder
    • hasFilterEnforced

      public boolean hasFilterEnforced()
       If set, this will enforce the rate limit decisions for the given fraction of requests.
      
       Note: this only applies to the fraction of enabled requests.
      
       Defaults to 0% of requests for safety.
       
      .envoy.config.core.v3.RuntimeFractionalPercent filter_enforced = 5;
      Specified by:
      hasFilterEnforced in interface LocalRateLimitOrBuilder
      Returns:
      Whether the filterEnforced field is set.
    • getFilterEnforced

      public RuntimeFractionalPercent getFilterEnforced()
       If set, this will enforce the rate limit decisions for the given fraction of requests.
      
       Note: this only applies to the fraction of enabled requests.
      
       Defaults to 0% of requests for safety.
       
      .envoy.config.core.v3.RuntimeFractionalPercent filter_enforced = 5;
      Specified by:
      getFilterEnforced in interface LocalRateLimitOrBuilder
      Returns:
      The filterEnforced.
    • getFilterEnforcedOrBuilder

      public RuntimeFractionalPercentOrBuilder getFilterEnforcedOrBuilder()
       If set, this will enforce the rate limit decisions for the given fraction of requests.
      
       Note: this only applies to the fraction of enabled requests.
      
       Defaults to 0% of requests for safety.
       
      .envoy.config.core.v3.RuntimeFractionalPercent filter_enforced = 5;
      Specified by:
      getFilterEnforcedOrBuilder in interface LocalRateLimitOrBuilder
    • getRequestHeadersToAddWhenNotEnforcedList

      public List<HeaderValueOption> getRequestHeadersToAddWhenNotEnforcedList()
       Specifies a list of HTTP headers that should be added to each request that
       has been rate limited and is also forwarded upstream. This can only occur when the
       filter is enabled but not enforced.
       
      repeated .envoy.config.core.v3.HeaderValueOption request_headers_to_add_when_not_enforced = 10 [(.validate.rules) = { ... }
      Specified by:
      getRequestHeadersToAddWhenNotEnforcedList in interface LocalRateLimitOrBuilder
    • getRequestHeadersToAddWhenNotEnforcedOrBuilderList

      public List<? extends HeaderValueOptionOrBuilder> getRequestHeadersToAddWhenNotEnforcedOrBuilderList()
       Specifies a list of HTTP headers that should be added to each request that
       has been rate limited and is also forwarded upstream. This can only occur when the
       filter is enabled but not enforced.
       
      repeated .envoy.config.core.v3.HeaderValueOption request_headers_to_add_when_not_enforced = 10 [(.validate.rules) = { ... }
      Specified by:
      getRequestHeadersToAddWhenNotEnforcedOrBuilderList in interface LocalRateLimitOrBuilder
    • getRequestHeadersToAddWhenNotEnforcedCount

      public int getRequestHeadersToAddWhenNotEnforcedCount()
       Specifies a list of HTTP headers that should be added to each request that
       has been rate limited and is also forwarded upstream. This can only occur when the
       filter is enabled but not enforced.
       
      repeated .envoy.config.core.v3.HeaderValueOption request_headers_to_add_when_not_enforced = 10 [(.validate.rules) = { ... }
      Specified by:
      getRequestHeadersToAddWhenNotEnforcedCount in interface LocalRateLimitOrBuilder
    • getRequestHeadersToAddWhenNotEnforced

      public HeaderValueOption getRequestHeadersToAddWhenNotEnforced(int index)
       Specifies a list of HTTP headers that should be added to each request that
       has been rate limited and is also forwarded upstream. This can only occur when the
       filter is enabled but not enforced.
       
      repeated .envoy.config.core.v3.HeaderValueOption request_headers_to_add_when_not_enforced = 10 [(.validate.rules) = { ... }
      Specified by:
      getRequestHeadersToAddWhenNotEnforced in interface LocalRateLimitOrBuilder
    • getRequestHeadersToAddWhenNotEnforcedOrBuilder

      public HeaderValueOptionOrBuilder getRequestHeadersToAddWhenNotEnforcedOrBuilder(int index)
       Specifies a list of HTTP headers that should be added to each request that
       has been rate limited and is also forwarded upstream. This can only occur when the
       filter is enabled but not enforced.
       
      repeated .envoy.config.core.v3.HeaderValueOption request_headers_to_add_when_not_enforced = 10 [(.validate.rules) = { ... }
      Specified by:
      getRequestHeadersToAddWhenNotEnforcedOrBuilder in interface LocalRateLimitOrBuilder
    • getResponseHeadersToAddList

      public List<HeaderValueOption> getResponseHeadersToAddList()
       Specifies a list of HTTP headers that should be added to each response for requests that
       have been rate limited. This occurs when the filter is enabled and fully enforced.
       
      repeated .envoy.config.core.v3.HeaderValueOption response_headers_to_add = 6 [(.validate.rules) = { ... }
      Specified by:
      getResponseHeadersToAddList in interface LocalRateLimitOrBuilder
    • getResponseHeadersToAddOrBuilderList

      public List<? extends HeaderValueOptionOrBuilder> getResponseHeadersToAddOrBuilderList()
       Specifies a list of HTTP headers that should be added to each response for requests that
       have been rate limited. This occurs when the filter is enabled and fully enforced.
       
      repeated .envoy.config.core.v3.HeaderValueOption response_headers_to_add = 6 [(.validate.rules) = { ... }
      Specified by:
      getResponseHeadersToAddOrBuilderList in interface LocalRateLimitOrBuilder
    • getResponseHeadersToAddCount

      public int getResponseHeadersToAddCount()
       Specifies a list of HTTP headers that should be added to each response for requests that
       have been rate limited. This occurs when the filter is enabled and fully enforced.
       
      repeated .envoy.config.core.v3.HeaderValueOption response_headers_to_add = 6 [(.validate.rules) = { ... }
      Specified by:
      getResponseHeadersToAddCount in interface LocalRateLimitOrBuilder
    • getResponseHeadersToAdd

      public HeaderValueOption getResponseHeadersToAdd(int index)
       Specifies a list of HTTP headers that should be added to each response for requests that
       have been rate limited. This occurs when the filter is enabled and fully enforced.
       
      repeated .envoy.config.core.v3.HeaderValueOption response_headers_to_add = 6 [(.validate.rules) = { ... }
      Specified by:
      getResponseHeadersToAdd in interface LocalRateLimitOrBuilder
    • getResponseHeadersToAddOrBuilder

      public HeaderValueOptionOrBuilder getResponseHeadersToAddOrBuilder(int index)
       Specifies a list of HTTP headers that should be added to each response for requests that
       have been rate limited. This occurs when the filter is enabled and fully enforced.
       
      repeated .envoy.config.core.v3.HeaderValueOption response_headers_to_add = 6 [(.validate.rules) = { ... }
      Specified by:
      getResponseHeadersToAddOrBuilder in interface LocalRateLimitOrBuilder
    • getDescriptorsList

      public List<LocalRateLimitDescriptor> getDescriptorsList()
       The rate limit descriptor list to use in the local rate limit to override
       on. The rate limit descriptor is selected by the first full match from the
       request descriptors.
      
       Example on how to use :ref:`this <config_http_filters_local_rate_limit_descriptors>`.
      
       .. note::
      
         In the current implementation the descriptor's token bucket :ref:`fill_interval
         <envoy_v3_api_field_type.v3.TokenBucket.fill_interval>` must be a multiple
         global :ref:`token bucket's<envoy_v3_api_field_extensions.filters.http.local_ratelimit.v3.LocalRateLimit.token_bucket>` fill interval.
      
         The descriptors must match verbatim for rate limiting to apply. There is no partial
         match by a subset of descriptor entries in the current implementation.
       
      repeated .envoy.extensions.common.ratelimit.v3.LocalRateLimitDescriptor descriptors = 8;
      Specified by:
      getDescriptorsList in interface LocalRateLimitOrBuilder
    • getDescriptorsOrBuilderList

      public List<? extends LocalRateLimitDescriptorOrBuilder> getDescriptorsOrBuilderList()
       The rate limit descriptor list to use in the local rate limit to override
       on. The rate limit descriptor is selected by the first full match from the
       request descriptors.
      
       Example on how to use :ref:`this <config_http_filters_local_rate_limit_descriptors>`.
      
       .. note::
      
         In the current implementation the descriptor's token bucket :ref:`fill_interval
         <envoy_v3_api_field_type.v3.TokenBucket.fill_interval>` must be a multiple
         global :ref:`token bucket's<envoy_v3_api_field_extensions.filters.http.local_ratelimit.v3.LocalRateLimit.token_bucket>` fill interval.
      
         The descriptors must match verbatim for rate limiting to apply. There is no partial
         match by a subset of descriptor entries in the current implementation.
       
      repeated .envoy.extensions.common.ratelimit.v3.LocalRateLimitDescriptor descriptors = 8;
      Specified by:
      getDescriptorsOrBuilderList in interface LocalRateLimitOrBuilder
    • getDescriptorsCount

      public int getDescriptorsCount()
       The rate limit descriptor list to use in the local rate limit to override
       on. The rate limit descriptor is selected by the first full match from the
       request descriptors.
      
       Example on how to use :ref:`this <config_http_filters_local_rate_limit_descriptors>`.
      
       .. note::
      
         In the current implementation the descriptor's token bucket :ref:`fill_interval
         <envoy_v3_api_field_type.v3.TokenBucket.fill_interval>` must be a multiple
         global :ref:`token bucket's<envoy_v3_api_field_extensions.filters.http.local_ratelimit.v3.LocalRateLimit.token_bucket>` fill interval.
      
         The descriptors must match verbatim for rate limiting to apply. There is no partial
         match by a subset of descriptor entries in the current implementation.
       
      repeated .envoy.extensions.common.ratelimit.v3.LocalRateLimitDescriptor descriptors = 8;
      Specified by:
      getDescriptorsCount in interface LocalRateLimitOrBuilder
    • getDescriptors

      public LocalRateLimitDescriptor getDescriptors(int index)
       The rate limit descriptor list to use in the local rate limit to override
       on. The rate limit descriptor is selected by the first full match from the
       request descriptors.
      
       Example on how to use :ref:`this <config_http_filters_local_rate_limit_descriptors>`.
      
       .. note::
      
         In the current implementation the descriptor's token bucket :ref:`fill_interval
         <envoy_v3_api_field_type.v3.TokenBucket.fill_interval>` must be a multiple
         global :ref:`token bucket's<envoy_v3_api_field_extensions.filters.http.local_ratelimit.v3.LocalRateLimit.token_bucket>` fill interval.
      
         The descriptors must match verbatim for rate limiting to apply. There is no partial
         match by a subset of descriptor entries in the current implementation.
       
      repeated .envoy.extensions.common.ratelimit.v3.LocalRateLimitDescriptor descriptors = 8;
      Specified by:
      getDescriptors in interface LocalRateLimitOrBuilder
    • getDescriptorsOrBuilder

      public LocalRateLimitDescriptorOrBuilder getDescriptorsOrBuilder(int index)
       The rate limit descriptor list to use in the local rate limit to override
       on. The rate limit descriptor is selected by the first full match from the
       request descriptors.
      
       Example on how to use :ref:`this <config_http_filters_local_rate_limit_descriptors>`.
      
       .. note::
      
         In the current implementation the descriptor's token bucket :ref:`fill_interval
         <envoy_v3_api_field_type.v3.TokenBucket.fill_interval>` must be a multiple
         global :ref:`token bucket's<envoy_v3_api_field_extensions.filters.http.local_ratelimit.v3.LocalRateLimit.token_bucket>` fill interval.
      
         The descriptors must match verbatim for rate limiting to apply. There is no partial
         match by a subset of descriptor entries in the current implementation.
       
      repeated .envoy.extensions.common.ratelimit.v3.LocalRateLimitDescriptor descriptors = 8;
      Specified by:
      getDescriptorsOrBuilder in interface LocalRateLimitOrBuilder
    • getStage

      public int getStage()
       Specifies the rate limit configurations to be applied with the same
       stage number. If not set, the default stage number is 0.
      
       .. note::
      
        The filter supports a range of 0 - 10 inclusively for stage numbers.
       
      uint32 stage = 9 [(.validate.rules) = { ... }
      Specified by:
      getStage in interface LocalRateLimitOrBuilder
      Returns:
      The stage.
    • getLocalRateLimitPerDownstreamConnection

      public boolean getLocalRateLimitPerDownstreamConnection()
       Specifies the scope of the rate limiter's token bucket.
       If set to false, the token bucket is shared across all worker threads,
       thus the rate limits are applied per Envoy process.
       If set to true, a token bucket is allocated for each connection.
       Thus the rate limits are applied per connection thereby allowing
       one to rate limit requests on a per connection basis.
       If unspecified, the default value is false.
       
      bool local_rate_limit_per_downstream_connection = 11;
      Specified by:
      getLocalRateLimitPerDownstreamConnection in interface LocalRateLimitOrBuilder
      Returns:
      The localRateLimitPerDownstreamConnection.
    • hasLocalClusterRateLimit

      public boolean hasLocalClusterRateLimit()
       Enables the local cluster level rate limiting, iff this is set explicitly. For example,
       given an Envoy gateway that contains N Envoy instances and a rate limit rule X tokens
       per second. If this is set, the total rate limit of whole gateway will always be X tokens
       per second regardless of how N changes. If this is not set, the total rate limit of whole
       gateway will be N * X tokens per second.
      
       .. note::
         This should never be set if the ``local_rate_limit_per_downstream_connection`` is set to
         true. Because if per connection rate limiting is enabled, we assume that the token buckets
         should never be shared across Envoy instances.
      
       .. note::
         This only works when the :ref:`local cluster name
         <envoy_v3_api_field_config.bootstrap.v3.ClusterManager.local_cluster_name>` is set and
         the related cluster is defined in the bootstrap configuration.
       
      .envoy.extensions.common.ratelimit.v3.LocalClusterRateLimit local_cluster_rate_limit = 16;
      Specified by:
      hasLocalClusterRateLimit in interface LocalRateLimitOrBuilder
      Returns:
      Whether the localClusterRateLimit field is set.
    • getLocalClusterRateLimit

      public LocalClusterRateLimit getLocalClusterRateLimit()
       Enables the local cluster level rate limiting, iff this is set explicitly. For example,
       given an Envoy gateway that contains N Envoy instances and a rate limit rule X tokens
       per second. If this is set, the total rate limit of whole gateway will always be X tokens
       per second regardless of how N changes. If this is not set, the total rate limit of whole
       gateway will be N * X tokens per second.
      
       .. note::
         This should never be set if the ``local_rate_limit_per_downstream_connection`` is set to
         true. Because if per connection rate limiting is enabled, we assume that the token buckets
         should never be shared across Envoy instances.
      
       .. note::
         This only works when the :ref:`local cluster name
         <envoy_v3_api_field_config.bootstrap.v3.ClusterManager.local_cluster_name>` is set and
         the related cluster is defined in the bootstrap configuration.
       
      .envoy.extensions.common.ratelimit.v3.LocalClusterRateLimit local_cluster_rate_limit = 16;
      Specified by:
      getLocalClusterRateLimit in interface LocalRateLimitOrBuilder
      Returns:
      The localClusterRateLimit.
    • getLocalClusterRateLimitOrBuilder

      public LocalClusterRateLimitOrBuilder getLocalClusterRateLimitOrBuilder()
       Enables the local cluster level rate limiting, iff this is set explicitly. For example,
       given an Envoy gateway that contains N Envoy instances and a rate limit rule X tokens
       per second. If this is set, the total rate limit of whole gateway will always be X tokens
       per second regardless of how N changes. If this is not set, the total rate limit of whole
       gateway will be N * X tokens per second.
      
       .. note::
         This should never be set if the ``local_rate_limit_per_downstream_connection`` is set to
         true. Because if per connection rate limiting is enabled, we assume that the token buckets
         should never be shared across Envoy instances.
      
       .. note::
         This only works when the :ref:`local cluster name
         <envoy_v3_api_field_config.bootstrap.v3.ClusterManager.local_cluster_name>` is set and
         the related cluster is defined in the bootstrap configuration.
       
      .envoy.extensions.common.ratelimit.v3.LocalClusterRateLimit local_cluster_rate_limit = 16;
      Specified by:
      getLocalClusterRateLimitOrBuilder in interface LocalRateLimitOrBuilder
    • getEnableXRatelimitHeadersValue

      public int getEnableXRatelimitHeadersValue()
       Defines the standard version to use for X-RateLimit headers emitted by the filter.
      
       * ``X-RateLimit-Limit`` - indicates the request-quota associated to the
         client in the current time-window followed by the description of the
         quota policy.
       * ``X-RateLimit-Remaining`` - indicates the remaining requests in the
         current time-window.
       * ``X-RateLimit-Reset`` - indicates the number of seconds until reset of
         the current time-window.
      
       In case rate limiting policy specifies more then one time window, the values
       above represent the window that is closest to reaching its limit.
      
       For more information about the headers specification see selected version of
       the `draft RFC <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_.
      
       Disabled by default.
       
      .envoy.extensions.common.ratelimit.v3.XRateLimitHeadersRFCVersion enable_x_ratelimit_headers = 12 [(.validate.rules) = { ... }
      Specified by:
      getEnableXRatelimitHeadersValue in interface LocalRateLimitOrBuilder
      Returns:
      The enum numeric value on the wire for enableXRatelimitHeaders.
    • getEnableXRatelimitHeaders

      public XRateLimitHeadersRFCVersion getEnableXRatelimitHeaders()
       Defines the standard version to use for X-RateLimit headers emitted by the filter.
      
       * ``X-RateLimit-Limit`` - indicates the request-quota associated to the
         client in the current time-window followed by the description of the
         quota policy.
       * ``X-RateLimit-Remaining`` - indicates the remaining requests in the
         current time-window.
       * ``X-RateLimit-Reset`` - indicates the number of seconds until reset of
         the current time-window.
      
       In case rate limiting policy specifies more then one time window, the values
       above represent the window that is closest to reaching its limit.
      
       For more information about the headers specification see selected version of
       the `draft RFC <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_.
      
       Disabled by default.
       
      .envoy.extensions.common.ratelimit.v3.XRateLimitHeadersRFCVersion enable_x_ratelimit_headers = 12 [(.validate.rules) = { ... }
      Specified by:
      getEnableXRatelimitHeaders in interface LocalRateLimitOrBuilder
      Returns:
      The enableXRatelimitHeaders.
    • getVhRateLimitsValue

      public int getVhRateLimitsValue()
       Specifies if the local rate limit filter should include the virtual host rate limits.
       
      .envoy.extensions.common.ratelimit.v3.VhRateLimitsOptions vh_rate_limits = 13 [(.validate.rules) = { ... }
      Specified by:
      getVhRateLimitsValue in interface LocalRateLimitOrBuilder
      Returns:
      The enum numeric value on the wire for vhRateLimits.
    • getVhRateLimits

      public VhRateLimitsOptions getVhRateLimits()
       Specifies if the local rate limit filter should include the virtual host rate limits.
       
      .envoy.extensions.common.ratelimit.v3.VhRateLimitsOptions vh_rate_limits = 13 [(.validate.rules) = { ... }
      Specified by:
      getVhRateLimits in interface LocalRateLimitOrBuilder
      Returns:
      The vhRateLimits.
    • hasAlwaysConsumeDefaultTokenBucket

      public boolean hasAlwaysConsumeDefaultTokenBucket()
       Specifies if default token bucket should be always consumed.
       If set to false, default token bucket will only be consumed when there is
       no matching descriptor. If set to true, default token bucket will always
       be consumed. Default is true.
       
      .google.protobuf.BoolValue always_consume_default_token_bucket = 14;
      Specified by:
      hasAlwaysConsumeDefaultTokenBucket in interface LocalRateLimitOrBuilder
      Returns:
      Whether the alwaysConsumeDefaultTokenBucket field is set.
    • getAlwaysConsumeDefaultTokenBucket

      public com.google.protobuf.BoolValue getAlwaysConsumeDefaultTokenBucket()
       Specifies if default token bucket should be always consumed.
       If set to false, default token bucket will only be consumed when there is
       no matching descriptor. If set to true, default token bucket will always
       be consumed. Default is true.
       
      .google.protobuf.BoolValue always_consume_default_token_bucket = 14;
      Specified by:
      getAlwaysConsumeDefaultTokenBucket in interface LocalRateLimitOrBuilder
      Returns:
      The alwaysConsumeDefaultTokenBucket.
    • getAlwaysConsumeDefaultTokenBucketOrBuilder

      public com.google.protobuf.BoolValueOrBuilder getAlwaysConsumeDefaultTokenBucketOrBuilder()
       Specifies if default token bucket should be always consumed.
       If set to false, default token bucket will only be consumed when there is
       no matching descriptor. If set to true, default token bucket will always
       be consumed. Default is true.
       
      .google.protobuf.BoolValue always_consume_default_token_bucket = 14;
      Specified by:
      getAlwaysConsumeDefaultTokenBucketOrBuilder in interface LocalRateLimitOrBuilder
    • getRateLimitedAsResourceExhausted

      public boolean getRateLimitedAsResourceExhausted()
       Specifies whether a ``RESOURCE_EXHAUSTED`` gRPC code must be returned instead
       of the default ``UNAVAILABLE`` gRPC code for a rate limited gRPC call. The
       HTTP code will be 200 for a gRPC response.
       
      bool rate_limited_as_resource_exhausted = 15;
      Specified by:
      getRateLimitedAsResourceExhausted in interface LocalRateLimitOrBuilder
      Returns:
      The rateLimitedAsResourceExhausted.
    • getRateLimitsList

      public List<RateLimit> getRateLimitsList()
       Rate limit configuration that is used to generate a list of descriptor entries based on
       the request context. The generated entries will be used to find one or multiple matched rate
       limit rule from the ``descriptors``.
       If this is set, then
       :ref:`VirtualHost.rate_limits<envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>` or
       :ref:`RouteAction.rate_limits<envoy_v3_api_field_config.route.v3.RouteAction.rate_limits>` fields
       will be ignored.
      
       .. note::
         Not all configuration fields of
         :ref:`rate limit config <envoy_v3_api_msg_config.route.v3.RateLimit>` is supported at here.
         Following fields are not supported:
      
         1. :ref:`rate limit stage <envoy_v3_api_field_config.route.v3.RateLimit.stage>`.
         2. :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>`.
         3. :ref:`disable_key <envoy_v3_api_field_config.route.v3.RateLimit.disable_key>`.
         4. :ref:`override limit <envoy_v3_api_field_config.route.v3.RateLimit.limit>`.
       
      repeated .envoy.config.route.v3.RateLimit rate_limits = 17;
      Specified by:
      getRateLimitsList in interface LocalRateLimitOrBuilder
    • getRateLimitsOrBuilderList

      public List<? extends RateLimitOrBuilder> getRateLimitsOrBuilderList()
       Rate limit configuration that is used to generate a list of descriptor entries based on
       the request context. The generated entries will be used to find one or multiple matched rate
       limit rule from the ``descriptors``.
       If this is set, then
       :ref:`VirtualHost.rate_limits<envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>` or
       :ref:`RouteAction.rate_limits<envoy_v3_api_field_config.route.v3.RouteAction.rate_limits>` fields
       will be ignored.
      
       .. note::
         Not all configuration fields of
         :ref:`rate limit config <envoy_v3_api_msg_config.route.v3.RateLimit>` is supported at here.
         Following fields are not supported:
      
         1. :ref:`rate limit stage <envoy_v3_api_field_config.route.v3.RateLimit.stage>`.
         2. :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>`.
         3. :ref:`disable_key <envoy_v3_api_field_config.route.v3.RateLimit.disable_key>`.
         4. :ref:`override limit <envoy_v3_api_field_config.route.v3.RateLimit.limit>`.
       
      repeated .envoy.config.route.v3.RateLimit rate_limits = 17;
      Specified by:
      getRateLimitsOrBuilderList in interface LocalRateLimitOrBuilder
    • getRateLimitsCount

      public int getRateLimitsCount()
       Rate limit configuration that is used to generate a list of descriptor entries based on
       the request context. The generated entries will be used to find one or multiple matched rate
       limit rule from the ``descriptors``.
       If this is set, then
       :ref:`VirtualHost.rate_limits<envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>` or
       :ref:`RouteAction.rate_limits<envoy_v3_api_field_config.route.v3.RouteAction.rate_limits>` fields
       will be ignored.
      
       .. note::
         Not all configuration fields of
         :ref:`rate limit config <envoy_v3_api_msg_config.route.v3.RateLimit>` is supported at here.
         Following fields are not supported:
      
         1. :ref:`rate limit stage <envoy_v3_api_field_config.route.v3.RateLimit.stage>`.
         2. :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>`.
         3. :ref:`disable_key <envoy_v3_api_field_config.route.v3.RateLimit.disable_key>`.
         4. :ref:`override limit <envoy_v3_api_field_config.route.v3.RateLimit.limit>`.
       
      repeated .envoy.config.route.v3.RateLimit rate_limits = 17;
      Specified by:
      getRateLimitsCount in interface LocalRateLimitOrBuilder
    • getRateLimits

      public RateLimit getRateLimits(int index)
       Rate limit configuration that is used to generate a list of descriptor entries based on
       the request context. The generated entries will be used to find one or multiple matched rate
       limit rule from the ``descriptors``.
       If this is set, then
       :ref:`VirtualHost.rate_limits<envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>` or
       :ref:`RouteAction.rate_limits<envoy_v3_api_field_config.route.v3.RouteAction.rate_limits>` fields
       will be ignored.
      
       .. note::
         Not all configuration fields of
         :ref:`rate limit config <envoy_v3_api_msg_config.route.v3.RateLimit>` is supported at here.
         Following fields are not supported:
      
         1. :ref:`rate limit stage <envoy_v3_api_field_config.route.v3.RateLimit.stage>`.
         2. :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>`.
         3. :ref:`disable_key <envoy_v3_api_field_config.route.v3.RateLimit.disable_key>`.
         4. :ref:`override limit <envoy_v3_api_field_config.route.v3.RateLimit.limit>`.
       
      repeated .envoy.config.route.v3.RateLimit rate_limits = 17;
      Specified by:
      getRateLimits in interface LocalRateLimitOrBuilder
    • getRateLimitsOrBuilder

      public RateLimitOrBuilder getRateLimitsOrBuilder(int index)
       Rate limit configuration that is used to generate a list of descriptor entries based on
       the request context. The generated entries will be used to find one or multiple matched rate
       limit rule from the ``descriptors``.
       If this is set, then
       :ref:`VirtualHost.rate_limits<envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>` or
       :ref:`RouteAction.rate_limits<envoy_v3_api_field_config.route.v3.RouteAction.rate_limits>` fields
       will be ignored.
      
       .. note::
         Not all configuration fields of
         :ref:`rate limit config <envoy_v3_api_msg_config.route.v3.RateLimit>` is supported at here.
         Following fields are not supported:
      
         1. :ref:`rate limit stage <envoy_v3_api_field_config.route.v3.RateLimit.stage>`.
         2. :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>`.
         3. :ref:`disable_key <envoy_v3_api_field_config.route.v3.RateLimit.disable_key>`.
         4. :ref:`override limit <envoy_v3_api_field_config.route.v3.RateLimit.limit>`.
       
      repeated .envoy.config.route.v3.RateLimit rate_limits = 17;
      Specified by:
      getRateLimitsOrBuilder in interface LocalRateLimitOrBuilder
    • hasMaxDynamicDescriptors

      public boolean hasMaxDynamicDescriptors()
       Specifies the max dynamic descriptors kept in the cache for a particular wildcard descriptor
       configured in the global :ref:`descriptors<envoy_v3_api_field_extensions.filters.http.local_ratelimit.v3.LocalRateLimit.descriptors>`.
       Wildcard descriptor means descriptor has one or more entries with just key and value omitted. For example if user has configured two descriptors
       with blank value entries, then max dynamic descriptors stored in the LRU cache will be 2 * max_dynamic_descriptors.
       Actual number of dynamic descriptors will depend on the cardinality of unique values received from the http request for the omitted
       values.
       Minimum is 1. Default is 20.
       
      .google.protobuf.UInt32Value max_dynamic_descriptors = 18 [(.validate.rules) = { ... }
      Specified by:
      hasMaxDynamicDescriptors in interface LocalRateLimitOrBuilder
      Returns:
      Whether the maxDynamicDescriptors field is set.
    • getMaxDynamicDescriptors

      public com.google.protobuf.UInt32Value getMaxDynamicDescriptors()
       Specifies the max dynamic descriptors kept in the cache for a particular wildcard descriptor
       configured in the global :ref:`descriptors<envoy_v3_api_field_extensions.filters.http.local_ratelimit.v3.LocalRateLimit.descriptors>`.
       Wildcard descriptor means descriptor has one or more entries with just key and value omitted. For example if user has configured two descriptors
       with blank value entries, then max dynamic descriptors stored in the LRU cache will be 2 * max_dynamic_descriptors.
       Actual number of dynamic descriptors will depend on the cardinality of unique values received from the http request for the omitted
       values.
       Minimum is 1. Default is 20.
       
      .google.protobuf.UInt32Value max_dynamic_descriptors = 18 [(.validate.rules) = { ... }
      Specified by:
      getMaxDynamicDescriptors in interface LocalRateLimitOrBuilder
      Returns:
      The maxDynamicDescriptors.
    • getMaxDynamicDescriptorsOrBuilder

      public com.google.protobuf.UInt32ValueOrBuilder getMaxDynamicDescriptorsOrBuilder()
       Specifies the max dynamic descriptors kept in the cache for a particular wildcard descriptor
       configured in the global :ref:`descriptors<envoy_v3_api_field_extensions.filters.http.local_ratelimit.v3.LocalRateLimit.descriptors>`.
       Wildcard descriptor means descriptor has one or more entries with just key and value omitted. For example if user has configured two descriptors
       with blank value entries, then max dynamic descriptors stored in the LRU cache will be 2 * max_dynamic_descriptors.
       Actual number of dynamic descriptors will depend on the cardinality of unique values received from the http request for the omitted
       values.
       Minimum is 1. Default is 20.
       
      .google.protobuf.UInt32Value max_dynamic_descriptors = 18 [(.validate.rules) = { ... }
      Specified by:
      getMaxDynamicDescriptorsOrBuilder in interface LocalRateLimitOrBuilder
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessageV3
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessageV3
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static LocalRateLimit parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LocalRateLimit parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LocalRateLimit parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LocalRateLimit parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LocalRateLimit parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LocalRateLimit parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LocalRateLimit parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static LocalRateLimit parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static LocalRateLimit parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static LocalRateLimit parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static LocalRateLimit parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static LocalRateLimit parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public LocalRateLimit.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static LocalRateLimit.Builder newBuilder()
    • newBuilder

      public static LocalRateLimit.Builder newBuilder(LocalRateLimit prototype)
    • toBuilder

      public LocalRateLimit.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected LocalRateLimit.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
      Specified by:
      newBuilderForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstance

      public static LocalRateLimit getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<LocalRateLimit> parser()
    • getParserForType

      public com.google.protobuf.Parser<LocalRateLimit> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstanceForType

      public LocalRateLimit getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder