类 VirtualServiceOuterClass.HTTPRedirect.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
istio.networking.v1alpha3.VirtualServiceOuterClass.HTTPRedirect.Builder
- 所有已实现的接口:
com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,VirtualServiceOuterClass.HTTPRedirectOrBuilder,Cloneable
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-
方法概要
修饰符和类型方法说明addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) build()clear()On a redirect, overwrite the Authority/Host portion of the URL with this value.clearField(com.google.protobuf.Descriptors.FieldDescriptor field) clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) On a redirect, Specifies the HTTP status code to use in the redirect response.clearUri()On a redirect, overwrite the Path portion of the URL with this value.clone()On a redirect, overwrite the Authority/Host portion of the URL with this value.com.google.protobuf.ByteStringOn a redirect, overwrite the Authority/Host portion of the URL with this value.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorintOn a redirect, Specifies the HTTP status code to use in the redirect response.getUri()On a redirect, overwrite the Path portion of the URL with this value.com.google.protobuf.ByteStringOn a redirect, overwrite the Path portion of the URL with this value.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) setAuthority(String value) On a redirect, overwrite the Authority/Host portion of the URL with this value.setAuthorityBytes(com.google.protobuf.ByteString value) On a redirect, overwrite the Authority/Host portion of the URL with this value.setRedirectCode(int value) On a redirect, Specifies the HTTP status code to use in the redirect response.setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) On a redirect, overwrite the Path portion of the URL with this value.setUriBytes(com.google.protobuf.ByteString value) On a redirect, overwrite the Path portion of the URL with this value.从类继承的方法 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, setUnknownFieldsProto3从类继承的方法 com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString从类继承的方法 com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException从接口继承的方法 com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFrom从接口继承的方法 com.google.protobuf.MessageLite.Builder
mergeFrom从接口继承的方法 com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
方法详细资料
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- 指定者:
internalGetFieldAccessorTable在类中com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-
clear
- 指定者:
clear在接口中com.google.protobuf.Message.Builder- 指定者:
clear在接口中com.google.protobuf.MessageLite.Builder- 覆盖:
clear在类中com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- 指定者:
getDescriptorForType在接口中com.google.protobuf.Message.Builder- 指定者:
getDescriptorForType在接口中com.google.protobuf.MessageOrBuilder- 覆盖:
getDescriptorForType在类中com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-
getDefaultInstanceForType
- 指定者:
getDefaultInstanceForType在接口中com.google.protobuf.MessageLiteOrBuilder- 指定者:
getDefaultInstanceForType在接口中com.google.protobuf.MessageOrBuilder
-
build
- 指定者:
build在接口中com.google.protobuf.Message.Builder- 指定者:
build在接口中com.google.protobuf.MessageLite.Builder
-
buildPartial
- 指定者:
buildPartial在接口中com.google.protobuf.Message.Builder- 指定者:
buildPartial在接口中com.google.protobuf.MessageLite.Builder
-
clone
- 指定者:
clone在接口中com.google.protobuf.Message.Builder- 指定者:
clone在接口中com.google.protobuf.MessageLite.Builder- 覆盖:
clone在类中com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-
setField
public VirtualServiceOuterClass.HTTPRedirect.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - 指定者:
setField在接口中com.google.protobuf.Message.Builder- 覆盖:
setField在类中com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-
clearField
public VirtualServiceOuterClass.HTTPRedirect.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) - 指定者:
clearField在接口中com.google.protobuf.Message.Builder- 覆盖:
clearField在类中com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-
clearOneof
public VirtualServiceOuterClass.HTTPRedirect.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) - 指定者:
clearOneof在接口中com.google.protobuf.Message.Builder- 覆盖:
clearOneof在类中com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-
setRepeatedField
public VirtualServiceOuterClass.HTTPRedirect.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) - 指定者:
setRepeatedField在接口中com.google.protobuf.Message.Builder- 覆盖:
setRepeatedField在类中com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-
addRepeatedField
public VirtualServiceOuterClass.HTTPRedirect.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - 指定者:
addRepeatedField在接口中com.google.protobuf.Message.Builder- 覆盖:
addRepeatedField在类中com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-
mergeFrom
- 指定者:
mergeFrom在接口中com.google.protobuf.Message.Builder- 覆盖:
mergeFrom在类中com.google.protobuf.AbstractMessage.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-
mergeFrom
public VirtualServiceOuterClass.HTTPRedirect.Builder mergeFrom(VirtualServiceOuterClass.HTTPRedirect other) -
isInitialized
public final boolean isInitialized()- 指定者:
isInitialized在接口中com.google.protobuf.MessageLiteOrBuilder- 覆盖:
isInitialized在类中com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-
mergeFrom
public VirtualServiceOuterClass.HTTPRedirect.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - 指定者:
mergeFrom在接口中com.google.protobuf.Message.Builder- 指定者:
mergeFrom在接口中com.google.protobuf.MessageLite.Builder- 覆盖:
mergeFrom在类中com.google.protobuf.AbstractMessage.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>- 抛出:
IOException
-
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.HTTPRedirectOrBuilder- 返回:
- The uri.
-
getUriBytes
public 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.HTTPRedirectOrBuilder- 返回:
- The bytes for uri.
-
setUri
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.- 返回:
- This builder for chaining.
-
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;- 返回:
- This builder for chaining.
-
setUriBytes
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.- 返回:
- This builder for chaining.
-
getAuthority
On a redirect, overwrite the Authority/Host portion of the URL with this value.
string authority = 2;- 指定者:
getAuthority在接口中VirtualServiceOuterClass.HTTPRedirectOrBuilder- 返回:
- The authority.
-
getAuthorityBytes
public com.google.protobuf.ByteString getAuthorityBytes()On a redirect, overwrite the Authority/Host portion of the URL with this value.
string authority = 2;- 指定者:
getAuthorityBytes在接口中VirtualServiceOuterClass.HTTPRedirectOrBuilder- 返回:
- The bytes for authority.
-
setAuthority
On a redirect, overwrite the Authority/Host portion of the URL with this value.
string authority = 2;- 参数:
value- The authority to set.- 返回:
- This builder for chaining.
-
clearAuthority
On a redirect, overwrite the Authority/Host portion of the URL with this value.
string authority = 2;- 返回:
- This builder for chaining.
-
setAuthorityBytes
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.- 返回:
- This builder for chaining.
-
getRedirectCode
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.HTTPRedirectOrBuilder- 返回:
- The redirectCode.
-
setRedirectCode
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.- 返回:
- This builder for chaining.
-
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;- 返回:
- This builder for chaining.
-
setUnknownFields
public final VirtualServiceOuterClass.HTTPRedirect.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - 指定者:
setUnknownFields在接口中com.google.protobuf.Message.Builder- 覆盖:
setUnknownFields在类中com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-
mergeUnknownFields
public final VirtualServiceOuterClass.HTTPRedirect.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - 指定者:
mergeUnknownFields在接口中com.google.protobuf.Message.Builder- 覆盖:
mergeUnknownFields在类中com.google.protobuf.GeneratedMessageV3.Builder<VirtualServiceOuterClass.HTTPRedirect.Builder>
-