|
| 1 | +<!-- |
| 2 | + - Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | + - contributor license agreements. See the NOTICE file distributed with |
| 4 | + - this work for additional information regarding copyright ownership. |
| 5 | + - The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | + - (the "License"); you may not use this file except in compliance with |
| 7 | + - the License. You may obtain a copy of the License at |
| 8 | + - |
| 9 | + - http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + - |
| 11 | + - Unless required by applicable law or agreed to in writing, software |
| 12 | + - distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + - See the License for the specific language governing permissions and |
| 15 | + - limitations under the License. |
| 16 | + --> |
| 17 | + |
| 18 | +# REST API v1 |
| 19 | + |
| 20 | +Note that: now the api version is v1 and the base uri is `/api/v1`. |
| 21 | + |
| 22 | +## Batch Resource |
| 23 | + |
| 24 | +### GET /batches |
| 25 | + |
| 26 | +Returns all the batches. |
| 27 | + |
| 28 | +#### Request Parameters |
| 29 | + |
| 30 | +| Name | Description | Type | |
| 31 | +| :--------- |:--------------------------------------------------------------------------------------------------------| :----- | |
| 32 | +| batchType | The batch type, such as spark/flink, if no batchType is specified,<br/> return all types | String | |
| 33 | +| batchState | The valid batch state can be one of the following:<br/> PENDING, RUNNING, FINISHED, ERROR, CANCELED | String | |
| 34 | +| batchUser | The user name that created the batch | String | |
| 35 | +| createTime | Return the batch that created after this timestamp | Long | |
| 36 | +| endTime | Return the batch that ended before this timestamp | Long | |
| 37 | +| from | The start index to fetch sessions | Int | |
| 38 | +| size | Number of sessions to fetch | Int | |
| 39 | + |
| 40 | +#### Response Body |
| 41 | + |
| 42 | +| Name | Description | Type | |
| 43 | +| :------ | :---------------------------------- | :--- | |
| 44 | +| from | The start index of fetched sessions | Int | |
| 45 | +| total | Number of sessions fetched | Int | |
| 46 | +| batches | [Batch](#batch) List | List | |
| 47 | + |
| 48 | +### POST /batches |
| 49 | + |
| 50 | +#### Request Body |
| 51 | + |
| 52 | +| Name | Description | Type | |
| 53 | +| :-------- |:---------------------------------------------------|:-----------------| |
| 54 | +| batchType | The batch type, such as Spark, Flink | String | |
| 55 | +| resource | The resource containing the application to execute | Path (required) | |
| 56 | +| className | Application main class | String(required) | |
| 57 | +| name | The name of this batch. | String | |
| 58 | +| conf | Configuration properties | Map of key=val | |
| 59 | +| args | Command line arguments for the application | List of Strings | |
| 60 | + |
| 61 | + |
| 62 | +#### Response Body |
| 63 | + |
| 64 | +The created [Batch](#batch) object. |
| 65 | + |
| 66 | +### GET /batches/{batchId} |
| 67 | + |
| 68 | +Returns the batch information. |
| 69 | + |
| 70 | +#### Response Body |
| 71 | + |
| 72 | +The [Batch](#batch). |
| 73 | + |
| 74 | +### DELETE /batches/${batchId} |
| 75 | + |
| 76 | +Kill the batch if it is still running. |
| 77 | + |
| 78 | +#### Request Parameters |
| 79 | + |
| 80 | +| Name | Description | Type | |
| 81 | +| :---------------------- | :---------------------------- | :--------------- | |
| 82 | +| hive.server2.proxy.user | the proxy user to impersonate | String(optional) | |
| 83 | + |
| 84 | +#### Response Body |
| 85 | + |
| 86 | +| Name | Description | Type | |
| 87 | +| :------ |:--------------------------------------| :------ | |
| 88 | +| success | Whether killed the batch successfully | Boolean | |
| 89 | +| msg | The kill batch message | String | |
| 90 | + |
| 91 | +### GET /batches/${batchId}/localLog |
| 92 | + |
| 93 | +Gets the local log lines from this batch. |
| 94 | + |
| 95 | +#### Request Parameters |
| 96 | + |
| 97 | +| Name | Description | Type | |
| 98 | +| :--- | :-------------------------------- | :--- | |
| 99 | +| from | Offset | Int | |
| 100 | +| size | Max number of log lines to return | Int | |
| 101 | + |
| 102 | +#### Response Body |
| 103 | + |
| 104 | +| Name | Description | Type | |
| 105 | +| :-------- | :---------------- |:--------------| |
| 106 | +| logRowSet | The log lines | List of sting | |
| 107 | +| rowCount | The log row count | Int | |
| 108 | + |
| 109 | +### Batch |
| 110 | + |
| 111 | +| Name | Description | Type | |
| 112 | +| :------------- |:------------------------------------------------------------------| :----- | |
| 113 | +| id | The batch id | String | |
| 114 | +| user | The user created the batch | String | |
| 115 | +| batchType | The batch type | String | |
| 116 | +| name | The batch name | String | |
| 117 | +| appId | The batch application Id | String | |
| 118 | +| appUrl | The batch application tracking url | String | |
| 119 | +| appState | The batch application state | String | |
| 120 | +| appDiagnostic | The batch application diagnostic | String | |
| 121 | +| kyuubiInstance | The kyuubi instance that created the batch | String | |
| 122 | +| state | The kyuubi batch operation state | String | |
| 123 | +| createTime | The batch create time | Long | |
| 124 | +| endTime | The batch end time, if it has not been terminated, the value is 0 | Long | |
0 commit comments