stackit-loadbalancer 0.0.1a1__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 (46) hide show
  1. stackit/loadbalancer/__init__.py +94 -0
  2. stackit/loadbalancer/api/__init__.py +4 -0
  3. stackit/loadbalancer/api/default_api.py +4224 -0
  4. stackit/loadbalancer/api_client.py +626 -0
  5. stackit/loadbalancer/api_response.py +23 -0
  6. stackit/loadbalancer/configuration.py +111 -0
  7. stackit/loadbalancer/exceptions.py +198 -0
  8. stackit/loadbalancer/models/__init__.py +75 -0
  9. stackit/loadbalancer/models/active_health_check.py +142 -0
  10. stackit/loadbalancer/models/create_credentials_payload.py +104 -0
  11. stackit/loadbalancer/models/create_credentials_response.py +92 -0
  12. stackit/loadbalancer/models/create_load_balancer_payload.py +231 -0
  13. stackit/loadbalancer/models/credentials_response.py +106 -0
  14. stackit/loadbalancer/models/get_credentials_response.py +92 -0
  15. stackit/loadbalancer/models/get_quota_response.py +106 -0
  16. stackit/loadbalancer/models/get_service_status_response.py +103 -0
  17. stackit/loadbalancer/models/google_protobuf_any.py +97 -0
  18. stackit/loadbalancer/models/list_credentials_response.py +98 -0
  19. stackit/loadbalancer/models/list_load_balancers_response.py +115 -0
  20. stackit/loadbalancer/models/list_plans_response.py +98 -0
  21. stackit/loadbalancer/models/listener.py +162 -0
  22. stackit/loadbalancer/models/load_balancer.py +231 -0
  23. stackit/loadbalancer/models/load_balancer_error.py +113 -0
  24. stackit/loadbalancer/models/load_balancer_options.py +116 -0
  25. stackit/loadbalancer/models/loadbalancer_option_access_control.py +85 -0
  26. stackit/loadbalancer/models/loadbalancer_option_logs.py +90 -0
  27. stackit/loadbalancer/models/loadbalancer_option_metrics.py +90 -0
  28. stackit/loadbalancer/models/loadbalancer_option_observability.py +100 -0
  29. stackit/loadbalancer/models/network.py +112 -0
  30. stackit/loadbalancer/models/options_tcp.py +96 -0
  31. stackit/loadbalancer/models/options_udp.py +96 -0
  32. stackit/loadbalancer/models/plan_details.py +97 -0
  33. stackit/loadbalancer/models/server_name_indicator.py +81 -0
  34. stackit/loadbalancer/models/session_persistence.py +85 -0
  35. stackit/loadbalancer/models/status.py +111 -0
  36. stackit/loadbalancer/models/target.py +97 -0
  37. stackit/loadbalancer/models/target_pool.py +137 -0
  38. stackit/loadbalancer/models/update_credentials_payload.py +104 -0
  39. stackit/loadbalancer/models/update_credentials_response.py +92 -0
  40. stackit/loadbalancer/models/update_load_balancer_payload.py +231 -0
  41. stackit/loadbalancer/models/update_target_pool_payload.py +137 -0
  42. stackit/loadbalancer/py.typed +0 -0
  43. stackit/loadbalancer/rest.py +148 -0
  44. stackit_loadbalancer-0.0.1a1.dist-info/METADATA +46 -0
  45. stackit_loadbalancer-0.0.1a1.dist-info/RECORD +46 -0
  46. stackit_loadbalancer-0.0.1a1.dist-info/WHEEL +4 -0
@@ -0,0 +1,4224 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Load Balancer API
5
+
6
+ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.
7
+
8
+ The version of the OpenAPI document: 1.7.2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501 docstring might be too long
13
+
14
+ import warnings
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+
17
+ from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
18
+ from stackit.core.configuration import Configuration
19
+ from typing_extensions import Annotated
20
+
21
+ from stackit.loadbalancer.api_client import ApiClient, RequestSerialized
22
+ from stackit.loadbalancer.api_response import ApiResponse
23
+ from stackit.loadbalancer.models.create_credentials_payload import (
24
+ CreateCredentialsPayload,
25
+ )
26
+ from stackit.loadbalancer.models.create_credentials_response import (
27
+ CreateCredentialsResponse,
28
+ )
29
+ from stackit.loadbalancer.models.create_load_balancer_payload import (
30
+ CreateLoadBalancerPayload,
31
+ )
32
+ from stackit.loadbalancer.models.get_credentials_response import GetCredentialsResponse
33
+ from stackit.loadbalancer.models.get_quota_response import GetQuotaResponse
34
+ from stackit.loadbalancer.models.get_service_status_response import (
35
+ GetServiceStatusResponse,
36
+ )
37
+ from stackit.loadbalancer.models.list_credentials_response import (
38
+ ListCredentialsResponse,
39
+ )
40
+ from stackit.loadbalancer.models.list_load_balancers_response import (
41
+ ListLoadBalancersResponse,
42
+ )
43
+ from stackit.loadbalancer.models.list_plans_response import ListPlansResponse
44
+ from stackit.loadbalancer.models.load_balancer import LoadBalancer
45
+ from stackit.loadbalancer.models.target_pool import TargetPool
46
+ from stackit.loadbalancer.models.update_credentials_payload import (
47
+ UpdateCredentialsPayload,
48
+ )
49
+ from stackit.loadbalancer.models.update_credentials_response import (
50
+ UpdateCredentialsResponse,
51
+ )
52
+ from stackit.loadbalancer.models.update_load_balancer_payload import (
53
+ UpdateLoadBalancerPayload,
54
+ )
55
+ from stackit.loadbalancer.models.update_target_pool_payload import (
56
+ UpdateTargetPoolPayload,
57
+ )
58
+ from stackit.loadbalancer.rest import RESTResponseType
59
+
60
+
61
+ class DefaultApi:
62
+ """NOTE: This class is auto generated by OpenAPI Generator
63
+ Ref: https://openapi-generator.tech
64
+
65
+ Do not edit the class manually.
66
+ """
67
+
68
+ def __init__(self, configuration: Configuration = None) -> None:
69
+ if configuration is None:
70
+ configuration = Configuration()
71
+ self.configuration = configuration
72
+ self.api_client = ApiClient(self.configuration)
73
+
74
+ @validate_call
75
+ def create_credentials(
76
+ self,
77
+ project_id: StrictStr,
78
+ x_request_id: StrictStr,
79
+ create_credentials_payload: CreateCredentialsPayload,
80
+ _request_timeout: Union[
81
+ None,
82
+ Annotated[StrictFloat, Field(gt=0)],
83
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
84
+ ] = None,
85
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
86
+ _content_type: Optional[StrictStr] = None,
87
+ _headers: Optional[Dict[StrictStr, Any]] = None,
88
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
89
+ ) -> CreateCredentialsResponse:
90
+ """Create credentials for observability of the Load Balancer
91
+
92
+ Create credentials can be used to store existing credentials, which are valid to be used for Load Balancer Observability. This means, e.g. when using ARGUS, that credentials first must be created for that ARGUS instance (by using their API) and then can be provided to the Load Balancer by storing them with this endpoint.
93
+
94
+ :param project_id: (required)
95
+ :type project_id: str
96
+ :param x_request_id: (required)
97
+ :type x_request_id: str
98
+ :param create_credentials_payload: (required)
99
+ :type create_credentials_payload: CreateCredentialsPayload
100
+ :param _request_timeout: timeout setting for this request. If one
101
+ number provided, it will be total request
102
+ timeout. It can also be a pair (tuple) of
103
+ (connection, read) timeouts.
104
+ :type _request_timeout: int, tuple(int, int), optional
105
+ :param _request_auth: set to override the auth_settings for an a single
106
+ request; this effectively ignores the
107
+ authentication in the spec for a single request.
108
+ :type _request_auth: dict, optional
109
+ :param _content_type: force content-type for the request.
110
+ :type _content_type: str, Optional
111
+ :param _headers: set to override the headers for a single
112
+ request; this effectively ignores the headers
113
+ in the spec for a single request.
114
+ :type _headers: dict, optional
115
+ :param _host_index: set to override the host_index for a single
116
+ request; this effectively ignores the host_index
117
+ in the spec for a single request.
118
+ :type _host_index: int, optional
119
+ :return: Returns the result object.
120
+ """ # noqa: E501 docstring might be too long
121
+
122
+ _param = self._create_credentials_serialize(
123
+ project_id=project_id,
124
+ x_request_id=x_request_id,
125
+ create_credentials_payload=create_credentials_payload,
126
+ _request_auth=_request_auth,
127
+ _content_type=_content_type,
128
+ _headers=_headers,
129
+ _host_index=_host_index,
130
+ )
131
+
132
+ _response_types_map: Dict[str, Optional[str]] = {
133
+ "200": "CreateCredentialsResponse",
134
+ "400": None,
135
+ "401": "str",
136
+ "403": None,
137
+ "500": None,
138
+ }
139
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
140
+ response_data.read()
141
+ return self.api_client.response_deserialize(
142
+ response_data=response_data,
143
+ response_types_map=_response_types_map,
144
+ ).data
145
+
146
+ @validate_call
147
+ def create_credentials_with_http_info(
148
+ self,
149
+ project_id: StrictStr,
150
+ x_request_id: StrictStr,
151
+ create_credentials_payload: CreateCredentialsPayload,
152
+ _request_timeout: Union[
153
+ None,
154
+ Annotated[StrictFloat, Field(gt=0)],
155
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
156
+ ] = None,
157
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
158
+ _content_type: Optional[StrictStr] = None,
159
+ _headers: Optional[Dict[StrictStr, Any]] = None,
160
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
161
+ ) -> ApiResponse[CreateCredentialsResponse]:
162
+ """Create credentials for observability of the Load Balancer
163
+
164
+ Create credentials can be used to store existing credentials, which are valid to be used for Load Balancer Observability. This means, e.g. when using ARGUS, that credentials first must be created for that ARGUS instance (by using their API) and then can be provided to the Load Balancer by storing them with this endpoint.
165
+
166
+ :param project_id: (required)
167
+ :type project_id: str
168
+ :param x_request_id: (required)
169
+ :type x_request_id: str
170
+ :param create_credentials_payload: (required)
171
+ :type create_credentials_payload: CreateCredentialsPayload
172
+ :param _request_timeout: timeout setting for this request. If one
173
+ number provided, it will be total request
174
+ timeout. It can also be a pair (tuple) of
175
+ (connection, read) timeouts.
176
+ :type _request_timeout: int, tuple(int, int), optional
177
+ :param _request_auth: set to override the auth_settings for an a single
178
+ request; this effectively ignores the
179
+ authentication in the spec for a single request.
180
+ :type _request_auth: dict, optional
181
+ :param _content_type: force content-type for the request.
182
+ :type _content_type: str, Optional
183
+ :param _headers: set to override the headers for a single
184
+ request; this effectively ignores the headers
185
+ in the spec for a single request.
186
+ :type _headers: dict, optional
187
+ :param _host_index: set to override the host_index for a single
188
+ request; this effectively ignores the host_index
189
+ in the spec for a single request.
190
+ :type _host_index: int, optional
191
+ :return: Returns the result object.
192
+ """ # noqa: E501 docstring might be too long
193
+
194
+ _param = self._create_credentials_serialize(
195
+ project_id=project_id,
196
+ x_request_id=x_request_id,
197
+ create_credentials_payload=create_credentials_payload,
198
+ _request_auth=_request_auth,
199
+ _content_type=_content_type,
200
+ _headers=_headers,
201
+ _host_index=_host_index,
202
+ )
203
+
204
+ _response_types_map: Dict[str, Optional[str]] = {
205
+ "200": "CreateCredentialsResponse",
206
+ "400": None,
207
+ "401": "str",
208
+ "403": None,
209
+ "500": None,
210
+ }
211
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
212
+ response_data.read()
213
+ return self.api_client.response_deserialize(
214
+ response_data=response_data,
215
+ response_types_map=_response_types_map,
216
+ )
217
+
218
+ @validate_call
219
+ def create_credentials_without_preload_content(
220
+ self,
221
+ project_id: StrictStr,
222
+ x_request_id: StrictStr,
223
+ create_credentials_payload: CreateCredentialsPayload,
224
+ _request_timeout: Union[
225
+ None,
226
+ Annotated[StrictFloat, Field(gt=0)],
227
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
228
+ ] = None,
229
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
230
+ _content_type: Optional[StrictStr] = None,
231
+ _headers: Optional[Dict[StrictStr, Any]] = None,
232
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
233
+ ) -> RESTResponseType:
234
+ """Create credentials for observability of the Load Balancer
235
+
236
+ Create credentials can be used to store existing credentials, which are valid to be used for Load Balancer Observability. This means, e.g. when using ARGUS, that credentials first must be created for that ARGUS instance (by using their API) and then can be provided to the Load Balancer by storing them with this endpoint.
237
+
238
+ :param project_id: (required)
239
+ :type project_id: str
240
+ :param x_request_id: (required)
241
+ :type x_request_id: str
242
+ :param create_credentials_payload: (required)
243
+ :type create_credentials_payload: CreateCredentialsPayload
244
+ :param _request_timeout: timeout setting for this request. If one
245
+ number provided, it will be total request
246
+ timeout. It can also be a pair (tuple) of
247
+ (connection, read) timeouts.
248
+ :type _request_timeout: int, tuple(int, int), optional
249
+ :param _request_auth: set to override the auth_settings for an a single
250
+ request; this effectively ignores the
251
+ authentication in the spec for a single request.
252
+ :type _request_auth: dict, optional
253
+ :param _content_type: force content-type for the request.
254
+ :type _content_type: str, Optional
255
+ :param _headers: set to override the headers for a single
256
+ request; this effectively ignores the headers
257
+ in the spec for a single request.
258
+ :type _headers: dict, optional
259
+ :param _host_index: set to override the host_index for a single
260
+ request; this effectively ignores the host_index
261
+ in the spec for a single request.
262
+ :type _host_index: int, optional
263
+ :return: Returns the result object.
264
+ """ # noqa: E501 docstring might be too long
265
+
266
+ _param = self._create_credentials_serialize(
267
+ project_id=project_id,
268
+ x_request_id=x_request_id,
269
+ create_credentials_payload=create_credentials_payload,
270
+ _request_auth=_request_auth,
271
+ _content_type=_content_type,
272
+ _headers=_headers,
273
+ _host_index=_host_index,
274
+ )
275
+
276
+ _response_types_map: Dict[str, Optional[str]] = {
277
+ "200": "CreateCredentialsResponse",
278
+ "400": None,
279
+ "401": "str",
280
+ "403": None,
281
+ "500": None,
282
+ }
283
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
284
+ return response_data.response
285
+
286
+ def _create_credentials_serialize(
287
+ self,
288
+ project_id,
289
+ x_request_id,
290
+ create_credentials_payload,
291
+ _request_auth,
292
+ _content_type,
293
+ _headers,
294
+ _host_index,
295
+ ) -> RequestSerialized:
296
+
297
+ _host = None
298
+
299
+ _collection_formats: Dict[str, str] = {}
300
+
301
+ _path_params: Dict[str, str] = {}
302
+ _query_params: List[Tuple[str, str]] = []
303
+ _header_params: Dict[str, Optional[str]] = _headers or {}
304
+ _form_params: List[Tuple[str, str]] = []
305
+ _files: Dict[str, Union[str, bytes]] = {}
306
+ _body_params: Optional[bytes] = None
307
+
308
+ # process the path parameters
309
+ if project_id is not None:
310
+ _path_params["projectId"] = project_id
311
+ # process the query parameters
312
+ # process the header parameters
313
+ if x_request_id is not None:
314
+ _header_params["X-Request-ID"] = x_request_id
315
+ # process the form parameters
316
+ # process the body parameter
317
+ if create_credentials_payload is not None:
318
+ _body_params = create_credentials_payload
319
+
320
+ # set the HTTP header `Accept`
321
+ if "Accept" not in _header_params:
322
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
323
+
324
+ # set the HTTP header `Content-Type`
325
+ if _content_type:
326
+ _header_params["Content-Type"] = _content_type
327
+ else:
328
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
329
+ if _default_content_type is not None:
330
+ _header_params["Content-Type"] = _default_content_type
331
+
332
+ # authentication setting
333
+ _auth_settings: List[str] = []
334
+
335
+ return self.api_client.param_serialize(
336
+ method="POST",
337
+ resource_path="/v1/projects/{projectId}/credentials",
338
+ path_params=_path_params,
339
+ query_params=_query_params,
340
+ header_params=_header_params,
341
+ body=_body_params,
342
+ post_params=_form_params,
343
+ files=_files,
344
+ auth_settings=_auth_settings,
345
+ collection_formats=_collection_formats,
346
+ _host=_host,
347
+ _request_auth=_request_auth,
348
+ )
349
+
350
+ @validate_call
351
+ def create_load_balancer(
352
+ self,
353
+ project_id: StrictStr,
354
+ x_request_id: StrictStr,
355
+ create_load_balancer_payload: CreateLoadBalancerPayload,
356
+ _request_timeout: Union[
357
+ None,
358
+ Annotated[StrictFloat, Field(gt=0)],
359
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
360
+ ] = None,
361
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
362
+ _content_type: Optional[StrictStr] = None,
363
+ _headers: Optional[Dict[StrictStr, Any]] = None,
364
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
365
+ ) -> LoadBalancer:
366
+ """Create a load balancer in a project
367
+
368
+ Create Load Balancer will create a load balancer. The default load balancing algorithm is round robin unless useSourceIpAddress in session persistence is enabled for a target pool then it is Maglev.
369
+
370
+ :param project_id: (required)
371
+ :type project_id: str
372
+ :param x_request_id: (required)
373
+ :type x_request_id: str
374
+ :param create_load_balancer_payload: (required)
375
+ :type create_load_balancer_payload: CreateLoadBalancerPayload
376
+ :param _request_timeout: timeout setting for this request. If one
377
+ number provided, it will be total request
378
+ timeout. It can also be a pair (tuple) of
379
+ (connection, read) timeouts.
380
+ :type _request_timeout: int, tuple(int, int), optional
381
+ :param _request_auth: set to override the auth_settings for an a single
382
+ request; this effectively ignores the
383
+ authentication in the spec for a single request.
384
+ :type _request_auth: dict, optional
385
+ :param _content_type: force content-type for the request.
386
+ :type _content_type: str, Optional
387
+ :param _headers: set to override the headers for a single
388
+ request; this effectively ignores the headers
389
+ in the spec for a single request.
390
+ :type _headers: dict, optional
391
+ :param _host_index: set to override the host_index for a single
392
+ request; this effectively ignores the host_index
393
+ in the spec for a single request.
394
+ :type _host_index: int, optional
395
+ :return: Returns the result object.
396
+ """ # noqa: E501 docstring might be too long
397
+
398
+ _param = self._create_load_balancer_serialize(
399
+ project_id=project_id,
400
+ x_request_id=x_request_id,
401
+ create_load_balancer_payload=create_load_balancer_payload,
402
+ _request_auth=_request_auth,
403
+ _content_type=_content_type,
404
+ _headers=_headers,
405
+ _host_index=_host_index,
406
+ )
407
+
408
+ _response_types_map: Dict[str, Optional[str]] = {
409
+ "200": "LoadBalancer",
410
+ "400": None,
411
+ "401": "str",
412
+ "403": None,
413
+ "409": None,
414
+ "500": None,
415
+ }
416
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
417
+ response_data.read()
418
+ return self.api_client.response_deserialize(
419
+ response_data=response_data,
420
+ response_types_map=_response_types_map,
421
+ ).data
422
+
423
+ @validate_call
424
+ def create_load_balancer_with_http_info(
425
+ self,
426
+ project_id: StrictStr,
427
+ x_request_id: StrictStr,
428
+ create_load_balancer_payload: CreateLoadBalancerPayload,
429
+ _request_timeout: Union[
430
+ None,
431
+ Annotated[StrictFloat, Field(gt=0)],
432
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
433
+ ] = None,
434
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
435
+ _content_type: Optional[StrictStr] = None,
436
+ _headers: Optional[Dict[StrictStr, Any]] = None,
437
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
438
+ ) -> ApiResponse[LoadBalancer]:
439
+ """Create a load balancer in a project
440
+
441
+ Create Load Balancer will create a load balancer. The default load balancing algorithm is round robin unless useSourceIpAddress in session persistence is enabled for a target pool then it is Maglev.
442
+
443
+ :param project_id: (required)
444
+ :type project_id: str
445
+ :param x_request_id: (required)
446
+ :type x_request_id: str
447
+ :param create_load_balancer_payload: (required)
448
+ :type create_load_balancer_payload: CreateLoadBalancerPayload
449
+ :param _request_timeout: timeout setting for this request. If one
450
+ number provided, it will be total request
451
+ timeout. It can also be a pair (tuple) of
452
+ (connection, read) timeouts.
453
+ :type _request_timeout: int, tuple(int, int), optional
454
+ :param _request_auth: set to override the auth_settings for an a single
455
+ request; this effectively ignores the
456
+ authentication in the spec for a single request.
457
+ :type _request_auth: dict, optional
458
+ :param _content_type: force content-type for the request.
459
+ :type _content_type: str, Optional
460
+ :param _headers: set to override the headers for a single
461
+ request; this effectively ignores the headers
462
+ in the spec for a single request.
463
+ :type _headers: dict, optional
464
+ :param _host_index: set to override the host_index for a single
465
+ request; this effectively ignores the host_index
466
+ in the spec for a single request.
467
+ :type _host_index: int, optional
468
+ :return: Returns the result object.
469
+ """ # noqa: E501 docstring might be too long
470
+
471
+ _param = self._create_load_balancer_serialize(
472
+ project_id=project_id,
473
+ x_request_id=x_request_id,
474
+ create_load_balancer_payload=create_load_balancer_payload,
475
+ _request_auth=_request_auth,
476
+ _content_type=_content_type,
477
+ _headers=_headers,
478
+ _host_index=_host_index,
479
+ )
480
+
481
+ _response_types_map: Dict[str, Optional[str]] = {
482
+ "200": "LoadBalancer",
483
+ "400": None,
484
+ "401": "str",
485
+ "403": None,
486
+ "409": None,
487
+ "500": None,
488
+ }
489
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
490
+ response_data.read()
491
+ return self.api_client.response_deserialize(
492
+ response_data=response_data,
493
+ response_types_map=_response_types_map,
494
+ )
495
+
496
+ @validate_call
497
+ def create_load_balancer_without_preload_content(
498
+ self,
499
+ project_id: StrictStr,
500
+ x_request_id: StrictStr,
501
+ create_load_balancer_payload: CreateLoadBalancerPayload,
502
+ _request_timeout: Union[
503
+ None,
504
+ Annotated[StrictFloat, Field(gt=0)],
505
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
506
+ ] = None,
507
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
508
+ _content_type: Optional[StrictStr] = None,
509
+ _headers: Optional[Dict[StrictStr, Any]] = None,
510
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
511
+ ) -> RESTResponseType:
512
+ """Create a load balancer in a project
513
+
514
+ Create Load Balancer will create a load balancer. The default load balancing algorithm is round robin unless useSourceIpAddress in session persistence is enabled for a target pool then it is Maglev.
515
+
516
+ :param project_id: (required)
517
+ :type project_id: str
518
+ :param x_request_id: (required)
519
+ :type x_request_id: str
520
+ :param create_load_balancer_payload: (required)
521
+ :type create_load_balancer_payload: CreateLoadBalancerPayload
522
+ :param _request_timeout: timeout setting for this request. If one
523
+ number provided, it will be total request
524
+ timeout. It can also be a pair (tuple) of
525
+ (connection, read) timeouts.
526
+ :type _request_timeout: int, tuple(int, int), optional
527
+ :param _request_auth: set to override the auth_settings for an a single
528
+ request; this effectively ignores the
529
+ authentication in the spec for a single request.
530
+ :type _request_auth: dict, optional
531
+ :param _content_type: force content-type for the request.
532
+ :type _content_type: str, Optional
533
+ :param _headers: set to override the headers for a single
534
+ request; this effectively ignores the headers
535
+ in the spec for a single request.
536
+ :type _headers: dict, optional
537
+ :param _host_index: set to override the host_index for a single
538
+ request; this effectively ignores the host_index
539
+ in the spec for a single request.
540
+ :type _host_index: int, optional
541
+ :return: Returns the result object.
542
+ """ # noqa: E501 docstring might be too long
543
+
544
+ _param = self._create_load_balancer_serialize(
545
+ project_id=project_id,
546
+ x_request_id=x_request_id,
547
+ create_load_balancer_payload=create_load_balancer_payload,
548
+ _request_auth=_request_auth,
549
+ _content_type=_content_type,
550
+ _headers=_headers,
551
+ _host_index=_host_index,
552
+ )
553
+
554
+ _response_types_map: Dict[str, Optional[str]] = {
555
+ "200": "LoadBalancer",
556
+ "400": None,
557
+ "401": "str",
558
+ "403": None,
559
+ "409": None,
560
+ "500": None,
561
+ }
562
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
563
+ return response_data.response
564
+
565
+ def _create_load_balancer_serialize(
566
+ self,
567
+ project_id,
568
+ x_request_id,
569
+ create_load_balancer_payload,
570
+ _request_auth,
571
+ _content_type,
572
+ _headers,
573
+ _host_index,
574
+ ) -> RequestSerialized:
575
+
576
+ _host = None
577
+
578
+ _collection_formats: Dict[str, str] = {}
579
+
580
+ _path_params: Dict[str, str] = {}
581
+ _query_params: List[Tuple[str, str]] = []
582
+ _header_params: Dict[str, Optional[str]] = _headers or {}
583
+ _form_params: List[Tuple[str, str]] = []
584
+ _files: Dict[str, Union[str, bytes]] = {}
585
+ _body_params: Optional[bytes] = None
586
+
587
+ # process the path parameters
588
+ if project_id is not None:
589
+ _path_params["projectId"] = project_id
590
+ # process the query parameters
591
+ # process the header parameters
592
+ if x_request_id is not None:
593
+ _header_params["X-Request-ID"] = x_request_id
594
+ # process the form parameters
595
+ # process the body parameter
596
+ if create_load_balancer_payload is not None:
597
+ _body_params = create_load_balancer_payload
598
+
599
+ # set the HTTP header `Accept`
600
+ if "Accept" not in _header_params:
601
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
602
+
603
+ # set the HTTP header `Content-Type`
604
+ if _content_type:
605
+ _header_params["Content-Type"] = _content_type
606
+ else:
607
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
608
+ if _default_content_type is not None:
609
+ _header_params["Content-Type"] = _default_content_type
610
+
611
+ # authentication setting
612
+ _auth_settings: List[str] = []
613
+
614
+ return self.api_client.param_serialize(
615
+ method="POST",
616
+ resource_path="/v1/projects/{projectId}/load-balancers",
617
+ path_params=_path_params,
618
+ query_params=_query_params,
619
+ header_params=_header_params,
620
+ body=_body_params,
621
+ post_params=_form_params,
622
+ files=_files,
623
+ auth_settings=_auth_settings,
624
+ collection_formats=_collection_formats,
625
+ _host=_host,
626
+ _request_auth=_request_auth,
627
+ )
628
+
629
+ @validate_call
630
+ def delete_credentials(
631
+ self,
632
+ project_id: StrictStr,
633
+ credentials_ref: StrictStr,
634
+ _request_timeout: Union[
635
+ None,
636
+ Annotated[StrictFloat, Field(gt=0)],
637
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
638
+ ] = None,
639
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
640
+ _content_type: Optional[StrictStr] = None,
641
+ _headers: Optional[Dict[StrictStr, Any]] = None,
642
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
643
+ ) -> object:
644
+ """Delete a single credential in a project.
645
+
646
+ Delete Credential
647
+
648
+ :param project_id: (required)
649
+ :type project_id: str
650
+ :param credentials_ref: (required)
651
+ :type credentials_ref: str
652
+ :param _request_timeout: timeout setting for this request. If one
653
+ number provided, it will be total request
654
+ timeout. It can also be a pair (tuple) of
655
+ (connection, read) timeouts.
656
+ :type _request_timeout: int, tuple(int, int), optional
657
+ :param _request_auth: set to override the auth_settings for an a single
658
+ request; this effectively ignores the
659
+ authentication in the spec for a single request.
660
+ :type _request_auth: dict, optional
661
+ :param _content_type: force content-type for the request.
662
+ :type _content_type: str, Optional
663
+ :param _headers: set to override the headers for a single
664
+ request; this effectively ignores the headers
665
+ in the spec for a single request.
666
+ :type _headers: dict, optional
667
+ :param _host_index: set to override the host_index for a single
668
+ request; this effectively ignores the host_index
669
+ in the spec for a single request.
670
+ :type _host_index: int, optional
671
+ :return: Returns the result object.
672
+ """ # noqa: E501 docstring might be too long
673
+
674
+ _param = self._delete_credentials_serialize(
675
+ project_id=project_id,
676
+ credentials_ref=credentials_ref,
677
+ _request_auth=_request_auth,
678
+ _content_type=_content_type,
679
+ _headers=_headers,
680
+ _host_index=_host_index,
681
+ )
682
+
683
+ _response_types_map: Dict[str, Optional[str]] = {
684
+ "200": "object",
685
+ "400": None,
686
+ "401": "str",
687
+ "403": None,
688
+ "500": None,
689
+ }
690
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
691
+ response_data.read()
692
+ return self.api_client.response_deserialize(
693
+ response_data=response_data,
694
+ response_types_map=_response_types_map,
695
+ ).data
696
+
697
+ @validate_call
698
+ def delete_credentials_with_http_info(
699
+ self,
700
+ project_id: StrictStr,
701
+ credentials_ref: StrictStr,
702
+ _request_timeout: Union[
703
+ None,
704
+ Annotated[StrictFloat, Field(gt=0)],
705
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
706
+ ] = None,
707
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
708
+ _content_type: Optional[StrictStr] = None,
709
+ _headers: Optional[Dict[StrictStr, Any]] = None,
710
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
711
+ ) -> ApiResponse[object]:
712
+ """Delete a single credential in a project.
713
+
714
+ Delete Credential
715
+
716
+ :param project_id: (required)
717
+ :type project_id: str
718
+ :param credentials_ref: (required)
719
+ :type credentials_ref: str
720
+ :param _request_timeout: timeout setting for this request. If one
721
+ number provided, it will be total request
722
+ timeout. It can also be a pair (tuple) of
723
+ (connection, read) timeouts.
724
+ :type _request_timeout: int, tuple(int, int), optional
725
+ :param _request_auth: set to override the auth_settings for an a single
726
+ request; this effectively ignores the
727
+ authentication in the spec for a single request.
728
+ :type _request_auth: dict, optional
729
+ :param _content_type: force content-type for the request.
730
+ :type _content_type: str, Optional
731
+ :param _headers: set to override the headers for a single
732
+ request; this effectively ignores the headers
733
+ in the spec for a single request.
734
+ :type _headers: dict, optional
735
+ :param _host_index: set to override the host_index for a single
736
+ request; this effectively ignores the host_index
737
+ in the spec for a single request.
738
+ :type _host_index: int, optional
739
+ :return: Returns the result object.
740
+ """ # noqa: E501 docstring might be too long
741
+
742
+ _param = self._delete_credentials_serialize(
743
+ project_id=project_id,
744
+ credentials_ref=credentials_ref,
745
+ _request_auth=_request_auth,
746
+ _content_type=_content_type,
747
+ _headers=_headers,
748
+ _host_index=_host_index,
749
+ )
750
+
751
+ _response_types_map: Dict[str, Optional[str]] = {
752
+ "200": "object",
753
+ "400": None,
754
+ "401": "str",
755
+ "403": None,
756
+ "500": None,
757
+ }
758
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
759
+ response_data.read()
760
+ return self.api_client.response_deserialize(
761
+ response_data=response_data,
762
+ response_types_map=_response_types_map,
763
+ )
764
+
765
+ @validate_call
766
+ def delete_credentials_without_preload_content(
767
+ self,
768
+ project_id: StrictStr,
769
+ credentials_ref: StrictStr,
770
+ _request_timeout: Union[
771
+ None,
772
+ Annotated[StrictFloat, Field(gt=0)],
773
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
774
+ ] = None,
775
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
776
+ _content_type: Optional[StrictStr] = None,
777
+ _headers: Optional[Dict[StrictStr, Any]] = None,
778
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
779
+ ) -> RESTResponseType:
780
+ """Delete a single credential in a project.
781
+
782
+ Delete Credential
783
+
784
+ :param project_id: (required)
785
+ :type project_id: str
786
+ :param credentials_ref: (required)
787
+ :type credentials_ref: str
788
+ :param _request_timeout: timeout setting for this request. If one
789
+ number provided, it will be total request
790
+ timeout. It can also be a pair (tuple) of
791
+ (connection, read) timeouts.
792
+ :type _request_timeout: int, tuple(int, int), optional
793
+ :param _request_auth: set to override the auth_settings for an a single
794
+ request; this effectively ignores the
795
+ authentication in the spec for a single request.
796
+ :type _request_auth: dict, optional
797
+ :param _content_type: force content-type for the request.
798
+ :type _content_type: str, Optional
799
+ :param _headers: set to override the headers for a single
800
+ request; this effectively ignores the headers
801
+ in the spec for a single request.
802
+ :type _headers: dict, optional
803
+ :param _host_index: set to override the host_index for a single
804
+ request; this effectively ignores the host_index
805
+ in the spec for a single request.
806
+ :type _host_index: int, optional
807
+ :return: Returns the result object.
808
+ """ # noqa: E501 docstring might be too long
809
+
810
+ _param = self._delete_credentials_serialize(
811
+ project_id=project_id,
812
+ credentials_ref=credentials_ref,
813
+ _request_auth=_request_auth,
814
+ _content_type=_content_type,
815
+ _headers=_headers,
816
+ _host_index=_host_index,
817
+ )
818
+
819
+ _response_types_map: Dict[str, Optional[str]] = {
820
+ "200": "object",
821
+ "400": None,
822
+ "401": "str",
823
+ "403": None,
824
+ "500": None,
825
+ }
826
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
827
+ return response_data.response
828
+
829
+ def _delete_credentials_serialize(
830
+ self,
831
+ project_id,
832
+ credentials_ref,
833
+ _request_auth,
834
+ _content_type,
835
+ _headers,
836
+ _host_index,
837
+ ) -> RequestSerialized:
838
+
839
+ _host = None
840
+
841
+ _collection_formats: Dict[str, str] = {}
842
+
843
+ _path_params: Dict[str, str] = {}
844
+ _query_params: List[Tuple[str, str]] = []
845
+ _header_params: Dict[str, Optional[str]] = _headers or {}
846
+ _form_params: List[Tuple[str, str]] = []
847
+ _files: Dict[str, Union[str, bytes]] = {}
848
+ _body_params: Optional[bytes] = None
849
+
850
+ # process the path parameters
851
+ if project_id is not None:
852
+ _path_params["projectId"] = project_id
853
+ if credentials_ref is not None:
854
+ _path_params["credentialsRef"] = credentials_ref
855
+ # process the query parameters
856
+ # process the header parameters
857
+ # process the form parameters
858
+ # process the body parameter
859
+
860
+ # set the HTTP header `Accept`
861
+ if "Accept" not in _header_params:
862
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
863
+
864
+ # authentication setting
865
+ _auth_settings: List[str] = []
866
+
867
+ return self.api_client.param_serialize(
868
+ method="DELETE",
869
+ resource_path="/v1/projects/{projectId}/credentials/{credentialsRef}",
870
+ path_params=_path_params,
871
+ query_params=_query_params,
872
+ header_params=_header_params,
873
+ body=_body_params,
874
+ post_params=_form_params,
875
+ files=_files,
876
+ auth_settings=_auth_settings,
877
+ collection_formats=_collection_formats,
878
+ _host=_host,
879
+ _request_auth=_request_auth,
880
+ )
881
+
882
+ @validate_call
883
+ def delete_load_balancer(
884
+ self,
885
+ project_id: StrictStr,
886
+ name: StrictStr,
887
+ _request_timeout: Union[
888
+ None,
889
+ Annotated[StrictFloat, Field(gt=0)],
890
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
891
+ ] = None,
892
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
893
+ _content_type: Optional[StrictStr] = None,
894
+ _headers: Optional[Dict[StrictStr, Any]] = None,
895
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
896
+ ) -> object:
897
+ """Delete a given load balancer in a project.
898
+
899
+ DeleteLoadBalancer will delete a given load balancer.
900
+
901
+ :param project_id: (required)
902
+ :type project_id: str
903
+ :param name: (required)
904
+ :type name: str
905
+ :param _request_timeout: timeout setting for this request. If one
906
+ number provided, it will be total request
907
+ timeout. It can also be a pair (tuple) of
908
+ (connection, read) timeouts.
909
+ :type _request_timeout: int, tuple(int, int), optional
910
+ :param _request_auth: set to override the auth_settings for an a single
911
+ request; this effectively ignores the
912
+ authentication in the spec for a single request.
913
+ :type _request_auth: dict, optional
914
+ :param _content_type: force content-type for the request.
915
+ :type _content_type: str, Optional
916
+ :param _headers: set to override the headers for a single
917
+ request; this effectively ignores the headers
918
+ in the spec for a single request.
919
+ :type _headers: dict, optional
920
+ :param _host_index: set to override the host_index for a single
921
+ request; this effectively ignores the host_index
922
+ in the spec for a single request.
923
+ :type _host_index: int, optional
924
+ :return: Returns the result object.
925
+ """ # noqa: E501 docstring might be too long
926
+
927
+ _param = self._delete_load_balancer_serialize(
928
+ project_id=project_id,
929
+ name=name,
930
+ _request_auth=_request_auth,
931
+ _content_type=_content_type,
932
+ _headers=_headers,
933
+ _host_index=_host_index,
934
+ )
935
+
936
+ _response_types_map: Dict[str, Optional[str]] = {
937
+ "200": "object",
938
+ "400": None,
939
+ "401": "str",
940
+ "403": None,
941
+ "500": None,
942
+ }
943
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
944
+ response_data.read()
945
+ return self.api_client.response_deserialize(
946
+ response_data=response_data,
947
+ response_types_map=_response_types_map,
948
+ ).data
949
+
950
+ @validate_call
951
+ def delete_load_balancer_with_http_info(
952
+ self,
953
+ project_id: StrictStr,
954
+ name: StrictStr,
955
+ _request_timeout: Union[
956
+ None,
957
+ Annotated[StrictFloat, Field(gt=0)],
958
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
959
+ ] = None,
960
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
961
+ _content_type: Optional[StrictStr] = None,
962
+ _headers: Optional[Dict[StrictStr, Any]] = None,
963
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
964
+ ) -> ApiResponse[object]:
965
+ """Delete a given load balancer in a project.
966
+
967
+ DeleteLoadBalancer will delete a given load balancer.
968
+
969
+ :param project_id: (required)
970
+ :type project_id: str
971
+ :param name: (required)
972
+ :type name: str
973
+ :param _request_timeout: timeout setting for this request. If one
974
+ number provided, it will be total request
975
+ timeout. It can also be a pair (tuple) of
976
+ (connection, read) timeouts.
977
+ :type _request_timeout: int, tuple(int, int), optional
978
+ :param _request_auth: set to override the auth_settings for an a single
979
+ request; this effectively ignores the
980
+ authentication in the spec for a single request.
981
+ :type _request_auth: dict, optional
982
+ :param _content_type: force content-type for the request.
983
+ :type _content_type: str, Optional
984
+ :param _headers: set to override the headers for a single
985
+ request; this effectively ignores the headers
986
+ in the spec for a single request.
987
+ :type _headers: dict, optional
988
+ :param _host_index: set to override the host_index for a single
989
+ request; this effectively ignores the host_index
990
+ in the spec for a single request.
991
+ :type _host_index: int, optional
992
+ :return: Returns the result object.
993
+ """ # noqa: E501 docstring might be too long
994
+
995
+ _param = self._delete_load_balancer_serialize(
996
+ project_id=project_id,
997
+ name=name,
998
+ _request_auth=_request_auth,
999
+ _content_type=_content_type,
1000
+ _headers=_headers,
1001
+ _host_index=_host_index,
1002
+ )
1003
+
1004
+ _response_types_map: Dict[str, Optional[str]] = {
1005
+ "200": "object",
1006
+ "400": None,
1007
+ "401": "str",
1008
+ "403": None,
1009
+ "500": None,
1010
+ }
1011
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1012
+ response_data.read()
1013
+ return self.api_client.response_deserialize(
1014
+ response_data=response_data,
1015
+ response_types_map=_response_types_map,
1016
+ )
1017
+
1018
+ @validate_call
1019
+ def delete_load_balancer_without_preload_content(
1020
+ self,
1021
+ project_id: StrictStr,
1022
+ name: StrictStr,
1023
+ _request_timeout: Union[
1024
+ None,
1025
+ Annotated[StrictFloat, Field(gt=0)],
1026
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1027
+ ] = None,
1028
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1029
+ _content_type: Optional[StrictStr] = None,
1030
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1031
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1032
+ ) -> RESTResponseType:
1033
+ """Delete a given load balancer in a project.
1034
+
1035
+ DeleteLoadBalancer will delete a given load balancer.
1036
+
1037
+ :param project_id: (required)
1038
+ :type project_id: str
1039
+ :param name: (required)
1040
+ :type name: str
1041
+ :param _request_timeout: timeout setting for this request. If one
1042
+ number provided, it will be total request
1043
+ timeout. It can also be a pair (tuple) of
1044
+ (connection, read) timeouts.
1045
+ :type _request_timeout: int, tuple(int, int), optional
1046
+ :param _request_auth: set to override the auth_settings for an a single
1047
+ request; this effectively ignores the
1048
+ authentication in the spec for a single request.
1049
+ :type _request_auth: dict, optional
1050
+ :param _content_type: force content-type for the request.
1051
+ :type _content_type: str, Optional
1052
+ :param _headers: set to override the headers for a single
1053
+ request; this effectively ignores the headers
1054
+ in the spec for a single request.
1055
+ :type _headers: dict, optional
1056
+ :param _host_index: set to override the host_index for a single
1057
+ request; this effectively ignores the host_index
1058
+ in the spec for a single request.
1059
+ :type _host_index: int, optional
1060
+ :return: Returns the result object.
1061
+ """ # noqa: E501 docstring might be too long
1062
+
1063
+ _param = self._delete_load_balancer_serialize(
1064
+ project_id=project_id,
1065
+ name=name,
1066
+ _request_auth=_request_auth,
1067
+ _content_type=_content_type,
1068
+ _headers=_headers,
1069
+ _host_index=_host_index,
1070
+ )
1071
+
1072
+ _response_types_map: Dict[str, Optional[str]] = {
1073
+ "200": "object",
1074
+ "400": None,
1075
+ "401": "str",
1076
+ "403": None,
1077
+ "500": None,
1078
+ }
1079
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1080
+ return response_data.response
1081
+
1082
+ def _delete_load_balancer_serialize(
1083
+ self,
1084
+ project_id,
1085
+ name,
1086
+ _request_auth,
1087
+ _content_type,
1088
+ _headers,
1089
+ _host_index,
1090
+ ) -> RequestSerialized:
1091
+
1092
+ _host = None
1093
+
1094
+ _collection_formats: Dict[str, str] = {}
1095
+
1096
+ _path_params: Dict[str, str] = {}
1097
+ _query_params: List[Tuple[str, str]] = []
1098
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1099
+ _form_params: List[Tuple[str, str]] = []
1100
+ _files: Dict[str, Union[str, bytes]] = {}
1101
+ _body_params: Optional[bytes] = None
1102
+
1103
+ # process the path parameters
1104
+ if project_id is not None:
1105
+ _path_params["projectId"] = project_id
1106
+ if name is not None:
1107
+ _path_params["name"] = name
1108
+ # process the query parameters
1109
+ # process the header parameters
1110
+ # process the form parameters
1111
+ # process the body parameter
1112
+
1113
+ # set the HTTP header `Accept`
1114
+ if "Accept" not in _header_params:
1115
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
1116
+
1117
+ # authentication setting
1118
+ _auth_settings: List[str] = []
1119
+
1120
+ return self.api_client.param_serialize(
1121
+ method="DELETE",
1122
+ resource_path="/v1/projects/{projectId}/load-balancers/{name}",
1123
+ path_params=_path_params,
1124
+ query_params=_query_params,
1125
+ header_params=_header_params,
1126
+ body=_body_params,
1127
+ post_params=_form_params,
1128
+ files=_files,
1129
+ auth_settings=_auth_settings,
1130
+ collection_formats=_collection_formats,
1131
+ _host=_host,
1132
+ _request_auth=_request_auth,
1133
+ )
1134
+
1135
+ @validate_call
1136
+ def disable_service(
1137
+ self,
1138
+ project_id: StrictStr,
1139
+ _request_timeout: Union[
1140
+ None,
1141
+ Annotated[StrictFloat, Field(gt=0)],
1142
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1143
+ ] = None,
1144
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1145
+ _content_type: Optional[StrictStr] = None,
1146
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1147
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1148
+ ) -> object:
1149
+ """(Deprecated) Disables the functionality of load balancers for the project specified.
1150
+
1151
+ DEPRECATED! Disabling the load balancer functionality is now automatic. The endpoint is kept for compatibility. Disable will disable the load balancer functionality for the project specified.
1152
+
1153
+ :param project_id: (required)
1154
+ :type project_id: str
1155
+ :param _request_timeout: timeout setting for this request. If one
1156
+ number provided, it will be total request
1157
+ timeout. It can also be a pair (tuple) of
1158
+ (connection, read) timeouts.
1159
+ :type _request_timeout: int, tuple(int, int), optional
1160
+ :param _request_auth: set to override the auth_settings for an a single
1161
+ request; this effectively ignores the
1162
+ authentication in the spec for a single request.
1163
+ :type _request_auth: dict, optional
1164
+ :param _content_type: force content-type for the request.
1165
+ :type _content_type: str, Optional
1166
+ :param _headers: set to override the headers for a single
1167
+ request; this effectively ignores the headers
1168
+ in the spec for a single request.
1169
+ :type _headers: dict, optional
1170
+ :param _host_index: set to override the host_index for a single
1171
+ request; this effectively ignores the host_index
1172
+ in the spec for a single request.
1173
+ :type _host_index: int, optional
1174
+ :return: Returns the result object.
1175
+ """ # noqa: E501 docstring might be too long
1176
+ warnings.warn("DELETE /v1/projects/{projectId} is deprecated.", DeprecationWarning)
1177
+
1178
+ _param = self._disable_service_serialize(
1179
+ project_id=project_id,
1180
+ _request_auth=_request_auth,
1181
+ _content_type=_content_type,
1182
+ _headers=_headers,
1183
+ _host_index=_host_index,
1184
+ )
1185
+
1186
+ _response_types_map: Dict[str, Optional[str]] = {
1187
+ "200": "object",
1188
+ "400": None,
1189
+ "401": "str",
1190
+ "403": None,
1191
+ "500": None,
1192
+ }
1193
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1194
+ response_data.read()
1195
+ return self.api_client.response_deserialize(
1196
+ response_data=response_data,
1197
+ response_types_map=_response_types_map,
1198
+ ).data
1199
+
1200
+ @validate_call
1201
+ def disable_service_with_http_info(
1202
+ self,
1203
+ project_id: StrictStr,
1204
+ _request_timeout: Union[
1205
+ None,
1206
+ Annotated[StrictFloat, Field(gt=0)],
1207
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1208
+ ] = None,
1209
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1210
+ _content_type: Optional[StrictStr] = None,
1211
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1212
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1213
+ ) -> ApiResponse[object]:
1214
+ """(Deprecated) Disables the functionality of load balancers for the project specified.
1215
+
1216
+ DEPRECATED! Disabling the load balancer functionality is now automatic. The endpoint is kept for compatibility. Disable will disable the load balancer functionality for the project specified.
1217
+
1218
+ :param project_id: (required)
1219
+ :type project_id: str
1220
+ :param _request_timeout: timeout setting for this request. If one
1221
+ number provided, it will be total request
1222
+ timeout. It can also be a pair (tuple) of
1223
+ (connection, read) timeouts.
1224
+ :type _request_timeout: int, tuple(int, int), optional
1225
+ :param _request_auth: set to override the auth_settings for an a single
1226
+ request; this effectively ignores the
1227
+ authentication in the spec for a single request.
1228
+ :type _request_auth: dict, optional
1229
+ :param _content_type: force content-type for the request.
1230
+ :type _content_type: str, Optional
1231
+ :param _headers: set to override the headers for a single
1232
+ request; this effectively ignores the headers
1233
+ in the spec for a single request.
1234
+ :type _headers: dict, optional
1235
+ :param _host_index: set to override the host_index for a single
1236
+ request; this effectively ignores the host_index
1237
+ in the spec for a single request.
1238
+ :type _host_index: int, optional
1239
+ :return: Returns the result object.
1240
+ """ # noqa: E501 docstring might be too long
1241
+ warnings.warn("DELETE /v1/projects/{projectId} is deprecated.", DeprecationWarning)
1242
+
1243
+ _param = self._disable_service_serialize(
1244
+ project_id=project_id,
1245
+ _request_auth=_request_auth,
1246
+ _content_type=_content_type,
1247
+ _headers=_headers,
1248
+ _host_index=_host_index,
1249
+ )
1250
+
1251
+ _response_types_map: Dict[str, Optional[str]] = {
1252
+ "200": "object",
1253
+ "400": None,
1254
+ "401": "str",
1255
+ "403": None,
1256
+ "500": None,
1257
+ }
1258
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1259
+ response_data.read()
1260
+ return self.api_client.response_deserialize(
1261
+ response_data=response_data,
1262
+ response_types_map=_response_types_map,
1263
+ )
1264
+
1265
+ @validate_call
1266
+ def disable_service_without_preload_content(
1267
+ self,
1268
+ project_id: StrictStr,
1269
+ _request_timeout: Union[
1270
+ None,
1271
+ Annotated[StrictFloat, Field(gt=0)],
1272
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1273
+ ] = None,
1274
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1275
+ _content_type: Optional[StrictStr] = None,
1276
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1277
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1278
+ ) -> RESTResponseType:
1279
+ """(Deprecated) Disables the functionality of load balancers for the project specified.
1280
+
1281
+ DEPRECATED! Disabling the load balancer functionality is now automatic. The endpoint is kept for compatibility. Disable will disable the load balancer functionality for the project specified.
1282
+
1283
+ :param project_id: (required)
1284
+ :type project_id: str
1285
+ :param _request_timeout: timeout setting for this request. If one
1286
+ number provided, it will be total request
1287
+ timeout. It can also be a pair (tuple) of
1288
+ (connection, read) timeouts.
1289
+ :type _request_timeout: int, tuple(int, int), optional
1290
+ :param _request_auth: set to override the auth_settings for an a single
1291
+ request; this effectively ignores the
1292
+ authentication in the spec for a single request.
1293
+ :type _request_auth: dict, optional
1294
+ :param _content_type: force content-type for the request.
1295
+ :type _content_type: str, Optional
1296
+ :param _headers: set to override the headers for a single
1297
+ request; this effectively ignores the headers
1298
+ in the spec for a single request.
1299
+ :type _headers: dict, optional
1300
+ :param _host_index: set to override the host_index for a single
1301
+ request; this effectively ignores the host_index
1302
+ in the spec for a single request.
1303
+ :type _host_index: int, optional
1304
+ :return: Returns the result object.
1305
+ """ # noqa: E501 docstring might be too long
1306
+ warnings.warn("DELETE /v1/projects/{projectId} is deprecated.", DeprecationWarning)
1307
+
1308
+ _param = self._disable_service_serialize(
1309
+ project_id=project_id,
1310
+ _request_auth=_request_auth,
1311
+ _content_type=_content_type,
1312
+ _headers=_headers,
1313
+ _host_index=_host_index,
1314
+ )
1315
+
1316
+ _response_types_map: Dict[str, Optional[str]] = {
1317
+ "200": "object",
1318
+ "400": None,
1319
+ "401": "str",
1320
+ "403": None,
1321
+ "500": None,
1322
+ }
1323
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1324
+ return response_data.response
1325
+
1326
+ def _disable_service_serialize(
1327
+ self,
1328
+ project_id,
1329
+ _request_auth,
1330
+ _content_type,
1331
+ _headers,
1332
+ _host_index,
1333
+ ) -> RequestSerialized:
1334
+
1335
+ _host = None
1336
+
1337
+ _collection_formats: Dict[str, str] = {}
1338
+
1339
+ _path_params: Dict[str, str] = {}
1340
+ _query_params: List[Tuple[str, str]] = []
1341
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1342
+ _form_params: List[Tuple[str, str]] = []
1343
+ _files: Dict[str, Union[str, bytes]] = {}
1344
+ _body_params: Optional[bytes] = None
1345
+
1346
+ # process the path parameters
1347
+ if project_id is not None:
1348
+ _path_params["projectId"] = project_id
1349
+ # process the query parameters
1350
+ # process the header parameters
1351
+ # process the form parameters
1352
+ # process the body parameter
1353
+
1354
+ # set the HTTP header `Accept`
1355
+ if "Accept" not in _header_params:
1356
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
1357
+
1358
+ # authentication setting
1359
+ _auth_settings: List[str] = []
1360
+
1361
+ return self.api_client.param_serialize(
1362
+ method="DELETE",
1363
+ resource_path="/v1/projects/{projectId}",
1364
+ path_params=_path_params,
1365
+ query_params=_query_params,
1366
+ header_params=_header_params,
1367
+ body=_body_params,
1368
+ post_params=_form_params,
1369
+ files=_files,
1370
+ auth_settings=_auth_settings,
1371
+ collection_formats=_collection_formats,
1372
+ _host=_host,
1373
+ _request_auth=_request_auth,
1374
+ )
1375
+
1376
+ @validate_call
1377
+ def enable_service(
1378
+ self,
1379
+ project_id: StrictStr,
1380
+ x_request_id: StrictStr,
1381
+ _request_timeout: Union[
1382
+ None,
1383
+ Annotated[StrictFloat, Field(gt=0)],
1384
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1385
+ ] = None,
1386
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1387
+ _content_type: Optional[StrictStr] = None,
1388
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1389
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1390
+ ) -> object:
1391
+ """(Deprecated) Enables the functionality of load balancers for the project specified.
1392
+
1393
+ DEPRECATED! Use CreateLoadBalancer directly instead. Enable will enable the load balancer functionality for the project specified.
1394
+
1395
+ :param project_id: (required)
1396
+ :type project_id: str
1397
+ :param x_request_id: (required)
1398
+ :type x_request_id: str
1399
+ :param _request_timeout: timeout setting for this request. If one
1400
+ number provided, it will be total request
1401
+ timeout. It can also be a pair (tuple) of
1402
+ (connection, read) timeouts.
1403
+ :type _request_timeout: int, tuple(int, int), optional
1404
+ :param _request_auth: set to override the auth_settings for an a single
1405
+ request; this effectively ignores the
1406
+ authentication in the spec for a single request.
1407
+ :type _request_auth: dict, optional
1408
+ :param _content_type: force content-type for the request.
1409
+ :type _content_type: str, Optional
1410
+ :param _headers: set to override the headers for a single
1411
+ request; this effectively ignores the headers
1412
+ in the spec for a single request.
1413
+ :type _headers: dict, optional
1414
+ :param _host_index: set to override the host_index for a single
1415
+ request; this effectively ignores the host_index
1416
+ in the spec for a single request.
1417
+ :type _host_index: int, optional
1418
+ :return: Returns the result object.
1419
+ """ # noqa: E501 docstring might be too long
1420
+ warnings.warn("POST /v1/projects/{projectId} is deprecated.", DeprecationWarning)
1421
+
1422
+ _param = self._enable_service_serialize(
1423
+ project_id=project_id,
1424
+ x_request_id=x_request_id,
1425
+ _request_auth=_request_auth,
1426
+ _content_type=_content_type,
1427
+ _headers=_headers,
1428
+ _host_index=_host_index,
1429
+ )
1430
+
1431
+ _response_types_map: Dict[str, Optional[str]] = {
1432
+ "200": "object",
1433
+ "400": None,
1434
+ "401": "str",
1435
+ "403": None,
1436
+ "500": None,
1437
+ }
1438
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1439
+ response_data.read()
1440
+ return self.api_client.response_deserialize(
1441
+ response_data=response_data,
1442
+ response_types_map=_response_types_map,
1443
+ ).data
1444
+
1445
+ @validate_call
1446
+ def enable_service_with_http_info(
1447
+ self,
1448
+ project_id: StrictStr,
1449
+ x_request_id: StrictStr,
1450
+ _request_timeout: Union[
1451
+ None,
1452
+ Annotated[StrictFloat, Field(gt=0)],
1453
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1454
+ ] = None,
1455
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1456
+ _content_type: Optional[StrictStr] = None,
1457
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1458
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1459
+ ) -> ApiResponse[object]:
1460
+ """(Deprecated) Enables the functionality of load balancers for the project specified.
1461
+
1462
+ DEPRECATED! Use CreateLoadBalancer directly instead. Enable will enable the load balancer functionality for the project specified.
1463
+
1464
+ :param project_id: (required)
1465
+ :type project_id: str
1466
+ :param x_request_id: (required)
1467
+ :type x_request_id: str
1468
+ :param _request_timeout: timeout setting for this request. If one
1469
+ number provided, it will be total request
1470
+ timeout. It can also be a pair (tuple) of
1471
+ (connection, read) timeouts.
1472
+ :type _request_timeout: int, tuple(int, int), optional
1473
+ :param _request_auth: set to override the auth_settings for an a single
1474
+ request; this effectively ignores the
1475
+ authentication in the spec for a single request.
1476
+ :type _request_auth: dict, optional
1477
+ :param _content_type: force content-type for the request.
1478
+ :type _content_type: str, Optional
1479
+ :param _headers: set to override the headers for a single
1480
+ request; this effectively ignores the headers
1481
+ in the spec for a single request.
1482
+ :type _headers: dict, optional
1483
+ :param _host_index: set to override the host_index for a single
1484
+ request; this effectively ignores the host_index
1485
+ in the spec for a single request.
1486
+ :type _host_index: int, optional
1487
+ :return: Returns the result object.
1488
+ """ # noqa: E501 docstring might be too long
1489
+ warnings.warn("POST /v1/projects/{projectId} is deprecated.", DeprecationWarning)
1490
+
1491
+ _param = self._enable_service_serialize(
1492
+ project_id=project_id,
1493
+ x_request_id=x_request_id,
1494
+ _request_auth=_request_auth,
1495
+ _content_type=_content_type,
1496
+ _headers=_headers,
1497
+ _host_index=_host_index,
1498
+ )
1499
+
1500
+ _response_types_map: Dict[str, Optional[str]] = {
1501
+ "200": "object",
1502
+ "400": None,
1503
+ "401": "str",
1504
+ "403": None,
1505
+ "500": None,
1506
+ }
1507
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1508
+ response_data.read()
1509
+ return self.api_client.response_deserialize(
1510
+ response_data=response_data,
1511
+ response_types_map=_response_types_map,
1512
+ )
1513
+
1514
+ @validate_call
1515
+ def enable_service_without_preload_content(
1516
+ self,
1517
+ project_id: StrictStr,
1518
+ x_request_id: StrictStr,
1519
+ _request_timeout: Union[
1520
+ None,
1521
+ Annotated[StrictFloat, Field(gt=0)],
1522
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1523
+ ] = None,
1524
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1525
+ _content_type: Optional[StrictStr] = None,
1526
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1527
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1528
+ ) -> RESTResponseType:
1529
+ """(Deprecated) Enables the functionality of load balancers for the project specified.
1530
+
1531
+ DEPRECATED! Use CreateLoadBalancer directly instead. Enable will enable the load balancer functionality for the project specified.
1532
+
1533
+ :param project_id: (required)
1534
+ :type project_id: str
1535
+ :param x_request_id: (required)
1536
+ :type x_request_id: str
1537
+ :param _request_timeout: timeout setting for this request. If one
1538
+ number provided, it will be total request
1539
+ timeout. It can also be a pair (tuple) of
1540
+ (connection, read) timeouts.
1541
+ :type _request_timeout: int, tuple(int, int), optional
1542
+ :param _request_auth: set to override the auth_settings for an a single
1543
+ request; this effectively ignores the
1544
+ authentication in the spec for a single request.
1545
+ :type _request_auth: dict, optional
1546
+ :param _content_type: force content-type for the request.
1547
+ :type _content_type: str, Optional
1548
+ :param _headers: set to override the headers for a single
1549
+ request; this effectively ignores the headers
1550
+ in the spec for a single request.
1551
+ :type _headers: dict, optional
1552
+ :param _host_index: set to override the host_index for a single
1553
+ request; this effectively ignores the host_index
1554
+ in the spec for a single request.
1555
+ :type _host_index: int, optional
1556
+ :return: Returns the result object.
1557
+ """ # noqa: E501 docstring might be too long
1558
+ warnings.warn("POST /v1/projects/{projectId} is deprecated.", DeprecationWarning)
1559
+
1560
+ _param = self._enable_service_serialize(
1561
+ project_id=project_id,
1562
+ x_request_id=x_request_id,
1563
+ _request_auth=_request_auth,
1564
+ _content_type=_content_type,
1565
+ _headers=_headers,
1566
+ _host_index=_host_index,
1567
+ )
1568
+
1569
+ _response_types_map: Dict[str, Optional[str]] = {
1570
+ "200": "object",
1571
+ "400": None,
1572
+ "401": "str",
1573
+ "403": None,
1574
+ "500": None,
1575
+ }
1576
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1577
+ return response_data.response
1578
+
1579
+ def _enable_service_serialize(
1580
+ self,
1581
+ project_id,
1582
+ x_request_id,
1583
+ _request_auth,
1584
+ _content_type,
1585
+ _headers,
1586
+ _host_index,
1587
+ ) -> RequestSerialized:
1588
+
1589
+ _host = None
1590
+
1591
+ _collection_formats: Dict[str, str] = {}
1592
+
1593
+ _path_params: Dict[str, str] = {}
1594
+ _query_params: List[Tuple[str, str]] = []
1595
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1596
+ _form_params: List[Tuple[str, str]] = []
1597
+ _files: Dict[str, Union[str, bytes]] = {}
1598
+ _body_params: Optional[bytes] = None
1599
+
1600
+ # process the path parameters
1601
+ if project_id is not None:
1602
+ _path_params["projectId"] = project_id
1603
+ # process the query parameters
1604
+ # process the header parameters
1605
+ if x_request_id is not None:
1606
+ _header_params["X-Request-ID"] = x_request_id
1607
+ # process the form parameters
1608
+ # process the body parameter
1609
+
1610
+ # set the HTTP header `Accept`
1611
+ if "Accept" not in _header_params:
1612
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
1613
+
1614
+ # authentication setting
1615
+ _auth_settings: List[str] = []
1616
+
1617
+ return self.api_client.param_serialize(
1618
+ method="POST",
1619
+ resource_path="/v1/projects/{projectId}",
1620
+ path_params=_path_params,
1621
+ query_params=_query_params,
1622
+ header_params=_header_params,
1623
+ body=_body_params,
1624
+ post_params=_form_params,
1625
+ files=_files,
1626
+ auth_settings=_auth_settings,
1627
+ collection_formats=_collection_formats,
1628
+ _host=_host,
1629
+ _request_auth=_request_auth,
1630
+ )
1631
+
1632
+ @validate_call
1633
+ def get_credentials(
1634
+ self,
1635
+ project_id: StrictStr,
1636
+ credentials_ref: StrictStr,
1637
+ _request_timeout: Union[
1638
+ None,
1639
+ Annotated[StrictFloat, Field(gt=0)],
1640
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1641
+ ] = None,
1642
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1643
+ _content_type: Optional[StrictStr] = None,
1644
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1645
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1646
+ ) -> GetCredentialsResponse:
1647
+ """Get a single credential reference in a project.
1648
+
1649
+ Get Credentials
1650
+
1651
+ :param project_id: (required)
1652
+ :type project_id: str
1653
+ :param credentials_ref: (required)
1654
+ :type credentials_ref: str
1655
+ :param _request_timeout: timeout setting for this request. If one
1656
+ number provided, it will be total request
1657
+ timeout. It can also be a pair (tuple) of
1658
+ (connection, read) timeouts.
1659
+ :type _request_timeout: int, tuple(int, int), optional
1660
+ :param _request_auth: set to override the auth_settings for an a single
1661
+ request; this effectively ignores the
1662
+ authentication in the spec for a single request.
1663
+ :type _request_auth: dict, optional
1664
+ :param _content_type: force content-type for the request.
1665
+ :type _content_type: str, Optional
1666
+ :param _headers: set to override the headers for a single
1667
+ request; this effectively ignores the headers
1668
+ in the spec for a single request.
1669
+ :type _headers: dict, optional
1670
+ :param _host_index: set to override the host_index for a single
1671
+ request; this effectively ignores the host_index
1672
+ in the spec for a single request.
1673
+ :type _host_index: int, optional
1674
+ :return: Returns the result object.
1675
+ """ # noqa: E501 docstring might be too long
1676
+
1677
+ _param = self._get_credentials_serialize(
1678
+ project_id=project_id,
1679
+ credentials_ref=credentials_ref,
1680
+ _request_auth=_request_auth,
1681
+ _content_type=_content_type,
1682
+ _headers=_headers,
1683
+ _host_index=_host_index,
1684
+ )
1685
+
1686
+ _response_types_map: Dict[str, Optional[str]] = {
1687
+ "200": "GetCredentialsResponse",
1688
+ "400": None,
1689
+ "401": "str",
1690
+ "403": None,
1691
+ "404": None,
1692
+ "500": None,
1693
+ }
1694
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1695
+ response_data.read()
1696
+ return self.api_client.response_deserialize(
1697
+ response_data=response_data,
1698
+ response_types_map=_response_types_map,
1699
+ ).data
1700
+
1701
+ @validate_call
1702
+ def get_credentials_with_http_info(
1703
+ self,
1704
+ project_id: StrictStr,
1705
+ credentials_ref: StrictStr,
1706
+ _request_timeout: Union[
1707
+ None,
1708
+ Annotated[StrictFloat, Field(gt=0)],
1709
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1710
+ ] = None,
1711
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1712
+ _content_type: Optional[StrictStr] = None,
1713
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1714
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1715
+ ) -> ApiResponse[GetCredentialsResponse]:
1716
+ """Get a single credential reference in a project.
1717
+
1718
+ Get Credentials
1719
+
1720
+ :param project_id: (required)
1721
+ :type project_id: str
1722
+ :param credentials_ref: (required)
1723
+ :type credentials_ref: str
1724
+ :param _request_timeout: timeout setting for this request. If one
1725
+ number provided, it will be total request
1726
+ timeout. It can also be a pair (tuple) of
1727
+ (connection, read) timeouts.
1728
+ :type _request_timeout: int, tuple(int, int), optional
1729
+ :param _request_auth: set to override the auth_settings for an a single
1730
+ request; this effectively ignores the
1731
+ authentication in the spec for a single request.
1732
+ :type _request_auth: dict, optional
1733
+ :param _content_type: force content-type for the request.
1734
+ :type _content_type: str, Optional
1735
+ :param _headers: set to override the headers for a single
1736
+ request; this effectively ignores the headers
1737
+ in the spec for a single request.
1738
+ :type _headers: dict, optional
1739
+ :param _host_index: set to override the host_index for a single
1740
+ request; this effectively ignores the host_index
1741
+ in the spec for a single request.
1742
+ :type _host_index: int, optional
1743
+ :return: Returns the result object.
1744
+ """ # noqa: E501 docstring might be too long
1745
+
1746
+ _param = self._get_credentials_serialize(
1747
+ project_id=project_id,
1748
+ credentials_ref=credentials_ref,
1749
+ _request_auth=_request_auth,
1750
+ _content_type=_content_type,
1751
+ _headers=_headers,
1752
+ _host_index=_host_index,
1753
+ )
1754
+
1755
+ _response_types_map: Dict[str, Optional[str]] = {
1756
+ "200": "GetCredentialsResponse",
1757
+ "400": None,
1758
+ "401": "str",
1759
+ "403": None,
1760
+ "404": None,
1761
+ "500": None,
1762
+ }
1763
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1764
+ response_data.read()
1765
+ return self.api_client.response_deserialize(
1766
+ response_data=response_data,
1767
+ response_types_map=_response_types_map,
1768
+ )
1769
+
1770
+ @validate_call
1771
+ def get_credentials_without_preload_content(
1772
+ self,
1773
+ project_id: StrictStr,
1774
+ credentials_ref: StrictStr,
1775
+ _request_timeout: Union[
1776
+ None,
1777
+ Annotated[StrictFloat, Field(gt=0)],
1778
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1779
+ ] = None,
1780
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1781
+ _content_type: Optional[StrictStr] = None,
1782
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1783
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1784
+ ) -> RESTResponseType:
1785
+ """Get a single credential reference in a project.
1786
+
1787
+ Get Credentials
1788
+
1789
+ :param project_id: (required)
1790
+ :type project_id: str
1791
+ :param credentials_ref: (required)
1792
+ :type credentials_ref: str
1793
+ :param _request_timeout: timeout setting for this request. If one
1794
+ number provided, it will be total request
1795
+ timeout. It can also be a pair (tuple) of
1796
+ (connection, read) timeouts.
1797
+ :type _request_timeout: int, tuple(int, int), optional
1798
+ :param _request_auth: set to override the auth_settings for an a single
1799
+ request; this effectively ignores the
1800
+ authentication in the spec for a single request.
1801
+ :type _request_auth: dict, optional
1802
+ :param _content_type: force content-type for the request.
1803
+ :type _content_type: str, Optional
1804
+ :param _headers: set to override the headers for a single
1805
+ request; this effectively ignores the headers
1806
+ in the spec for a single request.
1807
+ :type _headers: dict, optional
1808
+ :param _host_index: set to override the host_index for a single
1809
+ request; this effectively ignores the host_index
1810
+ in the spec for a single request.
1811
+ :type _host_index: int, optional
1812
+ :return: Returns the result object.
1813
+ """ # noqa: E501 docstring might be too long
1814
+
1815
+ _param = self._get_credentials_serialize(
1816
+ project_id=project_id,
1817
+ credentials_ref=credentials_ref,
1818
+ _request_auth=_request_auth,
1819
+ _content_type=_content_type,
1820
+ _headers=_headers,
1821
+ _host_index=_host_index,
1822
+ )
1823
+
1824
+ _response_types_map: Dict[str, Optional[str]] = {
1825
+ "200": "GetCredentialsResponse",
1826
+ "400": None,
1827
+ "401": "str",
1828
+ "403": None,
1829
+ "404": None,
1830
+ "500": None,
1831
+ }
1832
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1833
+ return response_data.response
1834
+
1835
+ def _get_credentials_serialize(
1836
+ self,
1837
+ project_id,
1838
+ credentials_ref,
1839
+ _request_auth,
1840
+ _content_type,
1841
+ _headers,
1842
+ _host_index,
1843
+ ) -> RequestSerialized:
1844
+
1845
+ _host = None
1846
+
1847
+ _collection_formats: Dict[str, str] = {}
1848
+
1849
+ _path_params: Dict[str, str] = {}
1850
+ _query_params: List[Tuple[str, str]] = []
1851
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1852
+ _form_params: List[Tuple[str, str]] = []
1853
+ _files: Dict[str, Union[str, bytes]] = {}
1854
+ _body_params: Optional[bytes] = None
1855
+
1856
+ # process the path parameters
1857
+ if project_id is not None:
1858
+ _path_params["projectId"] = project_id
1859
+ if credentials_ref is not None:
1860
+ _path_params["credentialsRef"] = credentials_ref
1861
+ # process the query parameters
1862
+ # process the header parameters
1863
+ # process the form parameters
1864
+ # process the body parameter
1865
+
1866
+ # set the HTTP header `Accept`
1867
+ if "Accept" not in _header_params:
1868
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
1869
+
1870
+ # authentication setting
1871
+ _auth_settings: List[str] = []
1872
+
1873
+ return self.api_client.param_serialize(
1874
+ method="GET",
1875
+ resource_path="/v1/projects/{projectId}/credentials/{credentialsRef}",
1876
+ path_params=_path_params,
1877
+ query_params=_query_params,
1878
+ header_params=_header_params,
1879
+ body=_body_params,
1880
+ post_params=_form_params,
1881
+ files=_files,
1882
+ auth_settings=_auth_settings,
1883
+ collection_formats=_collection_formats,
1884
+ _host=_host,
1885
+ _request_auth=_request_auth,
1886
+ )
1887
+
1888
+ @validate_call
1889
+ def get_load_balancer(
1890
+ self,
1891
+ project_id: StrictStr,
1892
+ name: StrictStr,
1893
+ _request_timeout: Union[
1894
+ None,
1895
+ Annotated[StrictFloat, Field(gt=0)],
1896
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1897
+ ] = None,
1898
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1899
+ _content_type: Optional[StrictStr] = None,
1900
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1901
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1902
+ ) -> LoadBalancer:
1903
+ """Get a single load balancer in a project.
1904
+
1905
+ Get Load Balancer will get a single load balancer of a project. This contains all the information set during creation or updates. Additionally, it will have information about the state of the load balancer in the form of a status field and error description feedback.
1906
+
1907
+ :param project_id: (required)
1908
+ :type project_id: str
1909
+ :param name: (required)
1910
+ :type name: str
1911
+ :param _request_timeout: timeout setting for this request. If one
1912
+ number provided, it will be total request
1913
+ timeout. It can also be a pair (tuple) of
1914
+ (connection, read) timeouts.
1915
+ :type _request_timeout: int, tuple(int, int), optional
1916
+ :param _request_auth: set to override the auth_settings for an a single
1917
+ request; this effectively ignores the
1918
+ authentication in the spec for a single request.
1919
+ :type _request_auth: dict, optional
1920
+ :param _content_type: force content-type for the request.
1921
+ :type _content_type: str, Optional
1922
+ :param _headers: set to override the headers for a single
1923
+ request; this effectively ignores the headers
1924
+ in the spec for a single request.
1925
+ :type _headers: dict, optional
1926
+ :param _host_index: set to override the host_index for a single
1927
+ request; this effectively ignores the host_index
1928
+ in the spec for a single request.
1929
+ :type _host_index: int, optional
1930
+ :return: Returns the result object.
1931
+ """ # noqa: E501 docstring might be too long
1932
+
1933
+ _param = self._get_load_balancer_serialize(
1934
+ project_id=project_id,
1935
+ name=name,
1936
+ _request_auth=_request_auth,
1937
+ _content_type=_content_type,
1938
+ _headers=_headers,
1939
+ _host_index=_host_index,
1940
+ )
1941
+
1942
+ _response_types_map: Dict[str, Optional[str]] = {
1943
+ "200": "LoadBalancer",
1944
+ "400": None,
1945
+ "401": "str",
1946
+ "403": None,
1947
+ "404": None,
1948
+ "500": None,
1949
+ }
1950
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1951
+ response_data.read()
1952
+ return self.api_client.response_deserialize(
1953
+ response_data=response_data,
1954
+ response_types_map=_response_types_map,
1955
+ ).data
1956
+
1957
+ @validate_call
1958
+ def get_load_balancer_with_http_info(
1959
+ self,
1960
+ project_id: StrictStr,
1961
+ name: StrictStr,
1962
+ _request_timeout: Union[
1963
+ None,
1964
+ Annotated[StrictFloat, Field(gt=0)],
1965
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1966
+ ] = None,
1967
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1968
+ _content_type: Optional[StrictStr] = None,
1969
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1970
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1971
+ ) -> ApiResponse[LoadBalancer]:
1972
+ """Get a single load balancer in a project.
1973
+
1974
+ Get Load Balancer will get a single load balancer of a project. This contains all the information set during creation or updates. Additionally, it will have information about the state of the load balancer in the form of a status field and error description feedback.
1975
+
1976
+ :param project_id: (required)
1977
+ :type project_id: str
1978
+ :param name: (required)
1979
+ :type name: str
1980
+ :param _request_timeout: timeout setting for this request. If one
1981
+ number provided, it will be total request
1982
+ timeout. It can also be a pair (tuple) of
1983
+ (connection, read) timeouts.
1984
+ :type _request_timeout: int, tuple(int, int), optional
1985
+ :param _request_auth: set to override the auth_settings for an a single
1986
+ request; this effectively ignores the
1987
+ authentication in the spec for a single request.
1988
+ :type _request_auth: dict, optional
1989
+ :param _content_type: force content-type for the request.
1990
+ :type _content_type: str, Optional
1991
+ :param _headers: set to override the headers for a single
1992
+ request; this effectively ignores the headers
1993
+ in the spec for a single request.
1994
+ :type _headers: dict, optional
1995
+ :param _host_index: set to override the host_index for a single
1996
+ request; this effectively ignores the host_index
1997
+ in the spec for a single request.
1998
+ :type _host_index: int, optional
1999
+ :return: Returns the result object.
2000
+ """ # noqa: E501 docstring might be too long
2001
+
2002
+ _param = self._get_load_balancer_serialize(
2003
+ project_id=project_id,
2004
+ name=name,
2005
+ _request_auth=_request_auth,
2006
+ _content_type=_content_type,
2007
+ _headers=_headers,
2008
+ _host_index=_host_index,
2009
+ )
2010
+
2011
+ _response_types_map: Dict[str, Optional[str]] = {
2012
+ "200": "LoadBalancer",
2013
+ "400": None,
2014
+ "401": "str",
2015
+ "403": None,
2016
+ "404": None,
2017
+ "500": None,
2018
+ }
2019
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2020
+ response_data.read()
2021
+ return self.api_client.response_deserialize(
2022
+ response_data=response_data,
2023
+ response_types_map=_response_types_map,
2024
+ )
2025
+
2026
+ @validate_call
2027
+ def get_load_balancer_without_preload_content(
2028
+ self,
2029
+ project_id: StrictStr,
2030
+ name: StrictStr,
2031
+ _request_timeout: Union[
2032
+ None,
2033
+ Annotated[StrictFloat, Field(gt=0)],
2034
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2035
+ ] = None,
2036
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2037
+ _content_type: Optional[StrictStr] = None,
2038
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2039
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2040
+ ) -> RESTResponseType:
2041
+ """Get a single load balancer in a project.
2042
+
2043
+ Get Load Balancer will get a single load balancer of a project. This contains all the information set during creation or updates. Additionally, it will have information about the state of the load balancer in the form of a status field and error description feedback.
2044
+
2045
+ :param project_id: (required)
2046
+ :type project_id: str
2047
+ :param name: (required)
2048
+ :type name: str
2049
+ :param _request_timeout: timeout setting for this request. If one
2050
+ number provided, it will be total request
2051
+ timeout. It can also be a pair (tuple) of
2052
+ (connection, read) timeouts.
2053
+ :type _request_timeout: int, tuple(int, int), optional
2054
+ :param _request_auth: set to override the auth_settings for an a single
2055
+ request; this effectively ignores the
2056
+ authentication in the spec for a single request.
2057
+ :type _request_auth: dict, optional
2058
+ :param _content_type: force content-type for the request.
2059
+ :type _content_type: str, Optional
2060
+ :param _headers: set to override the headers for a single
2061
+ request; this effectively ignores the headers
2062
+ in the spec for a single request.
2063
+ :type _headers: dict, optional
2064
+ :param _host_index: set to override the host_index for a single
2065
+ request; this effectively ignores the host_index
2066
+ in the spec for a single request.
2067
+ :type _host_index: int, optional
2068
+ :return: Returns the result object.
2069
+ """ # noqa: E501 docstring might be too long
2070
+
2071
+ _param = self._get_load_balancer_serialize(
2072
+ project_id=project_id,
2073
+ name=name,
2074
+ _request_auth=_request_auth,
2075
+ _content_type=_content_type,
2076
+ _headers=_headers,
2077
+ _host_index=_host_index,
2078
+ )
2079
+
2080
+ _response_types_map: Dict[str, Optional[str]] = {
2081
+ "200": "LoadBalancer",
2082
+ "400": None,
2083
+ "401": "str",
2084
+ "403": None,
2085
+ "404": None,
2086
+ "500": None,
2087
+ }
2088
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2089
+ return response_data.response
2090
+
2091
+ def _get_load_balancer_serialize(
2092
+ self,
2093
+ project_id,
2094
+ name,
2095
+ _request_auth,
2096
+ _content_type,
2097
+ _headers,
2098
+ _host_index,
2099
+ ) -> RequestSerialized:
2100
+
2101
+ _host = None
2102
+
2103
+ _collection_formats: Dict[str, str] = {}
2104
+
2105
+ _path_params: Dict[str, str] = {}
2106
+ _query_params: List[Tuple[str, str]] = []
2107
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2108
+ _form_params: List[Tuple[str, str]] = []
2109
+ _files: Dict[str, Union[str, bytes]] = {}
2110
+ _body_params: Optional[bytes] = None
2111
+
2112
+ # process the path parameters
2113
+ if project_id is not None:
2114
+ _path_params["projectId"] = project_id
2115
+ if name is not None:
2116
+ _path_params["name"] = name
2117
+ # process the query parameters
2118
+ # process the header parameters
2119
+ # process the form parameters
2120
+ # process the body parameter
2121
+
2122
+ # set the HTTP header `Accept`
2123
+ if "Accept" not in _header_params:
2124
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
2125
+
2126
+ # authentication setting
2127
+ _auth_settings: List[str] = []
2128
+
2129
+ return self.api_client.param_serialize(
2130
+ method="GET",
2131
+ resource_path="/v1/projects/{projectId}/load-balancers/{name}",
2132
+ path_params=_path_params,
2133
+ query_params=_query_params,
2134
+ header_params=_header_params,
2135
+ body=_body_params,
2136
+ post_params=_form_params,
2137
+ files=_files,
2138
+ auth_settings=_auth_settings,
2139
+ collection_formats=_collection_formats,
2140
+ _host=_host,
2141
+ _request_auth=_request_auth,
2142
+ )
2143
+
2144
+ @validate_call
2145
+ def get_quota(
2146
+ self,
2147
+ project_id: StrictStr,
2148
+ _request_timeout: Union[
2149
+ None,
2150
+ Annotated[StrictFloat, Field(gt=0)],
2151
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2152
+ ] = None,
2153
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2154
+ _content_type: Optional[StrictStr] = None,
2155
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2156
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2157
+ ) -> GetQuotaResponse:
2158
+ """Get the quota of Load Balancers and Target Pools in a project.
2159
+
2160
+ GetQuota gets the configured load balancer quota for the project. Default is 3.
2161
+
2162
+ :param project_id: (required)
2163
+ :type project_id: str
2164
+ :param _request_timeout: timeout setting for this request. If one
2165
+ number provided, it will be total request
2166
+ timeout. It can also be a pair (tuple) of
2167
+ (connection, read) timeouts.
2168
+ :type _request_timeout: int, tuple(int, int), optional
2169
+ :param _request_auth: set to override the auth_settings for an a single
2170
+ request; this effectively ignores the
2171
+ authentication in the spec for a single request.
2172
+ :type _request_auth: dict, optional
2173
+ :param _content_type: force content-type for the request.
2174
+ :type _content_type: str, Optional
2175
+ :param _headers: set to override the headers for a single
2176
+ request; this effectively ignores the headers
2177
+ in the spec for a single request.
2178
+ :type _headers: dict, optional
2179
+ :param _host_index: set to override the host_index for a single
2180
+ request; this effectively ignores the host_index
2181
+ in the spec for a single request.
2182
+ :type _host_index: int, optional
2183
+ :return: Returns the result object.
2184
+ """ # noqa: E501 docstring might be too long
2185
+
2186
+ _param = self._get_quota_serialize(
2187
+ project_id=project_id,
2188
+ _request_auth=_request_auth,
2189
+ _content_type=_content_type,
2190
+ _headers=_headers,
2191
+ _host_index=_host_index,
2192
+ )
2193
+
2194
+ _response_types_map: Dict[str, Optional[str]] = {
2195
+ "200": "GetQuotaResponse",
2196
+ "400": None,
2197
+ "401": "str",
2198
+ "403": None,
2199
+ "500": None,
2200
+ }
2201
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2202
+ response_data.read()
2203
+ return self.api_client.response_deserialize(
2204
+ response_data=response_data,
2205
+ response_types_map=_response_types_map,
2206
+ ).data
2207
+
2208
+ @validate_call
2209
+ def get_quota_with_http_info(
2210
+ self,
2211
+ project_id: StrictStr,
2212
+ _request_timeout: Union[
2213
+ None,
2214
+ Annotated[StrictFloat, Field(gt=0)],
2215
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2216
+ ] = None,
2217
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2218
+ _content_type: Optional[StrictStr] = None,
2219
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2220
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2221
+ ) -> ApiResponse[GetQuotaResponse]:
2222
+ """Get the quota of Load Balancers and Target Pools in a project.
2223
+
2224
+ GetQuota gets the configured load balancer quota for the project. Default is 3.
2225
+
2226
+ :param project_id: (required)
2227
+ :type project_id: str
2228
+ :param _request_timeout: timeout setting for this request. If one
2229
+ number provided, it will be total request
2230
+ timeout. It can also be a pair (tuple) of
2231
+ (connection, read) timeouts.
2232
+ :type _request_timeout: int, tuple(int, int), optional
2233
+ :param _request_auth: set to override the auth_settings for an a single
2234
+ request; this effectively ignores the
2235
+ authentication in the spec for a single request.
2236
+ :type _request_auth: dict, optional
2237
+ :param _content_type: force content-type for the request.
2238
+ :type _content_type: str, Optional
2239
+ :param _headers: set to override the headers for a single
2240
+ request; this effectively ignores the headers
2241
+ in the spec for a single request.
2242
+ :type _headers: dict, optional
2243
+ :param _host_index: set to override the host_index for a single
2244
+ request; this effectively ignores the host_index
2245
+ in the spec for a single request.
2246
+ :type _host_index: int, optional
2247
+ :return: Returns the result object.
2248
+ """ # noqa: E501 docstring might be too long
2249
+
2250
+ _param = self._get_quota_serialize(
2251
+ project_id=project_id,
2252
+ _request_auth=_request_auth,
2253
+ _content_type=_content_type,
2254
+ _headers=_headers,
2255
+ _host_index=_host_index,
2256
+ )
2257
+
2258
+ _response_types_map: Dict[str, Optional[str]] = {
2259
+ "200": "GetQuotaResponse",
2260
+ "400": None,
2261
+ "401": "str",
2262
+ "403": None,
2263
+ "500": None,
2264
+ }
2265
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2266
+ response_data.read()
2267
+ return self.api_client.response_deserialize(
2268
+ response_data=response_data,
2269
+ response_types_map=_response_types_map,
2270
+ )
2271
+
2272
+ @validate_call
2273
+ def get_quota_without_preload_content(
2274
+ self,
2275
+ project_id: StrictStr,
2276
+ _request_timeout: Union[
2277
+ None,
2278
+ Annotated[StrictFloat, Field(gt=0)],
2279
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2280
+ ] = None,
2281
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2282
+ _content_type: Optional[StrictStr] = None,
2283
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2284
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2285
+ ) -> RESTResponseType:
2286
+ """Get the quota of Load Balancers and Target Pools in a project.
2287
+
2288
+ GetQuota gets the configured load balancer quota for the project. Default is 3.
2289
+
2290
+ :param project_id: (required)
2291
+ :type project_id: str
2292
+ :param _request_timeout: timeout setting for this request. If one
2293
+ number provided, it will be total request
2294
+ timeout. It can also be a pair (tuple) of
2295
+ (connection, read) timeouts.
2296
+ :type _request_timeout: int, tuple(int, int), optional
2297
+ :param _request_auth: set to override the auth_settings for an a single
2298
+ request; this effectively ignores the
2299
+ authentication in the spec for a single request.
2300
+ :type _request_auth: dict, optional
2301
+ :param _content_type: force content-type for the request.
2302
+ :type _content_type: str, Optional
2303
+ :param _headers: set to override the headers for a single
2304
+ request; this effectively ignores the headers
2305
+ in the spec for a single request.
2306
+ :type _headers: dict, optional
2307
+ :param _host_index: set to override the host_index for a single
2308
+ request; this effectively ignores the host_index
2309
+ in the spec for a single request.
2310
+ :type _host_index: int, optional
2311
+ :return: Returns the result object.
2312
+ """ # noqa: E501 docstring might be too long
2313
+
2314
+ _param = self._get_quota_serialize(
2315
+ project_id=project_id,
2316
+ _request_auth=_request_auth,
2317
+ _content_type=_content_type,
2318
+ _headers=_headers,
2319
+ _host_index=_host_index,
2320
+ )
2321
+
2322
+ _response_types_map: Dict[str, Optional[str]] = {
2323
+ "200": "GetQuotaResponse",
2324
+ "400": None,
2325
+ "401": "str",
2326
+ "403": None,
2327
+ "500": None,
2328
+ }
2329
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2330
+ return response_data.response
2331
+
2332
+ def _get_quota_serialize(
2333
+ self,
2334
+ project_id,
2335
+ _request_auth,
2336
+ _content_type,
2337
+ _headers,
2338
+ _host_index,
2339
+ ) -> RequestSerialized:
2340
+
2341
+ _host = None
2342
+
2343
+ _collection_formats: Dict[str, str] = {}
2344
+
2345
+ _path_params: Dict[str, str] = {}
2346
+ _query_params: List[Tuple[str, str]] = []
2347
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2348
+ _form_params: List[Tuple[str, str]] = []
2349
+ _files: Dict[str, Union[str, bytes]] = {}
2350
+ _body_params: Optional[bytes] = None
2351
+
2352
+ # process the path parameters
2353
+ if project_id is not None:
2354
+ _path_params["projectId"] = project_id
2355
+ # process the query parameters
2356
+ # process the header parameters
2357
+ # process the form parameters
2358
+ # process the body parameter
2359
+
2360
+ # set the HTTP header `Accept`
2361
+ if "Accept" not in _header_params:
2362
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
2363
+
2364
+ # authentication setting
2365
+ _auth_settings: List[str] = []
2366
+
2367
+ return self.api_client.param_serialize(
2368
+ method="GET",
2369
+ resource_path="/v1/projects/{projectId}/quota",
2370
+ path_params=_path_params,
2371
+ query_params=_query_params,
2372
+ header_params=_header_params,
2373
+ body=_body_params,
2374
+ post_params=_form_params,
2375
+ files=_files,
2376
+ auth_settings=_auth_settings,
2377
+ collection_formats=_collection_formats,
2378
+ _host=_host,
2379
+ _request_auth=_request_auth,
2380
+ )
2381
+
2382
+ @validate_call
2383
+ def get_service_status(
2384
+ self,
2385
+ project_id: StrictStr,
2386
+ _request_timeout: Union[
2387
+ None,
2388
+ Annotated[StrictFloat, Field(gt=0)],
2389
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2390
+ ] = None,
2391
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2392
+ _content_type: Optional[StrictStr] = None,
2393
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2394
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2395
+ ) -> GetServiceStatusResponse:
2396
+ """(Deprecated) Return the status of load balancer functionality for the project specified.
2397
+
2398
+ DEPRECATED! Projects are auto-enabled on SE side, meaning status is always enabled. Status will return the load balancer functionality status for the project specified.
2399
+
2400
+ :param project_id: (required)
2401
+ :type project_id: str
2402
+ :param _request_timeout: timeout setting for this request. If one
2403
+ number provided, it will be total request
2404
+ timeout. It can also be a pair (tuple) of
2405
+ (connection, read) timeouts.
2406
+ :type _request_timeout: int, tuple(int, int), optional
2407
+ :param _request_auth: set to override the auth_settings for an a single
2408
+ request; this effectively ignores the
2409
+ authentication in the spec for a single request.
2410
+ :type _request_auth: dict, optional
2411
+ :param _content_type: force content-type for the request.
2412
+ :type _content_type: str, Optional
2413
+ :param _headers: set to override the headers for a single
2414
+ request; this effectively ignores the headers
2415
+ in the spec for a single request.
2416
+ :type _headers: dict, optional
2417
+ :param _host_index: set to override the host_index for a single
2418
+ request; this effectively ignores the host_index
2419
+ in the spec for a single request.
2420
+ :type _host_index: int, optional
2421
+ :return: Returns the result object.
2422
+ """ # noqa: E501 docstring might be too long
2423
+ warnings.warn("GET /v1/projects/{projectId} is deprecated.", DeprecationWarning)
2424
+
2425
+ _param = self._get_service_status_serialize(
2426
+ project_id=project_id,
2427
+ _request_auth=_request_auth,
2428
+ _content_type=_content_type,
2429
+ _headers=_headers,
2430
+ _host_index=_host_index,
2431
+ )
2432
+
2433
+ _response_types_map: Dict[str, Optional[str]] = {
2434
+ "200": "GetServiceStatusResponse",
2435
+ "400": None,
2436
+ "401": "str",
2437
+ "403": None,
2438
+ "500": None,
2439
+ }
2440
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2441
+ response_data.read()
2442
+ return self.api_client.response_deserialize(
2443
+ response_data=response_data,
2444
+ response_types_map=_response_types_map,
2445
+ ).data
2446
+
2447
+ @validate_call
2448
+ def get_service_status_with_http_info(
2449
+ self,
2450
+ project_id: StrictStr,
2451
+ _request_timeout: Union[
2452
+ None,
2453
+ Annotated[StrictFloat, Field(gt=0)],
2454
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2455
+ ] = None,
2456
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2457
+ _content_type: Optional[StrictStr] = None,
2458
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2459
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2460
+ ) -> ApiResponse[GetServiceStatusResponse]:
2461
+ """(Deprecated) Return the status of load balancer functionality for the project specified.
2462
+
2463
+ DEPRECATED! Projects are auto-enabled on SE side, meaning status is always enabled. Status will return the load balancer functionality status for the project specified.
2464
+
2465
+ :param project_id: (required)
2466
+ :type project_id: str
2467
+ :param _request_timeout: timeout setting for this request. If one
2468
+ number provided, it will be total request
2469
+ timeout. It can also be a pair (tuple) of
2470
+ (connection, read) timeouts.
2471
+ :type _request_timeout: int, tuple(int, int), optional
2472
+ :param _request_auth: set to override the auth_settings for an a single
2473
+ request; this effectively ignores the
2474
+ authentication in the spec for a single request.
2475
+ :type _request_auth: dict, optional
2476
+ :param _content_type: force content-type for the request.
2477
+ :type _content_type: str, Optional
2478
+ :param _headers: set to override the headers for a single
2479
+ request; this effectively ignores the headers
2480
+ in the spec for a single request.
2481
+ :type _headers: dict, optional
2482
+ :param _host_index: set to override the host_index for a single
2483
+ request; this effectively ignores the host_index
2484
+ in the spec for a single request.
2485
+ :type _host_index: int, optional
2486
+ :return: Returns the result object.
2487
+ """ # noqa: E501 docstring might be too long
2488
+ warnings.warn("GET /v1/projects/{projectId} is deprecated.", DeprecationWarning)
2489
+
2490
+ _param = self._get_service_status_serialize(
2491
+ project_id=project_id,
2492
+ _request_auth=_request_auth,
2493
+ _content_type=_content_type,
2494
+ _headers=_headers,
2495
+ _host_index=_host_index,
2496
+ )
2497
+
2498
+ _response_types_map: Dict[str, Optional[str]] = {
2499
+ "200": "GetServiceStatusResponse",
2500
+ "400": None,
2501
+ "401": "str",
2502
+ "403": None,
2503
+ "500": None,
2504
+ }
2505
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2506
+ response_data.read()
2507
+ return self.api_client.response_deserialize(
2508
+ response_data=response_data,
2509
+ response_types_map=_response_types_map,
2510
+ )
2511
+
2512
+ @validate_call
2513
+ def get_service_status_without_preload_content(
2514
+ self,
2515
+ project_id: StrictStr,
2516
+ _request_timeout: Union[
2517
+ None,
2518
+ Annotated[StrictFloat, Field(gt=0)],
2519
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2520
+ ] = None,
2521
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2522
+ _content_type: Optional[StrictStr] = None,
2523
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2524
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2525
+ ) -> RESTResponseType:
2526
+ """(Deprecated) Return the status of load balancer functionality for the project specified.
2527
+
2528
+ DEPRECATED! Projects are auto-enabled on SE side, meaning status is always enabled. Status will return the load balancer functionality status for the project specified.
2529
+
2530
+ :param project_id: (required)
2531
+ :type project_id: str
2532
+ :param _request_timeout: timeout setting for this request. If one
2533
+ number provided, it will be total request
2534
+ timeout. It can also be a pair (tuple) of
2535
+ (connection, read) timeouts.
2536
+ :type _request_timeout: int, tuple(int, int), optional
2537
+ :param _request_auth: set to override the auth_settings for an a single
2538
+ request; this effectively ignores the
2539
+ authentication in the spec for a single request.
2540
+ :type _request_auth: dict, optional
2541
+ :param _content_type: force content-type for the request.
2542
+ :type _content_type: str, Optional
2543
+ :param _headers: set to override the headers for a single
2544
+ request; this effectively ignores the headers
2545
+ in the spec for a single request.
2546
+ :type _headers: dict, optional
2547
+ :param _host_index: set to override the host_index for a single
2548
+ request; this effectively ignores the host_index
2549
+ in the spec for a single request.
2550
+ :type _host_index: int, optional
2551
+ :return: Returns the result object.
2552
+ """ # noqa: E501 docstring might be too long
2553
+ warnings.warn("GET /v1/projects/{projectId} is deprecated.", DeprecationWarning)
2554
+
2555
+ _param = self._get_service_status_serialize(
2556
+ project_id=project_id,
2557
+ _request_auth=_request_auth,
2558
+ _content_type=_content_type,
2559
+ _headers=_headers,
2560
+ _host_index=_host_index,
2561
+ )
2562
+
2563
+ _response_types_map: Dict[str, Optional[str]] = {
2564
+ "200": "GetServiceStatusResponse",
2565
+ "400": None,
2566
+ "401": "str",
2567
+ "403": None,
2568
+ "500": None,
2569
+ }
2570
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2571
+ return response_data.response
2572
+
2573
+ def _get_service_status_serialize(
2574
+ self,
2575
+ project_id,
2576
+ _request_auth,
2577
+ _content_type,
2578
+ _headers,
2579
+ _host_index,
2580
+ ) -> RequestSerialized:
2581
+
2582
+ _host = None
2583
+
2584
+ _collection_formats: Dict[str, str] = {}
2585
+
2586
+ _path_params: Dict[str, str] = {}
2587
+ _query_params: List[Tuple[str, str]] = []
2588
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2589
+ _form_params: List[Tuple[str, str]] = []
2590
+ _files: Dict[str, Union[str, bytes]] = {}
2591
+ _body_params: Optional[bytes] = None
2592
+
2593
+ # process the path parameters
2594
+ if project_id is not None:
2595
+ _path_params["projectId"] = project_id
2596
+ # process the query parameters
2597
+ # process the header parameters
2598
+ # process the form parameters
2599
+ # process the body parameter
2600
+
2601
+ # set the HTTP header `Accept`
2602
+ if "Accept" not in _header_params:
2603
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
2604
+
2605
+ # authentication setting
2606
+ _auth_settings: List[str] = []
2607
+
2608
+ return self.api_client.param_serialize(
2609
+ method="GET",
2610
+ resource_path="/v1/projects/{projectId}",
2611
+ path_params=_path_params,
2612
+ query_params=_query_params,
2613
+ header_params=_header_params,
2614
+ body=_body_params,
2615
+ post_params=_form_params,
2616
+ files=_files,
2617
+ auth_settings=_auth_settings,
2618
+ collection_formats=_collection_formats,
2619
+ _host=_host,
2620
+ _request_auth=_request_auth,
2621
+ )
2622
+
2623
+ @validate_call
2624
+ def list_credentials(
2625
+ self,
2626
+ project_id: StrictStr,
2627
+ _request_timeout: Union[
2628
+ None,
2629
+ Annotated[StrictFloat, Field(gt=0)],
2630
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2631
+ ] = None,
2632
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2633
+ _content_type: Optional[StrictStr] = None,
2634
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2635
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2636
+ ) -> ListCredentialsResponse:
2637
+ """List all credentials in a project.
2638
+
2639
+ List Credentials
2640
+
2641
+ :param project_id: (required)
2642
+ :type project_id: str
2643
+ :param _request_timeout: timeout setting for this request. If one
2644
+ number provided, it will be total request
2645
+ timeout. It can also be a pair (tuple) of
2646
+ (connection, read) timeouts.
2647
+ :type _request_timeout: int, tuple(int, int), optional
2648
+ :param _request_auth: set to override the auth_settings for an a single
2649
+ request; this effectively ignores the
2650
+ authentication in the spec for a single request.
2651
+ :type _request_auth: dict, optional
2652
+ :param _content_type: force content-type for the request.
2653
+ :type _content_type: str, Optional
2654
+ :param _headers: set to override the headers for a single
2655
+ request; this effectively ignores the headers
2656
+ in the spec for a single request.
2657
+ :type _headers: dict, optional
2658
+ :param _host_index: set to override the host_index for a single
2659
+ request; this effectively ignores the host_index
2660
+ in the spec for a single request.
2661
+ :type _host_index: int, optional
2662
+ :return: Returns the result object.
2663
+ """ # noqa: E501 docstring might be too long
2664
+
2665
+ _param = self._list_credentials_serialize(
2666
+ project_id=project_id,
2667
+ _request_auth=_request_auth,
2668
+ _content_type=_content_type,
2669
+ _headers=_headers,
2670
+ _host_index=_host_index,
2671
+ )
2672
+
2673
+ _response_types_map: Dict[str, Optional[str]] = {
2674
+ "200": "ListCredentialsResponse",
2675
+ "401": "str",
2676
+ "403": None,
2677
+ "500": None,
2678
+ }
2679
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2680
+ response_data.read()
2681
+ return self.api_client.response_deserialize(
2682
+ response_data=response_data,
2683
+ response_types_map=_response_types_map,
2684
+ ).data
2685
+
2686
+ @validate_call
2687
+ def list_credentials_with_http_info(
2688
+ self,
2689
+ project_id: StrictStr,
2690
+ _request_timeout: Union[
2691
+ None,
2692
+ Annotated[StrictFloat, Field(gt=0)],
2693
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2694
+ ] = None,
2695
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2696
+ _content_type: Optional[StrictStr] = None,
2697
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2698
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2699
+ ) -> ApiResponse[ListCredentialsResponse]:
2700
+ """List all credentials in a project.
2701
+
2702
+ List Credentials
2703
+
2704
+ :param project_id: (required)
2705
+ :type project_id: str
2706
+ :param _request_timeout: timeout setting for this request. If one
2707
+ number provided, it will be total request
2708
+ timeout. It can also be a pair (tuple) of
2709
+ (connection, read) timeouts.
2710
+ :type _request_timeout: int, tuple(int, int), optional
2711
+ :param _request_auth: set to override the auth_settings for an a single
2712
+ request; this effectively ignores the
2713
+ authentication in the spec for a single request.
2714
+ :type _request_auth: dict, optional
2715
+ :param _content_type: force content-type for the request.
2716
+ :type _content_type: str, Optional
2717
+ :param _headers: set to override the headers for a single
2718
+ request; this effectively ignores the headers
2719
+ in the spec for a single request.
2720
+ :type _headers: dict, optional
2721
+ :param _host_index: set to override the host_index for a single
2722
+ request; this effectively ignores the host_index
2723
+ in the spec for a single request.
2724
+ :type _host_index: int, optional
2725
+ :return: Returns the result object.
2726
+ """ # noqa: E501 docstring might be too long
2727
+
2728
+ _param = self._list_credentials_serialize(
2729
+ project_id=project_id,
2730
+ _request_auth=_request_auth,
2731
+ _content_type=_content_type,
2732
+ _headers=_headers,
2733
+ _host_index=_host_index,
2734
+ )
2735
+
2736
+ _response_types_map: Dict[str, Optional[str]] = {
2737
+ "200": "ListCredentialsResponse",
2738
+ "401": "str",
2739
+ "403": None,
2740
+ "500": None,
2741
+ }
2742
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2743
+ response_data.read()
2744
+ return self.api_client.response_deserialize(
2745
+ response_data=response_data,
2746
+ response_types_map=_response_types_map,
2747
+ )
2748
+
2749
+ @validate_call
2750
+ def list_credentials_without_preload_content(
2751
+ self,
2752
+ project_id: StrictStr,
2753
+ _request_timeout: Union[
2754
+ None,
2755
+ Annotated[StrictFloat, Field(gt=0)],
2756
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2757
+ ] = None,
2758
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2759
+ _content_type: Optional[StrictStr] = None,
2760
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2761
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2762
+ ) -> RESTResponseType:
2763
+ """List all credentials in a project.
2764
+
2765
+ List Credentials
2766
+
2767
+ :param project_id: (required)
2768
+ :type project_id: str
2769
+ :param _request_timeout: timeout setting for this request. If one
2770
+ number provided, it will be total request
2771
+ timeout. It can also be a pair (tuple) of
2772
+ (connection, read) timeouts.
2773
+ :type _request_timeout: int, tuple(int, int), optional
2774
+ :param _request_auth: set to override the auth_settings for an a single
2775
+ request; this effectively ignores the
2776
+ authentication in the spec for a single request.
2777
+ :type _request_auth: dict, optional
2778
+ :param _content_type: force content-type for the request.
2779
+ :type _content_type: str, Optional
2780
+ :param _headers: set to override the headers for a single
2781
+ request; this effectively ignores the headers
2782
+ in the spec for a single request.
2783
+ :type _headers: dict, optional
2784
+ :param _host_index: set to override the host_index for a single
2785
+ request; this effectively ignores the host_index
2786
+ in the spec for a single request.
2787
+ :type _host_index: int, optional
2788
+ :return: Returns the result object.
2789
+ """ # noqa: E501 docstring might be too long
2790
+
2791
+ _param = self._list_credentials_serialize(
2792
+ project_id=project_id,
2793
+ _request_auth=_request_auth,
2794
+ _content_type=_content_type,
2795
+ _headers=_headers,
2796
+ _host_index=_host_index,
2797
+ )
2798
+
2799
+ _response_types_map: Dict[str, Optional[str]] = {
2800
+ "200": "ListCredentialsResponse",
2801
+ "401": "str",
2802
+ "403": None,
2803
+ "500": None,
2804
+ }
2805
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2806
+ return response_data.response
2807
+
2808
+ def _list_credentials_serialize(
2809
+ self,
2810
+ project_id,
2811
+ _request_auth,
2812
+ _content_type,
2813
+ _headers,
2814
+ _host_index,
2815
+ ) -> RequestSerialized:
2816
+
2817
+ _host = None
2818
+
2819
+ _collection_formats: Dict[str, str] = {}
2820
+
2821
+ _path_params: Dict[str, str] = {}
2822
+ _query_params: List[Tuple[str, str]] = []
2823
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2824
+ _form_params: List[Tuple[str, str]] = []
2825
+ _files: Dict[str, Union[str, bytes]] = {}
2826
+ _body_params: Optional[bytes] = None
2827
+
2828
+ # process the path parameters
2829
+ if project_id is not None:
2830
+ _path_params["projectId"] = project_id
2831
+ # process the query parameters
2832
+ # process the header parameters
2833
+ # process the form parameters
2834
+ # process the body parameter
2835
+
2836
+ # set the HTTP header `Accept`
2837
+ if "Accept" not in _header_params:
2838
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
2839
+
2840
+ # authentication setting
2841
+ _auth_settings: List[str] = []
2842
+
2843
+ return self.api_client.param_serialize(
2844
+ method="GET",
2845
+ resource_path="/v1/projects/{projectId}/credentials",
2846
+ path_params=_path_params,
2847
+ query_params=_query_params,
2848
+ header_params=_header_params,
2849
+ body=_body_params,
2850
+ post_params=_form_params,
2851
+ files=_files,
2852
+ auth_settings=_auth_settings,
2853
+ collection_formats=_collection_formats,
2854
+ _host=_host,
2855
+ _request_auth=_request_auth,
2856
+ )
2857
+
2858
+ @validate_call
2859
+ def list_load_balancers(
2860
+ self,
2861
+ project_id: StrictStr,
2862
+ page_size: Annotated[
2863
+ Optional[StrictStr],
2864
+ Field(
2865
+ description="page_size specifies how many load balancers should be returned on this page. Must be a positive number <= 1000"
2866
+ ),
2867
+ ] = None,
2868
+ page_id: Annotated[
2869
+ Optional[StrictStr],
2870
+ Field(
2871
+ description="page_id is a page identifier returned by the previous response and is used to request the next page"
2872
+ ),
2873
+ ] = None,
2874
+ _request_timeout: Union[
2875
+ None,
2876
+ Annotated[StrictFloat, Field(gt=0)],
2877
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2878
+ ] = None,
2879
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2880
+ _content_type: Optional[StrictStr] = None,
2881
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2882
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2883
+ ) -> ListLoadBalancersResponse:
2884
+ """List load balancers in a project.
2885
+
2886
+ ListLoadBalancer will list load balancers of a project. This contains information set during creation or updates for every load balancer in the project. Additionally, it will have information about the state of the load balancer in the form of a status field and error description feedback.
2887
+
2888
+ :param project_id: (required)
2889
+ :type project_id: str
2890
+ :param page_size: page_size specifies how many load balancers should be returned on this page. Must be a positive number <= 1000
2891
+ :type page_size: str
2892
+ :param page_id: page_id is a page identifier returned by the previous response and is used to request the next page
2893
+ :type page_id: str
2894
+ :param _request_timeout: timeout setting for this request. If one
2895
+ number provided, it will be total request
2896
+ timeout. It can also be a pair (tuple) of
2897
+ (connection, read) timeouts.
2898
+ :type _request_timeout: int, tuple(int, int), optional
2899
+ :param _request_auth: set to override the auth_settings for an a single
2900
+ request; this effectively ignores the
2901
+ authentication in the spec for a single request.
2902
+ :type _request_auth: dict, optional
2903
+ :param _content_type: force content-type for the request.
2904
+ :type _content_type: str, Optional
2905
+ :param _headers: set to override the headers for a single
2906
+ request; this effectively ignores the headers
2907
+ in the spec for a single request.
2908
+ :type _headers: dict, optional
2909
+ :param _host_index: set to override the host_index for a single
2910
+ request; this effectively ignores the host_index
2911
+ in the spec for a single request.
2912
+ :type _host_index: int, optional
2913
+ :return: Returns the result object.
2914
+ """ # noqa: E501 docstring might be too long
2915
+
2916
+ _param = self._list_load_balancers_serialize(
2917
+ project_id=project_id,
2918
+ page_size=page_size,
2919
+ page_id=page_id,
2920
+ _request_auth=_request_auth,
2921
+ _content_type=_content_type,
2922
+ _headers=_headers,
2923
+ _host_index=_host_index,
2924
+ )
2925
+
2926
+ _response_types_map: Dict[str, Optional[str]] = {
2927
+ "200": "ListLoadBalancersResponse",
2928
+ "400": None,
2929
+ "401": "str",
2930
+ "403": None,
2931
+ "410": None,
2932
+ "500": None,
2933
+ }
2934
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2935
+ response_data.read()
2936
+ return self.api_client.response_deserialize(
2937
+ response_data=response_data,
2938
+ response_types_map=_response_types_map,
2939
+ ).data
2940
+
2941
+ @validate_call
2942
+ def list_load_balancers_with_http_info(
2943
+ self,
2944
+ project_id: StrictStr,
2945
+ page_size: Annotated[
2946
+ Optional[StrictStr],
2947
+ Field(
2948
+ description="page_size specifies how many load balancers should be returned on this page. Must be a positive number <= 1000"
2949
+ ),
2950
+ ] = None,
2951
+ page_id: Annotated[
2952
+ Optional[StrictStr],
2953
+ Field(
2954
+ description="page_id is a page identifier returned by the previous response and is used to request the next page"
2955
+ ),
2956
+ ] = None,
2957
+ _request_timeout: Union[
2958
+ None,
2959
+ Annotated[StrictFloat, Field(gt=0)],
2960
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2961
+ ] = None,
2962
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2963
+ _content_type: Optional[StrictStr] = None,
2964
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2965
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2966
+ ) -> ApiResponse[ListLoadBalancersResponse]:
2967
+ """List load balancers in a project.
2968
+
2969
+ ListLoadBalancer will list load balancers of a project. This contains information set during creation or updates for every load balancer in the project. Additionally, it will have information about the state of the load balancer in the form of a status field and error description feedback.
2970
+
2971
+ :param project_id: (required)
2972
+ :type project_id: str
2973
+ :param page_size: page_size specifies how many load balancers should be returned on this page. Must be a positive number <= 1000
2974
+ :type page_size: str
2975
+ :param page_id: page_id is a page identifier returned by the previous response and is used to request the next page
2976
+ :type page_id: str
2977
+ :param _request_timeout: timeout setting for this request. If one
2978
+ number provided, it will be total request
2979
+ timeout. It can also be a pair (tuple) of
2980
+ (connection, read) timeouts.
2981
+ :type _request_timeout: int, tuple(int, int), optional
2982
+ :param _request_auth: set to override the auth_settings for an a single
2983
+ request; this effectively ignores the
2984
+ authentication in the spec for a single request.
2985
+ :type _request_auth: dict, optional
2986
+ :param _content_type: force content-type for the request.
2987
+ :type _content_type: str, Optional
2988
+ :param _headers: set to override the headers for a single
2989
+ request; this effectively ignores the headers
2990
+ in the spec for a single request.
2991
+ :type _headers: dict, optional
2992
+ :param _host_index: set to override the host_index for a single
2993
+ request; this effectively ignores the host_index
2994
+ in the spec for a single request.
2995
+ :type _host_index: int, optional
2996
+ :return: Returns the result object.
2997
+ """ # noqa: E501 docstring might be too long
2998
+
2999
+ _param = self._list_load_balancers_serialize(
3000
+ project_id=project_id,
3001
+ page_size=page_size,
3002
+ page_id=page_id,
3003
+ _request_auth=_request_auth,
3004
+ _content_type=_content_type,
3005
+ _headers=_headers,
3006
+ _host_index=_host_index,
3007
+ )
3008
+
3009
+ _response_types_map: Dict[str, Optional[str]] = {
3010
+ "200": "ListLoadBalancersResponse",
3011
+ "400": None,
3012
+ "401": "str",
3013
+ "403": None,
3014
+ "410": None,
3015
+ "500": None,
3016
+ }
3017
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3018
+ response_data.read()
3019
+ return self.api_client.response_deserialize(
3020
+ response_data=response_data,
3021
+ response_types_map=_response_types_map,
3022
+ )
3023
+
3024
+ @validate_call
3025
+ def list_load_balancers_without_preload_content(
3026
+ self,
3027
+ project_id: StrictStr,
3028
+ page_size: Annotated[
3029
+ Optional[StrictStr],
3030
+ Field(
3031
+ description="page_size specifies how many load balancers should be returned on this page. Must be a positive number <= 1000"
3032
+ ),
3033
+ ] = None,
3034
+ page_id: Annotated[
3035
+ Optional[StrictStr],
3036
+ Field(
3037
+ description="page_id is a page identifier returned by the previous response and is used to request the next page"
3038
+ ),
3039
+ ] = None,
3040
+ _request_timeout: Union[
3041
+ None,
3042
+ Annotated[StrictFloat, Field(gt=0)],
3043
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3044
+ ] = None,
3045
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3046
+ _content_type: Optional[StrictStr] = None,
3047
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3048
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3049
+ ) -> RESTResponseType:
3050
+ """List load balancers in a project.
3051
+
3052
+ ListLoadBalancer will list load balancers of a project. This contains information set during creation or updates for every load balancer in the project. Additionally, it will have information about the state of the load balancer in the form of a status field and error description feedback.
3053
+
3054
+ :param project_id: (required)
3055
+ :type project_id: str
3056
+ :param page_size: page_size specifies how many load balancers should be returned on this page. Must be a positive number <= 1000
3057
+ :type page_size: str
3058
+ :param page_id: page_id is a page identifier returned by the previous response and is used to request the next page
3059
+ :type page_id: str
3060
+ :param _request_timeout: timeout setting for this request. If one
3061
+ number provided, it will be total request
3062
+ timeout. It can also be a pair (tuple) of
3063
+ (connection, read) timeouts.
3064
+ :type _request_timeout: int, tuple(int, int), optional
3065
+ :param _request_auth: set to override the auth_settings for an a single
3066
+ request; this effectively ignores the
3067
+ authentication in the spec for a single request.
3068
+ :type _request_auth: dict, optional
3069
+ :param _content_type: force content-type for the request.
3070
+ :type _content_type: str, Optional
3071
+ :param _headers: set to override the headers for a single
3072
+ request; this effectively ignores the headers
3073
+ in the spec for a single request.
3074
+ :type _headers: dict, optional
3075
+ :param _host_index: set to override the host_index for a single
3076
+ request; this effectively ignores the host_index
3077
+ in the spec for a single request.
3078
+ :type _host_index: int, optional
3079
+ :return: Returns the result object.
3080
+ """ # noqa: E501 docstring might be too long
3081
+
3082
+ _param = self._list_load_balancers_serialize(
3083
+ project_id=project_id,
3084
+ page_size=page_size,
3085
+ page_id=page_id,
3086
+ _request_auth=_request_auth,
3087
+ _content_type=_content_type,
3088
+ _headers=_headers,
3089
+ _host_index=_host_index,
3090
+ )
3091
+
3092
+ _response_types_map: Dict[str, Optional[str]] = {
3093
+ "200": "ListLoadBalancersResponse",
3094
+ "400": None,
3095
+ "401": "str",
3096
+ "403": None,
3097
+ "410": None,
3098
+ "500": None,
3099
+ }
3100
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3101
+ return response_data.response
3102
+
3103
+ def _list_load_balancers_serialize(
3104
+ self,
3105
+ project_id,
3106
+ page_size,
3107
+ page_id,
3108
+ _request_auth,
3109
+ _content_type,
3110
+ _headers,
3111
+ _host_index,
3112
+ ) -> RequestSerialized:
3113
+
3114
+ _host = None
3115
+
3116
+ _collection_formats: Dict[str, str] = {}
3117
+
3118
+ _path_params: Dict[str, str] = {}
3119
+ _query_params: List[Tuple[str, str]] = []
3120
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3121
+ _form_params: List[Tuple[str, str]] = []
3122
+ _files: Dict[str, Union[str, bytes]] = {}
3123
+ _body_params: Optional[bytes] = None
3124
+
3125
+ # process the path parameters
3126
+ if project_id is not None:
3127
+ _path_params["projectId"] = project_id
3128
+ # process the query parameters
3129
+ if page_size is not None:
3130
+
3131
+ _query_params.append(("pageSize", page_size))
3132
+
3133
+ if page_id is not None:
3134
+
3135
+ _query_params.append(("pageId", page_id))
3136
+
3137
+ # process the header parameters
3138
+ # process the form parameters
3139
+ # process the body parameter
3140
+
3141
+ # set the HTTP header `Accept`
3142
+ if "Accept" not in _header_params:
3143
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
3144
+
3145
+ # authentication setting
3146
+ _auth_settings: List[str] = []
3147
+
3148
+ return self.api_client.param_serialize(
3149
+ method="GET",
3150
+ resource_path="/v1/projects/{projectId}/load-balancers",
3151
+ path_params=_path_params,
3152
+ query_params=_query_params,
3153
+ header_params=_header_params,
3154
+ body=_body_params,
3155
+ post_params=_form_params,
3156
+ files=_files,
3157
+ auth_settings=_auth_settings,
3158
+ collection_formats=_collection_formats,
3159
+ _host=_host,
3160
+ _request_auth=_request_auth,
3161
+ )
3162
+
3163
+ @validate_call
3164
+ def list_plans(
3165
+ self,
3166
+ _request_timeout: Union[
3167
+ None,
3168
+ Annotated[StrictFloat, Field(gt=0)],
3169
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3170
+ ] = None,
3171
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3172
+ _content_type: Optional[StrictStr] = None,
3173
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3174
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3175
+ ) -> ListPlansResponse:
3176
+ """List available service plans.
3177
+
3178
+ ListPlans returns for the configured service plans for a project.
3179
+
3180
+ :param _request_timeout: timeout setting for this request. If one
3181
+ number provided, it will be total request
3182
+ timeout. It can also be a pair (tuple) of
3183
+ (connection, read) timeouts.
3184
+ :type _request_timeout: int, tuple(int, int), optional
3185
+ :param _request_auth: set to override the auth_settings for an a single
3186
+ request; this effectively ignores the
3187
+ authentication in the spec for a single request.
3188
+ :type _request_auth: dict, optional
3189
+ :param _content_type: force content-type for the request.
3190
+ :type _content_type: str, Optional
3191
+ :param _headers: set to override the headers for a single
3192
+ request; this effectively ignores the headers
3193
+ in the spec for a single request.
3194
+ :type _headers: dict, optional
3195
+ :param _host_index: set to override the host_index for a single
3196
+ request; this effectively ignores the host_index
3197
+ in the spec for a single request.
3198
+ :type _host_index: int, optional
3199
+ :return: Returns the result object.
3200
+ """ # noqa: E501 docstring might be too long
3201
+
3202
+ _param = self._list_plans_serialize(
3203
+ _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
3204
+ )
3205
+
3206
+ _response_types_map: Dict[str, Optional[str]] = {
3207
+ "200": "ListPlansResponse",
3208
+ "400": None,
3209
+ "401": "str",
3210
+ "403": None,
3211
+ "500": None,
3212
+ }
3213
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3214
+ response_data.read()
3215
+ return self.api_client.response_deserialize(
3216
+ response_data=response_data,
3217
+ response_types_map=_response_types_map,
3218
+ ).data
3219
+
3220
+ @validate_call
3221
+ def list_plans_with_http_info(
3222
+ self,
3223
+ _request_timeout: Union[
3224
+ None,
3225
+ Annotated[StrictFloat, Field(gt=0)],
3226
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3227
+ ] = None,
3228
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3229
+ _content_type: Optional[StrictStr] = None,
3230
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3231
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3232
+ ) -> ApiResponse[ListPlansResponse]:
3233
+ """List available service plans.
3234
+
3235
+ ListPlans returns for the configured service plans for a project.
3236
+
3237
+ :param _request_timeout: timeout setting for this request. If one
3238
+ number provided, it will be total request
3239
+ timeout. It can also be a pair (tuple) of
3240
+ (connection, read) timeouts.
3241
+ :type _request_timeout: int, tuple(int, int), optional
3242
+ :param _request_auth: set to override the auth_settings for an a single
3243
+ request; this effectively ignores the
3244
+ authentication in the spec for a single request.
3245
+ :type _request_auth: dict, optional
3246
+ :param _content_type: force content-type for the request.
3247
+ :type _content_type: str, Optional
3248
+ :param _headers: set to override the headers for a single
3249
+ request; this effectively ignores the headers
3250
+ in the spec for a single request.
3251
+ :type _headers: dict, optional
3252
+ :param _host_index: set to override the host_index for a single
3253
+ request; this effectively ignores the host_index
3254
+ in the spec for a single request.
3255
+ :type _host_index: int, optional
3256
+ :return: Returns the result object.
3257
+ """ # noqa: E501 docstring might be too long
3258
+
3259
+ _param = self._list_plans_serialize(
3260
+ _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
3261
+ )
3262
+
3263
+ _response_types_map: Dict[str, Optional[str]] = {
3264
+ "200": "ListPlansResponse",
3265
+ "400": None,
3266
+ "401": "str",
3267
+ "403": None,
3268
+ "500": None,
3269
+ }
3270
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3271
+ response_data.read()
3272
+ return self.api_client.response_deserialize(
3273
+ response_data=response_data,
3274
+ response_types_map=_response_types_map,
3275
+ )
3276
+
3277
+ @validate_call
3278
+ def list_plans_without_preload_content(
3279
+ self,
3280
+ _request_timeout: Union[
3281
+ None,
3282
+ Annotated[StrictFloat, Field(gt=0)],
3283
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3284
+ ] = None,
3285
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3286
+ _content_type: Optional[StrictStr] = None,
3287
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3288
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3289
+ ) -> RESTResponseType:
3290
+ """List available service plans.
3291
+
3292
+ ListPlans returns for the configured service plans for a project.
3293
+
3294
+ :param _request_timeout: timeout setting for this request. If one
3295
+ number provided, it will be total request
3296
+ timeout. It can also be a pair (tuple) of
3297
+ (connection, read) timeouts.
3298
+ :type _request_timeout: int, tuple(int, int), optional
3299
+ :param _request_auth: set to override the auth_settings for an a single
3300
+ request; this effectively ignores the
3301
+ authentication in the spec for a single request.
3302
+ :type _request_auth: dict, optional
3303
+ :param _content_type: force content-type for the request.
3304
+ :type _content_type: str, Optional
3305
+ :param _headers: set to override the headers for a single
3306
+ request; this effectively ignores the headers
3307
+ in the spec for a single request.
3308
+ :type _headers: dict, optional
3309
+ :param _host_index: set to override the host_index for a single
3310
+ request; this effectively ignores the host_index
3311
+ in the spec for a single request.
3312
+ :type _host_index: int, optional
3313
+ :return: Returns the result object.
3314
+ """ # noqa: E501 docstring might be too long
3315
+
3316
+ _param = self._list_plans_serialize(
3317
+ _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
3318
+ )
3319
+
3320
+ _response_types_map: Dict[str, Optional[str]] = {
3321
+ "200": "ListPlansResponse",
3322
+ "400": None,
3323
+ "401": "str",
3324
+ "403": None,
3325
+ "500": None,
3326
+ }
3327
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3328
+ return response_data.response
3329
+
3330
+ def _list_plans_serialize(
3331
+ self,
3332
+ _request_auth,
3333
+ _content_type,
3334
+ _headers,
3335
+ _host_index,
3336
+ ) -> RequestSerialized:
3337
+
3338
+ _host = None
3339
+
3340
+ _collection_formats: Dict[str, str] = {}
3341
+
3342
+ _path_params: Dict[str, str] = {}
3343
+ _query_params: List[Tuple[str, str]] = []
3344
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3345
+ _form_params: List[Tuple[str, str]] = []
3346
+ _files: Dict[str, Union[str, bytes]] = {}
3347
+ _body_params: Optional[bytes] = None
3348
+
3349
+ # process the path parameters
3350
+ # process the query parameters
3351
+ # process the header parameters
3352
+ # process the form parameters
3353
+ # process the body parameter
3354
+
3355
+ # set the HTTP header `Accept`
3356
+ if "Accept" not in _header_params:
3357
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
3358
+
3359
+ # authentication setting
3360
+ _auth_settings: List[str] = []
3361
+
3362
+ return self.api_client.param_serialize(
3363
+ method="GET",
3364
+ resource_path="/v1/plans",
3365
+ path_params=_path_params,
3366
+ query_params=_query_params,
3367
+ header_params=_header_params,
3368
+ body=_body_params,
3369
+ post_params=_form_params,
3370
+ files=_files,
3371
+ auth_settings=_auth_settings,
3372
+ collection_formats=_collection_formats,
3373
+ _host=_host,
3374
+ _request_auth=_request_auth,
3375
+ )
3376
+
3377
+ @validate_call
3378
+ def update_credentials(
3379
+ self,
3380
+ project_id: StrictStr,
3381
+ credentials_ref: StrictStr,
3382
+ update_credentials_payload: UpdateCredentialsPayload,
3383
+ _request_timeout: Union[
3384
+ None,
3385
+ Annotated[StrictFloat, Field(gt=0)],
3386
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3387
+ ] = None,
3388
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3389
+ _content_type: Optional[StrictStr] = None,
3390
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3391
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3392
+ ) -> UpdateCredentialsResponse:
3393
+ """Update credentials for observability in a project.
3394
+
3395
+ Update Credentials
3396
+
3397
+ :param project_id: (required)
3398
+ :type project_id: str
3399
+ :param credentials_ref: (required)
3400
+ :type credentials_ref: str
3401
+ :param update_credentials_payload: (required)
3402
+ :type update_credentials_payload: UpdateCredentialsPayload
3403
+ :param _request_timeout: timeout setting for this request. If one
3404
+ number provided, it will be total request
3405
+ timeout. It can also be a pair (tuple) of
3406
+ (connection, read) timeouts.
3407
+ :type _request_timeout: int, tuple(int, int), optional
3408
+ :param _request_auth: set to override the auth_settings for an a single
3409
+ request; this effectively ignores the
3410
+ authentication in the spec for a single request.
3411
+ :type _request_auth: dict, optional
3412
+ :param _content_type: force content-type for the request.
3413
+ :type _content_type: str, Optional
3414
+ :param _headers: set to override the headers for a single
3415
+ request; this effectively ignores the headers
3416
+ in the spec for a single request.
3417
+ :type _headers: dict, optional
3418
+ :param _host_index: set to override the host_index for a single
3419
+ request; this effectively ignores the host_index
3420
+ in the spec for a single request.
3421
+ :type _host_index: int, optional
3422
+ :return: Returns the result object.
3423
+ """ # noqa: E501 docstring might be too long
3424
+
3425
+ _param = self._update_credentials_serialize(
3426
+ project_id=project_id,
3427
+ credentials_ref=credentials_ref,
3428
+ update_credentials_payload=update_credentials_payload,
3429
+ _request_auth=_request_auth,
3430
+ _content_type=_content_type,
3431
+ _headers=_headers,
3432
+ _host_index=_host_index,
3433
+ )
3434
+
3435
+ _response_types_map: Dict[str, Optional[str]] = {
3436
+ "200": "UpdateCredentialsResponse",
3437
+ "400": None,
3438
+ "401": "str",
3439
+ "403": None,
3440
+ "404": None,
3441
+ "500": None,
3442
+ }
3443
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3444
+ response_data.read()
3445
+ return self.api_client.response_deserialize(
3446
+ response_data=response_data,
3447
+ response_types_map=_response_types_map,
3448
+ ).data
3449
+
3450
+ @validate_call
3451
+ def update_credentials_with_http_info(
3452
+ self,
3453
+ project_id: StrictStr,
3454
+ credentials_ref: StrictStr,
3455
+ update_credentials_payload: UpdateCredentialsPayload,
3456
+ _request_timeout: Union[
3457
+ None,
3458
+ Annotated[StrictFloat, Field(gt=0)],
3459
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3460
+ ] = None,
3461
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3462
+ _content_type: Optional[StrictStr] = None,
3463
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3464
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3465
+ ) -> ApiResponse[UpdateCredentialsResponse]:
3466
+ """Update credentials for observability in a project.
3467
+
3468
+ Update Credentials
3469
+
3470
+ :param project_id: (required)
3471
+ :type project_id: str
3472
+ :param credentials_ref: (required)
3473
+ :type credentials_ref: str
3474
+ :param update_credentials_payload: (required)
3475
+ :type update_credentials_payload: UpdateCredentialsPayload
3476
+ :param _request_timeout: timeout setting for this request. If one
3477
+ number provided, it will be total request
3478
+ timeout. It can also be a pair (tuple) of
3479
+ (connection, read) timeouts.
3480
+ :type _request_timeout: int, tuple(int, int), optional
3481
+ :param _request_auth: set to override the auth_settings for an a single
3482
+ request; this effectively ignores the
3483
+ authentication in the spec for a single request.
3484
+ :type _request_auth: dict, optional
3485
+ :param _content_type: force content-type for the request.
3486
+ :type _content_type: str, Optional
3487
+ :param _headers: set to override the headers for a single
3488
+ request; this effectively ignores the headers
3489
+ in the spec for a single request.
3490
+ :type _headers: dict, optional
3491
+ :param _host_index: set to override the host_index for a single
3492
+ request; this effectively ignores the host_index
3493
+ in the spec for a single request.
3494
+ :type _host_index: int, optional
3495
+ :return: Returns the result object.
3496
+ """ # noqa: E501 docstring might be too long
3497
+
3498
+ _param = self._update_credentials_serialize(
3499
+ project_id=project_id,
3500
+ credentials_ref=credentials_ref,
3501
+ update_credentials_payload=update_credentials_payload,
3502
+ _request_auth=_request_auth,
3503
+ _content_type=_content_type,
3504
+ _headers=_headers,
3505
+ _host_index=_host_index,
3506
+ )
3507
+
3508
+ _response_types_map: Dict[str, Optional[str]] = {
3509
+ "200": "UpdateCredentialsResponse",
3510
+ "400": None,
3511
+ "401": "str",
3512
+ "403": None,
3513
+ "404": None,
3514
+ "500": None,
3515
+ }
3516
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3517
+ response_data.read()
3518
+ return self.api_client.response_deserialize(
3519
+ response_data=response_data,
3520
+ response_types_map=_response_types_map,
3521
+ )
3522
+
3523
+ @validate_call
3524
+ def update_credentials_without_preload_content(
3525
+ self,
3526
+ project_id: StrictStr,
3527
+ credentials_ref: StrictStr,
3528
+ update_credentials_payload: UpdateCredentialsPayload,
3529
+ _request_timeout: Union[
3530
+ None,
3531
+ Annotated[StrictFloat, Field(gt=0)],
3532
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3533
+ ] = None,
3534
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3535
+ _content_type: Optional[StrictStr] = None,
3536
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3537
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3538
+ ) -> RESTResponseType:
3539
+ """Update credentials for observability in a project.
3540
+
3541
+ Update Credentials
3542
+
3543
+ :param project_id: (required)
3544
+ :type project_id: str
3545
+ :param credentials_ref: (required)
3546
+ :type credentials_ref: str
3547
+ :param update_credentials_payload: (required)
3548
+ :type update_credentials_payload: UpdateCredentialsPayload
3549
+ :param _request_timeout: timeout setting for this request. If one
3550
+ number provided, it will be total request
3551
+ timeout. It can also be a pair (tuple) of
3552
+ (connection, read) timeouts.
3553
+ :type _request_timeout: int, tuple(int, int), optional
3554
+ :param _request_auth: set to override the auth_settings for an a single
3555
+ request; this effectively ignores the
3556
+ authentication in the spec for a single request.
3557
+ :type _request_auth: dict, optional
3558
+ :param _content_type: force content-type for the request.
3559
+ :type _content_type: str, Optional
3560
+ :param _headers: set to override the headers for a single
3561
+ request; this effectively ignores the headers
3562
+ in the spec for a single request.
3563
+ :type _headers: dict, optional
3564
+ :param _host_index: set to override the host_index for a single
3565
+ request; this effectively ignores the host_index
3566
+ in the spec for a single request.
3567
+ :type _host_index: int, optional
3568
+ :return: Returns the result object.
3569
+ """ # noqa: E501 docstring might be too long
3570
+
3571
+ _param = self._update_credentials_serialize(
3572
+ project_id=project_id,
3573
+ credentials_ref=credentials_ref,
3574
+ update_credentials_payload=update_credentials_payload,
3575
+ _request_auth=_request_auth,
3576
+ _content_type=_content_type,
3577
+ _headers=_headers,
3578
+ _host_index=_host_index,
3579
+ )
3580
+
3581
+ _response_types_map: Dict[str, Optional[str]] = {
3582
+ "200": "UpdateCredentialsResponse",
3583
+ "400": None,
3584
+ "401": "str",
3585
+ "403": None,
3586
+ "404": None,
3587
+ "500": None,
3588
+ }
3589
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3590
+ return response_data.response
3591
+
3592
+ def _update_credentials_serialize(
3593
+ self,
3594
+ project_id,
3595
+ credentials_ref,
3596
+ update_credentials_payload,
3597
+ _request_auth,
3598
+ _content_type,
3599
+ _headers,
3600
+ _host_index,
3601
+ ) -> RequestSerialized:
3602
+
3603
+ _host = None
3604
+
3605
+ _collection_formats: Dict[str, str] = {}
3606
+
3607
+ _path_params: Dict[str, str] = {}
3608
+ _query_params: List[Tuple[str, str]] = []
3609
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3610
+ _form_params: List[Tuple[str, str]] = []
3611
+ _files: Dict[str, Union[str, bytes]] = {}
3612
+ _body_params: Optional[bytes] = None
3613
+
3614
+ # process the path parameters
3615
+ if project_id is not None:
3616
+ _path_params["projectId"] = project_id
3617
+ if credentials_ref is not None:
3618
+ _path_params["credentialsRef"] = credentials_ref
3619
+ # process the query parameters
3620
+ # process the header parameters
3621
+ # process the form parameters
3622
+ # process the body parameter
3623
+ if update_credentials_payload is not None:
3624
+ _body_params = update_credentials_payload
3625
+
3626
+ # set the HTTP header `Accept`
3627
+ if "Accept" not in _header_params:
3628
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
3629
+
3630
+ # set the HTTP header `Content-Type`
3631
+ if _content_type:
3632
+ _header_params["Content-Type"] = _content_type
3633
+ else:
3634
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
3635
+ if _default_content_type is not None:
3636
+ _header_params["Content-Type"] = _default_content_type
3637
+
3638
+ # authentication setting
3639
+ _auth_settings: List[str] = []
3640
+
3641
+ return self.api_client.param_serialize(
3642
+ method="PUT",
3643
+ resource_path="/v1/projects/{projectId}/credentials/{credentialsRef}",
3644
+ path_params=_path_params,
3645
+ query_params=_query_params,
3646
+ header_params=_header_params,
3647
+ body=_body_params,
3648
+ post_params=_form_params,
3649
+ files=_files,
3650
+ auth_settings=_auth_settings,
3651
+ collection_formats=_collection_formats,
3652
+ _host=_host,
3653
+ _request_auth=_request_auth,
3654
+ )
3655
+
3656
+ @validate_call
3657
+ def update_load_balancer(
3658
+ self,
3659
+ project_id: StrictStr,
3660
+ name: StrictStr,
3661
+ update_load_balancer_payload: UpdateLoadBalancerPayload,
3662
+ _request_timeout: Union[
3663
+ None,
3664
+ Annotated[StrictFloat, Field(gt=0)],
3665
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3666
+ ] = None,
3667
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3668
+ _content_type: Optional[StrictStr] = None,
3669
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3670
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3671
+ ) -> LoadBalancer:
3672
+ """Update a load balancer in a project.
3673
+
3674
+ Update Load Balancer allows the change of listeners and target pools of an existing Load Balancer. The Load balancer resource version needs to be the current version to ensure concurrency safe updates. The default load balancing algorithm is round robin unless useSourceIpAddress in session persistence is enabled for a target pool then it is Maglev.
3675
+
3676
+ :param project_id: (required)
3677
+ :type project_id: str
3678
+ :param name: (required)
3679
+ :type name: str
3680
+ :param update_load_balancer_payload: (required)
3681
+ :type update_load_balancer_payload: UpdateLoadBalancerPayload
3682
+ :param _request_timeout: timeout setting for this request. If one
3683
+ number provided, it will be total request
3684
+ timeout. It can also be a pair (tuple) of
3685
+ (connection, read) timeouts.
3686
+ :type _request_timeout: int, tuple(int, int), optional
3687
+ :param _request_auth: set to override the auth_settings for an a single
3688
+ request; this effectively ignores the
3689
+ authentication in the spec for a single request.
3690
+ :type _request_auth: dict, optional
3691
+ :param _content_type: force content-type for the request.
3692
+ :type _content_type: str, Optional
3693
+ :param _headers: set to override the headers for a single
3694
+ request; this effectively ignores the headers
3695
+ in the spec for a single request.
3696
+ :type _headers: dict, optional
3697
+ :param _host_index: set to override the host_index for a single
3698
+ request; this effectively ignores the host_index
3699
+ in the spec for a single request.
3700
+ :type _host_index: int, optional
3701
+ :return: Returns the result object.
3702
+ """ # noqa: E501 docstring might be too long
3703
+
3704
+ _param = self._update_load_balancer_serialize(
3705
+ project_id=project_id,
3706
+ name=name,
3707
+ update_load_balancer_payload=update_load_balancer_payload,
3708
+ _request_auth=_request_auth,
3709
+ _content_type=_content_type,
3710
+ _headers=_headers,
3711
+ _host_index=_host_index,
3712
+ )
3713
+
3714
+ _response_types_map: Dict[str, Optional[str]] = {
3715
+ "200": "LoadBalancer",
3716
+ "400": None,
3717
+ "401": "str",
3718
+ "403": None,
3719
+ "409": None,
3720
+ "500": None,
3721
+ }
3722
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3723
+ response_data.read()
3724
+ return self.api_client.response_deserialize(
3725
+ response_data=response_data,
3726
+ response_types_map=_response_types_map,
3727
+ ).data
3728
+
3729
+ @validate_call
3730
+ def update_load_balancer_with_http_info(
3731
+ self,
3732
+ project_id: StrictStr,
3733
+ name: StrictStr,
3734
+ update_load_balancer_payload: UpdateLoadBalancerPayload,
3735
+ _request_timeout: Union[
3736
+ None,
3737
+ Annotated[StrictFloat, Field(gt=0)],
3738
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3739
+ ] = None,
3740
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3741
+ _content_type: Optional[StrictStr] = None,
3742
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3743
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3744
+ ) -> ApiResponse[LoadBalancer]:
3745
+ """Update a load balancer in a project.
3746
+
3747
+ Update Load Balancer allows the change of listeners and target pools of an existing Load Balancer. The Load balancer resource version needs to be the current version to ensure concurrency safe updates. The default load balancing algorithm is round robin unless useSourceIpAddress in session persistence is enabled for a target pool then it is Maglev.
3748
+
3749
+ :param project_id: (required)
3750
+ :type project_id: str
3751
+ :param name: (required)
3752
+ :type name: str
3753
+ :param update_load_balancer_payload: (required)
3754
+ :type update_load_balancer_payload: UpdateLoadBalancerPayload
3755
+ :param _request_timeout: timeout setting for this request. If one
3756
+ number provided, it will be total request
3757
+ timeout. It can also be a pair (tuple) of
3758
+ (connection, read) timeouts.
3759
+ :type _request_timeout: int, tuple(int, int), optional
3760
+ :param _request_auth: set to override the auth_settings for an a single
3761
+ request; this effectively ignores the
3762
+ authentication in the spec for a single request.
3763
+ :type _request_auth: dict, optional
3764
+ :param _content_type: force content-type for the request.
3765
+ :type _content_type: str, Optional
3766
+ :param _headers: set to override the headers for a single
3767
+ request; this effectively ignores the headers
3768
+ in the spec for a single request.
3769
+ :type _headers: dict, optional
3770
+ :param _host_index: set to override the host_index for a single
3771
+ request; this effectively ignores the host_index
3772
+ in the spec for a single request.
3773
+ :type _host_index: int, optional
3774
+ :return: Returns the result object.
3775
+ """ # noqa: E501 docstring might be too long
3776
+
3777
+ _param = self._update_load_balancer_serialize(
3778
+ project_id=project_id,
3779
+ name=name,
3780
+ update_load_balancer_payload=update_load_balancer_payload,
3781
+ _request_auth=_request_auth,
3782
+ _content_type=_content_type,
3783
+ _headers=_headers,
3784
+ _host_index=_host_index,
3785
+ )
3786
+
3787
+ _response_types_map: Dict[str, Optional[str]] = {
3788
+ "200": "LoadBalancer",
3789
+ "400": None,
3790
+ "401": "str",
3791
+ "403": None,
3792
+ "409": None,
3793
+ "500": None,
3794
+ }
3795
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3796
+ response_data.read()
3797
+ return self.api_client.response_deserialize(
3798
+ response_data=response_data,
3799
+ response_types_map=_response_types_map,
3800
+ )
3801
+
3802
+ @validate_call
3803
+ def update_load_balancer_without_preload_content(
3804
+ self,
3805
+ project_id: StrictStr,
3806
+ name: StrictStr,
3807
+ update_load_balancer_payload: UpdateLoadBalancerPayload,
3808
+ _request_timeout: Union[
3809
+ None,
3810
+ Annotated[StrictFloat, Field(gt=0)],
3811
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3812
+ ] = None,
3813
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3814
+ _content_type: Optional[StrictStr] = None,
3815
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3816
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3817
+ ) -> RESTResponseType:
3818
+ """Update a load balancer in a project.
3819
+
3820
+ Update Load Balancer allows the change of listeners and target pools of an existing Load Balancer. The Load balancer resource version needs to be the current version to ensure concurrency safe updates. The default load balancing algorithm is round robin unless useSourceIpAddress in session persistence is enabled for a target pool then it is Maglev.
3821
+
3822
+ :param project_id: (required)
3823
+ :type project_id: str
3824
+ :param name: (required)
3825
+ :type name: str
3826
+ :param update_load_balancer_payload: (required)
3827
+ :type update_load_balancer_payload: UpdateLoadBalancerPayload
3828
+ :param _request_timeout: timeout setting for this request. If one
3829
+ number provided, it will be total request
3830
+ timeout. It can also be a pair (tuple) of
3831
+ (connection, read) timeouts.
3832
+ :type _request_timeout: int, tuple(int, int), optional
3833
+ :param _request_auth: set to override the auth_settings for an a single
3834
+ request; this effectively ignores the
3835
+ authentication in the spec for a single request.
3836
+ :type _request_auth: dict, optional
3837
+ :param _content_type: force content-type for the request.
3838
+ :type _content_type: str, Optional
3839
+ :param _headers: set to override the headers for a single
3840
+ request; this effectively ignores the headers
3841
+ in the spec for a single request.
3842
+ :type _headers: dict, optional
3843
+ :param _host_index: set to override the host_index for a single
3844
+ request; this effectively ignores the host_index
3845
+ in the spec for a single request.
3846
+ :type _host_index: int, optional
3847
+ :return: Returns the result object.
3848
+ """ # noqa: E501 docstring might be too long
3849
+
3850
+ _param = self._update_load_balancer_serialize(
3851
+ project_id=project_id,
3852
+ name=name,
3853
+ update_load_balancer_payload=update_load_balancer_payload,
3854
+ _request_auth=_request_auth,
3855
+ _content_type=_content_type,
3856
+ _headers=_headers,
3857
+ _host_index=_host_index,
3858
+ )
3859
+
3860
+ _response_types_map: Dict[str, Optional[str]] = {
3861
+ "200": "LoadBalancer",
3862
+ "400": None,
3863
+ "401": "str",
3864
+ "403": None,
3865
+ "409": None,
3866
+ "500": None,
3867
+ }
3868
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3869
+ return response_data.response
3870
+
3871
+ def _update_load_balancer_serialize(
3872
+ self,
3873
+ project_id,
3874
+ name,
3875
+ update_load_balancer_payload,
3876
+ _request_auth,
3877
+ _content_type,
3878
+ _headers,
3879
+ _host_index,
3880
+ ) -> RequestSerialized:
3881
+
3882
+ _host = None
3883
+
3884
+ _collection_formats: Dict[str, str] = {}
3885
+
3886
+ _path_params: Dict[str, str] = {}
3887
+ _query_params: List[Tuple[str, str]] = []
3888
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3889
+ _form_params: List[Tuple[str, str]] = []
3890
+ _files: Dict[str, Union[str, bytes]] = {}
3891
+ _body_params: Optional[bytes] = None
3892
+
3893
+ # process the path parameters
3894
+ if project_id is not None:
3895
+ _path_params["projectId"] = project_id
3896
+ if name is not None:
3897
+ _path_params["name"] = name
3898
+ # process the query parameters
3899
+ # process the header parameters
3900
+ # process the form parameters
3901
+ # process the body parameter
3902
+ if update_load_balancer_payload is not None:
3903
+ _body_params = update_load_balancer_payload
3904
+
3905
+ # set the HTTP header `Accept`
3906
+ if "Accept" not in _header_params:
3907
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
3908
+
3909
+ # set the HTTP header `Content-Type`
3910
+ if _content_type:
3911
+ _header_params["Content-Type"] = _content_type
3912
+ else:
3913
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
3914
+ if _default_content_type is not None:
3915
+ _header_params["Content-Type"] = _default_content_type
3916
+
3917
+ # authentication setting
3918
+ _auth_settings: List[str] = []
3919
+
3920
+ return self.api_client.param_serialize(
3921
+ method="PUT",
3922
+ resource_path="/v1/projects/{projectId}/load-balancers/{name}",
3923
+ path_params=_path_params,
3924
+ query_params=_query_params,
3925
+ header_params=_header_params,
3926
+ body=_body_params,
3927
+ post_params=_form_params,
3928
+ files=_files,
3929
+ auth_settings=_auth_settings,
3930
+ collection_formats=_collection_formats,
3931
+ _host=_host,
3932
+ _request_auth=_request_auth,
3933
+ )
3934
+
3935
+ @validate_call
3936
+ def update_target_pool(
3937
+ self,
3938
+ project_id: StrictStr,
3939
+ name: StrictStr,
3940
+ target_pool_name: StrictStr,
3941
+ update_target_pool_payload: UpdateTargetPoolPayload,
3942
+ _request_timeout: Union[
3943
+ None,
3944
+ Annotated[StrictFloat, Field(gt=0)],
3945
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3946
+ ] = None,
3947
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3948
+ _content_type: Optional[StrictStr] = None,
3949
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3950
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3951
+ ) -> TargetPool:
3952
+ """Update a single target pool of a load balancer in a project.
3953
+
3954
+ ReplaceTargetPool will replace a specific target pool of a load balancer with new content. Useful to add/remove target servers. will update a load balancer. Only replaces the mentioned target pools and leaves others unchanged. Cannot be used to create or rename a target pool.
3955
+
3956
+ :param project_id: (required)
3957
+ :type project_id: str
3958
+ :param name: (required)
3959
+ :type name: str
3960
+ :param target_pool_name: (required)
3961
+ :type target_pool_name: str
3962
+ :param update_target_pool_payload: (required)
3963
+ :type update_target_pool_payload: UpdateTargetPoolPayload
3964
+ :param _request_timeout: timeout setting for this request. If one
3965
+ number provided, it will be total request
3966
+ timeout. It can also be a pair (tuple) of
3967
+ (connection, read) timeouts.
3968
+ :type _request_timeout: int, tuple(int, int), optional
3969
+ :param _request_auth: set to override the auth_settings for an a single
3970
+ request; this effectively ignores the
3971
+ authentication in the spec for a single request.
3972
+ :type _request_auth: dict, optional
3973
+ :param _content_type: force content-type for the request.
3974
+ :type _content_type: str, Optional
3975
+ :param _headers: set to override the headers for a single
3976
+ request; this effectively ignores the headers
3977
+ in the spec for a single request.
3978
+ :type _headers: dict, optional
3979
+ :param _host_index: set to override the host_index for a single
3980
+ request; this effectively ignores the host_index
3981
+ in the spec for a single request.
3982
+ :type _host_index: int, optional
3983
+ :return: Returns the result object.
3984
+ """ # noqa: E501 docstring might be too long
3985
+
3986
+ _param = self._update_target_pool_serialize(
3987
+ project_id=project_id,
3988
+ name=name,
3989
+ target_pool_name=target_pool_name,
3990
+ update_target_pool_payload=update_target_pool_payload,
3991
+ _request_auth=_request_auth,
3992
+ _content_type=_content_type,
3993
+ _headers=_headers,
3994
+ _host_index=_host_index,
3995
+ )
3996
+
3997
+ _response_types_map: Dict[str, Optional[str]] = {
3998
+ "200": "TargetPool",
3999
+ "400": None,
4000
+ "401": "str",
4001
+ "403": None,
4002
+ "500": None,
4003
+ }
4004
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
4005
+ response_data.read()
4006
+ return self.api_client.response_deserialize(
4007
+ response_data=response_data,
4008
+ response_types_map=_response_types_map,
4009
+ ).data
4010
+
4011
+ @validate_call
4012
+ def update_target_pool_with_http_info(
4013
+ self,
4014
+ project_id: StrictStr,
4015
+ name: StrictStr,
4016
+ target_pool_name: StrictStr,
4017
+ update_target_pool_payload: UpdateTargetPoolPayload,
4018
+ _request_timeout: Union[
4019
+ None,
4020
+ Annotated[StrictFloat, Field(gt=0)],
4021
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
4022
+ ] = None,
4023
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4024
+ _content_type: Optional[StrictStr] = None,
4025
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4026
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4027
+ ) -> ApiResponse[TargetPool]:
4028
+ """Update a single target pool of a load balancer in a project.
4029
+
4030
+ ReplaceTargetPool will replace a specific target pool of a load balancer with new content. Useful to add/remove target servers. will update a load balancer. Only replaces the mentioned target pools and leaves others unchanged. Cannot be used to create or rename a target pool.
4031
+
4032
+ :param project_id: (required)
4033
+ :type project_id: str
4034
+ :param name: (required)
4035
+ :type name: str
4036
+ :param target_pool_name: (required)
4037
+ :type target_pool_name: str
4038
+ :param update_target_pool_payload: (required)
4039
+ :type update_target_pool_payload: UpdateTargetPoolPayload
4040
+ :param _request_timeout: timeout setting for this request. If one
4041
+ number provided, it will be total request
4042
+ timeout. It can also be a pair (tuple) of
4043
+ (connection, read) timeouts.
4044
+ :type _request_timeout: int, tuple(int, int), optional
4045
+ :param _request_auth: set to override the auth_settings for an a single
4046
+ request; this effectively ignores the
4047
+ authentication in the spec for a single request.
4048
+ :type _request_auth: dict, optional
4049
+ :param _content_type: force content-type for the request.
4050
+ :type _content_type: str, Optional
4051
+ :param _headers: set to override the headers for a single
4052
+ request; this effectively ignores the headers
4053
+ in the spec for a single request.
4054
+ :type _headers: dict, optional
4055
+ :param _host_index: set to override the host_index for a single
4056
+ request; this effectively ignores the host_index
4057
+ in the spec for a single request.
4058
+ :type _host_index: int, optional
4059
+ :return: Returns the result object.
4060
+ """ # noqa: E501 docstring might be too long
4061
+
4062
+ _param = self._update_target_pool_serialize(
4063
+ project_id=project_id,
4064
+ name=name,
4065
+ target_pool_name=target_pool_name,
4066
+ update_target_pool_payload=update_target_pool_payload,
4067
+ _request_auth=_request_auth,
4068
+ _content_type=_content_type,
4069
+ _headers=_headers,
4070
+ _host_index=_host_index,
4071
+ )
4072
+
4073
+ _response_types_map: Dict[str, Optional[str]] = {
4074
+ "200": "TargetPool",
4075
+ "400": None,
4076
+ "401": "str",
4077
+ "403": None,
4078
+ "500": None,
4079
+ }
4080
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
4081
+ response_data.read()
4082
+ return self.api_client.response_deserialize(
4083
+ response_data=response_data,
4084
+ response_types_map=_response_types_map,
4085
+ )
4086
+
4087
+ @validate_call
4088
+ def update_target_pool_without_preload_content(
4089
+ self,
4090
+ project_id: StrictStr,
4091
+ name: StrictStr,
4092
+ target_pool_name: StrictStr,
4093
+ update_target_pool_payload: UpdateTargetPoolPayload,
4094
+ _request_timeout: Union[
4095
+ None,
4096
+ Annotated[StrictFloat, Field(gt=0)],
4097
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
4098
+ ] = None,
4099
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4100
+ _content_type: Optional[StrictStr] = None,
4101
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4102
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4103
+ ) -> RESTResponseType:
4104
+ """Update a single target pool of a load balancer in a project.
4105
+
4106
+ ReplaceTargetPool will replace a specific target pool of a load balancer with new content. Useful to add/remove target servers. will update a load balancer. Only replaces the mentioned target pools and leaves others unchanged. Cannot be used to create or rename a target pool.
4107
+
4108
+ :param project_id: (required)
4109
+ :type project_id: str
4110
+ :param name: (required)
4111
+ :type name: str
4112
+ :param target_pool_name: (required)
4113
+ :type target_pool_name: str
4114
+ :param update_target_pool_payload: (required)
4115
+ :type update_target_pool_payload: UpdateTargetPoolPayload
4116
+ :param _request_timeout: timeout setting for this request. If one
4117
+ number provided, it will be total request
4118
+ timeout. It can also be a pair (tuple) of
4119
+ (connection, read) timeouts.
4120
+ :type _request_timeout: int, tuple(int, int), optional
4121
+ :param _request_auth: set to override the auth_settings for an a single
4122
+ request; this effectively ignores the
4123
+ authentication in the spec for a single request.
4124
+ :type _request_auth: dict, optional
4125
+ :param _content_type: force content-type for the request.
4126
+ :type _content_type: str, Optional
4127
+ :param _headers: set to override the headers for a single
4128
+ request; this effectively ignores the headers
4129
+ in the spec for a single request.
4130
+ :type _headers: dict, optional
4131
+ :param _host_index: set to override the host_index for a single
4132
+ request; this effectively ignores the host_index
4133
+ in the spec for a single request.
4134
+ :type _host_index: int, optional
4135
+ :return: Returns the result object.
4136
+ """ # noqa: E501 docstring might be too long
4137
+
4138
+ _param = self._update_target_pool_serialize(
4139
+ project_id=project_id,
4140
+ name=name,
4141
+ target_pool_name=target_pool_name,
4142
+ update_target_pool_payload=update_target_pool_payload,
4143
+ _request_auth=_request_auth,
4144
+ _content_type=_content_type,
4145
+ _headers=_headers,
4146
+ _host_index=_host_index,
4147
+ )
4148
+
4149
+ _response_types_map: Dict[str, Optional[str]] = {
4150
+ "200": "TargetPool",
4151
+ "400": None,
4152
+ "401": "str",
4153
+ "403": None,
4154
+ "500": None,
4155
+ }
4156
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
4157
+ return response_data.response
4158
+
4159
+ def _update_target_pool_serialize(
4160
+ self,
4161
+ project_id,
4162
+ name,
4163
+ target_pool_name,
4164
+ update_target_pool_payload,
4165
+ _request_auth,
4166
+ _content_type,
4167
+ _headers,
4168
+ _host_index,
4169
+ ) -> RequestSerialized:
4170
+
4171
+ _host = None
4172
+
4173
+ _collection_formats: Dict[str, str] = {}
4174
+
4175
+ _path_params: Dict[str, str] = {}
4176
+ _query_params: List[Tuple[str, str]] = []
4177
+ _header_params: Dict[str, Optional[str]] = _headers or {}
4178
+ _form_params: List[Tuple[str, str]] = []
4179
+ _files: Dict[str, Union[str, bytes]] = {}
4180
+ _body_params: Optional[bytes] = None
4181
+
4182
+ # process the path parameters
4183
+ if project_id is not None:
4184
+ _path_params["projectId"] = project_id
4185
+ if name is not None:
4186
+ _path_params["name"] = name
4187
+ if target_pool_name is not None:
4188
+ _path_params["targetPoolName"] = target_pool_name
4189
+ # process the query parameters
4190
+ # process the header parameters
4191
+ # process the form parameters
4192
+ # process the body parameter
4193
+ if update_target_pool_payload is not None:
4194
+ _body_params = update_target_pool_payload
4195
+
4196
+ # set the HTTP header `Accept`
4197
+ if "Accept" not in _header_params:
4198
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
4199
+
4200
+ # set the HTTP header `Content-Type`
4201
+ if _content_type:
4202
+ _header_params["Content-Type"] = _content_type
4203
+ else:
4204
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
4205
+ if _default_content_type is not None:
4206
+ _header_params["Content-Type"] = _default_content_type
4207
+
4208
+ # authentication setting
4209
+ _auth_settings: List[str] = []
4210
+
4211
+ return self.api_client.param_serialize(
4212
+ method="PUT",
4213
+ resource_path="/v1/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName}",
4214
+ path_params=_path_params,
4215
+ query_params=_query_params,
4216
+ header_params=_header_params,
4217
+ body=_body_params,
4218
+ post_params=_form_params,
4219
+ files=_files,
4220
+ auth_settings=_auth_settings,
4221
+ collection_formats=_collection_formats,
4222
+ _host=_host,
4223
+ _request_auth=_request_auth,
4224
+ )