Reference documentation and code samples for the Organization Policy V2 API module Google::Cloud::OrgPolicy::V2::OrgPolicy.
An interface for managing organization policies.
The Organization Policy Service provides a simple mechanism for
organizations to restrict the allowed configurations across their entire
resource hierarchy.
You can use a policy to configure restrictions on resources. For
example, you can enforce a policy that restricts which Google
Cloud APIs can be activated in a certain part of your resource
hierarchy, or prevents serial port access to VM instances in a
particular folder.
Policies are inherited down through the resource hierarchy. A policy
applied to a parent resource automatically applies to all its child resources
unless overridden with a policy lower in the hierarchy.
A constraint defines an aspect of a resource's configuration that can be
controlled by an organization's policy administrator. Policies are a
collection of constraints that defines their allowable configuration on a
particular resource and its child resources.
To load this service and instantiate a REST client:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Organization Policy V2 API - Module Google::Cloud::OrgPolicy::V2::OrgPolicy (v1.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.5.0 (latest)](/ruby/docs/reference/google-cloud-org_policy-v2/latest/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [1.4.1](/ruby/docs/reference/google-cloud-org_policy-v2/1.4.1/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [1.3.0](/ruby/docs/reference/google-cloud-org_policy-v2/1.3.0/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [1.2.0](/ruby/docs/reference/google-cloud-org_policy-v2/1.2.0/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [1.1.0](/ruby/docs/reference/google-cloud-org_policy-v2/1.1.0/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [1.0.1](/ruby/docs/reference/google-cloud-org_policy-v2/1.0.1/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [0.10.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.10.0/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [0.9.2](/ruby/docs/reference/google-cloud-org_policy-v2/0.9.2/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [0.8.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.8.0/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [0.7.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.7.0/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [0.6.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.6.0/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [0.5.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.5.0/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [0.4.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.4.0/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [0.3.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.3.0/Google-Cloud-OrgPolicy-V2-OrgPolicy)\n- [0.2.6](/ruby/docs/reference/google-cloud-org_policy-v2/0.2.6/Google-Cloud-OrgPolicy-V2-OrgPolicy) \nReference documentation and code samples for the Organization Policy V2 API module Google::Cloud::OrgPolicy::V2::OrgPolicy.\n\nAn interface for managing organization policies.\n\nThe Organization Policy Service provides a simple mechanism for\norganizations to restrict the allowed configurations across their entire\nresource hierarchy.\n\nYou can use a policy to configure restrictions on resources. For\nexample, you can enforce a policy that restricts which Google\nCloud APIs can be activated in a certain part of your resource\nhierarchy, or prevents serial port access to VM instances in a\nparticular folder.\n\nPolicies are inherited down through the resource hierarchy. A policy\napplied to a parent resource automatically applies to all its child resources\nunless overridden with a policy lower in the hierarchy.\n\nA constraint defines an aspect of a resource's configuration that can be\ncontrolled by an organization's policy administrator. Policies are a\ncollection of constraints that defines their allowable configuration on a\nparticular resource and its child resources.\n\nTo load this service and instantiate a REST client: \n\n require \"google/cloud/org_policy/v2/org_policy/rest\"\n client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Rest::Client.new"]]