malevich-coretools 0.2.1__py3-none-any.whl → 0.2.3__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.
Potentially problematic release.
This version of malevich-coretools might be problematic. Click here for more details.
- malevich_coretools/__init__.py +1 -0
- malevich_coretools/abstract/abstract.py +3 -0
- malevich_coretools/funcs/funcs.py +7 -0
- malevich_coretools/secondary/const.py +2 -0
- malevich_coretools/tools/__init__.py +1 -0
- malevich_coretools/tools/vast.py +306 -0
- malevich_coretools/utils.py +131 -119
- {malevich_coretools-0.2.1.dist-info → malevich_coretools-0.2.3.dist-info}/METADATA +1 -1
- malevich_coretools-0.2.3.dist-info/RECORD +18 -0
- {malevich_coretools-0.2.1.dist-info → malevich_coretools-0.2.3.dist-info}/WHEEL +1 -1
- malevich_coretools-0.2.1.dist-info/RECORD +0 -16
- {malevich_coretools-0.2.1.dist-info → malevich_coretools-0.2.3.dist-info}/LICENSE +0 -0
- {malevich_coretools-0.2.1.dist-info → malevich_coretools-0.2.3.dist-info}/top_level.txt +0 -0
malevich_coretools/__init__.py
CHANGED
|
@@ -103,6 +103,8 @@ class UserApp(BaseModel):
|
|
|
103
103
|
outputId: Optional[Alias.Id]
|
|
104
104
|
cfg: Optional[Alias.Json]
|
|
105
105
|
image: JsonImage
|
|
106
|
+
platform: str
|
|
107
|
+
platformSettings: Optional[str]
|
|
106
108
|
collectionsFrom: Optional[Dict[str, str]]
|
|
107
109
|
extraCollectionsFrom: Optional[Dict[str, str]]
|
|
108
110
|
|
|
@@ -391,3 +393,4 @@ class AppFunctionsInfo(BaseModel):
|
|
|
391
393
|
schemes: Dict[str, str] = dict()
|
|
392
394
|
inits: Dict[str, InitInfo] = dict()
|
|
393
395
|
logs: Optional[str] = None
|
|
396
|
+
instanceInfo: Optional[str] = None # json with info about instance
|
|
@@ -451,6 +451,13 @@ def get_app_info_by_real_id(id: str, parse: bool, *args, **kwargs) -> Union[Alia
|
|
|
451
451
|
return res
|
|
452
452
|
|
|
453
453
|
|
|
454
|
+
def get_image_info(data: JsonImage, parse: bool, *args, **kwargs) -> Union[Alias.Json, AppFunctionsInfo]:
|
|
455
|
+
res = send_to_core_modify(MANAGER_IMAGE_INFO, data, with_auth=False, with_show=False, show_func = show_fail_app_info, *args, **kwargs)
|
|
456
|
+
if parse:
|
|
457
|
+
res = model_from_json(res, AppFunctionsInfo)
|
|
458
|
+
return res
|
|
459
|
+
|
|
460
|
+
|
|
454
461
|
def get_task_schedules(data: Operation, with_show: bool, *args, **kwargs) -> Schedules:
|
|
455
462
|
res = model_from_json(send_to_core_modify(MANAGER_TASK_SCHEDULES, data, with_show=False, *args, **kwargs), Schedules)
|
|
456
463
|
if with_show:
|
|
@@ -12,6 +12,7 @@ LONG_SLEEP_TIME = 1 # second
|
|
|
12
12
|
WAIT_RESULT_TIMEOUT = 60 * 60 # hour
|
|
13
13
|
AIOHTTP_TIMEOUT = aiohttp.ClientTimeout(total=60 * 10) # 10 min
|
|
14
14
|
AIOHTTP_TIMEOUT_MINI = aiohttp.ClientTimeout(total=60 * 5) # 5 min
|
|
15
|
+
POSSIBLE_APPS_PLATFORMS = {"base", "vast"}
|
|
15
16
|
# endpoints
|
|
16
17
|
|
|
17
18
|
def with_wait(url, wait) -> str:
|
|
@@ -124,6 +125,7 @@ MANAGER_DAG_KEY_VALUE = lambda wait: with_wait(f"{MANAGER_MAIN}/dagKeyValue", wa
|
|
|
124
125
|
MANAGER_DAG_KEY_VALUE_OPERATION_ID = lambda operationId: f"{MANAGER_MAIN}/dagKeyValue/{operationId}"
|
|
125
126
|
MANAGER_APP_INFO = lambda appId: f"{MANAGER_MAIN}/appInfo/{appId}"
|
|
126
127
|
MANAGER_APP_INFO_REAL_ID = lambda appId: f"{MANAGER_MAIN}/appInfo/realId/{appId}"
|
|
128
|
+
MANAGER_IMAGE_INFO = f"{MANAGER_MAIN}/imageInfo"
|
|
127
129
|
MANAGER_TASK_SCHEDULES = f"{MANAGER_MAIN}/task/schedules"
|
|
128
130
|
MANAGER_TASK = lambda wait: with_wait(f"{MANAGER_MAIN}/task", wait)
|
|
129
131
|
MANAGER_TASK_RUN = lambda wait: with_wait(f"{MANAGER_MAIN}/task/run", wait)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .vast import vast_settings
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
from typing import Dict, Optional, Union, Any
|
|
2
|
+
import re
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
# from https://raw.githubusercontent.com/vast-ai/vast-python/master/vast.py
|
|
6
|
+
def parse_query(query_str: str, res: Dict = None) -> Dict:
|
|
7
|
+
"""
|
|
8
|
+
Basically takes a query string (like the ones in the examples of commands for the search__offers function) and
|
|
9
|
+
processes it into a dict of URL parameters to be sent to the server.
|
|
10
|
+
|
|
11
|
+
:param str query_str:
|
|
12
|
+
:param Dict res:
|
|
13
|
+
:return Dict:
|
|
14
|
+
"""
|
|
15
|
+
if res is None: res = {}
|
|
16
|
+
if type(query_str) == list:
|
|
17
|
+
query_str = " ".join(query_str)
|
|
18
|
+
query_str = query_str.strip()
|
|
19
|
+
opts = re.findall("([a-zA-Z0-9_]+)( *[=><!]+| +(?:[lg]te?|nin|neq|eq|not ?eq|not ?in|in) )?( *)(\[[^\]]+\]|[^ ]+)?( *)", query_str)
|
|
20
|
+
|
|
21
|
+
#print(opts)
|
|
22
|
+
# res = {}
|
|
23
|
+
op_names = {
|
|
24
|
+
">=": "gte",
|
|
25
|
+
">": "gt",
|
|
26
|
+
"gt": "gt",
|
|
27
|
+
"gte": "gte",
|
|
28
|
+
"<=": "lte",
|
|
29
|
+
"<": "lt",
|
|
30
|
+
"lt": "lt",
|
|
31
|
+
"lte": "lte",
|
|
32
|
+
"!=": "neq",
|
|
33
|
+
"==": "eq",
|
|
34
|
+
"=": "eq",
|
|
35
|
+
"eq": "eq",
|
|
36
|
+
"neq": "neq",
|
|
37
|
+
"noteq": "neq",
|
|
38
|
+
"not eq": "neq",
|
|
39
|
+
"notin": "notin",
|
|
40
|
+
"not in": "notin",
|
|
41
|
+
"nin": "notin",
|
|
42
|
+
"in": "in",
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
field_alias = {
|
|
46
|
+
"cuda_vers": "cuda_max_good",
|
|
47
|
+
"display_active": "gpu_display_active",
|
|
48
|
+
"reliability": "reliability2",
|
|
49
|
+
"dlperf_usd": "dlperf_per_dphtotal",
|
|
50
|
+
"dph": "dph_total",
|
|
51
|
+
"flops_usd": "flops_per_dphtotal",
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
field_multiplier = {
|
|
55
|
+
"cpu_ram": 1000,
|
|
56
|
+
"gpu_ram": 1000,
|
|
57
|
+
"duration": 24.0 * 60.0 * 60.0,
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
fields = {
|
|
61
|
+
"bw_nvlink",
|
|
62
|
+
"compute_cap",
|
|
63
|
+
"cpu_cores",
|
|
64
|
+
"cpu_cores_effective",
|
|
65
|
+
"cpu_ram",
|
|
66
|
+
"cuda_max_good",
|
|
67
|
+
"datacenter",
|
|
68
|
+
"direct_port_count",
|
|
69
|
+
"driver_version",
|
|
70
|
+
"disk_bw",
|
|
71
|
+
"disk_space",
|
|
72
|
+
"dlperf",
|
|
73
|
+
"dlperf_per_dphtotal",
|
|
74
|
+
"dph_total",
|
|
75
|
+
"duration",
|
|
76
|
+
"external",
|
|
77
|
+
"flops_per_dphtotal",
|
|
78
|
+
"gpu_display_active",
|
|
79
|
+
# "gpu_ram_free_min",
|
|
80
|
+
"gpu_mem_bw",
|
|
81
|
+
"gpu_name",
|
|
82
|
+
"gpu_ram",
|
|
83
|
+
"gpu_display_active",
|
|
84
|
+
"has_avx",
|
|
85
|
+
"host_id",
|
|
86
|
+
"id",
|
|
87
|
+
"inet_down",
|
|
88
|
+
"inet_down_cost",
|
|
89
|
+
"inet_up",
|
|
90
|
+
"inet_up_cost",
|
|
91
|
+
"machine_id",
|
|
92
|
+
"min_bid",
|
|
93
|
+
"mobo_name",
|
|
94
|
+
"num_gpus",
|
|
95
|
+
"pci_gen",
|
|
96
|
+
"pcie_bw",
|
|
97
|
+
"reliability2",
|
|
98
|
+
"rentable",
|
|
99
|
+
"rented",
|
|
100
|
+
"storage_cost",
|
|
101
|
+
"static_ip",
|
|
102
|
+
"total_flops",
|
|
103
|
+
"verification",
|
|
104
|
+
"verified",
|
|
105
|
+
"geolocation"
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
joined = "".join("".join(x) for x in opts)
|
|
109
|
+
if joined != query_str:
|
|
110
|
+
raise ValueError(
|
|
111
|
+
"Unconsumed text. Did you forget to quote your query? " + repr(joined) + " != " + repr(query_str))
|
|
112
|
+
|
|
113
|
+
for field, op, _, value, _ in opts:
|
|
114
|
+
value = value.strip(",[]")
|
|
115
|
+
v = res.setdefault(field, {})
|
|
116
|
+
op = op.strip()
|
|
117
|
+
op_name = op_names.get(op)
|
|
118
|
+
|
|
119
|
+
if field in field_alias:
|
|
120
|
+
field = field_alias[field]
|
|
121
|
+
|
|
122
|
+
if (field == "driver_version") and ('.' in value):
|
|
123
|
+
value = numeric_version(value)
|
|
124
|
+
|
|
125
|
+
if not field in fields:
|
|
126
|
+
print("Warning: Unrecognized field: {}, see list of recognized fields.".format(field), file=sys.stderr);
|
|
127
|
+
if not op_name:
|
|
128
|
+
raise ValueError("Unknown operator. Did you forget to quote your query? " + repr(op).strip("u"))
|
|
129
|
+
if op_name in ["in", "notin"]:
|
|
130
|
+
value = [x.strip() for x in value.split(",") if x.strip()]
|
|
131
|
+
if not value:
|
|
132
|
+
raise ValueError("Value cannot be blank. Did you forget to quote your query? " + repr((field, op, value)))
|
|
133
|
+
if not field:
|
|
134
|
+
raise ValueError("Field cannot be blank. Did you forget to quote your query? " + repr((field, op, value)))
|
|
135
|
+
if value in ["?", "*", "any"]:
|
|
136
|
+
if op_name != "eq":
|
|
137
|
+
raise ValueError("Wildcard only makes sense with equals.")
|
|
138
|
+
if field in v:
|
|
139
|
+
del v[field]
|
|
140
|
+
if field in res:
|
|
141
|
+
del res[field]
|
|
142
|
+
continue
|
|
143
|
+
|
|
144
|
+
if field in field_multiplier:
|
|
145
|
+
value = float(value) * field_multiplier[field]
|
|
146
|
+
|
|
147
|
+
if isinstance(value, str):
|
|
148
|
+
v[op_name] = value.replace('_', ' ')
|
|
149
|
+
else:
|
|
150
|
+
v[op_name] = value
|
|
151
|
+
|
|
152
|
+
else:
|
|
153
|
+
#print(value)
|
|
154
|
+
if value == 'true':
|
|
155
|
+
v[op_name] = True
|
|
156
|
+
elif value == 'False':
|
|
157
|
+
v[op_name] = False
|
|
158
|
+
elif isinstance(value, str):
|
|
159
|
+
v[op_name] = value.replace('_', ' ')
|
|
160
|
+
else:
|
|
161
|
+
#v[op_name] = [v.replace('_', ' ') for v in value]
|
|
162
|
+
v[op_name] = value
|
|
163
|
+
|
|
164
|
+
res[field] = v;
|
|
165
|
+
|
|
166
|
+
return res
|
|
167
|
+
|
|
168
|
+
# from https://raw.githubusercontent.com/vast-ai/vast-python/master/vast.py
|
|
169
|
+
def parse(search_query: str, show_order: str = "score-", no_default: bool = False, instance_type = "on-demand") -> Dict[str, Any]:
|
|
170
|
+
"""Query syntax:
|
|
171
|
+
|
|
172
|
+
query = comparison comparison...
|
|
173
|
+
comparison = field op value
|
|
174
|
+
field = <name of a field>
|
|
175
|
+
op = one of: <, <=, ==, !=, >=, >, in, notin
|
|
176
|
+
value = <bool, int, float, etc> | 'any'
|
|
177
|
+
bool: True, False
|
|
178
|
+
|
|
179
|
+
note: to pass '>' and '<' on the command line, make sure to use quotes
|
|
180
|
+
note: to encode a string query value (ie for gpu_name), replace any spaces ' ' with underscore '_'
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
Examples:
|
|
184
|
+
|
|
185
|
+
# search for somewhat reliable single RTX 3090 instances, filter out any duplicates or offers that conflict with our existing stopped instances
|
|
186
|
+
./vast search offers 'reliability > 0.98 num_gpus=1 gpu_name=RTX_3090 rented=False'
|
|
187
|
+
|
|
188
|
+
# search for datacenter gpus with minimal compute_cap and total_flops
|
|
189
|
+
./vast search offers 'compute_cap > 610 total_flops > 5 datacenter=True'
|
|
190
|
+
|
|
191
|
+
# search for reliable machines with at least 4 gpus, unverified, order by num_gpus, allow duplicates
|
|
192
|
+
./vast search offers 'reliability > 0.99 num_gpus>=4 verified=False rented=any' -o 'num_gpus-'
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
Available fields:
|
|
196
|
+
|
|
197
|
+
Name Type Description
|
|
198
|
+
|
|
199
|
+
bw_nvlink float bandwidth NVLink
|
|
200
|
+
compute_cap: int cuda compute capability*100 (ie: 650 for 6.5, 700 for 7.0)
|
|
201
|
+
cpu_cores: int # virtual cpus
|
|
202
|
+
cpu_cores_effective: float # virtual cpus you get
|
|
203
|
+
cpu_ram: float system RAM in gigabytes
|
|
204
|
+
cuda_vers: float machine max supported cuda version (based on driver version)
|
|
205
|
+
datacenter: bool show only datacenter offers
|
|
206
|
+
direct_port_count int open ports on host's router
|
|
207
|
+
disk_bw: float disk read bandwidth, in MB/s
|
|
208
|
+
disk_space: float disk storage space, in GB
|
|
209
|
+
dlperf: float DL-perf score (see FAQ for explanation)
|
|
210
|
+
dlperf_usd: float DL-perf/$
|
|
211
|
+
dph: float $/hour rental cost
|
|
212
|
+
driver_version string machine's nvidia driver version as 3 digit string ex. "535.86.05"
|
|
213
|
+
duration: float max rental duration in days
|
|
214
|
+
external: bool show external offers in addition to datacenter offers
|
|
215
|
+
flops_usd: float TFLOPs/$
|
|
216
|
+
geolocation: string Two letter country code. Works with operators =, !=, in, not in (e.g. geolocation not in [XV,XZ])
|
|
217
|
+
gpu_mem_bw: float GPU memory bandwidth in GB/s
|
|
218
|
+
gpu_name: string GPU model name (no quotes, replace spaces with underscores, ie: RTX_3090 rather than 'RTX 3090')
|
|
219
|
+
gpu_ram: float GPU RAM in GB
|
|
220
|
+
gpu_frac: float Ratio of GPUs in the offer to gpus in the system
|
|
221
|
+
gpu_display_active: bool True if the GPU has a display attached
|
|
222
|
+
has_avx: bool CPU supports AVX instruction set.
|
|
223
|
+
id: int instance unique ID
|
|
224
|
+
inet_down: float internet download speed in Mb/s
|
|
225
|
+
inet_down_cost: float internet download bandwidth cost in $/GB
|
|
226
|
+
inet_up: float internet upload speed in Mb/s
|
|
227
|
+
inet_up_cost: float internet upload bandwidth cost in $/GB
|
|
228
|
+
machine_id int machine id of instance
|
|
229
|
+
min_bid: float current minimum bid price in $/hr for interruptible
|
|
230
|
+
num_gpus: int # of GPUs
|
|
231
|
+
pci_gen: float PCIE generation
|
|
232
|
+
pcie_bw: float PCIE bandwidth (CPU to GPU)
|
|
233
|
+
reliability: float machine reliability score (see FAQ for explanation)
|
|
234
|
+
rentable: bool is the instance currently rentable
|
|
235
|
+
rented: bool allow/disallow duplicates and potential conflicts with existing stopped instances
|
|
236
|
+
storage_cost: float storage cost in $/GB/month
|
|
237
|
+
static_ip: bool is the IP addr static/stable
|
|
238
|
+
total_flops: float total TFLOPs from all GPUs
|
|
239
|
+
verified: bool is the machine verified
|
|
240
|
+
"""
|
|
241
|
+
field_alias = {
|
|
242
|
+
"cuda_vers": "cuda_max_good",
|
|
243
|
+
"reliability": "reliability2",
|
|
244
|
+
"dlperf_usd": "dlperf_per_dphtotal",
|
|
245
|
+
"dph": "dph_total",
|
|
246
|
+
"flops_usd": "flops_per_dphtotal",
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
try:
|
|
250
|
+
|
|
251
|
+
if no_default:
|
|
252
|
+
query = {}
|
|
253
|
+
else:
|
|
254
|
+
query = {"verified": {"eq": True}, "external": {"eq": False}, "rentable": {"eq": True}, "rented": {"eq": False}}
|
|
255
|
+
#query = {"verified": {"eq": True}, "external": {"eq": False}, "rentable": {"eq": True} }
|
|
256
|
+
|
|
257
|
+
if search_query is not None:
|
|
258
|
+
query = parse_query(search_query, query)
|
|
259
|
+
|
|
260
|
+
order = []
|
|
261
|
+
for name in show_order.split(","):
|
|
262
|
+
name = name.strip()
|
|
263
|
+
if not name: continue
|
|
264
|
+
direction = "asc"
|
|
265
|
+
if name.strip("-") != name:
|
|
266
|
+
direction = "desc"
|
|
267
|
+
field = name.strip("-");
|
|
268
|
+
if field in field_alias:
|
|
269
|
+
field = field_alias[field];
|
|
270
|
+
order.append([field, direction])
|
|
271
|
+
|
|
272
|
+
query["order"] = order
|
|
273
|
+
query["type"] = instance_type
|
|
274
|
+
# For backwards compatibility, support --type=interruptible option
|
|
275
|
+
if query["type"] == 'interruptible':
|
|
276
|
+
query["type"] = 'bid'
|
|
277
|
+
except ValueError as e:
|
|
278
|
+
print("Error: ", e)
|
|
279
|
+
return None
|
|
280
|
+
return query
|
|
281
|
+
|
|
282
|
+
def vast_settings(id: Optional[str] = None, query: Optional[Union[str, Dict[str, Any]]] = None) -> str:
|
|
283
|
+
"""
|
|
284
|
+
Platform settings for create app:\n
|
|
285
|
+
by nothing - use default query inside\n
|
|
286
|
+
by offer id - try use this id for app\n
|
|
287
|
+
by query - use this query inside\n
|
|
288
|
+
|
|
289
|
+
Examples:\n
|
|
290
|
+
vast_settings()\n
|
|
291
|
+
vast_settings(id="<id, that found with vast (vastai search offers)>")\n
|
|
292
|
+
vast_settings(query={"dph": {"lt": "0.1"}})\n
|
|
293
|
+
vast_settings(query="dph<0.1")\n
|
|
294
|
+
"""
|
|
295
|
+
res = {}
|
|
296
|
+
if id is not None:
|
|
297
|
+
assert query is None, "id and query set"
|
|
298
|
+
res["id"] = id
|
|
299
|
+
elif query is not None:
|
|
300
|
+
if isinstance(query, str):
|
|
301
|
+
res["query"] = parse(query, no_default=True) # run only with this options
|
|
302
|
+
else:
|
|
303
|
+
assert isinstance(query, dict), "wrong query type: it should be str or dict"
|
|
304
|
+
res["query"] = query
|
|
305
|
+
return json.dumps(res)
|
|
306
|
+
|
malevich_coretools/utils.py
CHANGED
|
@@ -8,7 +8,7 @@ import malevich_coretools.funcs.funcs as f
|
|
|
8
8
|
import malevich_coretools.funcs.helpers as fh
|
|
9
9
|
from malevich_coretools.abstract import * # noqa: F403
|
|
10
10
|
from malevich_coretools.secondary import Config, to_json
|
|
11
|
-
from malevich_coretools.secondary.const import WAIT_RESULT_TIMEOUT
|
|
11
|
+
from malevich_coretools.secondary.const import POSSIBLE_APPS_PLATFORMS, WAIT_RESULT_TIMEOUT
|
|
12
12
|
from malevich_coretools.secondary.helpers import rand_str
|
|
13
13
|
|
|
14
14
|
# config
|
|
@@ -54,155 +54,155 @@ def update_core_credentials(username: USERNAME, password: PASSWORD) -> None:
|
|
|
54
54
|
# Docs
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
def get_docs(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
57
|
+
def get_docs(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
58
58
|
"""return list ids"""
|
|
59
59
|
return f.get_docs(auth=auth, conn_url=conn_url)
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
def get_doc(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultDoc:
|
|
62
|
+
def get_doc(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultDoc:
|
|
63
63
|
"""return doc by \"id\""""
|
|
64
64
|
return f.get_docs_id(id, auth=auth, conn_url=conn_url)
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
def create_doc(data: Alias.Json, name: Optional[str], wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
67
|
+
def create_doc(data: Alias.Json, name: Optional[str], wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
68
68
|
"""save doc with \"data\" and \"name\", return \"id\""""
|
|
69
69
|
return f.post_docs(DocWithName(data=data, name=name), wait=wait, auth=auth, conn_url=conn_url)
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
def update_doc(id: str, data: Alias.Json, name: Optional[str], wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
72
|
+
def update_doc(id: str, data: Alias.Json, name: Optional[str], wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
73
73
|
"""update doc by \"id\", return \"id\""""
|
|
74
74
|
return f.post_docs_id(id, DocWithName(data=data, name=name), wait=wait, auth=auth, conn_url=conn_url)
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
def delete_doc(id: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
77
|
+
def delete_doc(id: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
78
78
|
"""delete doc by \"id\""""
|
|
79
79
|
return f.delete_docs_id(id, wait=wait, auth=auth, conn_url=conn_url)
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
def delete_docs(wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
82
|
+
def delete_docs(wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
83
83
|
"""delete all docs"""
|
|
84
84
|
return f.delete_docs(wait=wait, auth=auth, conn_url=conn_url)
|
|
85
85
|
|
|
86
86
|
# Collections
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
def get_collections(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultOwnAndSharedIds:
|
|
89
|
+
def get_collections(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultOwnAndSharedIds:
|
|
90
90
|
"""return 2 list: own collections ids and shared collections ids"""
|
|
91
91
|
return f.get_collections(auth=auth, conn_url=conn_url)
|
|
92
92
|
|
|
93
93
|
|
|
94
|
-
def get_collections_by_name(name: str, operation_id: Optional[str]=None, run_id: Optional[str]=None, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultOwnAndSharedIds:
|
|
94
|
+
def get_collections_by_name(name: str, operation_id: Optional[str]=None, run_id: Optional[str]=None, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultOwnAndSharedIds:
|
|
95
95
|
"""return 2 list: own collections ids and shared collections ids by \"name\" and mb also operation_id and run_id with which it was saved"""
|
|
96
96
|
assert not (operation_id is None and run_id is not None), "if run_id set, operation_id should be set too"
|
|
97
97
|
return f.get_collections_name(name, operation_id, run_id, auth=auth, conn_url=conn_url)
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
def get_collection(id: str, offset: int = 0, limit: int = -1, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultCollection:
|
|
100
|
+
def get_collection(id: str, offset: int = 0, limit: int = -1, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultCollection:
|
|
101
101
|
"""return collection by \"id\", pagination: unlimited - limit < 0"""
|
|
102
102
|
return f.get_collections_id(id, offset, limit, auth=auth, conn_url=conn_url)
|
|
103
103
|
|
|
104
104
|
|
|
105
|
-
def get_collection_by_name(name: str, operation_id: Optional[str]=None, run_id: Optional[str]=None, offset: int = 0, limit: int = -1, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultCollection:
|
|
105
|
+
def get_collection_by_name(name: str, operation_id: Optional[str]=None, run_id: Optional[str]=None, offset: int = 0, limit: int = -1, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultCollection:
|
|
106
106
|
"""return collection by \"name\" and mb also operation_id and run_id with which it was saved. raise if there are multiple collections, pagination: unlimited - limit < 0"""
|
|
107
107
|
assert not (operation_id is None and run_id is not None), "if run_id set, operation_id should be set too"
|
|
108
108
|
return f.get_collection_name(name, operation_id, run_id, offset, limit, auth=auth, conn_url=conn_url)
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
def create_collection(ids: List[str], name: Optional[str]=None, metadata: Optional[str]=None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
111
|
+
def create_collection(ids: List[str], name: Optional[str]=None, metadata: Optional[str]=None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
112
112
|
"""save collection by list docs \"ids\", return id"""
|
|
113
113
|
return f.post_collections(DocsCollection(data=ids, name=name, metadata=metadata), wait=wait, auth=auth, conn_url=conn_url)
|
|
114
114
|
|
|
115
115
|
|
|
116
|
-
def update_collection(id: str, ids: List[str], name: Optional[str]=None, metadata: Optional[str]=None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
116
|
+
def update_collection(id: str, ids: List[str], name: Optional[str]=None, metadata: Optional[str]=None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
117
117
|
"""update collection with \"id\" by list docs \"ids\", return \"id\""""
|
|
118
118
|
return f.post_collections_id(id, DocsCollection(data=ids, name=name, metadata=metadata), wait=wait, auth=auth, conn_url=conn_url)
|
|
119
119
|
|
|
120
120
|
|
|
121
|
-
def s3_put_collection(id: str, is_csv = True, key: Optional[str] = None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
121
|
+
def s3_put_collection(id: str, is_csv = True, key: Optional[str] = None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
122
122
|
"""is_csv = false -> save json, key by default = id"""
|
|
123
123
|
return f.post_collections_id_s3(id, PostS3Settings(isCsv=is_csv, key=key), wait=wait, auth=auth, conn_url=conn_url)
|
|
124
124
|
|
|
125
125
|
|
|
126
|
-
def create_collection_by_docs(docs: List[Alias.Json], name: Optional[str]=None, metadata: Optional[str]=None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
126
|
+
def create_collection_by_docs(docs: List[Alias.Json], name: Optional[str]=None, metadata: Optional[str]=None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
127
127
|
"""save collection by \"docs\", return \"id\""""
|
|
128
128
|
return f.post_collections_data(DocsDataCollection(data=docs, name=name, metadata=metadata), wait=wait, auth=auth, conn_url=conn_url)
|
|
129
129
|
|
|
130
130
|
|
|
131
|
-
def add_to_collection(id: str, ids: List[str], wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
131
|
+
def add_to_collection(id: str, ids: List[str], wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
132
132
|
"""add to collection with \"id\" docs with \"ids\""""
|
|
133
133
|
return f.post_collections_id_add(id, DocsCollectionChange(data=ids), wait=wait, auth=auth, conn_url=conn_url)
|
|
134
134
|
|
|
135
135
|
|
|
136
|
-
def copy_collection(id: str, full_copy: bool = True, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
136
|
+
def copy_collection(id: str, full_copy: bool = True, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
137
137
|
"""copy collection with \"id\", if not \"full_copy\" docs same as in collection with \"id\""""
|
|
138
138
|
return f.post_collections_id_copy(id, full_copy=full_copy, wait=wait, auth=auth, conn_url=conn_url)
|
|
139
139
|
|
|
140
140
|
|
|
141
|
-
def apply_scheme(coll_id: str, scheme_name: str, mode: str="drop", wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
141
|
+
def apply_scheme(coll_id: str, scheme_name: str, mode: str="drop", wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
142
142
|
"""apply scheme with \"scheme_name\" to collection with \"coll_id\" return new collection with another \"coll_id\""""
|
|
143
143
|
return f.post_collections_id_applyScheme(coll_id, FixScheme(schemeName=scheme_name, mode=mode), wait=wait, auth=auth, conn_url=conn_url)
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
def fix_scheme(coll_id: str, scheme_name: str, mode="check", wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
146
|
+
def fix_scheme(coll_id: str, scheme_name: str, mode="check", wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
147
147
|
"""optimization to core (not necessary call), sets the schema with \"scheme_name\" for the collection with \"coll_id\""""
|
|
148
148
|
fix_scheme_data = FixScheme(schemeName=scheme_name, mode=mode)
|
|
149
149
|
return f.post_collections_id_fixScheme(coll_id, fix_scheme_data, wait=wait, auth=auth, conn_url=conn_url)
|
|
150
150
|
|
|
151
151
|
|
|
152
|
-
def unfix_scheme(coll_id: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
152
|
+
def unfix_scheme(coll_id: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
153
153
|
"""unfix scheme for collection with \"coll_id\""""
|
|
154
154
|
return f.post_collections_id_unfixScheme(coll_id, wait=wait, auth=auth, conn_url=conn_url)
|
|
155
155
|
|
|
156
156
|
|
|
157
|
-
def update_metadata(coll_id: str, metadata: Optional[str], wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
157
|
+
def update_metadata(coll_id: str, metadata: Optional[str], wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
158
158
|
"""update metadata for collection with \"coll_id\""""
|
|
159
159
|
collection_metadata = CollectionMetadata(data=metadata)
|
|
160
160
|
return f.post_collections_metadata(coll_id, collection_metadata, wait=wait, auth=auth, conn_url=conn_url)
|
|
161
161
|
|
|
162
162
|
|
|
163
|
-
def delete_collections(wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
163
|
+
def delete_collections(wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
164
164
|
"""delete all collections"""
|
|
165
165
|
return f.delete_collections(wait=wait, auth=auth, conn_url=conn_url)
|
|
166
166
|
|
|
167
167
|
|
|
168
|
-
def delete_collection(id: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
168
|
+
def delete_collection(id: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
169
169
|
"""delete collection with \"id\""""
|
|
170
170
|
return f.delete_collections_id(id, wait=wait, auth=auth, conn_url=conn_url)
|
|
171
171
|
|
|
172
172
|
|
|
173
|
-
def s3_delete_collection(key: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
173
|
+
def s3_delete_collection(key: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
174
174
|
"""delete collection from s3 by key (that =id if not specified in s3_save_collection)"""
|
|
175
175
|
return f.delete_collections_id_s3(key, wait=wait, auth=auth, conn_url=conn_url)
|
|
176
176
|
|
|
177
177
|
|
|
178
|
-
def delete_from_collection(id: str, ids: List[str], wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
178
|
+
def delete_from_collection(id: str, ids: List[str], wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
179
179
|
"""delete docs with \"ids\" from collection with \"id\""""
|
|
180
180
|
return f.delete_collections_id_del(id, DocsCollectionChange(data=ids), wait=wait, auth=auth, conn_url=conn_url)
|
|
181
181
|
|
|
182
182
|
# Scheme
|
|
183
183
|
|
|
184
184
|
|
|
185
|
-
def get_schemes(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultOwnAndSharedIds:
|
|
185
|
+
def get_schemes(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultOwnAndSharedIds:
|
|
186
186
|
"""return 2 list: own schemes ids and shared schemes ids"""
|
|
187
187
|
return f.get_schemes(auth=auth, conn_url=conn_url)
|
|
188
188
|
|
|
189
189
|
|
|
190
|
-
def get_scheme(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultScheme:
|
|
190
|
+
def get_scheme(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultScheme:
|
|
191
191
|
"""return scheme by id"""
|
|
192
192
|
return f.get_schemes_id(id, auth=auth, conn_url=conn_url)
|
|
193
193
|
|
|
194
194
|
|
|
195
|
-
def get_scheme_raw(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Json:
|
|
195
|
+
def get_scheme_raw(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Json:
|
|
196
196
|
"""return raw scheme data by id"""
|
|
197
197
|
return f.get_schemes_id_raw(id, auth=auth, conn_url=conn_url)
|
|
198
198
|
|
|
199
199
|
|
|
200
|
-
def get_schemes_mapping(scheme_from_id: str, scheme_to_id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultMapping:
|
|
200
|
+
def get_schemes_mapping(scheme_from_id: str, scheme_to_id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultMapping:
|
|
201
201
|
"""return mapping by schemes ids, does not assume if it is not"""
|
|
202
202
|
return f.get_schemes_mapping(scheme_from_id, scheme_to_id, auth=auth, conn_url=conn_url)
|
|
203
203
|
|
|
204
204
|
|
|
205
|
-
def create_scheme(scheme_data: Union[Dict[str, Any], Alias.Json], name: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
205
|
+
def create_scheme(scheme_data: Union[Dict[str, Any], Alias.Json], name: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
206
206
|
"""create scheme\n
|
|
207
207
|
\"scheme_data\" must be json or dict
|
|
208
208
|
return \"id\""""
|
|
@@ -211,7 +211,7 @@ def create_scheme(scheme_data: Union[Dict[str, Any], Alias.Json], name: str, wai
|
|
|
211
211
|
return f.post_schemes(scheme, wait=wait, auth=auth, conn_url=conn_url)
|
|
212
212
|
|
|
213
213
|
|
|
214
|
-
def update_scheme(id: str, scheme_data: Union[Dict[str, Any], Alias.Json], name: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
214
|
+
def update_scheme(id: str, scheme_data: Union[Dict[str, Any], Alias.Json], name: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
215
215
|
"""update scheme\n
|
|
216
216
|
\"scheme_data\" must be json or dict
|
|
217
217
|
return \"id\""""
|
|
@@ -220,29 +220,29 @@ def update_scheme(id: str, scheme_data: Union[Dict[str, Any], Alias.Json], name:
|
|
|
220
220
|
return f.post_schemes_id(id, scheme, wait=wait, auth=auth, conn_url=conn_url)
|
|
221
221
|
|
|
222
222
|
|
|
223
|
-
def create_schemes_mapping(scheme_from_id: str, scheme_to_id: str, mapping: Dict[str, str], wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
223
|
+
def create_schemes_mapping(scheme_from_id: str, scheme_to_id: str, mapping: Dict[str, str], wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
224
224
|
"""save mapping between schemes with ids"""
|
|
225
225
|
return f.post_schemes_mapping(SchemesFixMapping(schemeFromId=scheme_from_id, schemeToId=scheme_to_id, data=mapping), wait=wait, auth=auth, conn_url=conn_url)
|
|
226
226
|
|
|
227
227
|
|
|
228
|
-
def delete_schemes(wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
228
|
+
def delete_schemes(wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
229
229
|
"""delete all schemes"""
|
|
230
230
|
return f.delete_schemes(wait=wait, auth=auth, conn_url=conn_url)
|
|
231
231
|
|
|
232
232
|
|
|
233
|
-
def delete_scheme(id: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
233
|
+
def delete_scheme(id: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
234
234
|
"""delete scheme by id"""
|
|
235
235
|
return f.delete_schemes_id(id, wait=wait, auth=auth, conn_url=conn_url)
|
|
236
236
|
|
|
237
237
|
|
|
238
|
-
def delete_schemes_mapping(scheme_from_id: str, scheme_to_id: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
238
|
+
def delete_schemes_mapping(scheme_from_id: str, scheme_to_id: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
239
239
|
"""delete mapping between schemes with ids"""
|
|
240
240
|
return f.delete_schemes_mapping(SchemesIds(schemeFromId=scheme_from_id, schemeToId=scheme_to_id), wait=wait, auth=auth, conn_url=conn_url)
|
|
241
241
|
|
|
242
242
|
# Common
|
|
243
243
|
|
|
244
244
|
|
|
245
|
-
def check_auth(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
245
|
+
def check_auth(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
246
246
|
"""check auth in core for current user"""
|
|
247
247
|
return f.get_check_auth(auth=auth, conn_url=conn_url)
|
|
248
248
|
|
|
@@ -252,70 +252,70 @@ def ping() -> Alias.Info:
|
|
|
252
252
|
return f.get_ping()
|
|
253
253
|
|
|
254
254
|
|
|
255
|
-
# def get_mappings(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultDocMappingsFull:
|
|
255
|
+
# def get_mappings(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultDocMappingsFull:
|
|
256
256
|
# """outdate\n
|
|
257
257
|
# return list: for each doc - map from scheme to mapping ids"""
|
|
258
258
|
# return f.get_mapping(auth=auth, conn_url=conn_url)
|
|
259
259
|
|
|
260
260
|
|
|
261
|
-
# def get_mapping(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultMapping:
|
|
261
|
+
# def get_mapping(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultMapping:
|
|
262
262
|
# """return mapping by \"id\""""
|
|
263
263
|
# return f.get_mapping_id(id, auth=auth, conn_url=conn_url)
|
|
264
264
|
|
|
265
265
|
|
|
266
|
-
# def create_mapping(docs_ids: List[str], scheme_id: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
266
|
+
# def create_mapping(docs_ids: List[str], scheme_id: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
267
267
|
# """try to do and save mapping docs with \"docs_ids\" with scheme with \"scheme_id\", ignore if failed"""
|
|
268
268
|
# return f.post_mapping(DocsAndScheme(docsIds=docs_ids, schemeId=scheme_id), wait=wait, auth=auth, conn_url=conn_url)
|
|
269
269
|
|
|
270
270
|
|
|
271
|
-
# def delete_mapping(doc_id: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
271
|
+
# def delete_mapping(doc_id: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
272
272
|
# """delete mappings for doc with \"doc_id\""""
|
|
273
273
|
# return f.delete_mapping_id(doc_id, wait=wait, auth=auth, conn_url=conn_url)
|
|
274
274
|
|
|
275
275
|
|
|
276
|
-
# def delete_all(wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
276
|
+
# def delete_all(wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
277
277
|
# """for admin: delete all"""
|
|
278
278
|
# return f.delete_all(wait=wait, auth=auth, conn_url=conn_url)
|
|
279
279
|
|
|
280
280
|
# UserShare
|
|
281
281
|
|
|
282
282
|
|
|
283
|
-
def get_shared_collection(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultLogins:
|
|
283
|
+
def get_shared_collection(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultLogins:
|
|
284
284
|
"""return list logins to which user has given access to the collection with \"id\""""
|
|
285
285
|
return f.get_share_collection_id(id, auth=auth, conn_url=conn_url)
|
|
286
286
|
|
|
287
287
|
|
|
288
|
-
def get_shared_scheme(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultLogins:
|
|
288
|
+
def get_shared_scheme(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultLogins:
|
|
289
289
|
"""return list logins to which user has given access to the scheme with \"id\""""
|
|
290
290
|
return f.get_share_scheme_id(id, auth=auth, conn_url=conn_url)
|
|
291
291
|
|
|
292
292
|
|
|
293
|
-
def get_shared_app(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultLogins:
|
|
293
|
+
def get_shared_app(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultLogins:
|
|
294
294
|
"""return list logins to which user has given access to the app with \"id\""""
|
|
295
295
|
return f.get_share_userApp_id(id, auth=auth, conn_url=conn_url)
|
|
296
296
|
|
|
297
297
|
|
|
298
|
-
def get_shared_by_login(login: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultSharedForLogin:
|
|
298
|
+
def get_shared_by_login(login: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultSharedForLogin:
|
|
299
299
|
"""return structure with all info about share to user with \"login\""""
|
|
300
300
|
return f.get_share_login(login, auth=auth, conn_url=conn_url)
|
|
301
301
|
|
|
302
302
|
|
|
303
|
-
def share_collection(id: str, user_logins: List[str], wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
303
|
+
def share_collection(id: str, user_logins: List[str], wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
304
304
|
"""gives access to the collection with \"id\" to all users with \"user_logins\""""
|
|
305
305
|
return f.post_share_collection_id(id, SharedWithUsers(userLogins=user_logins), wait=wait, auth=auth, conn_url=conn_url)
|
|
306
306
|
|
|
307
307
|
|
|
308
|
-
def share_scheme(id: str, user_logins: List[str], wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
308
|
+
def share_scheme(id: str, user_logins: List[str], wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
309
309
|
"""gives access to the scheme with \"id\" to all users with \"user_logins\""""
|
|
310
310
|
return f.post_share_scheme_id(id, SharedWithUsers(userLogins=user_logins), wait=wait, auth=auth, conn_url=conn_url)
|
|
311
311
|
|
|
312
312
|
|
|
313
|
-
def share_app(id: str, user_logins: List[str], wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
313
|
+
def share_app(id: str, user_logins: List[str], wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
314
314
|
"""gives access to the app with \"id\" to all users with \"user_logins\""""
|
|
315
315
|
return f.post_share_userApp_id(id, SharedWithUsers(userLogins=user_logins), wait=wait, auth=auth, conn_url=conn_url)
|
|
316
316
|
|
|
317
317
|
|
|
318
|
-
def share(user_logins: List[str], collections_ids: Optional[List[str]] = None, schemes_ids: Optional[List[str]] = None, user_apps_ids: Optional[List[str]] = None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
318
|
+
def share(user_logins: List[str], collections_ids: Optional[List[str]] = None, schemes_ids: Optional[List[str]] = None, user_apps_ids: Optional[List[str]] = None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
319
319
|
"""gives access to everything listed to all users with \"user_logins\""""
|
|
320
320
|
assert user_logins is not None, "\"user_logins\" is empty"
|
|
321
321
|
collections_ids = [] if collections_ids is None else collections_ids
|
|
@@ -324,7 +324,7 @@ def share(user_logins: List[str], collections_ids: Optional[List[str]] = None, s
|
|
|
324
324
|
return f.post_share(Shared(userLogins=user_logins, collectionsIds=collections_ids, schemesIds=schemes_ids, userAppsIds=user_apps_ids), wait=wait, auth=auth, conn_url=conn_url)
|
|
325
325
|
|
|
326
326
|
|
|
327
|
-
def delete_shared(user_logins: List[str], collections_ids: Optional[List[str]] = None, schemes_ids: Optional[List[str]] = None, user_apps_ids: Optional[List[str]] = None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
327
|
+
def delete_shared(user_logins: List[str], collections_ids: Optional[List[str]] = None, schemes_ids: Optional[List[str]] = None, user_apps_ids: Optional[List[str]] = None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
328
328
|
"""removes access to everything listed to all users with \"user_logins\""""
|
|
329
329
|
assert user_logins is not None, "\"user_logins\" is empty"
|
|
330
330
|
collections_ids = [] if collections_ids is None else collections_ids
|
|
@@ -333,70 +333,71 @@ def delete_shared(user_logins: List[str], collections_ids: Optional[List[str]] =
|
|
|
333
333
|
return f.delete_share(Shared(userLogins=user_logins, collectionsIds=collections_ids, schemesIds=schemes_ids, userAppsIds=user_apps_ids), wait=wait, auth=auth, conn_url=conn_url)
|
|
334
334
|
|
|
335
335
|
|
|
336
|
-
def delete_shared_all(wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
336
|
+
def delete_shared_all(wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
337
337
|
"""removes access to everything for all for current user"""
|
|
338
338
|
return f.delete_share_all(wait=wait, auth=auth, conn_url=conn_url)
|
|
339
339
|
|
|
340
340
|
# Registration
|
|
341
341
|
|
|
342
342
|
|
|
343
|
-
def get_user(login: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
343
|
+
def get_user(login: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
344
344
|
"""admin: displays saved information about the user"""
|
|
345
345
|
return f.get_register_login(login, auth=auth, conn_url=conn_url)
|
|
346
346
|
|
|
347
347
|
|
|
348
|
-
def get_users(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultLogins:
|
|
348
|
+
def get_users(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultLogins:
|
|
349
349
|
"""admin: returns a list of all logins"""
|
|
350
350
|
return f.get_register_all(auth=auth, conn_url=conn_url)
|
|
351
351
|
|
|
352
352
|
|
|
353
|
-
def create_user(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
353
|
+
def create_user(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
354
354
|
"""create user in malevich-core, all operations will continue on his behalf"""
|
|
355
355
|
return f.post_register(auth=auth, conn_url=conn_url)
|
|
356
356
|
|
|
357
357
|
|
|
358
|
-
def delete_user(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
358
|
+
def delete_user(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
359
359
|
"""delete current user, not raise if user not exist"""
|
|
360
360
|
return f.delete_register(auth=auth, conn_url=conn_url)
|
|
361
361
|
|
|
362
362
|
|
|
363
|
-
def delete_user_login(login: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> None:
|
|
363
|
+
def delete_user_login(login: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> None:
|
|
364
364
|
"""admin: delete user by login"""
|
|
365
365
|
f.delete_register_login(login, wait=wait, auth=auth, conn_url=conn_url)
|
|
366
366
|
|
|
367
367
|
# UserApps
|
|
368
368
|
|
|
369
369
|
|
|
370
|
-
def get_apps(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultOwnAndSharedIds:
|
|
370
|
+
def get_apps(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultOwnAndSharedIds:
|
|
371
371
|
"""return apps ids for current user"""
|
|
372
372
|
return f.get_userApps(auth=auth, conn_url=conn_url)
|
|
373
373
|
|
|
374
374
|
|
|
375
|
-
def get_apps_real(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultOwnAndSharedIds:
|
|
375
|
+
def get_apps_real(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultOwnAndSharedIds:
|
|
376
376
|
"""return apps real ids for current user"""
|
|
377
377
|
return f.get_userApps_realIds(auth=auth, conn_url=conn_url)
|
|
378
378
|
|
|
379
379
|
|
|
380
|
-
def get_apps_map(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultOwnAndSharedIdsMap:
|
|
380
|
+
def get_apps_map(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultOwnAndSharedIdsMap:
|
|
381
381
|
"""return apps ids with real ids for current user"""
|
|
382
382
|
return f.get_userApps_mapIds(auth=auth, conn_url=conn_url)
|
|
383
383
|
|
|
384
384
|
|
|
385
|
-
def get_app(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> UserApp:
|
|
385
|
+
def get_app(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> UserApp:
|
|
386
386
|
"""return app by \"id\""""
|
|
387
387
|
return f.get_userApps_id(id, auth=auth, conn_url=conn_url)
|
|
388
388
|
|
|
389
389
|
|
|
390
|
-
def get_app_real(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> UserApp:
|
|
390
|
+
def get_app_real(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> UserApp:
|
|
391
391
|
"""return app by \"real id\""""
|
|
392
392
|
return f.get_userApps_realId(id, auth=auth, conn_url=conn_url)
|
|
393
393
|
|
|
394
394
|
|
|
395
|
-
def create_app(app_id: str, processor_id: str, input_id: Optional[str]=None, output_id: Optional[str]=None, app_cfg: Optional[Union[Dict[str, Any], Alias.Json]] = None, image_ref: Optional[str] = None, image_auth: Optional[AUTH]=None, collections_from: Optional[Dict[str, str]]=None, extra_collections_from: Optional[Dict[str, str]]=None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
395
|
+
def create_app(app_id: str, processor_id: str, input_id: Optional[str]=None, output_id: Optional[str]=None, app_cfg: Optional[Union[Dict[str, Any], Alias.Json]] = None, image_ref: Optional[str] = None, image_auth: Optional[AUTH]=None, platform: str = "base", platform_settings: Optional[str] = None, collections_from: Optional[Dict[str, str]]=None, extra_collections_from: Optional[Dict[str, str]]=None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
396
396
|
"""create app\n
|
|
397
397
|
\"app_cfg\" must be json or dict or None\n
|
|
398
398
|
\"image_ref\" automatically generated by id, but this is not always True, it is better to set it\n
|
|
399
399
|
return \"id\""""
|
|
400
|
+
assert platform in POSSIBLE_APPS_PLATFORMS, f"wrong platform: {platform}, possible platforms: {POSSIBLE_APPS_PLATFORMS}"
|
|
400
401
|
app_cfg_json = None if app_cfg is None else to_json(app_cfg)
|
|
401
402
|
image_user = image_auth[0] if image_auth is not None else Config.USERNAME
|
|
402
403
|
image_token = image_auth[1] if image_auth is not None else Config.TOKEN
|
|
@@ -407,14 +408,15 @@ def create_app(app_id: str, processor_id: str, input_id: Optional[str]=None, out
|
|
|
407
408
|
if Config.WITH_WARNINGS:
|
|
408
409
|
Config.logger.warning(f"assumed image ref: {image_ref}")
|
|
409
410
|
json_image = JsonImage(ref=image_ref, user=image_user, token=image_token)
|
|
410
|
-
app = UserApp(appId=app_id, inputId=input_id, processorId=processor_id, outputId=output_id, cfg=app_cfg_json, image=json_image, collectionsFrom=collections_from, extraCollectionsFrom=extra_collections_from)
|
|
411
|
+
app = UserApp(appId=app_id, inputId=input_id, processorId=processor_id, outputId=output_id, cfg=app_cfg_json, image=json_image, platform=platform, platformSettings=platform_settings, collectionsFrom=collections_from, extraCollectionsFrom=extra_collections_from)
|
|
411
412
|
return f.post_userApps(app, wait=wait, auth=auth, conn_url=conn_url)
|
|
412
413
|
|
|
413
414
|
|
|
414
|
-
def update_app(id: str, app_id: str, processor_id: str, input_id: Optional[str]=None, output_id: Optional[str]=None, app_cfg: Optional[Union[Dict[str, Any], Alias.Json]] = None, image_ref: Optional[str] = None, image_auth: Optional[AUTH]=None, collections_from: Optional[Dict[str, str]]=None, extra_collections_from: Optional[Dict[str, str]]=None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
415
|
+
def update_app(id: str, app_id: str, processor_id: str, input_id: Optional[str]=None, output_id: Optional[str]=None, app_cfg: Optional[Union[Dict[str, Any], Alias.Json]] = None, image_ref: Optional[str] = None, image_auth: Optional[AUTH]=None, platform: str = "base", platform_settings: Optional[str] = None, collections_from: Optional[Dict[str, str]]=None, extra_collections_from: Optional[Dict[str, str]]=None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
415
416
|
"""update app by \"id\"\n
|
|
416
417
|
\"app_cfg\" must be json or dict or None\n
|
|
417
418
|
\"image_ref\" automatically generated by id, but this is not always True, it is better to set it"""
|
|
419
|
+
assert platform in POSSIBLE_APPS_PLATFORMS, f"wrong platform: {platform}, possible platforms: {POSSIBLE_APPS_PLATFORMS}"
|
|
418
420
|
app_cfg_json = None if app_cfg is None else to_json(app_cfg)
|
|
419
421
|
image_user = image_auth[0] if image_auth is not None else Config.USERNAME
|
|
420
422
|
image_token = image_auth[1] if image_auth is not None else Config.TOKEN
|
|
@@ -425,48 +427,48 @@ def update_app(id: str, app_id: str, processor_id: str, input_id: Optional[str]=
|
|
|
425
427
|
if Config.WITH_WARNINGS:
|
|
426
428
|
Config.logger.warning(f"assumed image ref: {image_ref}")
|
|
427
429
|
json_image = JsonImage(ref=image_ref, user=image_user, token=image_token)
|
|
428
|
-
app = UserApp(appId=app_id, inputId=input_id, processorId=processor_id, outputId=output_id, cfg=app_cfg_json, image=json_image, collectionsFrom=collections_from, extraCollectionsFrom=extra_collections_from)
|
|
430
|
+
app = UserApp(appId=app_id, inputId=input_id, processorId=processor_id, outputId=output_id, cfg=app_cfg_json, image=json_image, platform=platform, platformSettings=platform_settings, collectionsFrom=collections_from, extraCollectionsFrom=extra_collections_from)
|
|
429
431
|
return f.post_userApps_id(id, app, wait=wait, auth=auth, conn_url=conn_url)
|
|
430
432
|
|
|
431
433
|
|
|
432
|
-
def delete_apps(wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
434
|
+
def delete_apps(wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
433
435
|
"""delete all user apps"""
|
|
434
436
|
return f.delete_userApps(wait=wait, auth=auth, conn_url=conn_url)
|
|
435
437
|
|
|
436
438
|
|
|
437
|
-
def delete_app(id: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
439
|
+
def delete_app(id: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
438
440
|
"""delete user app by \"id\""""
|
|
439
441
|
return f.delete_userApps_id(id, wait=wait, auth=auth, conn_url=conn_url)
|
|
440
442
|
|
|
441
443
|
# UserTasks
|
|
442
444
|
|
|
443
445
|
|
|
444
|
-
def get_tasks(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
446
|
+
def get_tasks(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
445
447
|
"""return tasks ids for current user"""
|
|
446
448
|
return f.get_userTasks(auth=auth, conn_url=conn_url)
|
|
447
449
|
|
|
448
450
|
|
|
449
|
-
def get_tasks_real(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
451
|
+
def get_tasks_real(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
450
452
|
"""return tasks real ids for current user"""
|
|
451
453
|
return f.get_userTasks_realIds(auth=auth, conn_url=conn_url)
|
|
452
454
|
|
|
453
455
|
|
|
454
|
-
def get_tasks_map(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIdsMap:
|
|
456
|
+
def get_tasks_map(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIdsMap:
|
|
455
457
|
"""return tasks ids with real ids for current user"""
|
|
456
458
|
return f.get_userTasks_mapIds(auth=auth, conn_url=conn_url)
|
|
457
459
|
|
|
458
460
|
|
|
459
|
-
def get_task(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> UserTask:
|
|
461
|
+
def get_task(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> UserTask:
|
|
460
462
|
"""return task by \"id\""""
|
|
461
463
|
return f.get_userTasks_id(id, auth=auth, conn_url=conn_url)
|
|
462
464
|
|
|
463
465
|
|
|
464
|
-
def get_task_real(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> UserTask:
|
|
466
|
+
def get_task_real(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> UserTask:
|
|
465
467
|
"""return task by \"real id\""""
|
|
466
468
|
return f.get_userTasks_realId(id, auth=auth, conn_url=conn_url)
|
|
467
469
|
|
|
468
470
|
|
|
469
|
-
def create_task(task_id: str, app_id: Optional[str] = None, apps_depends: Optional[List[str]] = None, tasks_depends: Optional[List[str]] = None, synthetic: bool = False, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
471
|
+
def create_task(task_id: str, app_id: Optional[str] = None, apps_depends: Optional[List[str]] = None, tasks_depends: Optional[List[str]] = None, synthetic: bool = False, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
470
472
|
"""create task"""
|
|
471
473
|
if synthetic:
|
|
472
474
|
assert app_id is None, "app_id should be None for synthetic task"
|
|
@@ -480,7 +482,7 @@ def create_task(task_id: str, app_id: Optional[str] = None, apps_depends: Option
|
|
|
480
482
|
return f.post_userTasks(task, wait=wait, auth=auth, conn_url=conn_url)
|
|
481
483
|
|
|
482
484
|
|
|
483
|
-
def update_task(id: str, task_id: str, app_id: str, apps_depends: Optional[List[str]] = None, tasks_depends: Optional[List[str]] = None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
485
|
+
def update_task(id: str, task_id: str, app_id: str, apps_depends: Optional[List[str]] = None, tasks_depends: Optional[List[str]] = None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
484
486
|
"""update task by \"id\""""
|
|
485
487
|
if apps_depends is None:
|
|
486
488
|
apps_depends = []
|
|
@@ -490,44 +492,44 @@ def update_task(id: str, task_id: str, app_id: str, apps_depends: Optional[List[
|
|
|
490
492
|
return f.post_userTasks_id(id, task, wait=wait, auth=auth, conn_url=conn_url)
|
|
491
493
|
|
|
492
494
|
|
|
493
|
-
def delete_tasks(wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
495
|
+
def delete_tasks(wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
494
496
|
"""delete all user tasks"""
|
|
495
497
|
return f.delete_userTasks(wait=wait, auth=auth, conn_url=conn_url)
|
|
496
498
|
|
|
497
499
|
|
|
498
|
-
def delete_task(id: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
500
|
+
def delete_task(id: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
499
501
|
"""delete user task by \"id\""""
|
|
500
502
|
return f.delete_userTasks_id(id, wait=wait, auth=auth, conn_url=conn_url)
|
|
501
503
|
|
|
502
504
|
# UserCfgs
|
|
503
505
|
|
|
504
506
|
|
|
505
|
-
def get_cfgs(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
507
|
+
def get_cfgs(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
506
508
|
"""return cfgs ids for current user"""
|
|
507
509
|
return f.get_userCfgs(auth=auth, conn_url=conn_url)
|
|
508
510
|
|
|
509
511
|
|
|
510
|
-
def get_cfgs_real(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
512
|
+
def get_cfgs_real(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
511
513
|
"""return cfgs real ids for current user"""
|
|
512
514
|
return f.get_userCfgs_realIds(auth=auth, conn_url=conn_url)
|
|
513
515
|
|
|
514
516
|
|
|
515
|
-
def get_cfgs_map(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIdsMap:
|
|
517
|
+
def get_cfgs_map(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIdsMap:
|
|
516
518
|
"""return cfgs ids with real ids for current user"""
|
|
517
519
|
return f.get_userCfgs_mapIds(auth=auth, conn_url=conn_url)
|
|
518
520
|
|
|
519
521
|
|
|
520
|
-
def get_cfg(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultUserCfg:
|
|
522
|
+
def get_cfg(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultUserCfg:
|
|
521
523
|
"""return cfg by \"id\""""
|
|
522
524
|
return f.get_userCfgs_id(id, auth=auth, conn_url=conn_url)
|
|
523
525
|
|
|
524
526
|
|
|
525
|
-
def get_cfg_real(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultUserCfg:
|
|
527
|
+
def get_cfg_real(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultUserCfg:
|
|
526
528
|
"""return cfg by \"real id\""""
|
|
527
529
|
return f.get_userCfgs_realId(id, auth=auth, conn_url=conn_url)
|
|
528
530
|
|
|
529
531
|
|
|
530
|
-
def create_cfg(cfg_id: str, cfg: Union[Dict[str, Any], Alias.Json, Cfg], wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
532
|
+
def create_cfg(cfg_id: str, cfg: Union[Dict[str, Any], Alias.Json, Cfg], wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
531
533
|
"""create configuration file\n
|
|
532
534
|
\"cfg\" must be json or dict or Cfg\n
|
|
533
535
|
return \"id\""""
|
|
@@ -539,7 +541,7 @@ def create_cfg(cfg_id: str, cfg: Union[Dict[str, Any], Alias.Json, Cfg], wait: b
|
|
|
539
541
|
return f.post_userCfgs(user_cfg, wait=wait, auth=auth, conn_url=conn_url)
|
|
540
542
|
|
|
541
543
|
|
|
542
|
-
def update_cfg(id: str, cfg_id: str, cfg: Union[Dict[str, Any], Alias.Json, Cfg], wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
544
|
+
def update_cfg(id: str, cfg_id: str, cfg: Union[Dict[str, Any], Alias.Json, Cfg], wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
543
545
|
"""update configuration file\n
|
|
544
546
|
\"cfg\" must be json or dict or Cfg"""
|
|
545
547
|
if isinstance(cfg, Cfg):
|
|
@@ -550,112 +552,122 @@ def update_cfg(id: str, cfg_id: str, cfg: Union[Dict[str, Any], Alias.Json, Cfg]
|
|
|
550
552
|
return f.post_userCfgs_id(id, user_cfg, wait=wait, auth=auth, conn_url=conn_url)
|
|
551
553
|
|
|
552
554
|
|
|
553
|
-
def delete_cfgs(wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
555
|
+
def delete_cfgs(wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
554
556
|
"""delete all user cfgs"""
|
|
555
557
|
return f.delete_userCfgs(wait=wait, auth=auth, conn_url=conn_url)
|
|
556
558
|
|
|
557
559
|
|
|
558
|
-
def delete_cfg(id: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
560
|
+
def delete_cfg(id: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
559
561
|
"""delete user cfg by \"id\""""
|
|
560
562
|
return f.delete_userCfgs_id(id, wait=wait, auth=auth, conn_url=conn_url)
|
|
561
563
|
|
|
562
564
|
# OperationResults
|
|
563
565
|
|
|
564
566
|
|
|
565
|
-
def get_operations_results(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
567
|
+
def get_operations_results(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
566
568
|
"""return list of operations ids"""
|
|
567
569
|
return f.get_operationResults(auth=auth, conn_url=conn_url)
|
|
568
570
|
|
|
569
571
|
|
|
570
|
-
def get_operation_result(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> str:
|
|
572
|
+
def get_operation_result(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> str:
|
|
571
573
|
"""return result by operation \"id\" if operation status is \"OK\""""
|
|
572
574
|
return f.get_operationResults_id(id, auth=auth, conn_url=conn_url)
|
|
573
575
|
|
|
574
576
|
|
|
575
|
-
def delete_operations_results(wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
577
|
+
def delete_operations_results(wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
576
578
|
"""delete all operations results"""
|
|
577
579
|
return f.delete_operationResults(wait=wait, auth=auth, conn_url=conn_url)
|
|
578
580
|
|
|
579
581
|
|
|
580
|
-
def delete_operation_result(id: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
582
|
+
def delete_operation_result(id: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
581
583
|
"""delete operation result by \"id\""""
|
|
582
584
|
return f.delete_operationResults_id(id, wait=wait, auth=auth, conn_url=conn_url)
|
|
583
585
|
|
|
584
586
|
# TempRun
|
|
585
587
|
|
|
586
588
|
|
|
587
|
-
def get_run_condition(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Condition:
|
|
589
|
+
def get_run_condition(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Condition:
|
|
588
590
|
"""return run condition by operation \"id\" for running task"""
|
|
589
591
|
return f.get_run_condition(id, auth=auth, conn_url=conn_url)
|
|
590
592
|
|
|
591
593
|
|
|
592
|
-
def get_run_active_runs(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
594
|
+
def get_run_active_runs(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
593
595
|
"""return list running operationIds"""
|
|
594
596
|
return f.get_run_activeRuns(auth=auth, conn_url=conn_url)
|
|
595
597
|
|
|
596
598
|
|
|
597
|
-
def get_run_main_task_cfg(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> MainTaskCfg:
|
|
599
|
+
def get_run_main_task_cfg(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> MainTaskCfg:
|
|
598
600
|
"""return mainTaskCfg by operation \"id\" for running task"""
|
|
599
601
|
return f.get_run_mainTaskCfg(id, auth=auth, conn_url=conn_url)
|
|
600
602
|
|
|
601
603
|
|
|
602
|
-
def get_task_runs(task_id: str, cfg_id: Optional[str]=None, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
604
|
+
def get_task_runs(task_id: str, cfg_id: Optional[str]=None, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> ResultIds:
|
|
603
605
|
"""return list running operationIds with \"task_id\" and \"cfg_id\" if specified"""
|
|
604
606
|
return f.get_run_operationsIds(task_id, cfg_id, auth=auth, conn_url=conn_url)
|
|
605
607
|
|
|
606
608
|
# Manager
|
|
607
609
|
|
|
608
610
|
|
|
609
|
-
def logs(id: str, run_id: Optional[str] = None, force: bool=True, with_show: bool=True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> AppLogs:
|
|
611
|
+
def logs(id: str, run_id: Optional[str] = None, force: bool=True, with_show: bool=True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> AppLogs:
|
|
610
612
|
"""return task logs by operation \"id\" and \"run_id\""""
|
|
611
613
|
task = LogsTask(operationId=id, runId=run_id)
|
|
612
614
|
return f.get_manager_logs(task, with_show=with_show, auth=auth, conn_url=conn_url)
|
|
613
615
|
|
|
614
616
|
|
|
615
|
-
def logs_app(id: str, task_id: str, app_id: str, run_id: Optional[str] = None, force: bool=True, with_show: bool=True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> AppLogs:
|
|
617
|
+
def logs_app(id: str, task_id: str, app_id: str, run_id: Optional[str] = None, force: bool=True, with_show: bool=True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> AppLogs:
|
|
616
618
|
"""return app logs by operation \"id\", \"run_id\", \"task_id\" (that "null" if not exist) and \"app_id\""""
|
|
617
619
|
task = LogsTask(operationId=id, runId=run_id, appId=app_id, taskId=task_id, force=force)
|
|
618
620
|
return f.get_manager_logs(task, with_show=with_show, auth=auth, conn_url=conn_url)
|
|
619
621
|
|
|
620
622
|
|
|
621
|
-
def logs_clickhouse(auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Json:
|
|
623
|
+
def logs_clickhouse(*, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Json:
|
|
622
624
|
"""return all clickhouse logs"""
|
|
623
625
|
return f.get_clickhouse_all(auth=auth, conn_url=conn_url)
|
|
624
626
|
|
|
625
627
|
|
|
626
|
-
def logs_clickhouse_id(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Json:
|
|
628
|
+
def logs_clickhouse_id(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Json:
|
|
627
629
|
"""return clickhouse logs by operation \"id\""""
|
|
628
630
|
return f.get_clickhouse_id(id, auth=auth, conn_url=conn_url)
|
|
629
631
|
|
|
630
632
|
|
|
631
|
-
def get_dag_key_value(id: str, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Json:
|
|
633
|
+
def get_dag_key_value(id: str, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Json:
|
|
632
634
|
"""return key-value cfg from dag by operation \"id\""""
|
|
633
635
|
return f.get_manager_dagKeyValue_operationId(id, auth=auth, conn_url=conn_url)
|
|
634
636
|
|
|
635
637
|
|
|
636
|
-
def update_dag_key_value(data: Dict[str, str], operationId: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> None:
|
|
638
|
+
def update_dag_key_value(data: Dict[str, str], operationId: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> None:
|
|
637
639
|
"""update key-value cfg from dag by operation \"id\" and \"data\""""
|
|
638
640
|
return f.post_manager_dagKeyValue(KeysValues(data=data, operationId=operationId), wait=wait, auth=auth, conn_url=conn_url)
|
|
639
641
|
|
|
640
642
|
|
|
641
|
-
def get_app_info(id: str, parse: bool=False, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Union[Alias.Json, AppFunctionsInfo]:
|
|
643
|
+
def get_app_info(id: str, parse: bool=False, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Union[Alias.Json, AppFunctionsInfo]:
|
|
642
644
|
"""return json with functions app info, id is appId"""
|
|
643
645
|
return f.get_app_info(id, parse=parse, auth=auth, conn_url=conn_url)
|
|
644
646
|
|
|
645
647
|
|
|
646
|
-
def get_app_info_by_real_id(id: str, parse: bool=False, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Union[Alias.Json, AppFunctionsInfo]:
|
|
648
|
+
def get_app_info_by_real_id(id: str, parse: bool=False, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Union[Alias.Json, AppFunctionsInfo]:
|
|
647
649
|
"""return json with functions app info, id is real id for app"""
|
|
648
650
|
return f.get_app_info_by_real_id(id, parse=parse, auth=auth, conn_url=conn_url)
|
|
649
651
|
|
|
650
652
|
|
|
651
|
-
def
|
|
653
|
+
def get_image_info(image_ref: str, image_auth: Optional[AUTH]=None, parse: bool=False, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Union[Alias.Json, AppFunctionsInfo]:
|
|
654
|
+
"""return json with functions image info"""
|
|
655
|
+
image_user = image_auth[0] if image_auth is not None else Config.USERNAME
|
|
656
|
+
image_token = image_auth[1] if image_auth is not None else Config.TOKEN
|
|
657
|
+
if Config.WITH_WARNINGS and (image_user is None or image_token is None):
|
|
658
|
+
Config.logger.warning("image_auth not set")
|
|
659
|
+
json_image = JsonImage(ref=image_ref, user=image_user, token=image_token)
|
|
660
|
+
return f.get_image_info(json_image, parse=parse, auth=auth, conn_url=conn_url)
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
def get_task_schedules(operation_id: str, with_show: bool=True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Schedules:
|
|
652
664
|
"""return schedule ids by \"operation_id\""""
|
|
653
665
|
operation = Operation(operationId=operation_id)
|
|
654
666
|
return f.get_task_schedules(operation, with_show=with_show, auth=auth, conn_url=conn_url)
|
|
655
667
|
|
|
656
668
|
|
|
657
669
|
# FIXME check component
|
|
658
|
-
def task_full(task_id: str, cfg_id: str, info_url: Optional[str]=None, debug_mode: bool=False, core_manage: bool = False, single_request: bool = False, profile_mode: Optional[str] = None, with_show: bool=True, long: bool=False, long_timeout: Optional[int]=WAIT_RESULT_TIMEOUT, scaleInfo: List[ScaleInfo] = None, component: TaskComponent = None, policy: TaskPolicy = None, schedule: Optional[Schedule] = None, restrictions: Optional[Restrictions] = None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> AppLogs:
|
|
670
|
+
def task_full(task_id: str, cfg_id: str, info_url: Optional[str]=None, debug_mode: bool=False, core_manage: bool = False, single_request: bool = False, profile_mode: Optional[str] = None, with_show: bool=True, long: bool=False, long_timeout: Optional[int]=WAIT_RESULT_TIMEOUT, scaleInfo: List[ScaleInfo] = None, component: TaskComponent = None, policy: TaskPolicy = None, schedule: Optional[Schedule] = None, restrictions: Optional[Restrictions] = None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> AppLogs:
|
|
659
671
|
"""prepare, run and stop task by \"task_id\", \"cfg_id\" and other
|
|
660
672
|
|
|
661
673
|
Args:
|
|
@@ -688,7 +700,7 @@ def task_full(task_id: str, cfg_id: str, info_url: Optional[str]=None, debug_mod
|
|
|
688
700
|
return f.post_manager_task(task, with_show=with_show, long=long, long_timeout=long_timeout, wait=wait, auth=auth, conn_url=conn_url)
|
|
689
701
|
|
|
690
702
|
|
|
691
|
-
def task_prepare(task_id: str, cfg_id: Optional[str]=None, info_url: Optional[str]=None, debug_mode: bool=False, core_manage: bool = False, kafka_mode: bool = False, single_request: bool = False, kafka_mode_url_response: Optional[str] = None, with_listener: bool = False, tl_without_data: Optional[int] = None, wait_runs: bool = True, with_logs: bool = False, profile_mode: Optional[str] = None, with_show: bool=None, long: bool=False, long_timeout: int=WAIT_RESULT_TIMEOUT, scaleInfo: List[ScaleInfo] = None, component: TaskComponent = None, policy: TaskPolicy = None, restrictions: Optional[Restrictions] = None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> AppLogs:
|
|
703
|
+
def task_prepare(task_id: str, cfg_id: Optional[str]=None, info_url: Optional[str]=None, debug_mode: bool=False, core_manage: bool = False, kafka_mode: bool = False, single_request: bool = False, kafka_mode_url_response: Optional[str] = None, with_listener: bool = False, tl_without_data: Optional[int] = None, wait_runs: bool = True, with_logs: bool = False, profile_mode: Optional[str] = None, with_show: bool=None, long: bool=False, long_timeout: int=WAIT_RESULT_TIMEOUT, scaleInfo: List[ScaleInfo] = None, component: TaskComponent = None, policy: TaskPolicy = None, restrictions: Optional[Restrictions] = None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> AppLogs:
|
|
692
704
|
"""prepare task by \"task_id\", \"cfg_id\" and other, return operation_id
|
|
693
705
|
|
|
694
706
|
Args:
|
|
@@ -731,7 +743,7 @@ def task_prepare(task_id: str, cfg_id: Optional[str]=None, info_url: Optional[st
|
|
|
731
743
|
return f.post_manager_task(task, with_show=with_show, long=long, long_timeout=long_timeout, wait=wait, auth=auth, conn_url=conn_url)
|
|
732
744
|
|
|
733
745
|
|
|
734
|
-
def task_run(operation_id: str, cfg_id: Optional[str]=None, info_url: Optional[str]=None, debug_mode: Optional[bool]=None, run_id: Optional[str] = None, single_request: Optional[bool] = None, profile_mode: Optional[str] = None, with_show: bool=None, long: bool=False, long_timeout: int=WAIT_RESULT_TIMEOUT, with_logs: bool = False, schedule: Optional[Schedule] = None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Optional[AppLogs]:
|
|
746
|
+
def task_run(operation_id: str, cfg_id: Optional[str]=None, info_url: Optional[str]=None, debug_mode: Optional[bool]=None, run_id: Optional[str] = None, single_request: Optional[bool] = None, profile_mode: Optional[str] = None, with_show: bool=None, long: bool=False, long_timeout: int=WAIT_RESULT_TIMEOUT, with_logs: bool = False, schedule: Optional[Schedule] = None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Optional[AppLogs]:
|
|
735
747
|
"""run prepared task by \"operation_id\" with \"cfg_id\" and other overridden parameters
|
|
736
748
|
|
|
737
749
|
Args:
|
|
@@ -757,13 +769,13 @@ def task_run(operation_id: str, cfg_id: Optional[str]=None, info_url: Optional[s
|
|
|
757
769
|
return f.post_manager_task_run(task, with_show=with_show, long=long, long_timeout=long_timeout, wait=wait, auth=auth, conn_url=conn_url)
|
|
758
770
|
|
|
759
771
|
|
|
760
|
-
def task_unschedule(schedule_id: str, with_show: bool=True, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
772
|
+
def task_unschedule(schedule_id: str, with_show: bool=True, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Info:
|
|
761
773
|
"""unschedule task by \"schedule_id\""""
|
|
762
774
|
operation = UnscheduleOperation(scheduleId=schedule_id)
|
|
763
775
|
return f.post_manager_task_unschedule(operation, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url)
|
|
764
776
|
|
|
765
777
|
|
|
766
|
-
def task_stop(operation_id: str, with_logs: bool = False, info_url: Optional[str] = None, with_show: bool=None, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Optional[AppLogs]:
|
|
778
|
+
def task_stop(operation_id: str, with_logs: bool = False, info_url: Optional[str] = None, with_show: bool=None, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Optional[AppLogs]:
|
|
767
779
|
"""stop task by \"operation_id\"
|
|
768
780
|
|
|
769
781
|
Args:
|
|
@@ -779,37 +791,37 @@ def task_stop(operation_id: str, with_logs: bool = False, info_url: Optional[str
|
|
|
779
791
|
return f.post_manager_task_stop(task, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url)
|
|
780
792
|
|
|
781
793
|
|
|
782
|
-
def task_stop_all(with_logs: bool = False, info_url: Optional[str] = None, with_show: bool=True, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Json:
|
|
794
|
+
def task_stop_all(with_logs: bool = False, info_url: Optional[str] = None, with_show: bool=True, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Json:
|
|
783
795
|
"""stop task by \"operation_id\""""
|
|
784
796
|
task = StopOperationMany(withLogs=with_logs, infoUrl=info_url)
|
|
785
797
|
return f.post_manager_task_stop_all(task, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url)
|
|
786
798
|
|
|
787
799
|
|
|
788
|
-
def task_resume(operation_id: str, with_show: bool=True, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Empty:
|
|
800
|
+
def task_resume(operation_id: str, with_show: bool=True, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Empty:
|
|
789
801
|
"""resume task by \"operation_id\""""
|
|
790
802
|
task = Operation(operationId=operation_id)
|
|
791
803
|
return f.post_manager_task_resume(task, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url)
|
|
792
804
|
|
|
793
805
|
|
|
794
|
-
def task_pause(operation_id: str, with_show: bool=True, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Empty:
|
|
806
|
+
def task_pause(operation_id: str, with_show: bool=True, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Empty:
|
|
795
807
|
"""pause task by \"operation_id\""""
|
|
796
808
|
task = Operation(operationId=operation_id)
|
|
797
809
|
return f.post_manager_task_pause(task, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url)
|
|
798
810
|
|
|
799
811
|
|
|
800
|
-
def app_stop(operation_id: str, task_id: Optional[str], app_id: str, run_id: str, with_show: bool=True, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Empty:
|
|
812
|
+
def app_stop(operation_id: str, task_id: Optional[str], app_id: str, run_id: str, with_show: bool=True, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Empty:
|
|
801
813
|
"""stop app by \"operation_id\", \"task_id\" and \"app_id\""""
|
|
802
814
|
app_manage = AppManage(operationId=operation_id, taskId=task_id, appId=app_id, runId=run_id)
|
|
803
815
|
return f.post_manager_app_stop(app_manage, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url)
|
|
804
816
|
|
|
805
817
|
|
|
806
|
-
def app_resume(operation_id: str, task_id: Optional[str], app_id: str, run_id: str, with_show: bool=True, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Empty:
|
|
818
|
+
def app_resume(operation_id: str, task_id: Optional[str], app_id: str, run_id: str, with_show: bool=True, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Empty:
|
|
807
819
|
"""resume app by \"operation_id\", \"task_id\" and \"app_id\""""
|
|
808
820
|
app_manage = AppManage(operationId=operation_id, taskId=task_id, appId=app_id, runId=run_id)
|
|
809
821
|
return f.post_manager_app_resume(app_manage, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url)
|
|
810
822
|
|
|
811
823
|
|
|
812
|
-
def app_pause(operation_id: str, task_id: Optional[str], app_id: str, run_id: str, with_show: bool=True, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Empty:
|
|
824
|
+
def app_pause(operation_id: str, task_id: Optional[str], app_id: str, run_id: str, with_show: bool=True, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Empty:
|
|
813
825
|
"""pause app by \"operation_id\", \"task_id\" and \"app_id\""""
|
|
814
826
|
app_manage = AppManage(operationId=operation_id, taskId=task_id, appId=app_id, runId=run_id)
|
|
815
827
|
return f.post_manager_app_pause(app_manage, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url)
|
|
@@ -817,7 +829,7 @@ def app_pause(operation_id: str, task_id: Optional[str], app_id: str, run_id: st
|
|
|
817
829
|
# kafka
|
|
818
830
|
|
|
819
831
|
|
|
820
|
-
async def kafka_send(operation_id: str, run_id: Optional[str] = None, data: Dict[str, str] = None, metadata: Optional[Dict[str, Union[str, Dict[str, Any]]]] = None, with_show: bool=False, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Union[Alias.Info, KafkaMsg]: # TODO add tl
|
|
832
|
+
async def kafka_send(operation_id: str, run_id: Optional[str] = None, data: Dict[str, str] = None, metadata: Optional[Dict[str, Union[str, Dict[str, Any]]]] = None, with_show: bool=False, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Union[Alias.Info, KafkaMsg]: # TODO add tl
|
|
821
833
|
"""send msg to kafka for task by \"operation_id\", \"run_id\" and data"""
|
|
822
834
|
assert data is not None, "data should exists in kafka_send"
|
|
823
835
|
if run_id is None:
|
|
@@ -839,33 +851,33 @@ async def kafka_send(operation_id: str, run_id: Optional[str] = None, data: Dict
|
|
|
839
851
|
# other
|
|
840
852
|
|
|
841
853
|
|
|
842
|
-
def create_collection_from_file(filename: str, name: Optional[str]=None, metadata: Optional[Union[Dict[str, Any], str]]=None, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
854
|
+
def create_collection_from_file(filename: str, name: Optional[str]=None, metadata: Optional[Union[Dict[str, Any], str]]=None, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
843
855
|
"""create collection\n
|
|
844
856
|
return collection id"""
|
|
845
857
|
return fh.create_collection_from_file_df(filename, name, metadata, auth=auth, conn_url=conn_url)
|
|
846
858
|
|
|
847
859
|
|
|
848
|
-
def create_collection_from_df(data: pd.DataFrame, name: Optional[str]=None, metadata: Optional[Union[Dict[str, Any], str]]=None, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
860
|
+
def create_collection_from_df(data: pd.DataFrame, name: Optional[str]=None, metadata: Optional[Union[Dict[str, Any], str]]=None, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Alias.Id:
|
|
849
861
|
"""create collection\n
|
|
850
862
|
return collection id"""
|
|
851
863
|
return fh.create_collection_from_df(data, name, metadata, auth=auth, conn_url=conn_url)
|
|
852
864
|
|
|
853
865
|
|
|
854
|
-
def get_collection_to_df(id: str, offset: int = 0, limit: int = -1, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> pd.DataFrame:
|
|
866
|
+
def get_collection_to_df(id: str, offset: int = 0, limit: int = -1, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> pd.DataFrame:
|
|
855
867
|
"""return df from collection by \"id\", pagination: unlimited - limit < 0"""
|
|
856
868
|
collection = get_collection(id, offset, limit, auth=auth, conn_url=conn_url)
|
|
857
869
|
records = list(map(lambda x: json.loads(x.data), collection.docs))
|
|
858
870
|
return pd.DataFrame.from_records(records)
|
|
859
871
|
|
|
860
872
|
|
|
861
|
-
def get_collection_by_name_to_df(name: str, operation_id: Optional[str]=None, run_id: Optional[str]=None, offset: int = 0, limit: int = -1, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> pd.DataFrame:
|
|
873
|
+
def get_collection_by_name_to_df(name: str, operation_id: Optional[str]=None, run_id: Optional[str]=None, offset: int = 0, limit: int = -1, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> pd.DataFrame:
|
|
862
874
|
"""return df from collection by \"name\" and mb also operation_id and run_id with which it was saved. raise if there are multiple collections, pagination: unlimited - limit < 0"""
|
|
863
875
|
collection = get_collection_by_name(name, operation_id, run_id, offset, limit, auth=auth, conn_url=conn_url)
|
|
864
876
|
records = list(map(lambda x: json.loads(x.data), collection.docs))
|
|
865
877
|
return pd.DataFrame.from_records(records)
|
|
866
878
|
|
|
867
879
|
|
|
868
|
-
def create_schemes_by_path(path: str, wait: bool = True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Dict[str, Alias.Id]:
|
|
880
|
+
def create_schemes_by_path(path: str, wait: bool = True, *, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> Dict[str, Alias.Id]:
|
|
869
881
|
"""schemes are created from json along the path to the directory, scheme_name - is the name of the file without '.json', returned a dict from the name of the created scheme to id"""
|
|
870
882
|
res = dict()
|
|
871
883
|
for filename in os.listdir(path):
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
malevich_coretools/__init__.py,sha256=-JwDbXfkEcEYt-MaDDHvUHI8jQLj0RqkVjvr92WL-jw,68
|
|
2
|
+
malevich_coretools/utils.py,sha256=ge2xAykEnZ7P7s6cm2jsx05ruN8OPxgSzFXAwz2BtPw,52367
|
|
3
|
+
malevich_coretools/abstract/__init__.py,sha256=ZWtP4gFLpNVFXzlMKXEK4iMnUqqMg07pL8yKGSJd6QI,38
|
|
4
|
+
malevich_coretools/abstract/abstract.py,sha256=coe2Lmp9totwEfnQh_l1oEcSa6p7bdVCXdS7O4Gx94A,8221
|
|
5
|
+
malevich_coretools/funcs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
malevich_coretools/funcs/funcs.py,sha256=ltgFnCeye1Mc0ErMwDqHX7qOTuJYVCY9QScWiGbPDkg,27291
|
|
7
|
+
malevich_coretools/funcs/helpers.py,sha256=Y8v6uyawYl2_G0XmhmiVLqGIUzvxnkpKF0ODA9vrB3Y,1276
|
|
8
|
+
malevich_coretools/secondary/__init__.py,sha256=048HqvG36_1WdDVZK_RuECmaf14Iq2fviUysG1inlaE,78
|
|
9
|
+
malevich_coretools/secondary/config.py,sha256=b7RysQTkPKib8FEhfm3uU7TPvz8vgWLlqakvZN5NFs4,391
|
|
10
|
+
malevich_coretools/secondary/const.py,sha256=jBIynrBTA-MmL07ob270ihS01sHRYRHbdcOlljy0FgU,7523
|
|
11
|
+
malevich_coretools/secondary/helpers.py,sha256=yQiaG_Q_5sw04RFpZccoSryPBuoA25BpSmvzSyQtwK0,2937
|
|
12
|
+
malevich_coretools/tools/__init__.py,sha256=87oIj4h-inVh8yuPW9vtTLrEZ6zNp6yD6jClSmsU4AE,32
|
|
13
|
+
malevich_coretools/tools/vast.py,sha256=gAGJNBPdiLTzQZfZHlx-1hqMMcnoD2M6dmEYgFvl37I,9515
|
|
14
|
+
malevich_coretools-0.2.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
15
|
+
malevich_coretools-0.2.3.dist-info/METADATA,sha256=avZDIWtWk3kf3nnkyyYRmCGt4Lw2GHKOgMpLRW6-2Uo,236
|
|
16
|
+
malevich_coretools-0.2.3.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
|
|
17
|
+
malevich_coretools-0.2.3.dist-info/top_level.txt,sha256=wDX3s1Tso0otBPNrFRfXqyNpm48W4Bp5v6JfbITO2Z8,19
|
|
18
|
+
malevich_coretools-0.2.3.dist-info/RECORD,,
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
malevich_coretools/__init__.py,sha256=zdIcHs3T_NZ8HYWts-O7OpBEWHIu779QDZMGF5HRCLg,35
|
|
2
|
-
malevich_coretools/utils.py,sha256=GVuI6HzerOzkVL5awcXkGem84Jfpim7odnS-Ijg_ajg,50823
|
|
3
|
-
malevich_coretools/abstract/__init__.py,sha256=ZWtP4gFLpNVFXzlMKXEK4iMnUqqMg07pL8yKGSJd6QI,38
|
|
4
|
-
malevich_coretools/abstract/abstract.py,sha256=ElmocG9HAIir65Ja8eaXCr6uze_4k64C8cdxoZTM37U,8095
|
|
5
|
-
malevich_coretools/funcs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
malevich_coretools/funcs/funcs.py,sha256=YiuNRPRoi_3A8o21kckTEXZhlJ52qaUVGlzvPIlL-Wk,26962
|
|
7
|
-
malevich_coretools/funcs/helpers.py,sha256=Y8v6uyawYl2_G0XmhmiVLqGIUzvxnkpKF0ODA9vrB3Y,1276
|
|
8
|
-
malevich_coretools/secondary/__init__.py,sha256=048HqvG36_1WdDVZK_RuECmaf14Iq2fviUysG1inlaE,78
|
|
9
|
-
malevich_coretools/secondary/config.py,sha256=b7RysQTkPKib8FEhfm3uU7TPvz8vgWLlqakvZN5NFs4,391
|
|
10
|
-
malevich_coretools/secondary/const.py,sha256=C_PT-Zyr2YcKkc8CJ1QYVvk3HDTs8Kg3jcDLLUR3oUg,7431
|
|
11
|
-
malevich_coretools/secondary/helpers.py,sha256=yQiaG_Q_5sw04RFpZccoSryPBuoA25BpSmvzSyQtwK0,2937
|
|
12
|
-
malevich_coretools-0.2.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
13
|
-
malevich_coretools-0.2.1.dist-info/METADATA,sha256=xDrubhoqaXhxywqR17kBEskARiLAw0SKBk817TKnwFQ,236
|
|
14
|
-
malevich_coretools-0.2.1.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
15
|
-
malevich_coretools-0.2.1.dist-info/top_level.txt,sha256=wDX3s1Tso0otBPNrFRfXqyNpm48W4Bp5v6JfbITO2Z8,19
|
|
16
|
-
malevich_coretools-0.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|