import requests
url = "https://platform.ankra.app/api/v1/org/decisions/{decision_id}/execute"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/decisions/{decision_id}/execute', 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/org/decisions/{decision_id}/execute \
--header 'Authorization: Bearer <token>'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"area": "security",
"kind": "<string>",
"subject": {},
"summary": "<string>",
"plan": {},
"evidence": {},
"status": "proposed",
"source": "<string>",
"created_by": "<string>",
"decided_by": "<string>",
"decided_at": "2023-11-07T05:31:56Z",
"decision_note": "<string>",
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"receipt": {
"steps": [
{
"name": "<string>",
"outcome": "dispatched",
"detail": "<string>",
"evidence": {}
}
],
"claimed_at": "2023-11-07T05:31:56Z",
"executed_by": "<string>",
"dispatched_at": "2023-11-07T05:31:56Z",
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z",
"execution_status": "<string>"
},
"dedupe_key": "<string>",
"executable": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Run an approved decision proposal
Dispatches the platform operation the proposal’s kind maps to (addon_upgrade rewrites the add-on’s chart version in its stack; off_hours_schedule creates the stop and start power schedules; waste_cleanup files the platform cleanup job of the cloud waste finding, which snapshots a stopped server before deleting it and releases an unassigned IP or idle load balancer) as the caller, and records the receipt. The proposal is answered as the run left it: running with its operation_id when there is a platform execution to wait on, succeeded when the operation finished inside the call, or failed with the refusal on its receipt. Only an approved proposal runs, and only once: a concurrent execute finds it running. Gated on the area’s permission: billing.manage for cost, security.manage for security. The token stands in for the browser route’s CSRF double-submit. Bearer-PAT twin of the browser route of the same name under /org; the console’s session cookie is not accepted here and the browser route answers a token with a login redirect.
import requests
url = "https://platform.ankra.app/api/v1/org/decisions/{decision_id}/execute"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/decisions/{decision_id}/execute', 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/org/decisions/{decision_id}/execute \
--header 'Authorization: Bearer <token>'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"area": "security",
"kind": "<string>",
"subject": {},
"summary": "<string>",
"plan": {},
"evidence": {},
"status": "proposed",
"source": "<string>",
"created_by": "<string>",
"decided_by": "<string>",
"decided_at": "2023-11-07T05:31:56Z",
"decision_note": "<string>",
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"receipt": {
"steps": [
{
"name": "<string>",
"outcome": "dispatched",
"detail": "<string>",
"evidence": {}
}
],
"claimed_at": "2023-11-07T05:31:56Z",
"executed_by": "<string>",
"dispatched_at": "2023-11-07T05:31:56Z",
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z",
"execution_status": "<string>"
},
"dedupe_key": "<string>",
"executable": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"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.
Headers
PAT organisation override.
Path Parameters
Response
The proposal as the run left it: running, succeeded or failed, with its receipt
One proposal of the decision ledger: what it is about, what the surface computed, where it stands, who decided, and what running it did.
security or cost; decides which permission approving and running it takes.
security, cost What the proposal does, e.g. addon_upgrade, image_rebuild, right_size, off_hours_schedule, waste_cleanup. Only kinds with a platform operation are executable.
Identity of what the proposal is about (finding_id, cluster_id, addon_name, waste_finding_id ...), one document per kind.
The steps the surface computed. plan.parameters is the machine half the executable kinds are called with: addon_upgrade takes {cluster_id, addon_name, chart_version}; off_hours_schedule takes {cluster_id, timezone, schedules: [{action, stop_mode, cron_expression}]}; waste_cleanup takes {waste_finding_id}.
proposed, approved, set_aside, running, succeeded, failed, superseded Which surface computed it (default "surface").
Ankra user id of whoever posted it.
Ankra user id of the last approve or set-aside.
The platform execution a run dispatched, to watch under /api/v1/org/executions.
The record of running a proposal: who ran it and when, the platform operation it became, the steps taken and how it ended.
Show child attributes
Show child attributes
Whether the platform has an operation for the kind, so a surface offers "run" only where running can work.