This topic describes how to query information about a specified 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.
The node corresponding to the client in the request must be in an initialized cluster.
Sample code
The following example shows how to query tenant information synchronously:
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("****"))
tenant_info = client.v1.get_tenant_info("t1")
References
For more information about the API for querying tenant information, see Query tenant information.
For more information about how to call the API by using obshell-sdk-go, see Query tenant information.