import requests
url = "https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/addons/{addon_name}/rollback"
payload = {
"from_version": "<string>",
"to_version": "<string>",
"reason": "<string>"
}
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({from_version: '<string>', to_version: '<string>', reason: '<string>'})
};
fetch('https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/addons/{addon_name}/rollback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/addons/{addon_name}/rollback \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"from_version": "<string>",
"to_version": "<string>",
"reason": "<string>"
}
'{
"detail": "Cluster not found"
}{
"detail": "<string>",
"error_code": "<string>",
"declared_version": "<string>"
}{
"detail": "<string>",
"error_code": "<string>",
"declared_version": "<string>"
}{
"detail": "<string>",
"error_code": "<string>",
"declared_version": "<string>"
}Roll back an add-on's chart version
Moves one add-on back from the chart version its stack declares now (from_version) to an older one (to_version), for the reason a person gives, by rewriting that one member in its owning stack. The values are kept as stored. It is gated as the upgrade route is (session, CSRF header, the organisation and project gate) and needs stacks.write on the cluster. The write is recorded as a declared rollback with its reason. Answers the stack write payload with addon_name, previous_chart_version, chart_version and reason; operation_id is null when no deploy could start yet (another deploy of the add-on is still running, or the cluster cannot take one), and the reconciler starts it later. When the rollback is saved but its push to the cluster’s GitOps repository fails or is deferred, the answer is 422 with error_code GIT_PUSH_FAILED or GIT_PUSH_DEFERRED, and still carries the saved versions. Refusals carry an error_code: CHART_ROLLBACK_NOT_OLDER, CHART_ROLLBACK_NOT_DEPLOYED and CHART_ROLLBACK_VALUES_MIGRATED (a registered values migration lies between the two versions) are 422; CHART_ROLLBACK_VERSION_MOVED (the add-on is declared at another version now, named in declared_version), ADDON_ALREADY_AT_CHART_VERSION and ADDON_NOT_MANAGED_BY_STACK are 409; ADDON_NOT_IN_CLUSTER and CLUSTER_NOT_FOUND are 404.
import requests
url = "https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/addons/{addon_name}/rollback"
payload = {
"from_version": "<string>",
"to_version": "<string>",
"reason": "<string>"
}
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({from_version: '<string>', to_version: '<string>', reason: '<string>'})
};
fetch('https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/addons/{addon_name}/rollback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/addons/{addon_name}/rollback \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"from_version": "<string>",
"to_version": "<string>",
"reason": "<string>"
}
'{
"detail": "Cluster not found"
}{
"detail": "<string>",
"error_code": "<string>",
"declared_version": "<string>"
}{
"detail": "<string>",
"error_code": "<string>",
"declared_version": "<string>"
}{
"detail": "<string>",
"error_code": "<string>",
"declared_version": "<string>"
}Authorizations
Body
A person's declared rollback of one add-on's chart version.
Response
The rollback is written