This topic describes how to query tenant parameters by using obshell-sdk-python. It also covers both exact and fuzzy queries.
Note
We recommend that you first read obshell-sdk-python quick start to learn how to use obshell-sdk-python.
Query a specified tenant parameter
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 perform a task synchronously:
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance, with the node address as '10.10.10.1' and the port as 2886.
client = ClientSet("10.10.10.1", 2886, PassswordAuth("****"))
client.v1.get_tenant_parameter("t1", "max_partition_num")
Fuzzy query tenant parameters
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 perform a task synchronously:
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance, with the node address as '10.10.10.1' and the port as 2886.
client = ClientSet("10.10.10.1", 2886, PassswordAuth("****"))
parameters = client.v1.get_tenant_parameters("t1", "max_partition%")
References
For more information about the API for querying tenant parameters, see Query tenant parameters.
For more information about the API for fuzzy querying tenant parameters, see Fuzzy query tenant parameters.
For more information about how to request API methods by using obshell-sdk-go, see Query tenant parameters.