diff --git a/docs/client/rest/index.rst b/docs/client/rest/index.rst index 3a7683e4c..3e94c0e2d 100644 --- a/docs/client/rest/index.rst +++ b/docs/client/rest/index.rst @@ -20,5 +20,5 @@ RESTful APIs and Clients .. toctree:: :maxdepth: 2 - hive_beeline + rest_api diff --git a/docs/client/rest/rest_api.md b/docs/client/rest/rest_api.md new file mode 100644 index 000000000..e9a40c961 --- /dev/null +++ b/docs/client/rest/rest_api.md @@ -0,0 +1,124 @@ + + +# 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](#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](#batch) object. + +### GET /batches/{batchId} + +Returns the batch information. + +#### Response Body + +The [Batch](#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 |