public static final class VirtualServiceOuterClass.HTTPRedirect.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder> implements VirtualServiceOuterClass.HTTPRedirectOrBuilder
HTTPRedirect can be used to send a 301 redirect response to the caller,
where the Authority/Host and the URI in the response can be swapped with
the specified values. For example, the following rule redirects
requests for /v1/getProductRatings API on the ratings service to
/v1/bookRatings provided by the bookratings service.
{{<tabset category-name="example">}}
{{<tab name="v1alpha3" category-value="v1alpha3">}}
```yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: ratings-route
spec:
hosts:
- ratings.prod.svc.cluster.local
http:
- match:
- uri:
exact: /v1/getProductRatings
redirect:
uri: /v1/bookRatings
authority: newratings.default.svc.cluster.local
...
```
{{</tab>}}
{{<tab name="v1beta1" category-value="v1beta1">}}
```yaml
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: ratings-route
spec:
hosts:
- ratings.prod.svc.cluster.local
http:
- match:
- uri:
exact: /v1/getProductRatings
redirect:
uri: /v1/bookRatings
authority: newratings.default.svc.cluster.local
...
```
{{</tab>}}
{{</tabset>}}
Protobuf type istio.networking.v1alpha3.HTTPRedirect| 限定符和类型 | 方法和说明 |
|---|---|
VirtualServiceOuterClass.HTTPRedirect.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
VirtualServiceOuterClass.HTTPRedirect |
build() |
VirtualServiceOuterClass.HTTPRedirect |
buildPartial() |
VirtualServiceOuterClass.HTTPRedirect.Builder |
clear() |
VirtualServiceOuterClass.HTTPRedirect.Builder |
clearAuthority()
On a redirect, overwrite the Authority/Host portion of the URL with
this value.
|
VirtualServiceOuterClass.HTTPRedirect.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
VirtualServiceOuterClass.HTTPRedirect.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
VirtualServiceOuterClass.HTTPRedirect.Builder |
clearRedirectCode()
On a redirect, Specifies the HTTP status code to use in the redirect
response.
|
VirtualServiceOuterClass.HTTPRedirect.Builder |
clearUri()
On a redirect, overwrite the Path portion of the URL with this
value.
|
VirtualServiceOuterClass.HTTPRedirect.Builder |
clone() |
String |
getAuthority()
On a redirect, overwrite the Authority/Host portion of the URL with
this value.
|
com.google.protobuf.ByteString |
getAuthorityBytes()
On a redirect, overwrite the Authority/Host portion of the URL with
this value.
|
VirtualServiceOuterClass.HTTPRedirect |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
int |
getRedirectCode()
On a redirect, Specifies the HTTP status code to use in the redirect
response.
|
String |
getUri()
On a redirect, overwrite the Path portion of the URL with this
value.
|
com.google.protobuf.ByteString |
getUriBytes()
On a redirect, overwrite the Path portion of the URL with this
value.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
VirtualServiceOuterClass.HTTPRedirect.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
VirtualServiceOuterClass.HTTPRedirect.Builder |
mergeFrom(com.google.protobuf.Message other) |
VirtualServiceOuterClass.HTTPRedirect.Builder |
mergeFrom(VirtualServiceOuterClass.HTTPRedirect other) |
VirtualServiceOuterClass.HTTPRedirect.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
VirtualServiceOuterClass.HTTPRedirect.Builder |
setAuthority(String value)
On a redirect, overwrite the Authority/Host portion of the URL with
this value.
|
VirtualServiceOuterClass.HTTPRedirect.Builder |
setAuthorityBytes(com.google.protobuf.ByteString value)
On a redirect, overwrite the Authority/Host portion of the URL with
this value.
|
VirtualServiceOuterClass.HTTPRedirect.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
VirtualServiceOuterClass.HTTPRedirect.Builder |
setRedirectCode(int value)
On a redirect, Specifies the HTTP status code to use in the redirect
response.
|
VirtualServiceOuterClass.HTTPRedirect.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
VirtualServiceOuterClass.HTTPRedirect.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
VirtualServiceOuterClass.HTTPRedirect.Builder |
setUri(String value)
On a redirect, overwrite the Path portion of the URL with this
value.
|
VirtualServiceOuterClass.HTTPRedirect.Builder |
setUriBytes(com.google.protobuf.ByteString value)
On a redirect, overwrite the Path portion of the URL with this
value.
|
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable 在类中 com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>public VirtualServiceOuterClass.HTTPRedirect.Builder clear()
clear 在接口中 com.google.protobuf.Message.Builderclear 在接口中 com.google.protobuf.MessageLite.Builderclear 在类中 com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType 在接口中 com.google.protobuf.Message.BuildergetDescriptorForType 在接口中 com.google.protobuf.MessageOrBuildergetDescriptorForType 在类中 com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>public VirtualServiceOuterClass.HTTPRedirect getDefaultInstanceForType()
getDefaultInstanceForType 在接口中 com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType 在接口中 com.google.protobuf.MessageOrBuilderpublic VirtualServiceOuterClass.HTTPRedirect build()
build 在接口中 com.google.protobuf.Message.Builderbuild 在接口中 com.google.protobuf.MessageLite.Builderpublic VirtualServiceOuterClass.HTTPRedirect buildPartial()
buildPartial 在接口中 com.google.protobuf.Message.BuilderbuildPartial 在接口中 com.google.protobuf.MessageLite.Builderpublic VirtualServiceOuterClass.HTTPRedirect.Builder clone()
clone 在接口中 com.google.protobuf.Message.Builderclone 在接口中 com.google.protobuf.MessageLite.Builderclone 在类中 com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>public VirtualServiceOuterClass.HTTPRedirect.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField 在接口中 com.google.protobuf.Message.BuildersetField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>public VirtualServiceOuterClass.HTTPRedirect.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField 在接口中 com.google.protobuf.Message.BuilderclearField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>public VirtualServiceOuterClass.HTTPRedirect.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof 在接口中 com.google.protobuf.Message.BuilderclearOneof 在类中 com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>public VirtualServiceOuterClass.HTTPRedirect.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField 在接口中 com.google.protobuf.Message.BuildersetRepeatedField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>public VirtualServiceOuterClass.HTTPRedirect.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField 在接口中 com.google.protobuf.Message.BuilderaddRepeatedField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>public VirtualServiceOuterClass.HTTPRedirect.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom 在接口中 com.google.protobuf.Message.BuildermergeFrom 在类中 com.google.protobuf.AbstractMessage.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>public VirtualServiceOuterClass.HTTPRedirect.Builder mergeFrom(VirtualServiceOuterClass.HTTPRedirect other)
public final boolean isInitialized()
isInitialized 在接口中 com.google.protobuf.MessageLiteOrBuilderisInitialized 在类中 com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>public VirtualServiceOuterClass.HTTPRedirect.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom 在接口中 com.google.protobuf.Message.BuildermergeFrom 在接口中 com.google.protobuf.MessageLite.BuildermergeFrom 在类中 com.google.protobuf.AbstractMessage.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>IOExceptionpublic String getUri()
On a redirect, overwrite the Path portion of the URL with this value. Note that the entire path will be replaced, irrespective of the request URI being matched as an exact path or prefix.
string uri = 1;getUri 在接口中 VirtualServiceOuterClass.HTTPRedirectOrBuilderpublic com.google.protobuf.ByteString getUriBytes()
On a redirect, overwrite the Path portion of the URL with this value. Note that the entire path will be replaced, irrespective of the request URI being matched as an exact path or prefix.
string uri = 1;getUriBytes 在接口中 VirtualServiceOuterClass.HTTPRedirectOrBuilderpublic VirtualServiceOuterClass.HTTPRedirect.Builder setUri(String value)
On a redirect, overwrite the Path portion of the URL with this value. Note that the entire path will be replaced, irrespective of the request URI being matched as an exact path or prefix.
string uri = 1;value - The uri to set.public VirtualServiceOuterClass.HTTPRedirect.Builder clearUri()
On a redirect, overwrite the Path portion of the URL with this value. Note that the entire path will be replaced, irrespective of the request URI being matched as an exact path or prefix.
string uri = 1;public VirtualServiceOuterClass.HTTPRedirect.Builder setUriBytes(com.google.protobuf.ByteString value)
On a redirect, overwrite the Path portion of the URL with this value. Note that the entire path will be replaced, irrespective of the request URI being matched as an exact path or prefix.
string uri = 1;value - The bytes for uri to set.public String getAuthority()
On a redirect, overwrite the Authority/Host portion of the URL with this value.
string authority = 2;getAuthority 在接口中 VirtualServiceOuterClass.HTTPRedirectOrBuilderpublic com.google.protobuf.ByteString getAuthorityBytes()
On a redirect, overwrite the Authority/Host portion of the URL with this value.
string authority = 2;getAuthorityBytes 在接口中 VirtualServiceOuterClass.HTTPRedirectOrBuilderpublic VirtualServiceOuterClass.HTTPRedirect.Builder setAuthority(String value)
On a redirect, overwrite the Authority/Host portion of the URL with this value.
string authority = 2;value - The authority to set.public VirtualServiceOuterClass.HTTPRedirect.Builder clearAuthority()
On a redirect, overwrite the Authority/Host portion of the URL with this value.
string authority = 2;public VirtualServiceOuterClass.HTTPRedirect.Builder setAuthorityBytes(com.google.protobuf.ByteString value)
On a redirect, overwrite the Authority/Host portion of the URL with this value.
string authority = 2;value - The bytes for authority to set.public int getRedirectCode()
On a redirect, Specifies the HTTP status code to use in the redirect response. The default response code is MOVED_PERMANENTLY (301).
uint32 redirect_code = 3;getRedirectCode 在接口中 VirtualServiceOuterClass.HTTPRedirectOrBuilderpublic VirtualServiceOuterClass.HTTPRedirect.Builder setRedirectCode(int value)
On a redirect, Specifies the HTTP status code to use in the redirect response. The default response code is MOVED_PERMANENTLY (301).
uint32 redirect_code = 3;value - The redirectCode to set.public VirtualServiceOuterClass.HTTPRedirect.Builder clearRedirectCode()
On a redirect, Specifies the HTTP status code to use in the redirect response. The default response code is MOVED_PERMANENTLY (301).
uint32 redirect_code = 3;public final VirtualServiceOuterClass.HTTPRedirect.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields 在接口中 com.google.protobuf.Message.BuildersetUnknownFields 在类中 com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>public final VirtualServiceOuterClass.HTTPRedirect.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields 在接口中 com.google.protobuf.Message.BuildermergeUnknownFields 在类中 com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>Copyright © 2018–2023 Alibaba Group. All rights reserved.