openapi: 3.2.0 info: title: Harness Policies API version: '1.0' description: The Harness Software Delivery Platform uses OpenAPI Specification v3.0. contact: name: API Support email: contact@harness.io url: https://harness.io/ x-logo: url: https://mma.prnewswire.com/media/779232/Harnes_logo_horizontal.jpg?p=facebook altText: Harness termsOfService: https://harness.io/terms-of-use/ servers: - url: https://app.harness.io description: Harness host URL - url: https://{vanity} description: Vanity URL variables: vanity: default: app.harness.io security: - x-api-key: [] tags: - name: Policies description: Create, edit and delete Governance policies written in rego paths: /pm/api/v1/policies: get: tags: - Policies description: List all policies operationId: policies#list parameters: - name: accountIdentifier in: query description: Harness account ID allowEmptyValue: true schema: type: string description: Harness account ID default: '' example: eBqAoNchMLKigC_qZ5EdC example: eBqAoNchMLKigC_qZ5EdC - name: orgIdentifier in: query description: Harness organization ID allowEmptyValue: true schema: type: string description: Harness organization ID default: '' example: test-org example: test-org - name: projectIdentifier in: query description: Harness project ID allowEmptyValue: true schema: type: string description: Harness project ID default: '' example: test-project example: test-project - name: per_page in: query description: Number of results per page allowEmptyValue: true schema: type: integer description: Number of results per page default: 50 example: 20 format: int64 minimum: 1 maximum: 100 example: 20 - name: page in: query description: Page number (starting from 0) allowEmptyValue: true schema: type: integer description: Page number (starting from 0) default: 0 example: 4 format: int64 minimum: 0 example: 4 - name: identifierFilter in: query description: Comma separated List of Identifiers to filter on allowEmptyValue: true schema: type: string description: Comma separated List of Identifiers to filter on default: '' example: test-projectId1, test-projectId2 example: test-projectId1, test-projectId2 - name: searchTerm in: query description: Filter results by partial name match allowEmptyValue: true schema: type: string description: Filter results by partial name match default: '' example: poli example: poli - name: sort in: query description: Sort order for results allowEmptyValue: true schema: type: string description: Sort order for results default: name,ASC example: updated,ASC enum: - name,ASC - name,DESC - updated,ASC - updated,DESC example: name,DESC - name: excludeRegoFromResponse in: query description: Set to true to exclude Rego content from the response allowEmptyValue: true schema: type: boolean description: Set to true to exclude Rego content from the response default: false example: false example: false - name: includePolicySetCount in: query description: Set to true to include the count of policy sets associated with each policy in the response allowEmptyValue: true schema: type: boolean description: Set to true to include the count of policy sets associated with each policy in the response default: false example: true example: true - name: x-api-key in: header description: Harness PAT key used to perform authorization allowEmptyValue: true schema: type: string description: Harness PAT key used to perform authorization example: Consequatur nam eveniet amet veritatis quia veritatis. example: Sit molestiae id quod quaerat consequatur. responses: '200': description: OK response. headers: Link: description: Link-based paging schema: type: string description: Link-based paging example: '' example: '' X-Page-Index: description: 'Deprecated: Please use pageNumber / X-Page-Number instead. Same value as pageNumber; kept for legacy UI clients.' schema: type: integer description: 'Deprecated: Please use pageNumber / X-Page-Number instead. Same value as pageNumber; kept for legacy UI clients.' example: 4 format: int64 example: 4 X-Page-Item-Count: description: Number of results in this page schema: type: integer description: Number of results in this page example: 20 format: int64 example: 20 X-Page-Number: description: Current page number (0-based). Harness standard pagination header X-Page-Number. schema: type: integer description: Current page number (0-based). Harness standard pagination header X-Page-Number. example: 4 format: int64 example: 4 X-Page-Size: description: Requested page size. Harness standard pagination header X-Page-Size. schema: type: integer description: Requested page size. Harness standard pagination header X-Page-Size. example: 20 format: int64 example: 20 X-Total-Elements: description: Total number of results available. Harness standard pagination header X-Total-Elements. schema: type: integer description: Total number of results available. Harness standard pagination header X-Total-Elements. example: 230 format: int64 example: 230 X-Total-Items: description: 'Deprecated: Please use totalElements / X-Total-Elements instead. Same value as totalElements; kept for legacy UI clients.' schema: type: integer description: 'Deprecated: Please use totalElements / X-Total-Elements instead. Same value as totalElements; kept for legacy UI clients.' example: 230 format: int64 example: 230 X-Total-Pages: description: Total pages available schema: type: integer description: Total pages available example: 12 format: int64 example: 12 content: application/json: schema: type: array items: $ref: '#/components/schemas/PolicyManagementPolicy' example: - account_id: eBqAoNchMLKigC_qZ5EdC cache_response: cache_state: STALE_CACHE is_sync_enabled: true last_updated_at: 1773917288158 ttl_left: 258234442 created: 1636669297674 git_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_connector_ref: . git_default_branch: main git_default_branch_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_id: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_url: '' git_default_branch_update_error: 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_updated: 1636669297674 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: Aliquam est. polciy_size_in_bytes: 4204212102816286000 policy_package_name: Aspernatur in molestias recusandae odit quia. policy_set_count: 3 project_id: test-project rego: '' unique_id: Ex consequuntur saepe. updated: 1636669297674 - account_id: eBqAoNchMLKigC_qZ5EdC cache_response: cache_state: STALE_CACHE is_sync_enabled: true last_updated_at: 1773917288158 ttl_left: 258234442 created: 1636669297674 git_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_connector_ref: . git_default_branch: main git_default_branch_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_id: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_url: '' git_default_branch_update_error: 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_updated: 1636669297674 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: Aliquam est. polciy_size_in_bytes: 4204212102816286000 policy_package_name: Aspernatur in molestias recusandae odit quia. policy_set_count: 3 project_id: test-project rego: '' unique_id: Ex consequuntur saepe. updated: 1636669297674 - account_id: eBqAoNchMLKigC_qZ5EdC cache_response: cache_state: STALE_CACHE is_sync_enabled: true last_updated_at: 1773917288158 ttl_left: 258234442 created: 1636669297674 git_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_connector_ref: . git_default_branch: main git_default_branch_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_id: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_url: '' git_default_branch_update_error: 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_updated: 1636669297674 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: Aliquam est. polciy_size_in_bytes: 4204212102816286000 policy_package_name: Aspernatur in molestias recusandae odit quia. policy_set_count: 3 project_id: test-project rego: '' unique_id: Ex consequuntur saepe. updated: 1636669297674 - account_id: eBqAoNchMLKigC_qZ5EdC cache_response: cache_state: STALE_CACHE is_sync_enabled: true last_updated_at: 1773917288158 ttl_left: 258234442 created: 1636669297674 git_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_connector_ref: . git_default_branch: main git_default_branch_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_id: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_url: '' git_default_branch_update_error: 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_updated: 1636669297674 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: Aliquam est. polciy_size_in_bytes: 4204212102816286000 policy_package_name: Aspernatur in molestias recusandae odit quia. policy_set_count: 3 project_id: test-project rego: '' unique_id: Ex consequuntur saepe. updated: 1636669297674 example: - account_id: eBqAoNchMLKigC_qZ5EdC cache_response: cache_state: STALE_CACHE is_sync_enabled: true last_updated_at: 1773917288158 ttl_left: 258234442 created: 1636669297674 git_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_connector_ref: . git_default_branch: main git_default_branch_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_id: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_url: '' git_default_branch_update_error: 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_updated: 1636669297674 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: Aliquam est. polciy_size_in_bytes: 4204212102816286000 policy_package_name: Aspernatur in molestias recusandae odit quia. policy_set_count: 3 project_id: test-project rego: '' unique_id: Ex consequuntur saepe. updated: 1636669297674 - account_id: eBqAoNchMLKigC_qZ5EdC cache_response: cache_state: STALE_CACHE is_sync_enabled: true last_updated_at: 1773917288158 ttl_left: 258234442 created: 1636669297674 git_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_connector_ref: . git_default_branch: main git_default_branch_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_id: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_url: '' git_default_branch_update_error: 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_updated: 1636669297674 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: Aliquam est. polciy_size_in_bytes: 4204212102816286000 policy_package_name: Aspernatur in molestias recusandae odit quia. policy_set_count: 3 project_id: test-project rego: '' unique_id: Ex consequuntur saepe. updated: 1636669297674 - account_id: eBqAoNchMLKigC_qZ5EdC cache_response: cache_state: STALE_CACHE is_sync_enabled: true last_updated_at: 1773917288158 ttl_left: 258234442 created: 1636669297674 git_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_connector_ref: . git_default_branch: main git_default_branch_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_id: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_url: '' git_default_branch_update_error: 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_updated: 1636669297674 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: Aliquam est. polciy_size_in_bytes: 4204212102816286000 policy_package_name: Aspernatur in molestias recusandae odit quia. policy_set_count: 3 project_id: test-project rego: '' unique_id: Ex consequuntur saepe. updated: 1636669297674 '400': description: 'GitError: Bad Request response.' content: application/json: schema: $ref: '#/components/schemas/PolicyManagementError' 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]. '401': description: 'Unauthorized: Unauthorized response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '403': description: 'Forbidden: Forbidden response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '404': description: 'NotFound: Not Found response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '409': description: 'PolicyReferenced: Conflict response.' content: application/json: schema: $ref: '#/components/schemas/PolicyReferencedResult' example: message: Vel odit. referenced_by: - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. '500': description: 'ScopeInfoError: Internal Server Error response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '502': description: 'BadGateway: Bad Gateway response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' security: - jwt_header_Authorization: - core_governancePolicy_view - api_key_header_x-api-key: [] summary: Policies#list x-summary-source: derived post: tags: - Policies description: Create a policy operationId: policies#create parameters: - name: accountIdentifier in: query description: Harness account ID allowEmptyValue: true schema: type: string description: Harness account ID default: '' example: eBqAoNchMLKigC_qZ5EdC example: eBqAoNchMLKigC_qZ5EdC - name: orgIdentifier in: query description: Harness organization ID allowEmptyValue: true schema: type: string description: Harness organization ID default: '' example: test-org example: test-org - name: projectIdentifier in: query description: Harness project ID allowEmptyValue: true schema: type: string description: Harness project ID default: '' example: test-project example: test-project - name: git_commit_msg in: query description: The commit message used in git when creating the policy allowEmptyValue: true schema: type: string description: The commit message used in git when creating the policy example: harness policy commit msg example: harness policy commit msg - name: git_import in: query description: A flag to determine if the api should try and import and existing policy from git allowEmptyValue: true schema: type: boolean description: A flag to determine if the api should try and import and existing policy from git example: true example: true - name: git_branch in: query description: The git branch the policy will be created in allowEmptyValue: true schema: type: string description: The git branch the policy will be created in example: main example: main - name: git_is_new_branch in: query description: A flag to determine if the api should try and commit to a new branch allowEmptyValue: true schema: type: boolean description: A flag to determine if the api should try and commit to a new branch example: true example: true - name: git_base_branch in: query description: If committing to a new branch, git_base_branch tells the api which branch to base the new branch from allowEmptyValue: true schema: type: string description: If committing to a new branch, git_base_branch tells the api which branch to base the new branch from example: main example: main - name: x-api-key in: header description: Harness PAT key used to perform authorization allowEmptyValue: true schema: type: string description: Harness PAT key used to perform authorization example: Pariatur harum atque dolor rerum. example: Quas numquam aliquid suscipit. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateRequestBody' example: git_connector_ref: . git_path: .harness/policy.rego git_repo: github.com/org/repo identifier: policy-1 name: Check that an approval step is present rego: 'package test deny["should say hello world"] {input.message != "world"}' responses: '201': description: Created response. content: application/json: schema: $ref: '#/components/schemas/PolicyManagementPolicy' example: account_id: eBqAoNchMLKigC_qZ5EdC cache_response: cache_state: STALE_CACHE is_sync_enabled: true last_updated_at: 1773917288158 ttl_left: 258234442 created: 1636669297674 git_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_connector_ref: . git_default_branch: main git_default_branch_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_id: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_url: '' git_default_branch_update_error: 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_updated: 1636669297674 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: Fugiat autem accusamus esse. polciy_size_in_bytes: 5151500800531891000 policy_package_name: Dolor laborum soluta exercitationem veritatis hic. policy_set_count: 3 project_id: test-project rego: '' unique_id: Voluptas non quam atque voluptates. updated: 1636669297674 '400': description: 'GitError: Bad Request response.' content: application/json: schema: $ref: '#/components/schemas/PolicyManagementError' 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]. '401': description: 'Unauthorized: Unauthorized response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '403': description: 'Forbidden: Forbidden response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '404': description: 'NotFound: Not Found response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '409': description: 'PolicyReferenced: Conflict response.' content: application/json: schema: $ref: '#/components/schemas/PolicyReferencedResult' example: message: Ea adipisci quo sint consequatur. referenced_by: - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. '500': description: 'ScopeInfoError: Internal Server Error response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '502': description: 'BadGateway: Bad Gateway response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' security: - jwt_header_Authorization: - core_governancePolicy_create - api_key_header_x-api-key: [] summary: Policies#create x-summary-source: derived /pm/api/v1/policies/move-policy/{identifier}: post: tags: - Policies description: Move an inline policy's configuration to remote (Git) operationId: policies#move_policy parameters: - name: accountIdentifier in: query description: Harness account ID allowEmptyValue: true schema: type: string description: Harness account ID default: '' example: eBqAoNchMLKigC_qZ5EdC example: eBqAoNchMLKigC_qZ5EdC - name: orgIdentifier in: query description: Harness organization ID allowEmptyValue: true schema: type: string description: Harness organization ID default: '' example: test-org example: test-org - name: projectIdentifier in: query description: Harness project ID allowEmptyValue: true schema: type: string description: Harness project ID default: '' example: test-project example: test-project - name: identifier in: path description: Identifier of the policy to move required: true schema: type: string description: Identifier of the policy to move example: policy-1 minLength: 1 example: policy-1 - name: x-api-key in: header description: Harness PAT key used to perform authorization allowEmptyValue: true schema: type: string description: Harness PAT key used to perform authorization example: Alias assumenda aut provident reiciendis. example: Et nihil. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/MovePolicyRequestBody' example: git_base_branch: main git_branch: main git_commit_msg: Move policy to remote git_connector_ref: github_connector git_is_new_branch: false git_path: .harness/policy.rego git_repo: github.com/org/repo responses: '200': description: OK response. content: application/json: schema: $ref: '#/components/schemas/PolicyManagementPolicy' example: account_id: eBqAoNchMLKigC_qZ5EdC cache_response: cache_state: STALE_CACHE is_sync_enabled: true last_updated_at: 1773917288158 ttl_left: 258234442 created: 1636669297674 git_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_connector_ref: . git_default_branch: main git_default_branch_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_id: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_url: '' git_default_branch_update_error: 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_updated: 1636669297674 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: Et quis. polciy_size_in_bytes: 6239048642669652000 policy_package_name: Expedita optio ex qui perferendis at perferendis. policy_set_count: 3 project_id: test-project rego: '' unique_id: Sit qui deserunt sed atque rerum. updated: 1636669297674 '400': description: 'GitError: Bad Request response.' content: application/json: schema: $ref: '#/components/schemas/PolicyManagementError' 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]. '401': description: 'Unauthorized: Unauthorized response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '403': description: 'Forbidden: Forbidden response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '404': description: 'NotFound: Not Found response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '409': description: 'PolicyReferenced: Conflict response.' content: application/json: schema: $ref: '#/components/schemas/PolicyReferencedResult' example: message: Iusto ut exercitationem delectus perferendis aut atque. referenced_by: - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. '500': description: 'ScopeInfoError: Internal Server Error response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '502': description: 'BadGateway: Bad Gateway response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' security: - jwt_header_Authorization: - core_governancePolicy_edit - api_key_header_x-api-key: [] summary: Policies#move policy x-summary-source: derived /pm/api/v1/policies/{identifier}: delete: tags: - Policies description: Delete a policy by identifier. Returns 409 Conflict if the policy is referenced by policy sets (unless force=true). operationId: policies#delete parameters: - name: force in: query description: Force deletion even if the policy is referenced by policy sets allowEmptyValue: true schema: type: boolean description: Force deletion even if the policy is referenced by policy sets default: false example: false example: false - name: accountIdentifier in: query description: Harness account ID allowEmptyValue: true schema: type: string description: Harness account ID default: '' example: eBqAoNchMLKigC_qZ5EdC example: eBqAoNchMLKigC_qZ5EdC - name: orgIdentifier in: query description: Harness organization ID allowEmptyValue: true schema: type: string description: Harness organization ID default: '' example: test-org example: test-org - name: projectIdentifier in: query description: Harness project ID allowEmptyValue: true schema: type: string description: Harness project ID default: '' example: test-project example: test-project - name: identifier in: path description: Identifier of the policy required: true schema: type: string description: Identifier of the policy example: policy-1 minLength: 1 examples: default: summary: default value: policy-1 - name: x-api-key in: header description: Harness PAT key used to perform authorization allowEmptyValue: true schema: type: string description: Harness PAT key used to perform authorization example: Iure consectetur odio. example: Saepe veniam vero aut distinctio omnis. responses: '204': description: No Content response. '400': description: 'GitError: Bad Request response.' content: application/json: schema: $ref: '#/components/schemas/PolicyManagementError' 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]. '401': description: 'Unauthorized: Unauthorized response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '403': description: 'Forbidden: Forbidden response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '404': description: 'NotFound: Not Found response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '409': description: 'PolicyReferenced: Conflict response.' content: application/json: schema: $ref: '#/components/schemas/PolicyReferencedResult' example: message: Quod qui quod doloremque aspernatur. referenced_by: - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. '500': description: 'ScopeInfoError: Internal Server Error response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '502': description: 'BadGateway: Bad Gateway response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' security: - jwt_header_Authorization: - core_governancePolicy_delete - api_key_header_x-api-key: [] summary: Policies#delete x-summary-source: derived get: tags: - Policies description: Find a policy by identifier operationId: policies#find parameters: - name: accountIdentifier in: query description: Harness account ID allowEmptyValue: true schema: type: string description: Harness account ID default: '' example: eBqAoNchMLKigC_qZ5EdC example: eBqAoNchMLKigC_qZ5EdC - name: orgIdentifier in: query description: Harness organization ID allowEmptyValue: true schema: type: string description: Harness organization ID default: '' example: test-org example: test-org - name: projectIdentifier in: query description: Harness project ID allowEmptyValue: true schema: type: string description: Harness project ID default: '' example: test-project example: test-project - name: git_branch in: query description: The git branch the policy resides in allowEmptyValue: true schema: type: string description: The git branch the policy resides in example: main example: main - name: show_summary in: query description: "Setting to true returns the metadata about the\n\t\t\t requested policy including the information held about the status of this policy in the default branch.\n\t\t\t git_branch is ignored as no git operation takes place." allowEmptyValue: true schema: type: boolean description: "Setting to true returns the metadata about the\n\t\t\t requested policy including the information held about the status of this policy in the default branch.\n\t\t\t git_branch is ignored as no git operation takes place." example: true example: true - name: identifier in: path description: Identifier of the policy to retrieve required: true schema: type: string description: Identifier of the policy to retrieve example: policy-1 minLength: 1 examples: default: summary: default value: policy-1 - name: x-api-key in: header description: Harness PAT key used to perform authorization allowEmptyValue: true schema: type: string description: Harness PAT key used to perform authorization example: Quia amet sapiente. example: Explicabo illum sed. responses: '200': description: OK response. content: application/json: schema: $ref: '#/components/schemas/PolicyManagementPolicy' example: account_id: eBqAoNchMLKigC_qZ5EdC cache_response: cache_state: STALE_CACHE is_sync_enabled: true last_updated_at: 1773917288158 ttl_left: 258234442 created: 1636669297674 git_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_connector_ref: . git_default_branch: main git_default_branch_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_id: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_url: '' git_default_branch_update_error: 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_updated: 1636669297674 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: Autem inventore ut ea voluptates sunt. polciy_size_in_bytes: 3949905420204983300 policy_package_name: Aut ab vitae voluptate incidunt natus ullam. policy_set_count: 3 project_id: test-project rego: '' unique_id: Error et rerum nam. updated: 1636669297674 '400': description: 'GitError: Bad Request response.' content: application/json: schema: $ref: '#/components/schemas/PolicyManagementError' 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]. '401': description: 'Unauthorized: Unauthorized response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '403': description: 'Forbidden: Forbidden response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '404': description: 'NotFound: Not Found response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '409': description: 'PolicyReferenced: Conflict response.' content: application/json: schema: $ref: '#/components/schemas/PolicyReferencedResult' example: message: Sed ut dolor ullam suscipit enim et. referenced_by: - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. '500': description: 'ScopeInfoError: Internal Server Error response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '502': description: 'BadGateway: Bad Gateway response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' security: - jwt_header_Authorization: - core_governancePolicy_view - api_key_header_x-api-key: [] summary: Policies#find x-summary-source: derived patch: tags: - Policies description: Update a policy by identifier operationId: policies#update parameters: - name: git_commit_msg in: query description: The commit message used in git when creating the policy allowEmptyValue: true schema: type: string description: The commit message used in git when creating the policy example: harness policy commit msg example: harness policy commit msg - name: git_is_new_branch in: query description: A flag to determine if the api should try and commit to a new branch allowEmptyValue: true schema: type: boolean description: A flag to determine if the api should try and commit to a new branch example: true example: true - name: git_base_branch in: query description: If committing to a new branch, git_base_branch tells the api which branch to base the new branch from allowEmptyValue: true schema: type: string description: If committing to a new branch, git_base_branch tells the api which branch to base the new branch from example: main example: main - name: git_branch in: query description: The git branch the policy resides in allowEmptyValue: true schema: type: string description: The git branch the policy resides in example: main example: main - name: git_commit_sha in: query description: The existing commit sha of the file being updated allowEmptyValue: true schema: type: string description: The existing commit sha of the file being updated example: 1369b45c20fc685113adcfd1a08a914180ff3c0d example: 1369b45c20fc685113adcfd1a08a914180ff3c0d - name: git_file_id in: query description: The existing file id of the file being updated, not required for bitbucket files allowEmptyValue: true schema: type: string description: The existing file id of the file being updated, not required for bitbucket files example: 1369b45c20fc685113adcfd1a08a914180ff3c0d example: 1369b45c20fc685113adcfd1a08a914180ff3c0d - name: accountIdentifier in: query description: Harness account ID allowEmptyValue: true schema: type: string description: Harness account ID default: '' example: eBqAoNchMLKigC_qZ5EdC example: eBqAoNchMLKigC_qZ5EdC - name: orgIdentifier in: query description: Harness organization ID allowEmptyValue: true schema: type: string description: Harness organization ID default: '' example: test-org example: test-org - name: projectIdentifier in: query description: Harness project ID allowEmptyValue: true schema: type: string description: Harness project ID default: '' example: test-project example: test-project - name: identifier in: path description: Identifier of the policy required: true schema: type: string description: Identifier of the policy example: policy-1 example: policy-1 - name: x-api-key in: header description: Harness PAT key used to perform authorization allowEmptyValue: true schema: type: string description: Harness PAT key used to perform authorization example: Aut hic odio iste ea. example: Tempore sed saepe. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateRequestBody' example: name: Check that an approval step is present rego: 'package test deny["should say hello world"] {input.message != "world"}' responses: '204': description: No Content response. '400': description: 'GitError: Bad Request response.' content: application/json: schema: $ref: '#/components/schemas/PolicyManagementError' 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]. '401': description: 'Unauthorized: Unauthorized response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '403': description: 'Forbidden: Forbidden response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '404': description: 'NotFound: Not Found response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '409': description: 'PolicyReferenced: Conflict response.' content: application/json: schema: $ref: '#/components/schemas/PolicyReferencedResult' example: message: Unde corrupti et consequatur laboriosam saepe officiis. referenced_by: - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. '500': description: 'ScopeInfoError: Internal Server Error response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '502': description: 'BadGateway: Bad Gateway response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' security: - jwt_header_Authorization: - core_governancePolicy_edit - api_key_header_x-api-key: [] summary: Policies#update x-summary-source: derived /pm/api/v1/policies/{identifier}/policysets: get: tags: - Policies description: List all policy sets that reference a specific policy operationId: policies#list_policy_sets parameters: - name: accountIdentifier in: query description: Harness account ID allowEmptyValue: true schema: type: string description: Harness account ID default: '' example: eBqAoNchMLKigC_qZ5EdC example: eBqAoNchMLKigC_qZ5EdC - name: orgIdentifier in: query description: Harness organization ID allowEmptyValue: true schema: type: string description: Harness organization ID default: '' example: test-org example: test-org - name: projectIdentifier in: query description: Harness project ID allowEmptyValue: true schema: type: string description: Harness project ID default: '' example: test-project example: test-project - name: per_page in: query description: Number of results per page allowEmptyValue: true schema: type: integer description: Number of results per page default: 50 example: 20 format: int64 minimum: 1 maximum: 100 example: 20 - name: page in: query description: Page number (starting from 0) allowEmptyValue: true schema: type: integer description: Page number (starting from 0) default: 0 example: 4 format: int64 minimum: 0 example: 4 - name: searchTerm in: query description: Filter results by partial name match allowEmptyValue: true schema: type: string description: Filter results by partial name match default: '' example: poli example: poli - name: sort in: query description: Sort order for results allowEmptyValue: true schema: type: string description: Sort order for results default: name,ASC example: name,ASC enum: - name,ASC - name,DESC - updated,ASC - updated,DESC example: updated,ASC - name: identifier in: path description: Identifier for the policy required: true schema: type: string description: Identifier for the policy example: policy-1 example: policy-1 - name: x-api-key in: header description: Harness PAT key used to perform authorization allowEmptyValue: true schema: type: string description: Harness PAT key used to perform authorization example: Quis ut cum sunt. example: Accusantium fugiat sequi non blanditiis. responses: '200': description: OK response. headers: Link: description: Link-based paging schema: type: string description: Link-based paging example: '' example: '' X-Page-Index: description: 'Deprecated: Please use pageNumber / X-Page-Number instead. Same value as pageNumber; kept for legacy UI clients.' schema: type: integer description: 'Deprecated: Please use pageNumber / X-Page-Number instead. Same value as pageNumber; kept for legacy UI clients.' example: 4 format: int64 example: 4 X-Page-Item-Count: description: Number of results in this page schema: type: integer description: Number of results in this page example: 20 format: int64 example: 20 X-Page-Number: description: Current page number (0-based). Harness standard pagination header X-Page-Number. schema: type: integer description: Current page number (0-based). Harness standard pagination header X-Page-Number. example: 4 format: int64 example: 4 X-Page-Size: description: Requested page size. Harness standard pagination header X-Page-Size. schema: type: integer description: Requested page size. Harness standard pagination header X-Page-Size. example: 20 format: int64 example: 20 X-Total-Elements: description: Total number of results available. Harness standard pagination header X-Total-Elements. schema: type: integer description: Total number of results available. Harness standard pagination header X-Total-Elements. example: 230 format: int64 example: 230 X-Total-Items: description: 'Deprecated: Please use totalElements / X-Total-Elements instead. Same value as totalElements; kept for legacy UI clients.' schema: type: integer description: 'Deprecated: Please use totalElements / X-Total-Elements instead. Same value as totalElements; kept for legacy UI clients.' example: 230 format: int64 example: 230 X-Total-Pages: description: Total pages available schema: type: integer description: Total pages available example: 12 format: int64 example: 12 content: application/json: schema: type: array items: $ref: '#/components/schemas/PolicyToPolicySet' example: - account_id: eBqAoNchMLKigC_qZ5EdC action: onrun created: 1636669297674 enabled: true identifier: policyset-1 name: Production Policies org_id: test-org project_id: test-project updated: 1636669297674 - account_id: eBqAoNchMLKigC_qZ5EdC action: onrun created: 1636669297674 enabled: true identifier: policyset-1 name: Production Policies org_id: test-org project_id: test-project updated: 1636669297674 - account_id: eBqAoNchMLKigC_qZ5EdC action: onrun created: 1636669297674 enabled: true identifier: policyset-1 name: Production Policies org_id: test-org project_id: test-project updated: 1636669297674 - account_id: eBqAoNchMLKigC_qZ5EdC action: onrun created: 1636669297674 enabled: true identifier: policyset-1 name: Production Policies org_id: test-org project_id: test-project updated: 1636669297674 example: - account_id: eBqAoNchMLKigC_qZ5EdC action: onrun created: 1636669297674 enabled: true identifier: policyset-1 name: Production Policies org_id: test-org project_id: test-project updated: 1636669297674 - account_id: eBqAoNchMLKigC_qZ5EdC action: onrun created: 1636669297674 enabled: true identifier: policyset-1 name: Production Policies org_id: test-org project_id: test-project updated: 1636669297674 - account_id: eBqAoNchMLKigC_qZ5EdC action: onrun created: 1636669297674 enabled: true identifier: policyset-1 name: Production Policies org_id: test-org project_id: test-project updated: 1636669297674 - account_id: eBqAoNchMLKigC_qZ5EdC action: onrun created: 1636669297674 enabled: true identifier: policyset-1 name: Production Policies org_id: test-org project_id: test-project updated: 1636669297674 '400': description: 'GitError: Bad Request response.' content: application/json: schema: $ref: '#/components/schemas/PolicyManagementError' 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]. '401': description: 'Unauthorized: Unauthorized response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '403': description: 'Forbidden: Forbidden response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '404': description: 'NotFound: Not Found response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '409': description: 'PolicyReferenced: Conflict response.' content: application/json: schema: $ref: '#/components/schemas/PolicyReferencedResult' example: message: Deserunt eius omnis voluptate debitis quo. referenced_by: - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. - account_id: Quis aliquam fugit facere. identifier: Non et vitae omnis id. name: Quod itaque. org_id: Laborum iure. project_id: Corporis sequi consequatur. '500': description: 'ScopeInfoError: Internal Server Error response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' '502': description: 'BadGateway: Bad Gateway response.' content: application/vnd.goa.error: schema: $ref: '#/components/schemas/PolicyManagementError' security: - jwt_header_Authorization: - core_governancePolicy_view - api_key_header_x-api-key: [] summary: Policies#list policy sets x-summary-source: derived components: schemas: PolicyReferencedResult: type: object properties: message: type: string description: Human-readable warning message example: Voluptatem esse eos perspiciatis qui. referenced_by: type: array items: $ref: '#/components/schemas/PolicySetRef' description: Policy sets that reference this policy example: - account_id: Rem quo est. identifier: Non voluptatem. name: Illum tenetur aut officiis. org_id: Vel in dolor voluptatem qui et voluptatum. project_id: Repellendus ullam similique velit dolorum eos amet. - account_id: Rem quo est. identifier: Non voluptatem. name: Illum tenetur aut officiis. org_id: Vel in dolor voluptatem qui et voluptatum. project_id: Repellendus ullam similique velit dolorum eos amet. - account_id: Rem quo est. identifier: Non voluptatem. name: Illum tenetur aut officiis. org_id: Vel in dolor voluptatem qui et voluptatum. project_id: Repellendus ullam similique velit dolorum eos amet. - account_id: Rem quo est. identifier: Non voluptatem. name: Illum tenetur aut officiis. org_id: Vel in dolor voluptatem qui et voluptatum. project_id: Repellendus ullam similique velit dolorum eos amet. description: Error returned when deleting a policy that is referenced by policy sets example: message: Blanditiis facere itaque. referenced_by: - account_id: Rem quo est. identifier: Non voluptatem. name: Illum tenetur aut officiis. org_id: Vel in dolor voluptatem qui et voluptatum. project_id: Repellendus ullam similique velit dolorum eos amet. - account_id: Rem quo est. identifier: Non voluptatem. name: Illum tenetur aut officiis. org_id: Vel in dolor voluptatem qui et voluptatum. project_id: Repellendus ullam similique velit dolorum eos amet. - account_id: Rem quo est. identifier: Non voluptatem. name: Illum tenetur aut officiis. org_id: Vel in dolor voluptatem qui et voluptatum. project_id: Repellendus ullam similique velit dolorum eos amet. required: - message - referenced_by GitErrorResult: type: object properties: explanation: type: string description: the explanation of the error example: File with given filepath [file.rego] already exists in Github, thus couldn't create a new file hint: type: string description: 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]. message: type: string description: 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]. 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]. required: - message - explanation - hint PolicyManagementError: type: object properties: fault: type: boolean description: Is the error a server-side fault? example: true id: type: string description: ID is a unique identifier for this particular occurrence of the problem. example: 123abc message: type: string description: Message is a human-readable explanation specific to this occurrence of the problem. example: parameter 'p' must be an integer name: type: string description: Name is the name of this class of errors. example: bad_request temporary: type: boolean description: Is the error temporary? example: true timeout: type: boolean description: Is the error a timeout? example: true example: fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request temporary: true timeout: false required: - name - id - message - temporary - timeout - fault CreateRequestBody: type: object properties: git_connector_ref: type: string description: The harness connector used for authenticating on the git provider example: . git_path: type: string description: The path to the file in the git repo example: .harness/policy.rego git_repo: type: string description: The git repo the policy resides in example: github.com/org/repo identifier: type: string description: Identifier for the policy example: policy-1 minLength: 1 name: type: string description: Name of the policy example: Check that an approval step is present minLength: 1 rego: type: string description: Rego that defines the policy example: 'package test deny["should say hello world"] {input.message != "world"}' example: git_connector_ref: . git_path: .harness/policy.rego git_repo: github.com/org/repo identifier: policy-1 name: Check that an approval step is present rego: 'package test deny["should say hello world"] {input.message != "world"}' required: - name - identifier MovePolicyRequestBody: type: object properties: git_base_branch: type: string description: If committing to a new branch, git_base_branch tells the api which branch to base the new branch from example: main git_branch: type: string description: The git branch to commit the policy to example: main git_commit_msg: type: string description: The commit message used in git when moving the policy example: Move policy to remote git_connector_ref: type: string description: The harness connector used for authenticating on the git provider example: github_connector git_is_new_branch: type: boolean description: A flag to determine if the api should try and commit to a new branch example: false git_path: type: string description: The path to the file in the git repo example: .harness/policy.rego git_repo: type: string description: The git repo to store the policy in example: github.com/org/repo example: git_base_branch: main git_branch: main git_commit_msg: Move policy to remote git_connector_ref: github_connector git_is_new_branch: false git_path: .harness/policy.rego git_repo: github.com/org/repo required: - git_repo - git_branch - git_path - git_commit_msg PolicyManagementPolicy: type: object properties: account_id: type: string description: Harness account ID associated with this policy default: '' example: eBqAoNchMLKigC_qZ5EdC cache_response: $ref: '#/components/schemas/CacheResponse' created: type: integer description: Time the policy was created example: 1636669297674 format: int64 git_commit_sha: type: string description: The commit sha of the commit that last effected the file example: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_connector_ref: type: string description: The harness connector used for authenticating on the git provider example: . git_default_branch: type: string description: The default branch, the service pulls in changes from this branch for policy evaluation example: main git_default_branch_commit_sha: type: string description: The commit sha of the commit that last effected the file in the default branch example: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_id: type: string description: The file id of the file in the default branch, may be empty for bitbucket files example: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_url: type: string description: The url of the file in the default branch example: '' git_default_branch_update_error: $ref: '#/components/schemas/GitErrorResult' git_default_branch_updated: type: integer description: The last time the service successfully pulled in changes from the default branch example: 1636669297674 format: int64 git_file_id: type: string description: The file id of the file, may be empty for bitbucket files example: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_file_url: type: string description: The url of the file on the fit provider example: '' git_path: type: string description: The path to the file in the git repo example: .harness/policy.rego git_repo: type: string description: The git repo the policy resides in example: github.com/org/repo,omitempty identifier: type: string description: identifier of the policy example: policy-1 minLength: 1 name: type: string description: Name of the policy example: Pipeline Approval minLength: 1 org_id: type: string description: Harness organization ID associated with this policy default: '' example: test-org parent_unique_id: type: string description: Parent unique identifier for the policy example: Laborum reprehenderit aliquam voluptatem. polciy_size_in_bytes: type: integer description: Size of the policy in bytes example: 1710811858129014800 format: int64 policy_package_name: type: string description: Package name of the policy example: Sequi blanditiis. policy_set_count: type: integer description: Count of policy sets associated with this policy example: 3 format: int64 project_id: type: string description: Harness project ID associated with this policy default: '' example: test-project rego: type: string description: Rego that defines the policy example: '' minLength: 1 unique_id: type: string description: Unique identifier for the policy example: Sit consequatur ea modi ullam a placeat. updated: type: integer description: Time the policy was last updated example: 1636669297674 format: int64 example: account_id: eBqAoNchMLKigC_qZ5EdC cache_response: cache_state: STALE_CACHE is_sync_enabled: true last_updated_at: 1773917288158 ttl_left: 258234442 created: 1636669297674 git_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_connector_ref: . git_default_branch: main git_default_branch_commit_sha: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_id: 1369b45c20fc685113adcfd1a08a914180ff3c0d git_default_branch_file_url: '' git_default_branch_update_error: 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_updated: 1636669297674 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: Eius voluptates maxime. polciy_size_in_bytes: 696467044857856100 policy_package_name: Dolorem tempore repellat. policy_set_count: 3 project_id: test-project rego: '' unique_id: Molestiae numquam consequatur aut temporibus rerum. updated: 1636669297674 required: - identifier - name - rego - created - updated - account_id - org_id - project_id PolicySetRef: type: object properties: account_id: type: string description: Harness account ID example: Ut ut officia quia alias. identifier: type: string description: Identifier of the referencing policy set example: Quisquam nemo eum saepe sint occaecati. name: type: string description: Name of the referencing policy set example: Voluptatem praesentium. org_id: type: string description: Harness organization ID default: '' example: Reiciendis at magni ex nisi ut. project_id: type: string description: Harness project ID default: '' example: Eos harum at suscipit ut molestias. description: Lightweight reference to a policy set (used in error responses) example: account_id: Ut qui optio. identifier: Nostrum sapiente corporis ipsam eligendi laborum. name: Itaque vel maiores et qui nobis. org_id: Natus deserunt nam. project_id: Saepe molestiae molestias cupiditate odit eos. required: - identifier - name - account_id UpdateRequestBody: type: object properties: name: type: string description: The name of the policy example: Check that an approval step is present rego: type: string description: The rego that defines the policy example: 'package test deny["should say hello world"] {input.message != "world"}' example: name: Check that an approval step is present rego: 'package test deny["should say hello world"] {input.message != "world"}' CacheResponse: type: object properties: cache_state: type: string description: Cache state (UNKNOWN_STATE, VALID_CACHE, STALE_CACHE) example: STALE_CACHE is_sync_enabled: type: boolean description: Whether sync is enabled for this resource example: true last_updated_at: type: integer description: Timestamp (millis) when cache was last updated example: 1773917288158 format: int64 ttl_left: type: integer description: Remaining time-to-live in milliseconds example: 258234442 format: int64 description: Cache metadata from GitX getFile RPC example: cache_state: STALE_CACHE is_sync_enabled: true last_updated_at: 1773917288158 ttl_left: 258234442 PolicyToPolicySet: type: object properties: account_id: type: string description: Harness account ID associated with this policy set default: '' example: eBqAoNchMLKigC_qZ5EdC action: type: string description: Action that triggers the policy set example: onrun minLength: 1 created: type: integer description: Time the policy set was created example: 1636669297674 format: int64 enabled: type: boolean description: Only enabled policy sets are evaluated when evaluating by type/action example: true identifier: type: string description: Identifier of the policy set example: policyset-1 minLength: 1 name: type: string description: Name of the policy set example: Production Policies minLength: 1 org_id: type: string description: Harness organization ID associated with this policy set default: '' example: test-org project_id: type: string description: Harness project ID associated with this policy set default: '' example: test-project updated: type: integer description: Time the policy set was last updated example: 1636669297674 format: int64 example: account_id: eBqAoNchMLKigC_qZ5EdC action: onrun created: 1636669297674 enabled: true identifier: policyset-1 name: Production Policies org_id: test-org project_id: test-project updated: 1636669297674 required: - identifier - name - action - enabled - created - updated - account_id - org_id - project_id securitySchemes: x-api-key: name: x-api-key type: apiKey in: header description: API key is a token provided while making the API calls. This is used to authenticate the client at the exposed endpoint. externalDocs: description: Find out more about Swagger url: http://swagger.io x-stoplight: id: oc91t4vrfnjyi x-tagGroups: - name: Organizations tags: - Organization - name: Projects tags: - Org Project - Project - name: Secrets tags: - Account Secret - Org Secret - Project Secret - Secrets - name: Connectors tags: - Account Connector - Org Connector - Project Connector - Connectors - GoogleSecretManagerConnector - name: Roles tags: - Account Roles - Organization Roles - Project Roles - Roles - name: Resource Groups tags: - Account Resource Groups - Organization Resource Groups - Project Resource Groups - Filter Resource Groups - Harness Resource Group - Zendesk - name: Role Assignments tags: - Account Role Assignments - Org Role Assignments - Project Role Assignments - Role Assignments - name: Platform tags: - Access Control List - Account Banner - Account Banner - Account Licensed Modules - Account License Type - Account Webhooks - AccountSetting - Accounts - Analyze Account Access Policy - Analyze Organization Access Policy - Analyze Project Access Policy - ApiKey - Audit - AuditFilters - Authentication Settings - Canny - Devops Essentials License Data By Account - EULA - Filter - Harness Resource Type - Invite - IP Allowlist - Nextgen Ldap - Notification Channels - Notification Rules - OIDC - Oidc-Access-Token - Oidc-ID-Token - Org Webhooks - Permissions - Project Webhooks - Secret Managers - Service Account - Setting - SMTP - Source Code Manager - Token - User - User Group - Variables - name: Delegate tags: - Agent mTLS Endpoint Management - Delegate Download Resource - Delegate Group Tags Resource - Delegate Setup Resource - Delegate Token Resource - name: Pipelines tags: - Pipelines - Input Sets - Approvals - Pipeline Execution - Pipeline Dashboard - Pipeline Input Set - Pipeline - Pipeline Execution Details - Pipeline Execute - Pipeline Refresh - Pipeline data retention - Triggers - TriggersEvents - Webhook Triggers - Webhook Event Handler - DryRunPipeline - name: Artifact Registry tags: - Registries - Artifacts - Docker Artifacts - Helm Artifacts - quarantine - Webhooks - Spaces - Replication - Registry V3 - Registries - Registry V3 - Packages - Registry V3 - Versions - Registry V3 - Files - Registry V3 - Metadata - Registry V3 - Firewall - Registry V3 - Transfer - name: Database DevOps tags: - Database Schema - Database Instance - Deployed State - Execution Config - Migration State - name: CD tags: - K8s Release Service Mapping - CustomDeployment - Environments - EnvironmentGroup - Infrastructures - Usage - File Store - Service Dashboard - ServiceOverrides - Rollback - tas - name: Deployment Freeze tags: - Freeze CRUD - Freeze Evaluation - Freeze Schema - name: Services tags: - Account Services - Org Services - Project Services - Services - name: Rancher Infrastructures tags: - Account Rancher Infrastructure - Org Rancher Infrastructure - Project Rancher Infrastructure - name: Templates tags: - Account Template - Org Template - Project Template - Templates - Global Templates - name: GitOps tags: - Agents - Application - Applications - Certificates - Clusters - Dashboard Aggregates - Dashboards - GnuPGP Keys - GPG Keys - Hosts - Project mappings - Projects - Reconciler - Repositories - Repository Certificates - Repository credentials - ValidateHost - name: GitX tags: - GitX Webhooks - Org Gitx Webhooks - Project Gitx Webhooks - name: CACM tags: - Anomalies Ignorelist Rule - Anomalies - BI Dashboards - Budgets - Budget Groups - Cost Categories - Cloud Accounts - K8S Connectors Metadata - Notification Settings v2 - Overview - Data Job Status - Recommendation cost settings - Unit Metric - Anomaly Comments - Cloud and AI cost anomaly details - Cloud and AI cost anomalies v2 - Cost Details - Currency Preferences - External Data Provider - AiEngine - CACM governance cost settings - Governance Enforcement Recommendation APIs - Governance Alert - Governance Overview - Governance Recommendation APIs - RuleEnforcement - Rule Executions - Rule - Rule Sets - Perspectives Folders - Perspective Reports - Perspectives - Cost Category Jira Project Mapping - Recommendations Details - Recommendations - Recommendation Jira - Recommendation Preferences - Recommendation Presets - Recommendation Servicenow - Recommendation Tags - Recommendation Ignore List - AutoStopping Rules - AutoStopping Rules V2 - AutoStopping Load Balancers - AutoStopping Fixed Schedules - AutoStopping Alerts - Commitment Orchestrator Events APIs - name: Feature Flags tags: - API Keys - Feature Flags - Targets - Target Groups - Environment Perspectives - Anomalies - Proxy - Tags - name: SRM tags: - Monitored Services - SLOs dashboard - NG SLOs - SLOs - Downtime - Srm Notification - name: Internal Developer Portal - IDP tags: - Entities - Teams - CatalogCustomProperties - Scores - DataSource - KubernetesDataPoints - AggregationRules - AppConfig - PluginInfo - LayoutProxy - Kinds - LayoutsV3 - LayoutsV4 - name: Environment Management - IDP tags: - Environment - Infrastructure - Instance - name: Custom Dashboards tags: - aida - dashboards - downloads - embed - folders - name: Policy Management tags: - dashboard - examples - policies - evaluate - evaluations - policysets - system - name: Code tags: - repository - status_checks - pullreq - upload - webhook - resource - rules - labels - name: IaCM tags: - usage - approvals - costs - executions - module-registry - workspaces - settings - tf-standard-backend - variables - name: STO tags: - Exemptions - Issues - Scans - Products - Test Targets - Target Variants - name: SEI tags: - Collection categories - Collections - Contributors - DORA - name: Git Sync (deprecated) tags: - Git Branches - Git Full Sync - Git Sync Settings - Git Sync - Git Sync Errors - name: Error Models tags: - Error Response - Governance Metadata - name: Supply Chain Security tags: - integration - PipelineInfraConfig - SBOM - Integration Step Config - Delete Step Config - Delete Repositories - Pipeline Store Config - Evidence Vault [Beta] - name: Release Management tags: - Release Groups - Releases - Orchestration Processes - Orchestration Activities - Orchestration Executions - Conflicts - Freeze - Reports - Uploads - name: Resilience Testing tags: - Actions - Action Templates - Chaos Components - Chaos Hubs - ChaosGuard Conditions - ChaosGuard Rules - DR Tests - Experiments - Experiment Templates - Faults - Fault Templates - Chaos Infrastructure - Health - Network Maps - Onboarding - Probes - Probe Templates - Chaos Recommendations - Risks