---
title: "GET /v1/{v1Id}/{v1Id1}:analyzeOrgPolicies"
method: GET
path: "/v1/{v1Id}/{v1Id1}:analyzeOrgPolicies"
tags: ["v1"]
---

# GET /v1/{v1Id}/{v1Id1}:analyzeOrgPolicies

`GET /v1/{v1Id}/{v1Id1}:analyzeOrgPolicies`

## Request

- Base URL: `https://cloudasset.googleapis.com`
- URL: `https://cloudasset.googleapis.com/v1/{v1Id}/{v1Id1}:analyzeOrgPolicies`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-platform`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Analyzes organization policies under a scope.

## Path parameters

- `v1Id` string, required
- `v1Id1` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string
- `constraint` string
- `filter` string
- `pageSize` integer
- `pageToken` string

## Response `200`

Successful response

- AnalyzeOrgPoliciesResponse: The response message for AssetService.AnalyzeOrgPolicies.
  - `constraint` AnalyzerOrgPolicyConstraint: The organization policy constraint definition.
    - `customConstraint` GoogleCloudAssetV1CustomConstraint: The definition of a custom constraint.
      - `actionType` 'ACTION_TYPE_UNSPECIFIED' | 'ALLOW' | 'DENY': Allow or deny type.
      - `condition` string: Organization Policy condition/expression. For example: `resource.instanceName.matches("(production|test)_(.+_)?[\d]+")'` or, `resource.management.auto_upgrade == true`
      - `description` string: Detailed information about this custom policy constraint.
      - `displayName` string: One line display name for the UI.
      - `methodTypes` string[]: All the operations being applied for this constraint.
      - `name` string: Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example : "organizations/123/customConstraints/custom.createOnlyE2TypeVms"
      - `resourceTypes` string[]: The Resource Instance type on which this policy applies to. Format will be of the form : "/" Example: * `compute.googleapis.com/Instance`.
    - `googleDefinedConstraint` GoogleCloudAssetV1Constraint: The definition of a constraint.
      - `booleanConstraint` GoogleCloudAssetV1BooleanConstraint: A `Constraint` that is either enforced or not. For example a constraint `constraints/compute.disableSerialPortAccess`. If it is enforced on a VM instance, serial port connections will not be opened to that instance.
      - `constraintDefault` 'CONSTRAINT_DEFAULT_UNSPECIFIED' | 'ALLOW' | 'DENY': The evaluation behavior of this constraint in the absence of 'Policy'.
      - `description` string: Detailed description of what this `Constraint` controls as well as how and where it is enforced.
      - `displayName` string: The human readable name of the constraint.
      - `listConstraint` GoogleCloudAssetV1ListConstraint: A `Constraint` that allows or disallows a list of string values, which are configured by an organization's policy administrator with a `Policy`.
        - `supportsIn` boolean: Indicates whether values grouped into categories can be used in `Policy.allowed_values` and `Policy.denied_values`. For example, `"in:Python"` would match any value in the 'Python' group.
        - `supportsUnder` boolean: Indicates whether subtrees of Cloud Resource Manager resource hierarchy can be used in `Policy.allowed_values` and `Policy.denied_values`. For example, `"under:folders/123"` would match any resource under the 'folders/123' folder.
      - `name` string: The unique name of the constraint. Format of the name should be * `constraints/{constraint_name}` For example, `constraints/compute.disableSerialPortAccess`.
  - `nextPageToken` string: The page token to fetch the next page for AnalyzeOrgPoliciesResponse.org_policy_results.
  - `orgPolicyResults` OrgPolicyResult[]: The organization policies under the AnalyzeOrgPoliciesRequest.scope with the AnalyzeOrgPoliciesRequest.constraint.
    - `consolidatedPolicy` AnalyzerOrgPolicy: This organization policy message is a modified version of the one defined in the Organization Policy system. This message contains several fields defined in the original organization policy with some new fields for analysis purpose.
      - `appliedResource` string: The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of an organization/folder/project resource where this organization policy applies to. For any user defined org policies, this field has the same value as the [attached_resource] field. Only for default policy, this field has the different value.
      - `attachedResource` string: The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of an organization/folder/project resource where this organization policy is set. Notice that some type of constraints are defined with default policy. This field will be empty for them.
      - `inheritFromParent` boolean: If `inherit_from_parent` is true, Rules set higher up in the hierarchy (up to the closest root) are inherited and present in the effective policy. If it is false, then no rules are inherited, and this policy becomes the effective root for evaluation.
      - `reset` boolean: Ignores policies set above this resource and restores the default behavior of the constraint at this resource. This field can be set in policies for either list or boolean constraints. If set, `rules` must be empty and `inherit_from_parent` must be set to false.
      - `rules` GoogleCloudAssetV1Rule[]: List of rules for this organization policy.
        - `allowAll` boolean: Setting this to true means that all values are allowed. This field can be set only in Policies for list constraints.
        - `condition` Expr: Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
          - `description` string: Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
          - `expression` string: Textual representation of an expression in Common Expression Language syntax.
          - `location` string: Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
          - `title` string: Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
        - `conditionEvaluation` ConditionEvaluation: The condition evaluation.
          - `evaluationValue` 'EVALUATION_VALUE_UNSPECIFIED' | 'TRUE' | 'FALSE' | 'CONDITIONAL': The evaluation result.
        - `denyAll` boolean: Setting this to true means that all values are denied. This field can be set only in Policies for list constraints.
        - `enforce` boolean: If `true`, then the `Policy` is enforced. If `false`, then any configuration is acceptable. This field can be set only in Policies for boolean constraints.
        - `values` GoogleCloudAssetV1StringValues: The string values for the list constraints.
          - `allowedValues` string[]: List of values allowed at this resource.
          - `deniedValues` string[]: List of values denied at this resource.
    - `folders` string[]: The folder(s) that this consolidated policy belongs to, in the format of folders/{FOLDER_NUMBER}. This field is available when the consolidated policy belongs (directly or cascadingly) to one or more folders.
    - `organization` string: The organization that this consolidated policy belongs to, in the format of organizations/{ORGANIZATION_NUMBER}. This field is available when the consolidated policy belongs (directly or cascadingly) to an organization.
    - `policyBundle` AnalyzerOrgPolicy[]: The ordered list of all organization policies from the consolidated_policy.attached_resource. to the scope specified in the request. If the constraint is defined with default policy, it will also appear in the list.
      - `appliedResource` string: The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of an organization/folder/project resource where this organization policy applies to. For any user defined org policies, this field has the same value as the [attached_resource] field. Only for default policy, this field has the different value.
      - `attachedResource` string: The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of an organization/folder/project resource where this organization policy is set. Notice that some type of constraints are defined with default policy. This field will be empty for them.
      - `inheritFromParent` boolean: If `inherit_from_parent` is true, Rules set higher up in the hierarchy (up to the closest root) are inherited and present in the effective policy. If it is false, then no rules are inherited, and this policy becomes the effective root for evaluation.
      - `reset` boolean: Ignores policies set above this resource and restores the default behavior of the constraint at this resource. This field can be set in policies for either list or boolean constraints. If set, `rules` must be empty and `inherit_from_parent` must be set to false.
      - `rules` GoogleCloudAssetV1Rule[]: List of rules for this organization policy.
        - `allowAll` boolean: Setting this to true means that all values are allowed. This field can be set only in Policies for list constraints.
        - `condition` Expr: Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
          - `description` string: Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
          - `expression` string: Textual representation of an expression in Common Expression Language syntax.
          - `location` string: Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
          - `title` string: Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
        - `conditionEvaluation` ConditionEvaluation: The condition evaluation.
          - `evaluationValue` 'EVALUATION_VALUE_UNSPECIFIED' | 'TRUE' | 'FALSE' | 'CONDITIONAL': The evaluation result.
        - `denyAll` boolean: Setting this to true means that all values are denied. This field can be set only in Policies for list constraints.
        - `enforce` boolean: If `true`, then the `Policy` is enforced. If `false`, then any configuration is acceptable. This field can be set only in Policies for boolean constraints.
        - `values` GoogleCloudAssetV1StringValues: The string values for the list constraints.
          - `allowedValues` string[]: List of values allowed at this resource.
          - `deniedValues` string[]: List of values denied at this resource.
    - `project` string: The project that this consolidated policy belongs to, in the format of projects/{PROJECT_NUMBER}. This field is available when the consolidated policy belongs to a project.

---

[API](https://skmtc.dev/google/apis/cloudasset.md) - [All operations](https://skmtc.dev/google/apis/cloudasset/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/cloudasset/revisions/77b8c018c1d7?raw)
