Class CustomResponse
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite
-
- com.google.protobuf.AbstractMessage
-
- com.google.protobuf.GeneratedMessageV3
-
- io.envoyproxy.envoy.extensions.filters.http.custom_response.v3.CustomResponse
-
- All Implemented Interfaces:
com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,CustomResponseOrBuilder,Serializable
public final class CustomResponse extends com.google.protobuf.GeneratedMessageV3 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 typeenvoy.extensions.filters.http.custom_response.v3.CustomResponse- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCustomResponse.BuilderThe filter configuration is a collection of custom response policies in a matcher tree.-
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
-
-
Field Summary
Fields Modifier and Type Field Description static intCUSTOM_RESPONSE_MATCHER_FIELD_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)MatchergetCustomResponseMatcher()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.MatcherOrBuildergetCustomResponseMatcherOrBuilder()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 CustomResponsegetDefaultInstance()CustomResponsegetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Parser<CustomResponse>getParserForType()intgetSerializedSize()com.google.protobuf.UnknownFieldSetgetUnknownFields()booleanhasCustomResponseMatcher()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.inthashCode()protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()static CustomResponse.BuildernewBuilder()static CustomResponse.BuildernewBuilder(CustomResponse prototype)CustomResponse.BuildernewBuilderForType()protected CustomResponse.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)static CustomResponseparseDelimitedFrom(InputStream input)static CustomResponseparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static CustomResponseparseFrom(byte[] data)static CustomResponseparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static CustomResponseparseFrom(com.google.protobuf.ByteString data)static CustomResponseparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static CustomResponseparseFrom(com.google.protobuf.CodedInputStream input)static CustomResponseparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static CustomResponseparseFrom(InputStream input)static CustomResponseparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static CustomResponseparseFrom(ByteBuffer data)static CustomResponseparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static com.google.protobuf.Parser<CustomResponse>parser()CustomResponse.BuildertoBuilder()voidwriteTo(com.google.protobuf.CodedOutputStream output)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
-
Methods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
CUSTOM_RESPONSE_MATCHER_FIELD_NUMBER
public static final int CUSTOM_RESPONSE_MATCHER_FIELD_NUMBER
- See Also:
- Constant Field Values
-
-
Method Detail
-
newInstance
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getUnknownFields
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
- Specified by:
getUnknownFieldsin interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3
-
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
-
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
public Matcher 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.
-
getCustomResponseMatcherOrBuilder
public MatcherOrBuilder 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
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static CustomResponse parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static CustomResponse parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static CustomResponse parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static CustomResponse parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static CustomResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static CustomResponse parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static CustomResponse parseFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static CustomResponse parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static CustomResponse parseDelimitedFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static CustomResponse parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseFrom
public static CustomResponse parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static CustomResponse parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
newBuilderForType
public CustomResponse.Builder newBuilderForType()
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
public static CustomResponse.Builder newBuilder()
-
newBuilder
public static CustomResponse.Builder newBuilder(CustomResponse prototype)
-
toBuilder
public CustomResponse.Builder toBuilder()
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected CustomResponse.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
public static CustomResponse getDefaultInstance()
-
parser
public static com.google.protobuf.Parser<CustomResponse> parser()
-
getParserForType
public com.google.protobuf.Parser<CustomResponse> getParserForType()
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public CustomResponse getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
-