This API is used to add the specified node to the specified cluster. You must send a request to the target agent.
Call description
Limitations
If you set a password in the request, you must specify the X-OCS-Auth field in the header for authentication. For more information, see Authentication based on public-key encryption.
Request path
POST /api/v1/agent POST /api/v1/agent/join
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| agentInfo | Object | Yes | For more information, see the data structure of AgentInfo. | The information of the OceanBase Shell (OBShell) agent to which the node is to be added. |
| zoneName | String | Yes | zone1 | The zone to which the node is to be added. |
The following table describes the data structure of AgentInfo.
| Parameter | Type | Description |
|---|---|---|
| ip | String | The IP address of the agent. |
| port | Integer | The port number of the agent. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | Boolean | Indicates whether the request is 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. |
| data | Object | The information about the asynchronous task. For more information, see GetDagDetails. |
| error | Object | The information about the error that occurred. |
Examples
Sample request
POST xxx.xxx.1:2886/api/v1/agent
{
"agentInfo":
{
"ip":"xxx.xxx.1",
"port":2886
},
"zoneName": "zone1"
}
Sample response
{
"successful": true,
"timestamp": "2024-01-09T11:06:25.95745252+08:00",
"duration": 1,
"status": 200,
"traceId": "b6a0ec757782c147",
"data": {
"id": "22130706433028869",
"dag_id": 1,
"name": "Join self",
"stage": 1,
"max_stage": 1,
"state": "READY",
"operator": "RUN",
"start_time": "2024-01-09T11:06:25.956382369+08:00",
"end_time": "2024-01-09T11:06:25.956382369+08:00",
"additional_data": null,
"nodes": null
}
}