Restful Api
Linkis defines its own set of interface specifications when interacting between the front and back ends.
If you are interested in the interface specification, please click here view interface specification
We provide the following interfaces to facilitate users to quickly submit execution jobs and obtain execution results.
- Submit for execution
- Get status
- Get logs
- Get progress
- Kill mission
Interface
Submission method
POST
- The parameters in the request body data are described as follows
- Return to example
{
"method": "/api/rest_j/v1/entrance/execute",
"message": "Request executed successfully",
"data": {
"execID": "030418IDEhivebdpdwc010004:10087IDE_johnnwang_21",
"taskID": "123"
}
}
- execID is the uniquely identified execution ID generated for the task after the user task is submitted to UJES. It is of String type. This ID is only useful when the task is running, similar to the concept of PID. ExecID is designed as (requestApplicationName length) (executeAppName length 1) (Instance length 2)${requestApplicationName}${executeApplicationName}${entranceInstance information ip+port}${requestApplicationName}${umUser}${index}
- taskID is the unique ID of the task submitted by the user. This ID is generated by the database self-increment and is of Long type
3.2 Get status
Interface
/api/rest_j/v1/entrance/${execID}/status
Submission method
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 the parameters of the next log request
{
"method": "/api/rest_j/v1/entrance/${execID}/log",
"status": 0,
"message": "Return log information",
"data": {
"log": ["error log","warn log","info log", "all log"],
"fromLine": 56
}
3.4 Get progress
Interface
/api/rest_j/v1/entrance/${execID}/progress
Submission method
GET
Return to example
Submission method
GET
Return example, where the returned fromLine needs the parameters of the next log request
{
"method": "/api/rest_j/v1/entrance/{execID}/kill",
"status": 0,
"message": "OK",
"data": {
"execID":"${execID}"
}
3.6 System User Agent Settings
Gateway proxy settings
Modify the proxy.properties file in the gateway installation directory conf and add content: token=user1,user2
Note: The token is the secret key given to the system user, and the right is the other users that the system user can act as proxy. For example, token=*, the user is not restricted.
http request proxy settings
Add two parameter settings to the Headers parameter of the request