This topic describes how to delete a tenant through the API.
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| need_recycle | bool | No | true | Specifies whether to move the deleted tenant to the recycle bin. The default value is false, which means that the deleted tenant will not be moved to the recycle bin. |
Request path
DELETE /api/v1/tenant/:name
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| need_recycle | bool | No | true | Specifies whether to move the deleted tenant to the recycle bin. The default value is false, which means that the deleted tenant will not be moved to the recycle bin. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Indicates whether the request is successful. |
| timestamp | time.Time | The timestamp when the server completed the request. |
| duration | int | The time (in milliseconds) required by the server to process the request. |
| status | int | The HTTP status code. |
| traceId | string | The Trace ID of the request. |
| data | DagDetailDTO | The asynchronous task information. For more information, see Data structure of DagDetailDTO. |
| error | ApiError | The error information returned by the request, which contains the following information:
|
The data structure of DagDetailDTO is as follows:
| Parameter | Type | Description |
|---|---|---|
| id | string | The common ID of the DAG. |
| dag_id | int | The ID of the DAG, which is the primary key in 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 execution process of the DAG. |
| state | string | The execution status of the DAG. |
| operator | string | The type of the execution operation of the DAG. |
| start_time | time.Time | The start time of the execution of the DAG. |
| end_time | time.Time | The end time of the execution of the DAG. |
| additional_data | map[string]any | Other data of the DAG. |
| nodes | []NodeDetailDTO | Information about all nodes in the DAG. For more information, see Get node details. |
Examples
Request example
DELETE 10.10.10.1:2886/api/v1/tenant/t1
{
"need_recycle":false
}
Response example
{
"successful": true,
"timestamp": "2024-10-12T17:27:03.227154119+08:00",
"duration": 29,
"status": 200,
"traceId": "41c51afac21bb9e2",
"data": {
"id": "17",
"dag_id": 7,
"name": "Drop tenant",
"stage": 1,
"max_stage": 1,
"state": "READY",
"operator": "RUN",
"start_time": "0001-01-01T00:00:00Z",
"end_time": "0001-01-01T00:00:00Z",
"additional_data": null,
"nodes": null
}
}
References
You can also call the API through SDK methods.
For more information about how to call the API through obshell-sdk-python, see Delete a tenant.
For more information about how to call the API through obshell-sdk-go, see Delete a tenant.