import requests
url = "https://platform.ankra.app/api/v1/clusters/ovh/{cluster_id}/k8s-version"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/clusters/ovh/{cluster_id}/k8s-version', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/clusters/ovh/{cluster_id}/k8s-version \
--header 'Authorization: Bearer <token>'{
"current_version": "<string>",
"distribution": "<string>",
"auto_patch_upgrade_enabled": false,
"auto_patch_upgrade_last_run_at": "2023-11-07T05:31:56Z",
"auto_patch_upgrade_last_run_detail": "<string>",
"auto_patch_upgrade_last_run_status": "<string>",
"desired_version": "<string>",
"nodes": [
{
"name": "<string>",
"role": "<string>",
"state": "<string>",
"desired_version": "<string>",
"observed_version": "<string>"
}
],
"observed_version": "<string>",
"upgrade_execution": {
"blocking_pdbs": [
{
"disruptions_allowed": 123,
"name": "<string>",
"namespace": "<string>"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parked_node": "<string>",
"status": "<string>"
},
"version_drift": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get current Kubernetes version
Returns the cluster’s Kubernetes distribution with its current, desired and observed versions, whether any node still has to converge to the desired version, whether automatic patch upgrades are on, and the version of each node.
import requests
url = "https://platform.ankra.app/api/v1/clusters/ovh/{cluster_id}/k8s-version"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/clusters/ovh/{cluster_id}/k8s-version', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/clusters/ovh/{cluster_id}/k8s-version \
--header 'Authorization: Bearer <token>'{
"current_version": "<string>",
"distribution": "<string>",
"auto_patch_upgrade_enabled": false,
"auto_patch_upgrade_last_run_at": "2023-11-07T05:31:56Z",
"auto_patch_upgrade_last_run_detail": "<string>",
"auto_patch_upgrade_last_run_status": "<string>",
"desired_version": "<string>",
"nodes": [
{
"name": "<string>",
"role": "<string>",
"state": "<string>",
"desired_version": "<string>",
"observed_version": "<string>"
}
],
"observed_version": "<string>",
"upgrade_execution": {
"blocking_pdbs": [
{
"disruptions_allowed": 123,
"name": "<string>",
"namespace": "<string>"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parked_node": "<string>",
"status": "<string>"
},
"version_drift": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Response
Kubernetes version retrieved successfully
Why the sweep decided what auto_patch_upgrade_last_run_status says: the version it started and anything it went on without, the refusal, which checks could not read what, or why starting the upgrade failed; null when the sweep has not judged the cluster or recorded no reason.
What the sweep last decided: initiated (it started a patch upgrade), up_to_date (no newer patch), skipped (it started nothing for a reason that does not pass on its own: the upgrade preflight refused the hop, a choice leaves it for a person, or the cluster cannot be patched automatically; looked at again after a day), unknown (the upgrade preflight could not judge the hop: a check could not read what it judges, or the gate could not be asked; asked again after an hour) or failed (starting the upgrade failed); null until the sweep first judges the cluster.