crypticorn 2.17.0rc4__py3-none-any.whl → 2.17.0rc5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. crypticorn/auth/client/api/admin_api.py +0 -2
  2. crypticorn/auth/client/api/auth_api.py +0 -4
  3. crypticorn/auth/client/api/service_api.py +0 -4
  4. crypticorn/auth/client/api/user_api.py +0 -4
  5. crypticorn/auth/client/api/wallet_api.py +0 -4
  6. crypticorn/auth/client/api_client.py +0 -5
  7. crypticorn/auth/client/models/add_wallet_request.py +1 -1
  8. crypticorn/auth/client/models/authorize_user_request.py +1 -1
  9. crypticorn/auth/client/models/create_api_key_request.py +1 -1
  10. crypticorn/auth/client/models/create_user_request.py +1 -1
  11. crypticorn/auth/client/models/get_api_keys200_response_inner.py +1 -1
  12. crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +1 -1
  13. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +1 -1
  14. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +1 -1
  15. crypticorn/auth/client/models/list_wallets200_response_data_inner.py +1 -1
  16. crypticorn/auth/client/models/logout_default_response.py +1 -1
  17. crypticorn/auth/client/models/oauth_callback200_response_user.py +1 -1
  18. crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +1 -1
  19. crypticorn/auth/client/models/rotate_tokens200_response.py +1 -1
  20. crypticorn/auth/client/models/token_info200_response.py +1 -1
  21. crypticorn/auth/client/models/update_user_request.py +1 -1
  22. crypticorn/auth/client/models/user_by_username200_response.py +1 -1
  23. crypticorn/auth/client/models/verify200_response.py +1 -1
  24. crypticorn/auth/client/models/verify_email200_response_auth.py +1 -1
  25. crypticorn/auth/client/models/verify_email200_response_auth_auth.py +1 -1
  26. crypticorn/auth/client/models/whoami200_response.py +1 -1
  27. crypticorn/cli/init.py +1 -1
  28. crypticorn/cli/templates/.env.docker.temp +3 -0
  29. crypticorn/cli/templates/.env.example.temp +4 -0
  30. crypticorn/client.py +0 -1
  31. crypticorn/common/auth.py +1 -4
  32. crypticorn/common/decorators.py +1 -2
  33. crypticorn/common/enums.py +0 -2
  34. crypticorn/common/metrics.py +1 -1
  35. crypticorn/common/middleware.py +0 -1
  36. crypticorn/common/pagination.py +116 -24
  37. crypticorn/common/utils.py +1 -2
  38. crypticorn/dex/__init__.py +6 -0
  39. crypticorn/dex/client/__init__.py +49 -0
  40. crypticorn/dex/client/api/__init__.py +6 -0
  41. crypticorn/dex/client/api/admin_api.py +3046 -0
  42. crypticorn/dex/client/api/signals_api.py +1821 -0
  43. crypticorn/dex/client/api/status_api.py +907 -0
  44. crypticorn/dex/client/api_client.py +753 -0
  45. crypticorn/dex/client/api_response.py +20 -0
  46. crypticorn/dex/client/configuration.py +620 -0
  47. crypticorn/dex/client/exceptions.py +220 -0
  48. crypticorn/dex/client/models/__init__.py +30 -0
  49. crypticorn/dex/client/models/api_error_identifier.py +121 -0
  50. crypticorn/dex/client/models/api_error_level.py +37 -0
  51. crypticorn/dex/client/models/api_error_type.py +37 -0
  52. crypticorn/dex/client/models/exception_detail.py +117 -0
  53. crypticorn/dex/client/models/log_level.py +38 -0
  54. crypticorn/dex/client/models/paginated_response_signal_with_token.py +134 -0
  55. crypticorn/dex/client/models/risk.py +86 -0
  56. crypticorn/dex/client/models/signal_overview_stats.py +156 -0
  57. crypticorn/dex/client/models/signal_volume.py +84 -0
  58. crypticorn/dex/client/models/signal_with_token.py +163 -0
  59. crypticorn/dex/client/models/token_data.py +127 -0
  60. crypticorn/dex/client/models/token_detail.py +116 -0
  61. crypticorn/dex/client/py.typed +0 -0
  62. crypticorn/dex/client/rest.py +217 -0
  63. crypticorn/dex/main.py +1 -0
  64. crypticorn/hive/client/api/admin_api.py +0 -3
  65. crypticorn/hive/client/api/data_api.py +0 -4
  66. crypticorn/hive/client/api/models_api.py +1 -4
  67. crypticorn/hive/client/api/status_api.py +0 -3
  68. crypticorn/hive/client/api_client.py +0 -5
  69. crypticorn/hive/client/models/coin_info.py +1 -1
  70. crypticorn/hive/client/models/exception_detail.py +1 -1
  71. crypticorn/hive/client/models/target_info.py +1 -1
  72. crypticorn/hive/utils.py +2 -2
  73. crypticorn/klines/client/api/admin_api.py +0 -3
  74. crypticorn/klines/client/api/change_in_timeframe_api.py +0 -4
  75. crypticorn/klines/client/api/funding_rates_api.py +0 -4
  76. crypticorn/klines/client/api/ohlcv_data_api.py +0 -4
  77. crypticorn/klines/client/api/status_api.py +0 -3
  78. crypticorn/klines/client/api/symbols_api.py +0 -4
  79. crypticorn/klines/client/api/udf_api.py +0 -2
  80. crypticorn/klines/client/api_client.py +0 -5
  81. crypticorn/klines/client/models/exception_detail.py +1 -1
  82. crypticorn/klines/client/models/ohlcv.py +1 -1
  83. crypticorn/klines/client/models/symbol_group.py +1 -1
  84. crypticorn/klines/client/models/udf_config.py +1 -1
  85. crypticorn/metrics/client/api/admin_api.py +0 -3
  86. crypticorn/metrics/client/api/exchanges_api.py +0 -4
  87. crypticorn/metrics/client/api/indicators_api.py +0 -4
  88. crypticorn/metrics/client/api/logs_api.py +0 -4
  89. crypticorn/metrics/client/api/marketcap_api.py +0 -4
  90. crypticorn/metrics/client/api/markets_api.py +0 -4
  91. crypticorn/metrics/client/api/quote_currencies_api.py +0 -4
  92. crypticorn/metrics/client/api/status_api.py +0 -3
  93. crypticorn/metrics/client/api/tokens_api.py +0 -2
  94. crypticorn/metrics/client/api_client.py +0 -5
  95. crypticorn/metrics/client/models/exception_detail.py +1 -1
  96. crypticorn/metrics/client/models/exchange_mapping.py +1 -1
  97. crypticorn/metrics/client/models/marketcap_ranking.py +1 -1
  98. crypticorn/metrics/client/models/marketcap_symbol_ranking.py +1 -1
  99. crypticorn/metrics/client/models/ohlcv.py +1 -1
  100. crypticorn/pay/client/api/admin_api.py +0 -3
  101. crypticorn/pay/client/api/now_payments_api.py +0 -4
  102. crypticorn/pay/client/api/payments_api.py +0 -4
  103. crypticorn/pay/client/api/products_api.py +0 -4
  104. crypticorn/pay/client/api/status_api.py +0 -3
  105. crypticorn/pay/client/api_client.py +0 -5
  106. crypticorn/pay/client/models/exception_detail.py +1 -1
  107. crypticorn/pay/client/models/now_create_invoice_req.py +1 -1
  108. crypticorn/pay/client/models/now_create_invoice_res.py +1 -1
  109. crypticorn/pay/client/models/product.py +1 -1
  110. crypticorn/pay/client/models/product_create.py +1 -1
  111. crypticorn/pay/client/models/product_update.py +1 -1
  112. crypticorn/trade/client/__init__.py +5 -0
  113. crypticorn/trade/client/api/admin_api.py +22 -23
  114. crypticorn/trade/client/api/bots_api.py +4712 -168
  115. crypticorn/trade/client/api/orders_api.py +220 -106
  116. crypticorn/trade/client/configuration.py +2 -2
  117. crypticorn/trade/client/models/__init__.py +5 -0
  118. crypticorn/trade/client/models/bot.py +7 -18
  119. crypticorn/trade/client/models/bot_create.py +17 -1
  120. crypticorn/trade/client/models/bot_update.py +17 -1
  121. crypticorn/trade/client/models/exchange_key_create.py +17 -1
  122. crypticorn/trade/client/models/exchange_key_update.py +17 -1
  123. crypticorn/trade/client/models/notification.py +17 -1
  124. crypticorn/trade/client/models/notification_create.py +17 -1
  125. crypticorn/trade/client/models/notification_update.py +17 -1
  126. crypticorn/trade/client/models/orders_count.py +88 -0
  127. crypticorn/trade/client/models/paginated_response_order.py +134 -0
  128. crypticorn/trade/client/models/pn_l.py +95 -0
  129. crypticorn/trade/client/models/strategy.py +17 -1
  130. crypticorn/trade/client/models/strategy_create.py +17 -1
  131. crypticorn/trade/client/models/strategy_update.py +17 -1
  132. {crypticorn-2.17.0rc4.dist-info → crypticorn-2.17.0rc5.dist-info}/METADATA +1 -1
  133. {crypticorn-2.17.0rc4.dist-info → crypticorn-2.17.0rc5.dist-info}/RECORD +137 -106
  134. {crypticorn-2.17.0rc4.dist-info → crypticorn-2.17.0rc5.dist-info}/WHEEL +0 -0
  135. {crypticorn-2.17.0rc4.dist-info → crypticorn-2.17.0rc5.dist-info}/entry_points.txt +0 -0
  136. {crypticorn-2.17.0rc4.dist-info → crypticorn-2.17.0rc5.dist-info}/licenses/LICENSE +0 -0
  137. {crypticorn-2.17.0rc4.dist-info → crypticorn-2.17.0rc5.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,3046 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ DEX AI API
5
+
6
+ API for DEX AI
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from crypticorn.dex.client.models.log_level import LogLevel
20
+
21
+ from crypticorn.dex.client.api_client import ApiClient, RequestSerialized
22
+ from crypticorn.dex.client.api_response import ApiResponse
23
+ from crypticorn.dex.client.rest import RESTResponseType
24
+
25
+ # Import async_to_sync for sync methods
26
+ try:
27
+ from asgiref.sync import async_to_sync
28
+
29
+ _HAS_ASGIREF = True
30
+ except ImportError:
31
+ _HAS_ASGIREF = False
32
+
33
+ def async_to_sync(async_func):
34
+ """Fallback decorator that raises an error if asgiref is not available."""
35
+
36
+ def wrapper(*args, **kwargs):
37
+ raise ImportError(
38
+ "asgiref is required for sync methods. Install with: pip install asgiref"
39
+ )
40
+
41
+ return wrapper
42
+
43
+
44
+ class AdminApi:
45
+ """NOTE: This class is auto generated by OpenAPI Generator
46
+ Ref: https://openapi-generator.tech
47
+
48
+ Do not edit the class manually.
49
+ """
50
+
51
+ def __init__(self, api_client=None, is_sync: bool = False) -> None:
52
+ if api_client is None:
53
+ api_client = ApiClient.get_default()
54
+ self.api_client = api_client
55
+ self.is_sync = is_sync
56
+
57
+ @validate_call
58
+ def get_container_limits(
59
+ self,
60
+ _request_timeout: Union[
61
+ None,
62
+ Annotated[StrictFloat, Field(gt=0)],
63
+ Tuple[
64
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
65
+ ],
66
+ ] = None,
67
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
68
+ _content_type: Optional[StrictStr] = None,
69
+ _headers: Optional[Dict[StrictStr, Any]] = None,
70
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
71
+ ) -> Dict[str, object]:
72
+ """Get Container Limits
73
+
74
+ This method can work in both sync and async modes based on the is_sync flag.
75
+ """
76
+ if self.is_sync:
77
+ return self._get_container_limits_sync(
78
+ _request_timeout=_request_timeout,
79
+ _request_auth=_request_auth,
80
+ _content_type=_content_type,
81
+ _headers=_headers,
82
+ _host_index=_host_index,
83
+ )
84
+
85
+ else:
86
+ return self._get_container_limits_async(
87
+ _request_timeout=_request_timeout,
88
+ _request_auth=_request_auth,
89
+ _content_type=_content_type,
90
+ _headers=_headers,
91
+ _host_index=_host_index,
92
+ )
93
+
94
+ @validate_call
95
+ def get_container_limits_with_http_info(
96
+ self,
97
+ _request_timeout: Union[
98
+ None,
99
+ Annotated[StrictFloat, Field(gt=0)],
100
+ Tuple[
101
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
102
+ ],
103
+ ] = None,
104
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
105
+ _content_type: Optional[StrictStr] = None,
106
+ _headers: Optional[Dict[StrictStr, Any]] = None,
107
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
108
+ ) -> ApiResponse[Dict[str, object]]:
109
+ """Get Container Limits with HTTP info
110
+
111
+ This method can work in both sync and async modes based on the is_sync flag.
112
+ """
113
+ if self.is_sync:
114
+ return self._get_container_limits_sync_with_http_info(
115
+ _request_timeout=_request_timeout,
116
+ _request_auth=_request_auth,
117
+ _content_type=_content_type,
118
+ _headers=_headers,
119
+ _host_index=_host_index,
120
+ )
121
+
122
+ else:
123
+ return self._get_container_limits_async_with_http_info(
124
+ _request_timeout=_request_timeout,
125
+ _request_auth=_request_auth,
126
+ _content_type=_content_type,
127
+ _headers=_headers,
128
+ _host_index=_host_index,
129
+ )
130
+
131
+ @validate_call
132
+ def get_container_limits_without_preload_content(
133
+ self,
134
+ _request_timeout: Union[
135
+ None,
136
+ Annotated[StrictFloat, Field(gt=0)],
137
+ Tuple[
138
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
139
+ ],
140
+ ] = None,
141
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
142
+ _content_type: Optional[StrictStr] = None,
143
+ _headers: Optional[Dict[StrictStr, Any]] = None,
144
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
145
+ ) -> RESTResponseType:
146
+ """Get Container Limits without preloading content
147
+
148
+ This method can work in both sync and async modes based on the is_sync flag.
149
+ """
150
+ if self.is_sync:
151
+ return self._get_container_limits_sync_without_preload_content(
152
+ _request_timeout=_request_timeout,
153
+ _request_auth=_request_auth,
154
+ _content_type=_content_type,
155
+ _headers=_headers,
156
+ _host_index=_host_index,
157
+ )
158
+
159
+ else:
160
+ return self._get_container_limits_async_without_preload_content(
161
+ _request_timeout=_request_timeout,
162
+ _request_auth=_request_auth,
163
+ _content_type=_content_type,
164
+ _headers=_headers,
165
+ _host_index=_host_index,
166
+ )
167
+
168
+ # Private async implementation methods
169
+ @validate_call
170
+ async def _get_container_limits_async(
171
+ self,
172
+ _request_timeout: Union[
173
+ None,
174
+ Annotated[StrictFloat, Field(gt=0)],
175
+ Tuple[
176
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
177
+ ],
178
+ ] = None,
179
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
180
+ _content_type: Optional[StrictStr] = None,
181
+ _headers: Optional[Dict[StrictStr, Any]] = None,
182
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
183
+ ) -> Dict[str, object]:
184
+ """Get Container Limits
185
+
186
+ Return container resource limits from cgroup.
187
+
188
+ :param _request_timeout: timeout setting for this request. If one
189
+ number provided, it will be total request
190
+ timeout. It can also be a pair (tuple) of
191
+ (connection, read) timeouts.
192
+ :type _request_timeout: int, tuple(int, int), optional
193
+ :param _request_auth: set to override the auth_settings for an a single
194
+ request; this effectively ignores the
195
+ authentication in the spec for a single request.
196
+ :type _request_auth: dict, optional
197
+ :param _content_type: force content-type for the request.
198
+ :type _content_type: str, Optional
199
+ :param _headers: set to override the headers for a single
200
+ request; this effectively ignores the headers
201
+ in the spec for a single request.
202
+ :type _headers: dict, optional
203
+ :param _host_index: set to override the host_index for a single
204
+ request; this effectively ignores the host_index
205
+ in the spec for a single request.
206
+ :type _host_index: int, optional
207
+ :return: Returns the result object.
208
+ """ # noqa: E501
209
+
210
+ _param = self._get_container_limits_serialize(
211
+ _request_auth=_request_auth,
212
+ _content_type=_content_type,
213
+ _headers=_headers,
214
+ _host_index=_host_index,
215
+ )
216
+
217
+ _response_types_map: Dict[str, Optional[str]] = {
218
+ "200": "Dict[str, object]",
219
+ }
220
+ response_data = await self.api_client.call_api(
221
+ *_param, _request_timeout=_request_timeout
222
+ )
223
+ await response_data.read()
224
+ return self.api_client.response_deserialize(
225
+ response_data=response_data,
226
+ response_types_map=_response_types_map,
227
+ ).data
228
+
229
+ @validate_call
230
+ async def _get_container_limits_async_with_http_info(
231
+ self,
232
+ _request_timeout: Union[
233
+ None,
234
+ Annotated[StrictFloat, Field(gt=0)],
235
+ Tuple[
236
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
237
+ ],
238
+ ] = None,
239
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
240
+ _content_type: Optional[StrictStr] = None,
241
+ _headers: Optional[Dict[StrictStr, Any]] = None,
242
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
243
+ ) -> ApiResponse[Dict[str, object]]:
244
+ """Get Container Limits
245
+
246
+ Return container resource limits from cgroup.
247
+
248
+ :param _request_timeout: timeout setting for this request. If one
249
+ number provided, it will be total request
250
+ timeout. It can also be a pair (tuple) of
251
+ (connection, read) timeouts.
252
+ :type _request_timeout: int, tuple(int, int), optional
253
+ :param _request_auth: set to override the auth_settings for an a single
254
+ request; this effectively ignores the
255
+ authentication in the spec for a single request.
256
+ :type _request_auth: dict, optional
257
+ :param _content_type: force content-type for the request.
258
+ :type _content_type: str, Optional
259
+ :param _headers: set to override the headers for a single
260
+ request; this effectively ignores the headers
261
+ in the spec for a single request.
262
+ :type _headers: dict, optional
263
+ :param _host_index: set to override the host_index for a single
264
+ request; this effectively ignores the host_index
265
+ in the spec for a single request.
266
+ :type _host_index: int, optional
267
+ :return: Returns the result object.
268
+ """ # noqa: E501
269
+
270
+ _param = self._get_container_limits_serialize(
271
+ _request_auth=_request_auth,
272
+ _content_type=_content_type,
273
+ _headers=_headers,
274
+ _host_index=_host_index,
275
+ )
276
+
277
+ _response_types_map: Dict[str, Optional[str]] = {
278
+ "200": "Dict[str, object]",
279
+ }
280
+ response_data = await self.api_client.call_api(
281
+ *_param, _request_timeout=_request_timeout
282
+ )
283
+ await response_data.read()
284
+ return self.api_client.response_deserialize(
285
+ response_data=response_data, response_types_map=_response_types_map
286
+ )
287
+
288
+ @validate_call
289
+ async def _get_container_limits_async_without_preload_content(
290
+ self,
291
+ _request_timeout: Union[
292
+ None,
293
+ Annotated[StrictFloat, Field(gt=0)],
294
+ Tuple[
295
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
296
+ ],
297
+ ] = None,
298
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
299
+ _content_type: Optional[StrictStr] = None,
300
+ _headers: Optional[Dict[StrictStr, Any]] = None,
301
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
302
+ ) -> RESTResponseType:
303
+ """Get Container Limits
304
+
305
+ Return container resource limits from cgroup.
306
+
307
+ :param _request_timeout: timeout setting for this request. If one
308
+ number provided, it will be total request
309
+ timeout. It can also be a pair (tuple) of
310
+ (connection, read) timeouts.
311
+ :type _request_timeout: int, tuple(int, int), optional
312
+ :param _request_auth: set to override the auth_settings for an a single
313
+ request; this effectively ignores the
314
+ authentication in the spec for a single request.
315
+ :type _request_auth: dict, optional
316
+ :param _content_type: force content-type for the request.
317
+ :type _content_type: str, Optional
318
+ :param _headers: set to override the headers for a single
319
+ request; this effectively ignores the headers
320
+ in the spec for a single request.
321
+ :type _headers: dict, optional
322
+ :param _host_index: set to override the host_index for a single
323
+ request; this effectively ignores the host_index
324
+ in the spec for a single request.
325
+ :type _host_index: int, optional
326
+ :return: Returns the result object.
327
+ """ # noqa: E501
328
+
329
+ _param = self._get_container_limits_serialize(
330
+ _request_auth=_request_auth,
331
+ _content_type=_content_type,
332
+ _headers=_headers,
333
+ _host_index=_host_index,
334
+ )
335
+
336
+ _response_types_map: Dict[str, Optional[str]] = {
337
+ "200": "Dict[str, object]",
338
+ }
339
+ response_data = await self.api_client.call_api(
340
+ *_param, _request_timeout=_request_timeout
341
+ )
342
+ return response_data
343
+
344
+ # Private sync implementation methods
345
+ @validate_call
346
+ def _get_container_limits_sync(
347
+ self,
348
+ _request_timeout: Union[
349
+ None,
350
+ Annotated[StrictFloat, Field(gt=0)],
351
+ Tuple[
352
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
353
+ ],
354
+ ] = None,
355
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
356
+ _content_type: Optional[StrictStr] = None,
357
+ _headers: Optional[Dict[StrictStr, Any]] = None,
358
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
359
+ ) -> Dict[str, object]:
360
+ """Synchronous version of get_container_limits"""
361
+ return async_to_sync(self._get_container_limits_async)(
362
+ _request_timeout=_request_timeout,
363
+ _request_auth=_request_auth,
364
+ _content_type=_content_type,
365
+ _headers=_headers,
366
+ _host_index=_host_index,
367
+ )
368
+
369
+ @validate_call
370
+ def _get_container_limits_sync_with_http_info(
371
+ self,
372
+ _request_timeout: Union[
373
+ None,
374
+ Annotated[StrictFloat, Field(gt=0)],
375
+ Tuple[
376
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
377
+ ],
378
+ ] = None,
379
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
380
+ _content_type: Optional[StrictStr] = None,
381
+ _headers: Optional[Dict[StrictStr, Any]] = None,
382
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
383
+ ) -> ApiResponse[Dict[str, object]]:
384
+ """Synchronous version of get_container_limits_with_http_info"""
385
+ return async_to_sync(self._get_container_limits_async_with_http_info)(
386
+ _request_timeout=_request_timeout,
387
+ _request_auth=_request_auth,
388
+ _content_type=_content_type,
389
+ _headers=_headers,
390
+ _host_index=_host_index,
391
+ )
392
+
393
+ @validate_call
394
+ def _get_container_limits_sync_without_preload_content(
395
+ self,
396
+ _request_timeout: Union[
397
+ None,
398
+ Annotated[StrictFloat, Field(gt=0)],
399
+ Tuple[
400
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
401
+ ],
402
+ ] = None,
403
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
404
+ _content_type: Optional[StrictStr] = None,
405
+ _headers: Optional[Dict[StrictStr, Any]] = None,
406
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
407
+ ) -> RESTResponseType:
408
+ """Synchronous version of get_container_limits_without_preload_content"""
409
+ return async_to_sync(self._get_container_limits_async_without_preload_content)(
410
+ _request_timeout=_request_timeout,
411
+ _request_auth=_request_auth,
412
+ _content_type=_content_type,
413
+ _headers=_headers,
414
+ _host_index=_host_index,
415
+ )
416
+
417
+ def _get_container_limits_serialize(
418
+ self,
419
+ _request_auth,
420
+ _content_type,
421
+ _headers,
422
+ _host_index,
423
+ ) -> RequestSerialized:
424
+
425
+ _host = None
426
+
427
+ _collection_formats: Dict[str, str] = {}
428
+
429
+ _path_params: Dict[str, str] = {}
430
+ _query_params: List[Tuple[str, str]] = []
431
+ _header_params: Dict[str, Optional[str]] = _headers or {}
432
+ _form_params: List[Tuple[str, str]] = []
433
+ _files: Dict[
434
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
435
+ ] = {}
436
+ _body_params: Optional[bytes] = None
437
+
438
+ # process the path parameters
439
+ # process the query parameters
440
+ # process the header parameters
441
+ # process the form parameters
442
+ # process the body parameter
443
+
444
+ # set the HTTP header `Accept`
445
+ if "Accept" not in _header_params:
446
+ _header_params["Accept"] = self.api_client.select_header_accept(
447
+ ["application/json"]
448
+ )
449
+
450
+ # authentication setting
451
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
452
+
453
+ return self.api_client.param_serialize(
454
+ method="GET",
455
+ resource_path="/admin/limits",
456
+ path_params=_path_params,
457
+ query_params=_query_params,
458
+ header_params=_header_params,
459
+ body=_body_params,
460
+ post_params=_form_params,
461
+ files=_files,
462
+ auth_settings=_auth_settings,
463
+ collection_formats=_collection_formats,
464
+ _host=_host,
465
+ _request_auth=_request_auth,
466
+ )
467
+
468
+ @validate_call
469
+ def get_dependencies(
470
+ self,
471
+ include: Annotated[
472
+ Optional[List[Optional[StrictStr]]],
473
+ Field(
474
+ description="List of regex patterns to match against package names. If not provided, all installed packages will be returned."
475
+ ),
476
+ ] = None,
477
+ _request_timeout: Union[
478
+ None,
479
+ Annotated[StrictFloat, Field(gt=0)],
480
+ Tuple[
481
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
482
+ ],
483
+ ] = None,
484
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
485
+ _content_type: Optional[StrictStr] = None,
486
+ _headers: Optional[Dict[StrictStr, Any]] = None,
487
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
488
+ ) -> Dict[str, Optional[str]]:
489
+ """List Installed Packages
490
+
491
+ This method can work in both sync and async modes based on the is_sync flag.
492
+ """
493
+ if self.is_sync:
494
+ return self._get_dependencies_sync(
495
+ include=include,
496
+ _request_timeout=_request_timeout,
497
+ _request_auth=_request_auth,
498
+ _content_type=_content_type,
499
+ _headers=_headers,
500
+ _host_index=_host_index,
501
+ )
502
+
503
+ else:
504
+ return self._get_dependencies_async(
505
+ include=include,
506
+ _request_timeout=_request_timeout,
507
+ _request_auth=_request_auth,
508
+ _content_type=_content_type,
509
+ _headers=_headers,
510
+ _host_index=_host_index,
511
+ )
512
+
513
+ @validate_call
514
+ def get_dependencies_with_http_info(
515
+ self,
516
+ include: Annotated[
517
+ Optional[List[Optional[StrictStr]]],
518
+ Field(
519
+ description="List of regex patterns to match against package names. If not provided, all installed packages will be returned."
520
+ ),
521
+ ] = None,
522
+ _request_timeout: Union[
523
+ None,
524
+ Annotated[StrictFloat, Field(gt=0)],
525
+ Tuple[
526
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
527
+ ],
528
+ ] = None,
529
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
530
+ _content_type: Optional[StrictStr] = None,
531
+ _headers: Optional[Dict[StrictStr, Any]] = None,
532
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
533
+ ) -> ApiResponse[Dict[str, Optional[str]]]:
534
+ """List Installed Packages with HTTP info
535
+
536
+ This method can work in both sync and async modes based on the is_sync flag.
537
+ """
538
+ if self.is_sync:
539
+ return self._get_dependencies_sync_with_http_info(
540
+ include=include,
541
+ _request_timeout=_request_timeout,
542
+ _request_auth=_request_auth,
543
+ _content_type=_content_type,
544
+ _headers=_headers,
545
+ _host_index=_host_index,
546
+ )
547
+
548
+ else:
549
+ return self._get_dependencies_async_with_http_info(
550
+ include=include,
551
+ _request_timeout=_request_timeout,
552
+ _request_auth=_request_auth,
553
+ _content_type=_content_type,
554
+ _headers=_headers,
555
+ _host_index=_host_index,
556
+ )
557
+
558
+ @validate_call
559
+ def get_dependencies_without_preload_content(
560
+ self,
561
+ include: Annotated[
562
+ Optional[List[Optional[StrictStr]]],
563
+ Field(
564
+ description="List of regex patterns to match against package names. If not provided, all installed packages will be returned."
565
+ ),
566
+ ] = None,
567
+ _request_timeout: Union[
568
+ None,
569
+ Annotated[StrictFloat, Field(gt=0)],
570
+ Tuple[
571
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
572
+ ],
573
+ ] = None,
574
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
575
+ _content_type: Optional[StrictStr] = None,
576
+ _headers: Optional[Dict[StrictStr, Any]] = None,
577
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
578
+ ) -> RESTResponseType:
579
+ """List Installed Packages without preloading content
580
+
581
+ This method can work in both sync and async modes based on the is_sync flag.
582
+ """
583
+ if self.is_sync:
584
+ return self._get_dependencies_sync_without_preload_content(
585
+ include=include,
586
+ _request_timeout=_request_timeout,
587
+ _request_auth=_request_auth,
588
+ _content_type=_content_type,
589
+ _headers=_headers,
590
+ _host_index=_host_index,
591
+ )
592
+
593
+ else:
594
+ return self._get_dependencies_async_without_preload_content(
595
+ include=include,
596
+ _request_timeout=_request_timeout,
597
+ _request_auth=_request_auth,
598
+ _content_type=_content_type,
599
+ _headers=_headers,
600
+ _host_index=_host_index,
601
+ )
602
+
603
+ # Private async implementation methods
604
+ @validate_call
605
+ async def _get_dependencies_async(
606
+ self,
607
+ include: Annotated[
608
+ Optional[List[Optional[StrictStr]]],
609
+ Field(
610
+ description="List of regex patterns to match against package names. If not provided, all installed packages will be returned."
611
+ ),
612
+ ] = None,
613
+ _request_timeout: Union[
614
+ None,
615
+ Annotated[StrictFloat, Field(gt=0)],
616
+ Tuple[
617
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
618
+ ],
619
+ ] = None,
620
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
621
+ _content_type: Optional[StrictStr] = None,
622
+ _headers: Optional[Dict[StrictStr, Any]] = None,
623
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
624
+ ) -> Dict[str, Optional[str]]:
625
+ """List Installed Packages
626
+
627
+ Return a list of installed packages and versions. The include parameter accepts regex patterns to match against package names. For example: - crypticorn.* will match all packages starting with 'crypticorn' - .*tic.* will match all packages containing 'tic' in their name
628
+
629
+ :param include: List of regex patterns to match against package names. If not provided, all installed packages will be returned.
630
+ :type include: List[Optional[str]]
631
+ :param _request_timeout: timeout setting for this request. If one
632
+ number provided, it will be total request
633
+ timeout. It can also be a pair (tuple) of
634
+ (connection, read) timeouts.
635
+ :type _request_timeout: int, tuple(int, int), optional
636
+ :param _request_auth: set to override the auth_settings for an a single
637
+ request; this effectively ignores the
638
+ authentication in the spec for a single request.
639
+ :type _request_auth: dict, optional
640
+ :param _content_type: force content-type for the request.
641
+ :type _content_type: str, Optional
642
+ :param _headers: set to override the headers for a single
643
+ request; this effectively ignores the headers
644
+ in the spec for a single request.
645
+ :type _headers: dict, optional
646
+ :param _host_index: set to override the host_index for a single
647
+ request; this effectively ignores the host_index
648
+ in the spec for a single request.
649
+ :type _host_index: int, optional
650
+ :return: Returns the result object.
651
+ """ # noqa: E501
652
+
653
+ _param = self._get_dependencies_serialize(
654
+ include=include,
655
+ _request_auth=_request_auth,
656
+ _content_type=_content_type,
657
+ _headers=_headers,
658
+ _host_index=_host_index,
659
+ )
660
+
661
+ _response_types_map: Dict[str, Optional[str]] = {
662
+ "200": "Dict[str, Optional[str]]",
663
+ }
664
+ response_data = await self.api_client.call_api(
665
+ *_param, _request_timeout=_request_timeout
666
+ )
667
+ await response_data.read()
668
+ return self.api_client.response_deserialize(
669
+ response_data=response_data,
670
+ response_types_map=_response_types_map,
671
+ ).data
672
+
673
+ @validate_call
674
+ async def _get_dependencies_async_with_http_info(
675
+ self,
676
+ include: Annotated[
677
+ Optional[List[Optional[StrictStr]]],
678
+ Field(
679
+ description="List of regex patterns to match against package names. If not provided, all installed packages will be returned."
680
+ ),
681
+ ] = None,
682
+ _request_timeout: Union[
683
+ None,
684
+ Annotated[StrictFloat, Field(gt=0)],
685
+ Tuple[
686
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
687
+ ],
688
+ ] = None,
689
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
690
+ _content_type: Optional[StrictStr] = None,
691
+ _headers: Optional[Dict[StrictStr, Any]] = None,
692
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
693
+ ) -> ApiResponse[Dict[str, Optional[str]]]:
694
+ """List Installed Packages
695
+
696
+ Return a list of installed packages and versions. The include parameter accepts regex patterns to match against package names. For example: - crypticorn.* will match all packages starting with 'crypticorn' - .*tic.* will match all packages containing 'tic' in their name
697
+
698
+ :param include: List of regex patterns to match against package names. If not provided, all installed packages will be returned.
699
+ :type include: List[Optional[str]]
700
+ :param _request_timeout: timeout setting for this request. If one
701
+ number provided, it will be total request
702
+ timeout. It can also be a pair (tuple) of
703
+ (connection, read) timeouts.
704
+ :type _request_timeout: int, tuple(int, int), optional
705
+ :param _request_auth: set to override the auth_settings for an a single
706
+ request; this effectively ignores the
707
+ authentication in the spec for a single request.
708
+ :type _request_auth: dict, optional
709
+ :param _content_type: force content-type for the request.
710
+ :type _content_type: str, Optional
711
+ :param _headers: set to override the headers for a single
712
+ request; this effectively ignores the headers
713
+ in the spec for a single request.
714
+ :type _headers: dict, optional
715
+ :param _host_index: set to override the host_index for a single
716
+ request; this effectively ignores the host_index
717
+ in the spec for a single request.
718
+ :type _host_index: int, optional
719
+ :return: Returns the result object.
720
+ """ # noqa: E501
721
+
722
+ _param = self._get_dependencies_serialize(
723
+ include=include,
724
+ _request_auth=_request_auth,
725
+ _content_type=_content_type,
726
+ _headers=_headers,
727
+ _host_index=_host_index,
728
+ )
729
+
730
+ _response_types_map: Dict[str, Optional[str]] = {
731
+ "200": "Dict[str, Optional[str]]",
732
+ }
733
+ response_data = await self.api_client.call_api(
734
+ *_param, _request_timeout=_request_timeout
735
+ )
736
+ await response_data.read()
737
+ return self.api_client.response_deserialize(
738
+ response_data=response_data, response_types_map=_response_types_map
739
+ )
740
+
741
+ @validate_call
742
+ async def _get_dependencies_async_without_preload_content(
743
+ self,
744
+ include: Annotated[
745
+ Optional[List[Optional[StrictStr]]],
746
+ Field(
747
+ description="List of regex patterns to match against package names. If not provided, all installed packages will be returned."
748
+ ),
749
+ ] = None,
750
+ _request_timeout: Union[
751
+ None,
752
+ Annotated[StrictFloat, Field(gt=0)],
753
+ Tuple[
754
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
755
+ ],
756
+ ] = None,
757
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
758
+ _content_type: Optional[StrictStr] = None,
759
+ _headers: Optional[Dict[StrictStr, Any]] = None,
760
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
761
+ ) -> RESTResponseType:
762
+ """List Installed Packages
763
+
764
+ Return a list of installed packages and versions. The include parameter accepts regex patterns to match against package names. For example: - crypticorn.* will match all packages starting with 'crypticorn' - .*tic.* will match all packages containing 'tic' in their name
765
+
766
+ :param include: List of regex patterns to match against package names. If not provided, all installed packages will be returned.
767
+ :type include: List[Optional[str]]
768
+ :param _request_timeout: timeout setting for this request. If one
769
+ number provided, it will be total request
770
+ timeout. It can also be a pair (tuple) of
771
+ (connection, read) timeouts.
772
+ :type _request_timeout: int, tuple(int, int), optional
773
+ :param _request_auth: set to override the auth_settings for an a single
774
+ request; this effectively ignores the
775
+ authentication in the spec for a single request.
776
+ :type _request_auth: dict, optional
777
+ :param _content_type: force content-type for the request.
778
+ :type _content_type: str, Optional
779
+ :param _headers: set to override the headers for a single
780
+ request; this effectively ignores the headers
781
+ in the spec for a single request.
782
+ :type _headers: dict, optional
783
+ :param _host_index: set to override the host_index for a single
784
+ request; this effectively ignores the host_index
785
+ in the spec for a single request.
786
+ :type _host_index: int, optional
787
+ :return: Returns the result object.
788
+ """ # noqa: E501
789
+
790
+ _param = self._get_dependencies_serialize(
791
+ include=include,
792
+ _request_auth=_request_auth,
793
+ _content_type=_content_type,
794
+ _headers=_headers,
795
+ _host_index=_host_index,
796
+ )
797
+
798
+ _response_types_map: Dict[str, Optional[str]] = {
799
+ "200": "Dict[str, Optional[str]]",
800
+ }
801
+ response_data = await self.api_client.call_api(
802
+ *_param, _request_timeout=_request_timeout
803
+ )
804
+ return response_data
805
+
806
+ # Private sync implementation methods
807
+ @validate_call
808
+ def _get_dependencies_sync(
809
+ self,
810
+ include: Annotated[
811
+ Optional[List[Optional[StrictStr]]],
812
+ Field(
813
+ description="List of regex patterns to match against package names. If not provided, all installed packages will be returned."
814
+ ),
815
+ ] = None,
816
+ _request_timeout: Union[
817
+ None,
818
+ Annotated[StrictFloat, Field(gt=0)],
819
+ Tuple[
820
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
821
+ ],
822
+ ] = None,
823
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
824
+ _content_type: Optional[StrictStr] = None,
825
+ _headers: Optional[Dict[StrictStr, Any]] = None,
826
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
827
+ ) -> Dict[str, Optional[str]]:
828
+ """Synchronous version of get_dependencies"""
829
+ return async_to_sync(self._get_dependencies_async)(
830
+ include=include,
831
+ _request_timeout=_request_timeout,
832
+ _request_auth=_request_auth,
833
+ _content_type=_content_type,
834
+ _headers=_headers,
835
+ _host_index=_host_index,
836
+ )
837
+
838
+ @validate_call
839
+ def _get_dependencies_sync_with_http_info(
840
+ self,
841
+ include: Annotated[
842
+ Optional[List[Optional[StrictStr]]],
843
+ Field(
844
+ description="List of regex patterns to match against package names. If not provided, all installed packages will be returned."
845
+ ),
846
+ ] = None,
847
+ _request_timeout: Union[
848
+ None,
849
+ Annotated[StrictFloat, Field(gt=0)],
850
+ Tuple[
851
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
852
+ ],
853
+ ] = None,
854
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
855
+ _content_type: Optional[StrictStr] = None,
856
+ _headers: Optional[Dict[StrictStr, Any]] = None,
857
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
858
+ ) -> ApiResponse[Dict[str, Optional[str]]]:
859
+ """Synchronous version of get_dependencies_with_http_info"""
860
+ return async_to_sync(self._get_dependencies_async_with_http_info)(
861
+ include=include,
862
+ _request_timeout=_request_timeout,
863
+ _request_auth=_request_auth,
864
+ _content_type=_content_type,
865
+ _headers=_headers,
866
+ _host_index=_host_index,
867
+ )
868
+
869
+ @validate_call
870
+ def _get_dependencies_sync_without_preload_content(
871
+ self,
872
+ include: Annotated[
873
+ Optional[List[Optional[StrictStr]]],
874
+ Field(
875
+ description="List of regex patterns to match against package names. If not provided, all installed packages will be returned."
876
+ ),
877
+ ] = None,
878
+ _request_timeout: Union[
879
+ None,
880
+ Annotated[StrictFloat, Field(gt=0)],
881
+ Tuple[
882
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
883
+ ],
884
+ ] = None,
885
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
886
+ _content_type: Optional[StrictStr] = None,
887
+ _headers: Optional[Dict[StrictStr, Any]] = None,
888
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
889
+ ) -> RESTResponseType:
890
+ """Synchronous version of get_dependencies_without_preload_content"""
891
+ return async_to_sync(self._get_dependencies_async_without_preload_content)(
892
+ include=include,
893
+ _request_timeout=_request_timeout,
894
+ _request_auth=_request_auth,
895
+ _content_type=_content_type,
896
+ _headers=_headers,
897
+ _host_index=_host_index,
898
+ )
899
+
900
+ def _get_dependencies_serialize(
901
+ self,
902
+ include,
903
+ _request_auth,
904
+ _content_type,
905
+ _headers,
906
+ _host_index,
907
+ ) -> RequestSerialized:
908
+
909
+ _host = None
910
+
911
+ _collection_formats: Dict[str, str] = {
912
+ "include": "multi",
913
+ }
914
+
915
+ _path_params: Dict[str, str] = {}
916
+ _query_params: List[Tuple[str, str]] = []
917
+ _header_params: Dict[str, Optional[str]] = _headers or {}
918
+ _form_params: List[Tuple[str, str]] = []
919
+ _files: Dict[
920
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
921
+ ] = {}
922
+ _body_params: Optional[bytes] = None
923
+
924
+ # process the path parameters
925
+ # process the query parameters
926
+ if include is not None:
927
+
928
+ _query_params.append(("include", include))
929
+
930
+ # process the header parameters
931
+ # process the form parameters
932
+ # process the body parameter
933
+
934
+ # set the HTTP header `Accept`
935
+ if "Accept" not in _header_params:
936
+ _header_params["Accept"] = self.api_client.select_header_accept(
937
+ ["application/json"]
938
+ )
939
+
940
+ # authentication setting
941
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
942
+
943
+ return self.api_client.param_serialize(
944
+ method="GET",
945
+ resource_path="/admin/dependencies",
946
+ path_params=_path_params,
947
+ query_params=_query_params,
948
+ header_params=_header_params,
949
+ body=_body_params,
950
+ post_params=_form_params,
951
+ files=_files,
952
+ auth_settings=_auth_settings,
953
+ collection_formats=_collection_formats,
954
+ _host=_host,
955
+ _request_auth=_request_auth,
956
+ )
957
+
958
+ @validate_call
959
+ def get_log_level(
960
+ self,
961
+ _request_timeout: Union[
962
+ None,
963
+ Annotated[StrictFloat, Field(gt=0)],
964
+ Tuple[
965
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
966
+ ],
967
+ ] = None,
968
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
969
+ _content_type: Optional[StrictStr] = None,
970
+ _headers: Optional[Dict[StrictStr, Any]] = None,
971
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
972
+ ) -> LogLevel:
973
+ """Get Logging Level
974
+
975
+ This method can work in both sync and async modes based on the is_sync flag.
976
+ """
977
+ if self.is_sync:
978
+ return self._get_log_level_sync(
979
+ _request_timeout=_request_timeout,
980
+ _request_auth=_request_auth,
981
+ _content_type=_content_type,
982
+ _headers=_headers,
983
+ _host_index=_host_index,
984
+ )
985
+
986
+ else:
987
+ return self._get_log_level_async(
988
+ _request_timeout=_request_timeout,
989
+ _request_auth=_request_auth,
990
+ _content_type=_content_type,
991
+ _headers=_headers,
992
+ _host_index=_host_index,
993
+ )
994
+
995
+ @validate_call
996
+ def get_log_level_with_http_info(
997
+ self,
998
+ _request_timeout: Union[
999
+ None,
1000
+ Annotated[StrictFloat, Field(gt=0)],
1001
+ Tuple[
1002
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1003
+ ],
1004
+ ] = None,
1005
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1006
+ _content_type: Optional[StrictStr] = None,
1007
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1008
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1009
+ ) -> ApiResponse[LogLevel]:
1010
+ """Get Logging Level with HTTP info
1011
+
1012
+ This method can work in both sync and async modes based on the is_sync flag.
1013
+ """
1014
+ if self.is_sync:
1015
+ return self._get_log_level_sync_with_http_info(
1016
+ _request_timeout=_request_timeout,
1017
+ _request_auth=_request_auth,
1018
+ _content_type=_content_type,
1019
+ _headers=_headers,
1020
+ _host_index=_host_index,
1021
+ )
1022
+
1023
+ else:
1024
+ return self._get_log_level_async_with_http_info(
1025
+ _request_timeout=_request_timeout,
1026
+ _request_auth=_request_auth,
1027
+ _content_type=_content_type,
1028
+ _headers=_headers,
1029
+ _host_index=_host_index,
1030
+ )
1031
+
1032
+ @validate_call
1033
+ def get_log_level_without_preload_content(
1034
+ self,
1035
+ _request_timeout: Union[
1036
+ None,
1037
+ Annotated[StrictFloat, Field(gt=0)],
1038
+ Tuple[
1039
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1040
+ ],
1041
+ ] = None,
1042
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1043
+ _content_type: Optional[StrictStr] = None,
1044
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1045
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1046
+ ) -> RESTResponseType:
1047
+ """Get Logging Level without preloading content
1048
+
1049
+ This method can work in both sync and async modes based on the is_sync flag.
1050
+ """
1051
+ if self.is_sync:
1052
+ return self._get_log_level_sync_without_preload_content(
1053
+ _request_timeout=_request_timeout,
1054
+ _request_auth=_request_auth,
1055
+ _content_type=_content_type,
1056
+ _headers=_headers,
1057
+ _host_index=_host_index,
1058
+ )
1059
+
1060
+ else:
1061
+ return self._get_log_level_async_without_preload_content(
1062
+ _request_timeout=_request_timeout,
1063
+ _request_auth=_request_auth,
1064
+ _content_type=_content_type,
1065
+ _headers=_headers,
1066
+ _host_index=_host_index,
1067
+ )
1068
+
1069
+ # Private async implementation methods
1070
+ @validate_call
1071
+ async def _get_log_level_async(
1072
+ self,
1073
+ _request_timeout: Union[
1074
+ None,
1075
+ Annotated[StrictFloat, Field(gt=0)],
1076
+ Tuple[
1077
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1078
+ ],
1079
+ ] = None,
1080
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1081
+ _content_type: Optional[StrictStr] = None,
1082
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1083
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1084
+ ) -> LogLevel:
1085
+ """(Deprecated) Get Logging Level
1086
+
1087
+ Get the log level of the server logger. Will be removed in a future release.
1088
+
1089
+ :param _request_timeout: timeout setting for this request. If one
1090
+ number provided, it will be total request
1091
+ timeout. It can also be a pair (tuple) of
1092
+ (connection, read) timeouts.
1093
+ :type _request_timeout: int, tuple(int, int), optional
1094
+ :param _request_auth: set to override the auth_settings for an a single
1095
+ request; this effectively ignores the
1096
+ authentication in the spec for a single request.
1097
+ :type _request_auth: dict, optional
1098
+ :param _content_type: force content-type for the request.
1099
+ :type _content_type: str, Optional
1100
+ :param _headers: set to override the headers for a single
1101
+ request; this effectively ignores the headers
1102
+ in the spec for a single request.
1103
+ :type _headers: dict, optional
1104
+ :param _host_index: set to override the host_index for a single
1105
+ request; this effectively ignores the host_index
1106
+ in the spec for a single request.
1107
+ :type _host_index: int, optional
1108
+ :return: Returns the result object.
1109
+ """ # noqa: E501
1110
+ warnings.warn("GET /admin/log-level is deprecated.", DeprecationWarning)
1111
+
1112
+ _param = self._get_log_level_serialize(
1113
+ _request_auth=_request_auth,
1114
+ _content_type=_content_type,
1115
+ _headers=_headers,
1116
+ _host_index=_host_index,
1117
+ )
1118
+
1119
+ _response_types_map: Dict[str, Optional[str]] = {
1120
+ "200": "LogLevel",
1121
+ }
1122
+ response_data = await self.api_client.call_api(
1123
+ *_param, _request_timeout=_request_timeout
1124
+ )
1125
+ await response_data.read()
1126
+ return self.api_client.response_deserialize(
1127
+ response_data=response_data,
1128
+ response_types_map=_response_types_map,
1129
+ ).data
1130
+
1131
+ @validate_call
1132
+ async def _get_log_level_async_with_http_info(
1133
+ self,
1134
+ _request_timeout: Union[
1135
+ None,
1136
+ Annotated[StrictFloat, Field(gt=0)],
1137
+ Tuple[
1138
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1139
+ ],
1140
+ ] = None,
1141
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1142
+ _content_type: Optional[StrictStr] = None,
1143
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1144
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1145
+ ) -> ApiResponse[LogLevel]:
1146
+ """(Deprecated) Get Logging Level
1147
+
1148
+ Get the log level of the server logger. Will be removed in a future release.
1149
+
1150
+ :param _request_timeout: timeout setting for this request. If one
1151
+ number provided, it will be total request
1152
+ timeout. It can also be a pair (tuple) of
1153
+ (connection, read) timeouts.
1154
+ :type _request_timeout: int, tuple(int, int), optional
1155
+ :param _request_auth: set to override the auth_settings for an a single
1156
+ request; this effectively ignores the
1157
+ authentication in the spec for a single request.
1158
+ :type _request_auth: dict, optional
1159
+ :param _content_type: force content-type for the request.
1160
+ :type _content_type: str, Optional
1161
+ :param _headers: set to override the headers for a single
1162
+ request; this effectively ignores the headers
1163
+ in the spec for a single request.
1164
+ :type _headers: dict, optional
1165
+ :param _host_index: set to override the host_index for a single
1166
+ request; this effectively ignores the host_index
1167
+ in the spec for a single request.
1168
+ :type _host_index: int, optional
1169
+ :return: Returns the result object.
1170
+ """ # noqa: E501
1171
+ warnings.warn("GET /admin/log-level is deprecated.", DeprecationWarning)
1172
+
1173
+ _param = self._get_log_level_serialize(
1174
+ _request_auth=_request_auth,
1175
+ _content_type=_content_type,
1176
+ _headers=_headers,
1177
+ _host_index=_host_index,
1178
+ )
1179
+
1180
+ _response_types_map: Dict[str, Optional[str]] = {
1181
+ "200": "LogLevel",
1182
+ }
1183
+ response_data = await self.api_client.call_api(
1184
+ *_param, _request_timeout=_request_timeout
1185
+ )
1186
+ await response_data.read()
1187
+ return self.api_client.response_deserialize(
1188
+ response_data=response_data, response_types_map=_response_types_map
1189
+ )
1190
+
1191
+ @validate_call
1192
+ async def _get_log_level_async_without_preload_content(
1193
+ self,
1194
+ _request_timeout: Union[
1195
+ None,
1196
+ Annotated[StrictFloat, Field(gt=0)],
1197
+ Tuple[
1198
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1199
+ ],
1200
+ ] = None,
1201
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1202
+ _content_type: Optional[StrictStr] = None,
1203
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1204
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1205
+ ) -> RESTResponseType:
1206
+ """(Deprecated) Get Logging Level
1207
+
1208
+ Get the log level of the server logger. Will be removed in a future release.
1209
+
1210
+ :param _request_timeout: timeout setting for this request. If one
1211
+ number provided, it will be total request
1212
+ timeout. It can also be a pair (tuple) of
1213
+ (connection, read) timeouts.
1214
+ :type _request_timeout: int, tuple(int, int), optional
1215
+ :param _request_auth: set to override the auth_settings for an a single
1216
+ request; this effectively ignores the
1217
+ authentication in the spec for a single request.
1218
+ :type _request_auth: dict, optional
1219
+ :param _content_type: force content-type for the request.
1220
+ :type _content_type: str, Optional
1221
+ :param _headers: set to override the headers for a single
1222
+ request; this effectively ignores the headers
1223
+ in the spec for a single request.
1224
+ :type _headers: dict, optional
1225
+ :param _host_index: set to override the host_index for a single
1226
+ request; this effectively ignores the host_index
1227
+ in the spec for a single request.
1228
+ :type _host_index: int, optional
1229
+ :return: Returns the result object.
1230
+ """ # noqa: E501
1231
+ warnings.warn("GET /admin/log-level is deprecated.", DeprecationWarning)
1232
+
1233
+ _param = self._get_log_level_serialize(
1234
+ _request_auth=_request_auth,
1235
+ _content_type=_content_type,
1236
+ _headers=_headers,
1237
+ _host_index=_host_index,
1238
+ )
1239
+
1240
+ _response_types_map: Dict[str, Optional[str]] = {
1241
+ "200": "LogLevel",
1242
+ }
1243
+ response_data = await self.api_client.call_api(
1244
+ *_param, _request_timeout=_request_timeout
1245
+ )
1246
+ return response_data
1247
+
1248
+ # Private sync implementation methods
1249
+ @validate_call
1250
+ def _get_log_level_sync(
1251
+ self,
1252
+ _request_timeout: Union[
1253
+ None,
1254
+ Annotated[StrictFloat, Field(gt=0)],
1255
+ Tuple[
1256
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1257
+ ],
1258
+ ] = None,
1259
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1260
+ _content_type: Optional[StrictStr] = None,
1261
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1262
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1263
+ ) -> LogLevel:
1264
+ """Synchronous version of get_log_level"""
1265
+ return async_to_sync(self._get_log_level_async)(
1266
+ _request_timeout=_request_timeout,
1267
+ _request_auth=_request_auth,
1268
+ _content_type=_content_type,
1269
+ _headers=_headers,
1270
+ _host_index=_host_index,
1271
+ )
1272
+
1273
+ @validate_call
1274
+ def _get_log_level_sync_with_http_info(
1275
+ self,
1276
+ _request_timeout: Union[
1277
+ None,
1278
+ Annotated[StrictFloat, Field(gt=0)],
1279
+ Tuple[
1280
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1281
+ ],
1282
+ ] = None,
1283
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1284
+ _content_type: Optional[StrictStr] = None,
1285
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1286
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1287
+ ) -> ApiResponse[LogLevel]:
1288
+ """Synchronous version of get_log_level_with_http_info"""
1289
+ return async_to_sync(self._get_log_level_async_with_http_info)(
1290
+ _request_timeout=_request_timeout,
1291
+ _request_auth=_request_auth,
1292
+ _content_type=_content_type,
1293
+ _headers=_headers,
1294
+ _host_index=_host_index,
1295
+ )
1296
+
1297
+ @validate_call
1298
+ def _get_log_level_sync_without_preload_content(
1299
+ self,
1300
+ _request_timeout: Union[
1301
+ None,
1302
+ Annotated[StrictFloat, Field(gt=0)],
1303
+ Tuple[
1304
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1305
+ ],
1306
+ ] = None,
1307
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1308
+ _content_type: Optional[StrictStr] = None,
1309
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1310
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1311
+ ) -> RESTResponseType:
1312
+ """Synchronous version of get_log_level_without_preload_content"""
1313
+ return async_to_sync(self._get_log_level_async_without_preload_content)(
1314
+ _request_timeout=_request_timeout,
1315
+ _request_auth=_request_auth,
1316
+ _content_type=_content_type,
1317
+ _headers=_headers,
1318
+ _host_index=_host_index,
1319
+ )
1320
+
1321
+ def _get_log_level_serialize(
1322
+ self,
1323
+ _request_auth,
1324
+ _content_type,
1325
+ _headers,
1326
+ _host_index,
1327
+ ) -> RequestSerialized:
1328
+
1329
+ _host = None
1330
+
1331
+ _collection_formats: Dict[str, str] = {}
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
+ # set the HTTP header `Accept`
1349
+ if "Accept" not in _header_params:
1350
+ _header_params["Accept"] = self.api_client.select_header_accept(
1351
+ ["application/json"]
1352
+ )
1353
+
1354
+ # authentication setting
1355
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
1356
+
1357
+ return self.api_client.param_serialize(
1358
+ method="GET",
1359
+ resource_path="/admin/log-level",
1360
+ path_params=_path_params,
1361
+ query_params=_query_params,
1362
+ header_params=_header_params,
1363
+ body=_body_params,
1364
+ post_params=_form_params,
1365
+ files=_files,
1366
+ auth_settings=_auth_settings,
1367
+ collection_formats=_collection_formats,
1368
+ _host=_host,
1369
+ _request_auth=_request_auth,
1370
+ )
1371
+
1372
+ @validate_call
1373
+ def get_memory_usage(
1374
+ self,
1375
+ _request_timeout: Union[
1376
+ None,
1377
+ Annotated[StrictFloat, Field(gt=0)],
1378
+ Tuple[
1379
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1380
+ ],
1381
+ ] = None,
1382
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1383
+ _content_type: Optional[StrictStr] = None,
1384
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1385
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1386
+ ) -> float:
1387
+ """Get Memory Usage
1388
+
1389
+ This method can work in both sync and async modes based on the is_sync flag.
1390
+ """
1391
+ if self.is_sync:
1392
+ return self._get_memory_usage_sync(
1393
+ _request_timeout=_request_timeout,
1394
+ _request_auth=_request_auth,
1395
+ _content_type=_content_type,
1396
+ _headers=_headers,
1397
+ _host_index=_host_index,
1398
+ )
1399
+
1400
+ else:
1401
+ return self._get_memory_usage_async(
1402
+ _request_timeout=_request_timeout,
1403
+ _request_auth=_request_auth,
1404
+ _content_type=_content_type,
1405
+ _headers=_headers,
1406
+ _host_index=_host_index,
1407
+ )
1408
+
1409
+ @validate_call
1410
+ def get_memory_usage_with_http_info(
1411
+ self,
1412
+ _request_timeout: Union[
1413
+ None,
1414
+ Annotated[StrictFloat, Field(gt=0)],
1415
+ Tuple[
1416
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1417
+ ],
1418
+ ] = None,
1419
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1420
+ _content_type: Optional[StrictStr] = None,
1421
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1422
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1423
+ ) -> ApiResponse[float]:
1424
+ """Get Memory Usage with HTTP info
1425
+
1426
+ This method can work in both sync and async modes based on the is_sync flag.
1427
+ """
1428
+ if self.is_sync:
1429
+ return self._get_memory_usage_sync_with_http_info(
1430
+ _request_timeout=_request_timeout,
1431
+ _request_auth=_request_auth,
1432
+ _content_type=_content_type,
1433
+ _headers=_headers,
1434
+ _host_index=_host_index,
1435
+ )
1436
+
1437
+ else:
1438
+ return self._get_memory_usage_async_with_http_info(
1439
+ _request_timeout=_request_timeout,
1440
+ _request_auth=_request_auth,
1441
+ _content_type=_content_type,
1442
+ _headers=_headers,
1443
+ _host_index=_host_index,
1444
+ )
1445
+
1446
+ @validate_call
1447
+ def get_memory_usage_without_preload_content(
1448
+ self,
1449
+ _request_timeout: Union[
1450
+ None,
1451
+ Annotated[StrictFloat, Field(gt=0)],
1452
+ Tuple[
1453
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1454
+ ],
1455
+ ] = None,
1456
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1457
+ _content_type: Optional[StrictStr] = None,
1458
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1459
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1460
+ ) -> RESTResponseType:
1461
+ """Get Memory Usage without preloading content
1462
+
1463
+ This method can work in both sync and async modes based on the is_sync flag.
1464
+ """
1465
+ if self.is_sync:
1466
+ return self._get_memory_usage_sync_without_preload_content(
1467
+ _request_timeout=_request_timeout,
1468
+ _request_auth=_request_auth,
1469
+ _content_type=_content_type,
1470
+ _headers=_headers,
1471
+ _host_index=_host_index,
1472
+ )
1473
+
1474
+ else:
1475
+ return self._get_memory_usage_async_without_preload_content(
1476
+ _request_timeout=_request_timeout,
1477
+ _request_auth=_request_auth,
1478
+ _content_type=_content_type,
1479
+ _headers=_headers,
1480
+ _host_index=_host_index,
1481
+ )
1482
+
1483
+ # Private async implementation methods
1484
+ @validate_call
1485
+ async def _get_memory_usage_async(
1486
+ self,
1487
+ _request_timeout: Union[
1488
+ None,
1489
+ Annotated[StrictFloat, Field(gt=0)],
1490
+ Tuple[
1491
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1492
+ ],
1493
+ ] = None,
1494
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1495
+ _content_type: Optional[StrictStr] = None,
1496
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1497
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1498
+ ) -> float:
1499
+ """Get Memory Usage
1500
+
1501
+ Resident Set Size (RSS) in MB — the actual memory used by the process in RAM. Represents the physical memory footprint. Important for monitoring real usage.
1502
+
1503
+ :param _request_timeout: timeout setting for this request. If one
1504
+ number provided, it will be total request
1505
+ timeout. It can also be a pair (tuple) of
1506
+ (connection, read) timeouts.
1507
+ :type _request_timeout: int, tuple(int, int), optional
1508
+ :param _request_auth: set to override the auth_settings for an a single
1509
+ request; this effectively ignores the
1510
+ authentication in the spec for a single request.
1511
+ :type _request_auth: dict, optional
1512
+ :param _content_type: force content-type for the request.
1513
+ :type _content_type: str, Optional
1514
+ :param _headers: set to override the headers for a single
1515
+ request; this effectively ignores the headers
1516
+ in the spec for a single request.
1517
+ :type _headers: dict, optional
1518
+ :param _host_index: set to override the host_index for a single
1519
+ request; this effectively ignores the host_index
1520
+ in the spec for a single request.
1521
+ :type _host_index: int, optional
1522
+ :return: Returns the result object.
1523
+ """ # noqa: E501
1524
+
1525
+ _param = self._get_memory_usage_serialize(
1526
+ _request_auth=_request_auth,
1527
+ _content_type=_content_type,
1528
+ _headers=_headers,
1529
+ _host_index=_host_index,
1530
+ )
1531
+
1532
+ _response_types_map: Dict[str, Optional[str]] = {
1533
+ "200": "float",
1534
+ }
1535
+ response_data = await self.api_client.call_api(
1536
+ *_param, _request_timeout=_request_timeout
1537
+ )
1538
+ await response_data.read()
1539
+ return self.api_client.response_deserialize(
1540
+ response_data=response_data,
1541
+ response_types_map=_response_types_map,
1542
+ ).data
1543
+
1544
+ @validate_call
1545
+ async def _get_memory_usage_async_with_http_info(
1546
+ self,
1547
+ _request_timeout: Union[
1548
+ None,
1549
+ Annotated[StrictFloat, Field(gt=0)],
1550
+ Tuple[
1551
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1552
+ ],
1553
+ ] = None,
1554
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1555
+ _content_type: Optional[StrictStr] = None,
1556
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1557
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1558
+ ) -> ApiResponse[float]:
1559
+ """Get Memory Usage
1560
+
1561
+ Resident Set Size (RSS) in MB — the actual memory used by the process in RAM. Represents the physical memory footprint. Important for monitoring real usage.
1562
+
1563
+ :param _request_timeout: timeout setting for this request. If one
1564
+ number provided, it will be total request
1565
+ timeout. It can also be a pair (tuple) of
1566
+ (connection, read) timeouts.
1567
+ :type _request_timeout: int, tuple(int, int), optional
1568
+ :param _request_auth: set to override the auth_settings for an a single
1569
+ request; this effectively ignores the
1570
+ authentication in the spec for a single request.
1571
+ :type _request_auth: dict, optional
1572
+ :param _content_type: force content-type for the request.
1573
+ :type _content_type: str, Optional
1574
+ :param _headers: set to override the headers for a single
1575
+ request; this effectively ignores the headers
1576
+ in the spec for a single request.
1577
+ :type _headers: dict, optional
1578
+ :param _host_index: set to override the host_index for a single
1579
+ request; this effectively ignores the host_index
1580
+ in the spec for a single request.
1581
+ :type _host_index: int, optional
1582
+ :return: Returns the result object.
1583
+ """ # noqa: E501
1584
+
1585
+ _param = self._get_memory_usage_serialize(
1586
+ _request_auth=_request_auth,
1587
+ _content_type=_content_type,
1588
+ _headers=_headers,
1589
+ _host_index=_host_index,
1590
+ )
1591
+
1592
+ _response_types_map: Dict[str, Optional[str]] = {
1593
+ "200": "float",
1594
+ }
1595
+ response_data = await self.api_client.call_api(
1596
+ *_param, _request_timeout=_request_timeout
1597
+ )
1598
+ await response_data.read()
1599
+ return self.api_client.response_deserialize(
1600
+ response_data=response_data, response_types_map=_response_types_map
1601
+ )
1602
+
1603
+ @validate_call
1604
+ async def _get_memory_usage_async_without_preload_content(
1605
+ self,
1606
+ _request_timeout: Union[
1607
+ None,
1608
+ Annotated[StrictFloat, Field(gt=0)],
1609
+ Tuple[
1610
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1611
+ ],
1612
+ ] = None,
1613
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1614
+ _content_type: Optional[StrictStr] = None,
1615
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1616
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1617
+ ) -> RESTResponseType:
1618
+ """Get Memory Usage
1619
+
1620
+ Resident Set Size (RSS) in MB — the actual memory used by the process in RAM. Represents the physical memory footprint. Important for monitoring real usage.
1621
+
1622
+ :param _request_timeout: timeout setting for this request. If one
1623
+ number provided, it will be total request
1624
+ timeout. It can also be a pair (tuple) of
1625
+ (connection, read) timeouts.
1626
+ :type _request_timeout: int, tuple(int, int), optional
1627
+ :param _request_auth: set to override the auth_settings for an a single
1628
+ request; this effectively ignores the
1629
+ authentication in the spec for a single request.
1630
+ :type _request_auth: dict, optional
1631
+ :param _content_type: force content-type for the request.
1632
+ :type _content_type: str, Optional
1633
+ :param _headers: set to override the headers for a single
1634
+ request; this effectively ignores the headers
1635
+ in the spec for a single request.
1636
+ :type _headers: dict, optional
1637
+ :param _host_index: set to override the host_index for a single
1638
+ request; this effectively ignores the host_index
1639
+ in the spec for a single request.
1640
+ :type _host_index: int, optional
1641
+ :return: Returns the result object.
1642
+ """ # noqa: E501
1643
+
1644
+ _param = self._get_memory_usage_serialize(
1645
+ _request_auth=_request_auth,
1646
+ _content_type=_content_type,
1647
+ _headers=_headers,
1648
+ _host_index=_host_index,
1649
+ )
1650
+
1651
+ _response_types_map: Dict[str, Optional[str]] = {
1652
+ "200": "float",
1653
+ }
1654
+ response_data = await self.api_client.call_api(
1655
+ *_param, _request_timeout=_request_timeout
1656
+ )
1657
+ return response_data
1658
+
1659
+ # Private sync implementation methods
1660
+ @validate_call
1661
+ def _get_memory_usage_sync(
1662
+ self,
1663
+ _request_timeout: Union[
1664
+ None,
1665
+ Annotated[StrictFloat, Field(gt=0)],
1666
+ Tuple[
1667
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1668
+ ],
1669
+ ] = None,
1670
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1671
+ _content_type: Optional[StrictStr] = None,
1672
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1673
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1674
+ ) -> float:
1675
+ """Synchronous version of get_memory_usage"""
1676
+ return async_to_sync(self._get_memory_usage_async)(
1677
+ _request_timeout=_request_timeout,
1678
+ _request_auth=_request_auth,
1679
+ _content_type=_content_type,
1680
+ _headers=_headers,
1681
+ _host_index=_host_index,
1682
+ )
1683
+
1684
+ @validate_call
1685
+ def _get_memory_usage_sync_with_http_info(
1686
+ self,
1687
+ _request_timeout: Union[
1688
+ None,
1689
+ Annotated[StrictFloat, Field(gt=0)],
1690
+ Tuple[
1691
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1692
+ ],
1693
+ ] = None,
1694
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1695
+ _content_type: Optional[StrictStr] = None,
1696
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1697
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1698
+ ) -> ApiResponse[float]:
1699
+ """Synchronous version of get_memory_usage_with_http_info"""
1700
+ return async_to_sync(self._get_memory_usage_async_with_http_info)(
1701
+ _request_timeout=_request_timeout,
1702
+ _request_auth=_request_auth,
1703
+ _content_type=_content_type,
1704
+ _headers=_headers,
1705
+ _host_index=_host_index,
1706
+ )
1707
+
1708
+ @validate_call
1709
+ def _get_memory_usage_sync_without_preload_content(
1710
+ self,
1711
+ _request_timeout: Union[
1712
+ None,
1713
+ Annotated[StrictFloat, Field(gt=0)],
1714
+ Tuple[
1715
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1716
+ ],
1717
+ ] = None,
1718
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1719
+ _content_type: Optional[StrictStr] = None,
1720
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1721
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1722
+ ) -> RESTResponseType:
1723
+ """Synchronous version of get_memory_usage_without_preload_content"""
1724
+ return async_to_sync(self._get_memory_usage_async_without_preload_content)(
1725
+ _request_timeout=_request_timeout,
1726
+ _request_auth=_request_auth,
1727
+ _content_type=_content_type,
1728
+ _headers=_headers,
1729
+ _host_index=_host_index,
1730
+ )
1731
+
1732
+ def _get_memory_usage_serialize(
1733
+ self,
1734
+ _request_auth,
1735
+ _content_type,
1736
+ _headers,
1737
+ _host_index,
1738
+ ) -> RequestSerialized:
1739
+
1740
+ _host = None
1741
+
1742
+ _collection_formats: Dict[str, str] = {}
1743
+
1744
+ _path_params: Dict[str, str] = {}
1745
+ _query_params: List[Tuple[str, str]] = []
1746
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1747
+ _form_params: List[Tuple[str, str]] = []
1748
+ _files: Dict[
1749
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1750
+ ] = {}
1751
+ _body_params: Optional[bytes] = None
1752
+
1753
+ # process the path parameters
1754
+ # process the query parameters
1755
+ # process the header parameters
1756
+ # process the form parameters
1757
+ # process the body parameter
1758
+
1759
+ # set the HTTP header `Accept`
1760
+ if "Accept" not in _header_params:
1761
+ _header_params["Accept"] = self.api_client.select_header_accept(
1762
+ ["application/json"]
1763
+ )
1764
+
1765
+ # authentication setting
1766
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
1767
+
1768
+ return self.api_client.param_serialize(
1769
+ method="GET",
1770
+ resource_path="/admin/memory",
1771
+ path_params=_path_params,
1772
+ query_params=_query_params,
1773
+ header_params=_header_params,
1774
+ body=_body_params,
1775
+ post_params=_form_params,
1776
+ files=_files,
1777
+ auth_settings=_auth_settings,
1778
+ collection_formats=_collection_formats,
1779
+ _host=_host,
1780
+ _request_auth=_request_auth,
1781
+ )
1782
+
1783
+ @validate_call
1784
+ def get_metrics(
1785
+ self,
1786
+ _request_timeout: Union[
1787
+ None,
1788
+ Annotated[StrictFloat, Field(gt=0)],
1789
+ Tuple[
1790
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1791
+ ],
1792
+ ] = None,
1793
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1794
+ _content_type: Optional[StrictStr] = None,
1795
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1796
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1797
+ ) -> object:
1798
+ """Metrics
1799
+
1800
+ This method can work in both sync and async modes based on the is_sync flag.
1801
+ """
1802
+ if self.is_sync:
1803
+ return self._get_metrics_sync(
1804
+ _request_timeout=_request_timeout,
1805
+ _request_auth=_request_auth,
1806
+ _content_type=_content_type,
1807
+ _headers=_headers,
1808
+ _host_index=_host_index,
1809
+ )
1810
+
1811
+ else:
1812
+ return self._get_metrics_async(
1813
+ _request_timeout=_request_timeout,
1814
+ _request_auth=_request_auth,
1815
+ _content_type=_content_type,
1816
+ _headers=_headers,
1817
+ _host_index=_host_index,
1818
+ )
1819
+
1820
+ @validate_call
1821
+ def get_metrics_with_http_info(
1822
+ self,
1823
+ _request_timeout: Union[
1824
+ None,
1825
+ Annotated[StrictFloat, Field(gt=0)],
1826
+ Tuple[
1827
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1828
+ ],
1829
+ ] = None,
1830
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1831
+ _content_type: Optional[StrictStr] = None,
1832
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1833
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1834
+ ) -> ApiResponse[object]:
1835
+ """Metrics with HTTP info
1836
+
1837
+ This method can work in both sync and async modes based on the is_sync flag.
1838
+ """
1839
+ if self.is_sync:
1840
+ return self._get_metrics_sync_with_http_info(
1841
+ _request_timeout=_request_timeout,
1842
+ _request_auth=_request_auth,
1843
+ _content_type=_content_type,
1844
+ _headers=_headers,
1845
+ _host_index=_host_index,
1846
+ )
1847
+
1848
+ else:
1849
+ return self._get_metrics_async_with_http_info(
1850
+ _request_timeout=_request_timeout,
1851
+ _request_auth=_request_auth,
1852
+ _content_type=_content_type,
1853
+ _headers=_headers,
1854
+ _host_index=_host_index,
1855
+ )
1856
+
1857
+ @validate_call
1858
+ def get_metrics_without_preload_content(
1859
+ self,
1860
+ _request_timeout: Union[
1861
+ None,
1862
+ Annotated[StrictFloat, Field(gt=0)],
1863
+ Tuple[
1864
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1865
+ ],
1866
+ ] = None,
1867
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1868
+ _content_type: Optional[StrictStr] = None,
1869
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1870
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1871
+ ) -> RESTResponseType:
1872
+ """Metrics without preloading content
1873
+
1874
+ This method can work in both sync and async modes based on the is_sync flag.
1875
+ """
1876
+ if self.is_sync:
1877
+ return self._get_metrics_sync_without_preload_content(
1878
+ _request_timeout=_request_timeout,
1879
+ _request_auth=_request_auth,
1880
+ _content_type=_content_type,
1881
+ _headers=_headers,
1882
+ _host_index=_host_index,
1883
+ )
1884
+
1885
+ else:
1886
+ return self._get_metrics_async_without_preload_content(
1887
+ _request_timeout=_request_timeout,
1888
+ _request_auth=_request_auth,
1889
+ _content_type=_content_type,
1890
+ _headers=_headers,
1891
+ _host_index=_host_index,
1892
+ )
1893
+
1894
+ # Private async implementation methods
1895
+ @validate_call
1896
+ async def _get_metrics_async(
1897
+ self,
1898
+ _request_timeout: Union[
1899
+ None,
1900
+ Annotated[StrictFloat, Field(gt=0)],
1901
+ Tuple[
1902
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1903
+ ],
1904
+ ] = None,
1905
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1906
+ _content_type: Optional[StrictStr] = None,
1907
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1908
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1909
+ ) -> object:
1910
+ """Metrics
1911
+
1912
+ Get Prometheus metrics for the application. Returns plain text.
1913
+
1914
+ :param _request_timeout: timeout setting for this request. If one
1915
+ number provided, it will be total request
1916
+ timeout. It can also be a pair (tuple) of
1917
+ (connection, read) timeouts.
1918
+ :type _request_timeout: int, tuple(int, int), optional
1919
+ :param _request_auth: set to override the auth_settings for an a single
1920
+ request; this effectively ignores the
1921
+ authentication in the spec for a single request.
1922
+ :type _request_auth: dict, optional
1923
+ :param _content_type: force content-type for the request.
1924
+ :type _content_type: str, Optional
1925
+ :param _headers: set to override the headers for a single
1926
+ request; this effectively ignores the headers
1927
+ in the spec for a single request.
1928
+ :type _headers: dict, optional
1929
+ :param _host_index: set to override the host_index for a single
1930
+ request; this effectively ignores the host_index
1931
+ in the spec for a single request.
1932
+ :type _host_index: int, optional
1933
+ :return: Returns the result object.
1934
+ """ # noqa: E501
1935
+
1936
+ _param = self._get_metrics_serialize(
1937
+ _request_auth=_request_auth,
1938
+ _content_type=_content_type,
1939
+ _headers=_headers,
1940
+ _host_index=_host_index,
1941
+ )
1942
+
1943
+ _response_types_map: Dict[str, Optional[str]] = {
1944
+ "200": "object",
1945
+ }
1946
+ response_data = await self.api_client.call_api(
1947
+ *_param, _request_timeout=_request_timeout
1948
+ )
1949
+ await response_data.read()
1950
+ return self.api_client.response_deserialize(
1951
+ response_data=response_data,
1952
+ response_types_map=_response_types_map,
1953
+ ).data
1954
+
1955
+ @validate_call
1956
+ async def _get_metrics_async_with_http_info(
1957
+ self,
1958
+ _request_timeout: Union[
1959
+ None,
1960
+ Annotated[StrictFloat, Field(gt=0)],
1961
+ Tuple[
1962
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1963
+ ],
1964
+ ] = None,
1965
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1966
+ _content_type: Optional[StrictStr] = None,
1967
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1968
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1969
+ ) -> ApiResponse[object]:
1970
+ """Metrics
1971
+
1972
+ Get Prometheus metrics for the application. Returns plain text.
1973
+
1974
+ :param _request_timeout: timeout setting for this request. If one
1975
+ number provided, it will be total request
1976
+ timeout. It can also be a pair (tuple) of
1977
+ (connection, read) timeouts.
1978
+ :type _request_timeout: int, tuple(int, int), optional
1979
+ :param _request_auth: set to override the auth_settings for an a single
1980
+ request; this effectively ignores the
1981
+ authentication in the spec for a single request.
1982
+ :type _request_auth: dict, optional
1983
+ :param _content_type: force content-type for the request.
1984
+ :type _content_type: str, Optional
1985
+ :param _headers: set to override the headers for a single
1986
+ request; this effectively ignores the headers
1987
+ in the spec for a single request.
1988
+ :type _headers: dict, optional
1989
+ :param _host_index: set to override the host_index for a single
1990
+ request; this effectively ignores the host_index
1991
+ in the spec for a single request.
1992
+ :type _host_index: int, optional
1993
+ :return: Returns the result object.
1994
+ """ # noqa: E501
1995
+
1996
+ _param = self._get_metrics_serialize(
1997
+ _request_auth=_request_auth,
1998
+ _content_type=_content_type,
1999
+ _headers=_headers,
2000
+ _host_index=_host_index,
2001
+ )
2002
+
2003
+ _response_types_map: Dict[str, Optional[str]] = {
2004
+ "200": "object",
2005
+ }
2006
+ response_data = await self.api_client.call_api(
2007
+ *_param, _request_timeout=_request_timeout
2008
+ )
2009
+ await response_data.read()
2010
+ return self.api_client.response_deserialize(
2011
+ response_data=response_data, response_types_map=_response_types_map
2012
+ )
2013
+
2014
+ @validate_call
2015
+ async def _get_metrics_async_without_preload_content(
2016
+ self,
2017
+ _request_timeout: Union[
2018
+ None,
2019
+ Annotated[StrictFloat, Field(gt=0)],
2020
+ Tuple[
2021
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2022
+ ],
2023
+ ] = None,
2024
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2025
+ _content_type: Optional[StrictStr] = None,
2026
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2027
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2028
+ ) -> RESTResponseType:
2029
+ """Metrics
2030
+
2031
+ Get Prometheus metrics for the application. Returns plain text.
2032
+
2033
+ :param _request_timeout: timeout setting for this request. If one
2034
+ number provided, it will be total request
2035
+ timeout. It can also be a pair (tuple) of
2036
+ (connection, read) timeouts.
2037
+ :type _request_timeout: int, tuple(int, int), optional
2038
+ :param _request_auth: set to override the auth_settings for an a single
2039
+ request; this effectively ignores the
2040
+ authentication in the spec for a single request.
2041
+ :type _request_auth: dict, optional
2042
+ :param _content_type: force content-type for the request.
2043
+ :type _content_type: str, Optional
2044
+ :param _headers: set to override the headers for a single
2045
+ request; this effectively ignores the headers
2046
+ in the spec for a single request.
2047
+ :type _headers: dict, optional
2048
+ :param _host_index: set to override the host_index for a single
2049
+ request; this effectively ignores the host_index
2050
+ in the spec for a single request.
2051
+ :type _host_index: int, optional
2052
+ :return: Returns the result object.
2053
+ """ # noqa: E501
2054
+
2055
+ _param = self._get_metrics_serialize(
2056
+ _request_auth=_request_auth,
2057
+ _content_type=_content_type,
2058
+ _headers=_headers,
2059
+ _host_index=_host_index,
2060
+ )
2061
+
2062
+ _response_types_map: Dict[str, Optional[str]] = {
2063
+ "200": "object",
2064
+ }
2065
+ response_data = await self.api_client.call_api(
2066
+ *_param, _request_timeout=_request_timeout
2067
+ )
2068
+ return response_data
2069
+
2070
+ # Private sync implementation methods
2071
+ @validate_call
2072
+ def _get_metrics_sync(
2073
+ self,
2074
+ _request_timeout: Union[
2075
+ None,
2076
+ Annotated[StrictFloat, Field(gt=0)],
2077
+ Tuple[
2078
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2079
+ ],
2080
+ ] = None,
2081
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2082
+ _content_type: Optional[StrictStr] = None,
2083
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2084
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2085
+ ) -> object:
2086
+ """Synchronous version of get_metrics"""
2087
+ return async_to_sync(self._get_metrics_async)(
2088
+ _request_timeout=_request_timeout,
2089
+ _request_auth=_request_auth,
2090
+ _content_type=_content_type,
2091
+ _headers=_headers,
2092
+ _host_index=_host_index,
2093
+ )
2094
+
2095
+ @validate_call
2096
+ def _get_metrics_sync_with_http_info(
2097
+ self,
2098
+ _request_timeout: Union[
2099
+ None,
2100
+ Annotated[StrictFloat, Field(gt=0)],
2101
+ Tuple[
2102
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2103
+ ],
2104
+ ] = None,
2105
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2106
+ _content_type: Optional[StrictStr] = None,
2107
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2108
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2109
+ ) -> ApiResponse[object]:
2110
+ """Synchronous version of get_metrics_with_http_info"""
2111
+ return async_to_sync(self._get_metrics_async_with_http_info)(
2112
+ _request_timeout=_request_timeout,
2113
+ _request_auth=_request_auth,
2114
+ _content_type=_content_type,
2115
+ _headers=_headers,
2116
+ _host_index=_host_index,
2117
+ )
2118
+
2119
+ @validate_call
2120
+ def _get_metrics_sync_without_preload_content(
2121
+ self,
2122
+ _request_timeout: Union[
2123
+ None,
2124
+ Annotated[StrictFloat, Field(gt=0)],
2125
+ Tuple[
2126
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2127
+ ],
2128
+ ] = None,
2129
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2130
+ _content_type: Optional[StrictStr] = None,
2131
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2132
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2133
+ ) -> RESTResponseType:
2134
+ """Synchronous version of get_metrics_without_preload_content"""
2135
+ return async_to_sync(self._get_metrics_async_without_preload_content)(
2136
+ _request_timeout=_request_timeout,
2137
+ _request_auth=_request_auth,
2138
+ _content_type=_content_type,
2139
+ _headers=_headers,
2140
+ _host_index=_host_index,
2141
+ )
2142
+
2143
+ def _get_metrics_serialize(
2144
+ self,
2145
+ _request_auth,
2146
+ _content_type,
2147
+ _headers,
2148
+ _host_index,
2149
+ ) -> RequestSerialized:
2150
+
2151
+ _host = None
2152
+
2153
+ _collection_formats: Dict[str, str] = {}
2154
+
2155
+ _path_params: Dict[str, str] = {}
2156
+ _query_params: List[Tuple[str, str]] = []
2157
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2158
+ _form_params: List[Tuple[str, str]] = []
2159
+ _files: Dict[
2160
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2161
+ ] = {}
2162
+ _body_params: Optional[bytes] = None
2163
+
2164
+ # process the path parameters
2165
+ # process the query parameters
2166
+ # process the header parameters
2167
+ # process the form parameters
2168
+ # process the body parameter
2169
+
2170
+ # set the HTTP header `Accept`
2171
+ if "Accept" not in _header_params:
2172
+ _header_params["Accept"] = self.api_client.select_header_accept(
2173
+ ["application/json"]
2174
+ )
2175
+
2176
+ # authentication setting
2177
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
2178
+
2179
+ return self.api_client.param_serialize(
2180
+ method="GET",
2181
+ resource_path="/admin/metrics",
2182
+ path_params=_path_params,
2183
+ query_params=_query_params,
2184
+ header_params=_header_params,
2185
+ body=_body_params,
2186
+ post_params=_form_params,
2187
+ files=_files,
2188
+ auth_settings=_auth_settings,
2189
+ collection_formats=_collection_formats,
2190
+ _host=_host,
2191
+ _request_auth=_request_auth,
2192
+ )
2193
+
2194
+ @validate_call
2195
+ def get_threads(
2196
+ self,
2197
+ _request_timeout: Union[
2198
+ None,
2199
+ Annotated[StrictFloat, Field(gt=0)],
2200
+ Tuple[
2201
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2202
+ ],
2203
+ ] = None,
2204
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2205
+ _content_type: Optional[StrictStr] = None,
2206
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2207
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2208
+ ) -> Dict[str, object]:
2209
+ """Get Threads
2210
+
2211
+ This method can work in both sync and async modes based on the is_sync flag.
2212
+ """
2213
+ if self.is_sync:
2214
+ return self._get_threads_sync(
2215
+ _request_timeout=_request_timeout,
2216
+ _request_auth=_request_auth,
2217
+ _content_type=_content_type,
2218
+ _headers=_headers,
2219
+ _host_index=_host_index,
2220
+ )
2221
+
2222
+ else:
2223
+ return self._get_threads_async(
2224
+ _request_timeout=_request_timeout,
2225
+ _request_auth=_request_auth,
2226
+ _content_type=_content_type,
2227
+ _headers=_headers,
2228
+ _host_index=_host_index,
2229
+ )
2230
+
2231
+ @validate_call
2232
+ def get_threads_with_http_info(
2233
+ self,
2234
+ _request_timeout: Union[
2235
+ None,
2236
+ Annotated[StrictFloat, Field(gt=0)],
2237
+ Tuple[
2238
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2239
+ ],
2240
+ ] = None,
2241
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2242
+ _content_type: Optional[StrictStr] = None,
2243
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2244
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2245
+ ) -> ApiResponse[Dict[str, object]]:
2246
+ """Get Threads with HTTP info
2247
+
2248
+ This method can work in both sync and async modes based on the is_sync flag.
2249
+ """
2250
+ if self.is_sync:
2251
+ return self._get_threads_sync_with_http_info(
2252
+ _request_timeout=_request_timeout,
2253
+ _request_auth=_request_auth,
2254
+ _content_type=_content_type,
2255
+ _headers=_headers,
2256
+ _host_index=_host_index,
2257
+ )
2258
+
2259
+ else:
2260
+ return self._get_threads_async_with_http_info(
2261
+ _request_timeout=_request_timeout,
2262
+ _request_auth=_request_auth,
2263
+ _content_type=_content_type,
2264
+ _headers=_headers,
2265
+ _host_index=_host_index,
2266
+ )
2267
+
2268
+ @validate_call
2269
+ def get_threads_without_preload_content(
2270
+ self,
2271
+ _request_timeout: Union[
2272
+ None,
2273
+ Annotated[StrictFloat, Field(gt=0)],
2274
+ Tuple[
2275
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2276
+ ],
2277
+ ] = None,
2278
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2279
+ _content_type: Optional[StrictStr] = None,
2280
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2281
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2282
+ ) -> RESTResponseType:
2283
+ """Get Threads without preloading content
2284
+
2285
+ This method can work in both sync and async modes based on the is_sync flag.
2286
+ """
2287
+ if self.is_sync:
2288
+ return self._get_threads_sync_without_preload_content(
2289
+ _request_timeout=_request_timeout,
2290
+ _request_auth=_request_auth,
2291
+ _content_type=_content_type,
2292
+ _headers=_headers,
2293
+ _host_index=_host_index,
2294
+ )
2295
+
2296
+ else:
2297
+ return self._get_threads_async_without_preload_content(
2298
+ _request_timeout=_request_timeout,
2299
+ _request_auth=_request_auth,
2300
+ _content_type=_content_type,
2301
+ _headers=_headers,
2302
+ _host_index=_host_index,
2303
+ )
2304
+
2305
+ # Private async implementation methods
2306
+ @validate_call
2307
+ async def _get_threads_async(
2308
+ self,
2309
+ _request_timeout: Union[
2310
+ None,
2311
+ Annotated[StrictFloat, Field(gt=0)],
2312
+ Tuple[
2313
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2314
+ ],
2315
+ ] = None,
2316
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2317
+ _content_type: Optional[StrictStr] = None,
2318
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2319
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2320
+ ) -> Dict[str, object]:
2321
+ """Get Threads
2322
+
2323
+ Return count and names of active threads.
2324
+
2325
+ :param _request_timeout: timeout setting for this request. If one
2326
+ number provided, it will be total request
2327
+ timeout. It can also be a pair (tuple) of
2328
+ (connection, read) timeouts.
2329
+ :type _request_timeout: int, tuple(int, int), optional
2330
+ :param _request_auth: set to override the auth_settings for an a single
2331
+ request; this effectively ignores the
2332
+ authentication in the spec for a single request.
2333
+ :type _request_auth: dict, optional
2334
+ :param _content_type: force content-type for the request.
2335
+ :type _content_type: str, Optional
2336
+ :param _headers: set to override the headers for a single
2337
+ request; this effectively ignores the headers
2338
+ in the spec for a single request.
2339
+ :type _headers: dict, optional
2340
+ :param _host_index: set to override the host_index for a single
2341
+ request; this effectively ignores the host_index
2342
+ in the spec for a single request.
2343
+ :type _host_index: int, optional
2344
+ :return: Returns the result object.
2345
+ """ # noqa: E501
2346
+
2347
+ _param = self._get_threads_serialize(
2348
+ _request_auth=_request_auth,
2349
+ _content_type=_content_type,
2350
+ _headers=_headers,
2351
+ _host_index=_host_index,
2352
+ )
2353
+
2354
+ _response_types_map: Dict[str, Optional[str]] = {
2355
+ "200": "Dict[str, object]",
2356
+ }
2357
+ response_data = await self.api_client.call_api(
2358
+ *_param, _request_timeout=_request_timeout
2359
+ )
2360
+ await response_data.read()
2361
+ return self.api_client.response_deserialize(
2362
+ response_data=response_data,
2363
+ response_types_map=_response_types_map,
2364
+ ).data
2365
+
2366
+ @validate_call
2367
+ async def _get_threads_async_with_http_info(
2368
+ self,
2369
+ _request_timeout: Union[
2370
+ None,
2371
+ Annotated[StrictFloat, Field(gt=0)],
2372
+ Tuple[
2373
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2374
+ ],
2375
+ ] = None,
2376
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2377
+ _content_type: Optional[StrictStr] = None,
2378
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2379
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2380
+ ) -> ApiResponse[Dict[str, object]]:
2381
+ """Get Threads
2382
+
2383
+ Return count and names of active threads.
2384
+
2385
+ :param _request_timeout: timeout setting for this request. If one
2386
+ number provided, it will be total request
2387
+ timeout. It can also be a pair (tuple) of
2388
+ (connection, read) timeouts.
2389
+ :type _request_timeout: int, tuple(int, int), optional
2390
+ :param _request_auth: set to override the auth_settings for an a single
2391
+ request; this effectively ignores the
2392
+ authentication in the spec for a single request.
2393
+ :type _request_auth: dict, optional
2394
+ :param _content_type: force content-type for the request.
2395
+ :type _content_type: str, Optional
2396
+ :param _headers: set to override the headers for a single
2397
+ request; this effectively ignores the headers
2398
+ in the spec for a single request.
2399
+ :type _headers: dict, optional
2400
+ :param _host_index: set to override the host_index for a single
2401
+ request; this effectively ignores the host_index
2402
+ in the spec for a single request.
2403
+ :type _host_index: int, optional
2404
+ :return: Returns the result object.
2405
+ """ # noqa: E501
2406
+
2407
+ _param = self._get_threads_serialize(
2408
+ _request_auth=_request_auth,
2409
+ _content_type=_content_type,
2410
+ _headers=_headers,
2411
+ _host_index=_host_index,
2412
+ )
2413
+
2414
+ _response_types_map: Dict[str, Optional[str]] = {
2415
+ "200": "Dict[str, object]",
2416
+ }
2417
+ response_data = await self.api_client.call_api(
2418
+ *_param, _request_timeout=_request_timeout
2419
+ )
2420
+ await response_data.read()
2421
+ return self.api_client.response_deserialize(
2422
+ response_data=response_data, response_types_map=_response_types_map
2423
+ )
2424
+
2425
+ @validate_call
2426
+ async def _get_threads_async_without_preload_content(
2427
+ self,
2428
+ _request_timeout: Union[
2429
+ None,
2430
+ Annotated[StrictFloat, Field(gt=0)],
2431
+ Tuple[
2432
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2433
+ ],
2434
+ ] = None,
2435
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2436
+ _content_type: Optional[StrictStr] = None,
2437
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2438
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2439
+ ) -> RESTResponseType:
2440
+ """Get Threads
2441
+
2442
+ Return count and names of active threads.
2443
+
2444
+ :param _request_timeout: timeout setting for this request. If one
2445
+ number provided, it will be total request
2446
+ timeout. It can also be a pair (tuple) of
2447
+ (connection, read) timeouts.
2448
+ :type _request_timeout: int, tuple(int, int), optional
2449
+ :param _request_auth: set to override the auth_settings for an a single
2450
+ request; this effectively ignores the
2451
+ authentication in the spec for a single request.
2452
+ :type _request_auth: dict, optional
2453
+ :param _content_type: force content-type for the request.
2454
+ :type _content_type: str, Optional
2455
+ :param _headers: set to override the headers for a single
2456
+ request; this effectively ignores the headers
2457
+ in the spec for a single request.
2458
+ :type _headers: dict, optional
2459
+ :param _host_index: set to override the host_index for a single
2460
+ request; this effectively ignores the host_index
2461
+ in the spec for a single request.
2462
+ :type _host_index: int, optional
2463
+ :return: Returns the result object.
2464
+ """ # noqa: E501
2465
+
2466
+ _param = self._get_threads_serialize(
2467
+ _request_auth=_request_auth,
2468
+ _content_type=_content_type,
2469
+ _headers=_headers,
2470
+ _host_index=_host_index,
2471
+ )
2472
+
2473
+ _response_types_map: Dict[str, Optional[str]] = {
2474
+ "200": "Dict[str, object]",
2475
+ }
2476
+ response_data = await self.api_client.call_api(
2477
+ *_param, _request_timeout=_request_timeout
2478
+ )
2479
+ return response_data
2480
+
2481
+ # Private sync implementation methods
2482
+ @validate_call
2483
+ def _get_threads_sync(
2484
+ self,
2485
+ _request_timeout: Union[
2486
+ None,
2487
+ Annotated[StrictFloat, Field(gt=0)],
2488
+ Tuple[
2489
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2490
+ ],
2491
+ ] = None,
2492
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2493
+ _content_type: Optional[StrictStr] = None,
2494
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2495
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2496
+ ) -> Dict[str, object]:
2497
+ """Synchronous version of get_threads"""
2498
+ return async_to_sync(self._get_threads_async)(
2499
+ _request_timeout=_request_timeout,
2500
+ _request_auth=_request_auth,
2501
+ _content_type=_content_type,
2502
+ _headers=_headers,
2503
+ _host_index=_host_index,
2504
+ )
2505
+
2506
+ @validate_call
2507
+ def _get_threads_sync_with_http_info(
2508
+ self,
2509
+ _request_timeout: Union[
2510
+ None,
2511
+ Annotated[StrictFloat, Field(gt=0)],
2512
+ Tuple[
2513
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2514
+ ],
2515
+ ] = None,
2516
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2517
+ _content_type: Optional[StrictStr] = None,
2518
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2519
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2520
+ ) -> ApiResponse[Dict[str, object]]:
2521
+ """Synchronous version of get_threads_with_http_info"""
2522
+ return async_to_sync(self._get_threads_async_with_http_info)(
2523
+ _request_timeout=_request_timeout,
2524
+ _request_auth=_request_auth,
2525
+ _content_type=_content_type,
2526
+ _headers=_headers,
2527
+ _host_index=_host_index,
2528
+ )
2529
+
2530
+ @validate_call
2531
+ def _get_threads_sync_without_preload_content(
2532
+ self,
2533
+ _request_timeout: Union[
2534
+ None,
2535
+ Annotated[StrictFloat, Field(gt=0)],
2536
+ Tuple[
2537
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2538
+ ],
2539
+ ] = None,
2540
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2541
+ _content_type: Optional[StrictStr] = None,
2542
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2543
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2544
+ ) -> RESTResponseType:
2545
+ """Synchronous version of get_threads_without_preload_content"""
2546
+ return async_to_sync(self._get_threads_async_without_preload_content)(
2547
+ _request_timeout=_request_timeout,
2548
+ _request_auth=_request_auth,
2549
+ _content_type=_content_type,
2550
+ _headers=_headers,
2551
+ _host_index=_host_index,
2552
+ )
2553
+
2554
+ def _get_threads_serialize(
2555
+ self,
2556
+ _request_auth,
2557
+ _content_type,
2558
+ _headers,
2559
+ _host_index,
2560
+ ) -> RequestSerialized:
2561
+
2562
+ _host = None
2563
+
2564
+ _collection_formats: Dict[str, str] = {}
2565
+
2566
+ _path_params: Dict[str, str] = {}
2567
+ _query_params: List[Tuple[str, str]] = []
2568
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2569
+ _form_params: List[Tuple[str, str]] = []
2570
+ _files: Dict[
2571
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2572
+ ] = {}
2573
+ _body_params: Optional[bytes] = None
2574
+
2575
+ # process the path parameters
2576
+ # process the query parameters
2577
+ # process the header parameters
2578
+ # process the form parameters
2579
+ # process the body parameter
2580
+
2581
+ # set the HTTP header `Accept`
2582
+ if "Accept" not in _header_params:
2583
+ _header_params["Accept"] = self.api_client.select_header_accept(
2584
+ ["application/json"]
2585
+ )
2586
+
2587
+ # authentication setting
2588
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
2589
+
2590
+ return self.api_client.param_serialize(
2591
+ method="GET",
2592
+ resource_path="/admin/threads",
2593
+ path_params=_path_params,
2594
+ query_params=_query_params,
2595
+ header_params=_header_params,
2596
+ body=_body_params,
2597
+ post_params=_form_params,
2598
+ files=_files,
2599
+ auth_settings=_auth_settings,
2600
+ collection_formats=_collection_formats,
2601
+ _host=_host,
2602
+ _request_auth=_request_auth,
2603
+ )
2604
+
2605
+ @validate_call
2606
+ def get_uptime(
2607
+ self,
2608
+ type: Optional[StrictStr] = None,
2609
+ _request_timeout: Union[
2610
+ None,
2611
+ Annotated[StrictFloat, Field(gt=0)],
2612
+ Tuple[
2613
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2614
+ ],
2615
+ ] = None,
2616
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2617
+ _content_type: Optional[StrictStr] = None,
2618
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2619
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2620
+ ) -> str:
2621
+ """Get Uptime
2622
+
2623
+ This method can work in both sync and async modes based on the is_sync flag.
2624
+ """
2625
+ if self.is_sync:
2626
+ return self._get_uptime_sync(
2627
+ type=type,
2628
+ _request_timeout=_request_timeout,
2629
+ _request_auth=_request_auth,
2630
+ _content_type=_content_type,
2631
+ _headers=_headers,
2632
+ _host_index=_host_index,
2633
+ )
2634
+
2635
+ else:
2636
+ return self._get_uptime_async(
2637
+ type=type,
2638
+ _request_timeout=_request_timeout,
2639
+ _request_auth=_request_auth,
2640
+ _content_type=_content_type,
2641
+ _headers=_headers,
2642
+ _host_index=_host_index,
2643
+ )
2644
+
2645
+ @validate_call
2646
+ def get_uptime_with_http_info(
2647
+ self,
2648
+ type: Optional[StrictStr] = None,
2649
+ _request_timeout: Union[
2650
+ None,
2651
+ Annotated[StrictFloat, Field(gt=0)],
2652
+ Tuple[
2653
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2654
+ ],
2655
+ ] = None,
2656
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2657
+ _content_type: Optional[StrictStr] = None,
2658
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2659
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2660
+ ) -> ApiResponse[str]:
2661
+ """Get Uptime with HTTP info
2662
+
2663
+ This method can work in both sync and async modes based on the is_sync flag.
2664
+ """
2665
+ if self.is_sync:
2666
+ return self._get_uptime_sync_with_http_info(
2667
+ type=type,
2668
+ _request_timeout=_request_timeout,
2669
+ _request_auth=_request_auth,
2670
+ _content_type=_content_type,
2671
+ _headers=_headers,
2672
+ _host_index=_host_index,
2673
+ )
2674
+
2675
+ else:
2676
+ return self._get_uptime_async_with_http_info(
2677
+ type=type,
2678
+ _request_timeout=_request_timeout,
2679
+ _request_auth=_request_auth,
2680
+ _content_type=_content_type,
2681
+ _headers=_headers,
2682
+ _host_index=_host_index,
2683
+ )
2684
+
2685
+ @validate_call
2686
+ def get_uptime_without_preload_content(
2687
+ self,
2688
+ type: Optional[StrictStr] = None,
2689
+ _request_timeout: Union[
2690
+ None,
2691
+ Annotated[StrictFloat, Field(gt=0)],
2692
+ Tuple[
2693
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2694
+ ],
2695
+ ] = None,
2696
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2697
+ _content_type: Optional[StrictStr] = None,
2698
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2699
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2700
+ ) -> RESTResponseType:
2701
+ """Get Uptime without preloading content
2702
+
2703
+ This method can work in both sync and async modes based on the is_sync flag.
2704
+ """
2705
+ if self.is_sync:
2706
+ return self._get_uptime_sync_without_preload_content(
2707
+ type=type,
2708
+ _request_timeout=_request_timeout,
2709
+ _request_auth=_request_auth,
2710
+ _content_type=_content_type,
2711
+ _headers=_headers,
2712
+ _host_index=_host_index,
2713
+ )
2714
+
2715
+ else:
2716
+ return self._get_uptime_async_without_preload_content(
2717
+ type=type,
2718
+ _request_timeout=_request_timeout,
2719
+ _request_auth=_request_auth,
2720
+ _content_type=_content_type,
2721
+ _headers=_headers,
2722
+ _host_index=_host_index,
2723
+ )
2724
+
2725
+ # Private async implementation methods
2726
+ @validate_call
2727
+ async def _get_uptime_async(
2728
+ self,
2729
+ type: Optional[StrictStr] = None,
2730
+ _request_timeout: Union[
2731
+ None,
2732
+ Annotated[StrictFloat, Field(gt=0)],
2733
+ Tuple[
2734
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2735
+ ],
2736
+ ] = None,
2737
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2738
+ _content_type: Optional[StrictStr] = None,
2739
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2740
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2741
+ ) -> str:
2742
+ """Get Uptime
2743
+
2744
+ Return the server uptime in seconds or human-readable form.
2745
+
2746
+ :param type:
2747
+ :type type: str
2748
+ :param _request_timeout: timeout setting for this request. If one
2749
+ number provided, it will be total request
2750
+ timeout. It can also be a pair (tuple) of
2751
+ (connection, read) timeouts.
2752
+ :type _request_timeout: int, tuple(int, int), optional
2753
+ :param _request_auth: set to override the auth_settings for an a single
2754
+ request; this effectively ignores the
2755
+ authentication in the spec for a single request.
2756
+ :type _request_auth: dict, optional
2757
+ :param _content_type: force content-type for the request.
2758
+ :type _content_type: str, Optional
2759
+ :param _headers: set to override the headers for a single
2760
+ request; this effectively ignores the headers
2761
+ in the spec for a single request.
2762
+ :type _headers: dict, optional
2763
+ :param _host_index: set to override the host_index for a single
2764
+ request; this effectively ignores the host_index
2765
+ in the spec for a single request.
2766
+ :type _host_index: int, optional
2767
+ :return: Returns the result object.
2768
+ """ # noqa: E501
2769
+
2770
+ _param = self._get_uptime_serialize(
2771
+ type=type,
2772
+ _request_auth=_request_auth,
2773
+ _content_type=_content_type,
2774
+ _headers=_headers,
2775
+ _host_index=_host_index,
2776
+ )
2777
+
2778
+ _response_types_map: Dict[str, Optional[str]] = {
2779
+ "200": "str",
2780
+ }
2781
+ response_data = await self.api_client.call_api(
2782
+ *_param, _request_timeout=_request_timeout
2783
+ )
2784
+ await response_data.read()
2785
+ return self.api_client.response_deserialize(
2786
+ response_data=response_data,
2787
+ response_types_map=_response_types_map,
2788
+ ).data
2789
+
2790
+ @validate_call
2791
+ async def _get_uptime_async_with_http_info(
2792
+ self,
2793
+ type: Optional[StrictStr] = None,
2794
+ _request_timeout: Union[
2795
+ None,
2796
+ Annotated[StrictFloat, Field(gt=0)],
2797
+ Tuple[
2798
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2799
+ ],
2800
+ ] = None,
2801
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2802
+ _content_type: Optional[StrictStr] = None,
2803
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2804
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2805
+ ) -> ApiResponse[str]:
2806
+ """Get Uptime
2807
+
2808
+ Return the server uptime in seconds or human-readable form.
2809
+
2810
+ :param type:
2811
+ :type type: str
2812
+ :param _request_timeout: timeout setting for this request. If one
2813
+ number provided, it will be total request
2814
+ timeout. It can also be a pair (tuple) of
2815
+ (connection, read) timeouts.
2816
+ :type _request_timeout: int, tuple(int, int), optional
2817
+ :param _request_auth: set to override the auth_settings for an a single
2818
+ request; this effectively ignores the
2819
+ authentication in the spec for a single request.
2820
+ :type _request_auth: dict, optional
2821
+ :param _content_type: force content-type for the request.
2822
+ :type _content_type: str, Optional
2823
+ :param _headers: set to override the headers for a single
2824
+ request; this effectively ignores the headers
2825
+ in the spec for a single request.
2826
+ :type _headers: dict, optional
2827
+ :param _host_index: set to override the host_index for a single
2828
+ request; this effectively ignores the host_index
2829
+ in the spec for a single request.
2830
+ :type _host_index: int, optional
2831
+ :return: Returns the result object.
2832
+ """ # noqa: E501
2833
+
2834
+ _param = self._get_uptime_serialize(
2835
+ type=type,
2836
+ _request_auth=_request_auth,
2837
+ _content_type=_content_type,
2838
+ _headers=_headers,
2839
+ _host_index=_host_index,
2840
+ )
2841
+
2842
+ _response_types_map: Dict[str, Optional[str]] = {
2843
+ "200": "str",
2844
+ }
2845
+ response_data = await self.api_client.call_api(
2846
+ *_param, _request_timeout=_request_timeout
2847
+ )
2848
+ await response_data.read()
2849
+ return self.api_client.response_deserialize(
2850
+ response_data=response_data, response_types_map=_response_types_map
2851
+ )
2852
+
2853
+ @validate_call
2854
+ async def _get_uptime_async_without_preload_content(
2855
+ self,
2856
+ type: Optional[StrictStr] = None,
2857
+ _request_timeout: Union[
2858
+ None,
2859
+ Annotated[StrictFloat, Field(gt=0)],
2860
+ Tuple[
2861
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2862
+ ],
2863
+ ] = None,
2864
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2865
+ _content_type: Optional[StrictStr] = None,
2866
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2867
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2868
+ ) -> RESTResponseType:
2869
+ """Get Uptime
2870
+
2871
+ Return the server uptime in seconds or human-readable form.
2872
+
2873
+ :param type:
2874
+ :type type: str
2875
+ :param _request_timeout: timeout setting for this request. If one
2876
+ number provided, it will be total request
2877
+ timeout. It can also be a pair (tuple) of
2878
+ (connection, read) timeouts.
2879
+ :type _request_timeout: int, tuple(int, int), optional
2880
+ :param _request_auth: set to override the auth_settings for an a single
2881
+ request; this effectively ignores the
2882
+ authentication in the spec for a single request.
2883
+ :type _request_auth: dict, optional
2884
+ :param _content_type: force content-type for the request.
2885
+ :type _content_type: str, Optional
2886
+ :param _headers: set to override the headers for a single
2887
+ request; this effectively ignores the headers
2888
+ in the spec for a single request.
2889
+ :type _headers: dict, optional
2890
+ :param _host_index: set to override the host_index for a single
2891
+ request; this effectively ignores the host_index
2892
+ in the spec for a single request.
2893
+ :type _host_index: int, optional
2894
+ :return: Returns the result object.
2895
+ """ # noqa: E501
2896
+
2897
+ _param = self._get_uptime_serialize(
2898
+ type=type,
2899
+ _request_auth=_request_auth,
2900
+ _content_type=_content_type,
2901
+ _headers=_headers,
2902
+ _host_index=_host_index,
2903
+ )
2904
+
2905
+ _response_types_map: Dict[str, Optional[str]] = {
2906
+ "200": "str",
2907
+ }
2908
+ response_data = await self.api_client.call_api(
2909
+ *_param, _request_timeout=_request_timeout
2910
+ )
2911
+ return response_data
2912
+
2913
+ # Private sync implementation methods
2914
+ @validate_call
2915
+ def _get_uptime_sync(
2916
+ self,
2917
+ type: Optional[StrictStr] = None,
2918
+ _request_timeout: Union[
2919
+ None,
2920
+ Annotated[StrictFloat, Field(gt=0)],
2921
+ Tuple[
2922
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2923
+ ],
2924
+ ] = None,
2925
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2926
+ _content_type: Optional[StrictStr] = None,
2927
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2928
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2929
+ ) -> str:
2930
+ """Synchronous version of get_uptime"""
2931
+ return async_to_sync(self._get_uptime_async)(
2932
+ type=type,
2933
+ _request_timeout=_request_timeout,
2934
+ _request_auth=_request_auth,
2935
+ _content_type=_content_type,
2936
+ _headers=_headers,
2937
+ _host_index=_host_index,
2938
+ )
2939
+
2940
+ @validate_call
2941
+ def _get_uptime_sync_with_http_info(
2942
+ self,
2943
+ type: Optional[StrictStr] = None,
2944
+ _request_timeout: Union[
2945
+ None,
2946
+ Annotated[StrictFloat, Field(gt=0)],
2947
+ Tuple[
2948
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2949
+ ],
2950
+ ] = None,
2951
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2952
+ _content_type: Optional[StrictStr] = None,
2953
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2954
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2955
+ ) -> ApiResponse[str]:
2956
+ """Synchronous version of get_uptime_with_http_info"""
2957
+ return async_to_sync(self._get_uptime_async_with_http_info)(
2958
+ type=type,
2959
+ _request_timeout=_request_timeout,
2960
+ _request_auth=_request_auth,
2961
+ _content_type=_content_type,
2962
+ _headers=_headers,
2963
+ _host_index=_host_index,
2964
+ )
2965
+
2966
+ @validate_call
2967
+ def _get_uptime_sync_without_preload_content(
2968
+ self,
2969
+ type: Optional[StrictStr] = None,
2970
+ _request_timeout: Union[
2971
+ None,
2972
+ Annotated[StrictFloat, Field(gt=0)],
2973
+ Tuple[
2974
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2975
+ ],
2976
+ ] = None,
2977
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2978
+ _content_type: Optional[StrictStr] = None,
2979
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2980
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2981
+ ) -> RESTResponseType:
2982
+ """Synchronous version of get_uptime_without_preload_content"""
2983
+ return async_to_sync(self._get_uptime_async_without_preload_content)(
2984
+ type=type,
2985
+ _request_timeout=_request_timeout,
2986
+ _request_auth=_request_auth,
2987
+ _content_type=_content_type,
2988
+ _headers=_headers,
2989
+ _host_index=_host_index,
2990
+ )
2991
+
2992
+ def _get_uptime_serialize(
2993
+ self,
2994
+ type,
2995
+ _request_auth,
2996
+ _content_type,
2997
+ _headers,
2998
+ _host_index,
2999
+ ) -> RequestSerialized:
3000
+
3001
+ _host = None
3002
+
3003
+ _collection_formats: Dict[str, str] = {}
3004
+
3005
+ _path_params: Dict[str, str] = {}
3006
+ _query_params: List[Tuple[str, str]] = []
3007
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3008
+ _form_params: List[Tuple[str, str]] = []
3009
+ _files: Dict[
3010
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3011
+ ] = {}
3012
+ _body_params: Optional[bytes] = None
3013
+
3014
+ # process the path parameters
3015
+ # process the query parameters
3016
+ if type is not None:
3017
+
3018
+ _query_params.append(("type", type))
3019
+
3020
+ # process the header parameters
3021
+ # process the form parameters
3022
+ # process the body parameter
3023
+
3024
+ # set the HTTP header `Accept`
3025
+ if "Accept" not in _header_params:
3026
+ _header_params["Accept"] = self.api_client.select_header_accept(
3027
+ ["application/json"]
3028
+ )
3029
+
3030
+ # authentication setting
3031
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
3032
+
3033
+ return self.api_client.param_serialize(
3034
+ method="GET",
3035
+ resource_path="/admin/uptime",
3036
+ path_params=_path_params,
3037
+ query_params=_query_params,
3038
+ header_params=_header_params,
3039
+ body=_body_params,
3040
+ post_params=_form_params,
3041
+ files=_files,
3042
+ auth_settings=_auth_settings,
3043
+ collection_formats=_collection_formats,
3044
+ _host=_host,
3045
+ _request_auth=_request_auth,
3046
+ )