Reference documentation and code samples for the Google Cloud Network Services V1 Client class RetryPolicy.
The specifications for retries.
Generated from protobuf messagegoogle.cloud.networkservices.v1.HttpRoute.RetryPolicy
Namespace
Google \ Cloud \ NetworkServices \ V1 \ HttpRoute
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ retry_conditions
array
Specifies one or more conditions when this retry policy applies. Valid values are: 5xx: Proxy will attempt a retry if the destination service responds with any 5xx response code, of if the destination service does not respond at all, example: disconnect, reset, read timeout, connection failure and refused streams. gateway-error: Similar to 5xx, but only applies to response codes 502, 503, 504. reset: Proxy will attempt a retry if the destination service does not respond at all (disconnect/reset/read timeout) connect-failure: Proxy will retry on failures connecting to destination for example due to connection timeouts. retriable-4xx: Proxy will retry fro retriable 4xx response codes. Currently the only retriable error supported is 409. refused-stream: Proxy will retry if the destination resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry.
↳ num_retries
int
Specifies the allowed number of retries. This number must be > 0. If not specified, default to 1.
Specifies one or more conditions when this retry policy applies. Valid
values are:
5xx: Proxy will attempt a retry if the destination service responds
with any 5xx response code, of if the destination service does not
respond at all, example: disconnect, reset, read timeout, connection
failure and refused streams.
gateway-error: Similar to 5xx, but only applies to response codes 502,
503, 504.
reset: Proxy will attempt a retry if the destination service does not
respond at all (disconnect/reset/read timeout)
connect-failure: Proxy will retry on failures connecting to destination
for example due to connection timeouts.
retriable-4xx: Proxy will retry fro retriable 4xx response codes.
Currently the only retriable error supported is 409.
refused-stream: Proxy will retry if the destination resets the stream
with a REFUSED_STREAM error code. This reset type indicates that it
is safe to retry.
Specifies one or more conditions when this retry policy applies. Valid
values are:
5xx: Proxy will attempt a retry if the destination service responds
with any 5xx response code, of if the destination service does not
respond at all, example: disconnect, reset, read timeout, connection
failure and refused streams.
gateway-error: Similar to 5xx, but only applies to response codes 502,
503, 504.
reset: Proxy will attempt a retry if the destination service does not
respond at all (disconnect/reset/read timeout)
connect-failure: Proxy will retry on failures connecting to destination
for example due to connection timeouts.
retriable-4xx: Proxy will retry fro retriable 4xx response codes.
Currently the only retriable error supported is 409.
refused-stream: Proxy will retry if the destination resets the stream
with a REFUSED_STREAM error code. This reset type indicates that it
is safe to retry.
Parameter
Name
Description
var
string[]
Returns
Type
Description
$this
getNumRetries
Specifies the allowed number of retries. This number must be > 0. If not
specified, default to 1.
Returns
Type
Description
int
setNumRetries
Specifies the allowed number of retries. This number must be > 0. If not
specified, default to 1.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Network Services V1 Client - Class RetryPolicy (0.6.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.6.1 (latest)](/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.RetryPolicy)\n- [0.6.0](/php/docs/reference/cloud-networkservices/0.6.0/V1.HttpRoute.RetryPolicy)\n- [0.5.0](/php/docs/reference/cloud-networkservices/0.5.0/V1.HttpRoute.RetryPolicy)\n- [0.4.0](/php/docs/reference/cloud-networkservices/0.4.0/V1.HttpRoute.RetryPolicy)\n- [0.3.0](/php/docs/reference/cloud-networkservices/0.3.0/V1.HttpRoute.RetryPolicy)\n- [0.2.3](/php/docs/reference/cloud-networkservices/0.2.3/V1.HttpRoute.RetryPolicy)\n- [0.1.1](/php/docs/reference/cloud-networkservices/0.1.1/V1.HttpRoute.RetryPolicy) \nReference documentation and code samples for the Google Cloud Network Services V1 Client class RetryPolicy.\n\nThe specifications for retries.\n\nGenerated from protobuf message `google.cloud.networkservices.v1.HttpRoute.RetryPolicy`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ NetworkServices \\\\ V1 \\\\ HttpRoute\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getRetryConditions\n\nSpecifies one or more conditions when this retry policy applies. Valid\nvalues are:\n5xx: Proxy will attempt a retry if the destination service responds\nwith any 5xx response code, of if the destination service does not\nrespond at all, example: disconnect, reset, read timeout, connection\nfailure and refused streams.\n\ngateway-error: Similar to 5xx, but only applies to response codes 502,\n503, 504.\nreset: Proxy will attempt a retry if the destination service does not\nrespond at all (disconnect/reset/read timeout)\nconnect-failure: Proxy will retry on failures connecting to destination\nfor example due to connection timeouts.\nretriable-4xx: Proxy will retry fro retriable 4xx response codes.\nCurrently the only retriable error supported is 409.\nrefused-stream: Proxy will retry if the destination resets the stream\nwith a REFUSED_STREAM error code. This reset type indicates that it\nis safe to retry.\n\n### setRetryConditions\n\nSpecifies one or more conditions when this retry policy applies. Valid\nvalues are:\n5xx: Proxy will attempt a retry if the destination service responds\nwith any 5xx response code, of if the destination service does not\nrespond at all, example: disconnect, reset, read timeout, connection\nfailure and refused streams.\n\ngateway-error: Similar to 5xx, but only applies to response codes 502,\n503, 504.\nreset: Proxy will attempt a retry if the destination service does not\nrespond at all (disconnect/reset/read timeout)\nconnect-failure: Proxy will retry on failures connecting to destination\nfor example due to connection timeouts.\nretriable-4xx: Proxy will retry fro retriable 4xx response codes.\nCurrently the only retriable error supported is 409.\nrefused-stream: Proxy will retry if the destination resets the stream\nwith a REFUSED_STREAM error code. This reset type indicates that it\nis safe to retry.\n\n### getNumRetries\n\nSpecifies the allowed number of retries. This number must be \\\u003e 0. If not\nspecified, default to 1.\n\n### setNumRetries\n\nSpecifies the allowed number of retries. This number must be \\\u003e 0. If not\nspecified, default to 1.\n\n### getPerTryTimeout\n\nSpecifies a non-zero timeout per retry attempt.\n\n### hasPerTryTimeout\n\n### clearPerTryTimeout\n\n### setPerTryTimeout\n\nSpecifies a non-zero timeout per retry attempt."]]