import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/agent/resources"
payload = {
"memory_limit": "<string>",
"memory_request": "<string>",
"cpu_limit": "<string>",
"cpu_request": "<string>"
}
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({
memory_limit: '<string>',
memory_request: '<string>',
cpu_limit: '<string>',
cpu_request: '<string>'
})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/agent/resources', 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/clusters/{cluster_id}/agent/resources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"memory_limit": "<string>",
"memory_request": "<string>",
"cpu_limit": "<string>",
"cpu_request": "<string>"
}
'{
"memory_limit": "<string>",
"memory_request": "<string>",
"cpu_limit": "<string>",
"cpu_request": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"apply_state": "not_set",
"message": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Set the cluster agent's sizing
Sets the agent container sizing Ankra holds for the cluster. Name any of memory_limit, memory_request, cpu_limit and cpu_request: a Kubernetes quantity holds the member, an empty string stops holding it (which does not change what the agent runs: it keeps its current value, carried through upgrades), and an absent member is unchanged. Limits take memory 512Mi-16Gi and CPU 100m-8; requests are capped at memory 128Mi-2Gi and CPU 50m-2 because the agent’s old pod stops before its replacement schedules. Every later agent upgrade and every install command renders the held sizing; an online agent that accepts it re-renders its own release at once and restarts onto it. The bearer twin of ankra cluster agent resources set.
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/agent/resources"
payload = {
"memory_limit": "<string>",
"memory_request": "<string>",
"cpu_limit": "<string>",
"cpu_request": "<string>"
}
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({
memory_limit: '<string>',
memory_request: '<string>',
cpu_limit: '<string>',
cpu_request: '<string>'
})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/agent/resources', 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/clusters/{cluster_id}/agent/resources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"memory_limit": "<string>",
"memory_request": "<string>",
"cpu_limit": "<string>",
"cpu_request": "<string>"
}
'{
"memory_limit": "<string>",
"memory_request": "<string>",
"cpu_limit": "<string>",
"cpu_request": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"apply_state": "not_set",
"message": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Name at least one member. A Kubernetes quantity holds it, an empty string stops holding it, and an absent member is unchanged.
Memory limit, 512Mi to 16Gi, or an empty string.
Memory request, 128Mi to 2Gi, or an empty string. Must not exceed the memory limit.
CPU limit, 100m to 8, or an empty string.
CPU request, 50m to 2, or an empty string. Must not exceed the CPU limit.
Response
Successful Response
The held memory limit as a Kubernetes quantity, or null when Ankra holds none.
The held memory request, or null when Ankra holds none.
The held CPU limit, or null when Ankra holds none.
The held CPU request, or null when Ankra holds none.
When a held value last changed, or null before the first.
What the held sizing is doing on the cluster now.
not_set, applied, pending_upgrade, agent_offline A sentence describing the apply state, to show verbatim.