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,67 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Kelvin API Client.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Any, List, Mapping, Optional, 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 AssetInsights(DataModelBase):
|
|
17
|
+
@classmethod
|
|
18
|
+
def get_asset_insights(
|
|
19
|
+
cls,
|
|
20
|
+
page_size: Optional[int] = 10000,
|
|
21
|
+
page: Optional[int] = None,
|
|
22
|
+
data: Optional[Union[requests.AssetInsightsGet, Mapping[str, Any]]] = None,
|
|
23
|
+
fetch: bool = True,
|
|
24
|
+
_dry_run: bool = False,
|
|
25
|
+
_client: Any = None,
|
|
26
|
+
**kwargs: Any,
|
|
27
|
+
) -> Union[List[responses.AssetInsightsItem], responses.AssetInsightsGetPaginated]:
|
|
28
|
+
"""
|
|
29
|
+
Advanced Asset Insights collates Asset data and optional custom defined fields and returns a structured array of Asset related objects. Ideal for generating UI lists, it accommodates a range of search, filter, and optional data on Data Streams, Parameters, Control Changes, Recommendations, etc. related to the Asset.
|
|
30
|
+
|
|
31
|
+
**Permission Required:** `kelvin.permission.asset_insights.read`.
|
|
32
|
+
|
|
33
|
+
``getAssetInsights``: ``POST`` ``/api/v4/asset-insights/get``
|
|
34
|
+
|
|
35
|
+
Parameters
|
|
36
|
+
----------
|
|
37
|
+
page_size : :obj:`int`
|
|
38
|
+
Number of Asset objects to be returned.
|
|
39
|
+
page : :obj:`int`
|
|
40
|
+
Return the list of Asset objects on requested page using the
|
|
41
|
+
`page_size` as a page calculation reference.
|
|
42
|
+
data: requests.AssetInsightsGet, optional
|
|
43
|
+
**kwargs:
|
|
44
|
+
Extra parameters for requests.AssetInsightsGet
|
|
45
|
+
- get_asset_insights: dict
|
|
46
|
+
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
from ..model import responses
|
|
50
|
+
|
|
51
|
+
result = cls._make_request(
|
|
52
|
+
_client,
|
|
53
|
+
"post",
|
|
54
|
+
"/api/v4/asset-insights/get",
|
|
55
|
+
{},
|
|
56
|
+
{"page_size": page_size, "page": page},
|
|
57
|
+
{},
|
|
58
|
+
{},
|
|
59
|
+
data,
|
|
60
|
+
"requests.AssetInsightsGet",
|
|
61
|
+
False,
|
|
62
|
+
{"200": responses.AssetInsightsGetPaginated, "400": None, "424": None},
|
|
63
|
+
False,
|
|
64
|
+
_dry_run,
|
|
65
|
+
kwargs,
|
|
66
|
+
)
|
|
67
|
+
return result.fetch("/api/v4/asset-insights/get", "POST", data) if fetch and not _dry_run else result
|
|
@@ -0,0 +1,306 @@
|
|
|
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 Bridge(DataModelBase):
|
|
17
|
+
@classmethod
|
|
18
|
+
def deploy_bridge(
|
|
19
|
+
cls,
|
|
20
|
+
data: Optional[Union[requests.BridgeDeploy, Mapping[str, Any]]] = None,
|
|
21
|
+
_dry_run: bool = False,
|
|
22
|
+
_client: Any = None,
|
|
23
|
+
**kwargs: Any,
|
|
24
|
+
) -> responses.BridgeDeploy:
|
|
25
|
+
"""
|
|
26
|
+
Deploy a Bridge (Connection) from the App Registry as a Workload to a Cluster/Node.
|
|
27
|
+
|
|
28
|
+
**Permission Required:** `kelvin.permission.bridge.create`.
|
|
29
|
+
|
|
30
|
+
``deployBridge``: ``POST`` ``/api/v4/bridges/deploy``
|
|
31
|
+
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
data: requests.BridgeDeploy, optional
|
|
35
|
+
**kwargs:
|
|
36
|
+
Extra parameters for requests.BridgeDeploy
|
|
37
|
+
- deploy_bridge: dict
|
|
38
|
+
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
from ..model import responses
|
|
42
|
+
|
|
43
|
+
result = cls._make_request(
|
|
44
|
+
_client,
|
|
45
|
+
"post",
|
|
46
|
+
"/api/v4/bridges/deploy",
|
|
47
|
+
{},
|
|
48
|
+
{},
|
|
49
|
+
{},
|
|
50
|
+
{},
|
|
51
|
+
data,
|
|
52
|
+
"requests.BridgeDeploy",
|
|
53
|
+
False,
|
|
54
|
+
{"201": responses.BridgeDeploy, "400": None, "401": None, "409": None, "424": None},
|
|
55
|
+
False,
|
|
56
|
+
_dry_run,
|
|
57
|
+
kwargs,
|
|
58
|
+
)
|
|
59
|
+
return result
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def list_bridges(
|
|
63
|
+
cls,
|
|
64
|
+
names: Optional[Sequence[str]] = None,
|
|
65
|
+
search: Optional[Sequence[str]] = None,
|
|
66
|
+
cluster_name: Optional[Sequence[str]] = None,
|
|
67
|
+
workload_name: Optional[Sequence[str]] = None,
|
|
68
|
+
status_state: Optional[Sequence[str]] = None,
|
|
69
|
+
app_name: Optional[Sequence[str]] = None,
|
|
70
|
+
app_version: Optional[Sequence[str]] = None,
|
|
71
|
+
pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
|
|
72
|
+
page_size: Optional[int] = 10000,
|
|
73
|
+
page: Optional[int] = None,
|
|
74
|
+
next: Optional[str] = None,
|
|
75
|
+
previous: Optional[str] = None,
|
|
76
|
+
direction: Optional[Literal["asc", "desc"]] = None,
|
|
77
|
+
sort_by: Optional[Sequence[str]] = None,
|
|
78
|
+
fetch: bool = True,
|
|
79
|
+
_dry_run: bool = False,
|
|
80
|
+
_client: Any = None,
|
|
81
|
+
) -> Union[List[responses.BridgeItem], responses.BridgesListPaginatedResponseCursor]:
|
|
82
|
+
"""
|
|
83
|
+
Returns a list of Bridges (also known as Connections) and its parameters. The list can be optionally filtered and sorted on the server before being returned.
|
|
84
|
+
|
|
85
|
+
**Permission Required:** `kelvin.permission.bridge.read`.
|
|
86
|
+
|
|
87
|
+
``listBridges``: ``GET`` ``/api/v4/bridges/list``
|
|
88
|
+
|
|
89
|
+
Parameters
|
|
90
|
+
----------
|
|
91
|
+
names : :obj:`Sequence[str]`
|
|
92
|
+
A filter on the list based on the key `name`. The filter is on the
|
|
93
|
+
full name only. The string can only contain lowercase alphanumeric
|
|
94
|
+
characters and `.`, `_` or `-` characters.
|
|
95
|
+
search : :obj:`Sequence[str]`
|
|
96
|
+
Search and filter on the list based on the keys `name`, `title`
|
|
97
|
+
(Display Name), `cluster_name`, `node_name` and `workload_name`. All
|
|
98
|
+
strings in the array are treated as `OR`. The search is case
|
|
99
|
+
insensitive and will find partial matches as well.
|
|
100
|
+
cluster_name : :obj:`Sequence[str]`
|
|
101
|
+
A filter on the list based on the key `cluster_name`. The filter is on
|
|
102
|
+
the full name only. The string can only contain lowercase alphanumeric
|
|
103
|
+
characters and `.`, `_` or `-` characters. If set, it will override
|
|
104
|
+
acp_name
|
|
105
|
+
workload_name : :obj:`Sequence[str]`
|
|
106
|
+
A filter on the list based on the key `workload_name`. The filter is
|
|
107
|
+
on the full name only. The string can only contain lowercase
|
|
108
|
+
alphanumeric characters and `.`, `_` or `-` characters.
|
|
109
|
+
status_state : :obj:`Sequence[str]`
|
|
110
|
+
A filter on the list based on the key `state` in the `status` object.
|
|
111
|
+
The filter is on the full name only. The string can only contain
|
|
112
|
+
lowercase alphanumeric characters and `.`, `_` or `-` characters.
|
|
113
|
+
app_name : :obj:`Sequence[str]`
|
|
114
|
+
Unique identifier `name` of the App. The string can only contain
|
|
115
|
+
lowercase alphanumeric characters and `.`, `_` or `-` characters.
|
|
116
|
+
app_version : :obj:`Sequence[str]`
|
|
117
|
+
App version
|
|
118
|
+
pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
|
|
119
|
+
Method of pagination to use for return results where `total_items` is
|
|
120
|
+
greater than `page_size`. `cursor` and `limits` will return one `page`
|
|
121
|
+
of results, `stream` will return all results. ('limits', 'cursor',
|
|
122
|
+
'stream')
|
|
123
|
+
page_size : :obj:`int`
|
|
124
|
+
Number of objects to be returned in each page. Page size can range
|
|
125
|
+
between 1 and 1000 objects.
|
|
126
|
+
page : :obj:`int`
|
|
127
|
+
An integer for the wanted page of results. Used only with
|
|
128
|
+
`pagination_type` set as `limits`.
|
|
129
|
+
next : :obj:`str`
|
|
130
|
+
An alphanumeric string bookmark to indicate where to start for the
|
|
131
|
+
next page. Used only with `pagination_type` set as `cursor`.
|
|
132
|
+
previous : :obj:`str`
|
|
133
|
+
An alphanumeric string bookmark to indicate where to end for the
|
|
134
|
+
previous page. Used only with `pagination_type` set as `cursor`.
|
|
135
|
+
direction : :obj:`Literal['asc', 'desc']`
|
|
136
|
+
Sorting order according to the `sort_by` parameter. ('asc', 'desc')
|
|
137
|
+
sort_by : :obj:`Sequence[str]`
|
|
138
|
+
|
|
139
|
+
"""
|
|
140
|
+
|
|
141
|
+
from ..model import responses
|
|
142
|
+
|
|
143
|
+
result = cls._make_request(
|
|
144
|
+
_client,
|
|
145
|
+
"get",
|
|
146
|
+
"/api/v4/bridges/list",
|
|
147
|
+
{},
|
|
148
|
+
{
|
|
149
|
+
"names": names,
|
|
150
|
+
"search": search,
|
|
151
|
+
"cluster_name": cluster_name,
|
|
152
|
+
"workload_name": workload_name,
|
|
153
|
+
"status_state": status_state,
|
|
154
|
+
"app_name": app_name,
|
|
155
|
+
"app_version": app_version,
|
|
156
|
+
"pagination_type": pagination_type,
|
|
157
|
+
"page_size": page_size,
|
|
158
|
+
"page": page,
|
|
159
|
+
"next": next,
|
|
160
|
+
"previous": previous,
|
|
161
|
+
"direction": direction,
|
|
162
|
+
"sort_by": sort_by,
|
|
163
|
+
},
|
|
164
|
+
{},
|
|
165
|
+
{},
|
|
166
|
+
None,
|
|
167
|
+
None,
|
|
168
|
+
False,
|
|
169
|
+
{"200": responses.BridgesListPaginatedResponseCursor, "400": None, "401": None},
|
|
170
|
+
False,
|
|
171
|
+
_dry_run,
|
|
172
|
+
)
|
|
173
|
+
return result.fetch("/api/v4/bridges/list", "GET") if fetch and not _dry_run else result
|
|
174
|
+
|
|
175
|
+
@classmethod
|
|
176
|
+
def delete_bridge(cls, bridge_name: str, _dry_run: bool = False, _client: Any = None) -> None:
|
|
177
|
+
"""
|
|
178
|
+
Permanently delete an existing Bridge (Connection). You will no longer receieve Asset / Data Stream data from the assets associated with the Bridge (Connection). This cannot be undone once the API request has been submitted.
|
|
179
|
+
|
|
180
|
+
**Permission Required:** `kelvin.permission.bridge.delete`.
|
|
181
|
+
|
|
182
|
+
``deleteBridge``: ``POST`` ``/api/v4/bridges/{bridge_name}/delete``
|
|
183
|
+
|
|
184
|
+
Parameters
|
|
185
|
+
----------
|
|
186
|
+
bridge_name : :obj:`str`, optional
|
|
187
|
+
Unique identifier `name` of the Bridge (Connection).
|
|
188
|
+
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
result = cls._make_request(
|
|
192
|
+
_client,
|
|
193
|
+
"post",
|
|
194
|
+
"/api/v4/bridges/{bridge_name}/delete",
|
|
195
|
+
{"bridge_name": bridge_name},
|
|
196
|
+
{},
|
|
197
|
+
{},
|
|
198
|
+
{},
|
|
199
|
+
None,
|
|
200
|
+
None,
|
|
201
|
+
False,
|
|
202
|
+
{"200": None, "400": None, "401": None, "404": None},
|
|
203
|
+
False,
|
|
204
|
+
_dry_run,
|
|
205
|
+
)
|
|
206
|
+
return result
|
|
207
|
+
|
|
208
|
+
@classmethod
|
|
209
|
+
def get_bridge(cls, bridge_name: str, _dry_run: bool = False, _client: Any = None) -> responses.BridgeGet:
|
|
210
|
+
"""
|
|
211
|
+
Retrieve the parameters of a Bridge (Connection).
|
|
212
|
+
|
|
213
|
+
**Permission Required:** `kelvin.permission.bridge.read`.
|
|
214
|
+
|
|
215
|
+
``getBridge``: ``GET`` ``/api/v4/bridges/{bridge_name}/get``
|
|
216
|
+
|
|
217
|
+
Parameters
|
|
218
|
+
----------
|
|
219
|
+
bridge_name : :obj:`str`, optional
|
|
220
|
+
Unique identifier `name` of the Bridge (Connection).
|
|
221
|
+
|
|
222
|
+
"""
|
|
223
|
+
|
|
224
|
+
from ..model import responses
|
|
225
|
+
|
|
226
|
+
result = cls._make_request(
|
|
227
|
+
_client,
|
|
228
|
+
"get",
|
|
229
|
+
"/api/v4/bridges/{bridge_name}/get",
|
|
230
|
+
{"bridge_name": bridge_name},
|
|
231
|
+
{},
|
|
232
|
+
{},
|
|
233
|
+
{},
|
|
234
|
+
None,
|
|
235
|
+
None,
|
|
236
|
+
False,
|
|
237
|
+
{"200": responses.BridgeGet, "400": None, "401": None},
|
|
238
|
+
False,
|
|
239
|
+
_dry_run,
|
|
240
|
+
)
|
|
241
|
+
return result
|
|
242
|
+
|
|
243
|
+
@classmethod
|
|
244
|
+
def start_bridge(cls, bridge_name: str, _dry_run: bool = False, _client: Any = None) -> None:
|
|
245
|
+
"""
|
|
246
|
+
Start running the Bridge (Connection).
|
|
247
|
+
|
|
248
|
+
**Permission Required:** `kelvin.permission.bridge.update`.
|
|
249
|
+
|
|
250
|
+
``startBridge``: ``GET`` ``/api/v4/bridges/{bridge_name}/start``
|
|
251
|
+
|
|
252
|
+
Parameters
|
|
253
|
+
----------
|
|
254
|
+
bridge_name : :obj:`str`, optional
|
|
255
|
+
Unique identifier `name` of the Bridge (Connection).
|
|
256
|
+
|
|
257
|
+
"""
|
|
258
|
+
|
|
259
|
+
result = cls._make_request(
|
|
260
|
+
_client,
|
|
261
|
+
"get",
|
|
262
|
+
"/api/v4/bridges/{bridge_name}/start",
|
|
263
|
+
{"bridge_name": bridge_name},
|
|
264
|
+
{},
|
|
265
|
+
{},
|
|
266
|
+
{},
|
|
267
|
+
None,
|
|
268
|
+
None,
|
|
269
|
+
False,
|
|
270
|
+
{"200": None, "400": None, "401": None, "404": None},
|
|
271
|
+
False,
|
|
272
|
+
_dry_run,
|
|
273
|
+
)
|
|
274
|
+
return result
|
|
275
|
+
|
|
276
|
+
@classmethod
|
|
277
|
+
def stop_bridge(cls, bridge_name: str, _dry_run: bool = False, _client: Any = None) -> None:
|
|
278
|
+
"""
|
|
279
|
+
Stop running the Bridge (Connection).
|
|
280
|
+
**Permission Required:** `kelvin.permission.bridge.update`.
|
|
281
|
+
|
|
282
|
+
``stopBridge``: ``GET`` ``/api/v4/bridges/{bridge_name}/stop``
|
|
283
|
+
|
|
284
|
+
Parameters
|
|
285
|
+
----------
|
|
286
|
+
bridge_name : :obj:`str`, optional
|
|
287
|
+
Unique identifier `name` of the Bridge (Connection).
|
|
288
|
+
|
|
289
|
+
"""
|
|
290
|
+
|
|
291
|
+
result = cls._make_request(
|
|
292
|
+
_client,
|
|
293
|
+
"get",
|
|
294
|
+
"/api/v4/bridges/{bridge_name}/stop",
|
|
295
|
+
{"bridge_name": bridge_name},
|
|
296
|
+
{},
|
|
297
|
+
{},
|
|
298
|
+
{},
|
|
299
|
+
None,
|
|
300
|
+
None,
|
|
301
|
+
False,
|
|
302
|
+
{"200": None, "400": None, "401": None, "404": None},
|
|
303
|
+
False,
|
|
304
|
+
_dry_run,
|
|
305
|
+
)
|
|
306
|
+
return result
|