Class HttpRetryPolicy.Builder (1.13.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
TypeDescription
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
NameDescription
valuesIterable<String>

The retryConditions to add.

Returns
TypeDescription
HttpRetryPolicy.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public HttpRetryPolicy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The retryConditions to add.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes of the retryConditions to add.

Returns
TypeDescription
HttpRetryPolicy.Builder

This builder for chaining.

build()

public HttpRetryPolicy build()
Returns
TypeDescription
HttpRetryPolicy

buildPartial()

public HttpRetryPolicy buildPartial()
Returns
TypeDescription
HttpRetryPolicy

clear()

public HttpRetryPolicy.Builder clear()
Returns
TypeDescription
HttpRetryPolicy.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public HttpRetryPolicy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
HttpRetryPolicy.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public HttpRetryPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
HttpRetryPolicy.Builder

This builder for chaining.

clone()

public HttpRetryPolicy.Builder clone()
Returns
TypeDescription
HttpRetryPolicy.Builder
Overrides

getDefaultInstanceForType()

public HttpRetryPolicy getDefaultInstanceForType()
Returns
TypeDescription
HttpRetryPolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the perTryTimeout field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(HttpRetryPolicy other)

public HttpRetryPolicy.Builder mergeFrom(HttpRetryPolicy other)
Parameter
NameDescription
otherHttpRetryPolicy
Returns
TypeDescription
HttpRetryPolicy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public HttpRetryPolicy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
HttpRetryPolicy.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public HttpRetryPolicy.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valueDuration
Returns
TypeDescription
HttpRetryPolicy.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final HttpRetryPolicy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
HttpRetryPolicy.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public HttpRetryPolicy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueint

The numRetries to set.

Returns
TypeDescription
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
NameDescription
valueDuration
Returns
TypeDescription
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
NameDescription
builderForValueDuration.Builder
Returns
TypeDescription
HttpRetryPolicy.Builder

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

public HttpRetryPolicy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueString

The retryConditions to set.

Returns
TypeDescription
HttpRetryPolicy.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final HttpRetryPolicy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
HttpRetryPolicy.Builder
Overrides