POST /v2/projects/{projectsId}/policies
Changed onCreates 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.
Request
- Base URLhttps://orgpolicy.googleapis.com
- Auth
- OAuth 2 and OAuth 2Implicithttps://accounts.google.com/o/oauth2/authScopeshttps://www.googleapis.com/auth/cloud-platformAuthorization codehttps://accounts.google.com/o/oauth2/authToken URLhttps://accounts.google.com/o/oauth2/tokenScopeshttps://www.googleapis.com/auth/cloud-platform
- or OAuth 2 and OAuth 2Implicithttps://accounts.google.com/o/oauth2/authScopeshttps://www.googleapis.com/auth/organizationpolicyAuthorization codehttps://accounts.google.com/o/oauth2/authToken URLhttps://accounts.google.com/o/oauth2/tokenScopeshttps://www.googleapis.com/auth/organizationpolicy
Path parameters
Query parameters
V1 error format.
OAuth access token.
Data format for response.
JSONP
Selector specifying which fields to include in a partial response.
API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
OAuth 2.0 token for the current user.
Returns response with indentations and line breaks.
Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
Legacy upload protocol for media (e.g. "media", "multipart").
Upload protocol for media (e.g. "raw", "multipart").
Request body
Defines an organization policy that is used to specify constraints for configurations of Google Cloud resources.
Similar to PolicySpec but with an extra 'launch' field for launch reference. The PolicySpec here is specific for dry-run.
Defines a Google Cloud policy specification that is used to specify constraints for configurations of Google Cloud resources.
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.
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_number}/policies/{constraint_name} * organizations/{organization_number}/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.
Defines a Google Cloud policy specification that is used to specify constraints for configurations of Google Cloud resources.
Response
Successful response
Defines an organization policy that is used to specify constraints for configurations of Google Cloud resources.
Similar to PolicySpec but with an extra 'launch' field for launch reference. The PolicySpec here is specific for dry-run.
Defines a Google Cloud policy specification that is used to specify constraints for configurations of Google Cloud resources.
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.
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_number}/policies/{constraint_name} * organizations/{organization_number}/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.
Defines a Google Cloud policy specification that is used to specify constraints for configurations of Google Cloud resources.
Changes
- info
the security scope
https://www.googleapis.com/auth/cloud-platformwas added to the endpoint's security schemeOauth2 - info
the security scope
https://www.googleapis.com/auth/cloud-platformwas added to the endpoint's security schemeOauth2c - info
the security scope
https://www.googleapis.com/auth/organizationpolicywas removed from the endpoint's security schemeOauth2
1 more change in this revision
- info