Class HttpRetryPolicy.Builder (1.54.0)

public static final class HttpRetryPolicy.Builder extends GeneratedMessageV3.Builder<HttpRetryPolicy.Builder> implements HttpRetryPolicyOrBuilder

The retry policy associates with HttpRouteRule

Protobuf type google.cloud.compute.v1.HttpRetryPolicy

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllRetryConditions(Iterable<String> values)

public HttpRetryPolicy.Builder addAllRetryConditions(Iterable<String> values)

Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable

repeated string retry_conditions = 28815535;

Parameter
Name Description
values Iterable<String>

The retryConditions to add.

Returns
Type Description
HttpRetryPolicy.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public HttpRetryPolicy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
HttpRetryPolicy.Builder
Overrides

addRetryConditions(String value)

public HttpRetryPolicy.Builder addRetryConditions(String value)

Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable

repeated string retry_conditions = 28815535;

Parameter
Name Description
value String

The retryConditions to add.

Returns
Type Description
HttpRetryPolicy.Builder

This builder for chaining.

addRetryConditionsBytes(ByteString value)

public HttpRetryPolicy.Builder addRetryConditionsBytes(ByteString value)

Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable

repeated string retry_conditions = 28815535;

Parameter
Name Description
value ByteString

The bytes of the retryConditions to add.

Returns
Type Description
HttpRetryPolicy.Builder

This builder for chaining.

build()

public HttpRetryPolicy build()
Returns
Type Description
HttpRetryPolicy

buildPartial()

public HttpRetryPolicy buildPartial()
Returns
Type Description
HttpRetryPolicy

clear()

public HttpRetryPolicy.Builder clear()
Returns
Type Description
HttpRetryPolicy.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public HttpRetryPolicy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
HttpRetryPolicy.Builder
Overrides

clearNumRetries()

public HttpRetryPolicy.Builder clearNumRetries()

Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1.

optional uint32 num_retries = 251680141;

Returns
Type Description
HttpRetryPolicy.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public HttpRetryPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
HttpRetryPolicy.Builder
Overrides

clearPerTryTimeout()

public HttpRetryPolicy.Builder clearPerTryTimeout()

Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.

optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;

Returns
Type Description
HttpRetryPolicy.Builder

clearRetryConditions()

public HttpRetryPolicy.Builder clearRetryConditions()

Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable

repeated string retry_conditions = 28815535;

Returns
Type Description
HttpRetryPolicy.Builder

This builder for chaining.

clone()

public HttpRetryPolicy.Builder clone()
Returns
Type Description
HttpRetryPolicy.Builder
Overrides

getDefaultInstanceForType()

public HttpRetryPolicy getDefaultInstanceForType()
Returns
Type Description
HttpRetryPolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getNumRetries()

public int getNumRetries()

Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1.

optional uint32 num_retries = 251680141;

Returns
Type Description
int

The numRetries.

getPerTryTimeout()

public Duration getPerTryTimeout()

Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.

optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;

Returns
Type Description
Duration

The perTryTimeout.

getPerTryTimeoutBuilder()

public Duration.Builder getPerTryTimeoutBuilder()

Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.

optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;

Returns
Type Description
Duration.Builder

getPerTryTimeoutOrBuilder()

public DurationOrBuilder getPerTryTimeoutOrBuilder()

Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.

optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;

Returns
Type Description
DurationOrBuilder

getRetryConditions(int index)

public String getRetryConditions(int index)

Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable

repeated string retry_conditions = 28815535;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The retryConditions at the given index.

getRetryConditionsBytes(int index)

public ByteString getRetryConditionsBytes(int index)

Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable

repeated string retry_conditions = 28815535;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the retryConditions at the given index.

getRetryConditionsCount()

public int getRetryConditionsCount()

Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable

repeated string retry_conditions = 28815535;

Returns
Type Description
int

The count of retryConditions.

getRetryConditionsList()

public ProtocolStringList getRetryConditionsList()

Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable

repeated string retry_conditions = 28815535;

Returns
Type Description
ProtocolStringList

A list containing the retryConditions.

hasNumRetries()

public boolean hasNumRetries()

Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1.

optional uint32 num_retries = 251680141;

Returns
Type Description
boolean

Whether the numRetries field is set.

hasPerTryTimeout()

public boolean hasPerTryTimeout()

Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.

optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;

Returns
Type Description
boolean

Whether the perTryTimeout field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(HttpRetryPolicy other)

public HttpRetryPolicy.Builder mergeFrom(HttpRetryPolicy other)
Parameter
Name Description
other HttpRetryPolicy
Returns
Type Description
HttpRetryPolicy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public HttpRetryPolicy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
HttpRetryPolicy.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public HttpRetryPolicy.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
HttpRetryPolicy.Builder
Overrides

mergePerTryTimeout(Duration value)

public HttpRetryPolicy.Builder mergePerTryTimeout(Duration value)

Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.

optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;

Parameter
Name Description
value Duration
Returns
Type Description
HttpRetryPolicy.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final HttpRetryPolicy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
HttpRetryPolicy.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public HttpRetryPolicy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
HttpRetryPolicy.Builder
Overrides

setNumRetries(int value)

public HttpRetryPolicy.Builder setNumRetries(int value)

Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1.

optional uint32 num_retries = 251680141;

Parameter
Name Description
value int

The numRetries to set.

Returns
Type Description
HttpRetryPolicy.Builder

This builder for chaining.

setPerTryTimeout(Duration value)

public HttpRetryPolicy.Builder setPerTryTimeout(Duration value)

Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.

optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;

Parameter
Name Description
value Duration
Returns
Type Description
HttpRetryPolicy.Builder

setPerTryTimeout(Duration.Builder builderForValue)

public HttpRetryPolicy.Builder setPerTryTimeout(Duration.Builder builderForValue)

Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.

optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;

Parameter
Name Description
builderForValue Duration.Builder
Returns
Type Description
HttpRetryPolicy.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public HttpRetryPolicy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
HttpRetryPolicy.Builder
Overrides

setRetryConditions(int index, String value)

public HttpRetryPolicy.Builder setRetryConditions(int index, String value)

Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable

repeated string retry_conditions = 28815535;

Parameters
Name Description
index int

The index to set the value at.

value String

The retryConditions to set.

Returns
Type Description
HttpRetryPolicy.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final HttpRetryPolicy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
HttpRetryPolicy.Builder
Overrides