This topic describes how to destroy OceanBase Database Proxy (ODP) 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 the node corresponding to the client has deployed ODP.
Sample code
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance. The IP address of the node is '10.10.10.1', the port is 2886, and the agent password of the node is '***'.
client = ClientSet("10.10.10.1", 2886, PasswordAuth(agent_password='***'))
client.v1.delete_obproxy_sync()
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance. The IP address of the node is '10.10.10.1', the port is 2886, and the agent password of the node is '***'.
client = ClientSet("10.10.10.1", 2886, PasswordAuth(agent_password='***'))
dag = client.v1.delete_obproxy()
if dag is not None:
self.wait_dag_succeed(dag.generic_id)
References
For more information about the API to destroy ODP, see Destroy ODP.