v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-1391733.9 KB
organizations

Creates a policy. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the constraint does not exist. Returns a google.rpc.Status with google.rpc.Code.ALREADY_EXISTS if the policy already exists on the given Google Cloud resource.

post/v2/{+parent}/policies

Path parameters

parentstring required

Required. The Google Cloud resource that will parent the new policy. Must be in one of the following forms: * projects/{project_number} * projects/{project_id} * folders/{folder_id} * organizations/{organization_id}

Request body

etagstring

Optional. An opaque tag indicating the current state of the policy, used for concurrency control. This entity tag (ETag) is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.

namestring

Immutable. The resource name of the policy. Must be one of the following forms, where constraint_name is the name of the constraint that this policy configures: * projects/{project_number}/policies/{constraint_name} * folders/{folder_id}/policies/{constraint_name} * organizations/{organization_id}/policies/{constraint_name} For example, projects/123/policies/compute.disableSerialPortAccess. Note: projects/{project_id}/policies/{constraint_name} is also an acceptable name for API requests, but responses will return the name using the equivalent project number.

Response

Successful response