This topic describes how to query tenant system variables by using obshell-sdk-python. It also covers how to query tenant system variables by specifying the variables and how to query tenant system variables by using a wildcard.
Note
We recommend that you first read Get started with obshell-sdk-python to learn how to use obshell-sdk-python.
Query a specified system variable
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 example shows how to query a system variable synchronously:
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance, specifying the IP address of the node as '10.10.10.1' and the port as 2886.
client = ClientSet("10.10.10.1", 2886, PassswordAuth("****"))
variable = client.v1.get_tenant_variable("t1","max_connections")
Query tenant system variables by using a wildcard
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 example shows how to query tenant system variables synchronously:
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance, specifying the IP address of the node as '10.10.10.1' and the port as 2886.
client = ClientSet("10.10.10.1", 2886, PassswordAuth("****"))
variables = client.v1.get_tenant_variables("t1", "max_connect%")
References
For more information about the API for querying a specified tenant system variable, see Query a specified tenant system variable.
For more information about the API for querying tenant system variables by using a wildcard, see Fuzzy query tenant system variables.
For more information about how to request API methods by using obshell-sdk-go, see Query tenant system variables.