import requests
url = "https://platform.ankra.app/api/v1/org/service-admission/instances/{instance_id}/consumers"
payload = {
"consumer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_generation": 2
}
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({consumer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', expected_generation: 2})
};
fetch('https://platform.ankra.app/api/v1/org/service-admission/instances/{instance_id}/consumers', 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/service-admission/instances/{instance_id}/consumers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consumer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_generation": 2
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"package_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"state": "deploying",
"admission_operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"region": "<string>",
"data_boundary": "<string>",
"generation": 2,
"mode": "customer",
"requested_destinations": [
{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>"
}
],
"consumers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"application_name": "<string>",
"cluster_name": "<string>",
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"role": "playground"
},
"connection_delivery": {
"state": "delivered",
"secret_name": "<string>",
"variables": [
"<string>"
],
"reason": "<string>"
}
}
],
"deployment_operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deployment_state": "accepted",
"readiness": "unverified",
"readiness_check": {
"observed_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"last_passed_at": "2023-11-07T05:31:56Z"
},
"created_at": "2023-11-07T05:31:56Z",
"released_at": "2023-11-07T05:31:56Z",
"evidence_updated_at": "2023-11-07T05:31:56Z",
"connection": {
"namespace": "<string>",
"endpoints": [
{
"name": "<string>",
"address": "<string>"
}
],
"secret": {
"name": "<string>",
"keys": [
"<string>"
]
}
},
"health": {
"state": "serving",
"observed_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"quota": {
"state": "refused",
"namespaces": [
"<string>"
],
"refusal": {
"namespace": "<string>",
"object_kind": "<string>",
"object_name": "<string>",
"message": "<string>",
"last_seen_at": "2023-11-07T05:31:56Z"
}
}
},
"retirement": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": "in_progress",
"phase": "retire_stack",
"execution_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requested_at": "2023-11-07T05:31:56Z",
"settled_at": "2023-11-07T05:31:56Z",
"outcome": "retired",
"reason": "<string>"
}
}Connect an application to a managed service
Requires the applications rollout flag, applications.deploy, and clusters.operate and clusters.read on the service’s cluster, which is also the environment’s, all intersected with live token scopes. Adds one bound application environment (POST …/consumers) to the consumers of a service Ankra runs in your cluster, so a second application uses the same service instead of getting one of its own. Nothing is deployed and the generation does not move: the environment joins the service’s record of who uses it, receives the service’s connection the next time the application deploys, cannot be unbound while the service uses it, and is disconnected by a retirement like every other consumer. A retirement reviewed before the change is refused when confirmed. The environment must be on the service’s own cluster and in its data boundary. Refused for another generation than the one read, an environment that already uses the service, and a service that is still installing, being retired, retired, or not one Ankra runs in your cluster. One service serves at most 100 environments.
import requests
url = "https://platform.ankra.app/api/v1/org/service-admission/instances/{instance_id}/consumers"
payload = {
"consumer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_generation": 2
}
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({consumer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', expected_generation: 2})
};
fetch('https://platform.ankra.app/api/v1/org/service-admission/instances/{instance_id}/consumers', 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/service-admission/instances/{instance_id}/consumers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consumer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_generation": 2
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"package_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"state": "deploying",
"admission_operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"region": "<string>",
"data_boundary": "<string>",
"generation": 2,
"mode": "customer",
"requested_destinations": [
{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>"
}
],
"consumers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"application_name": "<string>",
"cluster_name": "<string>",
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"role": "playground"
},
"connection_delivery": {
"state": "delivered",
"secret_name": "<string>",
"variables": [
"<string>"
],
"reason": "<string>"
}
}
],
"deployment_operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deployment_state": "accepted",
"readiness": "unverified",
"readiness_check": {
"observed_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"last_passed_at": "2023-11-07T05:31:56Z"
},
"created_at": "2023-11-07T05:31:56Z",
"released_at": "2023-11-07T05:31:56Z",
"evidence_updated_at": "2023-11-07T05:31:56Z",
"connection": {
"namespace": "<string>",
"endpoints": [
{
"name": "<string>",
"address": "<string>"
}
],
"secret": {
"name": "<string>",
"keys": [
"<string>"
]
}
},
"health": {
"state": "serving",
"observed_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"quota": {
"state": "refused",
"namespaces": [
"<string>"
],
"refusal": {
"namespace": "<string>",
"object_kind": "<string>",
"object_name": "<string>",
"message": "<string>",
"last_seen_at": "2023-11-07T05:31:56Z"
}
}
},
"retirement": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": "in_progress",
"phase": "retire_stack",
"execution_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requested_at": "2023-11-07T05:31:56Z",
"settled_at": "2023-11-07T05:31:56Z",
"outcome": "retired",
"reason": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Response
The instance with the environment among its consumers.
The service cluster's name as it reads now, for display; cluster_id is the identity.
The instance's lifecycle in one word, folded at read time from deployment_state, health, readiness and retirement; those fields stay the evidence. released: the instance was released and its name is free. retiring: a confirmed retirement is removing it. failed: its admission or deployment operation failed. deploying: it is being installed, or its workload is rolling out. serving: the platform last observed its workload serving and no readiness check found it failing. degraded: an observation or readiness check found it not serving, or a namespace quota refuses its pods. deployed: its deployment finished and nothing observes its health (a package that is not a first-party engine, or one the health loop has not reached); not a statement that it serves. unknown: the recorded evidence establishes none of these. Precedence is released, retiring, failed, deploying, then the health-based states.
deploying, deployed, serving, degraded, failed, retiring, released, unknown Physical cloud region of the placement, for example eu-north-1. It locates infrastructure; it is not the data-location promise, which is data_boundary.
Boundary the data is permitted to stay within, for example eu. Sharing a service across clusters is decided by this boundary, never by the physical region.
x >= 1customer, existing, hosted Requested destinations from the durable plan; not proof of a live service connection.
Show child attributes
Show child attributes
The reviewed plan's consumers with their ids: exactly the set a retirement request names in disconnect_consumer_ids. Reviewed intent, not proof of a live connection.
Show child attributes
Show child attributes
Present only when current execution evidence matches the stored receipt and organisation/cluster scope.
accepted, admission_failed, deploying, deployment_failed, verification_pending, unknown, released Whether a consumer can use the service, from a scoped consumer-path canary - for PostgreSQL, a pod in the instance namespace logging in with the generated credentials by Secret reference and running SELECT 1 every five minutes; a result stands fifteen minutes. unverified: no canary covers this instance (an engine other than PostgreSQL, a hosted, released or later-generation instance, or one with no deployment receipt); a successful deployment is not readiness. verifying: covered, and no canary has established readiness yet - none has run, or the service is still deploying or inside its first start's grace window. ready: an unexpired canary passed. degraded: an unexpired canary ran and failed after the service had its chance to start. stale: readiness cannot currently be established - the canary could not run (no agent, the cluster unavailable, the canary pod refused or not finishing) or its last result expired; an expired ready is never reported.
unverified, verifying, ready, degraded, stale The canary evidence behind readiness, folded against the database clock at read time. Null when no canary has run at this generation. A canary that could not run leaves an unexpired pass or failure standing until it expires, so observed_at is when the standing result was observed, not necessarily the latest attempt. Never carries a probe log or a credential.
Show child attributes
Show child attributes
Where a first-party engine instance is reached inside its cluster and which Secret in its namespace holds the credentials the engine generated. Derived from the engine profile, not observed; null for any other package.
Show child attributes
Show child attributes
Health as the platform last observed it from the service cluster's synced state: whether the engine's workload reports ready, its Service and credentials Secret exist, and the stack that owns it is still deployed. It is not readiness - no consumer connection is proven. Evidence past expires_at reads unknown, folded against the database clock at read time, so a stopped observer never leaves a stale serving. Null when nothing has observed this generation: a package that is not a first-party engine, an instance not deployed yet, a released instance, or one not observed yet.
Show child attributes
Show child attributes
The latest confirmed retirement, running or settled; null when none was ever confirmed. A settled outcome other than retired left the service and its name in place.
Show child attributes
Show child attributes