Description
You can call this operation to enable an OBProxy cluster to take over an OBProxy.
Call description
Prerequisites
You have passed the authentication for the OceanBase Cloud Platform (OCP) application service.
Request path
POST /api/v2/obproxy/clusters/{id}/takeOver
Request parameters
path:
| Parameter | Type | Required? | Example value | Description |
|---|---|---|---|---|
| id | Long | Yes | 1 | The ID of the OBProxy cluster. |
body:
| Parameter | Type | Required? | Description |
|---|---|---|---|
| hosts | Array | Yes | The information about the host where the OBProxy to be taken over resides. |
Data structure of ObproxyTakeOverParam
| Parameter | Type | Required? | Example value | Description |
|---|---|---|---|---|
| hostId | Long | Yes | 1 | The ID of the host where the OBProxy to be taken over resides. |
| sqlPort | Integer | Yes | 2881 | The SQL port of the OBProxy to be taken over. |
| proxysysPasswd | String | No | xxxx | The root@proxysys password of the obproxy process deployed on the host. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | The information about the asynchronous task. For more information, see Task return structure. |
| 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. |
Examples
Sample request
POST /api/v2/obproxy/clusters/1/takeOver
{
"hosts": [
{
"hostId": 1,
"sqlPort": 2883
}
]
}
Sample response
{
"data": {
"contents": [{
"context": {
"listMap": {
"commands_to_check": ["nc"],
"process_keywords": ["obproxy", "obproxyd.sh"]
},
"parallel": false,
"parallelIdx": -1,
"stringMap": {
"obproxy_need_delete_cluster": "false",
"package_version": "1.9.1.1-1919579",
"prohibit_rollback": "false",
"service_name": "test",
"package_name": "obproxy",
"obproxy_server_id": "2",
"obproxy_parameter_version": "1",
"host_id": "2",
"obproxy_cluster_name": "test",
"obproxy_cluster_id": "1"
}
},
"creator": "admin",
"executor": "xxx.xxx.xxx.xxx",
"hostId": 2,
"id": 33001,
"name": "Install obproxy",
"operation": "EXECUTE",
"startTime": "2021-09-03T16:25:08.004+08:00",
"status": "RUNNING",
"subtasks": [{
"className": "com.alipay.ocp.service.task.business.obproxy.SyncObproxyParameterTask",
"description": "Sync obproxy parameter",
"downstreams": [34800],
"id": 34803,
"name": "Sync obproxy parameter",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 3,
"status": "PENDING",
"timeout": 30,
"upstreams": [34798]
}, {
"className": "com.alipay.ocp.service.task.business.obproxy.RegisterObproxyExporterTask",
"description": "Register obproxy exporter",
"downstreams": [34804],
"id": 34796,
"name": "Register obproxy exporter",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 7,
"status": "PENDING",
"timeout": 30,
"upstreams": [34797]
}, {
"className": "com.alipay.ocp.service.task.business.obproxy.UpdateObproxyStatusTask",
"description": "Update obproxy status",
"downstreams": [34805],
"id": 34804,
"name": "Update obproxy status",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 11,
"status": "PENDING",
"timeout": 300,
"upstreams": [34796]
}, {
"className": "com.alipay.ocp.service.task.business.obproxy.FinishTask",
"description": "Finish node",
"downstreams": [],
"id": 34805,
"name": "Finish node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 2,
"status": "PENDING",
"timeout": 0,
"upstreams": [34804]
}, {
"className": "com.alipay.ocp.service.task.business.host.InstallRpmByPackageAndVersionTask",
"description": "Install rpm by package and version",
"downstreams": [34798],
"id": 34807,
"name": "Install rpm by package and version",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 5,
"status": "PENDING",
"timeout": 3600,
"upstreams": [34799]
}, {
"className": "com.alipay.ocp.service.task.business.obproxy.SetObproxyUserPasswordForObTask",
"description": "Set obproxy user and password for connect",
"downstreams": [34797],
"id": 34800,
"name": "Set obproxy user and password for connect",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 10,
"status": "PENDING",
"timeout": 30,
"upstreams": [34803]
}, {
"className": "com.alipay.ocp.service.task.business.obproxy.StartObproxyTask",
"description": "Start obproxy process",
"downstreams": [34803],
"id": 34798,
"name": "Start obproxy process",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 1,
"status": "PENDING",
"timeout": 600,
"upstreams": [34807]
}, {
"className": "com.alipay.ocp.service.task.business.host.CheckProcessNotExistTask",
"description": "Check if process not exist",
"downstreams": [34799],
"id": 34802,
"name": "Check if process not exist",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 8,
"status": "PENDING",
"timeout": 300,
"upstreams": [34806]
}, {
"className": "com.alipay.ocp.service.task.business.obproxy.PrepareCreateObproxyTask",
"description": "Prepare create obproxy",
"downstreams": [34802],
"id": 34806,
"name": "Prepare create obproxy",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 0,
"status": "PENDING",
"timeout": 1800,
"upstreams": [34801]
}, {
"className": "com.alipay.ocp.service.task.business.host.RefreshAgentConfigTask",
"description": "Refresh ocp agent config",
"downstreams": [34796],
"id": 34797,
"name": "Refresh ocp agent config",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 9,
"status": "PENDING",
"timeout": 3600,
"upstreams": [34800]
}, {
"className": "com.alipay.ocp.service.task.business.obproxy.PrepareObproxyInstallTask",
"description": "Prepare obproxy install",
"downstreams": [34806],
"id": 34801,
"name": "Prepare obproxy install",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 4,
"status": "READY",
"timeout": 300,
"upstreams": []
}, {
"className": "com.alipay.ocp.service.task.business.host.CheckCommandTask",
"description": "Check if command exists",
"downstreams": [34807],
"id": 34799,
"name": "Check if command exists",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 6,
"status": "PENDING",
"timeout": 300,
"upstreams": [34802]
}],
"taskDefinitionId": -1,
"type": "MANUAL"
}]
},
"duration": 77,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-03T16:25:08.021+08:00",
"traceId": "c9c73aea31764206"
}