import requests
url = "https://platform.ankra.app/org/applications/{application_id}/subject-state"
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/org/applications/{application_id}/subject-state', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/org/applications/{application_id}/subject-state \
--header 'Authorization: Bearer <token>'{
"subject": {
"kind": "<string>",
"application_id": "<string>",
"environment": "<string>",
"cluster_id": "<string>",
"namespace": "<string>",
"deploy_run_id": "<string>"
},
"read_at": "<string>",
"application": {
"status": "present",
"reason": "<string>",
"name": "<string>",
"repository": "<string>",
"branch": "<string>",
"state": "<string>",
"error_message": "<string>"
},
"binding": {
"status": "present",
"reason": "<string>",
"place": {
"cluster_id": "<string>",
"cluster_name": "<string>",
"namespace": "<string>",
"installation_id": "<string>",
"status": "<string>",
"environment_id": "<string>",
"environment_name": "<string>"
},
"places": [
{
"cluster_id": "<string>",
"cluster_name": "<string>",
"namespace": "<string>",
"installation_id": "<string>",
"status": "<string>",
"environment_id": "<string>",
"environment_name": "<string>"
}
]
},
"health": {
"status": "present",
"pods": {
"status": "present",
"total": 123,
"ready": 123,
"reason": "<string>",
"problems": [
{
"pod": "<string>",
"container": "<string>",
"reason": "<string>",
"message": "<string>"
}
],
"observed_at": "<string>"
},
"reason": "<string>",
"deployment_state": "<string>",
"state_message": "<string>",
"state_changed_at": "<string>",
"first_healthy_at": "<string>",
"last_live_at": "<string>"
},
"deploy_runs": {
"status": "present",
"runs": [
{
"id": "<string>",
"status": "<string>",
"created_at": "<string>",
"error_message": "<string>",
"error_code": "<string>",
"cluster_id": "<string>",
"cluster_name": "<string>",
"namespace": "<string>",
"finished_at": "<string>"
}
],
"capped": true,
"reason": "<string>"
},
"builds": {
"status": "present",
"builds": [
{
"id": "<string>",
"status": "<string>",
"ref": "<string>",
"head_sha": "<string>",
"reason": "<string>",
"component": "<string>",
"error_class": "<string>",
"error_message": "<string>",
"started_at": "<string>",
"finished_at": "<string>"
}
],
"capped": true,
"reason": "<string>"
},
"pull_requests": {
"status": "present",
"ai_reviews": [
{
"url": "<string>",
"merge_state": "<string>",
"number": 123,
"title": "<string>",
"merged_at": "<string>",
"closed_at": "<string>",
"verdict": "<string>",
"summary": "<string>",
"branch": "<string>",
"head_sha": "<string>",
"lane": "<string>",
"created_at": "<string>"
}
],
"reason": "<string>",
"setup_pull_request": {
"url": "<string>",
"merge_state": "<string>",
"number": 123,
"title": "<string>",
"merged_at": "<string>",
"closed_at": "<string>",
"verdict": "<string>",
"summary": "<string>",
"branch": "<string>",
"head_sha": "<string>",
"lane": "<string>",
"created_at": "<string>"
}
},
"tickets": {
"status": "present",
"tickets": [
{
"id": "<string>",
"title": "<string>",
"status": "<string>",
"kind": "<string>",
"created_at": "<string>"
}
],
"reason": "<string>"
},
"platform_errors": {
"status": "present",
"errors": [
{
"message": "<string>",
"source": "<string>",
"source_id": "<string>",
"code": "<string>",
"occurred_at": "<string>",
"remedy": {
"kind": "deploy_again",
"label": "<string>",
"description": "<string>"
}
}
],
"reason": "<string>"
},
"chat_actions": {
"status": "present",
"actions": [
{
"action_id": "<string>",
"tool_name": "<string>",
"status": "<string>",
"created_at": "<string>",
"description": "<string>",
"completed_at": "<string>"
}
],
"reason": "<string>"
}
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get an application's subject state (browser session)
One platform read of everything Ankra records about the application in an environment (ankra-ab5fog.8): the application’s record, the place it runs (the one the query names by cluster and namespace, else the environment’s one deployment, else every place listed), the installation’s current state and the k8s mirror’s view of its pods, the newest deploy runs and platform builds with their errors, the setup pull request and the reviews Ankra AI wrote, the active platform errors with the remedy their code names, and the named conversation’s actions on it. Every section is three-state: a read that failed or was never attempted is unknown, never empty. Requires applications.read.
import requests
url = "https://platform.ankra.app/org/applications/{application_id}/subject-state"
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/org/applications/{application_id}/subject-state', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/org/applications/{application_id}/subject-state \
--header 'Authorization: Bearer <token>'{
"subject": {
"kind": "<string>",
"application_id": "<string>",
"environment": "<string>",
"cluster_id": "<string>",
"namespace": "<string>",
"deploy_run_id": "<string>"
},
"read_at": "<string>",
"application": {
"status": "present",
"reason": "<string>",
"name": "<string>",
"repository": "<string>",
"branch": "<string>",
"state": "<string>",
"error_message": "<string>"
},
"binding": {
"status": "present",
"reason": "<string>",
"place": {
"cluster_id": "<string>",
"cluster_name": "<string>",
"namespace": "<string>",
"installation_id": "<string>",
"status": "<string>",
"environment_id": "<string>",
"environment_name": "<string>"
},
"places": [
{
"cluster_id": "<string>",
"cluster_name": "<string>",
"namespace": "<string>",
"installation_id": "<string>",
"status": "<string>",
"environment_id": "<string>",
"environment_name": "<string>"
}
]
},
"health": {
"status": "present",
"pods": {
"status": "present",
"total": 123,
"ready": 123,
"reason": "<string>",
"problems": [
{
"pod": "<string>",
"container": "<string>",
"reason": "<string>",
"message": "<string>"
}
],
"observed_at": "<string>"
},
"reason": "<string>",
"deployment_state": "<string>",
"state_message": "<string>",
"state_changed_at": "<string>",
"first_healthy_at": "<string>",
"last_live_at": "<string>"
},
"deploy_runs": {
"status": "present",
"runs": [
{
"id": "<string>",
"status": "<string>",
"created_at": "<string>",
"error_message": "<string>",
"error_code": "<string>",
"cluster_id": "<string>",
"cluster_name": "<string>",
"namespace": "<string>",
"finished_at": "<string>"
}
],
"capped": true,
"reason": "<string>"
},
"builds": {
"status": "present",
"builds": [
{
"id": "<string>",
"status": "<string>",
"ref": "<string>",
"head_sha": "<string>",
"reason": "<string>",
"component": "<string>",
"error_class": "<string>",
"error_message": "<string>",
"started_at": "<string>",
"finished_at": "<string>"
}
],
"capped": true,
"reason": "<string>"
},
"pull_requests": {
"status": "present",
"ai_reviews": [
{
"url": "<string>",
"merge_state": "<string>",
"number": 123,
"title": "<string>",
"merged_at": "<string>",
"closed_at": "<string>",
"verdict": "<string>",
"summary": "<string>",
"branch": "<string>",
"head_sha": "<string>",
"lane": "<string>",
"created_at": "<string>"
}
],
"reason": "<string>",
"setup_pull_request": {
"url": "<string>",
"merge_state": "<string>",
"number": 123,
"title": "<string>",
"merged_at": "<string>",
"closed_at": "<string>",
"verdict": "<string>",
"summary": "<string>",
"branch": "<string>",
"head_sha": "<string>",
"lane": "<string>",
"created_at": "<string>"
}
},
"tickets": {
"status": "present",
"tickets": [
{
"id": "<string>",
"title": "<string>",
"status": "<string>",
"kind": "<string>",
"created_at": "<string>"
}
],
"reason": "<string>"
},
"platform_errors": {
"status": "present",
"errors": [
{
"message": "<string>",
"source": "<string>",
"source_id": "<string>",
"code": "<string>",
"occurred_at": "<string>",
"remedy": {
"kind": "deploy_again",
"label": "<string>",
"description": "<string>"
}
}
],
"reason": "<string>"
},
"chat_actions": {
"status": "present",
"actions": [
{
"action_id": "<string>",
"tool_name": "<string>",
"status": "<string>",
"created_at": "<string>",
"description": "<string>",
"completed_at": "<string>"
}
],
"reason": "<string>"
}
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
The environment in view, by name; its one deployment is the binding when the query names no cluster.
200The cluster of the place the page read; with namespace it picks the binding.
The namespace of the place the page read.
63The deploy run a hand-off pointed at; echoed on the subject.
The chat conversation whose actions on the subject to list; without it the actions section is unknown.
128Response
The subject state, every section with its own presence
One platform read of everything Ankra records about an application in an environment. Every section is three-state: present, absent (a successful read that found nothing) or unknown (the read failed or was never attempted; never a negative).
The thing the state is about, as the caller named it.
Show child attributes
Show child attributes
The application's own record.
Show child attributes
Show child attributes
The place the subject resolves to: place is set when exactly one matches; places lists them when several do.
Show child attributes
Show child attributes
The bound deployment's current state.
Show child attributes
Show child attributes
The newest deploy runs of the bound place, newest first.
Show child attributes
Show child attributes
The newest platform builds, newest first.
Show child attributes
Show child attributes
The setup pull request the platform opened and the reviews Ankra AI wrote.
Show child attributes
Show child attributes
The AI board's tickets about the subject.
Show child attributes
Show child attributes
The active platform errors on the subject.
Show child attributes
Show child attributes
The conversation's recent actions on the subject.
Show child attributes
Show child attributes