kyuubi/docs/client/rest/rest_api.md
Fei Wang 9cb8041dbd [KYUUBI #3076][Subtask][#3039] Add the docs for rest api - Batch Resource
### _Why are the changes needed?_

Add the docs for batch resource rest api.
Close #3076

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [x] Add screenshots for manual tests if appropriate
![image](https://user-images.githubusercontent.com/6757692/178957570-b0b9b006-a9a0-413d-bf74-c9c744d1fd50.png)

- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #3075 from turboFei/rest_api.

Closes #3076

970498e6 [Fei Wang] Cap
445fde21 [Fei Wang] nit
4b0306df [Fei Wang] refactor
b4a5a74f [Fei Wang] add rest api docs

Authored-by: Fei Wang <fwang12@ebay.com>
Signed-off-by: Fei Wang <fwang12@ebay.com>
2022-07-15 10:46:46 +08:00

5.7 KiB

REST API v1

Note that: now the api version is v1 and the base uri is /api/v1.

Batch Resource

GET /batches

Returns all the batches.

Request Parameters

Name Description Type
batchType The batch type, such as spark/flink, if no batchType is specified,
return all types
String
batchState The valid batch state can be one of the following:
PENDING, RUNNING, FINISHED, ERROR, CANCELED
String
batchUser The user name that created the batch String
createTime Return the batch that created after this timestamp Long
endTime Return the batch that ended before this timestamp Long
from The start index to fetch sessions Int
size Number of sessions to fetch Int

Response Body

Name Description Type
from The start index of fetched sessions Int
total Number of sessions fetched Int
batches Batch List List

POST /batches

Request Body

Name Description Type
batchType The batch type, such as Spark, Flink String
resource The resource containing the application to execute Path (required)
className Application main class String(required)
name The name of this batch. String
conf Configuration properties Map of key=val
args Command line arguments for the application List of Strings

Response Body

The created Batch object.

GET /batches/{batchId}

Returns the batch information.

Response Body

The Batch.

DELETE /batches/${batchId}

Kill the batch if it is still running.

Request Parameters

Name Description Type
hive.server2.proxy.user the proxy user to impersonate String(optional)

Response Body

Name Description Type
success Whether killed the batch successfully Boolean
msg The kill batch message String

GET /batches/${batchId}/localLog

Gets the local log lines from this batch.

Request Parameters

Name Description Type
from Offset Int
size Max number of log lines to return Int

Response Body

Name Description Type
logRowSet The log lines List of sting
rowCount The log row count Int

Batch

Name Description Type
id The batch id String
user The user created the batch String
batchType The batch type String
name The batch name String
appId The batch application Id String
appUrl The batch application tracking url String
appState The batch application state String
appDiagnostic The batch application diagnostic String
kyuubiInstance The kyuubi instance that created the batch String
state The kyuubi batch operation state String
createTime The batch create time Long
endTime The batch end time, if it has not been terminated, the value is 0 Long