This topic describes how to restore a specified tenant from the recycle bin by using the API.
Call procedure
If a password is set, you must authenticate. For more information, see API hybrid encryption.
Request path
POST /api/v1/recyclebin/tenant/:name
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| new_name | string | No | t2 | The new name of the restored tenant. If this parameter is not specified, the restored tenant will have the same name as its original tenant. |
Return results
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Indicates whether the request is successful. |
| timestamp | time.Time | The timestamp when the server received the request. |
| duration | int | The time (in milliseconds) that the server took to process the request. |
| status | int | The HTTP status code. |
| traceId | string | The Trace ID of the request. |
| error | ApiError | The error information returned during the request, which contains the following information:
|
Examples
Request example
POST 10.10.10.1:2886/api/v1/recyclebin/tenant/t1
{
"new_name": "t2"
}
Response example
{
"successful": true,
"timestamp": "2024-10-14T16:00:09.813011861+08:00",
"duration": 130,
"status": 200,
"traceId": "fa1fbe181d870bde"
}
References
You can also call API methods by using SDKs.
For more information about how to call the restore-tenant API by using the obshell-sdk-python SDK, see Restore a tenant from the recycle bin.
For more information about how to call the restore-tenant API by using the obshell-sdk-go SDK, see Restore a tenant from the recycle bin.