Feature description
The interface is used to update the cluster configuration of OBProxy.
Call instructions
Interface constraints
The caller needs to authenticate through the OCP application service.
Request path
PATCH /api/v2/obproxy/clusters/{id}
Request parameters
path:
Parameter |
Type |
Required |
Example Value |
Description |
|---|---|---|---|---|
| id | Long | Yes | 1 | The ID of the OBProxy cluster. |
body:
Parameter |
Type |
Required |
Example Value |
Description |
|---|---|---|---|---|
| address | String | No | foo.bar | The access address of the OBProxy cluster. |
| port | Integer | No | 2881 | The access port of the OBProxy cluster. |
Returned result
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The requested data. |
| ├─ contents | Array | The cluster information of OBProxy. For more information, see obproxyCluster data structure. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server finishes the request. |
| duration | Integer | The time that the server takes to process the request, in milliseconds. |
| status | Integer | The HTTP status code that conforms to the HTTP status 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. |
obproxyCluster data structure
Parameter |
Type |
Description |
|---|---|---|
| id | Long | The ID of the OBProxy cluster. |
| name | String | The name of the OBProxy cluster. |
| parameterVersion | Long | The parameter version of the OBProxy cluster. |
| creatorId | Long | The ID of the creator. |
| creatorName | String | The name of the creator. |
| createTime | OffsetDateTime | The creation time. |
| updateTime | OffsetDateTime | The modification time. |
| configUrl | String | The Config URL. |
| address | String | The access address of the OBProxy cluster. |
| port | Integer | The access port of the OBProxy cluster. |
| obLinks | Array | The information about the OceanBase clusters that can be connected. For more information, see ObLink data structure. |
| versions | Array | The OBProxy deployment version information, which statistics the number of OBProxies by version. For more information, see VersionStatInfo data structure. |
| topo | Array | The OBProxy deployment topology information, which statistics the number of OBProxies by IDC. For more information, see IdcStatInfo data structure. |
| obproxies | Array | The list of all OBProxies in the cluster. For more information, see ObproxyServer data structure. |
ObLink data structure
Parameter |
Type |
Description |
|---|---|---|
| clusterId | Long | The ID of the cluster in OCP. |
| clusterName | String | The cluster name. |
| username | String | The connection user. |
| status | String | The cluster status. Valid values: |
| connections | Double | The number of OceanBase cluster connections. |
| obClusterId | Long | The ID of the cluster in OceanBase. |
| clusterType | String | The cluster type. Valid values: |
VersionStatInfo data structure
Parameter |
Type |
Description |
|---|---|---|
| version | String | The version information. |
| count | Long | The number of OBProxies. |
IdcStatInfo data structure
Parameter |
Type |
Description |
|---|---|---|
| idcName | String | The name of the IDC. |
| count | Long | The number of OBProxies. |
ObproxyServer data structure
Parameter |
Type |
Description |
|---|---|---|
| id | Long | The ID of the OBProxy server. |
| clusterId | Long | The ID of the OBProxy cluster to which the OBProxy belongs. |
| hostId | Long | The ID of the host to which the OBProxy belongs. |
| idcName | String | The name of the IDC where the OBProxy is located. |
| lastActiveTime | OffsetDateTime | The last active time. |
| parameterVersion | Long | The parameter version. |
| ip | String | The IP address. |
| sqlPort | Integer | The SQL port. |
| exporterPort | Integer | The exporter port. |
| version | String | The OBProxy version. |
| status | String | The OBProxy status. Valid values: |
| operateStatus | String | The OBProxy operation status. Valid values: |
| architecture | String | The hardware architecture of the host. |
Examples
Request example
GET /api/v2/obproxy/clusters/1
{
"address": "foo.bar",
"port": 2883
}
Response example
{
"data": {
"address": "foo.bar",
"configUrl": "http://xxx.xxx.xxx.xxx:8080/services?Action=GetObProxyConfig&User_ID=alibaba&UID=admin&ObproxyClusterName=test",
"createTime": "2021-09-01T16:52:56+08:00",
"creatorId": 100,
"creatorName": "admin",
"id": 1,
"name": "test",
"obLinks": [],
"obproxies": [{
"architecture": "x86_64",
"clusterId": 1,
"exporterPort": 2884,
"hostId": 2,
"id": 1,
"idcName": "am171",
"ip": "xxx.xxx.xxx.xxx",
"lastActiveTime": "2021-09-01T16:59:06+08:00",
"operateStatus": "NORMAL",
"parameterVersion": 3,
"sqlPort": 2883,
"status": "UNAVAILABLE",
"version": "1.9.1.1-1919579"
}],
"parameterVersion": 3,
"port": 2883,
"topo": [{
"count": 1,
"idcName": "am171"
}],
"updateTime": "2021-09-01T16:59:14+08:00",
"versions": [{
"count": 1,
"version": "1.9.1.1-1919579"
}],
"workMode": "CONFIG_URL"
},
"duration": 37,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-03T16:13:33.908+08:00",
"traceId": "5f0e2f08e30e49e7"
}
