List all policies
OK response.
GitError: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
InternalServer: Internal Server Error response.
BadGateway: Bad Gateway response.
[- {
- "account_id": "eBqAoNchMLKigC_qZ5EdC",
- "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",
- "project_id": "test-project",
- "rego": "",
- "updated": 1636669297674
}, - {
- "account_id": "eBqAoNchMLKigC_qZ5EdC",
- "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",
- "project_id": "test-project",
- "rego": "",
- "updated": 1636669297674
}, - {
- "account_id": "eBqAoNchMLKigC_qZ5EdC",
- "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",
- "project_id": "test-project",
- "rego": "",
- "updated": 1636669297674
}
]
Create a policy
Created response.
GitError: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
InternalServer: Internal Server Error response.
BadGateway: Bad Gateway response.
{- "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\ndeny[\"should say hello world\"] {input.message != \"world\"}"
}
{- "account_id": "eBqAoNchMLKigC_qZ5EdC",
- "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",
- "project_id": "test-project",
- "rego": "",
- "updated": 1636669297674
}
Delete a policy by identifier
No Content response.
GitError: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
InternalServer: Internal Server Error response.
BadGateway: Bad Gateway response.
{- "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]."
}
Find a policy by identifier
OK response.
GitError: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
InternalServer: Internal Server Error response.
BadGateway: Bad Gateway response.
{- "account_id": "eBqAoNchMLKigC_qZ5EdC",
- "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",
- "project_id": "test-project",
- "rego": "",
- "updated": 1636669297674
}
Update a policy by identifier
No Content response.
GitError: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
InternalServer: Internal Server Error response.
BadGateway: Bad Gateway response.
{- "name": "Check that an approval step is present",
- "rego": "package test\ndeny[\"should say hello world\"] {input.message != \"world\"}"
}
{- "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]."
}