- [HTTP request](https://docs.cloud.google.com/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/alterLocation#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/alterLocation#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/alterLocation#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/alterLocation#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/alterLocation#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/alterLocation#body.aspect)
- [Examples](https://docs.cloud.google.com/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/alterLocation#examples)
- [Try it!](https://docs.cloud.google.com/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/alterLocation#try-it)

Alter metadata resource location. The metadata resource can be a database, table, or partition. This functionality only updates the parent directory for the respective metadata resource and does not transfer any existing data to the new location.

### HTTP request

`POST https://metastore.googleapis.com/v1/{service}:alterLocation`

### Path parameters

| Parameters ||
|---|---|
| `service` | `string` Required. The relative resource name of the metastore service to mutate metadata, in the following format: `projects/{projectId}/locations/{locationId}/services/{serviceId}`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `service`: - `metastore.services.mutateMetadata` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "resourceName": string, "locationUri": string } ``` |

| Fields ||
|---|---|
| `resourceName` | `string` Required. The relative metadata resource name in the following format. `databases/{database_id}` or `databases/{database_id}/tables/{table_id}` or `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` |
| `locationUri` | `string` Required. The new location URI for the metadata resource. |

### Response body

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