Class CustomResponse.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
io.envoyproxy.envoy.extensions.filters.http.custom_response.v3.CustomResponse.Builder
- All Implemented Interfaces:
com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,CustomResponseOrBuilder,Cloneable
- Enclosing class:
- CustomResponse
public static final class CustomResponse.Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
implements CustomResponseOrBuilder
The filter configuration is a collection of custom response policies in a matcher tree. The configuration can be defined at the filter, virtual host or route level. The response will be matched against the most specific to the least specific config, till a match is found.Protobuf type
envoy.extensions.filters.http.custom_response.v3.CustomResponse-
Method Summary
Modifier and TypeMethodDescriptionaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) build()clear()Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response.clearField(com.google.protobuf.Descriptors.FieldDescriptor field) clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) clone()Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response.Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response.Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorbooleanMatcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanMatcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response.mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeFrom(CustomResponse other) final CustomResponse.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) setCustomResponseMatcher(Matcher value) Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response.setCustomResponseMatcher(Matcher.Builder builderForValue) Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response.setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) final CustomResponse.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
-
setField
public CustomResponse.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
-
clearField
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
-
clearOneof
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
-
setRepeatedField
public CustomResponse.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) - Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
-
addRepeatedField
public CustomResponse.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<CustomResponse.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
-
mergeFrom
public CustomResponse.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<CustomResponse.Builder>- Throws:
IOException
-
hasCustomResponseMatcher
public boolean hasCustomResponseMatcher()Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response. The matching is done by matching against :ref:`response header values<extension_category_envoy.matching.http.input>` Example: .. validated-code-block:: yaml :type-name: xds.type.matcher.v3.Matcher matcher_list: matchers: # Apply a locally stored custom response to any 4xx response. - predicate: single_predicate: input: name: 4xx_response typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeClassMatchInput value_match: exact: "4xx" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.local_response_policy.v3.LocalResponsePolicy status_code: 499 body: inline_string: "not allowed" body_format: json_format: status: "%RESPONSE_CODE%" message: "%LOCAL_REPLY_BODY%" response_headers_to_add: - header: key: "foo" value: "x-bar" # Redirect to different upstream if the status code is one of 502, 503 or 504. - predicate: or_matcher: predicate: - single_predicate: input: name: "502_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "502" - single_predicate: input: name: "503_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "503" - single_predicate: input: name: "504_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "504" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy status_code: 299 uri: "https://foo.example/gateway_error" response_headers_to_add: - header: key: "foo2" value: "x-bar2" -- attention:: The first matched policy wins. Once the response is matched, matcher evaluations end. Refer to :ref:`Unified Matcher API <envoy_v3_api_msg_.xds.type.matcher.v3.Matcher>` documentation for more information on the matcher trees. [#extension-category: envoy.http.custom_response].xds.type.matcher.v3.Matcher custom_response_matcher = 1;- Specified by:
hasCustomResponseMatcherin interfaceCustomResponseOrBuilder- Returns:
- Whether the customResponseMatcher field is set.
-
getCustomResponseMatcher
Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response. The matching is done by matching against :ref:`response header values<extension_category_envoy.matching.http.input>` Example: .. validated-code-block:: yaml :type-name: xds.type.matcher.v3.Matcher matcher_list: matchers: # Apply a locally stored custom response to any 4xx response. - predicate: single_predicate: input: name: 4xx_response typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeClassMatchInput value_match: exact: "4xx" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.local_response_policy.v3.LocalResponsePolicy status_code: 499 body: inline_string: "not allowed" body_format: json_format: status: "%RESPONSE_CODE%" message: "%LOCAL_REPLY_BODY%" response_headers_to_add: - header: key: "foo" value: "x-bar" # Redirect to different upstream if the status code is one of 502, 503 or 504. - predicate: or_matcher: predicate: - single_predicate: input: name: "502_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "502" - single_predicate: input: name: "503_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "503" - single_predicate: input: name: "504_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "504" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy status_code: 299 uri: "https://foo.example/gateway_error" response_headers_to_add: - header: key: "foo2" value: "x-bar2" -- attention:: The first matched policy wins. Once the response is matched, matcher evaluations end. Refer to :ref:`Unified Matcher API <envoy_v3_api_msg_.xds.type.matcher.v3.Matcher>` documentation for more information on the matcher trees. [#extension-category: envoy.http.custom_response].xds.type.matcher.v3.Matcher custom_response_matcher = 1;- Specified by:
getCustomResponseMatcherin interfaceCustomResponseOrBuilder- Returns:
- The customResponseMatcher.
-
setCustomResponseMatcher
Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response. The matching is done by matching against :ref:`response header values<extension_category_envoy.matching.http.input>` Example: .. validated-code-block:: yaml :type-name: xds.type.matcher.v3.Matcher matcher_list: matchers: # Apply a locally stored custom response to any 4xx response. - predicate: single_predicate: input: name: 4xx_response typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeClassMatchInput value_match: exact: "4xx" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.local_response_policy.v3.LocalResponsePolicy status_code: 499 body: inline_string: "not allowed" body_format: json_format: status: "%RESPONSE_CODE%" message: "%LOCAL_REPLY_BODY%" response_headers_to_add: - header: key: "foo" value: "x-bar" # Redirect to different upstream if the status code is one of 502, 503 or 504. - predicate: or_matcher: predicate: - single_predicate: input: name: "502_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "502" - single_predicate: input: name: "503_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "503" - single_predicate: input: name: "504_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "504" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy status_code: 299 uri: "https://foo.example/gateway_error" response_headers_to_add: - header: key: "foo2" value: "x-bar2" -- attention:: The first matched policy wins. Once the response is matched, matcher evaluations end. Refer to :ref:`Unified Matcher API <envoy_v3_api_msg_.xds.type.matcher.v3.Matcher>` documentation for more information on the matcher trees. [#extension-category: envoy.http.custom_response].xds.type.matcher.v3.Matcher custom_response_matcher = 1; -
setCustomResponseMatcher
Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response. The matching is done by matching against :ref:`response header values<extension_category_envoy.matching.http.input>` Example: .. validated-code-block:: yaml :type-name: xds.type.matcher.v3.Matcher matcher_list: matchers: # Apply a locally stored custom response to any 4xx response. - predicate: single_predicate: input: name: 4xx_response typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeClassMatchInput value_match: exact: "4xx" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.local_response_policy.v3.LocalResponsePolicy status_code: 499 body: inline_string: "not allowed" body_format: json_format: status: "%RESPONSE_CODE%" message: "%LOCAL_REPLY_BODY%" response_headers_to_add: - header: key: "foo" value: "x-bar" # Redirect to different upstream if the status code is one of 502, 503 or 504. - predicate: or_matcher: predicate: - single_predicate: input: name: "502_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "502" - single_predicate: input: name: "503_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "503" - single_predicate: input: name: "504_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "504" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy status_code: 299 uri: "https://foo.example/gateway_error" response_headers_to_add: - header: key: "foo2" value: "x-bar2" -- attention:: The first matched policy wins. Once the response is matched, matcher evaluations end. Refer to :ref:`Unified Matcher API <envoy_v3_api_msg_.xds.type.matcher.v3.Matcher>` documentation for more information on the matcher trees. [#extension-category: envoy.http.custom_response].xds.type.matcher.v3.Matcher custom_response_matcher = 1; -
mergeCustomResponseMatcher
Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response. The matching is done by matching against :ref:`response header values<extension_category_envoy.matching.http.input>` Example: .. validated-code-block:: yaml :type-name: xds.type.matcher.v3.Matcher matcher_list: matchers: # Apply a locally stored custom response to any 4xx response. - predicate: single_predicate: input: name: 4xx_response typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeClassMatchInput value_match: exact: "4xx" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.local_response_policy.v3.LocalResponsePolicy status_code: 499 body: inline_string: "not allowed" body_format: json_format: status: "%RESPONSE_CODE%" message: "%LOCAL_REPLY_BODY%" response_headers_to_add: - header: key: "foo" value: "x-bar" # Redirect to different upstream if the status code is one of 502, 503 or 504. - predicate: or_matcher: predicate: - single_predicate: input: name: "502_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "502" - single_predicate: input: name: "503_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "503" - single_predicate: input: name: "504_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "504" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy status_code: 299 uri: "https://foo.example/gateway_error" response_headers_to_add: - header: key: "foo2" value: "x-bar2" -- attention:: The first matched policy wins. Once the response is matched, matcher evaluations end. Refer to :ref:`Unified Matcher API <envoy_v3_api_msg_.xds.type.matcher.v3.Matcher>` documentation for more information on the matcher trees. [#extension-category: envoy.http.custom_response].xds.type.matcher.v3.Matcher custom_response_matcher = 1; -
clearCustomResponseMatcher
Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response. The matching is done by matching against :ref:`response header values<extension_category_envoy.matching.http.input>` Example: .. validated-code-block:: yaml :type-name: xds.type.matcher.v3.Matcher matcher_list: matchers: # Apply a locally stored custom response to any 4xx response. - predicate: single_predicate: input: name: 4xx_response typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeClassMatchInput value_match: exact: "4xx" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.local_response_policy.v3.LocalResponsePolicy status_code: 499 body: inline_string: "not allowed" body_format: json_format: status: "%RESPONSE_CODE%" message: "%LOCAL_REPLY_BODY%" response_headers_to_add: - header: key: "foo" value: "x-bar" # Redirect to different upstream if the status code is one of 502, 503 or 504. - predicate: or_matcher: predicate: - single_predicate: input: name: "502_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "502" - single_predicate: input: name: "503_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "503" - single_predicate: input: name: "504_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "504" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy status_code: 299 uri: "https://foo.example/gateway_error" response_headers_to_add: - header: key: "foo2" value: "x-bar2" -- attention:: The first matched policy wins. Once the response is matched, matcher evaluations end. Refer to :ref:`Unified Matcher API <envoy_v3_api_msg_.xds.type.matcher.v3.Matcher>` documentation for more information on the matcher trees. [#extension-category: envoy.http.custom_response].xds.type.matcher.v3.Matcher custom_response_matcher = 1; -
getCustomResponseMatcherBuilder
Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response. The matching is done by matching against :ref:`response header values<extension_category_envoy.matching.http.input>` Example: .. validated-code-block:: yaml :type-name: xds.type.matcher.v3.Matcher matcher_list: matchers: # Apply a locally stored custom response to any 4xx response. - predicate: single_predicate: input: name: 4xx_response typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeClassMatchInput value_match: exact: "4xx" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.local_response_policy.v3.LocalResponsePolicy status_code: 499 body: inline_string: "not allowed" body_format: json_format: status: "%RESPONSE_CODE%" message: "%LOCAL_REPLY_BODY%" response_headers_to_add: - header: key: "foo" value: "x-bar" # Redirect to different upstream if the status code is one of 502, 503 or 504. - predicate: or_matcher: predicate: - single_predicate: input: name: "502_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "502" - single_predicate: input: name: "503_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "503" - single_predicate: input: name: "504_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "504" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy status_code: 299 uri: "https://foo.example/gateway_error" response_headers_to_add: - header: key: "foo2" value: "x-bar2" -- attention:: The first matched policy wins. Once the response is matched, matcher evaluations end. Refer to :ref:`Unified Matcher API <envoy_v3_api_msg_.xds.type.matcher.v3.Matcher>` documentation for more information on the matcher trees. [#extension-category: envoy.http.custom_response].xds.type.matcher.v3.Matcher custom_response_matcher = 1; -
getCustomResponseMatcherOrBuilder
Matcher to match against the original response to select a :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` that will override the original response. The matching is done by matching against :ref:`response header values<extension_category_envoy.matching.http.input>` Example: .. validated-code-block:: yaml :type-name: xds.type.matcher.v3.Matcher matcher_list: matchers: # Apply a locally stored custom response to any 4xx response. - predicate: single_predicate: input: name: 4xx_response typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeClassMatchInput value_match: exact: "4xx" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.local_response_policy.v3.LocalResponsePolicy status_code: 499 body: inline_string: "not allowed" body_format: json_format: status: "%RESPONSE_CODE%" message: "%LOCAL_REPLY_BODY%" response_headers_to_add: - header: key: "foo" value: "x-bar" # Redirect to different upstream if the status code is one of 502, 503 or 504. - predicate: or_matcher: predicate: - single_predicate: input: name: "502_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "502" - single_predicate: input: name: "503_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "503" - single_predicate: input: name: "504_response" typed_config: "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput value_match: exact: "504" on_match: action: name: action typed_config: "@type": type.googleapis.com/envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy status_code: 299 uri: "https://foo.example/gateway_error" response_headers_to_add: - header: key: "foo2" value: "x-bar2" -- attention:: The first matched policy wins. Once the response is matched, matcher evaluations end. Refer to :ref:`Unified Matcher API <envoy_v3_api_msg_.xds.type.matcher.v3.Matcher>` documentation for more information on the matcher trees. [#extension-category: envoy.http.custom_response].xds.type.matcher.v3.Matcher custom_response_matcher = 1;- Specified by:
getCustomResponseMatcherOrBuilderin interfaceCustomResponseOrBuilder
-
setUnknownFields
public final CustomResponse.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
-
mergeUnknownFields
public final CustomResponse.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<CustomResponse.Builder>
-