stackit-serverupdate 0.1.0__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,3412 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Server Update Management API
5
+
6
+ API endpoints for Server Update 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.serverupdate.api_client import ApiClient, RequestSerialized
23
+ from stackit.serverupdate.api_response import ApiResponse
24
+ from stackit.serverupdate.models.create_update_payload import CreateUpdatePayload
25
+ from stackit.serverupdate.models.create_update_schedule_payload import (
26
+ CreateUpdateSchedulePayload,
27
+ )
28
+ from stackit.serverupdate.models.enable_service_payload import EnableServicePayload
29
+ from stackit.serverupdate.models.enable_service_resource_payload import (
30
+ EnableServiceResourcePayload,
31
+ )
32
+ from stackit.serverupdate.models.get_update_policies_response import (
33
+ GetUpdatePoliciesResponse,
34
+ )
35
+ from stackit.serverupdate.models.get_update_schedules_response import (
36
+ GetUpdateSchedulesResponse,
37
+ )
38
+ from stackit.serverupdate.models.get_updates_list_response import GetUpdatesListResponse
39
+ from stackit.serverupdate.models.update import Update
40
+ from stackit.serverupdate.models.update_schedule import UpdateSchedule
41
+ from stackit.serverupdate.models.update_update_schedule_payload import (
42
+ UpdateUpdateSchedulePayload,
43
+ )
44
+ from stackit.serverupdate.rest import RESTResponseType
45
+
46
+
47
+ class DefaultApi:
48
+ """NOTE: This class is auto generated by OpenAPI Generator
49
+ Ref: https://openapi-generator.tech
50
+
51
+ Do not edit the class manually.
52
+ """
53
+
54
+ def __init__(self, configuration: Configuration = None) -> None:
55
+ if configuration is None:
56
+ configuration = Configuration()
57
+ self.configuration = configuration
58
+ self.api_client = ApiClient(self.configuration)
59
+
60
+ @validate_call
61
+ def create_update(
62
+ self,
63
+ project_id: Annotated[StrictStr, Field(description="project id")],
64
+ server_id: Annotated[StrictStr, Field(description="server id")],
65
+ create_update_payload: Optional[CreateUpdatePayload] = None,
66
+ _request_timeout: Union[
67
+ None,
68
+ Annotated[StrictFloat, Field(gt=0)],
69
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
70
+ ] = None,
71
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
72
+ _content_type: Optional[StrictStr] = None,
73
+ _headers: Optional[Dict[StrictStr, Any]] = None,
74
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
75
+ ) -> Update:
76
+ """create update
77
+
78
+
79
+ :param project_id: project id (required)
80
+ :type project_id: str
81
+ :param server_id: server id (required)
82
+ :type server_id: str
83
+ :param create_update_payload:
84
+ :type create_update_payload: CreateUpdatePayload
85
+ :param _request_timeout: timeout setting for this request. If one
86
+ number provided, it will be total request
87
+ timeout. It can also be a pair (tuple) of
88
+ (connection, read) timeouts.
89
+ :type _request_timeout: int, tuple(int, int), optional
90
+ :param _request_auth: set to override the auth_settings for an a single
91
+ request; this effectively ignores the
92
+ authentication in the spec for a single request.
93
+ :type _request_auth: dict, optional
94
+ :param _content_type: force content-type for the request.
95
+ :type _content_type: str, Optional
96
+ :param _headers: set to override the headers for a single
97
+ request; this effectively ignores the headers
98
+ in the spec for a single request.
99
+ :type _headers: dict, optional
100
+ :param _host_index: set to override the host_index for a single
101
+ request; this effectively ignores the host_index
102
+ in the spec for a single request.
103
+ :type _host_index: int, optional
104
+ :return: Returns the result object.
105
+ """ # noqa: E501 docstring might be too long
106
+
107
+ _param = self._create_update_serialize(
108
+ project_id=project_id,
109
+ server_id=server_id,
110
+ create_update_payload=create_update_payload,
111
+ _request_auth=_request_auth,
112
+ _content_type=_content_type,
113
+ _headers=_headers,
114
+ _host_index=_host_index,
115
+ )
116
+
117
+ _response_types_map: Dict[str, Optional[str]] = {
118
+ "202": "Update",
119
+ "400": None,
120
+ "401": None,
121
+ "404": None,
122
+ }
123
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
124
+ response_data.read()
125
+ return self.api_client.response_deserialize(
126
+ response_data=response_data,
127
+ response_types_map=_response_types_map,
128
+ ).data
129
+
130
+ @validate_call
131
+ def create_update_with_http_info(
132
+ self,
133
+ project_id: Annotated[StrictStr, Field(description="project id")],
134
+ server_id: Annotated[StrictStr, Field(description="server id")],
135
+ create_update_payload: Optional[CreateUpdatePayload] = None,
136
+ _request_timeout: Union[
137
+ None,
138
+ Annotated[StrictFloat, Field(gt=0)],
139
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
140
+ ] = None,
141
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
142
+ _content_type: Optional[StrictStr] = None,
143
+ _headers: Optional[Dict[StrictStr, Any]] = None,
144
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
145
+ ) -> ApiResponse[Update]:
146
+ """create update
147
+
148
+
149
+ :param project_id: project id (required)
150
+ :type project_id: str
151
+ :param server_id: server id (required)
152
+ :type server_id: str
153
+ :param create_update_payload:
154
+ :type create_update_payload: CreateUpdatePayload
155
+ :param _request_timeout: timeout setting for this request. If one
156
+ number provided, it will be total request
157
+ timeout. It can also be a pair (tuple) of
158
+ (connection, read) timeouts.
159
+ :type _request_timeout: int, tuple(int, int), optional
160
+ :param _request_auth: set to override the auth_settings for an a single
161
+ request; this effectively ignores the
162
+ authentication in the spec for a single request.
163
+ :type _request_auth: dict, optional
164
+ :param _content_type: force content-type for the request.
165
+ :type _content_type: str, Optional
166
+ :param _headers: set to override the headers for a single
167
+ request; this effectively ignores the headers
168
+ in the spec for a single request.
169
+ :type _headers: dict, optional
170
+ :param _host_index: set to override the host_index for a single
171
+ request; this effectively ignores the host_index
172
+ in the spec for a single request.
173
+ :type _host_index: int, optional
174
+ :return: Returns the result object.
175
+ """ # noqa: E501 docstring might be too long
176
+
177
+ _param = self._create_update_serialize(
178
+ project_id=project_id,
179
+ server_id=server_id,
180
+ create_update_payload=create_update_payload,
181
+ _request_auth=_request_auth,
182
+ _content_type=_content_type,
183
+ _headers=_headers,
184
+ _host_index=_host_index,
185
+ )
186
+
187
+ _response_types_map: Dict[str, Optional[str]] = {
188
+ "202": "Update",
189
+ "400": None,
190
+ "401": 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_update_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_update_payload: Optional[CreateUpdatePayload] = 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 update
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_update_payload:
224
+ :type create_update_payload: CreateUpdatePayload
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_update_serialize(
248
+ project_id=project_id,
249
+ server_id=server_id,
250
+ create_update_payload=create_update_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": "Update",
259
+ "400": None,
260
+ "401": None,
261
+ "404": None,
262
+ }
263
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
264
+ return response_data.response
265
+
266
+ def _create_update_serialize(
267
+ self,
268
+ project_id,
269
+ server_id,
270
+ create_update_payload,
271
+ _request_auth,
272
+ _content_type,
273
+ _headers,
274
+ _host_index,
275
+ ) -> RequestSerialized:
276
+
277
+ _host = None
278
+
279
+ _collection_formats: Dict[str, str] = {}
280
+
281
+ _path_params: Dict[str, str] = {}
282
+ _query_params: List[Tuple[str, str]] = []
283
+ _header_params: Dict[str, Optional[str]] = _headers or {}
284
+ _form_params: List[Tuple[str, str]] = []
285
+ _files: Dict[str, Union[str, bytes]] = {}
286
+ _body_params: Optional[bytes] = None
287
+
288
+ # process the path parameters
289
+ if project_id is not None:
290
+ _path_params["projectId"] = project_id
291
+ if server_id is not None:
292
+ _path_params["serverId"] = server_id
293
+ # process the query parameters
294
+ # process the header parameters
295
+ # process the form parameters
296
+ # process the body parameter
297
+ if create_update_payload is not None:
298
+ _body_params = create_update_payload
299
+
300
+ # set the HTTP header `Accept`
301
+ if "Accept" not in _header_params:
302
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
303
+
304
+ # set the HTTP header `Content-Type`
305
+ if _content_type:
306
+ _header_params["Content-Type"] = _content_type
307
+ else:
308
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
309
+ if _default_content_type is not None:
310
+ _header_params["Content-Type"] = _default_content_type
311
+
312
+ # authentication setting
313
+ _auth_settings: List[str] = []
314
+
315
+ return self.api_client.param_serialize(
316
+ method="POST",
317
+ resource_path="/v1/projects/{projectId}/servers/{serverId}/updates",
318
+ path_params=_path_params,
319
+ query_params=_query_params,
320
+ header_params=_header_params,
321
+ body=_body_params,
322
+ post_params=_form_params,
323
+ files=_files,
324
+ auth_settings=_auth_settings,
325
+ collection_formats=_collection_formats,
326
+ _host=_host,
327
+ _request_auth=_request_auth,
328
+ )
329
+
330
+ @validate_call
331
+ def create_update_schedule(
332
+ self,
333
+ project_id: Annotated[StrictStr, Field(description="project id")],
334
+ server_id: Annotated[StrictStr, Field(description="server id")],
335
+ create_update_schedule_payload: Optional[CreateUpdateSchedulePayload] = None,
336
+ _request_timeout: Union[
337
+ None,
338
+ Annotated[StrictFloat, Field(gt=0)],
339
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
340
+ ] = None,
341
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
342
+ _content_type: Optional[StrictStr] = None,
343
+ _headers: Optional[Dict[StrictStr, Any]] = None,
344
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
345
+ ) -> UpdateSchedule:
346
+ """create update schedule
347
+
348
+
349
+ :param project_id: project id (required)
350
+ :type project_id: str
351
+ :param server_id: server id (required)
352
+ :type server_id: str
353
+ :param create_update_schedule_payload:
354
+ :type create_update_schedule_payload: CreateUpdateSchedulePayload
355
+ :param _request_timeout: timeout setting for this request. If one
356
+ number provided, it will be total request
357
+ timeout. It can also be a pair (tuple) of
358
+ (connection, read) timeouts.
359
+ :type _request_timeout: int, tuple(int, int), optional
360
+ :param _request_auth: set to override the auth_settings for an a single
361
+ request; this effectively ignores the
362
+ authentication in the spec for a single request.
363
+ :type _request_auth: dict, optional
364
+ :param _content_type: force content-type for the request.
365
+ :type _content_type: str, Optional
366
+ :param _headers: set to override the headers for a single
367
+ request; this effectively ignores the headers
368
+ in the spec for a single request.
369
+ :type _headers: dict, optional
370
+ :param _host_index: set to override the host_index for a single
371
+ request; this effectively ignores the host_index
372
+ in the spec for a single request.
373
+ :type _host_index: int, optional
374
+ :return: Returns the result object.
375
+ """ # noqa: E501 docstring might be too long
376
+
377
+ _param = self._create_update_schedule_serialize(
378
+ project_id=project_id,
379
+ server_id=server_id,
380
+ create_update_schedule_payload=create_update_schedule_payload,
381
+ _request_auth=_request_auth,
382
+ _content_type=_content_type,
383
+ _headers=_headers,
384
+ _host_index=_host_index,
385
+ )
386
+
387
+ _response_types_map: Dict[str, Optional[str]] = {
388
+ "201": "UpdateSchedule",
389
+ "400": None,
390
+ "401": None,
391
+ "404": None,
392
+ }
393
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
394
+ response_data.read()
395
+ return self.api_client.response_deserialize(
396
+ response_data=response_data,
397
+ response_types_map=_response_types_map,
398
+ ).data
399
+
400
+ @validate_call
401
+ def create_update_schedule_with_http_info(
402
+ self,
403
+ project_id: Annotated[StrictStr, Field(description="project id")],
404
+ server_id: Annotated[StrictStr, Field(description="server id")],
405
+ create_update_schedule_payload: Optional[CreateUpdateSchedulePayload] = None,
406
+ _request_timeout: Union[
407
+ None,
408
+ Annotated[StrictFloat, Field(gt=0)],
409
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
410
+ ] = None,
411
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
412
+ _content_type: Optional[StrictStr] = None,
413
+ _headers: Optional[Dict[StrictStr, Any]] = None,
414
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
415
+ ) -> ApiResponse[UpdateSchedule]:
416
+ """create update schedule
417
+
418
+
419
+ :param project_id: project id (required)
420
+ :type project_id: str
421
+ :param server_id: server id (required)
422
+ :type server_id: str
423
+ :param create_update_schedule_payload:
424
+ :type create_update_schedule_payload: CreateUpdateSchedulePayload
425
+ :param _request_timeout: timeout setting for this request. If one
426
+ number provided, it will be total request
427
+ timeout. It can also be a pair (tuple) of
428
+ (connection, read) timeouts.
429
+ :type _request_timeout: int, tuple(int, int), optional
430
+ :param _request_auth: set to override the auth_settings for an a single
431
+ request; this effectively ignores the
432
+ authentication in the spec for a single request.
433
+ :type _request_auth: dict, optional
434
+ :param _content_type: force content-type for the request.
435
+ :type _content_type: str, Optional
436
+ :param _headers: set to override the headers for a single
437
+ request; this effectively ignores the headers
438
+ in the spec for a single request.
439
+ :type _headers: dict, optional
440
+ :param _host_index: set to override the host_index for a single
441
+ request; this effectively ignores the host_index
442
+ in the spec for a single request.
443
+ :type _host_index: int, optional
444
+ :return: Returns the result object.
445
+ """ # noqa: E501 docstring might be too long
446
+
447
+ _param = self._create_update_schedule_serialize(
448
+ project_id=project_id,
449
+ server_id=server_id,
450
+ create_update_schedule_payload=create_update_schedule_payload,
451
+ _request_auth=_request_auth,
452
+ _content_type=_content_type,
453
+ _headers=_headers,
454
+ _host_index=_host_index,
455
+ )
456
+
457
+ _response_types_map: Dict[str, Optional[str]] = {
458
+ "201": "UpdateSchedule",
459
+ "400": None,
460
+ "401": None,
461
+ "404": None,
462
+ }
463
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
464
+ response_data.read()
465
+ return self.api_client.response_deserialize(
466
+ response_data=response_data,
467
+ response_types_map=_response_types_map,
468
+ )
469
+
470
+ @validate_call
471
+ def create_update_schedule_without_preload_content(
472
+ self,
473
+ project_id: Annotated[StrictStr, Field(description="project id")],
474
+ server_id: Annotated[StrictStr, Field(description="server id")],
475
+ create_update_schedule_payload: Optional[CreateUpdateSchedulePayload] = None,
476
+ _request_timeout: Union[
477
+ None,
478
+ Annotated[StrictFloat, Field(gt=0)],
479
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
480
+ ] = None,
481
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
482
+ _content_type: Optional[StrictStr] = None,
483
+ _headers: Optional[Dict[StrictStr, Any]] = None,
484
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
485
+ ) -> RESTResponseType:
486
+ """create update schedule
487
+
488
+
489
+ :param project_id: project id (required)
490
+ :type project_id: str
491
+ :param server_id: server id (required)
492
+ :type server_id: str
493
+ :param create_update_schedule_payload:
494
+ :type create_update_schedule_payload: CreateUpdateSchedulePayload
495
+ :param _request_timeout: timeout setting for this request. If one
496
+ number provided, it will be total request
497
+ timeout. It can also be a pair (tuple) of
498
+ (connection, read) timeouts.
499
+ :type _request_timeout: int, tuple(int, int), optional
500
+ :param _request_auth: set to override the auth_settings for an a single
501
+ request; this effectively ignores the
502
+ authentication in the spec for a single request.
503
+ :type _request_auth: dict, optional
504
+ :param _content_type: force content-type for the request.
505
+ :type _content_type: str, Optional
506
+ :param _headers: set to override the headers for a single
507
+ request; this effectively ignores the headers
508
+ in the spec for a single request.
509
+ :type _headers: dict, optional
510
+ :param _host_index: set to override the host_index for a single
511
+ request; this effectively ignores the host_index
512
+ in the spec for a single request.
513
+ :type _host_index: int, optional
514
+ :return: Returns the result object.
515
+ """ # noqa: E501 docstring might be too long
516
+
517
+ _param = self._create_update_schedule_serialize(
518
+ project_id=project_id,
519
+ server_id=server_id,
520
+ create_update_schedule_payload=create_update_schedule_payload,
521
+ _request_auth=_request_auth,
522
+ _content_type=_content_type,
523
+ _headers=_headers,
524
+ _host_index=_host_index,
525
+ )
526
+
527
+ _response_types_map: Dict[str, Optional[str]] = {
528
+ "201": "UpdateSchedule",
529
+ "400": None,
530
+ "401": None,
531
+ "404": None,
532
+ }
533
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
534
+ return response_data.response
535
+
536
+ def _create_update_schedule_serialize(
537
+ self,
538
+ project_id,
539
+ server_id,
540
+ create_update_schedule_payload,
541
+ _request_auth,
542
+ _content_type,
543
+ _headers,
544
+ _host_index,
545
+ ) -> RequestSerialized:
546
+
547
+ _host = None
548
+
549
+ _collection_formats: Dict[str, str] = {}
550
+
551
+ _path_params: Dict[str, str] = {}
552
+ _query_params: List[Tuple[str, str]] = []
553
+ _header_params: Dict[str, Optional[str]] = _headers or {}
554
+ _form_params: List[Tuple[str, str]] = []
555
+ _files: Dict[str, Union[str, bytes]] = {}
556
+ _body_params: Optional[bytes] = None
557
+
558
+ # process the path parameters
559
+ if project_id is not None:
560
+ _path_params["projectId"] = project_id
561
+ if server_id is not None:
562
+ _path_params["serverId"] = server_id
563
+ # process the query parameters
564
+ # process the header parameters
565
+ # process the form parameters
566
+ # process the body parameter
567
+ if create_update_schedule_payload is not None:
568
+ _body_params = create_update_schedule_payload
569
+
570
+ # set the HTTP header `Accept`
571
+ if "Accept" not in _header_params:
572
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
573
+
574
+ # set the HTTP header `Content-Type`
575
+ if _content_type:
576
+ _header_params["Content-Type"] = _content_type
577
+ else:
578
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
579
+ if _default_content_type is not None:
580
+ _header_params["Content-Type"] = _default_content_type
581
+
582
+ # authentication setting
583
+ _auth_settings: List[str] = []
584
+
585
+ return self.api_client.param_serialize(
586
+ method="POST",
587
+ resource_path="/v1/projects/{projectId}/servers/{serverId}/update-schedules",
588
+ path_params=_path_params,
589
+ query_params=_query_params,
590
+ header_params=_header_params,
591
+ body=_body_params,
592
+ post_params=_form_params,
593
+ files=_files,
594
+ auth_settings=_auth_settings,
595
+ collection_formats=_collection_formats,
596
+ _host=_host,
597
+ _request_auth=_request_auth,
598
+ )
599
+
600
+ @validate_call
601
+ def delete_update_schedule(
602
+ self,
603
+ project_id: Annotated[StrictStr, Field(description="project id")],
604
+ server_id: Annotated[StrictStr, Field(description="server id")],
605
+ schedule_id: Annotated[StrictStr, Field(description="update schedule id")],
606
+ _request_timeout: Union[
607
+ None,
608
+ Annotated[StrictFloat, Field(gt=0)],
609
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
610
+ ] = None,
611
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
612
+ _content_type: Optional[StrictStr] = None,
613
+ _headers: Optional[Dict[StrictStr, Any]] = None,
614
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
615
+ ) -> None:
616
+ """delete update schedule
617
+
618
+
619
+ :param project_id: project id (required)
620
+ :type project_id: str
621
+ :param server_id: server id (required)
622
+ :type server_id: str
623
+ :param schedule_id: update schedule id (required)
624
+ :type schedule_id: str
625
+ :param _request_timeout: timeout setting for this request. If one
626
+ number provided, it will be total request
627
+ timeout. It can also be a pair (tuple) of
628
+ (connection, read) timeouts.
629
+ :type _request_timeout: int, tuple(int, int), optional
630
+ :param _request_auth: set to override the auth_settings for an a single
631
+ request; this effectively ignores the
632
+ authentication in the spec for a single request.
633
+ :type _request_auth: dict, optional
634
+ :param _content_type: force content-type for the request.
635
+ :type _content_type: str, Optional
636
+ :param _headers: set to override the headers for a single
637
+ request; this effectively ignores the headers
638
+ in the spec for a single request.
639
+ :type _headers: dict, optional
640
+ :param _host_index: set to override the host_index for a single
641
+ request; this effectively ignores the host_index
642
+ in the spec for a single request.
643
+ :type _host_index: int, optional
644
+ :return: Returns the result object.
645
+ """ # noqa: E501 docstring might be too long
646
+
647
+ _param = self._delete_update_schedule_serialize(
648
+ project_id=project_id,
649
+ server_id=server_id,
650
+ schedule_id=schedule_id,
651
+ _request_auth=_request_auth,
652
+ _content_type=_content_type,
653
+ _headers=_headers,
654
+ _host_index=_host_index,
655
+ )
656
+
657
+ _response_types_map: Dict[str, Optional[str]] = {
658
+ "204": None,
659
+ "400": None,
660
+ "401": None,
661
+ "404": None,
662
+ }
663
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
664
+ response_data.read()
665
+ return self.api_client.response_deserialize(
666
+ response_data=response_data,
667
+ response_types_map=_response_types_map,
668
+ ).data
669
+
670
+ @validate_call
671
+ def delete_update_schedule_with_http_info(
672
+ self,
673
+ project_id: Annotated[StrictStr, Field(description="project id")],
674
+ server_id: Annotated[StrictStr, Field(description="server id")],
675
+ schedule_id: Annotated[StrictStr, Field(description="update schedule id")],
676
+ _request_timeout: Union[
677
+ None,
678
+ Annotated[StrictFloat, Field(gt=0)],
679
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
680
+ ] = None,
681
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
682
+ _content_type: Optional[StrictStr] = None,
683
+ _headers: Optional[Dict[StrictStr, Any]] = None,
684
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
685
+ ) -> ApiResponse[None]:
686
+ """delete update schedule
687
+
688
+
689
+ :param project_id: project id (required)
690
+ :type project_id: str
691
+ :param server_id: server id (required)
692
+ :type server_id: str
693
+ :param schedule_id: update schedule id (required)
694
+ :type schedule_id: str
695
+ :param _request_timeout: timeout setting for this request. If one
696
+ number provided, it will be total request
697
+ timeout. It can also be a pair (tuple) of
698
+ (connection, read) timeouts.
699
+ :type _request_timeout: int, tuple(int, int), optional
700
+ :param _request_auth: set to override the auth_settings for an a single
701
+ request; this effectively ignores the
702
+ authentication in the spec for a single request.
703
+ :type _request_auth: dict, optional
704
+ :param _content_type: force content-type for the request.
705
+ :type _content_type: str, Optional
706
+ :param _headers: set to override the headers for a single
707
+ request; this effectively ignores the headers
708
+ in the spec for a single request.
709
+ :type _headers: dict, optional
710
+ :param _host_index: set to override the host_index for a single
711
+ request; this effectively ignores the host_index
712
+ in the spec for a single request.
713
+ :type _host_index: int, optional
714
+ :return: Returns the result object.
715
+ """ # noqa: E501 docstring might be too long
716
+
717
+ _param = self._delete_update_schedule_serialize(
718
+ project_id=project_id,
719
+ server_id=server_id,
720
+ schedule_id=schedule_id,
721
+ _request_auth=_request_auth,
722
+ _content_type=_content_type,
723
+ _headers=_headers,
724
+ _host_index=_host_index,
725
+ )
726
+
727
+ _response_types_map: Dict[str, Optional[str]] = {
728
+ "204": None,
729
+ "400": None,
730
+ "401": None,
731
+ "404": None,
732
+ }
733
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
734
+ response_data.read()
735
+ return self.api_client.response_deserialize(
736
+ response_data=response_data,
737
+ response_types_map=_response_types_map,
738
+ )
739
+
740
+ @validate_call
741
+ def delete_update_schedule_without_preload_content(
742
+ self,
743
+ project_id: Annotated[StrictStr, Field(description="project id")],
744
+ server_id: Annotated[StrictStr, Field(description="server id")],
745
+ schedule_id: Annotated[StrictStr, Field(description="update schedule id")],
746
+ _request_timeout: Union[
747
+ None,
748
+ Annotated[StrictFloat, Field(gt=0)],
749
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
750
+ ] = None,
751
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
752
+ _content_type: Optional[StrictStr] = None,
753
+ _headers: Optional[Dict[StrictStr, Any]] = None,
754
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
755
+ ) -> RESTResponseType:
756
+ """delete update schedule
757
+
758
+
759
+ :param project_id: project id (required)
760
+ :type project_id: str
761
+ :param server_id: server id (required)
762
+ :type server_id: str
763
+ :param schedule_id: update schedule id (required)
764
+ :type schedule_id: str
765
+ :param _request_timeout: timeout setting for this request. If one
766
+ number provided, it will be total request
767
+ timeout. It can also be a pair (tuple) of
768
+ (connection, read) timeouts.
769
+ :type _request_timeout: int, tuple(int, int), optional
770
+ :param _request_auth: set to override the auth_settings for an a single
771
+ request; this effectively ignores the
772
+ authentication in the spec for a single request.
773
+ :type _request_auth: dict, optional
774
+ :param _content_type: force content-type for the request.
775
+ :type _content_type: str, Optional
776
+ :param _headers: set to override the headers for a single
777
+ request; this effectively ignores the headers
778
+ in the spec for a single request.
779
+ :type _headers: dict, optional
780
+ :param _host_index: set to override the host_index for a single
781
+ request; this effectively ignores the host_index
782
+ in the spec for a single request.
783
+ :type _host_index: int, optional
784
+ :return: Returns the result object.
785
+ """ # noqa: E501 docstring might be too long
786
+
787
+ _param = self._delete_update_schedule_serialize(
788
+ project_id=project_id,
789
+ server_id=server_id,
790
+ schedule_id=schedule_id,
791
+ _request_auth=_request_auth,
792
+ _content_type=_content_type,
793
+ _headers=_headers,
794
+ _host_index=_host_index,
795
+ )
796
+
797
+ _response_types_map: Dict[str, Optional[str]] = {
798
+ "204": None,
799
+ "400": None,
800
+ "401": None,
801
+ "404": None,
802
+ }
803
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
804
+ return response_data.response
805
+
806
+ def _delete_update_schedule_serialize(
807
+ self,
808
+ project_id,
809
+ server_id,
810
+ schedule_id,
811
+ _request_auth,
812
+ _content_type,
813
+ _headers,
814
+ _host_index,
815
+ ) -> RequestSerialized:
816
+
817
+ _host = None
818
+
819
+ _collection_formats: Dict[str, str] = {}
820
+
821
+ _path_params: Dict[str, str] = {}
822
+ _query_params: List[Tuple[str, str]] = []
823
+ _header_params: Dict[str, Optional[str]] = _headers or {}
824
+ _form_params: List[Tuple[str, str]] = []
825
+ _files: Dict[str, Union[str, bytes]] = {}
826
+ _body_params: Optional[bytes] = None
827
+
828
+ # process the path parameters
829
+ if project_id is not None:
830
+ _path_params["projectId"] = project_id
831
+ if server_id is not None:
832
+ _path_params["serverId"] = server_id
833
+ if schedule_id is not None:
834
+ _path_params["scheduleId"] = schedule_id
835
+ # process the query parameters
836
+ # process the header parameters
837
+ # process the form parameters
838
+ # process the body parameter
839
+
840
+ # authentication setting
841
+ _auth_settings: List[str] = []
842
+
843
+ return self.api_client.param_serialize(
844
+ method="DELETE",
845
+ resource_path="/v1/projects/{projectId}/servers/{serverId}/update-schedules/{scheduleId}",
846
+ path_params=_path_params,
847
+ query_params=_query_params,
848
+ header_params=_header_params,
849
+ body=_body_params,
850
+ post_params=_form_params,
851
+ files=_files,
852
+ auth_settings=_auth_settings,
853
+ collection_formats=_collection_formats,
854
+ _host=_host,
855
+ _request_auth=_request_auth,
856
+ )
857
+
858
+ @validate_call
859
+ def disable_service(
860
+ self,
861
+ project_id: Annotated[StrictStr, Field(description="project id")],
862
+ server_id: Annotated[StrictStr, Field(description="server id")],
863
+ _request_timeout: Union[
864
+ None,
865
+ Annotated[StrictFloat, Field(gt=0)],
866
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
867
+ ] = None,
868
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
869
+ _content_type: Optional[StrictStr] = None,
870
+ _headers: Optional[Dict[StrictStr, Any]] = None,
871
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
872
+ ) -> None:
873
+ """(Deprecated) disable update service
874
+
875
+
876
+ :param project_id: project id (required)
877
+ :type project_id: str
878
+ :param server_id: server id (required)
879
+ :type server_id: str
880
+ :param _request_timeout: timeout setting for this request. If one
881
+ number provided, it will be total request
882
+ timeout. It can also be a pair (tuple) of
883
+ (connection, read) timeouts.
884
+ :type _request_timeout: int, tuple(int, int), optional
885
+ :param _request_auth: set to override the auth_settings for an a single
886
+ request; this effectively ignores the
887
+ authentication in the spec for a single request.
888
+ :type _request_auth: dict, optional
889
+ :param _content_type: force content-type for the request.
890
+ :type _content_type: str, Optional
891
+ :param _headers: set to override the headers for a single
892
+ request; this effectively ignores the headers
893
+ in the spec for a single request.
894
+ :type _headers: dict, optional
895
+ :param _host_index: set to override the host_index for a single
896
+ request; this effectively ignores the host_index
897
+ in the spec for a single request.
898
+ :type _host_index: int, optional
899
+ :return: Returns the result object.
900
+ """ # noqa: E501 docstring might be too long
901
+ warnings.warn("DELETE /v1/projects/{projectId}/servers/{serverId} is deprecated.", DeprecationWarning)
902
+
903
+ _param = self._disable_service_serialize(
904
+ project_id=project_id,
905
+ server_id=server_id,
906
+ _request_auth=_request_auth,
907
+ _content_type=_content_type,
908
+ _headers=_headers,
909
+ _host_index=_host_index,
910
+ )
911
+
912
+ _response_types_map: Dict[str, Optional[str]] = {
913
+ "204": None,
914
+ "400": None,
915
+ "401": None,
916
+ "404": None,
917
+ }
918
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
919
+ response_data.read()
920
+ return self.api_client.response_deserialize(
921
+ response_data=response_data,
922
+ response_types_map=_response_types_map,
923
+ ).data
924
+
925
+ @validate_call
926
+ def disable_service_with_http_info(
927
+ self,
928
+ project_id: Annotated[StrictStr, Field(description="project id")],
929
+ server_id: Annotated[StrictStr, Field(description="server id")],
930
+ _request_timeout: Union[
931
+ None,
932
+ Annotated[StrictFloat, Field(gt=0)],
933
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
934
+ ] = None,
935
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
936
+ _content_type: Optional[StrictStr] = None,
937
+ _headers: Optional[Dict[StrictStr, Any]] = None,
938
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
939
+ ) -> ApiResponse[None]:
940
+ """(Deprecated) disable update service
941
+
942
+
943
+ :param project_id: project id (required)
944
+ :type project_id: str
945
+ :param server_id: server id (required)
946
+ :type server_id: str
947
+ :param _request_timeout: timeout setting for this request. If one
948
+ number provided, it will be total request
949
+ timeout. It can also be a pair (tuple) of
950
+ (connection, read) timeouts.
951
+ :type _request_timeout: int, tuple(int, int), optional
952
+ :param _request_auth: set to override the auth_settings for an a single
953
+ request; this effectively ignores the
954
+ authentication in the spec for a single request.
955
+ :type _request_auth: dict, optional
956
+ :param _content_type: force content-type for the request.
957
+ :type _content_type: str, Optional
958
+ :param _headers: set to override the headers for a single
959
+ request; this effectively ignores the headers
960
+ in the spec for a single request.
961
+ :type _headers: dict, optional
962
+ :param _host_index: set to override the host_index for a single
963
+ request; this effectively ignores the host_index
964
+ in the spec for a single request.
965
+ :type _host_index: int, optional
966
+ :return: Returns the result object.
967
+ """ # noqa: E501 docstring might be too long
968
+ warnings.warn("DELETE /v1/projects/{projectId}/servers/{serverId} is deprecated.", DeprecationWarning)
969
+
970
+ _param = self._disable_service_serialize(
971
+ project_id=project_id,
972
+ server_id=server_id,
973
+ _request_auth=_request_auth,
974
+ _content_type=_content_type,
975
+ _headers=_headers,
976
+ _host_index=_host_index,
977
+ )
978
+
979
+ _response_types_map: Dict[str, Optional[str]] = {
980
+ "204": None,
981
+ "400": None,
982
+ "401": None,
983
+ "404": None,
984
+ }
985
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
986
+ response_data.read()
987
+ return self.api_client.response_deserialize(
988
+ response_data=response_data,
989
+ response_types_map=_response_types_map,
990
+ )
991
+
992
+ @validate_call
993
+ def disable_service_without_preload_content(
994
+ self,
995
+ project_id: Annotated[StrictStr, Field(description="project id")],
996
+ server_id: Annotated[StrictStr, Field(description="server id")],
997
+ _request_timeout: Union[
998
+ None,
999
+ Annotated[StrictFloat, Field(gt=0)],
1000
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1001
+ ] = None,
1002
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1003
+ _content_type: Optional[StrictStr] = None,
1004
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1005
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1006
+ ) -> RESTResponseType:
1007
+ """(Deprecated) disable update service
1008
+
1009
+
1010
+ :param project_id: project id (required)
1011
+ :type project_id: str
1012
+ :param server_id: server id (required)
1013
+ :type server_id: str
1014
+ :param _request_timeout: timeout setting for this request. If one
1015
+ number provided, it will be total request
1016
+ timeout. It can also be a pair (tuple) of
1017
+ (connection, read) timeouts.
1018
+ :type _request_timeout: int, tuple(int, int), optional
1019
+ :param _request_auth: set to override the auth_settings for an a single
1020
+ request; this effectively ignores the
1021
+ authentication in the spec for a single request.
1022
+ :type _request_auth: dict, optional
1023
+ :param _content_type: force content-type for the request.
1024
+ :type _content_type: str, Optional
1025
+ :param _headers: set to override the headers for a single
1026
+ request; this effectively ignores the headers
1027
+ in the spec for a single request.
1028
+ :type _headers: dict, optional
1029
+ :param _host_index: set to override the host_index for a single
1030
+ request; this effectively ignores the host_index
1031
+ in the spec for a single request.
1032
+ :type _host_index: int, optional
1033
+ :return: Returns the result object.
1034
+ """ # noqa: E501 docstring might be too long
1035
+ warnings.warn("DELETE /v1/projects/{projectId}/servers/{serverId} is deprecated.", DeprecationWarning)
1036
+
1037
+ _param = self._disable_service_serialize(
1038
+ project_id=project_id,
1039
+ server_id=server_id,
1040
+ _request_auth=_request_auth,
1041
+ _content_type=_content_type,
1042
+ _headers=_headers,
1043
+ _host_index=_host_index,
1044
+ )
1045
+
1046
+ _response_types_map: Dict[str, Optional[str]] = {
1047
+ "204": None,
1048
+ "400": None,
1049
+ "401": None,
1050
+ "404": None,
1051
+ }
1052
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1053
+ return response_data.response
1054
+
1055
+ def _disable_service_serialize(
1056
+ self,
1057
+ project_id,
1058
+ server_id,
1059
+ _request_auth,
1060
+ _content_type,
1061
+ _headers,
1062
+ _host_index,
1063
+ ) -> RequestSerialized:
1064
+
1065
+ _host = None
1066
+
1067
+ _collection_formats: Dict[str, str] = {}
1068
+
1069
+ _path_params: Dict[str, str] = {}
1070
+ _query_params: List[Tuple[str, str]] = []
1071
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1072
+ _form_params: List[Tuple[str, str]] = []
1073
+ _files: Dict[str, Union[str, bytes]] = {}
1074
+ _body_params: Optional[bytes] = None
1075
+
1076
+ # process the path parameters
1077
+ if project_id is not None:
1078
+ _path_params["projectId"] = project_id
1079
+ if server_id is not None:
1080
+ _path_params["serverId"] = server_id
1081
+ # process the query parameters
1082
+ # process the header parameters
1083
+ # process the form parameters
1084
+ # process the body parameter
1085
+
1086
+ # authentication setting
1087
+ _auth_settings: List[str] = []
1088
+
1089
+ return self.api_client.param_serialize(
1090
+ method="DELETE",
1091
+ resource_path="/v1/projects/{projectId}/servers/{serverId}",
1092
+ path_params=_path_params,
1093
+ query_params=_query_params,
1094
+ header_params=_header_params,
1095
+ body=_body_params,
1096
+ post_params=_form_params,
1097
+ files=_files,
1098
+ auth_settings=_auth_settings,
1099
+ collection_formats=_collection_formats,
1100
+ _host=_host,
1101
+ _request_auth=_request_auth,
1102
+ )
1103
+
1104
+ @validate_call
1105
+ def disable_service_resource(
1106
+ self,
1107
+ project_id: Annotated[StrictStr, Field(description="project id")],
1108
+ server_id: Annotated[StrictStr, Field(description="server id")],
1109
+ _request_timeout: Union[
1110
+ None,
1111
+ Annotated[StrictFloat, Field(gt=0)],
1112
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1113
+ ] = None,
1114
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1115
+ _content_type: Optional[StrictStr] = None,
1116
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1117
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1118
+ ) -> None:
1119
+ """disable update service
1120
+
1121
+
1122
+ :param project_id: project id (required)
1123
+ :type project_id: str
1124
+ :param server_id: server id (required)
1125
+ :type server_id: str
1126
+ :param _request_timeout: timeout setting for this request. If one
1127
+ number provided, it will be total request
1128
+ timeout. It can also be a pair (tuple) of
1129
+ (connection, read) timeouts.
1130
+ :type _request_timeout: int, tuple(int, int), optional
1131
+ :param _request_auth: set to override the auth_settings for an a single
1132
+ request; this effectively ignores the
1133
+ authentication in the spec for a single request.
1134
+ :type _request_auth: dict, optional
1135
+ :param _content_type: force content-type for the request.
1136
+ :type _content_type: str, Optional
1137
+ :param _headers: set to override the headers for a single
1138
+ request; this effectively ignores the headers
1139
+ in the spec for a single request.
1140
+ :type _headers: dict, optional
1141
+ :param _host_index: set to override the host_index for a single
1142
+ request; this effectively ignores the host_index
1143
+ in the spec for a single request.
1144
+ :type _host_index: int, optional
1145
+ :return: Returns the result object.
1146
+ """ # noqa: E501 docstring might be too long
1147
+
1148
+ _param = self._disable_service_resource_serialize(
1149
+ project_id=project_id,
1150
+ server_id=server_id,
1151
+ _request_auth=_request_auth,
1152
+ _content_type=_content_type,
1153
+ _headers=_headers,
1154
+ _host_index=_host_index,
1155
+ )
1156
+
1157
+ _response_types_map: Dict[str, Optional[str]] = {
1158
+ "204": None,
1159
+ "400": None,
1160
+ "401": None,
1161
+ "404": None,
1162
+ }
1163
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1164
+ response_data.read()
1165
+ return self.api_client.response_deserialize(
1166
+ response_data=response_data,
1167
+ response_types_map=_response_types_map,
1168
+ ).data
1169
+
1170
+ @validate_call
1171
+ def disable_service_resource_with_http_info(
1172
+ self,
1173
+ project_id: Annotated[StrictStr, Field(description="project id")],
1174
+ server_id: Annotated[StrictStr, Field(description="server id")],
1175
+ _request_timeout: Union[
1176
+ None,
1177
+ Annotated[StrictFloat, Field(gt=0)],
1178
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1179
+ ] = None,
1180
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1181
+ _content_type: Optional[StrictStr] = None,
1182
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1183
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1184
+ ) -> ApiResponse[None]:
1185
+ """disable update service
1186
+
1187
+
1188
+ :param project_id: project id (required)
1189
+ :type project_id: str
1190
+ :param server_id: server id (required)
1191
+ :type server_id: str
1192
+ :param _request_timeout: timeout setting for this request. If one
1193
+ number provided, it will be total request
1194
+ timeout. It can also be a pair (tuple) of
1195
+ (connection, read) timeouts.
1196
+ :type _request_timeout: int, tuple(int, int), optional
1197
+ :param _request_auth: set to override the auth_settings for an a single
1198
+ request; this effectively ignores the
1199
+ authentication in the spec for a single request.
1200
+ :type _request_auth: dict, optional
1201
+ :param _content_type: force content-type for the request.
1202
+ :type _content_type: str, Optional
1203
+ :param _headers: set to override the headers for a single
1204
+ request; this effectively ignores the headers
1205
+ in the spec for a single request.
1206
+ :type _headers: dict, optional
1207
+ :param _host_index: set to override the host_index for a single
1208
+ request; this effectively ignores the host_index
1209
+ in the spec for a single request.
1210
+ :type _host_index: int, optional
1211
+ :return: Returns the result object.
1212
+ """ # noqa: E501 docstring might be too long
1213
+
1214
+ _param = self._disable_service_resource_serialize(
1215
+ project_id=project_id,
1216
+ server_id=server_id,
1217
+ _request_auth=_request_auth,
1218
+ _content_type=_content_type,
1219
+ _headers=_headers,
1220
+ _host_index=_host_index,
1221
+ )
1222
+
1223
+ _response_types_map: Dict[str, Optional[str]] = {
1224
+ "204": None,
1225
+ "400": None,
1226
+ "401": None,
1227
+ "404": None,
1228
+ }
1229
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1230
+ response_data.read()
1231
+ return self.api_client.response_deserialize(
1232
+ response_data=response_data,
1233
+ response_types_map=_response_types_map,
1234
+ )
1235
+
1236
+ @validate_call
1237
+ def disable_service_resource_without_preload_content(
1238
+ self,
1239
+ project_id: Annotated[StrictStr, Field(description="project id")],
1240
+ server_id: Annotated[StrictStr, Field(description="server id")],
1241
+ _request_timeout: Union[
1242
+ None,
1243
+ Annotated[StrictFloat, Field(gt=0)],
1244
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1245
+ ] = None,
1246
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1247
+ _content_type: Optional[StrictStr] = None,
1248
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1249
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1250
+ ) -> RESTResponseType:
1251
+ """disable update service
1252
+
1253
+
1254
+ :param project_id: project id (required)
1255
+ :type project_id: str
1256
+ :param server_id: server id (required)
1257
+ :type server_id: str
1258
+ :param _request_timeout: timeout setting for this request. If one
1259
+ number provided, it will be total request
1260
+ timeout. It can also be a pair (tuple) of
1261
+ (connection, read) timeouts.
1262
+ :type _request_timeout: int, tuple(int, int), optional
1263
+ :param _request_auth: set to override the auth_settings for an a single
1264
+ request; this effectively ignores the
1265
+ authentication in the spec for a single request.
1266
+ :type _request_auth: dict, optional
1267
+ :param _content_type: force content-type for the request.
1268
+ :type _content_type: str, Optional
1269
+ :param _headers: set to override the headers for a single
1270
+ request; this effectively ignores the headers
1271
+ in the spec for a single request.
1272
+ :type _headers: dict, optional
1273
+ :param _host_index: set to override the host_index for a single
1274
+ request; this effectively ignores the host_index
1275
+ in the spec for a single request.
1276
+ :type _host_index: int, optional
1277
+ :return: Returns the result object.
1278
+ """ # noqa: E501 docstring might be too long
1279
+
1280
+ _param = self._disable_service_resource_serialize(
1281
+ project_id=project_id,
1282
+ server_id=server_id,
1283
+ _request_auth=_request_auth,
1284
+ _content_type=_content_type,
1285
+ _headers=_headers,
1286
+ _host_index=_host_index,
1287
+ )
1288
+
1289
+ _response_types_map: Dict[str, Optional[str]] = {
1290
+ "204": None,
1291
+ "400": None,
1292
+ "401": None,
1293
+ "404": None,
1294
+ }
1295
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1296
+ return response_data.response
1297
+
1298
+ def _disable_service_resource_serialize(
1299
+ self,
1300
+ project_id,
1301
+ server_id,
1302
+ _request_auth,
1303
+ _content_type,
1304
+ _headers,
1305
+ _host_index,
1306
+ ) -> RequestSerialized:
1307
+
1308
+ _host = None
1309
+
1310
+ _collection_formats: Dict[str, str] = {}
1311
+
1312
+ _path_params: Dict[str, str] = {}
1313
+ _query_params: List[Tuple[str, str]] = []
1314
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1315
+ _form_params: List[Tuple[str, str]] = []
1316
+ _files: Dict[str, Union[str, bytes]] = {}
1317
+ _body_params: Optional[bytes] = None
1318
+
1319
+ # process the path parameters
1320
+ if project_id is not None:
1321
+ _path_params["projectId"] = project_id
1322
+ if server_id is not None:
1323
+ _path_params["serverId"] = server_id
1324
+ # process the query parameters
1325
+ # process the header parameters
1326
+ # process the form parameters
1327
+ # process the body parameter
1328
+
1329
+ # authentication setting
1330
+ _auth_settings: List[str] = []
1331
+
1332
+ return self.api_client.param_serialize(
1333
+ method="DELETE",
1334
+ resource_path="/v1/projects/{projectId}/servers/{serverId}/service",
1335
+ path_params=_path_params,
1336
+ query_params=_query_params,
1337
+ header_params=_header_params,
1338
+ body=_body_params,
1339
+ post_params=_form_params,
1340
+ files=_files,
1341
+ auth_settings=_auth_settings,
1342
+ collection_formats=_collection_formats,
1343
+ _host=_host,
1344
+ _request_auth=_request_auth,
1345
+ )
1346
+
1347
+ @validate_call
1348
+ def enable_service(
1349
+ self,
1350
+ project_id: Annotated[StrictStr, Field(description="project id")],
1351
+ server_id: Annotated[StrictStr, Field(description="server id")],
1352
+ enable_service_payload: Optional[EnableServicePayload] = None,
1353
+ _request_timeout: Union[
1354
+ None,
1355
+ Annotated[StrictFloat, Field(gt=0)],
1356
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1357
+ ] = None,
1358
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1359
+ _content_type: Optional[StrictStr] = None,
1360
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1361
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1362
+ ) -> None:
1363
+ """(Deprecated) enable update service
1364
+
1365
+
1366
+ :param project_id: project id (required)
1367
+ :type project_id: str
1368
+ :param server_id: server id (required)
1369
+ :type server_id: str
1370
+ :param enable_service_payload:
1371
+ :type enable_service_payload: EnableServicePayload
1372
+ :param _request_timeout: timeout setting for this request. If one
1373
+ number provided, it will be total request
1374
+ timeout. It can also be a pair (tuple) of
1375
+ (connection, read) timeouts.
1376
+ :type _request_timeout: int, tuple(int, int), optional
1377
+ :param _request_auth: set to override the auth_settings for an a single
1378
+ request; this effectively ignores the
1379
+ authentication in the spec for a single request.
1380
+ :type _request_auth: dict, optional
1381
+ :param _content_type: force content-type for the request.
1382
+ :type _content_type: str, Optional
1383
+ :param _headers: set to override the headers for a single
1384
+ request; this effectively ignores the headers
1385
+ in the spec for a single request.
1386
+ :type _headers: dict, optional
1387
+ :param _host_index: set to override the host_index for a single
1388
+ request; this effectively ignores the host_index
1389
+ in the spec for a single request.
1390
+ :type _host_index: int, optional
1391
+ :return: Returns the result object.
1392
+ """ # noqa: E501 docstring might be too long
1393
+ warnings.warn("POST /v1/projects/{projectId}/servers/{serverId} is deprecated.", DeprecationWarning)
1394
+
1395
+ _param = self._enable_service_serialize(
1396
+ project_id=project_id,
1397
+ server_id=server_id,
1398
+ enable_service_payload=enable_service_payload,
1399
+ _request_auth=_request_auth,
1400
+ _content_type=_content_type,
1401
+ _headers=_headers,
1402
+ _host_index=_host_index,
1403
+ )
1404
+
1405
+ _response_types_map: Dict[str, Optional[str]] = {
1406
+ "204": None,
1407
+ "400": None,
1408
+ "401": None,
1409
+ "404": None,
1410
+ }
1411
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1412
+ response_data.read()
1413
+ return self.api_client.response_deserialize(
1414
+ response_data=response_data,
1415
+ response_types_map=_response_types_map,
1416
+ ).data
1417
+
1418
+ @validate_call
1419
+ def enable_service_with_http_info(
1420
+ self,
1421
+ project_id: Annotated[StrictStr, Field(description="project id")],
1422
+ server_id: Annotated[StrictStr, Field(description="server id")],
1423
+ enable_service_payload: Optional[EnableServicePayload] = None,
1424
+ _request_timeout: Union[
1425
+ None,
1426
+ Annotated[StrictFloat, Field(gt=0)],
1427
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1428
+ ] = None,
1429
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1430
+ _content_type: Optional[StrictStr] = None,
1431
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1432
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1433
+ ) -> ApiResponse[None]:
1434
+ """(Deprecated) enable update service
1435
+
1436
+
1437
+ :param project_id: project id (required)
1438
+ :type project_id: str
1439
+ :param server_id: server id (required)
1440
+ :type server_id: str
1441
+ :param enable_service_payload:
1442
+ :type enable_service_payload: EnableServicePayload
1443
+ :param _request_timeout: timeout setting for this request. If one
1444
+ number provided, it will be total request
1445
+ timeout. It can also be a pair (tuple) of
1446
+ (connection, read) timeouts.
1447
+ :type _request_timeout: int, tuple(int, int), optional
1448
+ :param _request_auth: set to override the auth_settings for an a single
1449
+ request; this effectively ignores the
1450
+ authentication in the spec for a single request.
1451
+ :type _request_auth: dict, optional
1452
+ :param _content_type: force content-type for the request.
1453
+ :type _content_type: str, Optional
1454
+ :param _headers: set to override the headers for a single
1455
+ request; this effectively ignores the headers
1456
+ in the spec for a single request.
1457
+ :type _headers: dict, optional
1458
+ :param _host_index: set to override the host_index for a single
1459
+ request; this effectively ignores the host_index
1460
+ in the spec for a single request.
1461
+ :type _host_index: int, optional
1462
+ :return: Returns the result object.
1463
+ """ # noqa: E501 docstring might be too long
1464
+ warnings.warn("POST /v1/projects/{projectId}/servers/{serverId} is deprecated.", DeprecationWarning)
1465
+
1466
+ _param = self._enable_service_serialize(
1467
+ project_id=project_id,
1468
+ server_id=server_id,
1469
+ enable_service_payload=enable_service_payload,
1470
+ _request_auth=_request_auth,
1471
+ _content_type=_content_type,
1472
+ _headers=_headers,
1473
+ _host_index=_host_index,
1474
+ )
1475
+
1476
+ _response_types_map: Dict[str, Optional[str]] = {
1477
+ "204": None,
1478
+ "400": None,
1479
+ "401": None,
1480
+ "404": None,
1481
+ }
1482
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1483
+ response_data.read()
1484
+ return self.api_client.response_deserialize(
1485
+ response_data=response_data,
1486
+ response_types_map=_response_types_map,
1487
+ )
1488
+
1489
+ @validate_call
1490
+ def enable_service_without_preload_content(
1491
+ self,
1492
+ project_id: Annotated[StrictStr, Field(description="project id")],
1493
+ server_id: Annotated[StrictStr, Field(description="server id")],
1494
+ enable_service_payload: Optional[EnableServicePayload] = None,
1495
+ _request_timeout: Union[
1496
+ None,
1497
+ Annotated[StrictFloat, Field(gt=0)],
1498
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1499
+ ] = None,
1500
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1501
+ _content_type: Optional[StrictStr] = None,
1502
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1503
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1504
+ ) -> RESTResponseType:
1505
+ """(Deprecated) enable update service
1506
+
1507
+
1508
+ :param project_id: project id (required)
1509
+ :type project_id: str
1510
+ :param server_id: server id (required)
1511
+ :type server_id: str
1512
+ :param enable_service_payload:
1513
+ :type enable_service_payload: EnableServicePayload
1514
+ :param _request_timeout: timeout setting for this request. If one
1515
+ number provided, it will be total request
1516
+ timeout. It can also be a pair (tuple) of
1517
+ (connection, read) timeouts.
1518
+ :type _request_timeout: int, tuple(int, int), optional
1519
+ :param _request_auth: set to override the auth_settings for an a single
1520
+ request; this effectively ignores the
1521
+ authentication in the spec for a single request.
1522
+ :type _request_auth: dict, optional
1523
+ :param _content_type: force content-type for the request.
1524
+ :type _content_type: str, Optional
1525
+ :param _headers: set to override the headers for a single
1526
+ request; this effectively ignores the headers
1527
+ in the spec for a single request.
1528
+ :type _headers: dict, optional
1529
+ :param _host_index: set to override the host_index for a single
1530
+ request; this effectively ignores the host_index
1531
+ in the spec for a single request.
1532
+ :type _host_index: int, optional
1533
+ :return: Returns the result object.
1534
+ """ # noqa: E501 docstring might be too long
1535
+ warnings.warn("POST /v1/projects/{projectId}/servers/{serverId} is deprecated.", DeprecationWarning)
1536
+
1537
+ _param = self._enable_service_serialize(
1538
+ project_id=project_id,
1539
+ server_id=server_id,
1540
+ enable_service_payload=enable_service_payload,
1541
+ _request_auth=_request_auth,
1542
+ _content_type=_content_type,
1543
+ _headers=_headers,
1544
+ _host_index=_host_index,
1545
+ )
1546
+
1547
+ _response_types_map: Dict[str, Optional[str]] = {
1548
+ "204": None,
1549
+ "400": None,
1550
+ "401": None,
1551
+ "404": None,
1552
+ }
1553
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1554
+ return response_data.response
1555
+
1556
+ def _enable_service_serialize(
1557
+ self,
1558
+ project_id,
1559
+ server_id,
1560
+ enable_service_payload,
1561
+ _request_auth,
1562
+ _content_type,
1563
+ _headers,
1564
+ _host_index,
1565
+ ) -> RequestSerialized:
1566
+
1567
+ _host = None
1568
+
1569
+ _collection_formats: Dict[str, str] = {}
1570
+
1571
+ _path_params: Dict[str, str] = {}
1572
+ _query_params: List[Tuple[str, str]] = []
1573
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1574
+ _form_params: List[Tuple[str, str]] = []
1575
+ _files: Dict[str, Union[str, bytes]] = {}
1576
+ _body_params: Optional[bytes] = None
1577
+
1578
+ # process the path parameters
1579
+ if project_id is not None:
1580
+ _path_params["projectId"] = project_id
1581
+ if server_id is not None:
1582
+ _path_params["serverId"] = server_id
1583
+ # process the query parameters
1584
+ # process the header parameters
1585
+ # process the form parameters
1586
+ # process the body parameter
1587
+ if enable_service_payload is not None:
1588
+ _body_params = enable_service_payload
1589
+
1590
+ # set the HTTP header `Content-Type`
1591
+ if _content_type:
1592
+ _header_params["Content-Type"] = _content_type
1593
+ else:
1594
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
1595
+ if _default_content_type is not None:
1596
+ _header_params["Content-Type"] = _default_content_type
1597
+
1598
+ # authentication setting
1599
+ _auth_settings: List[str] = []
1600
+
1601
+ return self.api_client.param_serialize(
1602
+ method="POST",
1603
+ resource_path="/v1/projects/{projectId}/servers/{serverId}",
1604
+ path_params=_path_params,
1605
+ query_params=_query_params,
1606
+ header_params=_header_params,
1607
+ body=_body_params,
1608
+ post_params=_form_params,
1609
+ files=_files,
1610
+ auth_settings=_auth_settings,
1611
+ collection_formats=_collection_formats,
1612
+ _host=_host,
1613
+ _request_auth=_request_auth,
1614
+ )
1615
+
1616
+ @validate_call
1617
+ def enable_service_resource(
1618
+ self,
1619
+ project_id: Annotated[StrictStr, Field(description="project id")],
1620
+ server_id: Annotated[StrictStr, Field(description="server id")],
1621
+ enable_service_resource_payload: Optional[EnableServiceResourcePayload] = None,
1622
+ _request_timeout: Union[
1623
+ None,
1624
+ Annotated[StrictFloat, Field(gt=0)],
1625
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1626
+ ] = None,
1627
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1628
+ _content_type: Optional[StrictStr] = None,
1629
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1630
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1631
+ ) -> None:
1632
+ """enable update service
1633
+
1634
+
1635
+ :param project_id: project id (required)
1636
+ :type project_id: str
1637
+ :param server_id: server id (required)
1638
+ :type server_id: str
1639
+ :param enable_service_resource_payload:
1640
+ :type enable_service_resource_payload: EnableServiceResourcePayload
1641
+ :param _request_timeout: timeout setting for this request. If one
1642
+ number provided, it will be total request
1643
+ timeout. It can also be a pair (tuple) of
1644
+ (connection, read) timeouts.
1645
+ :type _request_timeout: int, tuple(int, int), optional
1646
+ :param _request_auth: set to override the auth_settings for an a single
1647
+ request; this effectively ignores the
1648
+ authentication in the spec for a single request.
1649
+ :type _request_auth: dict, optional
1650
+ :param _content_type: force content-type for the request.
1651
+ :type _content_type: str, Optional
1652
+ :param _headers: set to override the headers for a single
1653
+ request; this effectively ignores the headers
1654
+ in the spec for a single request.
1655
+ :type _headers: dict, optional
1656
+ :param _host_index: set to override the host_index for a single
1657
+ request; this effectively ignores the host_index
1658
+ in the spec for a single request.
1659
+ :type _host_index: int, optional
1660
+ :return: Returns the result object.
1661
+ """ # noqa: E501 docstring might be too long
1662
+
1663
+ _param = self._enable_service_resource_serialize(
1664
+ project_id=project_id,
1665
+ server_id=server_id,
1666
+ enable_service_resource_payload=enable_service_resource_payload,
1667
+ _request_auth=_request_auth,
1668
+ _content_type=_content_type,
1669
+ _headers=_headers,
1670
+ _host_index=_host_index,
1671
+ )
1672
+
1673
+ _response_types_map: Dict[str, Optional[str]] = {
1674
+ "204": None,
1675
+ "400": None,
1676
+ "401": None,
1677
+ "404": None,
1678
+ }
1679
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1680
+ response_data.read()
1681
+ return self.api_client.response_deserialize(
1682
+ response_data=response_data,
1683
+ response_types_map=_response_types_map,
1684
+ ).data
1685
+
1686
+ @validate_call
1687
+ def enable_service_resource_with_http_info(
1688
+ self,
1689
+ project_id: Annotated[StrictStr, Field(description="project id")],
1690
+ server_id: Annotated[StrictStr, Field(description="server id")],
1691
+ enable_service_resource_payload: Optional[EnableServiceResourcePayload] = None,
1692
+ _request_timeout: Union[
1693
+ None,
1694
+ Annotated[StrictFloat, Field(gt=0)],
1695
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1696
+ ] = None,
1697
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1698
+ _content_type: Optional[StrictStr] = None,
1699
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1700
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1701
+ ) -> ApiResponse[None]:
1702
+ """enable update service
1703
+
1704
+
1705
+ :param project_id: project id (required)
1706
+ :type project_id: str
1707
+ :param server_id: server id (required)
1708
+ :type server_id: str
1709
+ :param enable_service_resource_payload:
1710
+ :type enable_service_resource_payload: EnableServiceResourcePayload
1711
+ :param _request_timeout: timeout setting for this request. If one
1712
+ number provided, it will be total request
1713
+ timeout. It can also be a pair (tuple) of
1714
+ (connection, read) timeouts.
1715
+ :type _request_timeout: int, tuple(int, int), optional
1716
+ :param _request_auth: set to override the auth_settings for an a single
1717
+ request; this effectively ignores the
1718
+ authentication in the spec for a single request.
1719
+ :type _request_auth: dict, optional
1720
+ :param _content_type: force content-type for the request.
1721
+ :type _content_type: str, Optional
1722
+ :param _headers: set to override the headers for a single
1723
+ request; this effectively ignores the headers
1724
+ in the spec for a single request.
1725
+ :type _headers: dict, optional
1726
+ :param _host_index: set to override the host_index for a single
1727
+ request; this effectively ignores the host_index
1728
+ in the spec for a single request.
1729
+ :type _host_index: int, optional
1730
+ :return: Returns the result object.
1731
+ """ # noqa: E501 docstring might be too long
1732
+
1733
+ _param = self._enable_service_resource_serialize(
1734
+ project_id=project_id,
1735
+ server_id=server_id,
1736
+ enable_service_resource_payload=enable_service_resource_payload,
1737
+ _request_auth=_request_auth,
1738
+ _content_type=_content_type,
1739
+ _headers=_headers,
1740
+ _host_index=_host_index,
1741
+ )
1742
+
1743
+ _response_types_map: Dict[str, Optional[str]] = {
1744
+ "204": None,
1745
+ "400": None,
1746
+ "401": None,
1747
+ "404": None,
1748
+ }
1749
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1750
+ response_data.read()
1751
+ return self.api_client.response_deserialize(
1752
+ response_data=response_data,
1753
+ response_types_map=_response_types_map,
1754
+ )
1755
+
1756
+ @validate_call
1757
+ def enable_service_resource_without_preload_content(
1758
+ self,
1759
+ project_id: Annotated[StrictStr, Field(description="project id")],
1760
+ server_id: Annotated[StrictStr, Field(description="server id")],
1761
+ enable_service_resource_payload: Optional[EnableServiceResourcePayload] = None,
1762
+ _request_timeout: Union[
1763
+ None,
1764
+ Annotated[StrictFloat, Field(gt=0)],
1765
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1766
+ ] = None,
1767
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1768
+ _content_type: Optional[StrictStr] = None,
1769
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1770
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1771
+ ) -> RESTResponseType:
1772
+ """enable update service
1773
+
1774
+
1775
+ :param project_id: project id (required)
1776
+ :type project_id: str
1777
+ :param server_id: server id (required)
1778
+ :type server_id: str
1779
+ :param enable_service_resource_payload:
1780
+ :type enable_service_resource_payload: EnableServiceResourcePayload
1781
+ :param _request_timeout: timeout setting for this request. If one
1782
+ number provided, it will be total request
1783
+ timeout. It can also be a pair (tuple) of
1784
+ (connection, read) timeouts.
1785
+ :type _request_timeout: int, tuple(int, int), optional
1786
+ :param _request_auth: set to override the auth_settings for an a single
1787
+ request; this effectively ignores the
1788
+ authentication in the spec for a single request.
1789
+ :type _request_auth: dict, optional
1790
+ :param _content_type: force content-type for the request.
1791
+ :type _content_type: str, Optional
1792
+ :param _headers: set to override the headers for a single
1793
+ request; this effectively ignores the headers
1794
+ in the spec for a single request.
1795
+ :type _headers: dict, optional
1796
+ :param _host_index: set to override the host_index for a single
1797
+ request; this effectively ignores the host_index
1798
+ in the spec for a single request.
1799
+ :type _host_index: int, optional
1800
+ :return: Returns the result object.
1801
+ """ # noqa: E501 docstring might be too long
1802
+
1803
+ _param = self._enable_service_resource_serialize(
1804
+ project_id=project_id,
1805
+ server_id=server_id,
1806
+ enable_service_resource_payload=enable_service_resource_payload,
1807
+ _request_auth=_request_auth,
1808
+ _content_type=_content_type,
1809
+ _headers=_headers,
1810
+ _host_index=_host_index,
1811
+ )
1812
+
1813
+ _response_types_map: Dict[str, Optional[str]] = {
1814
+ "204": None,
1815
+ "400": None,
1816
+ "401": None,
1817
+ "404": None,
1818
+ }
1819
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1820
+ return response_data.response
1821
+
1822
+ def _enable_service_resource_serialize(
1823
+ self,
1824
+ project_id,
1825
+ server_id,
1826
+ enable_service_resource_payload,
1827
+ _request_auth,
1828
+ _content_type,
1829
+ _headers,
1830
+ _host_index,
1831
+ ) -> RequestSerialized:
1832
+
1833
+ _host = None
1834
+
1835
+ _collection_formats: Dict[str, str] = {}
1836
+
1837
+ _path_params: Dict[str, str] = {}
1838
+ _query_params: List[Tuple[str, str]] = []
1839
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1840
+ _form_params: List[Tuple[str, str]] = []
1841
+ _files: Dict[str, Union[str, bytes]] = {}
1842
+ _body_params: Optional[bytes] = None
1843
+
1844
+ # process the path parameters
1845
+ if project_id is not None:
1846
+ _path_params["projectId"] = project_id
1847
+ if server_id is not None:
1848
+ _path_params["serverId"] = server_id
1849
+ # process the query parameters
1850
+ # process the header parameters
1851
+ # process the form parameters
1852
+ # process the body parameter
1853
+ if enable_service_resource_payload is not None:
1854
+ _body_params = enable_service_resource_payload
1855
+
1856
+ # set the HTTP header `Content-Type`
1857
+ if _content_type:
1858
+ _header_params["Content-Type"] = _content_type
1859
+ else:
1860
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
1861
+ if _default_content_type is not None:
1862
+ _header_params["Content-Type"] = _default_content_type
1863
+
1864
+ # authentication setting
1865
+ _auth_settings: List[str] = []
1866
+
1867
+ return self.api_client.param_serialize(
1868
+ method="POST",
1869
+ resource_path="/v1/projects/{projectId}/servers/{serverId}/service",
1870
+ path_params=_path_params,
1871
+ query_params=_query_params,
1872
+ header_params=_header_params,
1873
+ body=_body_params,
1874
+ post_params=_form_params,
1875
+ files=_files,
1876
+ auth_settings=_auth_settings,
1877
+ collection_formats=_collection_formats,
1878
+ _host=_host,
1879
+ _request_auth=_request_auth,
1880
+ )
1881
+
1882
+ @validate_call
1883
+ def get_update(
1884
+ self,
1885
+ project_id: Annotated[StrictStr, Field(description="project id")],
1886
+ server_id: Annotated[StrictStr, Field(description="server id")],
1887
+ update_id: Annotated[StrictStr, Field(description="id of the update")],
1888
+ _request_timeout: Union[
1889
+ None,
1890
+ Annotated[StrictFloat, Field(gt=0)],
1891
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1892
+ ] = None,
1893
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1894
+ _content_type: Optional[StrictStr] = None,
1895
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1896
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1897
+ ) -> Update:
1898
+ """get update
1899
+
1900
+
1901
+ :param project_id: project id (required)
1902
+ :type project_id: str
1903
+ :param server_id: server id (required)
1904
+ :type server_id: str
1905
+ :param update_id: id of the update (required)
1906
+ :type update_id: str
1907
+ :param _request_timeout: timeout setting for this request. If one
1908
+ number provided, it will be total request
1909
+ timeout. It can also be a pair (tuple) of
1910
+ (connection, read) timeouts.
1911
+ :type _request_timeout: int, tuple(int, int), optional
1912
+ :param _request_auth: set to override the auth_settings for an a single
1913
+ request; this effectively ignores the
1914
+ authentication in the spec for a single request.
1915
+ :type _request_auth: dict, optional
1916
+ :param _content_type: force content-type for the request.
1917
+ :type _content_type: str, Optional
1918
+ :param _headers: set to override the headers for a single
1919
+ request; this effectively ignores the headers
1920
+ in the spec for a single request.
1921
+ :type _headers: dict, optional
1922
+ :param _host_index: set to override the host_index for a single
1923
+ request; this effectively ignores the host_index
1924
+ in the spec for a single request.
1925
+ :type _host_index: int, optional
1926
+ :return: Returns the result object.
1927
+ """ # noqa: E501 docstring might be too long
1928
+
1929
+ _param = self._get_update_serialize(
1930
+ project_id=project_id,
1931
+ server_id=server_id,
1932
+ update_id=update_id,
1933
+ _request_auth=_request_auth,
1934
+ _content_type=_content_type,
1935
+ _headers=_headers,
1936
+ _host_index=_host_index,
1937
+ )
1938
+
1939
+ _response_types_map: Dict[str, Optional[str]] = {
1940
+ "200": "Update",
1941
+ "400": None,
1942
+ "401": None,
1943
+ "404": None,
1944
+ }
1945
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1946
+ response_data.read()
1947
+ return self.api_client.response_deserialize(
1948
+ response_data=response_data,
1949
+ response_types_map=_response_types_map,
1950
+ ).data
1951
+
1952
+ @validate_call
1953
+ def get_update_with_http_info(
1954
+ self,
1955
+ project_id: Annotated[StrictStr, Field(description="project id")],
1956
+ server_id: Annotated[StrictStr, Field(description="server id")],
1957
+ update_id: Annotated[StrictStr, Field(description="id of the update")],
1958
+ _request_timeout: Union[
1959
+ None,
1960
+ Annotated[StrictFloat, Field(gt=0)],
1961
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1962
+ ] = None,
1963
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1964
+ _content_type: Optional[StrictStr] = None,
1965
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1966
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1967
+ ) -> ApiResponse[Update]:
1968
+ """get update
1969
+
1970
+
1971
+ :param project_id: project id (required)
1972
+ :type project_id: str
1973
+ :param server_id: server id (required)
1974
+ :type server_id: str
1975
+ :param update_id: id of the update (required)
1976
+ :type update_id: str
1977
+ :param _request_timeout: timeout setting for this request. If one
1978
+ number provided, it will be total request
1979
+ timeout. It can also be a pair (tuple) of
1980
+ (connection, read) timeouts.
1981
+ :type _request_timeout: int, tuple(int, int), optional
1982
+ :param _request_auth: set to override the auth_settings for an a single
1983
+ request; this effectively ignores the
1984
+ authentication in the spec for a single request.
1985
+ :type _request_auth: dict, optional
1986
+ :param _content_type: force content-type for the request.
1987
+ :type _content_type: str, Optional
1988
+ :param _headers: set to override the headers for a single
1989
+ request; this effectively ignores the headers
1990
+ in the spec for a single request.
1991
+ :type _headers: dict, optional
1992
+ :param _host_index: set to override the host_index for a single
1993
+ request; this effectively ignores the host_index
1994
+ in the spec for a single request.
1995
+ :type _host_index: int, optional
1996
+ :return: Returns the result object.
1997
+ """ # noqa: E501 docstring might be too long
1998
+
1999
+ _param = self._get_update_serialize(
2000
+ project_id=project_id,
2001
+ server_id=server_id,
2002
+ update_id=update_id,
2003
+ _request_auth=_request_auth,
2004
+ _content_type=_content_type,
2005
+ _headers=_headers,
2006
+ _host_index=_host_index,
2007
+ )
2008
+
2009
+ _response_types_map: Dict[str, Optional[str]] = {
2010
+ "200": "Update",
2011
+ "400": None,
2012
+ "401": None,
2013
+ "404": None,
2014
+ }
2015
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2016
+ response_data.read()
2017
+ return self.api_client.response_deserialize(
2018
+ response_data=response_data,
2019
+ response_types_map=_response_types_map,
2020
+ )
2021
+
2022
+ @validate_call
2023
+ def get_update_without_preload_content(
2024
+ self,
2025
+ project_id: Annotated[StrictStr, Field(description="project id")],
2026
+ server_id: Annotated[StrictStr, Field(description="server id")],
2027
+ update_id: Annotated[StrictStr, Field(description="id of the update")],
2028
+ _request_timeout: Union[
2029
+ None,
2030
+ Annotated[StrictFloat, Field(gt=0)],
2031
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2032
+ ] = None,
2033
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2034
+ _content_type: Optional[StrictStr] = None,
2035
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2036
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2037
+ ) -> RESTResponseType:
2038
+ """get update
2039
+
2040
+
2041
+ :param project_id: project id (required)
2042
+ :type project_id: str
2043
+ :param server_id: server id (required)
2044
+ :type server_id: str
2045
+ :param update_id: id of the update (required)
2046
+ :type update_id: str
2047
+ :param _request_timeout: timeout setting for this request. If one
2048
+ number provided, it will be total request
2049
+ timeout. It can also be a pair (tuple) of
2050
+ (connection, read) timeouts.
2051
+ :type _request_timeout: int, tuple(int, int), optional
2052
+ :param _request_auth: set to override the auth_settings for an a single
2053
+ request; this effectively ignores the
2054
+ authentication in the spec for a single request.
2055
+ :type _request_auth: dict, optional
2056
+ :param _content_type: force content-type for the request.
2057
+ :type _content_type: str, Optional
2058
+ :param _headers: set to override the headers for a single
2059
+ request; this effectively ignores the headers
2060
+ in the spec for a single request.
2061
+ :type _headers: dict, optional
2062
+ :param _host_index: set to override the host_index for a single
2063
+ request; this effectively ignores the host_index
2064
+ in the spec for a single request.
2065
+ :type _host_index: int, optional
2066
+ :return: Returns the result object.
2067
+ """ # noqa: E501 docstring might be too long
2068
+
2069
+ _param = self._get_update_serialize(
2070
+ project_id=project_id,
2071
+ server_id=server_id,
2072
+ update_id=update_id,
2073
+ _request_auth=_request_auth,
2074
+ _content_type=_content_type,
2075
+ _headers=_headers,
2076
+ _host_index=_host_index,
2077
+ )
2078
+
2079
+ _response_types_map: Dict[str, Optional[str]] = {
2080
+ "200": "Update",
2081
+ "400": None,
2082
+ "401": None,
2083
+ "404": None,
2084
+ }
2085
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2086
+ return response_data.response
2087
+
2088
+ def _get_update_serialize(
2089
+ self,
2090
+ project_id,
2091
+ server_id,
2092
+ update_id,
2093
+ _request_auth,
2094
+ _content_type,
2095
+ _headers,
2096
+ _host_index,
2097
+ ) -> RequestSerialized:
2098
+
2099
+ _host = None
2100
+
2101
+ _collection_formats: Dict[str, str] = {}
2102
+
2103
+ _path_params: Dict[str, str] = {}
2104
+ _query_params: List[Tuple[str, str]] = []
2105
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2106
+ _form_params: List[Tuple[str, str]] = []
2107
+ _files: Dict[str, Union[str, bytes]] = {}
2108
+ _body_params: Optional[bytes] = None
2109
+
2110
+ # process the path parameters
2111
+ if project_id is not None:
2112
+ _path_params["projectId"] = project_id
2113
+ if server_id is not None:
2114
+ _path_params["serverId"] = server_id
2115
+ if update_id is not None:
2116
+ _path_params["updateId"] = update_id
2117
+ # process the query parameters
2118
+ # process the header parameters
2119
+ # process the form parameters
2120
+ # process the body parameter
2121
+
2122
+ # set the HTTP header `Accept`
2123
+ if "Accept" not in _header_params:
2124
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2125
+
2126
+ # authentication setting
2127
+ _auth_settings: List[str] = []
2128
+
2129
+ return self.api_client.param_serialize(
2130
+ method="GET",
2131
+ resource_path="/v1/projects/{projectId}/servers/{serverId}/updates/{updateId}",
2132
+ path_params=_path_params,
2133
+ query_params=_query_params,
2134
+ header_params=_header_params,
2135
+ body=_body_params,
2136
+ post_params=_form_params,
2137
+ files=_files,
2138
+ auth_settings=_auth_settings,
2139
+ collection_formats=_collection_formats,
2140
+ _host=_host,
2141
+ _request_auth=_request_auth,
2142
+ )
2143
+
2144
+ @validate_call
2145
+ def get_update_schedule(
2146
+ self,
2147
+ project_id: Annotated[StrictStr, Field(description="project id")],
2148
+ server_id: Annotated[StrictStr, Field(description="server id")],
2149
+ schedule_id: Annotated[StrictStr, Field(description="update schedule id")],
2150
+ _request_timeout: Union[
2151
+ None,
2152
+ Annotated[StrictFloat, Field(gt=0)],
2153
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2154
+ ] = None,
2155
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2156
+ _content_type: Optional[StrictStr] = None,
2157
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2158
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2159
+ ) -> UpdateSchedule:
2160
+ """get single update schedule details
2161
+
2162
+
2163
+ :param project_id: project id (required)
2164
+ :type project_id: str
2165
+ :param server_id: server id (required)
2166
+ :type server_id: str
2167
+ :param schedule_id: update schedule id (required)
2168
+ :type schedule_id: str
2169
+ :param _request_timeout: timeout setting for this request. If one
2170
+ number provided, it will be total request
2171
+ timeout. It can also be a pair (tuple) of
2172
+ (connection, read) timeouts.
2173
+ :type _request_timeout: int, tuple(int, int), optional
2174
+ :param _request_auth: set to override the auth_settings for an a single
2175
+ request; this effectively ignores the
2176
+ authentication in the spec for a single request.
2177
+ :type _request_auth: dict, optional
2178
+ :param _content_type: force content-type for the request.
2179
+ :type _content_type: str, Optional
2180
+ :param _headers: set to override the headers for a single
2181
+ request; this effectively ignores the headers
2182
+ in the spec for a single request.
2183
+ :type _headers: dict, optional
2184
+ :param _host_index: set to override the host_index for a single
2185
+ request; this effectively ignores the host_index
2186
+ in the spec for a single request.
2187
+ :type _host_index: int, optional
2188
+ :return: Returns the result object.
2189
+ """ # noqa: E501 docstring might be too long
2190
+
2191
+ _param = self._get_update_schedule_serialize(
2192
+ project_id=project_id,
2193
+ server_id=server_id,
2194
+ schedule_id=schedule_id,
2195
+ _request_auth=_request_auth,
2196
+ _content_type=_content_type,
2197
+ _headers=_headers,
2198
+ _host_index=_host_index,
2199
+ )
2200
+
2201
+ _response_types_map: Dict[str, Optional[str]] = {
2202
+ "200": "UpdateSchedule",
2203
+ "400": None,
2204
+ "401": None,
2205
+ "404": None,
2206
+ }
2207
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2208
+ response_data.read()
2209
+ return self.api_client.response_deserialize(
2210
+ response_data=response_data,
2211
+ response_types_map=_response_types_map,
2212
+ ).data
2213
+
2214
+ @validate_call
2215
+ def get_update_schedule_with_http_info(
2216
+ self,
2217
+ project_id: Annotated[StrictStr, Field(description="project id")],
2218
+ server_id: Annotated[StrictStr, Field(description="server id")],
2219
+ schedule_id: Annotated[StrictStr, Field(description="update schedule id")],
2220
+ _request_timeout: Union[
2221
+ None,
2222
+ Annotated[StrictFloat, Field(gt=0)],
2223
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2224
+ ] = None,
2225
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2226
+ _content_type: Optional[StrictStr] = None,
2227
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2228
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2229
+ ) -> ApiResponse[UpdateSchedule]:
2230
+ """get single update schedule details
2231
+
2232
+
2233
+ :param project_id: project id (required)
2234
+ :type project_id: str
2235
+ :param server_id: server id (required)
2236
+ :type server_id: str
2237
+ :param schedule_id: update schedule id (required)
2238
+ :type schedule_id: str
2239
+ :param _request_timeout: timeout setting for this request. If one
2240
+ number provided, it will be total request
2241
+ timeout. It can also be a pair (tuple) of
2242
+ (connection, read) timeouts.
2243
+ :type _request_timeout: int, tuple(int, int), optional
2244
+ :param _request_auth: set to override the auth_settings for an a single
2245
+ request; this effectively ignores the
2246
+ authentication in the spec for a single request.
2247
+ :type _request_auth: dict, optional
2248
+ :param _content_type: force content-type for the request.
2249
+ :type _content_type: str, Optional
2250
+ :param _headers: set to override the headers for a single
2251
+ request; this effectively ignores the headers
2252
+ in the spec for a single request.
2253
+ :type _headers: dict, optional
2254
+ :param _host_index: set to override the host_index for a single
2255
+ request; this effectively ignores the host_index
2256
+ in the spec for a single request.
2257
+ :type _host_index: int, optional
2258
+ :return: Returns the result object.
2259
+ """ # noqa: E501 docstring might be too long
2260
+
2261
+ _param = self._get_update_schedule_serialize(
2262
+ project_id=project_id,
2263
+ server_id=server_id,
2264
+ schedule_id=schedule_id,
2265
+ _request_auth=_request_auth,
2266
+ _content_type=_content_type,
2267
+ _headers=_headers,
2268
+ _host_index=_host_index,
2269
+ )
2270
+
2271
+ _response_types_map: Dict[str, Optional[str]] = {
2272
+ "200": "UpdateSchedule",
2273
+ "400": None,
2274
+ "401": None,
2275
+ "404": None,
2276
+ }
2277
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2278
+ response_data.read()
2279
+ return self.api_client.response_deserialize(
2280
+ response_data=response_data,
2281
+ response_types_map=_response_types_map,
2282
+ )
2283
+
2284
+ @validate_call
2285
+ def get_update_schedule_without_preload_content(
2286
+ self,
2287
+ project_id: Annotated[StrictStr, Field(description="project id")],
2288
+ server_id: Annotated[StrictStr, Field(description="server id")],
2289
+ schedule_id: Annotated[StrictStr, Field(description="update schedule id")],
2290
+ _request_timeout: Union[
2291
+ None,
2292
+ Annotated[StrictFloat, Field(gt=0)],
2293
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2294
+ ] = None,
2295
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2296
+ _content_type: Optional[StrictStr] = None,
2297
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2298
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2299
+ ) -> RESTResponseType:
2300
+ """get single update schedule details
2301
+
2302
+
2303
+ :param project_id: project id (required)
2304
+ :type project_id: str
2305
+ :param server_id: server id (required)
2306
+ :type server_id: str
2307
+ :param schedule_id: update schedule id (required)
2308
+ :type schedule_id: str
2309
+ :param _request_timeout: timeout setting for this request. If one
2310
+ number provided, it will be total request
2311
+ timeout. It can also be a pair (tuple) of
2312
+ (connection, read) timeouts.
2313
+ :type _request_timeout: int, tuple(int, int), optional
2314
+ :param _request_auth: set to override the auth_settings for an a single
2315
+ request; this effectively ignores the
2316
+ authentication in the spec for a single request.
2317
+ :type _request_auth: dict, optional
2318
+ :param _content_type: force content-type for the request.
2319
+ :type _content_type: str, Optional
2320
+ :param _headers: set to override the headers for a single
2321
+ request; this effectively ignores the headers
2322
+ in the spec for a single request.
2323
+ :type _headers: dict, optional
2324
+ :param _host_index: set to override the host_index for a single
2325
+ request; this effectively ignores the host_index
2326
+ in the spec for a single request.
2327
+ :type _host_index: int, optional
2328
+ :return: Returns the result object.
2329
+ """ # noqa: E501 docstring might be too long
2330
+
2331
+ _param = self._get_update_schedule_serialize(
2332
+ project_id=project_id,
2333
+ server_id=server_id,
2334
+ schedule_id=schedule_id,
2335
+ _request_auth=_request_auth,
2336
+ _content_type=_content_type,
2337
+ _headers=_headers,
2338
+ _host_index=_host_index,
2339
+ )
2340
+
2341
+ _response_types_map: Dict[str, Optional[str]] = {
2342
+ "200": "UpdateSchedule",
2343
+ "400": None,
2344
+ "401": None,
2345
+ "404": None,
2346
+ }
2347
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2348
+ return response_data.response
2349
+
2350
+ def _get_update_schedule_serialize(
2351
+ self,
2352
+ project_id,
2353
+ server_id,
2354
+ schedule_id,
2355
+ _request_auth,
2356
+ _content_type,
2357
+ _headers,
2358
+ _host_index,
2359
+ ) -> RequestSerialized:
2360
+
2361
+ _host = None
2362
+
2363
+ _collection_formats: Dict[str, str] = {}
2364
+
2365
+ _path_params: Dict[str, str] = {}
2366
+ _query_params: List[Tuple[str, str]] = []
2367
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2368
+ _form_params: List[Tuple[str, str]] = []
2369
+ _files: Dict[str, Union[str, bytes]] = {}
2370
+ _body_params: Optional[bytes] = None
2371
+
2372
+ # process the path parameters
2373
+ if project_id is not None:
2374
+ _path_params["projectId"] = project_id
2375
+ if server_id is not None:
2376
+ _path_params["serverId"] = server_id
2377
+ if schedule_id is not None:
2378
+ _path_params["scheduleId"] = schedule_id
2379
+ # process the query parameters
2380
+ # process the header parameters
2381
+ # process the form parameters
2382
+ # process the body parameter
2383
+
2384
+ # set the HTTP header `Accept`
2385
+ if "Accept" not in _header_params:
2386
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2387
+
2388
+ # authentication setting
2389
+ _auth_settings: List[str] = []
2390
+
2391
+ return self.api_client.param_serialize(
2392
+ method="GET",
2393
+ resource_path="/v1/projects/{projectId}/servers/{serverId}/update-schedules/{scheduleId}",
2394
+ path_params=_path_params,
2395
+ query_params=_query_params,
2396
+ header_params=_header_params,
2397
+ body=_body_params,
2398
+ post_params=_form_params,
2399
+ files=_files,
2400
+ auth_settings=_auth_settings,
2401
+ collection_formats=_collection_formats,
2402
+ _host=_host,
2403
+ _request_auth=_request_auth,
2404
+ )
2405
+
2406
+ @validate_call
2407
+ def list_update_policies(
2408
+ self,
2409
+ project_id: Annotated[StrictStr, Field(description="project id")],
2410
+ _request_timeout: Union[
2411
+ None,
2412
+ Annotated[StrictFloat, Field(gt=0)],
2413
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2414
+ ] = None,
2415
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2416
+ _content_type: Optional[StrictStr] = None,
2417
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2418
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2419
+ ) -> GetUpdatePoliciesResponse:
2420
+ """get list of update policies
2421
+
2422
+
2423
+ :param project_id: project id (required)
2424
+ :type project_id: str
2425
+ :param _request_timeout: timeout setting for this request. If one
2426
+ number provided, it will be total request
2427
+ timeout. It can also be a pair (tuple) of
2428
+ (connection, read) timeouts.
2429
+ :type _request_timeout: int, tuple(int, int), optional
2430
+ :param _request_auth: set to override the auth_settings for an a single
2431
+ request; this effectively ignores the
2432
+ authentication in the spec for a single request.
2433
+ :type _request_auth: dict, optional
2434
+ :param _content_type: force content-type for the request.
2435
+ :type _content_type: str, Optional
2436
+ :param _headers: set to override the headers for a single
2437
+ request; this effectively ignores the headers
2438
+ in the spec for a single request.
2439
+ :type _headers: dict, optional
2440
+ :param _host_index: set to override the host_index for a single
2441
+ request; this effectively ignores the host_index
2442
+ in the spec for a single request.
2443
+ :type _host_index: int, optional
2444
+ :return: Returns the result object.
2445
+ """ # noqa: E501 docstring might be too long
2446
+
2447
+ _param = self._list_update_policies_serialize(
2448
+ project_id=project_id,
2449
+ _request_auth=_request_auth,
2450
+ _content_type=_content_type,
2451
+ _headers=_headers,
2452
+ _host_index=_host_index,
2453
+ )
2454
+
2455
+ _response_types_map: Dict[str, Optional[str]] = {
2456
+ "200": "GetUpdatePoliciesResponse",
2457
+ "400": None,
2458
+ "404": None,
2459
+ }
2460
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2461
+ response_data.read()
2462
+ return self.api_client.response_deserialize(
2463
+ response_data=response_data,
2464
+ response_types_map=_response_types_map,
2465
+ ).data
2466
+
2467
+ @validate_call
2468
+ def list_update_policies_with_http_info(
2469
+ self,
2470
+ project_id: Annotated[StrictStr, Field(description="project id")],
2471
+ _request_timeout: Union[
2472
+ None,
2473
+ Annotated[StrictFloat, Field(gt=0)],
2474
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2475
+ ] = None,
2476
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2477
+ _content_type: Optional[StrictStr] = None,
2478
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2479
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2480
+ ) -> ApiResponse[GetUpdatePoliciesResponse]:
2481
+ """get list of update policies
2482
+
2483
+
2484
+ :param project_id: project id (required)
2485
+ :type project_id: str
2486
+ :param _request_timeout: timeout setting for this request. If one
2487
+ number provided, it will be total request
2488
+ timeout. It can also be a pair (tuple) of
2489
+ (connection, read) timeouts.
2490
+ :type _request_timeout: int, tuple(int, int), optional
2491
+ :param _request_auth: set to override the auth_settings for an a single
2492
+ request; this effectively ignores the
2493
+ authentication in the spec for a single request.
2494
+ :type _request_auth: dict, optional
2495
+ :param _content_type: force content-type for the request.
2496
+ :type _content_type: str, Optional
2497
+ :param _headers: set to override the headers for a single
2498
+ request; this effectively ignores the headers
2499
+ in the spec for a single request.
2500
+ :type _headers: dict, optional
2501
+ :param _host_index: set to override the host_index for a single
2502
+ request; this effectively ignores the host_index
2503
+ in the spec for a single request.
2504
+ :type _host_index: int, optional
2505
+ :return: Returns the result object.
2506
+ """ # noqa: E501 docstring might be too long
2507
+
2508
+ _param = self._list_update_policies_serialize(
2509
+ project_id=project_id,
2510
+ _request_auth=_request_auth,
2511
+ _content_type=_content_type,
2512
+ _headers=_headers,
2513
+ _host_index=_host_index,
2514
+ )
2515
+
2516
+ _response_types_map: Dict[str, Optional[str]] = {
2517
+ "200": "GetUpdatePoliciesResponse",
2518
+ "400": None,
2519
+ "404": None,
2520
+ }
2521
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2522
+ response_data.read()
2523
+ return self.api_client.response_deserialize(
2524
+ response_data=response_data,
2525
+ response_types_map=_response_types_map,
2526
+ )
2527
+
2528
+ @validate_call
2529
+ def list_update_policies_without_preload_content(
2530
+ self,
2531
+ project_id: Annotated[StrictStr, Field(description="project id")],
2532
+ _request_timeout: Union[
2533
+ None,
2534
+ Annotated[StrictFloat, Field(gt=0)],
2535
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2536
+ ] = None,
2537
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2538
+ _content_type: Optional[StrictStr] = None,
2539
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2540
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2541
+ ) -> RESTResponseType:
2542
+ """get list of update policies
2543
+
2544
+
2545
+ :param project_id: project id (required)
2546
+ :type project_id: str
2547
+ :param _request_timeout: timeout setting for this request. If one
2548
+ number provided, it will be total request
2549
+ timeout. It can also be a pair (tuple) of
2550
+ (connection, read) timeouts.
2551
+ :type _request_timeout: int, tuple(int, int), optional
2552
+ :param _request_auth: set to override the auth_settings for an a single
2553
+ request; this effectively ignores the
2554
+ authentication in the spec for a single request.
2555
+ :type _request_auth: dict, optional
2556
+ :param _content_type: force content-type for the request.
2557
+ :type _content_type: str, Optional
2558
+ :param _headers: set to override the headers for a single
2559
+ request; this effectively ignores the headers
2560
+ in the spec for a single request.
2561
+ :type _headers: dict, optional
2562
+ :param _host_index: set to override the host_index for a single
2563
+ request; this effectively ignores the host_index
2564
+ in the spec for a single request.
2565
+ :type _host_index: int, optional
2566
+ :return: Returns the result object.
2567
+ """ # noqa: E501 docstring might be too long
2568
+
2569
+ _param = self._list_update_policies_serialize(
2570
+ project_id=project_id,
2571
+ _request_auth=_request_auth,
2572
+ _content_type=_content_type,
2573
+ _headers=_headers,
2574
+ _host_index=_host_index,
2575
+ )
2576
+
2577
+ _response_types_map: Dict[str, Optional[str]] = {
2578
+ "200": "GetUpdatePoliciesResponse",
2579
+ "400": None,
2580
+ "404": None,
2581
+ }
2582
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2583
+ return response_data.response
2584
+
2585
+ def _list_update_policies_serialize(
2586
+ self,
2587
+ project_id,
2588
+ _request_auth,
2589
+ _content_type,
2590
+ _headers,
2591
+ _host_index,
2592
+ ) -> RequestSerialized:
2593
+
2594
+ _host = None
2595
+
2596
+ _collection_formats: Dict[str, str] = {}
2597
+
2598
+ _path_params: Dict[str, str] = {}
2599
+ _query_params: List[Tuple[str, str]] = []
2600
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2601
+ _form_params: List[Tuple[str, str]] = []
2602
+ _files: Dict[str, Union[str, bytes]] = {}
2603
+ _body_params: Optional[bytes] = None
2604
+
2605
+ # process the path parameters
2606
+ if project_id is not None:
2607
+ _path_params["projectId"] = project_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}/update-policies",
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 list_update_schedules(
2637
+ self,
2638
+ project_id: Annotated[StrictStr, Field(description="project id")],
2639
+ server_id: Annotated[StrictStr, Field(description="server id")],
2640
+ _request_timeout: Union[
2641
+ None,
2642
+ Annotated[StrictFloat, Field(gt=0)],
2643
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2644
+ ] = None,
2645
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2646
+ _content_type: Optional[StrictStr] = None,
2647
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2648
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2649
+ ) -> GetUpdateSchedulesResponse:
2650
+ """get list of update schedules
2651
+
2652
+
2653
+ :param project_id: project id (required)
2654
+ :type project_id: str
2655
+ :param server_id: server id (required)
2656
+ :type server_id: str
2657
+ :param _request_timeout: timeout setting for this request. If one
2658
+ number provided, it will be total request
2659
+ timeout. It can also be a pair (tuple) of
2660
+ (connection, read) timeouts.
2661
+ :type _request_timeout: int, tuple(int, int), optional
2662
+ :param _request_auth: set to override the auth_settings for an a single
2663
+ request; this effectively ignores the
2664
+ authentication in the spec for a single request.
2665
+ :type _request_auth: dict, optional
2666
+ :param _content_type: force content-type for the request.
2667
+ :type _content_type: str, Optional
2668
+ :param _headers: set to override the headers for a single
2669
+ request; this effectively ignores the headers
2670
+ in the spec for a single request.
2671
+ :type _headers: dict, optional
2672
+ :param _host_index: set to override the host_index for a single
2673
+ request; this effectively ignores the host_index
2674
+ in the spec for a single request.
2675
+ :type _host_index: int, optional
2676
+ :return: Returns the result object.
2677
+ """ # noqa: E501 docstring might be too long
2678
+
2679
+ _param = self._list_update_schedules_serialize(
2680
+ project_id=project_id,
2681
+ server_id=server_id,
2682
+ _request_auth=_request_auth,
2683
+ _content_type=_content_type,
2684
+ _headers=_headers,
2685
+ _host_index=_host_index,
2686
+ )
2687
+
2688
+ _response_types_map: Dict[str, Optional[str]] = {
2689
+ "200": "GetUpdateSchedulesResponse",
2690
+ "400": None,
2691
+ "401": None,
2692
+ "404": None,
2693
+ }
2694
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2695
+ response_data.read()
2696
+ return self.api_client.response_deserialize(
2697
+ response_data=response_data,
2698
+ response_types_map=_response_types_map,
2699
+ ).data
2700
+
2701
+ @validate_call
2702
+ def list_update_schedules_with_http_info(
2703
+ self,
2704
+ project_id: Annotated[StrictStr, Field(description="project id")],
2705
+ server_id: Annotated[StrictStr, Field(description="server id")],
2706
+ _request_timeout: Union[
2707
+ None,
2708
+ Annotated[StrictFloat, Field(gt=0)],
2709
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2710
+ ] = None,
2711
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2712
+ _content_type: Optional[StrictStr] = None,
2713
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2714
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2715
+ ) -> ApiResponse[GetUpdateSchedulesResponse]:
2716
+ """get list of update schedules
2717
+
2718
+
2719
+ :param project_id: project id (required)
2720
+ :type project_id: str
2721
+ :param server_id: server id (required)
2722
+ :type server_id: str
2723
+ :param _request_timeout: timeout setting for this request. If one
2724
+ number provided, it will be total request
2725
+ timeout. It can also be a pair (tuple) of
2726
+ (connection, read) timeouts.
2727
+ :type _request_timeout: int, tuple(int, int), optional
2728
+ :param _request_auth: set to override the auth_settings for an a single
2729
+ request; this effectively ignores the
2730
+ authentication in the spec for a single request.
2731
+ :type _request_auth: dict, optional
2732
+ :param _content_type: force content-type for the request.
2733
+ :type _content_type: str, Optional
2734
+ :param _headers: set to override the headers for a single
2735
+ request; this effectively ignores the headers
2736
+ in the spec for a single request.
2737
+ :type _headers: dict, optional
2738
+ :param _host_index: set to override the host_index for a single
2739
+ request; this effectively ignores the host_index
2740
+ in the spec for a single request.
2741
+ :type _host_index: int, optional
2742
+ :return: Returns the result object.
2743
+ """ # noqa: E501 docstring might be too long
2744
+
2745
+ _param = self._list_update_schedules_serialize(
2746
+ project_id=project_id,
2747
+ server_id=server_id,
2748
+ _request_auth=_request_auth,
2749
+ _content_type=_content_type,
2750
+ _headers=_headers,
2751
+ _host_index=_host_index,
2752
+ )
2753
+
2754
+ _response_types_map: Dict[str, Optional[str]] = {
2755
+ "200": "GetUpdateSchedulesResponse",
2756
+ "400": None,
2757
+ "401": None,
2758
+ "404": None,
2759
+ }
2760
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2761
+ response_data.read()
2762
+ return self.api_client.response_deserialize(
2763
+ response_data=response_data,
2764
+ response_types_map=_response_types_map,
2765
+ )
2766
+
2767
+ @validate_call
2768
+ def list_update_schedules_without_preload_content(
2769
+ self,
2770
+ project_id: Annotated[StrictStr, Field(description="project id")],
2771
+ server_id: Annotated[StrictStr, Field(description="server id")],
2772
+ _request_timeout: Union[
2773
+ None,
2774
+ Annotated[StrictFloat, Field(gt=0)],
2775
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2776
+ ] = None,
2777
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2778
+ _content_type: Optional[StrictStr] = None,
2779
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2780
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2781
+ ) -> RESTResponseType:
2782
+ """get list of update schedules
2783
+
2784
+
2785
+ :param project_id: project id (required)
2786
+ :type project_id: str
2787
+ :param server_id: server id (required)
2788
+ :type server_id: str
2789
+ :param _request_timeout: timeout setting for this request. If one
2790
+ number provided, it will be total request
2791
+ timeout. It can also be a pair (tuple) of
2792
+ (connection, read) timeouts.
2793
+ :type _request_timeout: int, tuple(int, int), optional
2794
+ :param _request_auth: set to override the auth_settings for an a single
2795
+ request; this effectively ignores the
2796
+ authentication in the spec for a single request.
2797
+ :type _request_auth: dict, optional
2798
+ :param _content_type: force content-type for the request.
2799
+ :type _content_type: str, Optional
2800
+ :param _headers: set to override the headers for a single
2801
+ request; this effectively ignores the headers
2802
+ in the spec for a single request.
2803
+ :type _headers: dict, optional
2804
+ :param _host_index: set to override the host_index for a single
2805
+ request; this effectively ignores the host_index
2806
+ in the spec for a single request.
2807
+ :type _host_index: int, optional
2808
+ :return: Returns the result object.
2809
+ """ # noqa: E501 docstring might be too long
2810
+
2811
+ _param = self._list_update_schedules_serialize(
2812
+ project_id=project_id,
2813
+ server_id=server_id,
2814
+ _request_auth=_request_auth,
2815
+ _content_type=_content_type,
2816
+ _headers=_headers,
2817
+ _host_index=_host_index,
2818
+ )
2819
+
2820
+ _response_types_map: Dict[str, Optional[str]] = {
2821
+ "200": "GetUpdateSchedulesResponse",
2822
+ "400": None,
2823
+ "401": None,
2824
+ "404": None,
2825
+ }
2826
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2827
+ return response_data.response
2828
+
2829
+ def _list_update_schedules_serialize(
2830
+ self,
2831
+ project_id,
2832
+ server_id,
2833
+ _request_auth,
2834
+ _content_type,
2835
+ _headers,
2836
+ _host_index,
2837
+ ) -> RequestSerialized:
2838
+
2839
+ _host = None
2840
+
2841
+ _collection_formats: Dict[str, str] = {}
2842
+
2843
+ _path_params: Dict[str, str] = {}
2844
+ _query_params: List[Tuple[str, str]] = []
2845
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2846
+ _form_params: List[Tuple[str, str]] = []
2847
+ _files: Dict[str, Union[str, bytes]] = {}
2848
+ _body_params: Optional[bytes] = None
2849
+
2850
+ # process the path parameters
2851
+ if project_id is not None:
2852
+ _path_params["projectId"] = project_id
2853
+ if server_id is not None:
2854
+ _path_params["serverId"] = server_id
2855
+ # process the query parameters
2856
+ # process the header parameters
2857
+ # process the form parameters
2858
+ # process the body parameter
2859
+
2860
+ # set the HTTP header `Accept`
2861
+ if "Accept" not in _header_params:
2862
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2863
+
2864
+ # authentication setting
2865
+ _auth_settings: List[str] = []
2866
+
2867
+ return self.api_client.param_serialize(
2868
+ method="GET",
2869
+ resource_path="/v1/projects/{projectId}/servers/{serverId}/update-schedules",
2870
+ path_params=_path_params,
2871
+ query_params=_query_params,
2872
+ header_params=_header_params,
2873
+ body=_body_params,
2874
+ post_params=_form_params,
2875
+ files=_files,
2876
+ auth_settings=_auth_settings,
2877
+ collection_formats=_collection_formats,
2878
+ _host=_host,
2879
+ _request_auth=_request_auth,
2880
+ )
2881
+
2882
+ @validate_call
2883
+ def list_updates(
2884
+ self,
2885
+ project_id: Annotated[StrictStr, Field(description="project id")],
2886
+ server_id: Annotated[StrictStr, Field(description="server id")],
2887
+ _request_timeout: Union[
2888
+ None,
2889
+ Annotated[StrictFloat, Field(gt=0)],
2890
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2891
+ ] = None,
2892
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2893
+ _content_type: Optional[StrictStr] = None,
2894
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2895
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2896
+ ) -> GetUpdatesListResponse:
2897
+ """get list of updates
2898
+
2899
+
2900
+ :param project_id: project id (required)
2901
+ :type project_id: str
2902
+ :param server_id: server id (required)
2903
+ :type server_id: str
2904
+ :param _request_timeout: timeout setting for this request. If one
2905
+ number provided, it will be total request
2906
+ timeout. It can also be a pair (tuple) of
2907
+ (connection, read) timeouts.
2908
+ :type _request_timeout: int, tuple(int, int), optional
2909
+ :param _request_auth: set to override the auth_settings for an a single
2910
+ request; this effectively ignores the
2911
+ authentication in the spec for a single request.
2912
+ :type _request_auth: dict, optional
2913
+ :param _content_type: force content-type for the request.
2914
+ :type _content_type: str, Optional
2915
+ :param _headers: set to override the headers for a single
2916
+ request; this effectively ignores the headers
2917
+ in the spec for a single request.
2918
+ :type _headers: dict, optional
2919
+ :param _host_index: set to override the host_index for a single
2920
+ request; this effectively ignores the host_index
2921
+ in the spec for a single request.
2922
+ :type _host_index: int, optional
2923
+ :return: Returns the result object.
2924
+ """ # noqa: E501 docstring might be too long
2925
+
2926
+ _param = self._list_updates_serialize(
2927
+ project_id=project_id,
2928
+ server_id=server_id,
2929
+ _request_auth=_request_auth,
2930
+ _content_type=_content_type,
2931
+ _headers=_headers,
2932
+ _host_index=_host_index,
2933
+ )
2934
+
2935
+ _response_types_map: Dict[str, Optional[str]] = {
2936
+ "200": "GetUpdatesListResponse",
2937
+ "400": None,
2938
+ "401": None,
2939
+ "404": None,
2940
+ }
2941
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2942
+ response_data.read()
2943
+ return self.api_client.response_deserialize(
2944
+ response_data=response_data,
2945
+ response_types_map=_response_types_map,
2946
+ ).data
2947
+
2948
+ @validate_call
2949
+ def list_updates_with_http_info(
2950
+ self,
2951
+ project_id: Annotated[StrictStr, Field(description="project id")],
2952
+ server_id: Annotated[StrictStr, Field(description="server id")],
2953
+ _request_timeout: Union[
2954
+ None,
2955
+ Annotated[StrictFloat, Field(gt=0)],
2956
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2957
+ ] = None,
2958
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2959
+ _content_type: Optional[StrictStr] = None,
2960
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2961
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2962
+ ) -> ApiResponse[GetUpdatesListResponse]:
2963
+ """get list of updates
2964
+
2965
+
2966
+ :param project_id: project id (required)
2967
+ :type project_id: str
2968
+ :param server_id: server id (required)
2969
+ :type server_id: str
2970
+ :param _request_timeout: timeout setting for this request. If one
2971
+ number provided, it will be total request
2972
+ timeout. It can also be a pair (tuple) of
2973
+ (connection, read) timeouts.
2974
+ :type _request_timeout: int, tuple(int, int), optional
2975
+ :param _request_auth: set to override the auth_settings for an a single
2976
+ request; this effectively ignores the
2977
+ authentication in the spec for a single request.
2978
+ :type _request_auth: dict, optional
2979
+ :param _content_type: force content-type for the request.
2980
+ :type _content_type: str, Optional
2981
+ :param _headers: set to override the headers for a single
2982
+ request; this effectively ignores the headers
2983
+ in the spec for a single request.
2984
+ :type _headers: dict, optional
2985
+ :param _host_index: set to override the host_index for a single
2986
+ request; this effectively ignores the host_index
2987
+ in the spec for a single request.
2988
+ :type _host_index: int, optional
2989
+ :return: Returns the result object.
2990
+ """ # noqa: E501 docstring might be too long
2991
+
2992
+ _param = self._list_updates_serialize(
2993
+ project_id=project_id,
2994
+ server_id=server_id,
2995
+ _request_auth=_request_auth,
2996
+ _content_type=_content_type,
2997
+ _headers=_headers,
2998
+ _host_index=_host_index,
2999
+ )
3000
+
3001
+ _response_types_map: Dict[str, Optional[str]] = {
3002
+ "200": "GetUpdatesListResponse",
3003
+ "400": None,
3004
+ "401": None,
3005
+ "404": None,
3006
+ }
3007
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3008
+ response_data.read()
3009
+ return self.api_client.response_deserialize(
3010
+ response_data=response_data,
3011
+ response_types_map=_response_types_map,
3012
+ )
3013
+
3014
+ @validate_call
3015
+ def list_updates_without_preload_content(
3016
+ self,
3017
+ project_id: Annotated[StrictStr, Field(description="project id")],
3018
+ server_id: Annotated[StrictStr, Field(description="server id")],
3019
+ _request_timeout: Union[
3020
+ None,
3021
+ Annotated[StrictFloat, Field(gt=0)],
3022
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3023
+ ] = None,
3024
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3025
+ _content_type: Optional[StrictStr] = None,
3026
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3027
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3028
+ ) -> RESTResponseType:
3029
+ """get list of updates
3030
+
3031
+
3032
+ :param project_id: project id (required)
3033
+ :type project_id: str
3034
+ :param server_id: server id (required)
3035
+ :type server_id: str
3036
+ :param _request_timeout: timeout setting for this request. If one
3037
+ number provided, it will be total request
3038
+ timeout. It can also be a pair (tuple) of
3039
+ (connection, read) timeouts.
3040
+ :type _request_timeout: int, tuple(int, int), optional
3041
+ :param _request_auth: set to override the auth_settings for an a single
3042
+ request; this effectively ignores the
3043
+ authentication in the spec for a single request.
3044
+ :type _request_auth: dict, optional
3045
+ :param _content_type: force content-type for the request.
3046
+ :type _content_type: str, Optional
3047
+ :param _headers: set to override the headers for a single
3048
+ request; this effectively ignores the headers
3049
+ in the spec for a single request.
3050
+ :type _headers: dict, optional
3051
+ :param _host_index: set to override the host_index for a single
3052
+ request; this effectively ignores the host_index
3053
+ in the spec for a single request.
3054
+ :type _host_index: int, optional
3055
+ :return: Returns the result object.
3056
+ """ # noqa: E501 docstring might be too long
3057
+
3058
+ _param = self._list_updates_serialize(
3059
+ project_id=project_id,
3060
+ server_id=server_id,
3061
+ _request_auth=_request_auth,
3062
+ _content_type=_content_type,
3063
+ _headers=_headers,
3064
+ _host_index=_host_index,
3065
+ )
3066
+
3067
+ _response_types_map: Dict[str, Optional[str]] = {
3068
+ "200": "GetUpdatesListResponse",
3069
+ "400": None,
3070
+ "401": None,
3071
+ "404": None,
3072
+ }
3073
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3074
+ return response_data.response
3075
+
3076
+ def _list_updates_serialize(
3077
+ self,
3078
+ project_id,
3079
+ server_id,
3080
+ _request_auth,
3081
+ _content_type,
3082
+ _headers,
3083
+ _host_index,
3084
+ ) -> RequestSerialized:
3085
+
3086
+ _host = None
3087
+
3088
+ _collection_formats: Dict[str, str] = {}
3089
+
3090
+ _path_params: Dict[str, str] = {}
3091
+ _query_params: List[Tuple[str, str]] = []
3092
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3093
+ _form_params: List[Tuple[str, str]] = []
3094
+ _files: Dict[str, Union[str, bytes]] = {}
3095
+ _body_params: Optional[bytes] = None
3096
+
3097
+ # process the path parameters
3098
+ if project_id is not None:
3099
+ _path_params["projectId"] = project_id
3100
+ if server_id is not None:
3101
+ _path_params["serverId"] = server_id
3102
+ # process the query parameters
3103
+ # process the header parameters
3104
+ # process the form parameters
3105
+ # process the body parameter
3106
+
3107
+ # set the HTTP header `Accept`
3108
+ if "Accept" not in _header_params:
3109
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
3110
+
3111
+ # authentication setting
3112
+ _auth_settings: List[str] = []
3113
+
3114
+ return self.api_client.param_serialize(
3115
+ method="GET",
3116
+ resource_path="/v1/projects/{projectId}/servers/{serverId}/updates",
3117
+ path_params=_path_params,
3118
+ query_params=_query_params,
3119
+ header_params=_header_params,
3120
+ body=_body_params,
3121
+ post_params=_form_params,
3122
+ files=_files,
3123
+ auth_settings=_auth_settings,
3124
+ collection_formats=_collection_formats,
3125
+ _host=_host,
3126
+ _request_auth=_request_auth,
3127
+ )
3128
+
3129
+ @validate_call
3130
+ def update_update_schedule(
3131
+ self,
3132
+ project_id: Annotated[StrictStr, Field(description="project id")],
3133
+ server_id: Annotated[StrictStr, Field(description="server id")],
3134
+ schedule_id: Annotated[StrictStr, Field(description="update schedule id")],
3135
+ update_update_schedule_payload: Optional[UpdateUpdateSchedulePayload] = None,
3136
+ _request_timeout: Union[
3137
+ None,
3138
+ Annotated[StrictFloat, Field(gt=0)],
3139
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3140
+ ] = None,
3141
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3142
+ _content_type: Optional[StrictStr] = None,
3143
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3144
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3145
+ ) -> UpdateSchedule:
3146
+ """update update schedule
3147
+
3148
+
3149
+ :param project_id: project id (required)
3150
+ :type project_id: str
3151
+ :param server_id: server id (required)
3152
+ :type server_id: str
3153
+ :param schedule_id: update schedule id (required)
3154
+ :type schedule_id: str
3155
+ :param update_update_schedule_payload:
3156
+ :type update_update_schedule_payload: UpdateUpdateSchedulePayload
3157
+ :param _request_timeout: timeout setting for this request. If one
3158
+ number provided, it will be total request
3159
+ timeout. It can also be a pair (tuple) of
3160
+ (connection, read) timeouts.
3161
+ :type _request_timeout: int, tuple(int, int), optional
3162
+ :param _request_auth: set to override the auth_settings for an a single
3163
+ request; this effectively ignores the
3164
+ authentication in the spec for a single request.
3165
+ :type _request_auth: dict, optional
3166
+ :param _content_type: force content-type for the request.
3167
+ :type _content_type: str, Optional
3168
+ :param _headers: set to override the headers for a single
3169
+ request; this effectively ignores the headers
3170
+ in the spec for a single request.
3171
+ :type _headers: dict, optional
3172
+ :param _host_index: set to override the host_index for a single
3173
+ request; this effectively ignores the host_index
3174
+ in the spec for a single request.
3175
+ :type _host_index: int, optional
3176
+ :return: Returns the result object.
3177
+ """ # noqa: E501 docstring might be too long
3178
+
3179
+ _param = self._update_update_schedule_serialize(
3180
+ project_id=project_id,
3181
+ server_id=server_id,
3182
+ schedule_id=schedule_id,
3183
+ update_update_schedule_payload=update_update_schedule_payload,
3184
+ _request_auth=_request_auth,
3185
+ _content_type=_content_type,
3186
+ _headers=_headers,
3187
+ _host_index=_host_index,
3188
+ )
3189
+
3190
+ _response_types_map: Dict[str, Optional[str]] = {
3191
+ "200": "UpdateSchedule",
3192
+ "400": None,
3193
+ "401": None,
3194
+ "404": None,
3195
+ }
3196
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3197
+ response_data.read()
3198
+ return self.api_client.response_deserialize(
3199
+ response_data=response_data,
3200
+ response_types_map=_response_types_map,
3201
+ ).data
3202
+
3203
+ @validate_call
3204
+ def update_update_schedule_with_http_info(
3205
+ self,
3206
+ project_id: Annotated[StrictStr, Field(description="project id")],
3207
+ server_id: Annotated[StrictStr, Field(description="server id")],
3208
+ schedule_id: Annotated[StrictStr, Field(description="update schedule id")],
3209
+ update_update_schedule_payload: Optional[UpdateUpdateSchedulePayload] = None,
3210
+ _request_timeout: Union[
3211
+ None,
3212
+ Annotated[StrictFloat, Field(gt=0)],
3213
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3214
+ ] = None,
3215
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3216
+ _content_type: Optional[StrictStr] = None,
3217
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3218
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3219
+ ) -> ApiResponse[UpdateSchedule]:
3220
+ """update update schedule
3221
+
3222
+
3223
+ :param project_id: project id (required)
3224
+ :type project_id: str
3225
+ :param server_id: server id (required)
3226
+ :type server_id: str
3227
+ :param schedule_id: update schedule id (required)
3228
+ :type schedule_id: str
3229
+ :param update_update_schedule_payload:
3230
+ :type update_update_schedule_payload: UpdateUpdateSchedulePayload
3231
+ :param _request_timeout: timeout setting for this request. If one
3232
+ number provided, it will be total request
3233
+ timeout. It can also be a pair (tuple) of
3234
+ (connection, read) timeouts.
3235
+ :type _request_timeout: int, tuple(int, int), optional
3236
+ :param _request_auth: set to override the auth_settings for an a single
3237
+ request; this effectively ignores the
3238
+ authentication in the spec for a single request.
3239
+ :type _request_auth: dict, optional
3240
+ :param _content_type: force content-type for the request.
3241
+ :type _content_type: str, Optional
3242
+ :param _headers: set to override the headers for a single
3243
+ request; this effectively ignores the headers
3244
+ in the spec for a single request.
3245
+ :type _headers: dict, optional
3246
+ :param _host_index: set to override the host_index for a single
3247
+ request; this effectively ignores the host_index
3248
+ in the spec for a single request.
3249
+ :type _host_index: int, optional
3250
+ :return: Returns the result object.
3251
+ """ # noqa: E501 docstring might be too long
3252
+
3253
+ _param = self._update_update_schedule_serialize(
3254
+ project_id=project_id,
3255
+ server_id=server_id,
3256
+ schedule_id=schedule_id,
3257
+ update_update_schedule_payload=update_update_schedule_payload,
3258
+ _request_auth=_request_auth,
3259
+ _content_type=_content_type,
3260
+ _headers=_headers,
3261
+ _host_index=_host_index,
3262
+ )
3263
+
3264
+ _response_types_map: Dict[str, Optional[str]] = {
3265
+ "200": "UpdateSchedule",
3266
+ "400": None,
3267
+ "401": None,
3268
+ "404": None,
3269
+ }
3270
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3271
+ response_data.read()
3272
+ return self.api_client.response_deserialize(
3273
+ response_data=response_data,
3274
+ response_types_map=_response_types_map,
3275
+ )
3276
+
3277
+ @validate_call
3278
+ def update_update_schedule_without_preload_content(
3279
+ self,
3280
+ project_id: Annotated[StrictStr, Field(description="project id")],
3281
+ server_id: Annotated[StrictStr, Field(description="server id")],
3282
+ schedule_id: Annotated[StrictStr, Field(description="update schedule id")],
3283
+ update_update_schedule_payload: Optional[UpdateUpdateSchedulePayload] = None,
3284
+ _request_timeout: Union[
3285
+ None,
3286
+ Annotated[StrictFloat, Field(gt=0)],
3287
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3288
+ ] = None,
3289
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3290
+ _content_type: Optional[StrictStr] = None,
3291
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3292
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3293
+ ) -> RESTResponseType:
3294
+ """update update schedule
3295
+
3296
+
3297
+ :param project_id: project id (required)
3298
+ :type project_id: str
3299
+ :param server_id: server id (required)
3300
+ :type server_id: str
3301
+ :param schedule_id: update schedule id (required)
3302
+ :type schedule_id: str
3303
+ :param update_update_schedule_payload:
3304
+ :type update_update_schedule_payload: UpdateUpdateSchedulePayload
3305
+ :param _request_timeout: timeout setting for this request. If one
3306
+ number provided, it will be total request
3307
+ timeout. It can also be a pair (tuple) of
3308
+ (connection, read) timeouts.
3309
+ :type _request_timeout: int, tuple(int, int), optional
3310
+ :param _request_auth: set to override the auth_settings for an a single
3311
+ request; this effectively ignores the
3312
+ authentication in the spec for a single request.
3313
+ :type _request_auth: dict, optional
3314
+ :param _content_type: force content-type for the request.
3315
+ :type _content_type: str, Optional
3316
+ :param _headers: set to override the headers for a single
3317
+ request; this effectively ignores the headers
3318
+ in the spec for a single request.
3319
+ :type _headers: dict, optional
3320
+ :param _host_index: set to override the host_index for a single
3321
+ request; this effectively ignores the host_index
3322
+ in the spec for a single request.
3323
+ :type _host_index: int, optional
3324
+ :return: Returns the result object.
3325
+ """ # noqa: E501 docstring might be too long
3326
+
3327
+ _param = self._update_update_schedule_serialize(
3328
+ project_id=project_id,
3329
+ server_id=server_id,
3330
+ schedule_id=schedule_id,
3331
+ update_update_schedule_payload=update_update_schedule_payload,
3332
+ _request_auth=_request_auth,
3333
+ _content_type=_content_type,
3334
+ _headers=_headers,
3335
+ _host_index=_host_index,
3336
+ )
3337
+
3338
+ _response_types_map: Dict[str, Optional[str]] = {
3339
+ "200": "UpdateSchedule",
3340
+ "400": None,
3341
+ "401": None,
3342
+ "404": None,
3343
+ }
3344
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3345
+ return response_data.response
3346
+
3347
+ def _update_update_schedule_serialize(
3348
+ self,
3349
+ project_id,
3350
+ server_id,
3351
+ schedule_id,
3352
+ update_update_schedule_payload,
3353
+ _request_auth,
3354
+ _content_type,
3355
+ _headers,
3356
+ _host_index,
3357
+ ) -> RequestSerialized:
3358
+
3359
+ _host = None
3360
+
3361
+ _collection_formats: Dict[str, str] = {}
3362
+
3363
+ _path_params: Dict[str, str] = {}
3364
+ _query_params: List[Tuple[str, str]] = []
3365
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3366
+ _form_params: List[Tuple[str, str]] = []
3367
+ _files: Dict[str, Union[str, bytes]] = {}
3368
+ _body_params: Optional[bytes] = None
3369
+
3370
+ # process the path parameters
3371
+ if project_id is not None:
3372
+ _path_params["projectId"] = project_id
3373
+ if server_id is not None:
3374
+ _path_params["serverId"] = server_id
3375
+ if schedule_id is not None:
3376
+ _path_params["scheduleId"] = schedule_id
3377
+ # process the query parameters
3378
+ # process the header parameters
3379
+ # process the form parameters
3380
+ # process the body parameter
3381
+ if update_update_schedule_payload is not None:
3382
+ _body_params = update_update_schedule_payload
3383
+
3384
+ # set the HTTP header `Accept`
3385
+ if "Accept" not in _header_params:
3386
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
3387
+
3388
+ # set the HTTP header `Content-Type`
3389
+ if _content_type:
3390
+ _header_params["Content-Type"] = _content_type
3391
+ else:
3392
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
3393
+ if _default_content_type is not None:
3394
+ _header_params["Content-Type"] = _default_content_type
3395
+
3396
+ # authentication setting
3397
+ _auth_settings: List[str] = []
3398
+
3399
+ return self.api_client.param_serialize(
3400
+ method="PUT",
3401
+ resource_path="/v1/projects/{projectId}/servers/{serverId}/update-schedules/{scheduleId}",
3402
+ path_params=_path_params,
3403
+ query_params=_query_params,
3404
+ header_params=_header_params,
3405
+ body=_body_params,
3406
+ post_params=_form_params,
3407
+ files=_files,
3408
+ auth_settings=_auth_settings,
3409
+ collection_formats=_collection_formats,
3410
+ _host=_host,
3411
+ _request_auth=_request_auth,
3412
+ )