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