# policies#find Find a policy by identifier Endpoint: GET /pm/api/v1/policies/{identifier} 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" - `git_branch` (string) The git branch the policy resides in Example: "main" - `show_summary` (boolean) Setting to true returns the metadata about the requested policy including the information held about the status of this policy in the default branch. git_branch is ignored as no git operation takes place. Example: true ## Path parameters: - `identifier` (string, required) Identifier of the policy to retrieve Example: "policy-1" ## Header parameters: - `x-api-key` (string) Harness PAT key used to perform authorization Example: "Harum nisi dolorum maiores." ## Response 200 fields (application/json): - `account_id` (string, required) Harness account ID associated with this policy Example: "eBqAoNchMLKigC_qZ5EdC" - `created` (integer, required) Time the policy was created Example: 1636669297674 - `git_commit_sha` (string) The commit sha of the commit that last effected the file Example: "1369b45c20fc685113adcfd1a08a914180ff3c0d" - `git_connector_ref` (string) The harness connector used for authenticating on the git provider Example: "." - `git_default_branch` (string) The default branch, the service pulls in changes from from this branch for policy evaluation Example: "main" - `git_default_branch_commit_sha` (string) The commit sha of the commit that last effected the file in the default branch Example: "1369b45c20fc685113adcfd1a08a914180ff3c0d" - `git_default_branch_file_id` (string) The file id of the file in the default branch, may be empty for bitbucket files Example: "1369b45c20fc685113adcfd1a08a914180ff3c0d" - `git_default_branch_file_url` (string) The url of the file in the default branch - `git_default_branch_update_error` (object) Example: {"explanation":"File with given filepath [file.rego] already exists in Github, thus couldn't create a new file","hint":"Please check if there's already a file [file.rego] in Github repository [rego-demo] for the given filepath and branch [main].","message":"Please check if there's already a file [file.rego] in Github repository [rego-demo] for the given filepath and branch [main]."} - `git_default_branch_update_error.explanation` (string, required) the explanation of the error Example: "File with given filepath [file.rego] already exists in Github, thus couldn't create a new file" - `git_default_branch_update_error.hint` (string, required) the hint on how to resolve the error Example: "Please check if there's already a file [file.rego] in Github repository [rego-demo] for the given filepath and branch [main]." - `git_default_branch_update_error.message` (string, required) the message is a human-readable explanation specific to this occurrence of the problem Example: "Please check if there's already a file [file.rego] in Github repository [rego-demo] for the given filepath and branch [main]." - `git_default_branch_updated` (integer) The last time the service successfully pulled in changes from the default branch Example: 1636669297674 - `git_file_id` (string) The file id of the file, may be empty for bitbucket files Example: "1369b45c20fc685113adcfd1a08a914180ff3c0d" - `git_file_url` (string) The url of the file on the fit provider - `git_path` (string) The path to the file in the git repo Example: ".harness/policy.rego" - `git_repo` (string) The git repo the policy resides in Example: "github.com/org/repo,omitempty" - `identifier` (string, required) identifier of the policy Example: "policy-1" - `name` (string, required) Name of the policy Example: "Pipeline Approval" - `org_id` (string, required) Harness organization ID associated with this policy Example: "test-org" - `policy_set_count` (integer) Count of policy sets associated with this policy Example: 3 - `project_id` (string, required) Harness project ID associated with this policy Example: "test-project" - `rego` (string, required) Rego that defines the policy - `updated` (integer, required) Time the policy was last updated Example: 1636669297674 ## Response 400 fields (application/json): - `fault` (boolean, required) Is the error a server-side fault? Example: true - `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? Example: true - `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? Example: true - `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? Example: true - `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? Example: true - `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? Example: true - `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? Example: true - `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? Example: true - `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? Example: true - `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? Example: true - `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? Example: true - `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? Example: true - `timeout` (boolean, required) Is the error a timeout? Example: true