kelvin-python-api-client 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. kelvin/api/client/__init__.py +15 -0
  2. kelvin/api/client/api/app_manager.py +646 -0
  3. kelvin/api/client/api/app_registry.py +342 -0
  4. kelvin/api/client/api/asset.py +1012 -0
  5. kelvin/api/client/api/asset_insights.py +67 -0
  6. kelvin/api/client/api/bridge.py +306 -0
  7. kelvin/api/client/api/control_change.py +398 -0
  8. kelvin/api/client/api/data_tag.py +499 -0
  9. kelvin/api/client/api/datastreams.py +1021 -0
  10. kelvin/api/client/api/filestorage.py +234 -0
  11. kelvin/api/client/api/instance.py +559 -0
  12. kelvin/api/client/api/orchestration.py +717 -0
  13. kelvin/api/client/api/parameters.py +417 -0
  14. kelvin/api/client/api/recommendation.py +804 -0
  15. kelvin/api/client/api/secret.py +173 -0
  16. kelvin/api/client/api/thread.py +435 -0
  17. kelvin/api/client/api/timeseries.py +273 -0
  18. kelvin/api/client/api/user.py +382 -0
  19. kelvin/api/client/api/workload.py +437 -0
  20. kelvin/api/client/base_client.py +924 -0
  21. kelvin/api/client/base_model.py +187 -0
  22. kelvin/api/client/client.py +181 -0
  23. kelvin/api/client/config.py +709 -0
  24. kelvin/api/client/data_model.py +523 -0
  25. kelvin/api/client/dataframe_conversion.py +172 -0
  26. kelvin/api/client/deeplist.py +285 -0
  27. kelvin/api/client/error.py +77 -0
  28. kelvin/api/client/model/__init__.py +3 -0
  29. kelvin/api/client/model/enum.py +82 -0
  30. kelvin/api/client/model/pagination.py +61 -0
  31. kelvin/api/client/model/requests.py +3352 -0
  32. kelvin/api/client/model/response.py +68 -0
  33. kelvin/api/client/model/responses.py +4799 -0
  34. kelvin/api/client/model/type.py +2025 -0
  35. kelvin/api/client/py.typed +0 -0
  36. kelvin/api/client/retry.py +88 -0
  37. kelvin/api/client/serialize.py +222 -0
  38. kelvin/api/client/utils.py +316 -0
  39. kelvin/api/client/version.py +16 -0
  40. kelvin_python_api_client-0.0.1.dist-info/METADATA +75 -0
  41. kelvin_python_api_client-0.0.1.dist-info/RECORD +43 -0
  42. kelvin_python_api_client-0.0.1.dist-info/WHEEL +5 -0
  43. kelvin_python_api_client-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,717 @@
1
+ """
2
+ Kelvin API Client.
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ from typing import Any, Iterator, List, Mapping, Optional, Sequence, Union
8
+
9
+ from typing_extensions import Literal
10
+
11
+ from kelvin.api.client.data_model import DataModelBase
12
+
13
+ from ..model import requests, responses
14
+
15
+
16
+ class Orchestration(DataModelBase):
17
+ @classmethod
18
+ def create_orchestration_clusters(
19
+ cls,
20
+ data: Optional[Union[requests.OrchestrationClustersCreate, Mapping[str, Any]]] = None,
21
+ _dry_run: bool = False,
22
+ _client: Any = None,
23
+ **kwargs: Any,
24
+ ) -> responses.OrchestrationClustersCreate:
25
+ """
26
+ Create a new Cluster. This only creates the Cloud registration, the actual installation still needs to be manually performed on the server/kubernetes cluster. The provision script to run locally on the server for `type` registered as `k3s` or on an existing kubernetes cluster for `type` registered as `kubernetes` will be in the key `provision_script ` in the 201 response body.
27
+
28
+ **Permission Required:** `kelvin.permission.cluster.create`.
29
+
30
+ ``createOrchestrationClusters``: ``POST`` ``/api/v4/orchestration/clusters/create``
31
+
32
+ Parameters
33
+ ----------
34
+ data: requests.OrchestrationClustersCreate, optional
35
+ **kwargs:
36
+ Extra parameters for requests.OrchestrationClustersCreate
37
+ - create_orchestration_clusters: dict
38
+
39
+ """
40
+
41
+ from ..model import responses
42
+
43
+ result = cls._make_request(
44
+ _client,
45
+ "post",
46
+ "/api/v4/orchestration/clusters/create",
47
+ {},
48
+ {},
49
+ {},
50
+ {},
51
+ data,
52
+ "requests.OrchestrationClustersCreate",
53
+ False,
54
+ {"201": responses.OrchestrationClustersCreate, "400": None, "401": None, "404": None, "409": None},
55
+ False,
56
+ _dry_run,
57
+ kwargs,
58
+ )
59
+ return result
60
+
61
+ @classmethod
62
+ def list_orchestration_clusters(
63
+ cls,
64
+ names: Optional[Sequence[str]] = None,
65
+ search: Optional[Sequence[str]] = None,
66
+ type: Optional[Sequence[str]] = None,
67
+ ready: Optional[bool] = None,
68
+ status: Optional[Sequence[str]] = None,
69
+ pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
70
+ page_size: Optional[int] = 10000,
71
+ page: Optional[int] = None,
72
+ next: Optional[str] = None,
73
+ previous: Optional[str] = None,
74
+ direction: Optional[Literal["asc", "desc"]] = None,
75
+ sort_by: Optional[Sequence[str]] = None,
76
+ fetch: bool = True,
77
+ _dry_run: bool = False,
78
+ _client: Any = None,
79
+ ) -> Union[
80
+ List[responses.OrchestrationClustersCreateItem], responses.OrchestrationClustersListPaginatedResponseCursor
81
+ ]:
82
+ """
83
+ Returns a list of Cluster objects. The list can be optionally filtered and sorted on the server before being returned.
84
+
85
+ **Permission Required:** `kelvin.permission.cluster.read`.
86
+
87
+ ``listOrchestrationClusters``: ``GET`` ``/api/v4/orchestration/clusters/list``
88
+
89
+ Parameters
90
+ ----------
91
+ names : :obj:`Sequence[str]`
92
+ A filter on the list based on the Cluster key `name`. The filter is on
93
+ the full name only. All strings in the array are treated as `OR`. Can
94
+ only contain lowercase alphanumeric characters and `.`, `_` or `-`
95
+ characters.
96
+ search : :obj:`Sequence[str]`
97
+ Search and filter on the list based on the Cluster keys `title`
98
+ (Display Name) or `name`. The search is case insensitive and will find
99
+ partial matches as well.
100
+ type : :obj:`Sequence[str]`
101
+ A filter on the list based on the Cluster key `type`. The filter is on
102
+ the full name only. All strings in the array are treated as `OR`.
103
+ Options are `k3s` and `kubernetes`
104
+ ready : :obj:`bool`
105
+ A filter on the list based on the Cluster key `ready`. Options are
106
+ `true` and `false`
107
+ status : :obj:`Sequence[str]`
108
+ A filter on the list based on the Cluster key `status`. The filter is
109
+ on the full name only. All strings in the array are treated as `OR`.
110
+ Options are `pending`, `online`, `unreachable` and
111
+ `requires_attention`
112
+ pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
113
+ Method of pagination to use for return results where `total_items` is
114
+ greater than `page_size`. `cursor` and `limits` will return one `page`
115
+ of results, `stream` will return all results. ('limits', 'cursor',
116
+ 'stream')
117
+ page_size : :obj:`int`
118
+ Number of objects to be returned in each page. Page size can range
119
+ between 1 and 1000 objects.
120
+ page : :obj:`int`
121
+ An integer for the wanted page of results. Used only with
122
+ `pagination_type` set as `limits`.
123
+ next : :obj:`str`
124
+ An alphanumeric string bookmark to indicate where to start for the
125
+ next page. Used only with `pagination_type` set as `cursor`.
126
+ previous : :obj:`str`
127
+ An alphanumeric string bookmark to indicate where to end for the
128
+ previous page. Used only with `pagination_type` set as `cursor`.
129
+ direction : :obj:`Literal['asc', 'desc']`
130
+ Sorting order according to the `sort_by` parameter. ('asc', 'desc')
131
+ sort_by : :obj:`Sequence[str]`
132
+ Sort the results by one of the Cluster parameters. Only one parameter
133
+ can be selected. Options: `name`, `title`, `ready`, `type`, `status`,
134
+ `last_seen`, `created`, `updated`.
135
+
136
+ """
137
+
138
+ from ..model import responses
139
+
140
+ result = cls._make_request(
141
+ _client,
142
+ "get",
143
+ "/api/v4/orchestration/clusters/list",
144
+ {},
145
+ {
146
+ "names": names,
147
+ "search": search,
148
+ "type": type,
149
+ "ready": ready,
150
+ "status": status,
151
+ "pagination_type": pagination_type,
152
+ "page_size": page_size,
153
+ "page": page,
154
+ "next": next,
155
+ "previous": previous,
156
+ "direction": direction,
157
+ "sort_by": sort_by,
158
+ },
159
+ {},
160
+ {},
161
+ None,
162
+ None,
163
+ False,
164
+ {"200": responses.OrchestrationClustersListPaginatedResponseCursor, "400": None, "401": None},
165
+ False,
166
+ _dry_run,
167
+ )
168
+ return result.fetch("/api/v4/orchestration/clusters/list", "GET") if fetch and not _dry_run else result
169
+
170
+ @classmethod
171
+ def download_orchestration_cluster_provision_binary(
172
+ cls, _dry_run: bool = False, _client: Any = None
173
+ ) -> Iterator[bytes]:
174
+ """
175
+ Download Cluster Provision Binary
176
+
177
+ **Permission Required:** `kelvin.permission.cluster.read`.
178
+
179
+ ``downloadOrchestrationClusterProvisionBinary``: ``GET`` ``/api/v4/orchestration/clusters/provision/bin/download``
180
+
181
+ """
182
+
183
+ result = cls._make_request(
184
+ _client,
185
+ "get",
186
+ "/api/v4/orchestration/clusters/provision/bin/download",
187
+ {},
188
+ {},
189
+ {},
190
+ {},
191
+ None,
192
+ None,
193
+ False,
194
+ {"200": bytes, "400": None, "401": None},
195
+ True,
196
+ _dry_run,
197
+ )
198
+ return result
199
+
200
+ @classmethod
201
+ def delete_orchestration_clusters(cls, cluster_name: str, _dry_run: bool = False, _client: Any = None) -> None:
202
+ """
203
+ Permanently delete an existing Cluster and its Nodes. This will also delete Workloads, Bridges and Services residing on the Cluster. This cannot be undone once the API request has been submitted.
204
+
205
+ **Permission Required:** `kelvin.permission.cluster.delete`.
206
+
207
+ ``deleteOrchestrationClusters``: ``POST`` ``/api/v4/orchestration/clusters/{cluster_name}/delete``
208
+
209
+ Parameters
210
+ ----------
211
+ cluster_name : :obj:`str`, optional
212
+ Cluster key `name` to delete. The string can only contain lowercase
213
+ alphanumeric characters and `.`, `_` or `-` characters.
214
+
215
+ """
216
+
217
+ result = cls._make_request(
218
+ _client,
219
+ "post",
220
+ "/api/v4/orchestration/clusters/{cluster_name}/delete",
221
+ {"cluster_name": cluster_name},
222
+ {},
223
+ {},
224
+ {},
225
+ None,
226
+ None,
227
+ False,
228
+ {"200": None, "400": None, "401": None, "404": None},
229
+ False,
230
+ _dry_run,
231
+ )
232
+ return result
233
+
234
+ @classmethod
235
+ def apply_orchestration_clusters_edge_apps_version(
236
+ cls, cluster_name: str, _dry_run: bool = False, _client: Any = None
237
+ ) -> None:
238
+ """
239
+ Initiates available cluster upgrades; requires cluster to be online and ready.
240
+
241
+ **Permission Required:** `kelvin.permission.cluster.update`.
242
+
243
+ ``applyOrchestrationClustersEdgeAppsVersion``: ``GET`` ``/api/v4/orchestration/clusters/{cluster_name}/edge-apps/version/apply``
244
+
245
+ Parameters
246
+ ----------
247
+ cluster_name : :obj:`str`, optional
248
+ Cluster key `name` to initiate upgrades. The string can only contain
249
+ lowercase alphanumeric characters and `.`, `_` or `-` characters.
250
+
251
+ """
252
+
253
+ result = cls._make_request(
254
+ _client,
255
+ "get",
256
+ "/api/v4/orchestration/clusters/{cluster_name}/edge-apps/version/apply",
257
+ {"cluster_name": cluster_name},
258
+ {},
259
+ {},
260
+ {},
261
+ None,
262
+ None,
263
+ False,
264
+ {"200": None, "400": None, "401": None, "404": None, "406": None},
265
+ False,
266
+ _dry_run,
267
+ )
268
+ return result
269
+
270
+ @classmethod
271
+ def update_orchestration_clusters_edge_apps_version_force(
272
+ cls, cluster_name: str, persist: Optional[bool] = None, _dry_run: bool = False, _client: Any = None
273
+ ) -> None:
274
+ """
275
+ Force available updates to Cluster even if update setting is disabled. Optionally keep a force update action on standby if the Cluster is offline. This ensures the update is applied once the Cluster returns online.
276
+
277
+ **Permission Required:** `kelvin.permission.cluster.update`.
278
+
279
+ ``updateOrchestrationClustersEdgeAppsVersionForce``: ``POST`` ``/api/v4/orchestration/clusters/{cluster_name}/edge-apps/version/force-update``
280
+
281
+ Parameters
282
+ ----------
283
+ cluster_name : :obj:`str`, optional
284
+ Cluster key `name` to initiate upgrades. The string can only contain
285
+ lowercase alphanumeric characters and `.`, `_` or `-` characters.
286
+ persist : :obj:`bool`
287
+ Optional setting to wait if the Cluster is currently unreachable and
288
+ force the update when the Cluster is next online.
289
+
290
+ """
291
+
292
+ result = cls._make_request(
293
+ _client,
294
+ "post",
295
+ "/api/v4/orchestration/clusters/{cluster_name}/edge-apps/version/force-update",
296
+ {"cluster_name": cluster_name},
297
+ {"persist": persist},
298
+ {},
299
+ {},
300
+ None,
301
+ None,
302
+ False,
303
+ {"200": None, "202": None, "400": None, "401": None, "404": None},
304
+ False,
305
+ _dry_run,
306
+ )
307
+ return result
308
+
309
+ @classmethod
310
+ def get_orchestration_clusters(
311
+ cls, cluster_name: str, _dry_run: bool = False, _client: Any = None
312
+ ) -> responses.OrchestrationClustersGet:
313
+ """
314
+ Retrieve the parameters and status of a Cluster.
315
+
316
+ **Permission Required:** `kelvin.permission.cluster.read`.
317
+
318
+ ``getOrchestrationClusters``: ``GET`` ``/api/v4/orchestration/clusters/{cluster_name}/get``
319
+
320
+ Parameters
321
+ ----------
322
+ cluster_name : :obj:`str`, optional
323
+ Cluster key `name` to get. The string can only contain lowercase
324
+ alphanumeric characters and `.`, `_` or `-` characters.
325
+
326
+ """
327
+
328
+ from ..model import responses
329
+
330
+ result = cls._make_request(
331
+ _client,
332
+ "get",
333
+ "/api/v4/orchestration/clusters/{cluster_name}/get",
334
+ {"cluster_name": cluster_name},
335
+ {},
336
+ {},
337
+ {},
338
+ None,
339
+ None,
340
+ False,
341
+ {"200": responses.OrchestrationClustersGet, "400": None, "401": None, "404": None},
342
+ False,
343
+ _dry_run,
344
+ )
345
+ return result
346
+
347
+ @classmethod
348
+ def get_orchestration_clusters_manifests(
349
+ cls, cluster_name: str, version: str, _dry_run: bool = False, _client: Any = None
350
+ ) -> responses.OrchestrationClustersManifestsGet:
351
+ """
352
+ Get Cluster Manifests
353
+
354
+ **Permission Required:** `kelvin.permission.cluster.read`.
355
+
356
+ ``getOrchestrationClustersManifests``: ``GET`` ``/api/v4/orchestration/clusters/{cluster_name}/manifests/get``
357
+
358
+ Parameters
359
+ ----------
360
+ cluster_name : :obj:`str`, optional
361
+ Cluster key `name` to retrieve provision yaml file. The string can
362
+ only contain lowercase alphanumeric characters and `.`, `_` or `-`
363
+ characters.
364
+ version : :obj:`str`, optional
365
+ Current version of the key `kelvin_version` in `version` object of the
366
+ Cluster parameters.
367
+
368
+ """
369
+
370
+ from ..model import responses
371
+
372
+ result = cls._make_request(
373
+ _client,
374
+ "get",
375
+ "/api/v4/orchestration/clusters/{cluster_name}/manifests/get",
376
+ {"cluster_name": cluster_name},
377
+ {"version": version},
378
+ {},
379
+ {},
380
+ None,
381
+ None,
382
+ False,
383
+ {"200": responses.OrchestrationClustersManifestsGet, "204": None, "400": None, "401": None, "404": None},
384
+ False,
385
+ _dry_run,
386
+ )
387
+ return result
388
+
389
+ @classmethod
390
+ def list_orchestration_clusters_node(
391
+ cls,
392
+ cluster_name: str,
393
+ search: Optional[Sequence[str]] = None,
394
+ status: Optional[Sequence[str]] = None,
395
+ pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
396
+ page_size: Optional[int] = 10000,
397
+ page: Optional[int] = None,
398
+ next: Optional[str] = None,
399
+ previous: Optional[str] = None,
400
+ direction: Optional[Literal["asc", "desc"]] = None,
401
+ sort_by: Optional[Sequence[str]] = None,
402
+ fetch: bool = True,
403
+ _dry_run: bool = False,
404
+ _client: Any = None,
405
+ ) -> Union[
406
+ List[responses.OrchestrationClustersNodesGetItem],
407
+ responses.OrchestrationClustersNodeListPaginatedResponseCursor,
408
+ ]:
409
+ """
410
+ Returns a list of Node objects in a Cluster. The list can be optionally filtered and sorted on the server before being returned.
411
+
412
+ **Permission Required:** `kelvin.permission.cluster.read`.
413
+
414
+ ``listOrchestrationClustersNode``: ``GET`` ``/api/v4/orchestration/clusters/{cluster_name}/nodes/list``
415
+
416
+ Parameters
417
+ ----------
418
+ cluster_name : :obj:`str`, optional
419
+ Cluster key `name` containing the Nodes to list. The filter is on the
420
+ full name only. Can only contain lowercase alphanumeric characters and
421
+ `.`, `_` or `-` characters.
422
+ search : :obj:`Sequence[str]`
423
+ Search and filter on the list based on the Node `name`. The search is
424
+ case insensitive and will find partial matches as well.
425
+ status : :obj:`Sequence[str]`
426
+ A filter on the list based on the Node key `status`. The filter is on
427
+ the full name only. All strings in the array are treated as `OR`.
428
+ Options are `online`, `unreachable` and `not_ready`
429
+ pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
430
+ Method of pagination to use for return results where `total_items` is
431
+ greater than `page_size`. `cursor` and `limits` will return one `page`
432
+ of results, `stream` will return all results. ('limits', 'cursor',
433
+ 'stream')
434
+ page_size : :obj:`int`
435
+ Number of objects to be returned in each page. Page size can range
436
+ between 1 and 1000 objects.
437
+ page : :obj:`int`
438
+ An integer for the wanted page of results. Used only with
439
+ `pagination_type` set as `limits`.
440
+ next : :obj:`str`
441
+ An alphanumeric string bookmark to indicate where to start for the
442
+ next page. Used only with `pagination_type` set as `cursor`.
443
+ previous : :obj:`str`
444
+ An alphanumeric string bookmark to indicate where to end for the
445
+ previous page. Used only with `pagination_type` set as `cursor`.
446
+ direction : :obj:`Literal['asc', 'desc']`
447
+ Sorting order according to the `sort_by` parameter. ('asc', 'desc')
448
+ sort_by : :obj:`Sequence[str]`
449
+ Sort the results by one of the Cluster parameters. Only one parameter
450
+ can be selected. Options: `id`, `name`, `status`, `last_seen`,
451
+ `created` and `updated`.
452
+
453
+ """
454
+
455
+ from ..model import responses
456
+
457
+ result = cls._make_request(
458
+ _client,
459
+ "get",
460
+ "/api/v4/orchestration/clusters/{cluster_name}/nodes/list",
461
+ {"cluster_name": cluster_name},
462
+ {
463
+ "search": search,
464
+ "status": status,
465
+ "pagination_type": pagination_type,
466
+ "page_size": page_size,
467
+ "page": page,
468
+ "next": next,
469
+ "previous": previous,
470
+ "direction": direction,
471
+ "sort_by": sort_by,
472
+ },
473
+ {},
474
+ {},
475
+ None,
476
+ None,
477
+ False,
478
+ {"200": responses.OrchestrationClustersNodeListPaginatedResponseCursor, "400": None, "401": None},
479
+ False,
480
+ _dry_run,
481
+ )
482
+ return (
483
+ result.fetch("/api/v4/orchestration/clusters/{cluster_name}/nodes/list", "GET")
484
+ if fetch and not _dry_run
485
+ else result
486
+ )
487
+
488
+ @classmethod
489
+ def get_orchestration_clusters_nodes(
490
+ cls, cluster_name: str, node_name: str, _dry_run: bool = False, _client: Any = None
491
+ ) -> responses.OrchestrationClustersNodesGet:
492
+ """
493
+ Retrieve the parameters and status of a specific Node on a Cluster.
494
+
495
+ **Permission Required:** `kelvin.permission.cluster.read`.
496
+
497
+ ``getOrchestrationClustersNodes``: ``GET`` ``/api/v4/orchestration/clusters/{cluster_name}/nodes/{node_name}/get``
498
+
499
+ Parameters
500
+ ----------
501
+ cluster_name : :obj:`str`, optional
502
+ Cluster key `name` to look for Node. The string can only contain
503
+ lowercase alphanumeric characters and `.`, `_` or `-` characters.
504
+ node_name : :obj:`str`, optional
505
+ Node key `name` to get. The string can only contain lowercase
506
+ alphanumeric characters and `.`, `_` or `-` characters.
507
+
508
+ """
509
+
510
+ from ..model import responses
511
+
512
+ result = cls._make_request(
513
+ _client,
514
+ "get",
515
+ "/api/v4/orchestration/clusters/{cluster_name}/nodes/{node_name}/get",
516
+ {"cluster_name": cluster_name, "node_name": node_name},
517
+ {},
518
+ {},
519
+ {},
520
+ None,
521
+ None,
522
+ False,
523
+ {"200": responses.OrchestrationClustersNodesGet, "400": None, "401": None, "404": None},
524
+ False,
525
+ _dry_run,
526
+ )
527
+ return result
528
+
529
+ @classmethod
530
+ def get_orchestration_clusters_provision(
531
+ cls, cluster_name: str, _dry_run: bool = False, _client: Any = None
532
+ ) -> Iterator[bytes]:
533
+ """
534
+ Get Clusters Provision YAML Specifications
535
+
536
+ **Permission Required:** `kelvin.permission.cluster.read`.
537
+
538
+ ``getOrchestrationClustersProvision``: ``GET`` ``/api/v4/orchestration/clusters/{cluster_name}/provision/get``
539
+
540
+ Parameters
541
+ ----------
542
+ cluster_name : :obj:`str`, optional
543
+ Cluster key `name` to retrieve provision yaml file. The string can
544
+ only contain lowercase alphanumeric characters and `.`, `_` or `-`
545
+ characters.
546
+
547
+ """
548
+
549
+ result = cls._make_request(
550
+ _client,
551
+ "get",
552
+ "/api/v4/orchestration/clusters/{cluster_name}/provision/get",
553
+ {"cluster_name": cluster_name},
554
+ {},
555
+ {},
556
+ {},
557
+ None,
558
+ None,
559
+ False,
560
+ {"200": bytes, "400": None, "401": None, "404": None},
561
+ True,
562
+ _dry_run,
563
+ )
564
+ return result
565
+
566
+ @classmethod
567
+ def list_orchestration_clusters_service(
568
+ cls,
569
+ cluster_name: str,
570
+ search: Optional[Sequence[str]] = None,
571
+ workload_name: Optional[Sequence[str]] = None,
572
+ service_type: Optional[Sequence[str]] = None,
573
+ pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
574
+ page_size: Optional[int] = 10000,
575
+ page: Optional[int] = None,
576
+ next: Optional[str] = None,
577
+ previous: Optional[str] = None,
578
+ direction: Optional[Literal["asc", "desc"]] = None,
579
+ sort_by: Optional[Sequence[str]] = None,
580
+ fetch: bool = True,
581
+ _dry_run: bool = False,
582
+ _client: Any = None,
583
+ ) -> Union[List[responses.ServiceItem], responses.OrchestrationClustersServiceListPaginatedResponseCursor]:
584
+ """
585
+ Returns a list of Service objects in a Cluster. The list can be optionally filtered and sorted on the server before being returned.
586
+
587
+ **Permission Required:** `kelvin.permission.cluster.read`.
588
+
589
+ ``listOrchestrationClustersService``: ``GET`` ``/api/v4/orchestration/clusters/{cluster_name}/services/list``
590
+
591
+ Parameters
592
+ ----------
593
+ cluster_name : :obj:`str`, optional
594
+ Cluster key `name` containing the Services to list. The filter is on
595
+ the full name only. Can only contain lowercase alphanumeric characters
596
+ and `.`, `_` or `-` characters.
597
+ search : :obj:`Sequence[str]`
598
+ Search and filter on the list based on any of the Service keys `name`,
599
+ `workload_name`, `network_interface`, `address`, and `service_type`.
600
+ The search is case insensitive and will find partial matches as well.
601
+ All strings in the array are treated as `OR`.
602
+ workload_name : :obj:`Sequence[str]`
603
+ A filter on the list based on the Workload key `name`. The filter is
604
+ on the full name only. All strings in the array are treated as `OR`.
605
+ service_type : :obj:`Sequence[str]`
606
+ A filter on the list based on the Service Type key `service_type`. The
607
+ filter is on the full name only. All strings in the array are treated
608
+ as `OR`. Options are `cluster_ip`, `node_port` and `host_port`.
609
+ pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
610
+ Method of pagination to use for return results where `total_items` is
611
+ greater than `page_size`. `cursor` and `limits` will return one `page`
612
+ of results, `stream` will return all results. ('limits', 'cursor',
613
+ 'stream')
614
+ page_size : :obj:`int`
615
+ Number of objects to be returned in each page. Page size can range
616
+ between 1 and 1000 objects.
617
+ page : :obj:`int`
618
+ An integer for the wanted page of results. Used only with
619
+ `pagination_type` set as `limits`.
620
+ next : :obj:`str`
621
+ An alphanumeric string bookmark to indicate where to start for the
622
+ next page. Used only with `pagination_type` set as `cursor`.
623
+ previous : :obj:`str`
624
+ An alphanumeric string bookmark to indicate where to end for the
625
+ previous page. Used only with `pagination_type` set as `cursor`.
626
+ direction : :obj:`Literal['asc', 'desc']`
627
+ Sorting order according to the `sort_by` parameter. ('asc', 'desc')
628
+ sort_by : :obj:`Sequence[str]`
629
+ Sort the results by one of the Cluster parameters. Only one parameter
630
+ can be selected. Options: `name`, `workload_name`,
631
+ `network_interface`, `service_type`, `address`, `created` and
632
+ `updated`.
633
+
634
+ """
635
+
636
+ from ..model import responses
637
+
638
+ result = cls._make_request(
639
+ _client,
640
+ "get",
641
+ "/api/v4/orchestration/clusters/{cluster_name}/services/list",
642
+ {"cluster_name": cluster_name},
643
+ {
644
+ "search": search,
645
+ "workload_name": workload_name,
646
+ "service_type": service_type,
647
+ "pagination_type": pagination_type,
648
+ "page_size": page_size,
649
+ "page": page,
650
+ "next": next,
651
+ "previous": previous,
652
+ "direction": direction,
653
+ "sort_by": sort_by,
654
+ },
655
+ {},
656
+ {},
657
+ None,
658
+ None,
659
+ False,
660
+ {"200": responses.OrchestrationClustersServiceListPaginatedResponseCursor, "400": None, "401": None},
661
+ False,
662
+ _dry_run,
663
+ )
664
+ return (
665
+ result.fetch("/api/v4/orchestration/clusters/{cluster_name}/services/list", "GET")
666
+ if fetch and not _dry_run
667
+ else result
668
+ )
669
+
670
+ @classmethod
671
+ def update_orchestration_clusters(
672
+ cls,
673
+ cluster_name: str,
674
+ data: Optional[Union[requests.OrchestrationClustersUpdate, Mapping[str, Any]]] = None,
675
+ _dry_run: bool = False,
676
+ _client: Any = None,
677
+ **kwargs: Any,
678
+ ) -> responses.OrchestrationClustersUpdate:
679
+ """
680
+ Update the configuration settings of the Cluster. Only key/values provided in the request body will be updated, all other settings will remain unchanged.
681
+
682
+ **Permission Required:** `kelvin.permission.cluster.update`.
683
+
684
+ ``updateOrchestrationClusters``: ``POST`` ``/api/v4/orchestration/clusters/{cluster_name}/update``
685
+
686
+ Parameters
687
+ ----------
688
+ cluster_name : :obj:`str`, optional
689
+ Cluster key `name` target for sending parameter updates. The string
690
+ can only contain lowercase alphanumeric characters and `.`, `_` or `-`
691
+ characters.
692
+ data: requests.OrchestrationClustersUpdate, optional
693
+ **kwargs:
694
+ Extra parameters for requests.OrchestrationClustersUpdate
695
+ - update_orchestration_clusters: dict
696
+
697
+ """
698
+
699
+ from ..model import responses
700
+
701
+ result = cls._make_request(
702
+ _client,
703
+ "post",
704
+ "/api/v4/orchestration/clusters/{cluster_name}/update",
705
+ {"cluster_name": cluster_name},
706
+ {},
707
+ {},
708
+ {},
709
+ data,
710
+ "requests.OrchestrationClustersUpdate",
711
+ False,
712
+ {"200": responses.OrchestrationClustersUpdate, "400": None, "401": None, "404": None, "409": None},
713
+ False,
714
+ _dry_run,
715
+ kwargs,
716
+ )
717
+ return result