# Google Cloud Network Services V1 Client - Class RouteAction (0.8.2)

0.8.2 (latest) 0.8.1 0.7.1 0.6.1 0.5.0 0.4.0 0.3.0 0.2.3 0.1.1 Reference documentation and code samples for the Google Cloud Network Services V1 Client class RouteAction.

The specifications for routing traffic and applying associated policies.

Generated from protobuf message `google.cloud.networkservices.v1.HttpRoute.RouteAction`

## Namespace

Google \\ Cloud \\ NetworkServices \\ V1 \\ HttpRoute

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ destinations` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.Destination>` The destination to which traffic should be forwarded. |
| `↳ redirect` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.Redirect` If set, the request is directed as configured by this field. |
| `↳ fault_injection_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.FaultInjectionPolicy` The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced on a percentage of requests before sending those requests to the backend service. Similarly requests from clients can be aborted for a percentage of requests. timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy |
| `↳ request_header_modifier` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.HeaderModifier` The specification for modifying the headers of a matching request prior to delivery of the request to the destination. If HeaderModifiers are set on both the Destination and the RouteAction, they will be merged. Conflicts between the two will not be resolved on the configuration. |
| `↳ response_header_modifier` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.HeaderModifier` The specification for modifying the headers of a response prior to sending the response back to the client. If HeaderModifiers are set on both the Destination and the RouteAction, they will be merged. Conflicts between the two will not be resolved on the configuration. |
| `↳ url_rewrite` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.URLRewrite` The specification for rewrite URL before forwarding requests to the destination. |
| `↳ timeout` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Specifies the timeout for selected route. Timeout is computed from the time the request has been fully processed (i.e. end of stream) up until the response has been completely processed. Timeout includes all retries. |
| `↳ retry_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.RetryPolicy` Specifies the retry policy associated with this route. |
| `↳ request_mirror_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.RequestMirrorPolicy` Specifies the policy on how requests intended for the routes destination are shadowed to a separate mirrored destination. Proxy will not wait for the shadow destination to respond before returning the response. Prior to sending traffic to the shadow service, the host/authority header is suffixed with -shadow. |
| `↳ cors_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.CorsPolicy` The specification for allowing client side cross-origin requests. |
| `↳ stateful_session_affinity` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.StatefulSessionAffinityPolicy` Optional. Specifies cookie-based stateful session affinity. |
| `↳ direct_response` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.HttpDirectResponse` Optional. Static HTTP Response object to be returned regardless of the request. |
| `↳ idle_timeout` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Optional. Specifies the idle timeout for the selected route. The idle timeout is defined as the period in which there are no bytes sent or received on either the upstream or downstream connection. If not set, the default idle timeout is 1 hour. If set to 0s, the timeout will be disabled. |

### getDestinations

The destination to which traffic should be forwarded.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.Destination>` |   |

### setDestinations

The destination to which traffic should be forwarded.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.Destination>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRedirect

If set, the request is directed as configured by this field.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.Redirect|null` |   |

### hasRedirect

### clearRedirect

### setRedirect

If set, the request is directed as configured by this field.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.Redirect` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFaultInjectionPolicy

The specification for fault injection introduced into traffic to test the
resiliency of clients to backend service failure. As part of fault
injection, when clients send requests to a backend service, delays can be
introduced on a percentage of requests before sending those requests to
the backend service. Similarly requests from clients can be aborted for a
percentage of requests.

timeout and retry_policy will be ignored by clients that are configured
with a fault_injection_policy

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.FaultInjectionPolicy|null` |   |

### hasFaultInjectionPolicy

### clearFaultInjectionPolicy

### setFaultInjectionPolicy

The specification for fault injection introduced into traffic to test the
resiliency of clients to backend service failure. As part of fault
injection, when clients send requests to a backend service, delays can be
introduced on a percentage of requests before sending those requests to
the backend service. Similarly requests from clients can be aborted for a
percentage of requests.

timeout and retry_policy will be ignored by clients that are configured
with a fault_injection_policy

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.FaultInjectionPolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRequestHeaderModifier

The specification for modifying the headers of a matching request prior
to delivery of the request to the destination. If HeaderModifiers are set
on both the Destination and the RouteAction, they will be merged.

Conflicts between the two will not be resolved on the configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.HeaderModifier|null` |   |

### hasRequestHeaderModifier

### clearRequestHeaderModifier

### setRequestHeaderModifier

The specification for modifying the headers of a matching request prior
to delivery of the request to the destination. If HeaderModifiers are set
on both the Destination and the RouteAction, they will be merged.

Conflicts between the two will not be resolved on the configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.HeaderModifier` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResponseHeaderModifier

The specification for modifying the headers of a response prior to
sending the response back to the client. If HeaderModifiers are set
on both the Destination and the RouteAction, they will be merged.

Conflicts between the two will not be resolved on the configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.HeaderModifier|null` |   |

### hasResponseHeaderModifier

### clearResponseHeaderModifier

### setResponseHeaderModifier

The specification for modifying the headers of a response prior to
sending the response back to the client. If HeaderModifiers are set
on both the Destination and the RouteAction, they will be merged.

Conflicts between the two will not be resolved on the configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.HeaderModifier` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUrlRewrite

The specification for rewrite URL before forwarding requests to the
destination.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.URLRewrite|null` |   |

### hasUrlRewrite

### clearUrlRewrite

### setUrlRewrite

The specification for rewrite URL before forwarding requests to the
destination.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.URLRewrite` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTimeout

Specifies the timeout for selected route. Timeout is computed from the
time the request has been fully processed (i.e. end of stream) up until
the response has been completely processed. Timeout includes all retries.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasTimeout

### clearTimeout

### setTimeout

Specifies the timeout for selected route. Timeout is computed from the
time the request has been fully processed (i.e. end of stream) up until
the response has been completely processed. Timeout includes all retries.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRetryPolicy

Specifies the retry policy associated with this route.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.RetryPolicy|null` |   |

### hasRetryPolicy

### clearRetryPolicy

### setRetryPolicy

Specifies the retry policy associated with this route.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.RetryPolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRequestMirrorPolicy

Specifies the policy on how requests intended for the routes destination
are shadowed to a separate mirrored destination. Proxy will not wait for
the shadow destination to respond before returning the response. Prior to
sending traffic to the shadow service, the host/authority header is
suffixed with -shadow.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.RequestMirrorPolicy|null` |   |

### hasRequestMirrorPolicy

### clearRequestMirrorPolicy

### setRequestMirrorPolicy

Specifies the policy on how requests intended for the routes destination
are shadowed to a separate mirrored destination. Proxy will not wait for
the shadow destination to respond before returning the response. Prior to
sending traffic to the shadow service, the host/authority header is
suffixed with -shadow.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.RequestMirrorPolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCorsPolicy

The specification for allowing client side cross-origin requests.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.CorsPolicy|null` |   |

### hasCorsPolicy

### clearCorsPolicy

### setCorsPolicy

The specification for allowing client side cross-origin requests.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.CorsPolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStatefulSessionAffinity

Optional. Specifies cookie-based stateful session affinity.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.StatefulSessionAffinityPolicy|null` |   |

### hasStatefulSessionAffinity

### clearStatefulSessionAffinity

### setStatefulSessionAffinity

Optional. Specifies cookie-based stateful session affinity.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.StatefulSessionAffinityPolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDirectResponse

Optional. Static HTTP Response object to be returned regardless of the
request.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.HttpDirectResponse|null` |   |

### hasDirectResponse

### clearDirectResponse

### setDirectResponse

Optional. Static HTTP Response object to be returned regardless of the
request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.HttpDirectResponse` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getIdleTimeout

Optional. Specifies the idle timeout for the selected route. The idle
timeout is defined as the period in which there are no bytes sent or
received on either the upstream or downstream connection. If not set, the
default idle timeout is 1 hour. If set to 0s, the timeout will be
disabled.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasIdleTimeout

### clearIdleTimeout

### setIdleTimeout

Optional. Specifies the idle timeout for the selected route. The idle
timeout is defined as the period in which there are no bytes sent or
received on either the upstream or downstream connection. If not set, the
default idle timeout is 1 hour. If set to 0s, the timeout will be
disabled.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |