Description
You can call this operation to perform a precheck before a batch failover between the primary and standby tenants.
Call description
Prerequisites
You have the permission to modify tenants.
For more information about the permissions, see Users and Permissions Overview.
You have passed the authentication for the OceanBase Cloud Platform (OCP) application service.
Request path
POST /api/v2/ob/clusters/{id}/tenants/failoverPreCheck
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| id | Integer | Yes | 1 | The ID of the cluster. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| data | ObTenantPreCheckResult | The check result. For more information, see Data structure of ObTenantPreCheckResult. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The amount of time taken by the server to process the request, in milliseconds. |
| status | Integer | The HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
Data structure of ObTenantPreCheckResult
| Parameter | Type | Description |
|---|---|---|
| valid | Boolean | Indicates whether the standby tenant is available for switchover. |
| tenantId | Long | The ID of the standby tenant. |
| name | String | The name of the standby tenant. |
| clusterId | Long | The ID of cluster to which the standby tenant belongs. |
| clusterName | String | The name of cluster to which the standby tenant belongs. |
| syncScn | Long | The synchronization latency of the standby tenant. |
| primaryTenantServiceName | String | The service name of the primary tenant. |
| checkResults | PreCheckResult | The failure information list. For more information, see Data structure of PreCheckResult. |
Data structure of PreCheckResult
| Parameter | Type | Description |
|---|---|---|
| warning | Boolean | Indicates whether a warning is generated as the precheck result. The value true indicates a warning, which does not affect the switchover process. The value false indicates an error, which will affect the switchover process. |
| errorCode | String | The error code. |
| errorMessage | String | The error message. |
Examples
Sample request
POST /api/v2/ob/clusters/{id}/tenants/failoverPreCheck
Sample response
{
"data": {
"contents": [
{
"checkResults": [
{
"errorCode": "OBE26107",
"errorMessage": "A failover is not allowed because the primary tenant can still be connected.",
"warning": false
}
],
"clusterId": 3000010,
"clusterName": "OB424_A",
"name": "ohayo_2",
"primaryTenantServiceName": "SERVICE_C",
"tenantId": 2000025,
"valid": false
}
]
},
"duration": 10165,
"server": "3af57a8e6b",
"status": 200,
"successful": true,
"timestamp": "2024-07-23T17:42:33.754+08:00",
"traceId": "8a4d817ee7e5aed8"
}