# Method: projects.locations.instances.failover

- [HTTP request](https://docs.cloud.google.com/memorystore/docs/redis/reference/rest/v1beta1/projects.locations.instances/failover#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/memorystore/docs/redis/reference/rest/v1beta1/projects.locations.instances/failover#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/memorystore/docs/redis/reference/rest/v1beta1/projects.locations.instances/failover#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/memorystore/docs/redis/reference/rest/v1beta1/projects.locations.instances/failover#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/memorystore/docs/redis/reference/rest/v1beta1/projects.locations.instances/failover#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/memorystore/docs/redis/reference/rest/v1beta1/projects.locations.instances/failover#body.aspect)
- [DataProtectionMode](https://docs.cloud.google.com/memorystore/docs/redis/reference/rest/v1beta1/projects.locations.instances/failover#DataProtectionMode)
- [Examples](https://docs.cloud.google.com/memorystore/docs/redis/reference/rest/v1beta1/projects.locations.instances/failover#examples)
- [Try it!](https://docs.cloud.google.com/memorystore/docs/redis/reference/rest/v1beta1/projects.locations.instances/failover#try-it)

Initiates a failover of the primary node to current replica node for a specific STANDARD tier Cloud Memorystore for Redis instance.

### HTTP request

`POST https://redis.googleapis.com/v1beta1/{name=projects/*/locations/*/instances/*}:failover`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. Redis instance resource name using the form: `projects/{projectId}/locations/{locationId}/instances/{instanceId}` where `locationId` refers to a GCP region. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "dataProtectionMode": enum (`https://docs.cloud.google.com/memorystore/docs/redis/reference/rest/v1beta1/projects.locations.instances/failover#DataProtectionMode`) } ``` |

| Fields ||
|---|---|
| `dataProtectionMode` | ``enum (`https://docs.cloud.google.com/memorystore/docs/redis/reference/rest/v1beta1/projects.locations.instances/failover#DataProtectionMode`)`` Optional. Available data protection modes that the user can choose. If it's unspecified, data protection mode will be LIMITED_DATA_LOSS by default. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/memorystore/docs/redis/reference/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

## DataProtectionMode

Specifies different modes of operation in relation to the data retention.

| Enums ||
|---|---|
| `DATA_PROTECTION_MODE_UNSPECIFIED` | Defaults to LIMITED_DATA_LOSS if a data protection mode is not specified. |
| `LIMITED_DATA_LOSS` | Instance failover will be protected with data loss control. More specifically, the failover will only be performed if the current replication offset diff between primary and replica is under a certain threshold. |
| `FORCE_DATA_LOSS` | Instance failover will be performed without data loss control. |