import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks/{stack_name}/variables/{variable_name}"
payload = { "value": "<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({value: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks/{stack_name}/variables/{variable_name}', 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/imported/{cluster_id}/stacks/{stack_name}/variables/{variable_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "<string>"
}
'{
"changed": true,
"commit_sha": "<string>",
"commit_url": "<string>",
"job_count": 123,
"operation_id": "<string>",
"set": {},
"stack_name": "<string>",
"unset": [
"<string>"
]
}{
"detail": "Cluster not found"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Set one stack variable
Sets one stack variable. The edit is merged into the deployed variables under the cluster lock, so keys it does not name are never overwritten, including a key the application image-tag lane moved a moment earlier. It is a live write: a pending draft of the stack is neither read nor published, and the stack’s description, deploy wave and members are kept. A pending draft of the stack picks this write up when it is next reconciled against the deployed stack, and publishing the draft merges its variables with the live stack key by key: only a variable the draft itself changed keeps the draft’s value. A variable added live after the draft last reconciled is one the draft never saw, so it is kept: publishing the draft cannot remove it. Requires stacks.write on the cluster.
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks/{stack_name}/variables/{variable_name}"
payload = { "value": "<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({value: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks/{stack_name}/variables/{variable_name}', 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/imported/{cluster_id}/stacks/{stack_name}/variables/{variable_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "<string>"
}
'{
"changed": true,
"commit_sha": "<string>",
"commit_url": "<string>",
"job_count": 123,
"operation_id": "<string>",
"set": {},
"stack_name": "<string>",
"unset": [
"<string>"
]
}{
"detail": "Cluster not found"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Response
The edit was applied, or the live stack already satisfied it (changed false, nothing written).
False when the live stack already satisfied the edit and nothing was written.
Show child attributes
Show child attributes