Organization Policy API

The Org Policy API allows users to configure governance ruleson their GCP resources across the Cloud 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.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.