Description
The interface used to create an OBProxy cluster.
Call instructions
Interface constraints
The caller needs to be authenticated through the OCP application service.
Request path
POST /api/v2/obproxy/clusters
Request parameters
body:
Parameter |
Type |
Required |
Example Value |
Description |
|---|---|---|---|---|
| name | String | Yes | foo | The name of the OBProxy cluster. |
| address | String | Yes | foo.bar | The access address of the OBProxy cluster. |
| port | Integer | Yes | 2883 | The access port of the OBProxy cluster. |
| workMode | String | No | CONFIG_URL | The work mode of the OBProxy cluster. Valid values: |
| obproxyInstallParam | Object | Yes | -- | The OBProxy information to be installed when the OBProxy cluster is created. |
| ├─hostIds | Array | Yes | [1,2] | The ID of the host on which OBProxy is to be installed. |
| ├─sqlPort | Integer | Yes | 2883 | The SQL port of OBProxy. |
| ├─exportPort | Integer | Yes | 2884 | The Exproter port of OBProxy. |
| ├─version | String | No | obproxy-1.9.1.1-1919579.el7.x86_64.rpm | The software package version. This parameter is not required if OBProxy Server is not to be deployed. |
| obLinks | Array | No | -- | The information about the OceanBase cluster that can be connected. For more information, see ObLink data structure. |
| startupParameters | Array | No | -- | The startup parameters of OBProxy. For more information, see ObproxyParameter data structure. This parameter can be an empty array. |
| parameters | Array | No | -- | The non-startup parameters of OBProxy. For more information, see ObproxyParameter data structure. This parameter can be an empty array. |
| password | String | No | -- | The password of the proxysys account. OBProxy versions earlier than V3.1.0 do not support this parameter. |
ObLink data structure
Parameter |
Type |
Required |
Example Value |
Description |
|---|---|---|---|---|
| clusterName | String | Yes | foo | The name of the OceanBase cluster. |
| obClusterId | Integer | No | 1 | The ID of the cluster in OceanBase. |
| username | String | Yes | proxyro | The username for connecting to the cluster. |
ObproxyParameter data structure
Parameter |
Type |
Required |
Example Value |
Description |
|---|---|---|---|---|
| name | String | Yes | foo | The parameter name. |
| value | String | Yes | bar | The parameter value. |
Return result
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | Asynchronous task information. For more information, see Task information. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp indicating the time when the server finishes the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An HTTP status code that conforms to the HTTP status code specification. |
| traceId | String | The Trace ID of the request, which is used for troubleshooting. |
| server | String | The address of the application service that responds to the request. |
Example
Request example
POST /api/v2/obproxy/clusters
{
"name": "OBProxy001",
"installPath": "/home/admin/obproxy",
"runUser": "admin",
"address": "foo.bae",
"port": 2883,
"password": "",
"workMode": "CONFIG_URL",
"obproxyInstallParam": {
"version": "obproxy-x.x.x.-752024120610.el7.x86_64.rpm",
"sqlPort": 2883,
"rpcPort": 2885,
"exporterPort": 2884,
"hostIds": [1]
}
}
Response example
{
"data": {
"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": [{
"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]
},
{
"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"
}
