import requests
url = "https://platform.ankra.app/api/v1/org/service-admission/connection-defaults"
payload = {
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
application_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
namespace: '<string>',
instance_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://platform.ankra.app/api/v1/org/service-admission/connection-defaults', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/service-admission/connection-defaults \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"protocol": "<string>",
"variables": [
"<string>"
],
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_name": "<string>"
}Choose the service behind an application's conventional connection names
Requires the applications rollout flag, applications.deploy, and clusters.operate on the environment’s cluster, all intersected with live token scopes. Chooses which managed service gives one application environment a protocol’s conventional connection names (DATABASE_URL and the PG* names for postgres, REDIS_URL for redis, NATS_URL, OPENSEARCH_URL, S3_ENDPOINT and AWS_* for s3, …), or, with instance_id null, that none does. Every service connected to the environment is always delivered under its own prefix (ORDERS_DB_DATABASE_URL); the conventional names belong to one service per protocol, recorded the first time a deploy delivers them, and never move by themselves. When that service stops serving the environment while another service of the protocol still does, the application’s deploys are refused until a person chooses here; the instance read shows it as connection_delivery.holder_gone on the consumer. Nothing is deployed: the next deploy delivers the choice. A chosen service must be connected to the environment and speak the protocol.
import requests
url = "https://platform.ankra.app/api/v1/org/service-admission/connection-defaults"
payload = {
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
application_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
namespace: '<string>',
instance_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://platform.ankra.app/api/v1/org/service-admission/connection-defaults', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/service-admission/connection-defaults \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"protocol": "<string>",
"variables": [
"<string>"
],
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_name": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The cluster the application environment runs on.
The application environment's namespace on that cluster.
The wire protocol whose conventional names are chosen.
postgres, redis, nats, opensearch, s3, victorialogs, victoriametrics The managed service that provides the names; it must be connected to the environment and speak the protocol. null chooses none: the application reads only each service's prefixed names.
Response
The recorded choice and the names it governs.
The conventional names the choice governs.
The chosen service; null when none was chosen.
The chosen service's name; null when none was chosen.