This topic describes how to use obshell-sdk-python to query the overview of all tenants in a cluster.
Note
We recommend that you first check out obshell-sdk-python quick start to learn how to use obshell-sdk-python.
Considerations
Make sure that obshell is running.
The node where the client is located must be in an initialized cluster.
Sample code
The following sample code demonstrates how to query the overview of all tenants in a cluster:
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("****"))
tenants = client.v1.get_all_tenants()
References
For more information about the API for querying the overview of all tenants, see Query the overview of all tenants.
For more information about how to use obshell-sdk-go to call API methods, see Query the overview of all tenants.