Description
You can call this operation to switch the current primary cluster to a standby cluster, and the specified standby cluster to the new primary cluster.
Call description
Limitations
None.
Request path
POST /api/v2/ob/clusters/{id:[\\d]+}/switchover
Request parameters
None.
Response parameters
| Parameter | Type | Description |
|---|---|---|
| data | Object | The information about the asynchronous task. For more information, see Task return structure. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server completes 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 responds to the request. |
Sample response
{
"data": {
"clusterId": 8,
"creator": "admin",
"executor": "xxx.xxx.xxx.xxx",
"id": 172383,
"name": "Switchover OB cluster",
"operation": "EXECUTE",
"prohibitRollback": false,
"startTime": "2022-09-05T14:12:17.398+08:00",
"status": "RUNNING",
"subtasks": [
{
"description": "Switchover Update Role Task",
"downstreams": [
203634
],
"id": 203640,
"name": "Switchover Update Role Task",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 3,
"status": "PENDING",
"timeout": 60,
"upstreams": [
203636
]
},
{
"description": "Prepare switchover",
"downstreams": [
203638
],
"id": 203637,
"name": "Prepare switchover",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 5,
"status": "PENDING",
"timeout": 300,
"upstreams": [
203639
]
},
{
"description": "Switchover to primary",
"downstreams": [
203640
],
"id": 203636,
"name": "Switchover to primary",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 2,
"status": "PENDING",
"timeout": 300,
"upstreams": [
203635
]
},
{
"description": "Mc lock ob clusters",
"downstreams": [
203637
],
"id": 203639,
"name": "Mc lock ob clusters",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 0,
"status": "READY",
"timeout": 60,
"upstreams": []
},
{
"description": "Switchover to primary check",
"downstreams": [
203636
],
"id": 203635,
"name": "Switchover to primary check",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 1,
"status": "PENDING",
"timeout": 300,
"upstreams": [
203638
]
},
{
"description": "Switchover to standby",
"downstreams": [
203635
],
"id": 203638,
"name": "Switchover to standby",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 6,
"status": "PENDING",
"timeout": 300,
"upstreams": [
203637
]
},
{
"description": "Mc unlock ob clusters",
"downstreams": [],
"id": 203634,
"name": "Mc unlock ob clusters",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 4,
"status": "PENDING",
"timeout": 60,
"upstreams": [
203640
]
}
],
"taskDefinitionId": -1,
"type": "MANUAL"
},
"duration": 193,
"server": "xxx.xxx.xxx.xxx",
"status": 200,
"successful": true,
"timestamp": "2022-09-05T14:12:17.407+08:00",
"traceId": "6ef2c4a7054f4948"
}