|
21 | 21 | from typing_extensions import Annotated |
22 | 22 | from otari._client.models.external_events_request import ExternalEventsRequest |
23 | 23 | from otari._client.models.external_ingest_result import ExternalIngestResult |
| 24 | +from otari._client.models.in_flight_response import InFlightResponse |
24 | 25 | from otari._client.models.usage_count import UsageCount |
25 | 26 | from otari._client.models.usage_delete_request import UsageDeleteRequest |
26 | 27 | from otari._client.models.usage_delete_result import UsageDeleteResult |
@@ -1131,6 +1132,253 @@ def _ingest_external_usage_v1_usage_external_events_post_serialize( |
1131 | 1132 |
|
1132 | 1133 |
|
1133 | 1134 |
|
| 1135 | + @validate_call |
| 1136 | + def list_in_flight_v1_usage_in_flight_get( |
| 1137 | + self, |
| 1138 | + _request_timeout: Union[ |
| 1139 | + None, |
| 1140 | + Annotated[StrictFloat, Field(gt=0)], |
| 1141 | + Tuple[ |
| 1142 | + Annotated[StrictFloat, Field(gt=0)], |
| 1143 | + Annotated[StrictFloat, Field(gt=0)] |
| 1144 | + ] |
| 1145 | + ] = None, |
| 1146 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 1147 | + _content_type: Optional[StrictStr] = None, |
| 1148 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 1149 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 1150 | + ) -> InFlightResponse: |
| 1151 | + """List In Flight |
| 1152 | +
|
| 1153 | + Requests the gateway is currently serving, longest-running first. A usage row is written when a request settles, so the log alone cannot answer \"is anything happening right now\": on a slow backend, a 30-second local model call is invisible until it finishes. This reports what is in progress. Read from an in-memory registry, so it describes the process that answers this call and not the deployment: behind a load balancer, consecutive polls reach different otari processes, and there is no deployment-wide total to ask for. ``total`` is the true in-flight count for the answering process even when ``requests`` is capped. |
| 1154 | +
|
| 1155 | + :param _request_timeout: timeout setting for this request. If one |
| 1156 | + number provided, it will be total request |
| 1157 | + timeout. It can also be a pair (tuple) of |
| 1158 | + (connection, read) timeouts. |
| 1159 | + :type _request_timeout: int, tuple(int, int), optional |
| 1160 | + :param _request_auth: set to override the auth_settings for an a single |
| 1161 | + request; this effectively ignores the |
| 1162 | + authentication in the spec for a single request. |
| 1163 | + :type _request_auth: dict, optional |
| 1164 | + :param _content_type: force content-type for the request. |
| 1165 | + :type _content_type: str, Optional |
| 1166 | + :param _headers: set to override the headers for a single |
| 1167 | + request; this effectively ignores the headers |
| 1168 | + in the spec for a single request. |
| 1169 | + :type _headers: dict, optional |
| 1170 | + :param _host_index: set to override the host_index for a single |
| 1171 | + request; this effectively ignores the host_index |
| 1172 | + in the spec for a single request. |
| 1173 | + :type _host_index: int, optional |
| 1174 | + :return: Returns the result object. |
| 1175 | + """ # noqa: E501 |
| 1176 | + |
| 1177 | + _param = self._list_in_flight_v1_usage_in_flight_get_serialize( |
| 1178 | + _request_auth=_request_auth, |
| 1179 | + _content_type=_content_type, |
| 1180 | + _headers=_headers, |
| 1181 | + _host_index=_host_index |
| 1182 | + ) |
| 1183 | + |
| 1184 | + _response_types_map: Dict[str, Optional[str]] = { |
| 1185 | + '200': "InFlightResponse", |
| 1186 | + } |
| 1187 | + response_data = self.api_client.call_api( |
| 1188 | + *_param, |
| 1189 | + _request_timeout=_request_timeout |
| 1190 | + ) |
| 1191 | + response_data.read() |
| 1192 | + return self.api_client.response_deserialize( |
| 1193 | + response_data=response_data, |
| 1194 | + response_types_map=_response_types_map, |
| 1195 | + ).data |
| 1196 | + |
| 1197 | + |
| 1198 | + @validate_call |
| 1199 | + def list_in_flight_v1_usage_in_flight_get_with_http_info( |
| 1200 | + self, |
| 1201 | + _request_timeout: Union[ |
| 1202 | + None, |
| 1203 | + Annotated[StrictFloat, Field(gt=0)], |
| 1204 | + Tuple[ |
| 1205 | + Annotated[StrictFloat, Field(gt=0)], |
| 1206 | + Annotated[StrictFloat, Field(gt=0)] |
| 1207 | + ] |
| 1208 | + ] = None, |
| 1209 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 1210 | + _content_type: Optional[StrictStr] = None, |
| 1211 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 1212 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 1213 | + ) -> ApiResponse[InFlightResponse]: |
| 1214 | + """List In Flight |
| 1215 | +
|
| 1216 | + Requests the gateway is currently serving, longest-running first. A usage row is written when a request settles, so the log alone cannot answer \"is anything happening right now\": on a slow backend, a 30-second local model call is invisible until it finishes. This reports what is in progress. Read from an in-memory registry, so it describes the process that answers this call and not the deployment: behind a load balancer, consecutive polls reach different otari processes, and there is no deployment-wide total to ask for. ``total`` is the true in-flight count for the answering process even when ``requests`` is capped. |
| 1217 | +
|
| 1218 | + :param _request_timeout: timeout setting for this request. If one |
| 1219 | + number provided, it will be total request |
| 1220 | + timeout. It can also be a pair (tuple) of |
| 1221 | + (connection, read) timeouts. |
| 1222 | + :type _request_timeout: int, tuple(int, int), optional |
| 1223 | + :param _request_auth: set to override the auth_settings for an a single |
| 1224 | + request; this effectively ignores the |
| 1225 | + authentication in the spec for a single request. |
| 1226 | + :type _request_auth: dict, optional |
| 1227 | + :param _content_type: force content-type for the request. |
| 1228 | + :type _content_type: str, Optional |
| 1229 | + :param _headers: set to override the headers for a single |
| 1230 | + request; this effectively ignores the headers |
| 1231 | + in the spec for a single request. |
| 1232 | + :type _headers: dict, optional |
| 1233 | + :param _host_index: set to override the host_index for a single |
| 1234 | + request; this effectively ignores the host_index |
| 1235 | + in the spec for a single request. |
| 1236 | + :type _host_index: int, optional |
| 1237 | + :return: Returns the result object. |
| 1238 | + """ # noqa: E501 |
| 1239 | + |
| 1240 | + _param = self._list_in_flight_v1_usage_in_flight_get_serialize( |
| 1241 | + _request_auth=_request_auth, |
| 1242 | + _content_type=_content_type, |
| 1243 | + _headers=_headers, |
| 1244 | + _host_index=_host_index |
| 1245 | + ) |
| 1246 | + |
| 1247 | + _response_types_map: Dict[str, Optional[str]] = { |
| 1248 | + '200': "InFlightResponse", |
| 1249 | + } |
| 1250 | + response_data = self.api_client.call_api( |
| 1251 | + *_param, |
| 1252 | + _request_timeout=_request_timeout |
| 1253 | + ) |
| 1254 | + response_data.read() |
| 1255 | + return self.api_client.response_deserialize( |
| 1256 | + response_data=response_data, |
| 1257 | + response_types_map=_response_types_map, |
| 1258 | + ) |
| 1259 | + |
| 1260 | + |
| 1261 | + @validate_call |
| 1262 | + def list_in_flight_v1_usage_in_flight_get_without_preload_content( |
| 1263 | + self, |
| 1264 | + _request_timeout: Union[ |
| 1265 | + None, |
| 1266 | + Annotated[StrictFloat, Field(gt=0)], |
| 1267 | + Tuple[ |
| 1268 | + Annotated[StrictFloat, Field(gt=0)], |
| 1269 | + Annotated[StrictFloat, Field(gt=0)] |
| 1270 | + ] |
| 1271 | + ] = None, |
| 1272 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 1273 | + _content_type: Optional[StrictStr] = None, |
| 1274 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 1275 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 1276 | + ) -> RESTResponseType: |
| 1277 | + """List In Flight |
| 1278 | +
|
| 1279 | + Requests the gateway is currently serving, longest-running first. A usage row is written when a request settles, so the log alone cannot answer \"is anything happening right now\": on a slow backend, a 30-second local model call is invisible until it finishes. This reports what is in progress. Read from an in-memory registry, so it describes the process that answers this call and not the deployment: behind a load balancer, consecutive polls reach different otari processes, and there is no deployment-wide total to ask for. ``total`` is the true in-flight count for the answering process even when ``requests`` is capped. |
| 1280 | +
|
| 1281 | + :param _request_timeout: timeout setting for this request. If one |
| 1282 | + number provided, it will be total request |
| 1283 | + timeout. It can also be a pair (tuple) of |
| 1284 | + (connection, read) timeouts. |
| 1285 | + :type _request_timeout: int, tuple(int, int), optional |
| 1286 | + :param _request_auth: set to override the auth_settings for an a single |
| 1287 | + request; this effectively ignores the |
| 1288 | + authentication in the spec for a single request. |
| 1289 | + :type _request_auth: dict, optional |
| 1290 | + :param _content_type: force content-type for the request. |
| 1291 | + :type _content_type: str, Optional |
| 1292 | + :param _headers: set to override the headers for a single |
| 1293 | + request; this effectively ignores the headers |
| 1294 | + in the spec for a single request. |
| 1295 | + :type _headers: dict, optional |
| 1296 | + :param _host_index: set to override the host_index for a single |
| 1297 | + request; this effectively ignores the host_index |
| 1298 | + in the spec for a single request. |
| 1299 | + :type _host_index: int, optional |
| 1300 | + :return: Returns the result object. |
| 1301 | + """ # noqa: E501 |
| 1302 | + |
| 1303 | + _param = self._list_in_flight_v1_usage_in_flight_get_serialize( |
| 1304 | + _request_auth=_request_auth, |
| 1305 | + _content_type=_content_type, |
| 1306 | + _headers=_headers, |
| 1307 | + _host_index=_host_index |
| 1308 | + ) |
| 1309 | + |
| 1310 | + _response_types_map: Dict[str, Optional[str]] = { |
| 1311 | + '200': "InFlightResponse", |
| 1312 | + } |
| 1313 | + response_data = self.api_client.call_api( |
| 1314 | + *_param, |
| 1315 | + _request_timeout=_request_timeout |
| 1316 | + ) |
| 1317 | + return response_data.response |
| 1318 | + |
| 1319 | + |
| 1320 | + def _list_in_flight_v1_usage_in_flight_get_serialize( |
| 1321 | + self, |
| 1322 | + _request_auth, |
| 1323 | + _content_type, |
| 1324 | + _headers, |
| 1325 | + _host_index, |
| 1326 | + ) -> RequestSerialized: |
| 1327 | + |
| 1328 | + _host = None |
| 1329 | + |
| 1330 | + _collection_formats: Dict[str, str] = { |
| 1331 | + } |
| 1332 | + |
| 1333 | + _path_params: Dict[str, str] = {} |
| 1334 | + _query_params: List[Tuple[str, str]] = [] |
| 1335 | + _header_params: Dict[str, Optional[str]] = _headers or {} |
| 1336 | + _form_params: List[Tuple[str, str]] = [] |
| 1337 | + _files: Dict[ |
| 1338 | + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] |
| 1339 | + ] = {} |
| 1340 | + _body_params: Optional[bytes] = None |
| 1341 | + |
| 1342 | + # process the path parameters |
| 1343 | + # process the query parameters |
| 1344 | + # process the header parameters |
| 1345 | + # process the form parameters |
| 1346 | + # process the body parameter |
| 1347 | + |
| 1348 | + |
| 1349 | + # set the HTTP header `Accept` |
| 1350 | + if 'Accept' not in _header_params: |
| 1351 | + _header_params['Accept'] = self.api_client.select_header_accept( |
| 1352 | + [ |
| 1353 | + 'application/json' |
| 1354 | + ] |
| 1355 | + ) |
| 1356 | + |
| 1357 | + |
| 1358 | + # authentication setting |
| 1359 | + _auth_settings: List[str] = [ |
| 1360 | + 'XApiKeyAuth', |
| 1361 | + 'ApiKeyAuth' |
| 1362 | + ] |
| 1363 | + |
| 1364 | + return self.api_client.param_serialize( |
| 1365 | + method='GET', |
| 1366 | + resource_path='/v1/usage/in-flight', |
| 1367 | + path_params=_path_params, |
| 1368 | + query_params=_query_params, |
| 1369 | + header_params=_header_params, |
| 1370 | + body=_body_params, |
| 1371 | + post_params=_form_params, |
| 1372 | + files=_files, |
| 1373 | + auth_settings=_auth_settings, |
| 1374 | + collection_formats=_collection_formats, |
| 1375 | + _host=_host, |
| 1376 | + _request_auth=_request_auth |
| 1377 | + ) |
| 1378 | + |
| 1379 | + |
| 1380 | + |
| 1381 | + |
1134 | 1382 | @validate_call |
1135 | 1383 | def list_usage_v1_usage_get( |
1136 | 1384 | self, |
|
0 commit comments