import requests
url = "https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/node-os-policy"
payload = {
"node_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"all_nodes": False,
"include_bastion": False,
"revert": False
}
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({
node_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
all_nodes: false,
include_bastion: false,
revert: false
})
};
fetch('https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/node-os-policy', 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/clusters/digitalocean/{cluster_id}/node-os-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"node_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"all_nodes": false,
"include_bastion": false,
"revert": false
}
'{
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"step_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_id": "<string>",
"job_name": "<string>",
"status": "<string>",
"completed": true,
"health": {},
"report": {},
"error_excerpt": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Apply the node OS update hold
Bearer PAT authentication; RBAC permission clusters.operate. The REST twin of the assistant’s apply_node_os_policy: dispatches the digitalocean_node_os_policy job, which over the bastion writes the node OS update hold on the named nodes, on every node, and on the bastion, or with revert removes it. Name nodes or ask for all nodes, not both; at least one target is required and one run covers at most 100 named nodes. It waits for the report within a bounded budget; a whole-cluster run answers the operation ids to poll.
import requests
url = "https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/node-os-policy"
payload = {
"node_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"all_nodes": False,
"include_bastion": False,
"revert": False
}
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({
node_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
all_nodes: false,
include_bastion: false,
revert: false
})
};
fetch('https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/node-os-policy', 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/clusters/digitalocean/{cluster_id}/node-os-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"node_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"all_nodes": false,
"include_bastion": false,
"revert": false
}
'{
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"step_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_id": "<string>",
"job_name": "<string>",
"status": "<string>",
"completed": true,
"health": {},
"report": {},
"error_excerpt": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Response
Successful response
The bastion resource the job was dispatched against.
False when the wait budget elapsed first; poll operation_id for the report.
The platform's own bastion health view at dispatch time.
The job's per-host outcome, present once it completed.