# List all policy sets hierarchically List all policy sets hierarchically (includes policy sets from account, org, and project levels) Endpoint: GET /pm/api/v1/policysets/all Version: 1.0 Security: ## Query parameters: - `accountIdentifier` (string) Harness account ID Example: "eBqAoNchMLKigC_qZ5EdC" - `orgIdentifier` (string) Harness organization ID Example: "test-org" - `projectIdentifier` (string) Harness project ID Example: "test-project" - `per_page` (integer) Number of results per page Example: 20 - `page` (integer) Page number (starting from 0) Example: 4 - `identifierFilter` (string) Comma separated List of Identifiers to filter on Example: "test-projectId1, test-projectId2" - `type` (string) Filter results by type Example: "pipeline" - `action` (string) Filter results by action Example: "onrun" ## Header parameters: - `x-api-key` (string) Harness PAT key used to perform authorization Example: "Dolorem ut qui optio modi natus deserunt." ## Response 200 fields (application/json): - `account_id` (string, required) Harness account ID associated with this policy set Example: "eBqAoNchMLKigC_qZ5EdC" - `action` (string, required) Action that triggers the policy set Example: "onrun" - `created` (integer, required) Time the policy set was created Example: 1636669297674 - `description` (string) Description of the policy set Example: "Captures critical production policies" - `enabled` (boolean, required) Only enabled policy sets are evaluated when evaluating by type/action Example: true - `entity_selector` (string, required) A string enum value which determines which entities the policy set applies to during evaluation Enum: "all_entities_in_scope", "all_entities_in_resource_groups" - `identifier` (string, required) Identifier of the policy set Example: "policyset-1" - `infra_params` (object) Infrastructure parameters for executing policies on customer infrastructure Example: {"annotations":{"Libero a quisquam non.":"Sint ducimus cupiditate eos corrupti.","Omnis dolores cupiditate eum itaque cum.":"Aut facilis aperiam sunt nam repellat similique.","Saepe commodi amet.":"Error laudantium aut ea."},"connectorRef":"account.k8s_connector","harnessImageConnectorRef":"account.docker_connector","initTimeout":"10m","labels":{"Rerum dicta vitae aut autem aut asperiores.":"Voluptas quis labore."},"namespace":"default","nodeSelector":{"Sapiente asperiores provident laborum ut.":"Facilis atque sunt."},"os":"linux","poolName":"vm-pool-1","resources":{"limits":{"cpu":"100m","memory":"128Mi"},"requests":{"cpu":"100m","memory":"128Mi"}}} - `infra_params.annotations` (object) Kubernetes annotations (for KubernetesDirect) Example: {"Libero a quisquam non.":"Sint ducimus cupiditate eos corrupti.","Omnis dolores cupiditate eum itaque cum.":"Aut facilis aperiam sunt nam repellat similique.","Saepe commodi amet.":"Error laudantium aut ea."} - `infra_params.connectorRef` (string) Connector reference (for KubernetesDirect) Example: "account.k8s_connector" - `infra_params.harnessImageConnectorRef` (string) Harness image connector reference Example: "account.docker_connector" - `infra_params.initTimeout` (string) Initialization timeout (for KubernetesDirect) Example: "10m" - `infra_params.labels` (object) Kubernetes labels (for KubernetesDirect) Example: {"Rerum dicta vitae aut autem aut asperiores.":"Voluptas quis labore."} - `infra_params.namespace` (string) Kubernetes namespace (for KubernetesDirect) Example: "default" - `infra_params.nodeSelector` (object) Kubernetes node selector (for KubernetesDirect) Example: {"Sapiente asperiores provident laborum ut.":"Facilis atque sunt."} - `infra_params.os` (string) Operating system (for VM) Example: "linux" - `infra_params.poolName` (string) VM pool name (for VM) Example: "vm-pool-1" - `infra_params.resources` (object) Container resource requests and limits Example: {"limits":{"cpu":"100m","memory":"128Mi"},"requests":{"cpu":"100m","memory":"128Mi"}} - `infra_params.resources.limits` (object) CPU and memory quantities for container resources Example: {"cpu":"100m","memory":"128Mi"} - `infra_params.resources.limits.cpu` (string, required) CPU quantity Example: "100m" - `infra_params.resources.limits.memory` (string, required) Memory quantity Example: "128Mi" - `infra_params.resources.requests` (object) CPU and memory quantities for container resources Example: {"cpu":"100m","memory":"128Mi"} - `infra_type` (string) Infrastructure type for executing policies on customer infrastructure Enum: "KubernetesDirect", "VM" - `name` (string, required) Name of the policy set Example: "Production Policies" - `org_id` (string, required) Harness organization ID associated with this policy set Example: "test-org" - `policies` (array) Policies linked to this policy set Example: [{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"git_commit_sha":"1369b45c20fc685113adcfd1a08a914180ff3c0d","git_connector_ref":".","git_file_id":"1369b45c20fc685113adcfd1a08a914180ff3c0d","git_file_url":"","git_path":".harness/policy.rego","git_repo":"github.com/org/repo,omitempty","identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","parent_unique_id":"Vel exercitationem molestiae consequuntur sint.","polciy_size_in_bytes":5354236275073299000,"policy_package_name":"Officiis quam voluptates dolor aut.","project_id":"test-project","rego":"","severity":"warning","unique_id":"Iusto earum enim ea incidunt.","updated":1636669297674},{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"git_commit_sha":"1369b45c20fc685113adcfd1a08a914180ff3c0d","git_connector_ref":".","git_file_id":"1369b45c20fc685113adcfd1a08a914180ff3c0d","git_file_url":"","git_path":".harness/policy.rego","git_repo":"github.com/org/repo,omitempty","identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","parent_unique_id":"Vel exercitationem molestiae consequuntur sint.","polciy_size_in_bytes":5354236275073299000,"policy_package_name":"Officiis quam voluptates dolor aut.","project_id":"test-project","rego":"","severity":"warning","unique_id":"Iusto earum enim ea incidunt.","updated":1636669297674},{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"git_commit_sha":"1369b45c20fc685113adcfd1a08a914180ff3c0d","git_connector_ref":".","git_file_id":"1369b45c20fc685113adcfd1a08a914180ff3c0d","git_file_url":"","git_path":".harness/policy.rego","git_repo":"github.com/org/repo,omitempty","identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","parent_unique_id":"Vel exercitationem molestiae consequuntur sint.","polciy_size_in_bytes":5354236275073299000,"policy_package_name":"Officiis quam voluptates dolor aut.","project_id":"test-project","rego":"","severity":"warning","unique_id":"Iusto earum enim ea incidunt.","updated":1636669297674},{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"git_commit_sha":"1369b45c20fc685113adcfd1a08a914180ff3c0d","git_connector_ref":".","git_file_id":"1369b45c20fc685113adcfd1a08a914180ff3c0d","git_file_url":"","git_path":".harness/policy.rego","git_repo":"github.com/org/repo,omitempty","identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","parent_unique_id":"Vel exercitationem molestiae consequuntur sint.","polciy_size_in_bytes":5354236275073299000,"policy_package_name":"Officiis quam voluptates dolor aut.","project_id":"test-project","rego":"","severity":"warning","unique_id":"Iusto earum enim ea incidunt.","updated":1636669297674}] - `policies.account_id` (string, required) Harness account ID associated with this policy Example: "eBqAoNchMLKigC_qZ5EdC" - `policies.created` (integer, required) Time the policy was created Example: 1636669297674 - `policies.git_commit_sha` (string) The commit sha of the commit that last effected the file Example: "1369b45c20fc685113adcfd1a08a914180ff3c0d" - `policies.git_connector_ref` (string) The harness connector used for authenticating on the git provider Example: "." - `policies.git_file_id` (string) The file id of the file, may be empty for bitbucket files Example: "1369b45c20fc685113adcfd1a08a914180ff3c0d" - `policies.git_file_url` (string) The url of the file on the fit provider - `policies.git_path` (string) The path to the file in the git repo Example: ".harness/policy.rego" - `policies.git_repo` (string) The git repo the policy resides in Example: "github.com/org/repo,omitempty" - `policies.identifier` (string, required) identifier of the policy Example: "policy-1" - `policies.name` (string, required) Name of the policy Example: "Pipeline Approval" - `policies.org_id` (string, required) Harness organization ID associated with this policy Example: "test-org" - `policies.parent_unique_id` (string) Parent unique identifier for the policy Example: "Eligendi minima similique molestias quia." - `policies.polciy_size_in_bytes` (integer) Size of the policy in bytes Example: 156792332710919040 - `policies.policy_package_name` (string) Package name of the policy Example: "Quia modi optio occaecati porro eaque laborum." - `policies.project_id` (string, required) Harness project ID associated with this policy Example: "test-project" - `policies.rego` (string, required) Rego that defines the policy - `policies.severity` (string, required) The severity of this policy in this context Enum: "warning", "error" - `policies.unique_id` (string) Unique identifier for the policy Example: "Temporibus possimus fugiat." - `policies.updated` (integer, required) Time the policy was last updated Example: 1636669297674 - `project_id` (string, required) Harness project ID associated with this policy set Example: "test-project" - `resource_groups` (array) The groups of resources that this policy set should be applied to Example: [{"account_id":"Pariatur ut architecto quisquam.","created":2180831361609885000,"identifier":"Possimus corporis doloremque nihil hic exercitationem.","name":"Consequatur dolorum minima molestiae aperiam repudiandae.","org_id":"Suscipit quos iste qui molestias.","project_id":"Delectus nihil suscipit omnis commodi sunt quas."},{"account_id":"Pariatur ut architecto quisquam.","created":2180831361609885000,"identifier":"Possimus corporis doloremque nihil hic exercitationem.","name":"Consequatur dolorum minima molestiae aperiam repudiandae.","org_id":"Suscipit quos iste qui molestias.","project_id":"Delectus nihil suscipit omnis commodi sunt quas."}] - `resource_groups.account_id` (string, required) resource group account id Example: "Voluptates temporibus perferendis numquam." - `resource_groups.created` (integer, required) resource group timestamp Example: 8258050507909352000 - `resource_groups.identifier` (string, required) resource group identifier Example: "Neque assumenda nisi rerum quia repellendus id." - `resource_groups.name` (string, required) resource group name Example: "Eius praesentium et quod consequuntur iusto aperiam." - `resource_groups.org_id` (string, required) resource group org id Example: "Aliquid quas qui quas." - `resource_groups.project_id` (string, required) resource group project identifier Example: "Qui sed dolor nihil esse a." - `type` (string, required) Type of input suitable for the policy set Example: "pipeline" - `updated` (integer, required) Time the policy set was last updated Example: 1636669297674 - `yaml_version` (string) Harness yaml version associated with this policySet Enum: "0", "1" ## Response 400 fields (application/vnd.goa.error): - `fault` (boolean, required) Is the error a server-side fault? - `id` (string, required) ID is a unique identifier for this particular occurrence of the problem. Example: "123abc" - `message` (string, required) Message is a human-readable explanation specific to this occurrence of the problem. Example: "parameter 'p' must be an integer" - `name` (string, required) Name is the name of this class of errors. Example: "bad_request" - `temporary` (boolean, required) Is the error temporary? - `timeout` (boolean, required) Is the error a timeout? Example: true ## Response 401 fields (application/vnd.goa.error): - `fault` (boolean, required) Is the error a server-side fault? - `id` (string, required) ID is a unique identifier for this particular occurrence of the problem. Example: "123abc" - `message` (string, required) Message is a human-readable explanation specific to this occurrence of the problem. Example: "parameter 'p' must be an integer" - `name` (string, required) Name is the name of this class of errors. Example: "bad_request" - `temporary` (boolean, required) Is the error temporary? - `timeout` (boolean, required) Is the error a timeout? Example: true ## Response 403 fields (application/vnd.goa.error): - `fault` (boolean, required) Is the error a server-side fault? - `id` (string, required) ID is a unique identifier for this particular occurrence of the problem. Example: "123abc" - `message` (string, required) Message is a human-readable explanation specific to this occurrence of the problem. Example: "parameter 'p' must be an integer" - `name` (string, required) Name is the name of this class of errors. Example: "bad_request" - `temporary` (boolean, required) Is the error temporary? - `timeout` (boolean, required) Is the error a timeout? Example: true ## Response 404 fields (application/vnd.goa.error): - `fault` (boolean, required) Is the error a server-side fault? - `id` (string, required) ID is a unique identifier for this particular occurrence of the problem. Example: "123abc" - `message` (string, required) Message is a human-readable explanation specific to this occurrence of the problem. Example: "parameter 'p' must be an integer" - `name` (string, required) Name is the name of this class of errors. Example: "bad_request" - `temporary` (boolean, required) Is the error temporary? - `timeout` (boolean, required) Is the error a timeout? Example: true ## Response 500 fields (application/vnd.goa.error): - `fault` (boolean, required) Is the error a server-side fault? - `id` (string, required) ID is a unique identifier for this particular occurrence of the problem. Example: "123abc" - `message` (string, required) Message is a human-readable explanation specific to this occurrence of the problem. Example: "parameter 'p' must be an integer" - `name` (string, required) Name is the name of this class of errors. Example: "bad_request" - `temporary` (boolean, required) Is the error temporary? - `timeout` (boolean, required) Is the error a timeout? Example: true ## Response 502 fields (application/vnd.goa.error): - `fault` (boolean, required) Is the error a server-side fault? - `id` (string, required) ID is a unique identifier for this particular occurrence of the problem. Example: "123abc" - `message` (string, required) Message is a human-readable explanation specific to this occurrence of the problem. Example: "parameter 'p' must be an integer" - `name` (string, required) Name is the name of this class of errors. Example: "bad_request" - `temporary` (boolean, required) Is the error temporary? - `timeout` (boolean, required) Is the error a timeout? Example: true