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,15 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Kelvin API Client 2.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from .base_client import ClientConfiguration, History
|
|
6
|
+
from .client import MODELS, Client
|
|
7
|
+
from .data_model import DataModelBase
|
|
8
|
+
from .error import ClientError
|
|
9
|
+
from .version import version as __version__
|
|
10
|
+
|
|
11
|
+
__all__ = ["Client", "ClientConfiguration", "ClientError", "History", "DataModelBase", *MODELS]
|
|
12
|
+
|
|
13
|
+
locals().update(MODELS)
|
|
14
|
+
|
|
15
|
+
del MODELS
|
|
@@ -0,0 +1,646 @@
|
|
|
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, type
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class AppManager(DataModelBase):
|
|
17
|
+
@classmethod
|
|
18
|
+
def get_app_manager_app(
|
|
19
|
+
cls, app_name: str, _dry_run: bool = False, _client: Any = None
|
|
20
|
+
) -> responses.AppManagerAppGet:
|
|
21
|
+
"""
|
|
22
|
+
Retrieve the parameters of an Application.
|
|
23
|
+
|
|
24
|
+
**Permission Required:** `kelvin.permission.appmanager.read`.
|
|
25
|
+
|
|
26
|
+
``getAppManagerApp``: ``GET`` ``/api/v4/app-manager/app/{app_name}/get``
|
|
27
|
+
|
|
28
|
+
Parameters
|
|
29
|
+
----------
|
|
30
|
+
app_name : :obj:`str`, optional
|
|
31
|
+
A filter on the list based on the Application key `name`. The filter
|
|
32
|
+
is on the full name only. All strings in the array are treated as
|
|
33
|
+
`OR`. Can only contain lowercase alphanumeric characters and `.`, `_`
|
|
34
|
+
or `-` characters.
|
|
35
|
+
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
from ..model import responses
|
|
39
|
+
|
|
40
|
+
result = cls._make_request(
|
|
41
|
+
_client,
|
|
42
|
+
"get",
|
|
43
|
+
"/api/v4/app-manager/app/{app_name}/get",
|
|
44
|
+
{"app_name": app_name},
|
|
45
|
+
{},
|
|
46
|
+
{},
|
|
47
|
+
{},
|
|
48
|
+
None,
|
|
49
|
+
None,
|
|
50
|
+
False,
|
|
51
|
+
{"200": responses.AppManagerAppGet, "400": None, "401": None, "404": None},
|
|
52
|
+
False,
|
|
53
|
+
_dry_run,
|
|
54
|
+
)
|
|
55
|
+
return result
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def get_app_manager_app_planner_rules(
|
|
59
|
+
cls, app_name: str, _dry_run: bool = False, _client: Any = None
|
|
60
|
+
) -> responses.AppManagerAppPlannerRulesGet:
|
|
61
|
+
"""
|
|
62
|
+
Return the Planner Rules for the specified Application.
|
|
63
|
+
|
|
64
|
+
``getAppManagerAppPlannerRules``: ``GET`` ``/api/v4/app-manager/app/{app_name}/planner-rules/get``
|
|
65
|
+
|
|
66
|
+
Parameters
|
|
67
|
+
----------
|
|
68
|
+
app_name : :obj:`str`, optional
|
|
69
|
+
Application key `name` to deploy.
|
|
70
|
+
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
from ..model import responses
|
|
74
|
+
|
|
75
|
+
result = cls._make_request(
|
|
76
|
+
_client,
|
|
77
|
+
"get",
|
|
78
|
+
"/api/v4/app-manager/app/{app_name}/planner-rules/get",
|
|
79
|
+
{"app_name": app_name},
|
|
80
|
+
{},
|
|
81
|
+
{},
|
|
82
|
+
{},
|
|
83
|
+
None,
|
|
84
|
+
None,
|
|
85
|
+
False,
|
|
86
|
+
{"200": responses.AppManagerAppPlannerRulesGet, "401": None, "404": None},
|
|
87
|
+
False,
|
|
88
|
+
_dry_run,
|
|
89
|
+
)
|
|
90
|
+
return result
|
|
91
|
+
|
|
92
|
+
@classmethod
|
|
93
|
+
def update_app_manager_app_planner_rules(
|
|
94
|
+
cls,
|
|
95
|
+
app_name: str,
|
|
96
|
+
data: Optional[Union[requests.AppManagerAppPlannerRulesUpdate, Mapping[str, Any]]] = None,
|
|
97
|
+
_dry_run: bool = False,
|
|
98
|
+
_client: Any = None,
|
|
99
|
+
**kwargs: Any,
|
|
100
|
+
) -> responses.AppManagerAppPlannerRulesUpdate:
|
|
101
|
+
"""
|
|
102
|
+
Updates the Planner Rules for the specified Application. The object in the payload is applied as a whole, not merged with the existing object.
|
|
103
|
+
|
|
104
|
+
For example if the key `cluster` is currently set, updating with a payload without that key will set it to an empty string.
|
|
105
|
+
|
|
106
|
+
``updateAppManagerAppPlannerRules``: ``POST`` ``/api/v4/app-manager/app/{app_name}/planner-rules/update``
|
|
107
|
+
|
|
108
|
+
Parameters
|
|
109
|
+
----------
|
|
110
|
+
app_name : :obj:`str`, optional
|
|
111
|
+
Application key `name` to deploy.
|
|
112
|
+
data: requests.AppManagerAppPlannerRulesUpdate, optional
|
|
113
|
+
**kwargs:
|
|
114
|
+
Extra parameters for requests.AppManagerAppPlannerRulesUpdate
|
|
115
|
+
- update_app_manager_app_planner_rules: str
|
|
116
|
+
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
from ..model import responses
|
|
120
|
+
|
|
121
|
+
result = cls._make_request(
|
|
122
|
+
_client,
|
|
123
|
+
"post",
|
|
124
|
+
"/api/v4/app-manager/app/{app_name}/planner-rules/update",
|
|
125
|
+
{"app_name": app_name},
|
|
126
|
+
{},
|
|
127
|
+
{},
|
|
128
|
+
{},
|
|
129
|
+
data,
|
|
130
|
+
"requests.AppManagerAppPlannerRulesUpdate",
|
|
131
|
+
False,
|
|
132
|
+
{"201": responses.AppManagerAppPlannerRulesUpdate, "400": None, "401": None, "404": None},
|
|
133
|
+
False,
|
|
134
|
+
_dry_run,
|
|
135
|
+
kwargs,
|
|
136
|
+
)
|
|
137
|
+
return result
|
|
138
|
+
|
|
139
|
+
@classmethod
|
|
140
|
+
def list_app_manager_app_resources(
|
|
141
|
+
cls,
|
|
142
|
+
app_name: str,
|
|
143
|
+
pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
|
|
144
|
+
page_size: Optional[int] = 10000,
|
|
145
|
+
page: Optional[int] = None,
|
|
146
|
+
next: Optional[str] = None,
|
|
147
|
+
previous: Optional[str] = None,
|
|
148
|
+
direction: Optional[Literal["asc", "desc"]] = None,
|
|
149
|
+
sort_by: Optional[Sequence[str]] = None,
|
|
150
|
+
data: Optional[Union[requests.AppManagerAppResourcesList, Mapping[str, Any]]] = None,
|
|
151
|
+
fetch: bool = True,
|
|
152
|
+
_dry_run: bool = False,
|
|
153
|
+
_client: Any = None,
|
|
154
|
+
**kwargs: Any,
|
|
155
|
+
) -> Union[List[responses.AppManagerResourceContext], responses.AppManagerAppResourcesListPaginatedResponseCursor]:
|
|
156
|
+
"""
|
|
157
|
+
Returns a list of Assets and associated information running on an Application. The list can be optionally filtered and sorted on the server before being returned.
|
|
158
|
+
|
|
159
|
+
**Permission Required:** `kelvin.permission.appmanager.read`.
|
|
160
|
+
|
|
161
|
+
``listAppManagerAppResources``: ``POST`` ``/api/v4/app-manager/app/{app_name}/resources/list``
|
|
162
|
+
|
|
163
|
+
Parameters
|
|
164
|
+
----------
|
|
165
|
+
app_name : :obj:`str`, optional
|
|
166
|
+
A filter on the list based on the Application key `name`. The filter
|
|
167
|
+
is on the full name only. All strings in the array are treated as
|
|
168
|
+
`OR`. Can only contain lowercase alphanumeric characters and `.`, `_`
|
|
169
|
+
or `-` characters.
|
|
170
|
+
pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
|
|
171
|
+
Method of pagination to use for return results where `total_items` is
|
|
172
|
+
greater than `page_size`. `cursor` and `limits` will return one `page`
|
|
173
|
+
of results, `stream` will return all results. ('limits', 'cursor',
|
|
174
|
+
'stream')
|
|
175
|
+
page_size : :obj:`int`
|
|
176
|
+
Number of objects to be returned in each page. Page size can range
|
|
177
|
+
between 1 and 1000 objects.
|
|
178
|
+
page : :obj:`int`
|
|
179
|
+
An integer for the wanted page of results. Used only with
|
|
180
|
+
`pagination_type` set as `limits`.
|
|
181
|
+
next : :obj:`str`
|
|
182
|
+
An alphanumeric string bookmark to indicate where to start for the
|
|
183
|
+
next page. Used only with `pagination_type` set as `cursor`.
|
|
184
|
+
previous : :obj:`str`
|
|
185
|
+
An alphanumeric string bookmark to indicate where to end for the
|
|
186
|
+
previous page. Used only with `pagination_type` set as `cursor`.
|
|
187
|
+
direction : :obj:`Literal['asc', 'desc']`
|
|
188
|
+
Sorting order according to the `sort_by` parameter. ('asc', 'desc')
|
|
189
|
+
sort_by : :obj:`Sequence[str]`
|
|
190
|
+
data: requests.AppManagerAppResourcesList, optional
|
|
191
|
+
**kwargs:
|
|
192
|
+
Extra parameters for requests.AppManagerAppResourcesList
|
|
193
|
+
- list_app_manager_app_resources: dict
|
|
194
|
+
|
|
195
|
+
"""
|
|
196
|
+
|
|
197
|
+
from ..model import responses
|
|
198
|
+
|
|
199
|
+
result = cls._make_request(
|
|
200
|
+
_client,
|
|
201
|
+
"post",
|
|
202
|
+
"/api/v4/app-manager/app/{app_name}/resources/list",
|
|
203
|
+
{"app_name": app_name},
|
|
204
|
+
{
|
|
205
|
+
"pagination_type": pagination_type,
|
|
206
|
+
"page_size": page_size,
|
|
207
|
+
"page": page,
|
|
208
|
+
"next": next,
|
|
209
|
+
"previous": previous,
|
|
210
|
+
"direction": direction,
|
|
211
|
+
"sort_by": sort_by,
|
|
212
|
+
},
|
|
213
|
+
{},
|
|
214
|
+
{},
|
|
215
|
+
data,
|
|
216
|
+
"requests.AppManagerAppResourcesList",
|
|
217
|
+
False,
|
|
218
|
+
{"200": responses.AppManagerAppResourcesListPaginatedResponseCursor, "400": None, "401": None},
|
|
219
|
+
False,
|
|
220
|
+
_dry_run,
|
|
221
|
+
kwargs,
|
|
222
|
+
)
|
|
223
|
+
return (
|
|
224
|
+
result.fetch("/api/v4/app-manager/app/{app_name}/resources/list", "POST", data)
|
|
225
|
+
if fetch and not _dry_run
|
|
226
|
+
else result
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
@classmethod
|
|
230
|
+
def get_app_manager_app_version_data_mapping(
|
|
231
|
+
cls,
|
|
232
|
+
app_name: str,
|
|
233
|
+
version: str,
|
|
234
|
+
data: Optional[Union[requests.AppManagerAppVersionDataMappingGet, Mapping[str, Any]]] = None,
|
|
235
|
+
_dry_run: bool = False,
|
|
236
|
+
_client: Any = None,
|
|
237
|
+
**kwargs: Any,
|
|
238
|
+
) -> responses.AppManagerAppVersionDataMappingGet:
|
|
239
|
+
"""
|
|
240
|
+
Retrieve a list of all the Input and Output mappings between an Application and the Assets and Data Streams.
|
|
241
|
+
|
|
242
|
+
**Permission Required:** `kelvin.permission.appmanager.read`.
|
|
243
|
+
|
|
244
|
+
``getAppManagerAppVersionDataMapping``: ``POST`` ``/api/v4/app-manager/app/{app_name}/v/{version}/data-mapping``
|
|
245
|
+
|
|
246
|
+
Parameters
|
|
247
|
+
----------
|
|
248
|
+
app_name : :obj:`str`, optional
|
|
249
|
+
A filter on the list based on the Application key `name`. The filter
|
|
250
|
+
is on the full name only. All strings in the array are treated as
|
|
251
|
+
`OR`. Can only contain lowercase alphanumeric characters and `.`, `_`
|
|
252
|
+
or `-` characters.
|
|
253
|
+
version : :obj:`str`, optional
|
|
254
|
+
Version of Application to check for Assets.
|
|
255
|
+
data: requests.AppManagerAppVersionDataMappingGet, optional
|
|
256
|
+
**kwargs:
|
|
257
|
+
Extra parameters for requests.AppManagerAppVersionDataMappingGet
|
|
258
|
+
- get_app_manager_app_version_data_mapping: dict
|
|
259
|
+
|
|
260
|
+
"""
|
|
261
|
+
|
|
262
|
+
from ..model import responses
|
|
263
|
+
|
|
264
|
+
result = cls._make_request(
|
|
265
|
+
_client,
|
|
266
|
+
"post",
|
|
267
|
+
"/api/v4/app-manager/app/{app_name}/v/{version}/data-mapping",
|
|
268
|
+
{"app_name": app_name, "version": version},
|
|
269
|
+
{},
|
|
270
|
+
{},
|
|
271
|
+
{},
|
|
272
|
+
data,
|
|
273
|
+
"requests.AppManagerAppVersionDataMappingGet",
|
|
274
|
+
False,
|
|
275
|
+
{"200": responses.AppManagerAppVersionDataMappingGet, "400": None, "401": None},
|
|
276
|
+
False,
|
|
277
|
+
_dry_run,
|
|
278
|
+
kwargs,
|
|
279
|
+
)
|
|
280
|
+
return result
|
|
281
|
+
|
|
282
|
+
@classmethod
|
|
283
|
+
def deploy_app_manager_app_version(
|
|
284
|
+
cls,
|
|
285
|
+
app_name: str,
|
|
286
|
+
version: str,
|
|
287
|
+
dry_run: Optional[bool] = None,
|
|
288
|
+
data: Optional[Union[requests.AppManagerAppVersionDeploy, Mapping[str, Any]]] = None,
|
|
289
|
+
_dry_run: bool = False,
|
|
290
|
+
_client: Any = None,
|
|
291
|
+
**kwargs: Any,
|
|
292
|
+
) -> responses.AppManagerAppVersionDeploy:
|
|
293
|
+
"""
|
|
294
|
+
Deploy an Application to an edge or cloud Cluster.
|
|
295
|
+
|
|
296
|
+
**Permission Required:** `kelvin.permission.appmanager.create`.
|
|
297
|
+
|
|
298
|
+
``deployAppManagerAppVersion``: ``POST`` ``/api/v4/app-manager/app/{app_name}/v/{version}/deploy``
|
|
299
|
+
|
|
300
|
+
Parameters
|
|
301
|
+
----------
|
|
302
|
+
app_name : :obj:`str`, optional
|
|
303
|
+
Application key `name` to deploy.
|
|
304
|
+
version : :obj:`str`, optional
|
|
305
|
+
Version of Application to deploy.
|
|
306
|
+
dry_run : :obj:`bool`
|
|
307
|
+
Executes a simulated run when set to true, providing feedback without
|
|
308
|
+
altering server data.
|
|
309
|
+
data: requests.AppManagerAppVersionDeploy, optional
|
|
310
|
+
**kwargs:
|
|
311
|
+
Extra parameters for requests.AppManagerAppVersionDeploy
|
|
312
|
+
- deploy_app_manager_app_version: dict
|
|
313
|
+
|
|
314
|
+
"""
|
|
315
|
+
|
|
316
|
+
from ..model import responses
|
|
317
|
+
|
|
318
|
+
result = cls._make_request(
|
|
319
|
+
_client,
|
|
320
|
+
"post",
|
|
321
|
+
"/api/v4/app-manager/app/{app_name}/v/{version}/deploy",
|
|
322
|
+
{"app_name": app_name, "version": version},
|
|
323
|
+
{"dry_run": dry_run},
|
|
324
|
+
{},
|
|
325
|
+
{},
|
|
326
|
+
data,
|
|
327
|
+
"requests.AppManagerAppVersionDeploy",
|
|
328
|
+
False,
|
|
329
|
+
{
|
|
330
|
+
"201": responses.AppManagerAppVersionDeploy,
|
|
331
|
+
"207": responses.AppManagerAppVersionDeploy,
|
|
332
|
+
"400": None,
|
|
333
|
+
"401": None,
|
|
334
|
+
},
|
|
335
|
+
False,
|
|
336
|
+
_dry_run,
|
|
337
|
+
kwargs,
|
|
338
|
+
)
|
|
339
|
+
return result
|
|
340
|
+
|
|
341
|
+
@classmethod
|
|
342
|
+
def start_app_manager_app_version(
|
|
343
|
+
cls,
|
|
344
|
+
app_name: str,
|
|
345
|
+
version: str,
|
|
346
|
+
data: Optional[Union[requests.AppManagerAppVersionStart, Mapping[str, Any]]] = None,
|
|
347
|
+
_dry_run: bool = False,
|
|
348
|
+
_client: Any = None,
|
|
349
|
+
**kwargs: Any,
|
|
350
|
+
) -> None:
|
|
351
|
+
"""
|
|
352
|
+
Start running the Asset(s) associated with the Application Version. This API request allows batch starting of multiple Assets for a given Application.
|
|
353
|
+
|
|
354
|
+
**Permission Required:** `kelvin.permission.appmanager.update`.
|
|
355
|
+
|
|
356
|
+
``startAppManagerAppVersion``: ``POST`` ``/api/v4/app-manager/app/{app_name}/v/{version}/start``
|
|
357
|
+
|
|
358
|
+
Parameters
|
|
359
|
+
----------
|
|
360
|
+
app_name : :obj:`str`, optional
|
|
361
|
+
Application key `name` to associate with Assets (resources) to perform
|
|
362
|
+
the required actions.
|
|
363
|
+
version : :obj:`str`, optional
|
|
364
|
+
Version of Application.
|
|
365
|
+
data: requests.AppManagerAppVersionStart, optional
|
|
366
|
+
**kwargs:
|
|
367
|
+
Extra parameters for requests.AppManagerAppVersionStart
|
|
368
|
+
- start_app_manager_app_version: str
|
|
369
|
+
|
|
370
|
+
"""
|
|
371
|
+
|
|
372
|
+
result = cls._make_request(
|
|
373
|
+
_client,
|
|
374
|
+
"post",
|
|
375
|
+
"/api/v4/app-manager/app/{app_name}/v/{version}/start",
|
|
376
|
+
{"app_name": app_name, "version": version},
|
|
377
|
+
{},
|
|
378
|
+
{},
|
|
379
|
+
{},
|
|
380
|
+
data,
|
|
381
|
+
"requests.AppManagerAppVersionStart",
|
|
382
|
+
False,
|
|
383
|
+
{"200": None, "207": None, "400": None, "401": None},
|
|
384
|
+
False,
|
|
385
|
+
_dry_run,
|
|
386
|
+
kwargs,
|
|
387
|
+
)
|
|
388
|
+
return result
|
|
389
|
+
|
|
390
|
+
@classmethod
|
|
391
|
+
def stop_app_manager_app_version(
|
|
392
|
+
cls,
|
|
393
|
+
app_name: str,
|
|
394
|
+
version: str,
|
|
395
|
+
data: Optional[Union[requests.AppManagerAppVersionStop, Mapping[str, Any]]] = None,
|
|
396
|
+
_dry_run: bool = False,
|
|
397
|
+
_client: Any = None,
|
|
398
|
+
**kwargs: Any,
|
|
399
|
+
) -> None:
|
|
400
|
+
"""
|
|
401
|
+
Stop running the Asset(s) associated with the Application Version. This API request allows batch starting of multiple Assets for a given Application.
|
|
402
|
+
|
|
403
|
+
**Permission Required:** `kelvin.permission.appmanager.update`.
|
|
404
|
+
|
|
405
|
+
``stopAppManagerAppVersion``: ``POST`` ``/api/v4/app-manager/app/{app_name}/v/{version}/stop``
|
|
406
|
+
|
|
407
|
+
Parameters
|
|
408
|
+
----------
|
|
409
|
+
app_name : :obj:`str`, optional
|
|
410
|
+
Application key `name` to associate with Assets (resources) to perform
|
|
411
|
+
the required actions.
|
|
412
|
+
version : :obj:`str`, optional
|
|
413
|
+
Version of Application.
|
|
414
|
+
data: requests.AppManagerAppVersionStop, optional
|
|
415
|
+
**kwargs:
|
|
416
|
+
Extra parameters for requests.AppManagerAppVersionStop
|
|
417
|
+
- stop_app_manager_app_version: str
|
|
418
|
+
|
|
419
|
+
"""
|
|
420
|
+
|
|
421
|
+
result = cls._make_request(
|
|
422
|
+
_client,
|
|
423
|
+
"post",
|
|
424
|
+
"/api/v4/app-manager/app/{app_name}/v/{version}/stop",
|
|
425
|
+
{"app_name": app_name, "version": version},
|
|
426
|
+
{},
|
|
427
|
+
{},
|
|
428
|
+
{},
|
|
429
|
+
data,
|
|
430
|
+
"requests.AppManagerAppVersionStop",
|
|
431
|
+
False,
|
|
432
|
+
{"200": None, "207": None, "400": None, "401": None},
|
|
433
|
+
False,
|
|
434
|
+
_dry_run,
|
|
435
|
+
kwargs,
|
|
436
|
+
)
|
|
437
|
+
return result
|
|
438
|
+
|
|
439
|
+
@classmethod
|
|
440
|
+
def undeploy_app_manager_app_version(
|
|
441
|
+
cls,
|
|
442
|
+
app_name: str,
|
|
443
|
+
version: str,
|
|
444
|
+
data: Optional[Union[requests.AppManagerAppVersionUndeploy, Mapping[str, Any]]] = None,
|
|
445
|
+
_dry_run: bool = False,
|
|
446
|
+
_client: Any = None,
|
|
447
|
+
**kwargs: Any,
|
|
448
|
+
) -> None:
|
|
449
|
+
"""
|
|
450
|
+
Undeploy (remove) an Application from an edge or cloud Cluster. This will only remove the specified version.
|
|
451
|
+
|
|
452
|
+
**Permission Required:** `kelvin.permission.appmanager.delete`.
|
|
453
|
+
|
|
454
|
+
``undeployAppManagerAppVersion``: ``POST`` ``/api/v4/app-manager/app/{app_name}/v/{version}/undeploy``
|
|
455
|
+
|
|
456
|
+
Parameters
|
|
457
|
+
----------
|
|
458
|
+
app_name : :obj:`str`, optional
|
|
459
|
+
Application key `name` to associate with Assets (resources) to perform
|
|
460
|
+
the required actions.
|
|
461
|
+
version : :obj:`str`, optional
|
|
462
|
+
Version of Application.
|
|
463
|
+
data: requests.AppManagerAppVersionUndeploy, optional
|
|
464
|
+
**kwargs:
|
|
465
|
+
Extra parameters for requests.AppManagerAppVersionUndeploy
|
|
466
|
+
- undeploy_app_manager_app_version: str
|
|
467
|
+
|
|
468
|
+
"""
|
|
469
|
+
|
|
470
|
+
result = cls._make_request(
|
|
471
|
+
_client,
|
|
472
|
+
"post",
|
|
473
|
+
"/api/v4/app-manager/app/{app_name}/v/{version}/undeploy",
|
|
474
|
+
{"app_name": app_name, "version": version},
|
|
475
|
+
{},
|
|
476
|
+
{},
|
|
477
|
+
{},
|
|
478
|
+
data,
|
|
479
|
+
"requests.AppManagerAppVersionUndeploy",
|
|
480
|
+
False,
|
|
481
|
+
{"200": None, "207": None, "400": None, "401": None},
|
|
482
|
+
False,
|
|
483
|
+
_dry_run,
|
|
484
|
+
kwargs,
|
|
485
|
+
)
|
|
486
|
+
return result
|
|
487
|
+
|
|
488
|
+
@classmethod
|
|
489
|
+
def list_app_manager(
|
|
490
|
+
cls,
|
|
491
|
+
pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
|
|
492
|
+
page_size: Optional[int] = 10000,
|
|
493
|
+
page: Optional[int] = None,
|
|
494
|
+
next: Optional[str] = None,
|
|
495
|
+
previous: Optional[str] = None,
|
|
496
|
+
direction: Optional[Literal["asc", "desc"]] = None,
|
|
497
|
+
sort_by: Optional[Sequence[str]] = None,
|
|
498
|
+
data: Optional[Union[requests.AppManagerList, Mapping[str, Any]]] = None,
|
|
499
|
+
fetch: bool = True,
|
|
500
|
+
_dry_run: bool = False,
|
|
501
|
+
_client: Any = None,
|
|
502
|
+
**kwargs: Any,
|
|
503
|
+
) -> Union[List[type.AppManagerApp], responses.AppManagerListPaginatedResponseCursor]:
|
|
504
|
+
"""
|
|
505
|
+
Returns a list of Application objects. The list can be optionally filtered and sorted on the server before being returned.
|
|
506
|
+
|
|
507
|
+
**Permission Required:** `kelvin.permission.appmanager.read`.
|
|
508
|
+
|
|
509
|
+
``listAppManager``: ``POST`` ``/api/v4/app-manager/list``
|
|
510
|
+
|
|
511
|
+
Parameters
|
|
512
|
+
----------
|
|
513
|
+
pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
|
|
514
|
+
Method of pagination to use for return results where `total_items` is
|
|
515
|
+
greater than `page_size`. `cursor` and `limits` will return one `page`
|
|
516
|
+
of results, `stream` will return all results. ('limits', 'cursor',
|
|
517
|
+
'stream')
|
|
518
|
+
page_size : :obj:`int`
|
|
519
|
+
Number of objects to be returned in each page. Page size can range
|
|
520
|
+
between 1 and 1000 objects.
|
|
521
|
+
page : :obj:`int`
|
|
522
|
+
An integer for the wanted page of results. Used only with
|
|
523
|
+
`pagination_type` set as `limits`.
|
|
524
|
+
next : :obj:`str`
|
|
525
|
+
An alphanumeric string bookmark to indicate where to start for the
|
|
526
|
+
next page. Used only with `pagination_type` set as `cursor`.
|
|
527
|
+
previous : :obj:`str`
|
|
528
|
+
An alphanumeric string bookmark to indicate where to end for the
|
|
529
|
+
previous page. Used only with `pagination_type` set as `cursor`.
|
|
530
|
+
direction : :obj:`Literal['asc', 'desc']`
|
|
531
|
+
Sorting order according to the `sort_by` parameter. ('asc', 'desc')
|
|
532
|
+
sort_by : :obj:`Sequence[str]`
|
|
533
|
+
data: requests.AppManagerList, optional
|
|
534
|
+
**kwargs:
|
|
535
|
+
Extra parameters for requests.AppManagerList
|
|
536
|
+
- list_app_manager: dict
|
|
537
|
+
|
|
538
|
+
"""
|
|
539
|
+
|
|
540
|
+
from ..model import responses
|
|
541
|
+
|
|
542
|
+
result = cls._make_request(
|
|
543
|
+
_client,
|
|
544
|
+
"post",
|
|
545
|
+
"/api/v4/app-manager/list",
|
|
546
|
+
{},
|
|
547
|
+
{
|
|
548
|
+
"pagination_type": pagination_type,
|
|
549
|
+
"page_size": page_size,
|
|
550
|
+
"page": page,
|
|
551
|
+
"next": next,
|
|
552
|
+
"previous": previous,
|
|
553
|
+
"direction": direction,
|
|
554
|
+
"sort_by": sort_by,
|
|
555
|
+
},
|
|
556
|
+
{},
|
|
557
|
+
{},
|
|
558
|
+
data,
|
|
559
|
+
"requests.AppManagerList",
|
|
560
|
+
False,
|
|
561
|
+
{"200": responses.AppManagerListPaginatedResponseCursor, "400": None, "401": None},
|
|
562
|
+
False,
|
|
563
|
+
_dry_run,
|
|
564
|
+
kwargs,
|
|
565
|
+
)
|
|
566
|
+
return result.fetch("/api/v4/app-manager/list", "POST", data) if fetch and not _dry_run else result
|
|
567
|
+
|
|
568
|
+
@classmethod
|
|
569
|
+
def get_app_manager_resource(
|
|
570
|
+
cls,
|
|
571
|
+
resource_krn: str,
|
|
572
|
+
pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
|
|
573
|
+
page_size: Optional[int] = 10000,
|
|
574
|
+
page: Optional[int] = None,
|
|
575
|
+
next: Optional[str] = None,
|
|
576
|
+
previous: Optional[str] = None,
|
|
577
|
+
direction: Optional[Literal["asc", "desc"]] = None,
|
|
578
|
+
sort_by: Optional[Literal["name", "title", "description", "version"]] = None,
|
|
579
|
+
fetch: bool = True,
|
|
580
|
+
_dry_run: bool = False,
|
|
581
|
+
_client: Any = None,
|
|
582
|
+
) -> Union[List[type.AppManagerAppVersionSummary], responses.AppManagerResourceGetPaginatedResponseCursor]:
|
|
583
|
+
"""
|
|
584
|
+
Returns a list of all Applications associated with an Asset (`resource`).
|
|
585
|
+
|
|
586
|
+
**Permission Required:** `kelvin.permission.appmanager.read`.
|
|
587
|
+
|
|
588
|
+
``getAppManagerResource``: ``GET`` ``/api/v4/app-manager/resource/{resource_krn}/get``
|
|
589
|
+
|
|
590
|
+
Parameters
|
|
591
|
+
----------
|
|
592
|
+
resource_krn : :obj:`str`, optional
|
|
593
|
+
The Asset (`resource`) entered as a KRN value.
|
|
594
|
+
pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
|
|
595
|
+
Method of pagination to use for return results where `total_items` is
|
|
596
|
+
greater than `page_size`. `cursor` and `limits` will return one `page`
|
|
597
|
+
of results, `stream` will return all results. ('limits', 'cursor',
|
|
598
|
+
'stream')
|
|
599
|
+
page_size : :obj:`int`
|
|
600
|
+
Number of objects to be returned in each page. Page size can range
|
|
601
|
+
between 1 and 1000 objects.
|
|
602
|
+
page : :obj:`int`
|
|
603
|
+
An integer for the wanted page of results. Used only with
|
|
604
|
+
`pagination_type` set as `limits`.
|
|
605
|
+
next : :obj:`str`
|
|
606
|
+
An alphanumeric string bookmark to indicate where to start for the
|
|
607
|
+
next page. Used only with `pagination_type` set as `cursor`.
|
|
608
|
+
previous : :obj:`str`
|
|
609
|
+
An alphanumeric string bookmark to indicate where to end for the
|
|
610
|
+
previous page. Used only with `pagination_type` set as `cursor`.
|
|
611
|
+
direction : :obj:`Literal['asc', 'desc']`
|
|
612
|
+
Sorting order according to the `sort_by` parameter. ('asc', 'desc')
|
|
613
|
+
sort_by : :obj:`Literal['name', 'title', 'description', 'version']`
|
|
614
|
+
Sort the results by one or more enumerators. ('name', 'title',
|
|
615
|
+
'description', 'version')
|
|
616
|
+
|
|
617
|
+
"""
|
|
618
|
+
|
|
619
|
+
from ..model import responses
|
|
620
|
+
|
|
621
|
+
result = cls._make_request(
|
|
622
|
+
_client,
|
|
623
|
+
"get",
|
|
624
|
+
"/api/v4/app-manager/resource/{resource_krn}/get",
|
|
625
|
+
{"resource_krn": resource_krn},
|
|
626
|
+
{
|
|
627
|
+
"pagination_type": pagination_type,
|
|
628
|
+
"page_size": page_size,
|
|
629
|
+
"page": page,
|
|
630
|
+
"next": next,
|
|
631
|
+
"previous": previous,
|
|
632
|
+
"direction": direction,
|
|
633
|
+
"sort_by": sort_by,
|
|
634
|
+
},
|
|
635
|
+
{},
|
|
636
|
+
{},
|
|
637
|
+
None,
|
|
638
|
+
None,
|
|
639
|
+
False,
|
|
640
|
+
{"200": responses.AppManagerResourceGetPaginatedResponseCursor, "400": None, "401": None, "404": None},
|
|
641
|
+
False,
|
|
642
|
+
_dry_run,
|
|
643
|
+
)
|
|
644
|
+
return (
|
|
645
|
+
result.fetch("/api/v4/app-manager/resource/{resource_krn}/get", "GET") if fetch and not _dry_run else result
|
|
646
|
+
)
|