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
Body
Name at least one member. A Kubernetes quantity holds it, an empty string stops holding it, and an absent member is unchanged.
Response
Successful Response