This topic describes how to query the current status of the specified OBServer node, such as the identity, process information, and service status of the node, by using obshell-sdk-python.
Note
We recommend that you read Quick start for a better understanding of how to use obshell-sdk-python.
Considerations
Make sure that OceanBase Shell (obshell) runs normally.
Sample code
The sample code for synchronous task execution is as follows:
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance, with the IP address of "10.10.10.1" and the port number of 2886.
# Enter the root@sys password "****" for the cluster.
client = ClientSet("10.10.10.1", 2886, PasswordAuth("****"))
# Obtain the status of the node.
status = client.v1.get_status()
References
For more information about the API operation, see QueryNodeStatus.
For more information about how to call the API operation by using obshell-sdk-go, see Query the status of a node.