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

    1. {
    2. "executeApplicationName": "hive", //Engine type
    3. "requestApplicationName": "dss", //Client service type
    4. "executionCode": "show tables",
    5. "params": {"variable": {}, "configuration": {}},
    6. "runType": "hql", //The type of script to run
    7. "source": {"scriptPath":"file:///tmp/hadoop/1.hql"}
    8. }
    • Submission method POST

    -Return to example

    1. {
    2. "method": "/api/rest_j/v1/entrance/execute",
    3. "status": 0,
    4. "message": "Request executed successfully",
    5. "execID": "030418IDEhivebdpdwc010004:10087IDE_hadoop_21",
    6. "taskID": "123"
    7. }
    8. }
    • 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

    1. {
    2. "status": 0,
    3. "message": "Return log information",
    4. "data": {
    5. "execID": "${execID}",
    6. "fromLine": 56
    7. }
    8. }
    • 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

    1. {
    2. "method": "/api/rest_j/v1/entrance/{execID}/kill",
    3. "status": 0,
    4. "message": "OK",
    5. "data": {
    6. "execID":"${execID}"
    7. }