This topic describes how to rename a tenant by using obshell-sdk-python.
Note
We recommend that you first read Get started with obshell-sdk-python 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 must be in an initialized cluster.
Sample code
The following sample code shows how to rename a tenant:
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance with the node address set to '10.10.10.1' and the port set to 2886.
client = ClientSet("10.10.10.1", 2886, PassswordAuth("****"))
client.v1.rename_tenant("t1","t2")
References
For more information about the API for renaming a tenant, see Rename a tenant.
For more information about how to call the API by using obshell-sdk-go, see Rename a tenant.