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