import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/agent/upgrade"
payload = {
"allow_downgrade": False,
"version": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({allow_downgrade: false, version: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/agent/upgrade', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/agent/upgrade \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allow_downgrade": false,
"version": "<string>"
}
'{
"status": "<string>",
"message": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Upgrade the cluster agent
Sends the cluster agent an upgrade command and returns its acknowledgement. Without a body it installs the latest stable release, or re-renders the agent at the release it runs when that is newer, so a canary on a release candidate is never walked back. version names an exact release; one older than the running release answers 409 unless allow_downgrade is set, and a release that is neither published nor running answers 422. Requires agents.manage; answers 503 when the cluster is offline or has no agent and 504 when the agent does not respond in time.
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/agent/upgrade"
payload = {
"allow_downgrade": False,
"version": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({allow_downgrade: false, version: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/agent/upgrade', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/agent/upgrade \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allow_downgrade": false,
"version": "<string>"
}
'{
"status": "<string>",
"message": "<string>"
}{
"detail": "Cluster not found"
}{
"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
Optional body of an agent upgrade. Without a body the platform installs the latest stable release, or keeps the release the agent runs when that is newer, so an upgrade never moves an agent backwards. Naming an older release needs allow_downgrade.