This topic describes how to query tenant parameters using obshell-sdk-python, including exact search and fuzzy search.
Note
We recommend that you first read through the Quick start section of obshell-sdk-python to understand how to use it.
Query specific tenant parameters
Considerations
Ensure that obshell is running normally.
Ensure the specified tenant exists and its status is NORMAL.
The node corresponding to the requesting client must be part of the initialized cluster.
Sample code
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance with the node address '10.10.10.1' and port 2886.
client = ClientSet("10.10.10.1", 2886, PasswordAuth("****"))
client.v1.get_tenant_parameter("t1", "max_partition_num")
Fuzzy search for tenant parameters
Considerations
Ensure that obshell is running normally.
Ensure the specified tenant exists and its status is NORMAL.
The node corresponding to the requesting client must be part of the initialized cluster.
Sample code
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance with the node address '10.10.10.1' and port 2886.
client = ClientSet("10.10.10.1", 2886, PasswordAuth("****"))
parameters = client.v1.get_tenant_parameters("t1", "max_partition%")
References
For more information about the API for querying specific tenant parameters, see Query tenant parameters.
For more information about the API for fuzzy search of tenant parameters, see Fuzzy search for tenant parameters.
For more information about how to request API methods using obshell-sdk-go, see Query tenant parameters.
