機能の概要
日常的な切り替えでは、指定されたスタンバイクラスタをプライマリクラスタに切り替えると同時に、現在のプライマリクラスタをスタンバイクラスタに切り替えます。
呼び出しの説明
インターフェース制約
なし。
リクエストパス
POST /api/v2/ob/clusters/{id:[\\d]+}/switchover
リクエストパラメータ
なし。
戻り値
パラメータ |
型 |
説明 |
|---|---|---|
| data | Object | 非同期タスク情報。詳細はタスク返却構造を参照してください。 |
| successful | Boolean | リクエストが成功したかどうかを示します。 |
| timestamp | Datetime | サーバーがリクエストを完了したタイムスタンプです。 |
| duration | Integer | サーバーがリクエストを処理した時間(ミリ秒)。 |
| status | Integer | HTTP Status仕様に準拠したコード。 |
| traceId | String | リクエストのTrace ID。問題の調査に使用されます。 |
| server | String | リクエストに応答したアプリケーションサービスのアドレスです。 |
レスポンス例
{
"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"
}