Organization Policy API

The Organization Policy API allows users to configure governance rules on their Google Cloud resources across the resource hierarchy.

Service: orgpolicy.googleapis.com

To call this service, we recommend that you use the Google-provided client libraries. If your application needs to use your own libraries to call this service, use the following information when you make the API requests.

Discovery document

A Discovery Document is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery document:

Service endpoint

A service endpoint is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:

  • https://orgpolicy.googleapis.com

REST Resource: v2.folders.constraints

Methods
list GET /v2/{parent=folders/*}/constraints
Lists constraints that could be applied on the specified resource.

REST Resource: v2.folders.policies

Methods
create POST /v2/{parent=folders/*}/policies
Creates a policy.
delete DELETE /v2/{name=folders/*/policies/*}
Deletes a policy.
get GET /v2/{name=folders/*/policies/*}
Gets a policy on a resource.
getEffectivePolicy GET /v2/{name=folders/*/policies/*}:getEffectivePolicy
Gets the effective policy on a resource.
list GET /v2/{parent=folders/*}/policies
Retrieves all of the policies that exist on a particular resource.
patch PATCH /v2/{policy.name=folders/*/policies/*}
Updates a policy.

REST Resource: v2.organizations.constraints

Methods
list GET /v2/{parent=organizations/*}/constraints
Lists constraints that could be applied on the specified resource.

REST Resource: v2.organizations.customConstraints

Methods
create POST /v2/{parent=organizations/*}/customConstraints
Creates a custom constraint.
delete DELETE /v2/{name=organizations/*/customConstraints/*}
Deletes a custom constraint.
get GET /v2/{name=organizations/*/customConstraints/*}
Gets a custom constraint.
list GET /v2/{parent=organizations/*}/customConstraints
Retrieves all of the custom constraints that exist on a particular organization resource.
patch PATCH /v2/{customConstraint.name=organizations/*/customConstraints/*}
Updates a custom constraint.

REST Resource: v2.organizations.policies

Methods
create POST /v2/{parent=organizations/*}/policies
Creates a policy.
delete DELETE /v2/{name=organizations/*/policies/*}
Deletes a policy.
get GET /v2/{name=organizations/*/policies/*}
Gets a policy on a resource.
getEffectivePolicy GET /v2/{name=organizations/*/policies/*}:getEffectivePolicy
Gets the effective policy on a resource.
list GET /v2/{parent=organizations/*}/policies
Retrieves all of the policies that exist on a particular resource.
patch PATCH /v2/{policy.name=organizations/*/policies/*}
Updates a policy.

REST Resource: v2.projects.constraints

Methods
list GET /v2/{parent=projects/*}/constraints
Lists constraints that could be applied on the specified resource.

REST Resource: v2.projects.policies

Methods
create POST /v2/{parent=projects/*}/policies
Creates a policy.
delete DELETE /v2/{name=projects/*/policies/*}
Deletes a policy.
get GET /v2/{name=projects/*/policies/*}
Gets a policy on a resource.
getEffectivePolicy GET /v2/{name=projects/*/policies/*}:getEffectivePolicy
Gets the effective policy on a resource.
list GET /v2/{parent=projects/*}/policies
Retrieves all of the policies that exist on a particular resource.
patch PATCH /v2/{policy.name=projects/*/policies/*}
Updates a policy.