import requests
url = "https://platform.ankra.app/api/v1/org/pipelines/repositories/{repository_id}"
payload = {
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaces_only": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', workspaces_only: true})
};
fetch('https://platform.ankra.app/api/v1/org/pipelines/repositories/{repository_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://platform.ankra.app/api/v1/org/pipelines/repositories/{repository_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaces_only": true
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "github",
"owner": "<string>",
"name": "<string>",
"credential_name": "<string>",
"default_branch": "<string>",
"application_id": "<string>",
"cluster_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_trigger": {},
"merge_train_enabled": true,
"merge_train_max_cars": 4,
"workspaces_only": true
}Change a repository's CI cluster
Changes a connected repository’s CI cluster override (or clears it with null), its Workspaces-only mode, or both, without disconnecting the repository. The cluster must be a live cluster of this organisation whose agent advertises pipeline steps. It changes where the repository’s next runs go: runs already queued or running keep the cluster they were pinned to. A Workspaces-only repository starts no pipeline run from any trigger, posts no commit status or check run and records no pipeline definition, while workspaces keep working; turning the mode on is refused with 409 while a run is queued or running. Needs pipelines.manage. A browser session twin is mounted at the same path without the /api/v1 prefix (cookie authentication).
import requests
url = "https://platform.ankra.app/api/v1/org/pipelines/repositories/{repository_id}"
payload = {
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaces_only": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', workspaces_only: true})
};
fetch('https://platform.ankra.app/api/v1/org/pipelines/repositories/{repository_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://platform.ankra.app/api/v1/org/pipelines/repositories/{repository_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaces_only": true
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "github",
"owner": "<string>",
"name": "<string>",
"credential_name": "<string>",
"default_branch": "<string>",
"application_id": "<string>",
"cluster_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_trigger": {},
"merge_train_enabled": true,
"merge_train_max_cars": 4,
"workspaces_only": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The connected repository.
Body
Change a connected repository's CI cluster override, its Workspaces-only mode, or both. At least one member is named; a member left out is left unchanged. A body naming neither answers 422 with cluster_id missing.
A cluster of this organisation whose agent runs pipeline steps, or null to clear the override so the repository's runs follow the organisation's CI settings (and its CI pool) again.
true connects the repository for Ankra Workspaces only (no pipeline runs, no commit statuses or check runs, no definition of record); false makes it an ordinary pipeline repository again. Turning it on while a run is queued or running answers 409.
Response
The repository as stored.
A repository connected to Ankra Pipelines.
github, gitlab, bitbucket_cloud The linked application; null when none.
The repository's CI cluster override; null when its runs follow the organisation's CI settings.
What the trigger last decided for this repository; null when it has never decided anything.
Whether the repository's merge train is on (GET .../merge-train answers the same value with the queue).
How many pull requests the repository's merge train tests at once.
1 <= x <= 8The repository is connected for Ankra Workspaces only: no push, pull request, tag, schedule, merge train or manual dispatch starts a pipeline run for it, no commit status or check run is posted for it, and no pipeline definition is recorded for it. Workspaces (up, runs, the clone credential, workspace profiles) work as for any connected repository.