Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com> Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
14 KiB
Performing a Switchover
Function
This API is used to switch over virtual IP addresses.
Constraints
Only synchronization between self-built databases supports the dual virtual IP address switchover.
URI
POST /v3/{project_id}/jobs/{job_id}/switch-vip
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID of a tenant in a region. |
job_id |
Yes |
String |
Job ID of a tenant in a region. If the task is a cross-AZ task, the parent task ID is used. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
The content type. The default value is application/json. |
X-Auth-Token |
Yes |
String |
User token obtained from IAM. |
X-Language |
No |
String |
Request language type Default value: en-us Values:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
mode |
Yes |
String |
Switchover type. Values:
|
Response Parameters
Status code: 202
Parameter |
Type |
Description |
---|---|---|
id |
String |
Task ID. |
status |
String |
Status Values:
|
error_code |
String |
Error code, which is optional and indicates the returned information about the failure status. |
error_msg |
String |
Error message, which is optional and indicates the returned information about the failure status. |
Example Request
Example of batch primary/standby switchover:
https://{EndPoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/8c81a12f-2581-4424-a3ab-70ed874jb201/switch-vip
{ "mode": "source" }
Example Response
Status code: 202
Accepted
{ "id": "8c81a12f-2581-4424-a3ab-70ed874jb201", "status": "success" }
Status Code
Status Code |
Description |
---|---|
202 |
Accepted |
400 |
Bad Request |
Error code
For details, see Error Code.