This topic describes how to remove a specified node from an initialized cluster.
Description
Interface constraints
obshell Server performs security checks on this API. For more information, see Hybrid encryption for APIs.
Request path
DELETE /api/v1/observer POST /api/v1/ob/scale_in
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| agent_info | AgentInfo | Yes | { "ip": "10.10.10.3", "port": 2886 } |
The information of the node to be removed from the cluster. The information includes the following:
|
| force_kill | map[string]string | No | true | If you set this parameter to true, the observer process will be killed before the node is removed from the cluster.
NoticeYou must set |
Response
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Indicates whether the request was successful. |
| timestamp | time.Time | The timestamp when the server completed the request. |
| duration | int | The time taken by the server to process the request, in milliseconds. |
| status | int | The HTTP status code. |
| traceId | string | The trace ID of the request. |
| data | DagDetailDTO | For more information, see the Data structure of DagDetailDTO section below. |
| error | ApiError | The error information, which contains the following parameters:
|
The data structure of DagDetailDTO is as follows:
| Parameter | Type | Description |
|---|---|---|
| id | string | The general ID of the DAG. |
| dag_id | int | The ID of the DAG, which is the primary key stored in the OceanBase Database. |
| name | string | The name of the DAG. |
| stage | int | The current execution stage of the DAG. |
| max_stage | int | The total number of stages in the DAG execution process. |
| state | string | The execution state of the DAG. |
| operator | string | The execution operation type of the DAG. |
| start_time | time.Time | The start time of the DAG execution. |
| end_time | time.Time | The end time of the DAG execution. |
| additional_data | map[string]any | Other data of the DAG. |
| nodes | []NodeDetailDTO | The information of all nodes in the DAG. For more information, see Obtain the details of a node. |
Example
Request example
POST 10.10.10.1:2886/api/v1/ob/scale_in
{
"agent_info": {
"ip": "10.10.10.4",
"port": 2886
},
"force_kill": false
}
This example shows a request to remove the 10.10.10.4:2886 node from the cluster by sending a request to the 10.10.10.1:2886 node.
Response example
{
"successful": true,
"timestamp": "2024-12-23T19:38:38.10769991+08:00",
"duration": 101,
"status": 200,
"traceId": "50c6e85c24a30919",
"data": {
"id": "11",
"dag_id": 1,
"name": "Cluster scale in",
"stage": 1,
"max_stage": 5,
"state": "READY",
"operator": "RUN",
"start_time": "0001-01-01T00:00:00Z",
"end_time": "0001-01-01T00:00:00Z",
"additional_data": null,
"nodes": null
}
}
Related documents
You can also call APIs by using SDK methods.
For more information about how to call APIs by using the obshell-sdk-python SDK, see Shrink a cluster.
For more information about how to call APIs by using the obshell-sdk-go SDK, see Shrink a cluster.