Multi tenant instance updated api
- When the connection string of a tenant of a multi-tenant instance changes in the tenants table, call this API.
- Every server drops the connection pools of that tenant: for PostgreSQL, the pools of all its databases. The cached answers of the instance and of the tenants table are cleared.
- The next request of the tenant reads its row of the tenants table again and connects with the new connection string. Until this API is called, the servers keep using the pools they have.
Request Method: POST
URL
Request payload
- One tenant of one instance. Both fields are required.
- Several items at once.
[
{
"instanceName": "crm",
"username": "acme"
},
{
"instanceName": "billing",
"username": "acme"
}
]
title: Multi Tenant Instance Updated Example description: Tell every API Maker server that the connection string of a tenant of a multi-tenant instance changed, using API Maker's g.sys.system.multiTenantInstanceUpdated.
Multi tenant instance updated System API
After the connection string of a tenant of a multi-tenant instance changed in the tenants table, tell API Maker. Every server drops the connection pools of that tenant, and the next request of the tenant connects with the new connection string.
Several instances or tenants at once, each item answered on its own:
API Response
- Each item is answered on its own: an unknown instance (404) or an instance which is not multi-tenant (400) does not stop the other items.
{
"success": true,
"statusCode": 200,
"data": [
{
"success": true,
"data": true
},
{
"success": false,
"data": false,
"error": {
"code": 400,
"message": "Instance 'billing' is not a multi tenant structure instance."
}
}
]
}
- A missing field is refused with 400:
Please provide [username] value in sys.system.multiTenantInstanceUpdated.