import requests
url = "https://platform.ankra.app/api/v1/org/service-admission/instances/{instance_id}/reconfigurations"
payload = {
"expected_generation": 2,
"parameters": {}
}
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({expected_generation: 2, parameters: {}})
};
fetch('https://platform.ankra.app/api/v1/org/service-admission/instances/{instance_id}/reconfigurations', 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}/reconfigurations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_generation": 2,
"parameters": {}
}
'{
"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",
"name": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generation": 123,
"stack_resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stack_name": "<string>",
"current": {},
"target": {},
"changes": [
{
"parameter": "<string>",
"from": 123,
"to": 123,
"unit": "<string>"
}
],
"variables": [
{
"name": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"storage_classes": [
"<string>"
],
"effects": [
"<string>"
],
"expires_at": "2023-11-07T05:31:56Z"
},
"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",
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"capacity": {
"state": "fits",
"reason": "<string>",
"plan_id": "<string>",
"quota": {
"limits_cpu_millicores": 123,
"limits_memory_mib": 123,
"requests_cpu_millicores": 123,
"requests_memory_mib": 123
},
"committed": {
"limits_cpu_millicores": 123,
"limits_memory_mib": 123,
"requests_cpu_millicores": 123,
"requests_memory_mib": 123
},
"transient": {
"limits_cpu_millicores": 123,
"limits_memory_mib": 123,
"requests_cpu_millicores": 123,
"requests_memory_mib": 123
},
"required": {
"limits_cpu_millicores": 123,
"limits_memory_mib": 123,
"requests_cpu_millicores": 123,
"requests_memory_mib": 123
}
}
}Prepare a managed-service resize review
Requires the applications rollout flag, applications.deploy in the cluster’s project, and clusters.read and clusters.operate on the service’s cluster, all intersected with live token scopes: the authority setting the service up on that cluster needed. Resolves, on the primary database, one resize of a running managed PostgreSQL service: the new value of each setting the request names (instances, tier, storage_gib, memory_mib, cpu_millicores), each against the value the service’s stack holds now, the stack variables the confirmation sets (with the variables the options of instances and tier set), the StorageClasses of the service’s volumes when the storage grows, and in plain words what happens to the running database. It stores an actor-bound plan with a digest and a ten-minute expiry. Nothing changes. A storage size below the current one is refused, and a storage grow is refused up front when a volume’s StorageClass does not allow volume expansion or Ankra cannot see the volumes. The new size is placed as setup places it: the Production tier is refused on a cluster without three usable nodes, and a playground short of quota is refused. capacity carries the quota assessment and is not part of the digest. An actor may hold at most 10 open resize reviews and an organisation 50.
import requests
url = "https://platform.ankra.app/api/v1/org/service-admission/instances/{instance_id}/reconfigurations"
payload = {
"expected_generation": 2,
"parameters": {}
}
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({expected_generation: 2, parameters: {}})
};
fetch('https://platform.ankra.app/api/v1/org/service-admission/instances/{instance_id}/reconfigurations', 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}/reconfigurations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_generation": 2,
"parameters": {}
}
'{
"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",
"name": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generation": 123,
"stack_resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stack_name": "<string>",
"current": {},
"target": {},
"changes": [
{
"parameter": "<string>",
"from": 123,
"to": 123,
"unit": "<string>"
}
],
"variables": [
{
"name": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"storage_classes": [
"<string>"
],
"effects": [
"<string>"
],
"expires_at": "2023-11-07T05:31:56Z"
},
"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",
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"capacity": {
"state": "fits",
"reason": "<string>",
"plan_id": "<string>",
"quota": {
"limits_cpu_millicores": 123,
"limits_memory_mib": 123,
"requests_cpu_millicores": 123,
"requests_memory_mib": 123
},
"committed": {
"limits_cpu_millicores": 123,
"limits_memory_mib": 123,
"requests_cpu_millicores": 123,
"requests_memory_mib": 123
},
"transient": {
"limits_cpu_millicores": 123,
"limits_memory_mib": 123,
"requests_cpu_millicores": 123,
"requests_memory_mib": 123
},
"required": {
"limits_cpu_millicores": 123,
"limits_memory_mib": 123,
"requests_cpu_millicores": 123,
"requests_memory_mib": 123
}
}
}Authorizations
Body
One resize of a running managed service: the generation the person reviewed and the new value of each setting it changes.
Response
The stored resize review, its plan and digest.
One resize of a managed service, as its preparing actor sees it.