Feature description
The interface for adding an OBProxy to an OBProxy cluster.
Call instructions
Interface constraints
You must authenticate by using OCP application service.
Request path
POST /api/v2/obproxy/clusters/{id}/obproxies/batchAdd
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 |
|---|---|---|---|---|
| hostIds | Array | Yes | [1,2] | The host ID of the OBProxy to be added. |
| sqlPort | Integer | Yes | 2883 | The SQL port. |
| exporterPort | Integer | Yes | 2884 | The Exproter port. |
| rpcPort | Integer | No | 2884 | The RPC port. OBProxy must be V4.3.0 or later. |
| version | String | Yes | obproxy-1.9.1.1-1919579.el7.x86_64.rpm | The software package version. |
Return result
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The asynchronous task information. For more information, see Task information. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server finishes processing the request. |
| duration | Integer | The 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, which is used to troubleshoot issues. |
| server | String | The address of the application service that responds to the request. |
Examples
Request example
POST /api/v2/obproxy/clusters/1/obproxies/batchAdd
{
"hostIds": [2],
"sqlPort": 2883,
"exporterPort": 2884,
"version": "obproxy-1.9.1.1-1919579.el7.x86_64.rpm"
}
Response example
{
"data": {
"contents": [{
"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": [{
"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]
}, {
"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]
}, {
"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]
}, {
"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]
}, {
"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]
}, {
"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]
}, {
"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]
}, {
"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]
}, {
"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]
}, {
"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]
}, {
"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": []
}, {
"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"
}
