malevich-coretools 0.3.61__tar.gz → 0.3.63__tar.gz

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.

Potentially problematic release.


This version of malevich-coretools might be problematic. Click here for more details.

Files changed (39) hide show
  1. {malevich_coretools-0.3.61/malevich_coretools.egg-info → malevich_coretools-0.3.63}/PKG-INFO +1 -1
  2. malevich_coretools-0.3.63/VERSION +1 -0
  3. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/abstract/abstract.py +20 -5
  4. malevich_coretools-0.3.63/malevich_coretools/admin/utils.py +374 -0
  5. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/funcs/funcs.py +18 -2
  6. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/funcs/helpers.py +2 -10
  7. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/secondary/const.py +1 -0
  8. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/secondary/helpers.py +1 -1
  9. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/utils.py +14 -5
  10. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63/malevich_coretools.egg-info}/PKG-INFO +1 -1
  11. malevich_coretools-0.3.61/VERSION +0 -1
  12. malevich_coretools-0.3.61/malevich_coretools/admin/utils.py +0 -99
  13. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/LICENSE +0 -0
  14. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/MANIFEST.in +0 -0
  15. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/README.md +0 -0
  16. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/__init__.py +0 -0
  17. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/abstract/__init__.py +0 -0
  18. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/abstract/operations.py +0 -0
  19. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/abstract/pipeline.py +0 -0
  20. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/abstract/statuses.py +0 -0
  21. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/admin/__init__.py +0 -0
  22. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/batch/__init__.py +0 -0
  23. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/batch/utils.py +0 -0
  24. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/funcs/__init__.py +0 -0
  25. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/funcs/checks.py +0 -0
  26. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/secondary/__init__.py +0 -0
  27. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/secondary/config.py +0 -0
  28. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/secondary/kafka_utils.py +0 -0
  29. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/tools/__init__.py +0 -0
  30. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/tools/abstract.py +0 -0
  31. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools/tools/vast.py +0 -0
  32. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools.egg-info/SOURCES.txt +0 -0
  33. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools.egg-info/dependency_links.txt +0 -0
  34. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools.egg-info/requires.txt +0 -0
  35. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/malevich_coretools.egg-info/top_level.txt +0 -0
  36. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/pyproject.toml +0 -0
  37. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/requirements.txt +0 -0
  38. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/setup.cfg +0 -0
  39. {malevich_coretools-0.3.61 → malevich_coretools-0.3.63}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: malevich-coretools
3
- Version: 0.3.61
3
+ Version: 0.3.63
4
4
  Author: Andrew Pogrebnoj
5
5
  Author-email: andrew@onjulius.co
6
6
  License-File: LICENSE
@@ -0,0 +1 @@
1
+ 0.3.63
@@ -101,6 +101,7 @@ class JsonImage(BaseModel):
101
101
  tag: str = ""
102
102
  user: Optional[str] = None
103
103
  token: Optional[str] = None
104
+ syncRef: bool = True
104
105
 
105
106
 
106
107
  class UserApp(BaseModel):
@@ -139,12 +140,8 @@ class ScaleInfo(BaseModel):
139
140
 
140
141
 
141
142
  class TaskComponent(BaseModel):
142
- appControl: Optional[str] = None
143
- control: Optional[str] = None
144
- extra: Optional[str] = None
145
- internal: Optional[str] = None
143
+ main: Optional[str] = None
146
144
  keyValue: Optional[str] = None
147
- minimal: Optional[str] = None
148
145
  objectStorage: Optional[str] = None
149
146
 
150
147
 
@@ -504,6 +501,24 @@ class OperationOrNone(BaseModel):
504
501
  operationId: Optional[Alias.Id] = None
505
502
 
506
503
 
504
+ class AdminRunInfoReq(OperationOrNone):
505
+ dmId: Optional[str] = None
506
+
507
+
508
+ class AdminDMRegister(BaseModel):
509
+ id: int
510
+ url: Optional[str]
511
+ secret: Optional[str]
512
+ appSecret: Optional[str]
513
+ login: Optional[str]
514
+ actuaryDMId: Optional[int]
515
+
516
+
517
+ class AdminDMUnregister(BaseModel):
518
+ id: str
519
+ actuaryDMId: Optional[int]
520
+
521
+
507
522
  class AdminStopOperation(BaseModel):
508
523
  operationId: Optional[Alias.Id] = None
509
524
  withLogs: bool
@@ -0,0 +1,374 @@
1
+ from typing import Coroutine, Literal, Union, overload
2
+
3
+ import malevich_coretools.funcs.funcs as f
4
+ from malevich_coretools.abstract import * # noqa: F403
5
+ from malevich_coretools.batch import Batcher
6
+ from malevich_coretools.secondary import Config
7
+
8
+
9
+ @overload
10
+ def admin_get_runs(
11
+ *,
12
+ auth: Optional[AUTH] = None,
13
+ conn_url: Optional[str] = None,
14
+ batcher: Optional[Batcher] = None,
15
+ is_async: Literal[False] = False,
16
+ ) -> AdminRunsInfo:
17
+ pass
18
+
19
+
20
+ @overload
21
+ def admin_get_runs(
22
+ *,
23
+ auth: Optional[AUTH] = None,
24
+ conn_url: Optional[str] = None,
25
+ batcher: Optional[Batcher] = None,
26
+ is_async: Literal[True],
27
+ ) -> Coroutine[Any, Any, AdminRunsInfo]:
28
+ pass
29
+
30
+
31
+ def admin_get_runs(
32
+ *,
33
+ auth: Optional[AUTH] = None,
34
+ conn_url: Optional[str] = None,
35
+ batcher: Optional[Batcher] = None,
36
+ is_async: bool = False,
37
+ ) -> Union[AdminRunsInfo, Coroutine[Any, Any, AdminRunsInfo]]:
38
+ """return info about all runs"""
39
+ if batcher is None:
40
+ batcher = Config.BATCHER
41
+ if batcher is not None:
42
+ return batcher.add("getAllRuns", result_model=AdminRunsInfo)
43
+ if is_async:
44
+ return f.get_admin_runs_async(auth=auth, conn_url=conn_url)
45
+ return f.get_admin_runs(auth=auth, conn_url=conn_url)
46
+
47
+
48
+ @overload
49
+ def admin_get_run_info(
50
+ id: Alias.Id,
51
+ *,
52
+ dm_id: Optional[str] = None,
53
+ auth: Optional[AUTH] = None,
54
+ conn_url: Optional[str] = None,
55
+ batcher: Optional[Batcher] = None,
56
+ is_async: Literal[False] = False,
57
+ ) -> Alias.Json:
58
+ pass
59
+
60
+
61
+ @overload
62
+ def admin_get_run_info(
63
+ id: Alias.Id,
64
+ *,
65
+ dm_id: Optional[str] = None,
66
+ auth: Optional[AUTH] = None,
67
+ conn_url: Optional[str] = None,
68
+ batcher: Optional[Batcher] = None,
69
+ is_async: Literal[True],
70
+ ) -> Coroutine[Any, Any, Alias.Json]:
71
+ pass
72
+
73
+
74
+ def admin_get_run_info(
75
+ id: Alias.Id,
76
+ *,
77
+ dm_id: Optional[str] = None,
78
+ auth: Optional[AUTH] = None,
79
+ conn_url: Optional[str] = None,
80
+ batcher: Optional[Batcher] = None,
81
+ is_async: bool = False,
82
+ ) -> Union[Alias.Json, Coroutine[Any, Any, Alias.Json]]:
83
+ """return run info by operation `id`"""
84
+ if batcher is None:
85
+ batcher = Config.BATCHER
86
+ data = AdminRunInfoReq(operationId=id, dmId=dm_id)
87
+ if batcher is not None:
88
+ return batcher.add("getRunInfo", data=data)
89
+ if is_async:
90
+ return f.get_admin_runs_info_async(data, auth=auth, conn_url=conn_url)
91
+ return f.get_admin_runs_info(data, auth=auth, conn_url=conn_url)
92
+
93
+
94
+ @overload
95
+ def admin_get_runs_info(
96
+ *,
97
+ dm_id: Optional[str] = None,
98
+ auth: Optional[AUTH] = None,
99
+ conn_url: Optional[str] = None,
100
+ batcher: Optional[Batcher] = None,
101
+ is_async: Literal[False] = False,
102
+ ) -> Alias.Json:
103
+ pass
104
+
105
+
106
+ @overload
107
+ def admin_get_runs_info(
108
+ *,
109
+ dm_id: Optional[str] = None,
110
+ auth: Optional[AUTH] = None,
111
+ conn_url: Optional[str] = None,
112
+ batcher: Optional[Batcher] = None,
113
+ is_async: Literal[True],
114
+ ) -> Coroutine[Any, Any, Alias.Json]:
115
+ pass
116
+
117
+
118
+ def admin_get_runs_info(
119
+ *,
120
+ dm_id: Optional[str] = None,
121
+ auth: Optional[AUTH] = None,
122
+ conn_url: Optional[str] = None,
123
+ batcher: Optional[Batcher] = None,
124
+ is_async: bool = False,
125
+ ) -> Union[Alias.Json, Coroutine[Any, Any, Alias.Json]]:
126
+ """return json: dm id -> info about its runs"""
127
+ if batcher is None:
128
+ batcher = Config.BATCHER
129
+ data = AdminRunInfoReq(dmId=dm_id)
130
+ if batcher is not None:
131
+ return batcher.add("getRunInfo", data=data)
132
+ if is_async:
133
+ return f.get_admin_runs_info_async(data, auth=auth, conn_url=conn_url)
134
+ return f.get_admin_runs_info(data, auth=auth, conn_url=conn_url)
135
+
136
+
137
+ @overload
138
+ def admin_dm_register(
139
+ id: Optional[int] = None,
140
+ url: Optional[str] = None,
141
+ secret: Optional[str] = None,
142
+ app_secret: Optional[str] = None,
143
+ login: Optional[str] = None,
144
+ actuary_dm_id: Optional[int] = None,
145
+ *,
146
+ auth: Optional[AUTH] = None,
147
+ conn_url: Optional[str] = None,
148
+ batcher: Optional[Batcher] = None,
149
+ is_async: Literal[False] = False,
150
+ ) -> None:
151
+ pass
152
+
153
+
154
+ @overload
155
+ def admin_dm_register(
156
+ id: Optional[int] = None,
157
+ url: Optional[str] = None,
158
+ secret: Optional[str] = None,
159
+ app_secret: Optional[str] = None,
160
+ login: Optional[str] = None,
161
+ actuary_dm_id: Optional[int] = None,
162
+ *,
163
+ auth: Optional[AUTH] = None,
164
+ conn_url: Optional[str] = None,
165
+ batcher: Optional[Batcher] = None,
166
+ is_async: Literal[True],
167
+ ) -> Coroutine[Any, Any, None]:
168
+ pass
169
+
170
+
171
+ def admin_dm_register(
172
+ id: Optional[int] = None,
173
+ url: Optional[str] = None,
174
+ secret: Optional[str] = None,
175
+ app_secret: Optional[str] = None,
176
+ login: Optional[str] = None,
177
+ actuary_dm_id: Optional[int] = None,
178
+ *,
179
+ auth: Optional[AUTH] = None,
180
+ conn_url: Optional[str] = None,
181
+ batcher: Optional[Batcher] = None,
182
+ is_async: bool = False,
183
+ ) -> Union[None, Coroutine[Any, Any, None]]:
184
+ assert id is not None or (url is not None and secret is not None and app_secret is not None and login is not None), "id or url & secret & app_secret & login should set"
185
+ if batcher is None:
186
+ batcher = Config.BATCHER
187
+ data = AdminDMRegister(id=id, url=url, secret=secret, appSecret=app_secret, login=login, actuaryDMId=actuary_dm_id)
188
+ if batcher is not None:
189
+ return batcher.add("postDMRegister", data=data)
190
+ if is_async:
191
+ return f.post_admin_dm_register_async(data, auth=auth, conn_url=conn_url)
192
+ return f.post_admin_dm_register(data, auth=auth, conn_url=conn_url)
193
+
194
+
195
+ @overload
196
+ def admin_dm_unregister(
197
+ id: Union[str, int] = 0,
198
+ actuary_dm_id: Optional[int] = None,
199
+ *,
200
+ auth: Optional[AUTH] = None,
201
+ conn_url: Optional[str] = None,
202
+ batcher: Optional[Batcher] = None,
203
+ is_async: Literal[False] = False,
204
+ ) -> None:
205
+ pass
206
+
207
+
208
+ @overload
209
+ def admin_dm_unregister(
210
+ id: Union[str, int] = 0,
211
+ actuary_dm_id: Optional[int] = None,
212
+ *,
213
+ auth: Optional[AUTH] = None,
214
+ conn_url: Optional[str] = None,
215
+ batcher: Optional[Batcher] = None,
216
+ is_async: Literal[True],
217
+ ) -> Coroutine[Any, Any, None]:
218
+ pass
219
+
220
+
221
+ def admin_dm_unregister(
222
+ id: Union[str, int] = 0, # id or login
223
+ actuary_dm_id: Optional[int] = None,
224
+ *,
225
+ auth: Optional[AUTH] = None,
226
+ conn_url: Optional[str] = None,
227
+ batcher: Optional[Batcher] = None,
228
+ is_async: bool = False,
229
+ ) -> Union[None, Coroutine[Any, Any, None]]:
230
+ if isinstance(id, int):
231
+ id = f'{id:05d}'
232
+ if batcher is None:
233
+ batcher = Config.BATCHER
234
+ data = AdminDMUnregister(id=id, actuaryDMId=actuary_dm_id)
235
+ if batcher is not None:
236
+ return batcher.add("deleteDMRegister", data=data)
237
+ if is_async:
238
+ return f.delete_admin_dm_register_async(data, auth=auth, conn_url=conn_url)
239
+ return f.delete_admin_dm_register(data, auth=auth, conn_url=conn_url)
240
+
241
+
242
+ @overload
243
+ def admin_update_superuser(
244
+ login: str,
245
+ is_superuser: bool = True,
246
+ *,
247
+ auth: Optional[AUTH] = None,
248
+ conn_url: Optional[str] = None,
249
+ batcher: Optional[Batcher] = None,
250
+ is_async: Literal[False] = False,
251
+ ) -> Alias.Info:
252
+ pass
253
+
254
+
255
+ @overload
256
+ def admin_update_superuser(
257
+ login: str,
258
+ is_superuser: bool = True,
259
+ *,
260
+ auth: Optional[AUTH] = None,
261
+ conn_url: Optional[str] = None,
262
+ batcher: Optional[Batcher] = None,
263
+ is_async: Literal[True],
264
+ ) -> Coroutine[Any, Any, Alias.Info]:
265
+ pass
266
+
267
+
268
+ def admin_update_superuser(
269
+ login: str,
270
+ is_superuser: bool = True,
271
+ *,
272
+ auth: Optional[AUTH] = None,
273
+ conn_url: Optional[str] = None,
274
+ batcher: Optional[Batcher] = None,
275
+ is_async: bool = False,
276
+ ) -> Union[Alias.Info, Coroutine[Any, Any, Alias.Info]]:
277
+ """update user role by login"""
278
+ if batcher is None:
279
+ batcher = Config.BATCHER
280
+ data = Superuser(login=login, isSuperuser=is_superuser)
281
+ if batcher is not None:
282
+ return batcher.add("postUpdateSuperuser", data=data)
283
+ if is_async:
284
+ return f.post_admin_update_superuser_async(data, auth=auth, conn_url=conn_url)
285
+ return f.post_admin_update_superuser(data, auth=auth, conn_url=conn_url)
286
+
287
+
288
+ @overload
289
+ def admin_delete_run(
290
+ id: Alias.Id,
291
+ withLogs: bool = False,
292
+ *,
293
+ auth: Optional[AUTH] = None,
294
+ conn_url: Optional[str] = None,
295
+ batcher: Optional[Batcher] = None,
296
+ is_async: Literal[False] = False,
297
+ ) -> Alias.Json:
298
+ pass
299
+
300
+
301
+ @overload
302
+ def admin_delete_run(
303
+ id: Alias.Id,
304
+ withLogs: bool = False,
305
+ *,
306
+ auth: Optional[AUTH] = None,
307
+ conn_url: Optional[str] = None,
308
+ batcher: Optional[Batcher] = None,
309
+ is_async: Literal[True],
310
+ ) -> Coroutine[Any, Any, Alias.Json]:
311
+ pass
312
+
313
+
314
+ def admin_delete_run(
315
+ id: Alias.Id,
316
+ withLogs: bool = False,
317
+ *,
318
+ auth: Optional[AUTH] = None,
319
+ conn_url: Optional[str] = None,
320
+ batcher: Optional[Batcher] = None,
321
+ is_async: bool = False,
322
+ ) -> Union[Alias.Json, Coroutine[Any, Any, Alias.Json]]:
323
+ """delete run by operation `id`"""
324
+ if batcher is None:
325
+ batcher = Config.BATCHER
326
+ data = AdminStopOperation(operationId=id, withLogs=withLogs)
327
+ if batcher is not None:
328
+ return batcher.add("deleteRuns", data=data)
329
+ if is_async:
330
+ return f.delete_admin_runs_async(data, auth=auth, conn_url=conn_url)
331
+ return f.delete_admin_runs(data, auth=auth, conn_url=conn_url)
332
+
333
+
334
+ @overload
335
+ def admin_delete_runs(
336
+ withLogs: bool = False,
337
+ *,
338
+ auth: Optional[AUTH] = None,
339
+ conn_url: Optional[str] = None,
340
+ batcher: Optional[Batcher] = None,
341
+ is_async: Literal[False] = False,
342
+ ) -> Alias.Json:
343
+ pass
344
+
345
+
346
+ @overload
347
+ def admin_delete_runs(
348
+ withLogs: bool = False,
349
+ *,
350
+ auth: Optional[AUTH] = None,
351
+ conn_url: Optional[str] = None,
352
+ batcher: Optional[Batcher] = None,
353
+ is_async: Literal[True],
354
+ ) -> Coroutine[Any, Any, Alias.Json]:
355
+ pass
356
+
357
+
358
+ def admin_delete_runs(
359
+ withLogs: bool = False,
360
+ *,
361
+ auth: Optional[AUTH] = None,
362
+ conn_url: Optional[str] = None,
363
+ batcher: Optional[Batcher] = None,
364
+ is_async: bool = False,
365
+ ) -> Union[Alias.Json, Coroutine[Any, Any, Alias.Json]]:
366
+ """delete all runs"""
367
+ if batcher is None:
368
+ batcher = Config.BATCHER
369
+ data = AdminStopOperation(withLogs=withLogs)
370
+ if batcher is not None:
371
+ return batcher.add("deleteRuns", data=data)
372
+ if is_async:
373
+ return f.delete_admin_runs_async(data, auth=auth, conn_url=conn_url)
374
+ return f.delete_admin_runs(data, auth=auth, conn_url=conn_url)
@@ -1114,14 +1114,30 @@ async def get_admin_runs_async(*args, **kwargs) -> AdminRunsInfo:
1114
1114
  return model_from_json(await send_to_core_get_async(ADMIN_RUNS, *args, **kwargs), AdminRunsInfo)
1115
1115
 
1116
1116
 
1117
- def get_admin_runs_info(data: OperationOrNone, *args, **kwargs) -> Alias.Json:
1117
+ def get_admin_runs_info(data: AdminRunInfoReq, *args, **kwargs) -> Alias.Json:
1118
1118
  return send_to_core_modify(ADMIN_RUNS_INFO, data, *args, **kwargs)
1119
1119
 
1120
1120
 
1121
- async def get_admin_runs_info_async(data: OperationOrNone, *args, **kwargs) -> Alias.Json:
1121
+ async def get_admin_runs_info_async(data: AdminRunInfoReq, *args, **kwargs) -> Alias.Json:
1122
1122
  return await send_to_core_modify_async(ADMIN_RUNS_INFO, data, *args, **kwargs)
1123
1123
 
1124
1124
 
1125
+ def post_admin_dm_register(data: AdminDMRegister, *args, **kwargs) -> None:
1126
+ return send_to_core_modify(ADMIN_DM_REGISTER, data, *args, **kwargs)
1127
+
1128
+
1129
+ async def post_admin_dm_register_async(data: AdminDMRegister, *args, **kwargs) -> None:
1130
+ return await send_to_core_modify_async(ADMIN_DM_REGISTER, data, *args, **kwargs)
1131
+
1132
+
1133
+ def delete_admin_dm_register(data: AdminDMUnregister, *args, **kwargs) -> None:
1134
+ return send_to_core_modify(ADMIN_DM_REGISTER, data, *args, **kwargs, is_post=False)
1135
+
1136
+
1137
+ async def delete_admin_dm_register_async(data: AdminDMUnregister, *args, **kwargs) -> None:
1138
+ return await send_to_core_modify_async(ADMIN_DM_REGISTER, data, *args, **kwargs, is_post=False)
1139
+
1140
+
1125
1141
  def post_admin_update_superuser(data: Superuser, *args, **kwargs) -> Alias.Info:
1126
1142
  return send_to_core_modify(ADMIN_SUPERUSER, data, *args, **kwargs)
1127
1143
 
@@ -287,21 +287,13 @@ def create_user_config(
287
287
 
288
288
 
289
289
  def create_task_component(
290
- app_control: Optional[str] = None,
291
- control: Optional[str] = None,
292
- extra: Optional[str] = None,
293
- internal: Optional[str] = None,
290
+ main: Optional[str] = None,
294
291
  key_value: Optional[str] = None,
295
- minimal: Optional[str] = None,
296
292
  object_storage: Optional[str] = None,
297
293
  ) -> TaskComponent:
298
294
  return TaskComponent(
299
- appControl=app_control,
300
- control=control,
301
- extra=extra,
302
- internal=internal,
295
+ main=main,
303
296
  keyValue=key_value,
304
- minimal=minimal,
305
297
  objectStorage=object_storage
306
298
  )
307
299
 
@@ -168,6 +168,7 @@ TEMP_RUN_OPERATIONS_IDS = lambda taskId, cfgId: f"{TEMP_RUN_MAIN}/operationsIds/
168
168
  ADMIN_MAIN = f"{API_VERSION}/admin"
169
169
  ADMIN_RUNS = f"{ADMIN_MAIN}/runs"
170
170
  ADMIN_RUNS_INFO = f"{ADMIN_MAIN}/runs/info"
171
+ ADMIN_DM_REGISTER = f"{ADMIN_MAIN}/dm/register"
171
172
  ADMIN_SUPERUSER = f"{ADMIN_MAIN}/superuser"
172
173
 
173
174
  ## ManagerController
@@ -57,7 +57,7 @@ def bool_to_str(b: bool) -> str:
57
57
  return "true" if b else "false"
58
58
 
59
59
 
60
- def __show_logs_result(res: LogsResult, i: Optional[int]): # noqa: ANN202
60
+ def __show_logs_result(res: LogsResult, i: Optional[int] = None): # noqa: ANN202
61
61
  if len(res.data) > 0:
62
62
  print(f"------- main ({i}):" if i is not None else "------- main:")
63
63
  print(res.data)
@@ -4104,6 +4104,7 @@ def create_app(
4104
4104
  image_ref: Optional[str] = None,
4105
4105
  image_auth: Optional[AUTH] = None,
4106
4106
  image_tag: Optional[str] = None,
4107
+ image_sync: bool = True,
4107
4108
  platform: str = "base",
4108
4109
  platform_settings: Optional[str] = None,
4109
4110
  extra_collections_from: Optional[Dict[str, Union[List[str], str]]] = None,
@@ -4128,6 +4129,7 @@ def create_app(
4128
4129
  image_ref: Optional[str] = None,
4129
4130
  image_auth: Optional[AUTH] = None,
4130
4131
  image_tag: Optional[str] = None,
4132
+ image_sync: bool = True,
4131
4133
  platform: str = "base",
4132
4134
  platform_settings: Optional[str] = None,
4133
4135
  extra_collections_from: Optional[Dict[str, Union[List[str], str]]] = None,
@@ -4151,6 +4153,7 @@ def create_app(
4151
4153
  image_ref: Optional[str] = None,
4152
4154
  image_auth: Optional[AUTH] = None,
4153
4155
  image_tag: Optional[str] = None,
4156
+ image_sync: bool = True,
4154
4157
  platform: str = "base",
4155
4158
  platform_settings: Optional[str] = None,
4156
4159
  extra_collections_from: Optional[Dict[str, Union[List[str], str]]] = None,
@@ -4176,7 +4179,7 @@ def create_app(
4176
4179
  image_token = image_auth[1] if image_auth is not None else Config.TOKEN if use_system_auth else None
4177
4180
  if Config.WITH_WARNINGS and (image_user is None or image_token is None):
4178
4181
  Config.logger.warning("image_auth not set")
4179
- json_image = JsonImage(ref=image_ref, tag=image_tag or "", user=image_user, token=image_token)
4182
+ json_image = JsonImage(ref=image_ref, tag=image_tag or "", user=image_user, token=image_token, syncRef=image_sync)
4180
4183
  if extra_collections_from is not None:
4181
4184
  for k, v in extra_collections_from.items():
4182
4185
  if isinstance(v, str):
@@ -4210,6 +4213,7 @@ def update_app(
4210
4213
  image_ref: Optional[str] = None,
4211
4214
  image_auth: Optional[AUTH] = None,
4212
4215
  image_tag: Optional[str] = None,
4216
+ image_sync: bool = True,
4213
4217
  platform: str = "base",
4214
4218
  platform_settings: Optional[str] = None,
4215
4219
  extra_collections_from: Optional[Dict[str, Union[List[str], str]]] = None,
@@ -4235,6 +4239,7 @@ def update_app(
4235
4239
  image_ref: Optional[str] = None,
4236
4240
  image_auth: Optional[AUTH] = None,
4237
4241
  image_tag: Optional[str] = None,
4242
+ image_sync: bool = True,
4238
4243
  platform: str = "base",
4239
4244
  platform_settings: Optional[str] = None,
4240
4245
  extra_collections_from: Optional[Dict[str, Union[List[str], str]]] = None,
@@ -4259,6 +4264,7 @@ def update_app(
4259
4264
  image_ref: Optional[str] = None,
4260
4265
  image_auth: Optional[AUTH] = None,
4261
4266
  image_tag: Optional[str] = None,
4267
+ image_sync: bool = True,
4262
4268
  platform: str = "base",
4263
4269
  platform_settings: Optional[str] = None,
4264
4270
  extra_collections_from: Optional[Dict[str, Union[List[str], str]]] = None,
@@ -4283,7 +4289,7 @@ def update_app(
4283
4289
  image_token = image_auth[1] if image_auth is not None else Config.TOKEN if use_system_auth else None
4284
4290
  if Config.WITH_WARNINGS and (image_user is None or image_token is None):
4285
4291
  Config.logger.warning("image_auth not set")
4286
- json_image = JsonImage(ref=image_ref, tag=image_tag or "", user=image_user, token=image_token)
4292
+ json_image = JsonImage(ref=image_ref, tag=image_tag or "", user=image_user, token=image_token, syncRef=image_sync)
4287
4293
  if extra_collections_from is not None:
4288
4294
  for k, v in extra_collections_from.items():
4289
4295
  if isinstance(v, str):
@@ -6672,6 +6678,7 @@ def get_image_info(
6672
6678
  image_ref: str,
6673
6679
  image_auth: Optional[AUTH] = None,
6674
6680
  image_tag: Optional[str] = None,
6681
+ image_sync: bool = True,
6675
6682
  parse: bool = False,
6676
6683
  *,
6677
6684
  use_system_auth: bool = False,
@@ -6688,6 +6695,7 @@ def get_image_info(
6688
6695
  image_ref: str,
6689
6696
  image_auth: Optional[AUTH] = None,
6690
6697
  image_tag: Optional[str] = None,
6698
+ image_sync: bool = True,
6691
6699
  parse: bool = False,
6692
6700
  *,
6693
6701
  use_system_auth: bool = False,
@@ -6703,6 +6711,7 @@ def get_image_info(
6703
6711
  image_ref: str,
6704
6712
  image_auth: Optional[AUTH] = None,
6705
6713
  image_tag: Optional[str] = None,
6714
+ image_sync: bool = True,
6706
6715
  parse: bool = False,
6707
6716
  *,
6708
6717
  use_system_auth: bool = False,
@@ -6718,7 +6727,7 @@ def get_image_info(
6718
6727
  image_token = image_auth[1] if image_auth is not None else Config.TOKEN if use_system_auth else None
6719
6728
  if Config.WITH_WARNINGS and (image_user is None or image_token is None):
6720
6729
  Config.logger.warning("image_auth not set")
6721
- data = JsonImage(ref=image_ref, tag=image_tag or "", user=image_user, token=image_token)
6730
+ data = JsonImage(ref=image_ref, tag=image_tag or "", user=image_user, token=image_token, syncRef=image_sync)
6722
6731
  if batcher is not None:
6723
6732
  return batcher.add("imageInfo", data=data, result_model=AppFunctionsInfo if parse else None)
6724
6733
  if is_async:
@@ -6728,7 +6737,7 @@ def get_image_info(
6728
6737
 
6729
6738
  @overload
6730
6739
  def get_task_schedules(
6731
- operation_id: str,
6740
+ operation_id: Optional[str] = None,
6732
6741
  with_show: bool = True,
6733
6742
  *,
6734
6743
  auth: Optional[AUTH] = None,
@@ -6741,7 +6750,7 @@ def get_task_schedules(
6741
6750
 
6742
6751
  @overload
6743
6752
  def get_task_schedules(
6744
- operation_id: str,
6753
+ operation_id: Optional[str] = None,
6745
6754
  with_show: bool = True,
6746
6755
  *,
6747
6756
  auth: Optional[AUTH] = None,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: malevich-coretools
3
- Version: 0.3.61
3
+ Version: 0.3.63
4
4
  Author: Andrew Pogrebnoj
5
5
  Author-email: andrew@onjulius.co
6
6
  License-File: LICENSE
@@ -1 +0,0 @@
1
- 0.3.61
@@ -1,99 +0,0 @@
1
- import malevich_coretools.funcs.funcs as f
2
- from malevich_coretools.abstract import * # noqa: F403
3
- from malevich_coretools.batch import Batcher
4
- from malevich_coretools.secondary import Config
5
-
6
-
7
- def admin_get_runs(
8
- *,
9
- auth: Optional[AUTH] = None,
10
- conn_url: Optional[str] = None,
11
- batcher: Optional[Batcher] = None,
12
- ) -> AdminRunsInfo:
13
- """return info about all runs"""
14
- if batcher is None:
15
- batcher = Config.BATCHER
16
- if batcher is not None:
17
- return batcher.add("getAllRuns", result_model=AdminRunsInfo)
18
- return f.get_admin_runs(auth=auth, conn_url=conn_url)
19
-
20
-
21
- def admin_get_run_info(
22
- id: Alias.Id,
23
- *,
24
- auth: Optional[AUTH] = None,
25
- conn_url: Optional[str] = None,
26
- batcher: Optional[Batcher] = None,
27
- ) -> Alias.Json:
28
- """return run info by operation `id`"""
29
- if batcher is None:
30
- batcher = Config.BATCHER
31
- data = OperationOrNone(operationId=id)
32
- if batcher is not None:
33
- return batcher.add("getRunInfo", data=data)
34
- return f.get_admin_runs_info(data, auth=auth, conn_url=conn_url)
35
-
36
-
37
- def admin_get_runs_info(
38
- *,
39
- auth: Optional[AUTH] = None,
40
- conn_url: Optional[str] = None,
41
- batcher: Optional[Batcher] = None,
42
- ) -> Alias.Json:
43
- """return json: dm id -> info about its runs"""
44
- if batcher is None:
45
- batcher = Config.BATCHER
46
- data = OperationOrNone()
47
- if batcher is not None:
48
- return batcher.add("getRunInfo", data=data)
49
- return f.get_admin_runs_info(data, auth=auth, conn_url=conn_url)
50
-
51
-
52
- def admin_update_superuser(
53
- login: str,
54
- is_superuser: bool = True,
55
- *,
56
- auth: Optional[AUTH] = None,
57
- conn_url: Optional[str] = None,
58
- batcher: Optional[Batcher] = None,
59
- ) -> Alias.Info:
60
- """update user role by login"""
61
- if batcher is None:
62
- batcher = Config.BATCHER
63
- data = Superuser(login=login, isSuperuser=is_superuser)
64
- if batcher is not None:
65
- return batcher.add("postUpdateSuperuser", data=data)
66
- return f.post_admin_update_superuser(data, auth=auth, conn_url=conn_url)
67
-
68
-
69
- def admin_delete_run(
70
- id: Alias.Id,
71
- withLogs: bool = False,
72
- *,
73
- auth: Optional[AUTH] = None,
74
- conn_url: Optional[str] = None,
75
- batcher: Optional[Batcher] = None,
76
- ) -> Alias.Json:
77
- """delete run by operation `id`"""
78
- if batcher is None:
79
- batcher = Config.BATCHER
80
- data = AdminStopOperation(operationId=id, withLogs=withLogs)
81
- if batcher is not None:
82
- return batcher.add("deleteRuns", data=data)
83
- return f.delete_admin_runs(data, auth=auth, conn_url=conn_url)
84
-
85
-
86
- def admin_delete_runs(
87
- withLogs: bool = False,
88
- *,
89
- auth: Optional[AUTH] = None,
90
- conn_url: Optional[str] = None,
91
- batcher: Optional[Batcher] = None,
92
- ) -> Alias.Json:
93
- """delete all runs"""
94
- if batcher is None:
95
- batcher = Config.BATCHER
96
- data = AdminStopOperation(withLogs=withLogs)
97
- if batcher is not None:
98
- return batcher.add("deleteRuns", data=data)
99
- return f.delete_admin_runs(data, auth=auth, conn_url=conn_url)