Add a node to the cluster by specifying the node to join. You need to send a request to yourself and specify the target obshell to join.
API details
Constraints
The obshell server performs security verification for this API. For more information, see API hybrid encryption.
Request paths
POST /api/v1/agent
POST /api/v1/agent/join
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| agentInfo | AgentInfo | Yes | { "ip":"10.10.10.1", "port":2886 } |
Information about the target obshell to join, including:
|
| zoneName | string | Yes | zone1 | The target zone to join. |
| masterPassword | string | No | ***** | When joining a MASTER node, if a node password is set for the MASTER, you must specify the node password with this parameter.
NoteThis parameter is supported starting with obshell V4.2.6. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Indicates whether the request was successful. |
| timestamp | time.Time | The timestamp when the server finished processing the request. |
| duration | int | Time taken by the server to process the request (milliseconds). |
| status | int | HTTP status code that conforms to the HTTP status specification. |
| traceId | string | Trace ID of the request. |
| data | DagDetailDTO | For more information, see DagDetailDTO data structure below. |
| error | ApiError | Error details, including:
|
DagDetailDTO data structure:
| Parameter | Type | Description |
|---|---|---|
| id | string | General DAG ID. |
| dag_id | int | DAG ID, which is the primary key recorded in the OceanBase database. |
| name | string | DAG name. |
| stage | int | Current execution stage of the DAG. |
| max_stage | int | Total number of stages in the DAG execution process. |
| state | string | Execution status of the DAG. |
| operator | string | Operation type of the DAG execution. |
| start_time | time.Time | Start time of the DAG execution. |
| end_time | time.Time | End time of the DAG execution. |
| additional_data | map[string]any | Other DAG data. |
| nodes | []NodeDetailDTO | All node information in the DAG. For more information, see Get node details. |
Examples
Request example
POST 10.10.10.1:2886/api/v1/agent
{
"agentInfo":
{
"ip":"10.10.10.1",
"port":2886
},
"zoneName": "zone1"
}
Response example
{
"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
}
}
References
In addition to using the CLI to call the API, you can also use the SDK.
- For more information about requesting the API using obshell-sdk-python, see Add a node before cluster initialization.
- For more information about requesting the API using obshell-sdk-go, see Add a node before cluster initialization.