import requests
url = "https://platform.ankra.app/api/v1/org/pipelines/repositories/{repository_id}"
payload = { "cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
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'})
};
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"
}
'{
"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": {}
}Change a repository's CI cluster
Changes a connected repository’s CI cluster override, or clears it with null, 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. 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" }
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'})
};
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"
}
'{
"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": {}
}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.
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.
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.