Using the Rest API
In this article, we will be using Curl
to demonstrate the usage of the Rest API. You can use any preferred programming language or any tools as you like.
You may also want to directly interact with our online API using Swagger UI.
1. Generate a token
Once you have the userid
and secret key
(please check this page for how to get the userid
and secret key
), the first API need to be called is:
This API will return a temporary token that needs to be used in the API call thereafter.
Tips: If you are using SQLFLow On-Premise, token might not be required if you have set following flag in /wings/sqlflow/backend/conf/gudu_sqlflow.conf
The TTL for the token is configurable in gudu_sqlflow.conf, check here for more details.
2. Generate the data lineage
Call this API by sending the SQL query and get the result includes the data lineage.
SQLFlow Cloud Server
3. Export the data lineage in csv format
Call this API by sending the SQL file and get the csv result includes the data lineage.
Sample:
Note:
-H "Content-Type:multipart/form-data" is required.
Add @ before the upload file path
--output is required.
Optional, if you just want to fetch table to table relations, please add -F "tableToTable=true"
4. Submit multiple SQL files and get the data lineage in CSV, JSON, graphml format.
The following Apis can take multiple SQL files as the input of analysis. Compress your SQL files into one zip file and upload the archive zip file as request body if you wish to submit multiple SQL files.
/sqlflow/exportFullLineageAsCsvJob InterfaceThe full reference to the Rest APIs
SQLFlow Rest API referenceTroubleshooting
Under windows, you may need to add option
--ssl-no-revoke
to avoid some security issues,curl --ssl-no-revoke
Last updated