import requests
url = "https://platform.ankra.app/api/v1/org/ci-settings"
payload = {
"ci_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ci_max_parallel_runs": 32,
"ci_max_parallel_steps": 128,
"ci_allowed_image_prefixes": ["<string>"],
"ci_artifact_retention_days": 183,
"ci_cache_retention_days": 183,
"ci_run_retention_days": 186,
"ci_image_gate": "<string>",
"ci_ignore_unfixed": True,
"ci_egress_allowed_cidrs": ["<string>"],
"ci_always_run_stages": ["<string>"],
"ci_full_run_on_default_branch": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ci_cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ci_max_parallel_runs: 32,
ci_max_parallel_steps: 128,
ci_allowed_image_prefixes: ['<string>'],
ci_artifact_retention_days: 183,
ci_cache_retention_days: 183,
ci_run_retention_days: 186,
ci_image_gate: '<string>',
ci_ignore_unfixed: true,
ci_egress_allowed_cidrs: ['<string>'],
ci_always_run_stages: ['<string>'],
ci_full_run_on_default_branch: true
})
};
fetch('https://platform.ankra.app/api/v1/org/ci-settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/ci-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ci_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ci_max_parallel_runs": 32,
"ci_max_parallel_steps": 128,
"ci_allowed_image_prefixes": [
"<string>"
],
"ci_artifact_retention_days": 183,
"ci_cache_retention_days": 183,
"ci_run_retention_days": 186,
"ci_image_gate": "<string>",
"ci_ignore_unfixed": true,
"ci_egress_allowed_cidrs": [
"<string>"
],
"ci_always_run_stages": [
"<string>"
],
"ci_full_run_on_default_branch": true
}
'{
"ci_cluster_id": "<string>",
"ci_cluster_name": "<string>",
"ci_build_fallback": "<string>",
"ci_max_parallel_runs": 123,
"ci_max_parallel_steps": 123,
"ci_allowed_image_prefixes": [
"<string>"
],
"ci_artifact_retention_days": 123,
"ci_cache_retention_days": 123,
"ci_run_retention_days": 123,
"ci_image_gate": "<string>",
"ci_ignore_unfixed": true,
"ci_egress_allowed_cidrs": [
"<string>"
],
"ci_always_run_stages": [
"<string>"
],
"ci_full_run_on_default_branch": true,
"ci_skip_markers": "<string>",
"platform_builds_enabled": true,
"is_default": true,
"updated_at": "2023-11-07T05:31:56Z",
"workspace_sandbox_warning": "<string>"
}Update the organisation's CI settings
Changes the named CI settings and leaves the rest. Organisation admins only. A setting out of range, a cluster outside the organisation or a body naming platform_builds_enabled answers 422 against that member.
import requests
url = "https://platform.ankra.app/api/v1/org/ci-settings"
payload = {
"ci_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ci_max_parallel_runs": 32,
"ci_max_parallel_steps": 128,
"ci_allowed_image_prefixes": ["<string>"],
"ci_artifact_retention_days": 183,
"ci_cache_retention_days": 183,
"ci_run_retention_days": 186,
"ci_image_gate": "<string>",
"ci_ignore_unfixed": True,
"ci_egress_allowed_cidrs": ["<string>"],
"ci_always_run_stages": ["<string>"],
"ci_full_run_on_default_branch": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ci_cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ci_max_parallel_runs: 32,
ci_max_parallel_steps: 128,
ci_allowed_image_prefixes: ['<string>'],
ci_artifact_retention_days: 183,
ci_cache_retention_days: 183,
ci_run_retention_days: 186,
ci_image_gate: '<string>',
ci_ignore_unfixed: true,
ci_egress_allowed_cidrs: ['<string>'],
ci_always_run_stages: ['<string>'],
ci_full_run_on_default_branch: true
})
};
fetch('https://platform.ankra.app/api/v1/org/ci-settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/ci-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ci_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ci_max_parallel_runs": 32,
"ci_max_parallel_steps": 128,
"ci_allowed_image_prefixes": [
"<string>"
],
"ci_artifact_retention_days": 183,
"ci_cache_retention_days": 183,
"ci_run_retention_days": 186,
"ci_image_gate": "<string>",
"ci_ignore_unfixed": true,
"ci_egress_allowed_cidrs": [
"<string>"
],
"ci_always_run_stages": [
"<string>"
],
"ci_full_run_on_default_branch": true
}
'{
"ci_cluster_id": "<string>",
"ci_cluster_name": "<string>",
"ci_build_fallback": "<string>",
"ci_max_parallel_runs": 123,
"ci_max_parallel_steps": 123,
"ci_allowed_image_prefixes": [
"<string>"
],
"ci_artifact_retention_days": 123,
"ci_cache_retention_days": 123,
"ci_run_retention_days": 123,
"ci_image_gate": "<string>",
"ci_ignore_unfixed": true,
"ci_egress_allowed_cidrs": [
"<string>"
],
"ci_always_run_stages": [
"<string>"
],
"ci_full_run_on_default_branch": true,
"ci_skip_markers": "<string>",
"platform_builds_enabled": true,
"is_default": true,
"updated_at": "2023-11-07T05:31:56Z",
"workspace_sandbox_warning": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
At least one setting must be named; an absent member keeps its stored value. platform_builds_enabled is Ankra's grant and is refused here.
Cluster pipeline steps run on; null clears the choice.
platform_builders, none 1 <= x <= 641 <= x <= 256502001 <= x <= 3651 <= x <= 3657 <= x <= 365Which image findings block a publish.
3250100everywhere, except_default_branch, never Response
The CI settings after the change.
The organisation's Ankra Pipelines settings. ci_cluster_id and ci_cluster_name are null when no pipeline cluster is chosen; ci_cluster_name alone is null when the chosen cluster was deleted. is_default reports that every setting is Ankra's default. platform_builds_enabled is Ankra's grant of the platform build lane, not a setting.