Sets the access control policy on a database or backup resource. Replaces any existing policy.
Authorization requires spanner.databases.setIamPolicy
permission on resource
. For backups, authorization requires spanner.backups.setIamPolicy
permission on resource
. For backup schedules, authorization requires spanner.backupSchedules.setIamPolicy
permission on resource
.
HTTP request
The URLs use gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
resource
|
REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{
"policy"
:
{
object (
|
| Fields | |
|---|---|
policy
|
REQUIRED: The complete policy to be applied to the |
Response body
If successful, the response body contains an instance of Policy
.
Authorization scopes
Requires one of the following OAuth scopes:
-
https://www.googleapis.com/auth/spanner.admin -
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview .

