{ "method": "", "status": 0, "message": "", "data": {} }
Convention:
For more information about the Linkis Restful interface specification, please refer to: Linkis Restful Interface Specification
Interface /api/rest_j/v1/entrance/execute
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"} }
Interface /api/rest_j/v1/entrance/submit
Submission method POST
{ "executionContent": {"code": "show tables", "runType": "sql"}, "params": {"variable": {}, "configuration": {}}, "source": {"scriptPath": "file:///mnt/bdp/hadoop/1.hql"}, "labels": { "engineType": "spark-2.4.3", "userCreator": "hadoop-IDE" } }
-Return to example
{ "method": "/api/rest_j/v1/entrance/execute", "status": 0, "message": "Request executed successfully", "data": { "execID": "030418IDEhivelocalhost010004:10087IDE_hadoop_21", "taskID": "123" } }
execID is the unique identification execution ID generated for the task after the user task is submitted to Linkis. It is of type String. This ID is only useful when the task is running, similar to the concept of PID. The design of ExecID is (requestApplicationName length)(executeAppName length)(Instance length)${requestApplicationName}${executeApplicationName}${entranceInstance information ip+port}${requestApplicationName}_${umUser}_${index}
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
{ "method": "/api/rest_j/v1/entrance/{execID}/status", "status": 0, "message": "Get status successful", "data": { "execID": "${execID}", "status": "Running" } }
Interface /api/rest_j/v1/entrance/${execID}/log?fromLine=${fromLine}&size=${size}
Submission method GET
The request parameter fromLine refers to the number of lines from which to get, and size refers to the number of lines of logs that this request gets
Return example, where the returned fromLine needs to be used as a parameter for the next request of this interface
{ "method": "/api/rest_j/v1/entrance/${execID}/log", "status": 0, "message": "Return log information", "data": { "execID": "${execID}", "log": ["error log","warn log","info log", "all log"], "fromLine": 56 } }
Interface /api/rest_j/v1/entrance/${execID}/progress
Submission method GET
Return to example
{ "method": "/api/rest_j/v1/entrance/{execID}/progress", "status": 0, "message": "Return progress information", "data": { "execID": "${execID}", "progress": 0.2, "progressInfo": [ { "id": "job-1", "succeedTasks": 2, "failedTasks": 0, "runningTasks": 5, "totalTasks": 10 }, { "id": "job-2", "succeedTasks": 5, "failedTasks": 0, "runningTasks": 5, "totalTasks": 10 } ] } }
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}" } }