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