import requests
url = "https://api.platform.ankra.app/org/service-admission/instances/{instance_id}/credential-rotations"
payload = { "expected_generation": 2 }
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({expected_generation: 2})
};
fetch('https://api.platform.ankra.app/org/service-admission/instances/{instance_id}/credential-rotations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/service-admission/instances/{instance_id}/credential-rotations \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"expected_generation": 2
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"plan": {
"schema_version": 123,
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_name": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generation": 123,
"expires_at": "2023-11-07T05:31:56Z",
"secret_name": "<string>",
"owner_role": "<string>",
"secret_uid": "<string>",
"rotations": 123,
"consumers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_name": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"on_service_cluster": true,
"credential": "owner",
"breaks": true,
"statement": "<string>",
"role_state": "<string>"
}
],
"breaking": 123,
"statements": {
"what_happens": "<string>",
"breaks": "<string>",
"not_affected": "<string>",
"other_copies": "<string>",
"heal": "<string>"
}
},
"digest": "<string>",
"state": "pending",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"confirmed_at": "2023-11-07T05:31:56Z",
"settled_at": "2023-11-07T05:31:56Z",
"outcome": {
"secret": "deleted",
"note": "<string>",
"observed_at": "2023-11-07T05:31:56Z"
},
"effect": "awaiting",
"effective_at": "2023-11-07T05:31:56Z"
}Prepare a managed-service owner credential rotation review (browser session)
Requires the applications rollout flag, applications.deploy, and clusters.operate on the service’s cluster and clusters.operate and clusters.read on the cluster of every application environment connected to the service, all intersected with live token scopes. Resolves, on the primary database, what rotating the shared owner credential (the Secret postgresql-app and the role app) of a running managed PostgreSQL service does: it names every connected application environment and says, for each, whether it connects with the owner credential (it cannot open new connections to the database until its next deploy copies the new password), with a database role of its own (not affected), has no connection delivered yet, or runs on another cluster; what else stops working (copies of the old password made by hand, and one a disconnected application may still hold); and how the rotation meets Ankra’s own check of the database. It stores an actor-bound plan with a digest and a ten-minute expiry. Nothing changes. Refused for another engine, for a service Ankra does not run in the cluster, while the service installs or retires, while a rotation of it may still take effect, while the cluster’s last sync does not show postgresql-app, when it shows that CloudNativePG would not create postgresql-app again (its controller owner reference does not name the database Cluster, or the Cluster’s bootstrap names a Secret of its own), while it does not show the CloudNativePG operator serving or the database Cluster ready, and for another generation. An actor may hold at most 10 open rotation reviews and an organisation 50.
import requests
url = "https://api.platform.ankra.app/org/service-admission/instances/{instance_id}/credential-rotations"
payload = { "expected_generation": 2 }
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({expected_generation: 2})
};
fetch('https://api.platform.ankra.app/org/service-admission/instances/{instance_id}/credential-rotations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/service-admission/instances/{instance_id}/credential-rotations \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"expected_generation": 2
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"plan": {
"schema_version": 123,
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_name": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generation": 123,
"expires_at": "2023-11-07T05:31:56Z",
"secret_name": "<string>",
"owner_role": "<string>",
"secret_uid": "<string>",
"rotations": 123,
"consumers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_name": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"on_service_cluster": true,
"credential": "owner",
"breaks": true,
"statement": "<string>",
"role_state": "<string>"
}
],
"breaking": 123,
"statements": {
"what_happens": "<string>",
"breaks": "<string>",
"not_affected": "<string>",
"other_copies": "<string>",
"heal": "<string>"
}
},
"digest": "<string>",
"state": "pending",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"confirmed_at": "2023-11-07T05:31:56Z",
"settled_at": "2023-11-07T05:31:56Z",
"outcome": {
"secret": "deleted",
"note": "<string>",
"observed_at": "2023-11-07T05:31:56Z"
},
"effect": "awaiting",
"effective_at": "2023-11-07T05:31:56Z"
}Authorizations
Body
Response
The stored rotation review, its plan and digest.
One rotation of a managed PostgreSQL service's owner credential, as its preparing actor sees it.
Null until the rotation is confirmed. taken: Ankra saw postgresql-app replaced, so each application environment on the owner credential is marked as needing a deploy and its next deploy copies the new password. awaiting: Ankra has not seen the new Secret yet, and the rotation may still take effect; another rotation is refused meanwhile. lapsed: the rotation never takes effect.
awaiting, taken, lapsed, null