This topic describes how to lock a tenant by using obshell-sdk-python. A locked tenant cannot establish new connections.
Note
We recommend that you first check out the obshell-sdk-python quick start section to learn how to use obshell-sdk-python.
Considerations
Make sure that obshell is running.
Make sure that the tenant exists and is in the NORMAL state.
The node corresponding to the client in the request must be in an initialized cluster.
Sample code
The following sample code shows how to lock a tenant:
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance with the node address '10.10.10.1' and port 2886.
client = ClientSet("10.10.10.1", 2886, PassswordAuth("****"))
client.v1.lock_tenant("t1")
References
For more information about the API for locking a tenant, see Lock a tenant.
For more information about how to call the API by using obshell-sdk-go, see Lock a tenant.