Description
You can call this operation to create an OBProxy cluster.
Call description
Prerequisite
You have passed the authentication for the OCP application service.
Request path
POST /api/v2/obproxy/clusters
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| name | String | Yes | foo | The name of the OBProxy cluster. |
| address | String | No | foo.bar | The IP address of the OBProxy cluster. |
| port | Integer | No | 2883 | The access port number of the OBProxy cluster. |
| workMode | String | No | CONFIG_URL | The operating mode of the OBProxy cluster. Valid values: * CONFIG_URL * RS_LIST |
| obproxyInstallParam | Object | No | -- | The information about the OBProxy to be installed for creating an OBProxy cluster. |
| ├─hostIds | Array | Yes | [1,2] | The ID of the host where the OBProxy is to be installed. |
| ├─sqlPort | Integer | Yes | 2883 | The SQL port number of the OBProxy. |
| ├─exportPort | Integer | Yes | 2884 | The exporter port number of the OBProxy. |
| ├─version | String | Yes | obproxy-1.9.1.1-1919579.el7.x86_64.rpm | The version of the software package. |
| obLinks | Array | Yes | -- | The information about connectable OceanBase clusters. For more information about the data structure, see Data structure of ObLink. In RS_LIST mode, only one connectable OceanBase cluster is available. In CONFIG_URL mode, the number of connectable OceanBase clusters is not limited. |
| startupParameters | Array | Yes | -- | The startup parameters of the OBProxy. For more information about the data structure, see Data structure of ObproxyParameter. This array can be left empty. |
| parameters | Array | Yes | -- | The non-startup parameters of the OBProxy. For more information about the data structure, see Data structure of ObproxyParameter. This array can be left empty. |
Data structure of ObLink
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| clusterName | String | Yes | foo | The name of the OceanBase cluster. |
| obClusterId | Integer | Yes | 1 | The ID of the OceanBase cluster. |
| username | String | Yes | proxyro | The username used to connect to the cluster. |
Data structure of ObproxyParameter
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| name | String | Yes | foo | The name of the parameter. |
| value | String | Yes | bar | The value of the parameter. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | The information about the asynchronous task. For more information, see Task information. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An 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
{
"obproxyInstallParam": {
"hostIds": []
},
"obLinks": [{
"clusterName": "hooray",
"clusterId": 1,
"username": "proxyro",
"obClusterId": 1
}],
"name": "OBProxy001",
"address": "foo.bar",
"port": 2883,
"workMode": "CONFIG_URL"
}
Sample response
{
"data": {
"context": {
"listMap": {},
"parallel": false,
"parallelIdx": -1,
"stringMap": {
"prohibit_rollback": "false"
}
},
"creator": "admin",
"executor": "xxx.xxx.xxx.xxx",
"id": 31257,
"name": "Install obproxy",
"operation": "EXECUTE",
"startTime": "2021-09-03T15:05:01.101+08:00",
"status": "RUNNING",
"subtasks": [{
"className": "com.alipay.ocp.service.task.business.obproxy.FinishTask",
"description": "Finish node",
"downstreams": [],
"id": 32955,
"name": "Finish node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 1,
"status": "PENDING",
"timeout": 0,
"upstreams": [32954]
}, {
"className": "com.alipay.ocp.service.task.business.obproxy.PrepareObproxyInstallTask",
"description": "Prepare obproxy install",
"downstreams": [32955],
"id": 32954,
"name": "Prepare obproxy install",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 0,
"status": "READY",
"timeout": 300,
"upstreams": []
}],
"taskDefinitionId": -1,
"type": "MANUAL"
},
"duration": 82,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-03T15:05:01.106+08:00",
"traceId": "e874a2cead544112"
}