This topic describes how to query the information about a directed acyclic graph (DAG) task by using obshell-sdk-python. DAGs are the physical concept of tasks in OceanBase Shell (obshell).
Note
We recommend that you read Quick start for a better understanding of how to use obshell-sdk-python.
Considerations
Make sure that 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 information about the DAG task whose generic_id is 20194912107080886.
dag = client.v1.get_dag("20194912107080886")
References
For more information about the API operation, see GetDagDetails.
For more information about how to call the API operation by using obshell-sdk-go, see Obtain the information about a task.