import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks/{stack_name}"
payload = { "spec": {
"argo_cd": {
"namespace": "<string>",
"version": "<string>"
},
"git_repository": {
"branch": "<string>",
"credential_name": "<string>",
"repository": "<string>",
"provider": "github"
},
"helm_registries": [
{
"name": "<string>",
"url": "<string>",
"credential_name": "<string>",
"exclude_charts": ["<string>"]
}
],
"kubernetes": { "version": "0.0.0" },
"prometheus_credential": {
"name": "<string>",
"password": "<string>",
"token": "<string>",
"username": "<string>"
},
"prometheus_metrics": {
"endpoint": "<string>",
"credential_name": "<string>",
"flavor": "<string>",
"tenant_id": "<string>"
},
"provider": "imported",
"stacks": []
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
spec: {
argo_cd: {namespace: '<string>', version: '<string>'},
git_repository: {
branch: '<string>',
credential_name: '<string>',
repository: '<string>',
provider: 'github'
},
helm_registries: [
{
name: '<string>',
url: '<string>',
credential_name: '<string>',
exclude_charts: ['<string>']
}
],
kubernetes: {version: '0.0.0'},
prometheus_credential: {
name: '<string>',
password: '<string>',
token: '<string>',
username: '<string>'
},
prometheus_metrics: {
endpoint: '<string>',
credential_name: '<string>',
flavor: '<string>',
tenant_id: '<string>'
},
provider: 'imported',
stacks: []
}
})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks/{stack_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks/{stack_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"spec": {
"argo_cd": {
"namespace": "<string>",
"version": "<string>"
},
"git_repository": {
"branch": "<string>",
"credential_name": "<string>",
"repository": "<string>",
"provider": "github"
},
"helm_registries": [
{
"name": "<string>",
"url": "<string>",
"credential_name": "<string>",
"exclude_charts": [
"<string>"
]
}
],
"kubernetes": {
"version": "0.0.0"
},
"prometheus_credential": {
"name": "<string>",
"password": "<string>",
"token": "<string>",
"username": "<string>"
},
"prometheus_metrics": {
"endpoint": "<string>",
"credential_name": "<string>",
"flavor": "<string>",
"tenant_id": "<string>"
},
"provider": "imported",
"stacks": []
}
}
'{
"stack_name": "<string>",
"commit_sha": "<string>",
"commit_url": "<string>",
"errors": [],
"job_count": 0,
"noop_count": 0,
"operation_id": "<string>",
"settings_only_count": 0,
"warnings": []
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Update a cluster stack
Surgical partial update of a stack’s addons/manifests.
Accepts the same body as the web UI endpoint. Callers must set partial_stack=true to merge-update (vs replace) the named stack.
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks/{stack_name}"
payload = { "spec": {
"argo_cd": {
"namespace": "<string>",
"version": "<string>"
},
"git_repository": {
"branch": "<string>",
"credential_name": "<string>",
"repository": "<string>",
"provider": "github"
},
"helm_registries": [
{
"name": "<string>",
"url": "<string>",
"credential_name": "<string>",
"exclude_charts": ["<string>"]
}
],
"kubernetes": { "version": "0.0.0" },
"prometheus_credential": {
"name": "<string>",
"password": "<string>",
"token": "<string>",
"username": "<string>"
},
"prometheus_metrics": {
"endpoint": "<string>",
"credential_name": "<string>",
"flavor": "<string>",
"tenant_id": "<string>"
},
"provider": "imported",
"stacks": []
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
spec: {
argo_cd: {namespace: '<string>', version: '<string>'},
git_repository: {
branch: '<string>',
credential_name: '<string>',
repository: '<string>',
provider: 'github'
},
helm_registries: [
{
name: '<string>',
url: '<string>',
credential_name: '<string>',
exclude_charts: ['<string>']
}
],
kubernetes: {version: '0.0.0'},
prometheus_credential: {
name: '<string>',
password: '<string>',
token: '<string>',
username: '<string>'
},
prometheus_metrics: {
endpoint: '<string>',
credential_name: '<string>',
flavor: '<string>',
tenant_id: '<string>'
},
provider: 'imported',
stacks: []
}
})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks/{stack_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks/{stack_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"spec": {
"argo_cd": {
"namespace": "<string>",
"version": "<string>"
},
"git_repository": {
"branch": "<string>",
"credential_name": "<string>",
"repository": "<string>",
"provider": "github"
},
"helm_registries": [
{
"name": "<string>",
"url": "<string>",
"credential_name": "<string>",
"exclude_charts": [
"<string>"
]
}
],
"kubernetes": {
"version": "0.0.0"
},
"prometheus_credential": {
"name": "<string>",
"password": "<string>",
"token": "<string>",
"username": "<string>"
},
"prometheus_metrics": {
"endpoint": "<string>",
"credential_name": "<string>",
"flavor": "<string>",
"tenant_id": "<string>"
},
"provider": "imported",
"stacks": []
}
}
'{
"stack_name": "<string>",
"commit_sha": "<string>",
"commit_url": "<string>",
"errors": [],
"job_count": 0,
"noop_count": 0,
"operation_id": "<string>",
"settings_only_count": 0,
"warnings": []
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Show child attributes
Show child attributes
Retired. It used to admit every chart downgrade in the write, including ones the person was never shown; it is still accepted as a boolean, but it admits nothing. Send confirmed_chart_downgrades instead.
The chart downgrades the person confirmed. A write that moves a member's chart_version BELOW the currently declared version is refused with 422 CHART_VERSION_DOWNGRADE, whose detail.details.downgrades names every move, so that a stale whole-stack snapshot cannot silently revert somebody else's chart bump. Re-send the write with those rows here: each admits exactly the move it names, and a downgrade the list does not name (a version that moved while the question was open) is refused again, naming every move with confirmed marking the ones already named.
200Show child attributes
Show child attributes
The change-set digest the caller reviewed, as GET /drafts/stacks/{draft_id}/diff reports it for draft_id. Optional: omit it and the write behaves exactly as before. When sent, the server recomputes the change set inside the write transaction, under the cluster lock, and refuses with 422 CHANGE_SET_DRIFTED if it no longer matches - so an approval cannot ship a draft that moved since it was read.
Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes