|
18 | 18 | name: groups |
19 | 19 | - description: Access Control Management (ACLs) |
20 | 20 | name: acls |
| 21 | +- description: Send and receive records interactively |
| 22 | + name: records |
21 | 23 | paths: |
22 | 24 | /rest/topics: |
23 | 25 | get: |
@@ -1180,6 +1182,190 @@ paths: |
1180 | 1182 | tags: |
1181 | 1183 | - acls |
1182 | 1184 | x-accepts: application/json |
| 1185 | + /rest/topics/{topicName}/records: |
| 1186 | + get: |
| 1187 | + description: Consume a limited number of records from a topic, optionally specifying |
| 1188 | + a partition and an absolute offset or timestamp as the starting point for |
| 1189 | + message retrieval. |
| 1190 | + operationId: consumeRecords |
| 1191 | + parameters: |
| 1192 | + - description: Topic name |
| 1193 | + explode: false |
| 1194 | + in: path |
| 1195 | + name: topicName |
| 1196 | + required: true |
| 1197 | + schema: |
| 1198 | + type: string |
| 1199 | + style: simple |
| 1200 | + - description: List of properties to include for each record in the response |
| 1201 | + explode: false |
| 1202 | + in: query |
| 1203 | + name: include |
| 1204 | + required: false |
| 1205 | + schema: |
| 1206 | + items: |
| 1207 | + $ref: '#/components/schemas/RecordIncludedProperty' |
| 1208 | + type: array |
| 1209 | + style: form |
| 1210 | + - description: Limit the number of records fetched and returned |
| 1211 | + explode: true |
| 1212 | + in: query |
| 1213 | + name: limit |
| 1214 | + required: false |
| 1215 | + schema: |
| 1216 | + format: int32 |
| 1217 | + type: integer |
| 1218 | + style: form |
| 1219 | + - description: Retrieve messages with an offset equal to or greater than this |
| 1220 | + offset. If both `timestamp` and `offset` are requested, `timestamp` is given |
| 1221 | + preference. |
| 1222 | + explode: true |
| 1223 | + in: query |
| 1224 | + name: offset |
| 1225 | + required: false |
| 1226 | + schema: |
| 1227 | + format: int32 |
| 1228 | + type: integer |
| 1229 | + style: form |
| 1230 | + - description: Retrieve messages only from this partition |
| 1231 | + explode: true |
| 1232 | + in: query |
| 1233 | + name: partition |
| 1234 | + required: false |
| 1235 | + schema: |
| 1236 | + format: int32 |
| 1237 | + type: integer |
| 1238 | + style: form |
| 1239 | + - description: Retrieve messages with a timestamp equal to or later than this |
| 1240 | + timestamp. If both `timestamp` and `offset` are requested, `timestamp` is |
| 1241 | + given preference. |
| 1242 | + explode: true |
| 1243 | + in: query |
| 1244 | + name: timestamp |
| 1245 | + required: false |
| 1246 | + schema: |
| 1247 | + format: date-time |
| 1248 | + style: form |
| 1249 | + responses: |
| 1250 | + "400": |
| 1251 | + content: |
| 1252 | + application/json: |
| 1253 | + examples: |
| 1254 | + badrequest: |
| 1255 | + summary: Invalid query parameter |
| 1256 | + value: |
| 1257 | + code: 400 |
| 1258 | + error_message: Invalid parameter value |
| 1259 | + schema: |
| 1260 | + $ref: '#/components/schemas/Error' |
| 1261 | + description: |- |
| 1262 | + The client request was invalid. One or more request parameters or the request |
| 1263 | + body was rejected. Additional information may be found in the response. |
| 1264 | + "401": |
| 1265 | + content: |
| 1266 | + application/json: |
| 1267 | + schema: |
| 1268 | + $ref: '#/components/schemas/Error' |
| 1269 | + description: Request authentication missing or invalid |
| 1270 | + "403": |
| 1271 | + content: |
| 1272 | + application/json: |
| 1273 | + schema: |
| 1274 | + $ref: '#/components/schemas/Error' |
| 1275 | + description: User is not authorized to access requested resource |
| 1276 | + "500": |
| 1277 | + content: |
| 1278 | + application/json: |
| 1279 | + schema: |
| 1280 | + $ref: '#/components/schemas/Error' |
| 1281 | + description: Internal server error |
| 1282 | + "503": |
| 1283 | + content: |
| 1284 | + application/json: |
| 1285 | + schema: |
| 1286 | + $ref: '#/components/schemas/Error' |
| 1287 | + description: Kafka service unavailable |
| 1288 | + "200": |
| 1289 | + content: |
| 1290 | + application/json: |
| 1291 | + schema: |
| 1292 | + $ref: '#/components/schemas/RecordList' |
| 1293 | + description: List of records matching the request query parameters. |
| 1294 | + summary: Consume records from a topic |
| 1295 | + tags: |
| 1296 | + - records |
| 1297 | + x-accepts: application/json |
| 1298 | + post: |
| 1299 | + description: Produce (write) a single record to a topic. |
| 1300 | + operationId: produceRecord |
| 1301 | + parameters: |
| 1302 | + - description: Topic name |
| 1303 | + explode: false |
| 1304 | + in: path |
| 1305 | + name: topicName |
| 1306 | + required: true |
| 1307 | + schema: |
| 1308 | + type: string |
| 1309 | + style: simple |
| 1310 | + requestBody: |
| 1311 | + content: |
| 1312 | + application/json: |
| 1313 | + examples: |
| 1314 | + RecordProduceExample: |
| 1315 | + $ref: '#/components/examples/RecordProduceExample' |
| 1316 | + schema: |
| 1317 | + $ref: '#/components/schemas/Record' |
| 1318 | + required: true |
| 1319 | + responses: |
| 1320 | + "400": |
| 1321 | + content: |
| 1322 | + application/json: |
| 1323 | + examples: |
| 1324 | + badrequest: |
| 1325 | + summary: Invalid query parameter |
| 1326 | + value: |
| 1327 | + code: 400 |
| 1328 | + error_message: Invalid parameter value |
| 1329 | + schema: |
| 1330 | + $ref: '#/components/schemas/Error' |
| 1331 | + description: |- |
| 1332 | + The client request was invalid. One or more request parameters or the request |
| 1333 | + body was rejected. Additional information may be found in the response. |
| 1334 | + "401": |
| 1335 | + content: |
| 1336 | + application/json: |
| 1337 | + schema: |
| 1338 | + $ref: '#/components/schemas/Error' |
| 1339 | + description: Request authentication missing or invalid |
| 1340 | + "403": |
| 1341 | + content: |
| 1342 | + application/json: |
| 1343 | + schema: |
| 1344 | + $ref: '#/components/schemas/Error' |
| 1345 | + description: User is not authorized to access requested resource |
| 1346 | + "500": |
| 1347 | + content: |
| 1348 | + application/json: |
| 1349 | + schema: |
| 1350 | + $ref: '#/components/schemas/Error' |
| 1351 | + description: Internal server error |
| 1352 | + "503": |
| 1353 | + content: |
| 1354 | + application/json: |
| 1355 | + schema: |
| 1356 | + $ref: '#/components/schemas/Error' |
| 1357 | + description: Kafka service unavailable |
| 1358 | + "201": |
| 1359 | + content: |
| 1360 | + application/json: |
| 1361 | + schema: |
| 1362 | + $ref: '#/components/schemas/Record' |
| 1363 | + description: Record was successfully sent to the topic |
| 1364 | + summary: Send a record to a topic |
| 1365 | + tags: |
| 1366 | + - records |
| 1367 | + x-contentType: application/json |
| 1368 | + x-accepts: application/json |
1183 | 1369 | components: |
1184 | 1370 | examples: |
1185 | 1371 | NewTopicExample: |
@@ -1234,6 +1420,14 @@ components: |
1234 | 1420 | - topic: my-topic |
1235 | 1421 | partitions: |
1236 | 1422 | - 0 |
| 1423 | + RecordProduceExample: |
| 1424 | + description: Sample record to produce a record to partition 1, including a custom |
| 1425 | + header |
| 1426 | + value: |
| 1427 | + partition: 1 |
| 1428 | + headers: |
| 1429 | + X-Custom-Header: header-value-1 |
| 1430 | + value: '{ "examplekey": "example-value" }' |
1237 | 1431 | responses: |
1238 | 1432 | BadRequest: |
1239 | 1433 | content: |
@@ -1828,6 +2022,111 @@ components: |
1828 | 2022 | required: |
1829 | 2023 | - partition |
1830 | 2024 | type: object |
| 2025 | + Record: |
| 2026 | + description: An individual record consumed from a topic or produced to a topic |
| 2027 | + example: |
| 2028 | + headers: |
| 2029 | + key: headers |
| 2030 | + partition: 5 |
| 2031 | + offset: 5 |
| 2032 | + timestampType: timestampType |
| 2033 | + value: value |
| 2034 | + key: key |
| 2035 | + timestamp: 2000-01-23T04:56:07.000+00:00 |
| 2036 | + properties: |
| 2037 | + partition: |
| 2038 | + description: The record's partition within the topic |
| 2039 | + format: int32 |
| 2040 | + type: integer |
| 2041 | + offset: |
| 2042 | + description: The record's offset within the topic partition |
| 2043 | + format: int64 |
| 2044 | + readOnly: true |
| 2045 | + type: integer |
| 2046 | + timestamp: |
| 2047 | + description: Timestamp associated with the record. The type is indicated |
| 2048 | + by `timestampType`. When producing a record, this value will be used as |
| 2049 | + the record's `CREATE_TIME`. |
| 2050 | + format: date-time |
| 2051 | + type: string |
| 2052 | + timestampType: |
| 2053 | + description: Type of timestamp associated with the record |
| 2054 | + readOnly: true |
| 2055 | + type: string |
| 2056 | + headers: |
| 2057 | + additionalProperties: |
| 2058 | + type: string |
| 2059 | + description: Record headers, key/value pairs |
| 2060 | + type: object |
| 2061 | + key: |
| 2062 | + description: Record key |
| 2063 | + type: string |
| 2064 | + value: |
| 2065 | + description: Record value |
| 2066 | + nullable: false |
| 2067 | + type: string |
| 2068 | + required: |
| 2069 | + - value |
| 2070 | + title: Record |
| 2071 | + type: object |
| 2072 | + RecordIncludedProperty: |
| 2073 | + enum: |
| 2074 | + - partition |
| 2075 | + - offset |
| 2076 | + - timestamp |
| 2077 | + - timestampType |
| 2078 | + - headers |
| 2079 | + - key |
| 2080 | + - value |
| 2081 | + type: string |
| 2082 | + RecordList: |
| 2083 | + description: A page of records consumed from a topic |
| 2084 | + example: |
| 2085 | + total: 0 |
| 2086 | + size: 6 |
| 2087 | + page: 1 |
| 2088 | + items: |
| 2089 | + - headers: |
| 2090 | + key: headers |
| 2091 | + partition: 5 |
| 2092 | + offset: 5 |
| 2093 | + timestampType: timestampType |
| 2094 | + value: value |
| 2095 | + key: key |
| 2096 | + timestamp: 2000-01-23T04:56:07.000+00:00 |
| 2097 | + - headers: |
| 2098 | + key: headers |
| 2099 | + partition: 5 |
| 2100 | + offset: 5 |
| 2101 | + timestampType: timestampType |
| 2102 | + value: value |
| 2103 | + key: key |
| 2104 | + timestamp: 2000-01-23T04:56:07.000+00:00 |
| 2105 | + properties: |
| 2106 | + total: |
| 2107 | + description: Total number of records returned in this request. This value |
| 2108 | + does not indicate the total number of records in the topic. |
| 2109 | + format: int32 |
| 2110 | + nullable: false |
| 2111 | + type: integer |
| 2112 | + size: |
| 2113 | + description: Not used |
| 2114 | + format: int32 |
| 2115 | + type: integer |
| 2116 | + page: |
| 2117 | + description: Not used |
| 2118 | + format: int32 |
| 2119 | + type: integer |
| 2120 | + items: |
| 2121 | + items: |
| 2122 | + $ref: '#/components/schemas/Record' |
| 2123 | + nullable: false |
| 2124 | + type: array |
| 2125 | + required: |
| 2126 | + - items |
| 2127 | + - total |
| 2128 | + title: Record List |
| 2129 | + type: object |
1831 | 2130 | SortDirection: |
1832 | 2131 | enum: |
1833 | 2132 | - asc |
|
0 commit comments