import requests
url = "https://platform.ankra.app/api/v1/org/ci-settings/pool/{cluster_id}"
payload = { "weight": 500 }
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({weight: 500})
};
fetch('https://platform.ankra.app/api/v1/org/ci-settings/pool/{cluster_id}', 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/pool/{cluster_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"weight": 500
}'{
"is_pooled": true,
"members": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"weight": 500,
"is_primary": true,
"is_listed": true,
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"is_pooled": true,
"members": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"weight": 500,
"is_primary": true,
"is_listed": true,
"created_at": "2023-11-07T05:31:56Z"
}
]
}Add or re-weight a CI pool member
Lists one cluster in the organisation’s CI pool, or changes its weight. The cluster must be a live cluster of this organisation whose agent advertises pipeline steps, and in no other organisation’s pool. Answers 201 when the cluster was newly listed. Organisation admins only. A browser session twin is mounted at the same path without the /api/v1 prefix (cookie authentication; writes also need the X-Ankra-CSRF header).
import requests
url = "https://platform.ankra.app/api/v1/org/ci-settings/pool/{cluster_id}"
payload = { "weight": 500 }
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({weight: 500})
};
fetch('https://platform.ankra.app/api/v1/org/ci-settings/pool/{cluster_id}', 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/pool/{cluster_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"weight": 500
}'{
"is_pooled": true,
"members": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"weight": 500,
"is_primary": true,
"is_listed": true,
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"is_pooled": true,
"members": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"weight": 500,
"is_primary": true,
"is_listed": true,
"created_at": "2023-11-07T05:31:56Z"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The member cluster.
Body
The body of a single member write. Both the body and its weight are optional: an omitted weight keeps a listed member's weight and gives a new member 100.
The member's weight.
1 <= x <= 1000Response
The member was re-weighted; the pool as stored.
The organisation's CI cluster pool: the clusters its pipeline runs are spread across. Each run is pinned, at its first dispatch, to the least-loaded member whose agent can take a step, preferring the member where the repository last ran when the loads are within a fifth of a cluster's workers; a run never moves between clusters.