import requests
url = "https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}/runs/{run_id}/stream"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}/runs/{run_id}/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}/runs/{run_id}/stream \
--header 'Authorization: Bearer <token>'<string>{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "<string>",
"error_code": "CLUSTER_OFFLINE",
"retry_after": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "<string>",
"error_code": "CLUSTER_OFFLINE",
"retry_after": 123
}Stream a workspace run's output
Bearer PAT authentication; RBAC permission workspaces.use for the caller’s own workspace, workspaces.manage for another member’s. Relays a run’s output as server-sent events from the given byte offsets: stdout and stderr events carry {"data": "<base64>"} with the id <stdout offset>:<stderr offset> after them; exit ({"code", "started", "state"}) ends a run that ran to an exit; reconnect ({"stdout_offset", "stderr_offset", "reason"}) ends a stream the platform cut (lost frames, a gateway restart, a dropped session, a 30 minute connection) and says where to resume; error ({"message", "state"}) ends one for a run the workspace no longer has. A keepalive comment is sent after 15 s of silence. Last-Event-ID wins over the offset parameters. The command runs on in the pod whatever happens to the connection, so output arrives exactly once across reconnects.
import requests
url = "https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}/runs/{run_id}/stream"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}/runs/{run_id}/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}/runs/{run_id}/stream \
--header 'Authorization: Bearer <token>'<string>{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "<string>",
"error_code": "CLUSTER_OFFLINE",
"retry_after": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "<string>",
"error_code": "CLUSTER_OFFLINE",
"retry_after": 123
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
The id of the last event received, <stdout offset>:<stderr offset>.
Query Parameters
Bytes of stdout the client already has.
x >= 0Bytes of stderr the client already has.
x >= 0Response
Server-sent event stream of the run's output
The response is of type string.