This topic describes how to lock a specified tenant by using the API. After a tenant is locked, no new connections can be established on the tenant, but existing connections remain unchanged.
API call
If you have set a password, you must authenticate. For more information, see API hybrid encryption.
Request path
POST /api/v1/tenant/:name/lock
Return result
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Indicates whether the request is successful. |
| timestamp | time.Time | The timestamp when the server completes the request. |
| duration | int | The time (in milliseconds) that the server takes to process the request. |
| status | int | The HTTP status code. |
| traceId | string | The Trace ID of the request. |
| error | ApiError | The error generated by the request, which contains the following information:
|
Examples
Request example
POST 10.10.10.1:2886/api/v1/tenant/t1/lock
Response example
{
"successful": true,
"timestamp": "2024-10-14T10:29:49.199126252+08:00",
"duration": 59,
"status": 200,
"traceId": "0f40c14342ff2e32"
}
References
You can also call API methods by using SDKs.
For more information about how to call the API method by using the obshell-sdk-python, see Lock a tenant.
For more information about how to call the API method by using the obshell-sdk-go, see Lock a tenant.