- [HTTP request](https://docs.cloud.google.com/functions/docs/reference/rest/v2alpha/projects.locations.functions/redirectFunctionUpgradeTraffic#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/functions/docs/reference/rest/v2alpha/projects.locations.functions/redirectFunctionUpgradeTraffic#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/functions/docs/reference/rest/v2alpha/projects.locations.functions/redirectFunctionUpgradeTraffic#body.request_body)
- [Response body](https://docs.cloud.google.com/functions/docs/reference/rest/v2alpha/projects.locations.functions/redirectFunctionUpgradeTraffic#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/functions/docs/reference/rest/v2alpha/projects.locations.functions/redirectFunctionUpgradeTraffic#body.aspect)
- [Try it!](https://docs.cloud.google.com/functions/docs/reference/rest/v2alpha/projects.locations.functions/redirectFunctionUpgradeTraffic#try-it)

Changes the traffic target of a function from the original 1st Gen function to the 2nd Gen copy. This is the second step of the multi step process to upgrade 1st Gen functions to 2nd Gen. After this operation, all new traffic will be served by 2nd Gen copy.

### HTTP request

`POST https://cloudfunctions.googleapis.com/v2alpha/{name}:redirectFunctionUpgradeTraffic`

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The name of the function for which traffic target should be changed to 2nd Gen from 1st Gen. It takes the form `projects/{project}/locations/{location}/functions/{function}`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `name`: - `cloudfunctions.functions.generationUpgrade` |

### Request body

The request body must be empty.

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/functions/docs/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).