Linkis Task submission and execution Rest API document
- The return of the Linkis Restful interface follows the following standard return format:
- method: Returns the requested Restful API URI, which is mainly used in WebSocket mode.
- status: return status information, where: -1 means no login, 0 means success, 1 means error, 2 means verification failed, 3 means no access to the interface.
- data: return specific data.
- message: return the requested prompt message. If the status is not 0, the message returned is an error message, and the data may have a stack field, which returns specific stack information.
For more information about the Linkis Restful interface specification, please refer to: Linkis Restful Interface Specification
Interface
Submission method
POST
{
"executeApplicationName": "hive", //Engine type
"requestApplicationName": "dss", //Client service type
"executionCode": "show tables",
"params": {"variable": {}, "configuration": {}},
"runType": "hql", //The type of script to run
"source": {"scriptPath":"file:///tmp/hadoop/1.hql"}
}
Submission method
POST
-Return to example
{
"method": "/api/rest_j/v1/entrance/execute",
"status": 0,
"message": "Request executed successfully",
"execID": "030418IDEhivebdpdwc010004:10087IDE_hadoop_21",
"taskID": "123"
}
}
taskID is the unique ID that represents the task submitted by the user. This ID is generated by the database self-increment and is of Long type
Interface
/api/rest_j/v1/entrance/${execID}/status
Submission method
GET
Return to example
Interface
/api/rest_j/v1/entrance/${execID}/log?fromLine=${fromLine}&size=${size}
Submission method
GET
Return example, where the returned fromLine needs to be used as a parameter for the next request of this interface
{
"status": 0,
"message": "Return log information",
"data": {
"execID": "${execID}",
"fromLine": 56
}
}
Interface
/api/rest_j/v1/entrance/${execID}/progress
Submission method
GET
Return to example
Interface
/api/rest_j/v1/entrance/${execID}/kill
Submission method
POST
{
"method": "/api/rest_j/v1/entrance/{execID}/kill",
"status": 0,
"message": "OK",
"data": {
"execID":"${execID}"
}