This topic describes how to restore a tenant from the recycle bin by using obshell-sdk-python.
Note
We recommend that you first check out the obshell-sdk-python quick start topic 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
The following sample code shows how to restore a tenant from the recycle bin:
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance. The IP address of the node is '10.10.10.1' and the port is 2886.
client = ClientSet("10.10.10.1", 2886, PassswordAuth("****"))
# Restore the tenant named t1 in the recycle bin to a new tenant named t2.
client.v1.flashback_recyclebin_tenant("t1", new_name="t2")
References
For more information about the API for restoring a tenant from the recycle bin, see Restore a tenant from the recycle bin.
For more information about how to call the API by using obshell-sdk-go, see Restore a tenant from the recycle bin.