This topic describes how to delete a zone from an initialized cluster. After a zone is deleted, the observer processes on the zone are also removed from the cluster.
Considerations
When deleting a zone, ensure that no units are present in the zone to be deleted.
API call description
API constraints
obshell Server performs security checks on this API. For more information, see API hybrid encryption.
Request path
DELETE /api/v1/zone/{zoneName}
Request parameters
None
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 DagDetailDTO data structure section below. |
| error | ApiError | The error details, including the following information:
|
The DagDetailDTO data structure 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 status of the DAG. |
| operator | string | The execution operation type of the DAG. |
| start_time | time.Time | The start time of DAG execution. |
| end_time | time.Time | The end time of DAG execution. |
| additional_data | map[string]any | Other data of the DAG. |
| nodes | []NodeDetailDTO | The details of all nodes in the DAG. For more information, see Get node details. |
Example
Request example
Send a request to the 10.10.10.1:2886 node to delete the zone3 zone from the cluster. Here is an example:
POST 10.10.10.1:2886/api/v1/zone/zone3
Response example
{
"successful": true,
"timestamp": "2024-12-23T19:46:19.33899863+08:00",
"duration": 99,
"status": 200,
"traceId": "8651d2dd3e17280e",
"data": {
"id": "13",
"dag_id": 3,
"name": "Delete zone",
"stage": 1,
"max_stage": 7,
"state": "READY",
"operator": "RUN",
"start_time": "0001-01-01T00:00:00Z",
"end_time": "0001-01-01T00:00:00Z",
"additional_data": null,
"nodes": null
}
}
References
In addition to calling the API through the CLI, you can also call the API through SDK methods.
For information about how to request the API by using the obshell-sdk-python SDK, see Delete a zone.
For information about how to request the API by using the obshell-sdk-go SDK, see Delete a zone.