This topic describes how to purge a tenant from the recycle bin by using obshell-sdk-python. The corresponding resource pool will also be released.
Note
We recommend that you first read obshell-sdk-python Quick Start to learn how to use obshell-sdk-python.
Considerations
Make sure that obshell is running.
The node corresponding to the client must be in an initialized cluster.
Sample code
Synchronous execution
Asynchronous execution
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance, where the node address is '10.10.10.1' and the port is 2886.
client = ClientSet("10.10.10.1", 2886, PassswordAuth("****"))
client.v1.purge_recyclebin_tenant_sync("t1")
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance, where the node address is '10.10.10.1' and the port is 2886.
client = ClientSet("10.10.10.1", 2886, PassswordAuth("****"))
dag = client.v1.purge_recyclebin_tenant("t1")
# Wait for the task to complete.
client.v1.wait_dag_succeed(dag.generic_id)
References
For more information about the API for purging a tenant from the recycle bin, see Purge a tenant from the recycle bin.
For more information about how to call API methods by using obshell-sdk-go, see Purge a tenant from the recycle bin.
