This topic describes how to stop OceanBase Database Proxy (ODP) on a specified node by using obshell-sdk-python.
Note
This API is supported starting with obshell V4.2.6.
Considerations
Make sure that obshell is running normally.
Make sure that ODP is deployed on the node corresponding to the client.
Example code
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance. The node address is '10.10.10.1', the port is 2886, and the agent password is '***'.
client = ClientSet("10.10.10.1", 2886, PasswordAuth(agent_password='***'))
client.v1.stop_obproxy_sync()
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance. The node address is '10.10.10.1', the port is 2886, and the agent password is '***'.
client = ClientSet("10.10.10.1", 2886, PasswordAuth(agent_password='***'))
dag = client.v1.stop_obproxy()
client.v1.wait_dag_succeed(dag.generic_id)
References
For more information about the API to stop ODP, see Stop ODP.