Feature description
This interface is used to perform pre-checks for batch daily switchover of primary and standby tenants.
Call instructions
Interface constraints
The caller must have the permission to modify tenants.
For more information about the permissions of the caller, see Overview of users and permissions.
The caller must be authenticated by OCP application service.
Request path
POST /api/v2/ob/clusters/{id}/tenants/switchoverPreCheck
Request parameters
path:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| id | Integer | Yes | 3000010 | The ID of the cluster in the OCP console to which the primary tenant belongs. |
body:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| tenantParamList | SwitchoverObTenantParam | Yes | - | Each item is a primary and standby tenant to be switched over. For more information, see the SwitchoverObTenantParam data structure. |
SwitchoverObTenantParam data structure
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| tenantId | Long | Yes | 2000025 | The ID of the primary tenant in the OCP console. |
| standbyTenantId | Long | Yes | 2000022 | The ID of the standby tenant in the OCP console. |
| standbyOcpClusterId | Long | No | 100001 | The ID of the cluster in the OCP console to which the standby tenant belongs. This parameter is required only when OCP is in multi-cluster mode. |
Response
Basic data structures
Parameter |
Type |
Description |
|---|---|---|
| data | SwitchoverPreCheckResult | The check result data structure. For more information, see SwitchoverPreCheckResult data structure. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server finishes the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | The HTTP status code that conforms to the HTTP status specification. |
| traceId | String | The Trace ID of the request, which is used to troubleshoot issues. |
| server | String | The address of the application service that responds to the request. |
SwitchoverPreCheckResult data structure
Parameter |
Type |
Description |
|---|---|---|
| valid | Boolean | The precheck result. |
| tenantId | Long | The tenant ID of the primary tenant in OCP. |
| name | String | The name of the primary tenant. |
| clusterId | Long | The cluster ID of the primary tenant in OCP. |
| clusterName | String | The name of the primary tenant's cluster. |
| standbyCheckResults | ObTenantPreCheckResult | For more information, see ObTenantPreCheckResult data structure. |
ObTenantPreCheckResult data structure
Parameter |
Type |
Description |
|---|---|---|
| valid | Boolean | Indicates whether the standby tenant can be switched. |
| tenantId | Long | The tenant ID of the standby tenant in OCP. |
| name | String | The name of the standby tenant. |
| clusterId | Long | The cluster ID of the standby tenant in OCP. |
| clusterName | String | The name of the standby tenant's cluster. |
| syncScn | Long | The synchronization latency of the standby tenant. |
| primaryTenantServiceName | String | The service name of the primary tenant. |
| checkResults | PreCheckResult | The list of failure information. For more information, see PreCheckResult data structure. |
PreCheckResult data structure
Parameter |
Type |
Description |
|---|---|---|
| warning | Boolean | Indicates whether the error is a warning. The value true indicates a warning that does not affect the switchover process. The value false indicates an error that affects the switchover process. |
| errorCode | String | The error code. |
| errorMessage | String | The error message. |
Example
Request example
POST /api/v2/ob/clusters/3000010/tenants/switchoverPreCheck
{
"tenantParamList":[
{
"tenantId": 2000025,
"standbyTenantId": 2000022
}
]
}
Response example
{
"data": {
"contents": [
{
"clusterId": 3000010,
"clusterName": "OB424_A",
"name": "ohayo_2",
"standbyCheckResults": [
{
"checkResults": [
{
"errorCode": "OBE26107",
"errorMessage": "The primary and standby tenants are not associated with a common OBProxy. Therefore, automatic routing cannot be achieved after the primary tenant is switched over.",
"warning": true
}
],
"clusterId": 3000009,
"clusterName": "OB42_B",
"name": "ohayo_1",
"tenantId": 2000022,
"valid": true
}
],
"tenantId": 2000025,
"valid": true
}
]
},
"duration": 300,
"server": "3af57a8e6b",
"status": 200,
"successful": true,
"timestamp": "2024-07-23T17:34:54.581+08:00",
"traceId": "ba5d438d1a1e1bf2"
}
