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.
- kelvin/api/client/__init__.py +15 -0
- kelvin/api/client/api/app_manager.py +646 -0
- kelvin/api/client/api/app_registry.py +342 -0
- kelvin/api/client/api/asset.py +1012 -0
- kelvin/api/client/api/asset_insights.py +67 -0
- kelvin/api/client/api/bridge.py +306 -0
- kelvin/api/client/api/control_change.py +398 -0
- kelvin/api/client/api/data_tag.py +499 -0
- kelvin/api/client/api/datastreams.py +1021 -0
- kelvin/api/client/api/filestorage.py +234 -0
- kelvin/api/client/api/instance.py +559 -0
- kelvin/api/client/api/orchestration.py +717 -0
- kelvin/api/client/api/parameters.py +417 -0
- kelvin/api/client/api/recommendation.py +804 -0
- kelvin/api/client/api/secret.py +173 -0
- kelvin/api/client/api/thread.py +435 -0
- kelvin/api/client/api/timeseries.py +273 -0
- kelvin/api/client/api/user.py +382 -0
- kelvin/api/client/api/workload.py +437 -0
- kelvin/api/client/base_client.py +924 -0
- kelvin/api/client/base_model.py +187 -0
- kelvin/api/client/client.py +181 -0
- kelvin/api/client/config.py +709 -0
- kelvin/api/client/data_model.py +523 -0
- kelvin/api/client/dataframe_conversion.py +172 -0
- kelvin/api/client/deeplist.py +285 -0
- kelvin/api/client/error.py +77 -0
- kelvin/api/client/model/__init__.py +3 -0
- kelvin/api/client/model/enum.py +82 -0
- kelvin/api/client/model/pagination.py +61 -0
- kelvin/api/client/model/requests.py +3352 -0
- kelvin/api/client/model/response.py +68 -0
- kelvin/api/client/model/responses.py +4799 -0
- kelvin/api/client/model/type.py +2025 -0
- kelvin/api/client/py.typed +0 -0
- kelvin/api/client/retry.py +88 -0
- kelvin/api/client/serialize.py +222 -0
- kelvin/api/client/utils.py +316 -0
- kelvin/api/client/version.py +16 -0
- kelvin_python_api_client-0.0.1.dist-info/METADATA +75 -0
- kelvin_python_api_client-0.0.1.dist-info/RECORD +43 -0
- kelvin_python_api_client-0.0.1.dist-info/WHEEL +5 -0
- kelvin_python_api_client-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Kelvin API Client.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Any, 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 ControlChange(DataModelBase):
|
|
17
|
+
@classmethod
|
|
18
|
+
def get_control_change_clustering(
|
|
19
|
+
cls,
|
|
20
|
+
data: Optional[Union[requests.ControlChangeClusteringGet, Mapping[str, Any]]] = None,
|
|
21
|
+
_dry_run: bool = False,
|
|
22
|
+
_client: Any = None,
|
|
23
|
+
**kwargs: Any,
|
|
24
|
+
) -> List[responses.ControlChangeClustering]:
|
|
25
|
+
"""
|
|
26
|
+
Retrieve the total count of Control Changes matching an array of `resources` and filter options between two dates grouped by the parameter `time_bucket`. Will also return a list of all the Control Change `id`s counted.
|
|
27
|
+
|
|
28
|
+
**Permission Required:** `kelvin.permission.control_change.read`.
|
|
29
|
+
|
|
30
|
+
``getControlChangeClustering``: ``POST`` ``/api/v4/control-changes/clustering/get``
|
|
31
|
+
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
data: requests.ControlChangeClusteringGet, optional
|
|
35
|
+
**kwargs:
|
|
36
|
+
Extra parameters for requests.ControlChangeClusteringGet
|
|
37
|
+
- get_control_change_clustering: dict
|
|
38
|
+
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
from ..model import responses
|
|
42
|
+
|
|
43
|
+
result = cls._make_request(
|
|
44
|
+
_client,
|
|
45
|
+
"post",
|
|
46
|
+
"/api/v4/control-changes/clustering/get",
|
|
47
|
+
{},
|
|
48
|
+
{},
|
|
49
|
+
{},
|
|
50
|
+
{},
|
|
51
|
+
data,
|
|
52
|
+
"requests.ControlChangeClusteringGet",
|
|
53
|
+
False,
|
|
54
|
+
{"200": List[responses.ControlChangeClustering], "400": None, "401": None, "404": None},
|
|
55
|
+
False,
|
|
56
|
+
_dry_run,
|
|
57
|
+
kwargs,
|
|
58
|
+
)
|
|
59
|
+
return result
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def create_control_change(
|
|
63
|
+
cls,
|
|
64
|
+
data: Optional[Union[requests.ControlChangeCreate, Mapping[str, Any]]] = None,
|
|
65
|
+
_dry_run: bool = False,
|
|
66
|
+
_client: Any = None,
|
|
67
|
+
**kwargs: Any,
|
|
68
|
+
) -> responses.ControlChangeCreate:
|
|
69
|
+
"""
|
|
70
|
+
Send a new value to be written to an Asset / Data Stream pair. The Control Change Manager will automatically find which Cluster and Bridge to communicate the change to.
|
|
71
|
+
|
|
72
|
+
**Permission Required:** `kelvin.permission.control_change.create`.
|
|
73
|
+
|
|
74
|
+
``createControlChange``: ``POST`` ``/api/v4/control-changes/create``
|
|
75
|
+
|
|
76
|
+
Parameters
|
|
77
|
+
----------
|
|
78
|
+
data: requests.ControlChangeCreate, optional
|
|
79
|
+
**kwargs:
|
|
80
|
+
Extra parameters for requests.ControlChangeCreate
|
|
81
|
+
- create_control_change: dict
|
|
82
|
+
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
from ..model import responses
|
|
86
|
+
|
|
87
|
+
result = cls._make_request(
|
|
88
|
+
_client,
|
|
89
|
+
"post",
|
|
90
|
+
"/api/v4/control-changes/create",
|
|
91
|
+
{},
|
|
92
|
+
{},
|
|
93
|
+
{},
|
|
94
|
+
{},
|
|
95
|
+
data,
|
|
96
|
+
"requests.ControlChangeCreate",
|
|
97
|
+
False,
|
|
98
|
+
{"201": responses.ControlChangeCreate, "400": None, "401": None},
|
|
99
|
+
False,
|
|
100
|
+
_dry_run,
|
|
101
|
+
kwargs,
|
|
102
|
+
)
|
|
103
|
+
return result
|
|
104
|
+
|
|
105
|
+
@classmethod
|
|
106
|
+
def get_control_change_last(
|
|
107
|
+
cls,
|
|
108
|
+
status_limit: Optional[int] = None,
|
|
109
|
+
pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
|
|
110
|
+
page_size: Optional[int] = 10000,
|
|
111
|
+
page: Optional[int] = None,
|
|
112
|
+
next: Optional[str] = None,
|
|
113
|
+
previous: Optional[str] = None,
|
|
114
|
+
direction: Optional[Literal["asc", "desc"]] = None,
|
|
115
|
+
sort_by: Optional[Sequence[str]] = None,
|
|
116
|
+
data: Optional[Union[requests.ControlChangeLastGet, Mapping[str, Any]]] = None,
|
|
117
|
+
fetch: bool = True,
|
|
118
|
+
_dry_run: bool = False,
|
|
119
|
+
_client: Any = None,
|
|
120
|
+
**kwargs: Any,
|
|
121
|
+
) -> Union[List[responses.ControlChangeGet], responses.ControlChangeLastGetPaginatedResponseCursor]:
|
|
122
|
+
"""
|
|
123
|
+
Returns a dictionary with a data property containing an array of latest Control Change objects. Only the latest Control Changes for each `resource` in the request filters will be returned.
|
|
124
|
+
|
|
125
|
+
**Permission Required:** `kelvin.permission.control_change.read`.
|
|
126
|
+
|
|
127
|
+
``getControlChangeLast``: ``POST`` ``/api/v4/control-changes/last/get``
|
|
128
|
+
|
|
129
|
+
Parameters
|
|
130
|
+
----------
|
|
131
|
+
status_limit : :obj:`int`
|
|
132
|
+
Maximum number of status logs to fetched per Control Change object,
|
|
133
|
+
starting from most recent logs created.
|
|
134
|
+
pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
|
|
135
|
+
Method of pagination to use for return results where `total_items` is
|
|
136
|
+
greater than `page_size`. `cursor` and `limits` will return one `page`
|
|
137
|
+
of results, `stream` will return all results. ('limits', 'cursor',
|
|
138
|
+
'stream')
|
|
139
|
+
page_size : :obj:`int`
|
|
140
|
+
Number of objects to be returned in each page. Page size can range
|
|
141
|
+
between 1 and 1000 objects.
|
|
142
|
+
page : :obj:`int`
|
|
143
|
+
An integer for the wanted page of results. Used only with
|
|
144
|
+
`pagination_type` set as `limits`.
|
|
145
|
+
next : :obj:`str`
|
|
146
|
+
An alphanumeric string bookmark to indicate where to start for the
|
|
147
|
+
next page. Used only with `pagination_type` set as `cursor`.
|
|
148
|
+
previous : :obj:`str`
|
|
149
|
+
An alphanumeric string bookmark to indicate where to end for the
|
|
150
|
+
previous page. Used only with `pagination_type` set as `cursor`.
|
|
151
|
+
direction : :obj:`Literal['asc', 'desc']`
|
|
152
|
+
Sorting order according to the `sort_by` parameter. ('asc', 'desc')
|
|
153
|
+
sort_by : :obj:`Sequence[str]`
|
|
154
|
+
data: requests.ControlChangeLastGet, optional
|
|
155
|
+
**kwargs:
|
|
156
|
+
Extra parameters for requests.ControlChangeLastGet
|
|
157
|
+
- get_control_change_last: dict
|
|
158
|
+
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
from ..model import responses
|
|
162
|
+
|
|
163
|
+
result = cls._make_request(
|
|
164
|
+
_client,
|
|
165
|
+
"post",
|
|
166
|
+
"/api/v4/control-changes/last/get",
|
|
167
|
+
{},
|
|
168
|
+
{
|
|
169
|
+
"status_limit": status_limit,
|
|
170
|
+
"pagination_type": pagination_type,
|
|
171
|
+
"page_size": page_size,
|
|
172
|
+
"page": page,
|
|
173
|
+
"next": next,
|
|
174
|
+
"previous": previous,
|
|
175
|
+
"direction": direction,
|
|
176
|
+
"sort_by": sort_by,
|
|
177
|
+
},
|
|
178
|
+
{},
|
|
179
|
+
{},
|
|
180
|
+
data,
|
|
181
|
+
"requests.ControlChangeLastGet",
|
|
182
|
+
False,
|
|
183
|
+
{"200": responses.ControlChangeLastGetPaginatedResponseCursor, "400": None},
|
|
184
|
+
False,
|
|
185
|
+
_dry_run,
|
|
186
|
+
kwargs,
|
|
187
|
+
)
|
|
188
|
+
return result.fetch("/api/v4/control-changes/last/get", "POST", data) if fetch and not _dry_run else result
|
|
189
|
+
|
|
190
|
+
@classmethod
|
|
191
|
+
def list_control_changes(
|
|
192
|
+
cls,
|
|
193
|
+
status_limit: Optional[int] = None,
|
|
194
|
+
pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
|
|
195
|
+
page_size: Optional[int] = 10000,
|
|
196
|
+
page: Optional[int] = None,
|
|
197
|
+
next: Optional[str] = None,
|
|
198
|
+
previous: Optional[str] = None,
|
|
199
|
+
direction: Optional[Literal["asc", "desc"]] = None,
|
|
200
|
+
sort_by: Optional[Sequence[str]] = None,
|
|
201
|
+
data: Optional[Union[requests.ControlChangesList, Mapping[str, Any]]] = None,
|
|
202
|
+
fetch: bool = True,
|
|
203
|
+
_dry_run: bool = False,
|
|
204
|
+
_client: Any = None,
|
|
205
|
+
**kwargs: Any,
|
|
206
|
+
) -> Union[List[responses.ControlChangeGet], responses.ControlChangesListPaginatedResponseCursor]:
|
|
207
|
+
"""
|
|
208
|
+
Returns a list of Control Change objects for specific Asset / Data Stream pairs or Control Change IDs. The list can be optionally filtered and sorted on the server before being returned.
|
|
209
|
+
|
|
210
|
+
**Permission Required:** `kelvin.permission.control_change.read`.
|
|
211
|
+
|
|
212
|
+
``listControlChanges``: ``POST`` ``/api/v4/control-changes/list``
|
|
213
|
+
|
|
214
|
+
Parameters
|
|
215
|
+
----------
|
|
216
|
+
status_limit : :obj:`int`
|
|
217
|
+
Maximum number of status logs to fetched per Control Change object,
|
|
218
|
+
starting from most recent logs created.
|
|
219
|
+
pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
|
|
220
|
+
Method of pagination to use for return results where `total_items` is
|
|
221
|
+
greater than `page_size`. `cursor` and `limits` will return one `page`
|
|
222
|
+
of results, `stream` will return all results. ('limits', 'cursor',
|
|
223
|
+
'stream')
|
|
224
|
+
page_size : :obj:`int`
|
|
225
|
+
Number of objects to be returned in each page. Page size can range
|
|
226
|
+
between 1 and 1000 objects.
|
|
227
|
+
page : :obj:`int`
|
|
228
|
+
An integer for the wanted page of results. Used only with
|
|
229
|
+
`pagination_type` set as `limits`.
|
|
230
|
+
next : :obj:`str`
|
|
231
|
+
An alphanumeric string bookmark to indicate where to start for the
|
|
232
|
+
next page. Used only with `pagination_type` set as `cursor`.
|
|
233
|
+
previous : :obj:`str`
|
|
234
|
+
An alphanumeric string bookmark to indicate where to end for the
|
|
235
|
+
previous page. Used only with `pagination_type` set as `cursor`.
|
|
236
|
+
direction : :obj:`Literal['asc', 'desc']`
|
|
237
|
+
Sorting order according to the `sort_by` parameter. ('asc', 'desc')
|
|
238
|
+
sort_by : :obj:`Sequence[str]`
|
|
239
|
+
data: requests.ControlChangesList, optional
|
|
240
|
+
**kwargs:
|
|
241
|
+
Extra parameters for requests.ControlChangesList
|
|
242
|
+
- list_control_changes: dict
|
|
243
|
+
|
|
244
|
+
"""
|
|
245
|
+
|
|
246
|
+
from ..model import responses
|
|
247
|
+
|
|
248
|
+
result = cls._make_request(
|
|
249
|
+
_client,
|
|
250
|
+
"post",
|
|
251
|
+
"/api/v4/control-changes/list",
|
|
252
|
+
{},
|
|
253
|
+
{
|
|
254
|
+
"status_limit": status_limit,
|
|
255
|
+
"pagination_type": pagination_type,
|
|
256
|
+
"page_size": page_size,
|
|
257
|
+
"page": page,
|
|
258
|
+
"next": next,
|
|
259
|
+
"previous": previous,
|
|
260
|
+
"direction": direction,
|
|
261
|
+
"sort_by": sort_by,
|
|
262
|
+
},
|
|
263
|
+
{},
|
|
264
|
+
{},
|
|
265
|
+
data,
|
|
266
|
+
"requests.ControlChangesList",
|
|
267
|
+
False,
|
|
268
|
+
{"200": responses.ControlChangesListPaginatedResponseCursor, "400": None},
|
|
269
|
+
False,
|
|
270
|
+
_dry_run,
|
|
271
|
+
kwargs,
|
|
272
|
+
)
|
|
273
|
+
return result.fetch("/api/v4/control-changes/list", "POST", data) if fetch and not _dry_run else result
|
|
274
|
+
|
|
275
|
+
@classmethod
|
|
276
|
+
def get_control_change_range(
|
|
277
|
+
cls,
|
|
278
|
+
status_limit: Optional[int] = None,
|
|
279
|
+
pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
|
|
280
|
+
page_size: Optional[int] = 10000,
|
|
281
|
+
page: Optional[int] = None,
|
|
282
|
+
next: Optional[str] = None,
|
|
283
|
+
previous: Optional[str] = None,
|
|
284
|
+
direction: Optional[Literal["asc", "desc"]] = None,
|
|
285
|
+
sort_by: Optional[Sequence[str]] = None,
|
|
286
|
+
data: Optional[Union[requests.ControlChangeRangeGet, Mapping[str, Any]]] = None,
|
|
287
|
+
fetch: bool = True,
|
|
288
|
+
_dry_run: bool = False,
|
|
289
|
+
_client: Any = None,
|
|
290
|
+
**kwargs: Any,
|
|
291
|
+
) -> Union[List[responses.ControlChangeGet], responses.ControlChangeRangeGetPaginatedResponseCursor]:
|
|
292
|
+
"""
|
|
293
|
+
Returns a dictionary with a data property containing an array of Control Changes within a specified time range for all of the `resources` in the `resources` array that match the filter options.
|
|
294
|
+
|
|
295
|
+
**Permission Required:** `kelvin.permission.control_change.read`.
|
|
296
|
+
|
|
297
|
+
``getControlChangeRange``: ``POST`` ``/api/v4/control-changes/range/get``
|
|
298
|
+
|
|
299
|
+
Parameters
|
|
300
|
+
----------
|
|
301
|
+
status_limit : :obj:`int`
|
|
302
|
+
Maximum number of status logs to fetched per Control Change object,
|
|
303
|
+
starting from most recent logs created.
|
|
304
|
+
pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
|
|
305
|
+
Method of pagination to use for return results where `total_items` is
|
|
306
|
+
greater than `page_size`. `cursor` and `limits` will return one `page`
|
|
307
|
+
of results, `stream` will return all results. ('limits', 'cursor',
|
|
308
|
+
'stream')
|
|
309
|
+
page_size : :obj:`int`
|
|
310
|
+
Number of objects to be returned in each page. Page size can range
|
|
311
|
+
between 1 and 1000 objects.
|
|
312
|
+
page : :obj:`int`
|
|
313
|
+
An integer for the wanted page of results. Used only with
|
|
314
|
+
`pagination_type` set as `limits`.
|
|
315
|
+
next : :obj:`str`
|
|
316
|
+
An alphanumeric string bookmark to indicate where to start for the
|
|
317
|
+
next page. Used only with `pagination_type` set as `cursor`.
|
|
318
|
+
previous : :obj:`str`
|
|
319
|
+
An alphanumeric string bookmark to indicate where to end for the
|
|
320
|
+
previous page. Used only with `pagination_type` set as `cursor`.
|
|
321
|
+
direction : :obj:`Literal['asc', 'desc']`
|
|
322
|
+
Sorting order according to the `sort_by` parameter. ('asc', 'desc')
|
|
323
|
+
sort_by : :obj:`Sequence[str]`
|
|
324
|
+
data: requests.ControlChangeRangeGet, optional
|
|
325
|
+
**kwargs:
|
|
326
|
+
Extra parameters for requests.ControlChangeRangeGet
|
|
327
|
+
- get_control_change_range: dict
|
|
328
|
+
|
|
329
|
+
"""
|
|
330
|
+
|
|
331
|
+
from ..model import responses
|
|
332
|
+
|
|
333
|
+
result = cls._make_request(
|
|
334
|
+
_client,
|
|
335
|
+
"post",
|
|
336
|
+
"/api/v4/control-changes/range/get",
|
|
337
|
+
{},
|
|
338
|
+
{
|
|
339
|
+
"status_limit": status_limit,
|
|
340
|
+
"pagination_type": pagination_type,
|
|
341
|
+
"page_size": page_size,
|
|
342
|
+
"page": page,
|
|
343
|
+
"next": next,
|
|
344
|
+
"previous": previous,
|
|
345
|
+
"direction": direction,
|
|
346
|
+
"sort_by": sort_by,
|
|
347
|
+
},
|
|
348
|
+
{},
|
|
349
|
+
{},
|
|
350
|
+
data,
|
|
351
|
+
"requests.ControlChangeRangeGet",
|
|
352
|
+
False,
|
|
353
|
+
{"200": responses.ControlChangeRangeGetPaginatedResponseCursor, "400": None},
|
|
354
|
+
False,
|
|
355
|
+
_dry_run,
|
|
356
|
+
kwargs,
|
|
357
|
+
)
|
|
358
|
+
return result.fetch("/api/v4/control-changes/range/get", "POST", data) if fetch and not _dry_run else result
|
|
359
|
+
|
|
360
|
+
@classmethod
|
|
361
|
+
def get_control_change(
|
|
362
|
+
cls, control_change_id: str, status_limit: Optional[int] = None, _dry_run: bool = False, _client: Any = None
|
|
363
|
+
) -> responses.ControlChangeGet:
|
|
364
|
+
"""
|
|
365
|
+
Retrieves the properties, status and all associated logs of a Control Change.
|
|
366
|
+
|
|
367
|
+
**Permission Required:** `kelvin.permission.control_change.read`.
|
|
368
|
+
|
|
369
|
+
``getControlChange``: ``GET`` ``/api/v4/control-changes/{control_change_id}/get``
|
|
370
|
+
|
|
371
|
+
Parameters
|
|
372
|
+
----------
|
|
373
|
+
control_change_id : :obj:`str`, optional
|
|
374
|
+
A unique random generated UUID as the key `id` for the Control Change.
|
|
375
|
+
status_limit : :obj:`int`
|
|
376
|
+
Maximum number of status logs to fetched per Control Change object,
|
|
377
|
+
starting from most recent logs created.
|
|
378
|
+
|
|
379
|
+
"""
|
|
380
|
+
|
|
381
|
+
from ..model import responses
|
|
382
|
+
|
|
383
|
+
result = cls._make_request(
|
|
384
|
+
_client,
|
|
385
|
+
"get",
|
|
386
|
+
"/api/v4/control-changes/{control_change_id}/get",
|
|
387
|
+
{"control_change_id": control_change_id},
|
|
388
|
+
{"status_limit": status_limit},
|
|
389
|
+
{},
|
|
390
|
+
{},
|
|
391
|
+
None,
|
|
392
|
+
None,
|
|
393
|
+
False,
|
|
394
|
+
{"200": responses.ControlChangeGet, "400": None, "404": None},
|
|
395
|
+
False,
|
|
396
|
+
_dry_run,
|
|
397
|
+
)
|
|
398
|
+
return result
|