cribl-control-plane 0.0.13__py3-none-any.whl → 0.0.15__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.
Potentially problematic release.
This version of cribl-control-plane might be problematic. Click here for more details.
- cribl_control_plane/_version.py +3 -3
- cribl_control_plane/models/__init__.py +186 -4
- cribl_control_plane/models/createpipelineop.py +24 -0
- cribl_control_plane/models/createroutesappendbyidop.py +45 -0
- cribl_control_plane/models/deletepipelinebyidop.py +37 -0
- cribl_control_plane/models/getpipelinebyidop.py +37 -0
- cribl_control_plane/models/getroutesbyidop.py +37 -0
- cribl_control_plane/models/inputsystemstate.py +4 -4
- cribl_control_plane/models/listpipelineop.py +24 -0
- cribl_control_plane/models/listroutesop.py +24 -0
- cribl_control_plane/models/pipeline.py +70 -0
- cribl_control_plane/models/pipelinefunctionconf.py +53 -0
- cribl_control_plane/models/routecloneconf.py +13 -0
- cribl_control_plane/models/routeconf.py +56 -0
- cribl_control_plane/models/routes.py +97 -0
- cribl_control_plane/models/routesroute.py +70 -0
- cribl_control_plane/models/routesroute_input.py +67 -0
- cribl_control_plane/models/updatepipelinebyidop.py +47 -0
- cribl_control_plane/models/updateroutesbyidop.py +48 -0
- cribl_control_plane/pipelines.py +903 -0
- cribl_control_plane/routes_sdk.py +769 -0
- cribl_control_plane/sdk.py +8 -0
- {cribl_control_plane-0.0.13.dist-info → cribl_control_plane-0.0.15.dist-info}/METADATA +17 -2
- {cribl_control_plane-0.0.13.dist-info → cribl_control_plane-0.0.15.dist-info}/RECORD +25 -7
- {cribl_control_plane-0.0.13.dist-info → cribl_control_plane-0.0.15.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,769 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from cribl_control_plane import errors, models, utils
|
|
5
|
+
from cribl_control_plane._hooks import HookContext
|
|
6
|
+
from cribl_control_plane.types import OptionalNullable, UNSET
|
|
7
|
+
from cribl_control_plane.utils import get_security_from_env
|
|
8
|
+
from cribl_control_plane.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class RoutesSDK(BaseSDK):
|
|
13
|
+
r"""Actions related to Routes"""
|
|
14
|
+
|
|
15
|
+
def list_routes(
|
|
16
|
+
self,
|
|
17
|
+
*,
|
|
18
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
19
|
+
server_url: Optional[str] = None,
|
|
20
|
+
timeout_ms: Optional[int] = None,
|
|
21
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
22
|
+
) -> models.ListRoutesResponse:
|
|
23
|
+
r"""Get a list of Routes objects
|
|
24
|
+
|
|
25
|
+
Get a list of Routes objects
|
|
26
|
+
|
|
27
|
+
:param retries: Override the default retry configuration for this method
|
|
28
|
+
:param server_url: Override the default server URL for this method
|
|
29
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
30
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
31
|
+
"""
|
|
32
|
+
base_url = None
|
|
33
|
+
url_variables = None
|
|
34
|
+
if timeout_ms is None:
|
|
35
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
36
|
+
|
|
37
|
+
if server_url is not None:
|
|
38
|
+
base_url = server_url
|
|
39
|
+
else:
|
|
40
|
+
base_url = self._get_url(base_url, url_variables)
|
|
41
|
+
req = self._build_request(
|
|
42
|
+
method="GET",
|
|
43
|
+
path="/routes",
|
|
44
|
+
base_url=base_url,
|
|
45
|
+
url_variables=url_variables,
|
|
46
|
+
request=None,
|
|
47
|
+
request_body_required=False,
|
|
48
|
+
request_has_path_params=False,
|
|
49
|
+
request_has_query_params=True,
|
|
50
|
+
user_agent_header="user-agent",
|
|
51
|
+
accept_header_value="application/json",
|
|
52
|
+
http_headers=http_headers,
|
|
53
|
+
security=self.sdk_configuration.security,
|
|
54
|
+
timeout_ms=timeout_ms,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
if retries == UNSET:
|
|
58
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
59
|
+
retries = self.sdk_configuration.retry_config
|
|
60
|
+
|
|
61
|
+
retry_config = None
|
|
62
|
+
if isinstance(retries, utils.RetryConfig):
|
|
63
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
64
|
+
|
|
65
|
+
http_res = self.do_request(
|
|
66
|
+
hook_ctx=HookContext(
|
|
67
|
+
config=self.sdk_configuration,
|
|
68
|
+
base_url=base_url or "",
|
|
69
|
+
operation_id="listRoutes",
|
|
70
|
+
oauth2_scopes=[],
|
|
71
|
+
security_source=get_security_from_env(
|
|
72
|
+
self.sdk_configuration.security, models.Security
|
|
73
|
+
),
|
|
74
|
+
),
|
|
75
|
+
request=req,
|
|
76
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
77
|
+
retry_config=retry_config,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
response_data: Any = None
|
|
81
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
82
|
+
return unmarshal_json_response(models.ListRoutesResponse, http_res)
|
|
83
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
84
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
85
|
+
raise errors.Error(response_data, http_res)
|
|
86
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
87
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
88
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
89
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
90
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
91
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
92
|
+
|
|
93
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
94
|
+
|
|
95
|
+
async def list_routes_async(
|
|
96
|
+
self,
|
|
97
|
+
*,
|
|
98
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
99
|
+
server_url: Optional[str] = None,
|
|
100
|
+
timeout_ms: Optional[int] = None,
|
|
101
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
102
|
+
) -> models.ListRoutesResponse:
|
|
103
|
+
r"""Get a list of Routes objects
|
|
104
|
+
|
|
105
|
+
Get a list of Routes objects
|
|
106
|
+
|
|
107
|
+
:param retries: Override the default retry configuration for this method
|
|
108
|
+
:param server_url: Override the default server URL for this method
|
|
109
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
110
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
111
|
+
"""
|
|
112
|
+
base_url = None
|
|
113
|
+
url_variables = None
|
|
114
|
+
if timeout_ms is None:
|
|
115
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
116
|
+
|
|
117
|
+
if server_url is not None:
|
|
118
|
+
base_url = server_url
|
|
119
|
+
else:
|
|
120
|
+
base_url = self._get_url(base_url, url_variables)
|
|
121
|
+
req = self._build_request_async(
|
|
122
|
+
method="GET",
|
|
123
|
+
path="/routes",
|
|
124
|
+
base_url=base_url,
|
|
125
|
+
url_variables=url_variables,
|
|
126
|
+
request=None,
|
|
127
|
+
request_body_required=False,
|
|
128
|
+
request_has_path_params=False,
|
|
129
|
+
request_has_query_params=True,
|
|
130
|
+
user_agent_header="user-agent",
|
|
131
|
+
accept_header_value="application/json",
|
|
132
|
+
http_headers=http_headers,
|
|
133
|
+
security=self.sdk_configuration.security,
|
|
134
|
+
timeout_ms=timeout_ms,
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
if retries == UNSET:
|
|
138
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
139
|
+
retries = self.sdk_configuration.retry_config
|
|
140
|
+
|
|
141
|
+
retry_config = None
|
|
142
|
+
if isinstance(retries, utils.RetryConfig):
|
|
143
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
144
|
+
|
|
145
|
+
http_res = await self.do_request_async(
|
|
146
|
+
hook_ctx=HookContext(
|
|
147
|
+
config=self.sdk_configuration,
|
|
148
|
+
base_url=base_url or "",
|
|
149
|
+
operation_id="listRoutes",
|
|
150
|
+
oauth2_scopes=[],
|
|
151
|
+
security_source=get_security_from_env(
|
|
152
|
+
self.sdk_configuration.security, models.Security
|
|
153
|
+
),
|
|
154
|
+
),
|
|
155
|
+
request=req,
|
|
156
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
157
|
+
retry_config=retry_config,
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
response_data: Any = None
|
|
161
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
162
|
+
return unmarshal_json_response(models.ListRoutesResponse, http_res)
|
|
163
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
164
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
165
|
+
raise errors.Error(response_data, http_res)
|
|
166
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
167
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
168
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
169
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
170
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
171
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
172
|
+
|
|
173
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
174
|
+
|
|
175
|
+
def get_routes_by_id(
|
|
176
|
+
self,
|
|
177
|
+
*,
|
|
178
|
+
id: str,
|
|
179
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
180
|
+
server_url: Optional[str] = None,
|
|
181
|
+
timeout_ms: Optional[int] = None,
|
|
182
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
183
|
+
) -> models.GetRoutesByIDResponse:
|
|
184
|
+
r"""Get Routes by ID
|
|
185
|
+
|
|
186
|
+
Get Routes by ID
|
|
187
|
+
|
|
188
|
+
:param id: Unique ID to GET
|
|
189
|
+
:param retries: Override the default retry configuration for this method
|
|
190
|
+
:param server_url: Override the default server URL for this method
|
|
191
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
192
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
193
|
+
"""
|
|
194
|
+
base_url = None
|
|
195
|
+
url_variables = None
|
|
196
|
+
if timeout_ms is None:
|
|
197
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
198
|
+
|
|
199
|
+
if server_url is not None:
|
|
200
|
+
base_url = server_url
|
|
201
|
+
else:
|
|
202
|
+
base_url = self._get_url(base_url, url_variables)
|
|
203
|
+
|
|
204
|
+
request = models.GetRoutesByIDRequest(
|
|
205
|
+
id=id,
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
req = self._build_request(
|
|
209
|
+
method="GET",
|
|
210
|
+
path="/routes/{id}",
|
|
211
|
+
base_url=base_url,
|
|
212
|
+
url_variables=url_variables,
|
|
213
|
+
request=request,
|
|
214
|
+
request_body_required=False,
|
|
215
|
+
request_has_path_params=True,
|
|
216
|
+
request_has_query_params=True,
|
|
217
|
+
user_agent_header="user-agent",
|
|
218
|
+
accept_header_value="application/json",
|
|
219
|
+
http_headers=http_headers,
|
|
220
|
+
security=self.sdk_configuration.security,
|
|
221
|
+
timeout_ms=timeout_ms,
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
if retries == UNSET:
|
|
225
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
226
|
+
retries = self.sdk_configuration.retry_config
|
|
227
|
+
|
|
228
|
+
retry_config = None
|
|
229
|
+
if isinstance(retries, utils.RetryConfig):
|
|
230
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
231
|
+
|
|
232
|
+
http_res = self.do_request(
|
|
233
|
+
hook_ctx=HookContext(
|
|
234
|
+
config=self.sdk_configuration,
|
|
235
|
+
base_url=base_url or "",
|
|
236
|
+
operation_id="getRoutesById",
|
|
237
|
+
oauth2_scopes=[],
|
|
238
|
+
security_source=get_security_from_env(
|
|
239
|
+
self.sdk_configuration.security, models.Security
|
|
240
|
+
),
|
|
241
|
+
),
|
|
242
|
+
request=req,
|
|
243
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
244
|
+
retry_config=retry_config,
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
response_data: Any = None
|
|
248
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
249
|
+
return unmarshal_json_response(models.GetRoutesByIDResponse, http_res)
|
|
250
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
251
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
252
|
+
raise errors.Error(response_data, http_res)
|
|
253
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
254
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
255
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
256
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
257
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
258
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
259
|
+
|
|
260
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
261
|
+
|
|
262
|
+
async def get_routes_by_id_async(
|
|
263
|
+
self,
|
|
264
|
+
*,
|
|
265
|
+
id: str,
|
|
266
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
267
|
+
server_url: Optional[str] = None,
|
|
268
|
+
timeout_ms: Optional[int] = None,
|
|
269
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
270
|
+
) -> models.GetRoutesByIDResponse:
|
|
271
|
+
r"""Get Routes by ID
|
|
272
|
+
|
|
273
|
+
Get Routes by ID
|
|
274
|
+
|
|
275
|
+
:param id: Unique ID to GET
|
|
276
|
+
:param retries: Override the default retry configuration for this method
|
|
277
|
+
:param server_url: Override the default server URL for this method
|
|
278
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
279
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
280
|
+
"""
|
|
281
|
+
base_url = None
|
|
282
|
+
url_variables = None
|
|
283
|
+
if timeout_ms is None:
|
|
284
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
285
|
+
|
|
286
|
+
if server_url is not None:
|
|
287
|
+
base_url = server_url
|
|
288
|
+
else:
|
|
289
|
+
base_url = self._get_url(base_url, url_variables)
|
|
290
|
+
|
|
291
|
+
request = models.GetRoutesByIDRequest(
|
|
292
|
+
id=id,
|
|
293
|
+
)
|
|
294
|
+
|
|
295
|
+
req = self._build_request_async(
|
|
296
|
+
method="GET",
|
|
297
|
+
path="/routes/{id}",
|
|
298
|
+
base_url=base_url,
|
|
299
|
+
url_variables=url_variables,
|
|
300
|
+
request=request,
|
|
301
|
+
request_body_required=False,
|
|
302
|
+
request_has_path_params=True,
|
|
303
|
+
request_has_query_params=True,
|
|
304
|
+
user_agent_header="user-agent",
|
|
305
|
+
accept_header_value="application/json",
|
|
306
|
+
http_headers=http_headers,
|
|
307
|
+
security=self.sdk_configuration.security,
|
|
308
|
+
timeout_ms=timeout_ms,
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
if retries == UNSET:
|
|
312
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
313
|
+
retries = self.sdk_configuration.retry_config
|
|
314
|
+
|
|
315
|
+
retry_config = None
|
|
316
|
+
if isinstance(retries, utils.RetryConfig):
|
|
317
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
318
|
+
|
|
319
|
+
http_res = await self.do_request_async(
|
|
320
|
+
hook_ctx=HookContext(
|
|
321
|
+
config=self.sdk_configuration,
|
|
322
|
+
base_url=base_url or "",
|
|
323
|
+
operation_id="getRoutesById",
|
|
324
|
+
oauth2_scopes=[],
|
|
325
|
+
security_source=get_security_from_env(
|
|
326
|
+
self.sdk_configuration.security, models.Security
|
|
327
|
+
),
|
|
328
|
+
),
|
|
329
|
+
request=req,
|
|
330
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
331
|
+
retry_config=retry_config,
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
response_data: Any = None
|
|
335
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
336
|
+
return unmarshal_json_response(models.GetRoutesByIDResponse, http_res)
|
|
337
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
338
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
339
|
+
raise errors.Error(response_data, http_res)
|
|
340
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
341
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
342
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
343
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
344
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
345
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
346
|
+
|
|
347
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
348
|
+
|
|
349
|
+
def update_routes_by_id(
|
|
350
|
+
self,
|
|
351
|
+
*,
|
|
352
|
+
id_param: str,
|
|
353
|
+
routes: Union[
|
|
354
|
+
List[models.RoutesRouteInput], List[models.RoutesRouteInputTypedDict]
|
|
355
|
+
],
|
|
356
|
+
id: Optional[str] = None,
|
|
357
|
+
groups: Optional[
|
|
358
|
+
Union[
|
|
359
|
+
Dict[str, models.RoutesGroups], Dict[str, models.RoutesGroupsTypedDict]
|
|
360
|
+
]
|
|
361
|
+
] = None,
|
|
362
|
+
comments: Optional[
|
|
363
|
+
Union[List[models.Comment], List[models.CommentTypedDict]]
|
|
364
|
+
] = None,
|
|
365
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
366
|
+
server_url: Optional[str] = None,
|
|
367
|
+
timeout_ms: Optional[int] = None,
|
|
368
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
369
|
+
) -> models.UpdateRoutesByIDResponse:
|
|
370
|
+
r"""Update Routes
|
|
371
|
+
|
|
372
|
+
Update Routes
|
|
373
|
+
|
|
374
|
+
:param id_param: Unique ID to PATCH
|
|
375
|
+
:param routes: Pipeline routing rules
|
|
376
|
+
:param id: Routes ID
|
|
377
|
+
:param groups:
|
|
378
|
+
:param comments: Comments
|
|
379
|
+
:param retries: Override the default retry configuration for this method
|
|
380
|
+
:param server_url: Override the default server URL for this method
|
|
381
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
382
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
383
|
+
"""
|
|
384
|
+
base_url = None
|
|
385
|
+
url_variables = None
|
|
386
|
+
if timeout_ms is None:
|
|
387
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
388
|
+
|
|
389
|
+
if server_url is not None:
|
|
390
|
+
base_url = server_url
|
|
391
|
+
else:
|
|
392
|
+
base_url = self._get_url(base_url, url_variables)
|
|
393
|
+
|
|
394
|
+
request = models.UpdateRoutesByIDRequest(
|
|
395
|
+
id_param=id_param,
|
|
396
|
+
routes=models.RoutesInput(
|
|
397
|
+
id=id,
|
|
398
|
+
routes=utils.get_pydantic_model(routes, List[models.RoutesRouteInput]),
|
|
399
|
+
groups=utils.get_pydantic_model(
|
|
400
|
+
groups, Optional[Dict[str, models.RoutesGroups]]
|
|
401
|
+
),
|
|
402
|
+
comments=utils.get_pydantic_model(
|
|
403
|
+
comments, Optional[List[models.Comment]]
|
|
404
|
+
),
|
|
405
|
+
),
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
req = self._build_request(
|
|
409
|
+
method="PATCH",
|
|
410
|
+
path="/routes/{id}",
|
|
411
|
+
base_url=base_url,
|
|
412
|
+
url_variables=url_variables,
|
|
413
|
+
request=request,
|
|
414
|
+
request_body_required=True,
|
|
415
|
+
request_has_path_params=True,
|
|
416
|
+
request_has_query_params=True,
|
|
417
|
+
user_agent_header="user-agent",
|
|
418
|
+
accept_header_value="application/json",
|
|
419
|
+
http_headers=http_headers,
|
|
420
|
+
security=self.sdk_configuration.security,
|
|
421
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
422
|
+
request.routes, False, False, "json", models.RoutesInput
|
|
423
|
+
),
|
|
424
|
+
timeout_ms=timeout_ms,
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
if retries == UNSET:
|
|
428
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
429
|
+
retries = self.sdk_configuration.retry_config
|
|
430
|
+
|
|
431
|
+
retry_config = None
|
|
432
|
+
if isinstance(retries, utils.RetryConfig):
|
|
433
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
434
|
+
|
|
435
|
+
http_res = self.do_request(
|
|
436
|
+
hook_ctx=HookContext(
|
|
437
|
+
config=self.sdk_configuration,
|
|
438
|
+
base_url=base_url or "",
|
|
439
|
+
operation_id="updateRoutesById",
|
|
440
|
+
oauth2_scopes=[],
|
|
441
|
+
security_source=get_security_from_env(
|
|
442
|
+
self.sdk_configuration.security, models.Security
|
|
443
|
+
),
|
|
444
|
+
),
|
|
445
|
+
request=req,
|
|
446
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
447
|
+
retry_config=retry_config,
|
|
448
|
+
)
|
|
449
|
+
|
|
450
|
+
response_data: Any = None
|
|
451
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
452
|
+
return unmarshal_json_response(models.UpdateRoutesByIDResponse, http_res)
|
|
453
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
454
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
455
|
+
raise errors.Error(response_data, http_res)
|
|
456
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
457
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
458
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
459
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
460
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
461
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
462
|
+
|
|
463
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
464
|
+
|
|
465
|
+
async def update_routes_by_id_async(
|
|
466
|
+
self,
|
|
467
|
+
*,
|
|
468
|
+
id_param: str,
|
|
469
|
+
routes: Union[
|
|
470
|
+
List[models.RoutesRouteInput], List[models.RoutesRouteInputTypedDict]
|
|
471
|
+
],
|
|
472
|
+
id: Optional[str] = None,
|
|
473
|
+
groups: Optional[
|
|
474
|
+
Union[
|
|
475
|
+
Dict[str, models.RoutesGroups], Dict[str, models.RoutesGroupsTypedDict]
|
|
476
|
+
]
|
|
477
|
+
] = None,
|
|
478
|
+
comments: Optional[
|
|
479
|
+
Union[List[models.Comment], List[models.CommentTypedDict]]
|
|
480
|
+
] = None,
|
|
481
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
482
|
+
server_url: Optional[str] = None,
|
|
483
|
+
timeout_ms: Optional[int] = None,
|
|
484
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
485
|
+
) -> models.UpdateRoutesByIDResponse:
|
|
486
|
+
r"""Update Routes
|
|
487
|
+
|
|
488
|
+
Update Routes
|
|
489
|
+
|
|
490
|
+
:param id_param: Unique ID to PATCH
|
|
491
|
+
:param routes: Pipeline routing rules
|
|
492
|
+
:param id: Routes ID
|
|
493
|
+
:param groups:
|
|
494
|
+
:param comments: Comments
|
|
495
|
+
:param retries: Override the default retry configuration for this method
|
|
496
|
+
:param server_url: Override the default server URL for this method
|
|
497
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
498
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
499
|
+
"""
|
|
500
|
+
base_url = None
|
|
501
|
+
url_variables = None
|
|
502
|
+
if timeout_ms is None:
|
|
503
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
504
|
+
|
|
505
|
+
if server_url is not None:
|
|
506
|
+
base_url = server_url
|
|
507
|
+
else:
|
|
508
|
+
base_url = self._get_url(base_url, url_variables)
|
|
509
|
+
|
|
510
|
+
request = models.UpdateRoutesByIDRequest(
|
|
511
|
+
id_param=id_param,
|
|
512
|
+
routes=models.RoutesInput(
|
|
513
|
+
id=id,
|
|
514
|
+
routes=utils.get_pydantic_model(routes, List[models.RoutesRouteInput]),
|
|
515
|
+
groups=utils.get_pydantic_model(
|
|
516
|
+
groups, Optional[Dict[str, models.RoutesGroups]]
|
|
517
|
+
),
|
|
518
|
+
comments=utils.get_pydantic_model(
|
|
519
|
+
comments, Optional[List[models.Comment]]
|
|
520
|
+
),
|
|
521
|
+
),
|
|
522
|
+
)
|
|
523
|
+
|
|
524
|
+
req = self._build_request_async(
|
|
525
|
+
method="PATCH",
|
|
526
|
+
path="/routes/{id}",
|
|
527
|
+
base_url=base_url,
|
|
528
|
+
url_variables=url_variables,
|
|
529
|
+
request=request,
|
|
530
|
+
request_body_required=True,
|
|
531
|
+
request_has_path_params=True,
|
|
532
|
+
request_has_query_params=True,
|
|
533
|
+
user_agent_header="user-agent",
|
|
534
|
+
accept_header_value="application/json",
|
|
535
|
+
http_headers=http_headers,
|
|
536
|
+
security=self.sdk_configuration.security,
|
|
537
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
538
|
+
request.routes, False, False, "json", models.RoutesInput
|
|
539
|
+
),
|
|
540
|
+
timeout_ms=timeout_ms,
|
|
541
|
+
)
|
|
542
|
+
|
|
543
|
+
if retries == UNSET:
|
|
544
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
545
|
+
retries = self.sdk_configuration.retry_config
|
|
546
|
+
|
|
547
|
+
retry_config = None
|
|
548
|
+
if isinstance(retries, utils.RetryConfig):
|
|
549
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
550
|
+
|
|
551
|
+
http_res = await self.do_request_async(
|
|
552
|
+
hook_ctx=HookContext(
|
|
553
|
+
config=self.sdk_configuration,
|
|
554
|
+
base_url=base_url or "",
|
|
555
|
+
operation_id="updateRoutesById",
|
|
556
|
+
oauth2_scopes=[],
|
|
557
|
+
security_source=get_security_from_env(
|
|
558
|
+
self.sdk_configuration.security, models.Security
|
|
559
|
+
),
|
|
560
|
+
),
|
|
561
|
+
request=req,
|
|
562
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
563
|
+
retry_config=retry_config,
|
|
564
|
+
)
|
|
565
|
+
|
|
566
|
+
response_data: Any = None
|
|
567
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
568
|
+
return unmarshal_json_response(models.UpdateRoutesByIDResponse, http_res)
|
|
569
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
570
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
571
|
+
raise errors.Error(response_data, http_res)
|
|
572
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
573
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
574
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
575
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
576
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
577
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
578
|
+
|
|
579
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
580
|
+
|
|
581
|
+
def create_routes_append_by_id(
|
|
582
|
+
self,
|
|
583
|
+
*,
|
|
584
|
+
id: str,
|
|
585
|
+
request_body: Union[List[models.RouteConf], List[models.RouteConfTypedDict]],
|
|
586
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
587
|
+
server_url: Optional[str] = None,
|
|
588
|
+
timeout_ms: Optional[int] = None,
|
|
589
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
590
|
+
) -> models.CreateRoutesAppendByIDResponse:
|
|
591
|
+
r"""Appends routes to the end of the routing table
|
|
592
|
+
|
|
593
|
+
Appends routes to the end of the routing table
|
|
594
|
+
|
|
595
|
+
:param id: the route table to be appended to - currently default is the only supported value
|
|
596
|
+
:param request_body: RouteDefinitions object
|
|
597
|
+
:param retries: Override the default retry configuration for this method
|
|
598
|
+
:param server_url: Override the default server URL for this method
|
|
599
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
600
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
601
|
+
"""
|
|
602
|
+
base_url = None
|
|
603
|
+
url_variables = None
|
|
604
|
+
if timeout_ms is None:
|
|
605
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
606
|
+
|
|
607
|
+
if server_url is not None:
|
|
608
|
+
base_url = server_url
|
|
609
|
+
else:
|
|
610
|
+
base_url = self._get_url(base_url, url_variables)
|
|
611
|
+
|
|
612
|
+
request = models.CreateRoutesAppendByIDRequest(
|
|
613
|
+
id=id,
|
|
614
|
+
request_body=utils.get_pydantic_model(request_body, List[models.RouteConf]),
|
|
615
|
+
)
|
|
616
|
+
|
|
617
|
+
req = self._build_request(
|
|
618
|
+
method="POST",
|
|
619
|
+
path="/routes/{id}/append",
|
|
620
|
+
base_url=base_url,
|
|
621
|
+
url_variables=url_variables,
|
|
622
|
+
request=request,
|
|
623
|
+
request_body_required=True,
|
|
624
|
+
request_has_path_params=True,
|
|
625
|
+
request_has_query_params=True,
|
|
626
|
+
user_agent_header="user-agent",
|
|
627
|
+
accept_header_value="application/json",
|
|
628
|
+
http_headers=http_headers,
|
|
629
|
+
security=self.sdk_configuration.security,
|
|
630
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
631
|
+
request.request_body, False, False, "json", List[models.RouteConf]
|
|
632
|
+
),
|
|
633
|
+
timeout_ms=timeout_ms,
|
|
634
|
+
)
|
|
635
|
+
|
|
636
|
+
if retries == UNSET:
|
|
637
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
638
|
+
retries = self.sdk_configuration.retry_config
|
|
639
|
+
|
|
640
|
+
retry_config = None
|
|
641
|
+
if isinstance(retries, utils.RetryConfig):
|
|
642
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
643
|
+
|
|
644
|
+
http_res = self.do_request(
|
|
645
|
+
hook_ctx=HookContext(
|
|
646
|
+
config=self.sdk_configuration,
|
|
647
|
+
base_url=base_url or "",
|
|
648
|
+
operation_id="createRoutesAppendById",
|
|
649
|
+
oauth2_scopes=[],
|
|
650
|
+
security_source=get_security_from_env(
|
|
651
|
+
self.sdk_configuration.security, models.Security
|
|
652
|
+
),
|
|
653
|
+
),
|
|
654
|
+
request=req,
|
|
655
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
656
|
+
retry_config=retry_config,
|
|
657
|
+
)
|
|
658
|
+
|
|
659
|
+
response_data: Any = None
|
|
660
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
661
|
+
return unmarshal_json_response(
|
|
662
|
+
models.CreateRoutesAppendByIDResponse, http_res
|
|
663
|
+
)
|
|
664
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
665
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
666
|
+
raise errors.Error(response_data, http_res)
|
|
667
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
668
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
669
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
670
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
671
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
672
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
673
|
+
|
|
674
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
675
|
+
|
|
676
|
+
async def create_routes_append_by_id_async(
|
|
677
|
+
self,
|
|
678
|
+
*,
|
|
679
|
+
id: str,
|
|
680
|
+
request_body: Union[List[models.RouteConf], List[models.RouteConfTypedDict]],
|
|
681
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
682
|
+
server_url: Optional[str] = None,
|
|
683
|
+
timeout_ms: Optional[int] = None,
|
|
684
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
685
|
+
) -> models.CreateRoutesAppendByIDResponse:
|
|
686
|
+
r"""Appends routes to the end of the routing table
|
|
687
|
+
|
|
688
|
+
Appends routes to the end of the routing table
|
|
689
|
+
|
|
690
|
+
:param id: the route table to be appended to - currently default is the only supported value
|
|
691
|
+
:param request_body: RouteDefinitions object
|
|
692
|
+
:param retries: Override the default retry configuration for this method
|
|
693
|
+
:param server_url: Override the default server URL for this method
|
|
694
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
695
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
696
|
+
"""
|
|
697
|
+
base_url = None
|
|
698
|
+
url_variables = None
|
|
699
|
+
if timeout_ms is None:
|
|
700
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
701
|
+
|
|
702
|
+
if server_url is not None:
|
|
703
|
+
base_url = server_url
|
|
704
|
+
else:
|
|
705
|
+
base_url = self._get_url(base_url, url_variables)
|
|
706
|
+
|
|
707
|
+
request = models.CreateRoutesAppendByIDRequest(
|
|
708
|
+
id=id,
|
|
709
|
+
request_body=utils.get_pydantic_model(request_body, List[models.RouteConf]),
|
|
710
|
+
)
|
|
711
|
+
|
|
712
|
+
req = self._build_request_async(
|
|
713
|
+
method="POST",
|
|
714
|
+
path="/routes/{id}/append",
|
|
715
|
+
base_url=base_url,
|
|
716
|
+
url_variables=url_variables,
|
|
717
|
+
request=request,
|
|
718
|
+
request_body_required=True,
|
|
719
|
+
request_has_path_params=True,
|
|
720
|
+
request_has_query_params=True,
|
|
721
|
+
user_agent_header="user-agent",
|
|
722
|
+
accept_header_value="application/json",
|
|
723
|
+
http_headers=http_headers,
|
|
724
|
+
security=self.sdk_configuration.security,
|
|
725
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
726
|
+
request.request_body, False, False, "json", List[models.RouteConf]
|
|
727
|
+
),
|
|
728
|
+
timeout_ms=timeout_ms,
|
|
729
|
+
)
|
|
730
|
+
|
|
731
|
+
if retries == UNSET:
|
|
732
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
733
|
+
retries = self.sdk_configuration.retry_config
|
|
734
|
+
|
|
735
|
+
retry_config = None
|
|
736
|
+
if isinstance(retries, utils.RetryConfig):
|
|
737
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
738
|
+
|
|
739
|
+
http_res = await self.do_request_async(
|
|
740
|
+
hook_ctx=HookContext(
|
|
741
|
+
config=self.sdk_configuration,
|
|
742
|
+
base_url=base_url or "",
|
|
743
|
+
operation_id="createRoutesAppendById",
|
|
744
|
+
oauth2_scopes=[],
|
|
745
|
+
security_source=get_security_from_env(
|
|
746
|
+
self.sdk_configuration.security, models.Security
|
|
747
|
+
),
|
|
748
|
+
),
|
|
749
|
+
request=req,
|
|
750
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
751
|
+
retry_config=retry_config,
|
|
752
|
+
)
|
|
753
|
+
|
|
754
|
+
response_data: Any = None
|
|
755
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
756
|
+
return unmarshal_json_response(
|
|
757
|
+
models.CreateRoutesAppendByIDResponse, http_res
|
|
758
|
+
)
|
|
759
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
760
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
761
|
+
raise errors.Error(response_data, http_res)
|
|
762
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
763
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
764
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
765
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
766
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
767
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
768
|
+
|
|
769
|
+
raise errors.APIError("Unexpected response received", http_res)
|