import requests
url = "https://api.platform.ankra.app/org/clusters/{cluster_id}/architecture"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
fetch('https://api.platform.ankra.app/org/clusters/{cluster_id}/architecture', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.platform.ankra.app/org/clusters/{cluster_id}/architecture \
--cookie ankra_session={
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"observed_at": "2023-11-07T05:31:56Z",
"mirror": "fresh",
"focus": {
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"namespaces": [
"<string>"
]
},
"groups": [
{
"id": "<string>",
"namespace": "<string>",
"owner": {
"kind": "application",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"expanded": true,
"counts": {
"entry_points": 1,
"services": 1,
"workloads": 1,
"storage": 1
}
}
],
"nodes": [
{
"id": "<string>",
"part": "entry_point",
"kind": "<string>",
"namespace": "<string>",
"name": "<string>",
"detail": "<string>",
"state": "ok"
}
],
"edges": [
{
"from": "<string>",
"to": "<string>",
"says": "routes_to",
"basis": "declared",
"crosses_namespace": true
}
],
"capped": true,
"not_drawn": [
"traffic"
]
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get the cluster architecture map (browser session)
Draws the cluster as Ankra knows it: one group per namespace, owned by the application, add-on or managed service Ankra records there, and the cluster’s entry points, Services, workloads and storage from Ankra’s synchronised copy of the cluster (pods are not drawn). Every line names what it is based on: routes_to (an Ingress backend), selects (a Service selector matching a workload’s pod labels), mounts (a workload’s claim) and names_host (an ExternalName Service naming a cluster Service) are declared in the objects; has_credentials_for (a namespace holding a ready credential for a managed service) is recorded by Ankra. Nothing is inferred from names, labels, environment values, Secrets or traffic, and not_drawn lists what the map leaves out. A cluster never synchronised answers mirror not_synced with nothing drawn; a copy older than the platform’s staleness limit, or one where a kind every cluster serves has never synchronised, answers stale. With application_id the application’s namespaces and every namespace one line away are expanded; without it, the 20 namespaces with the most workloads. At most 300 groups, 600 nodes and 1000 edges; capped says a cap was reached or an object could not be read in full. Requires kubernetes.read on the cluster. An application is on the map only for a caller who may read it: for any other caller its installations and the credentials given to it are no record, so the answer is the one it would be without that application. A managed service is drawn only for a caller who may list it; a cluster or application outside a confined caller’s project answers 404.
import requests
url = "https://api.platform.ankra.app/org/clusters/{cluster_id}/architecture"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
fetch('https://api.platform.ankra.app/org/clusters/{cluster_id}/architecture', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.platform.ankra.app/org/clusters/{cluster_id}/architecture \
--cookie ankra_session={
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"observed_at": "2023-11-07T05:31:56Z",
"mirror": "fresh",
"focus": {
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"namespaces": [
"<string>"
]
},
"groups": [
{
"id": "<string>",
"namespace": "<string>",
"owner": {
"kind": "application",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"expanded": true,
"counts": {
"entry_points": 1,
"services": 1,
"workloads": 1,
"storage": 1
}
}
],
"nodes": [
{
"id": "<string>",
"part": "entry_point",
"kind": "<string>",
"namespace": "<string>",
"name": "<string>",
"detail": "<string>",
"state": "ok"
}
],
"edges": [
{
"from": "<string>",
"to": "<string>",
"says": "routes_to",
"basis": "declared",
"crosses_namespace": true
}
],
"capped": true,
"not_drawn": [
"traffic"
]
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Query Parameters
Response
The cluster's architecture map
The cluster drawn from Ankra's synchronised copy of it and Ankra's own records.
fresh: every kind read synchronised within the platform's staleness limit. stale: at least one is older, or a kind every cluster serves has never synchronised while others have (TunnelBindings, which only some clusters serve, may be missing), so the map may be behind the cluster or missing parts of it; the answer does not say which kind. not_synced: the cluster has never been synchronised and nothing is drawn, which is not an empty cluster.
fresh, stale, not_synced What the map does not draw, so an absent line is not read as an absent connection. managed_services_not_shown: the cluster runs managed services the caller may not list, or more than were read.
traffic, gateway_api, databases_outside_ankra, tunnel_binding_routes, statefulset_claim_templates, stack_owners, managed_services_not_shown