malevich-coretools 0.3.36__tar.gz → 0.3.38__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.
- {malevich_coretools-0.3.36/malevich_coretools.egg-info → malevich_coretools-0.3.38}/PKG-INFO +1 -1
- malevich_coretools-0.3.38/VERSION +1 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/funcs/funcs.py +145 -4
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/utils.py +134 -54
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38/malevich_coretools.egg-info}/PKG-INFO +1 -1
- malevich_coretools-0.3.36/VERSION +0 -1
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/LICENSE +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/MANIFEST.in +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/README.md +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/__init__.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/abstract/__init__.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/abstract/abstract.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/abstract/operations.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/abstract/pipeline.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/abstract/statuses.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/admin/__init__.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/admin/utils.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/batch/__init__.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/batch/utils.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/funcs/__init__.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/funcs/checks.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/funcs/helpers.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/secondary/__init__.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/secondary/config.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/secondary/const.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/secondary/helpers.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/secondary/kafka_utils.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/tools/__init__.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/tools/abstract.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/tools/vast.py +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools.egg-info/SOURCES.txt +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools.egg-info/dependency_links.txt +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools.egg-info/requires.txt +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools.egg-info/top_level.txt +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/pyproject.toml +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/requirements.txt +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/setup.cfg +0 -0
- {malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.3.38
|
|
@@ -283,6 +283,10 @@ def get_ping(*args, **kwargs) -> Alias.Info:
|
|
|
283
283
|
return send_to_core_get(PING, *args, **kwargs, is_text=True)
|
|
284
284
|
|
|
285
285
|
|
|
286
|
+
async def get_ping_async(*args, **kwargs) -> Alias.Info:
|
|
287
|
+
return await send_to_core_get_async(PING, *args, **kwargs, is_text=True)
|
|
288
|
+
|
|
289
|
+
|
|
286
290
|
# def get_mapping(wait: bool, *args, **kwargs) -> ResultDocMappingsFull:
|
|
287
291
|
# return model_from_json(send_to_core_get(MAPPING, *args, **kwargs), ResultDocMappingsFull)
|
|
288
292
|
|
|
@@ -666,6 +670,16 @@ def post_manager_task(data: MainTask, with_show: bool, long: bool, long_timeout:
|
|
|
666
670
|
return AppLogs.model_validate_json(res)
|
|
667
671
|
|
|
668
672
|
|
|
673
|
+
async def post_manager_task_async(data: MainTask, with_show: bool, long: bool, long_timeout: int, wait: bool, auth: Optional[AUTH], conn_url: Optional[str]=None, *args, **kwargs) -> Union[Alias.Id, AppLogs]:
|
|
674
|
+
check_profile_mode(data.profileMode)
|
|
675
|
+
res = await send_to_core_modify_async(MANAGER_TASK(wait and not long), data, with_show=with_show, show_func=show_logs_func, auth=auth, conn_url=conn_url, *args, **kwargs)
|
|
676
|
+
if wait and long:
|
|
677
|
+
res = await __get_result(res, timeout=long_timeout, auth=auth)
|
|
678
|
+
if not wait:
|
|
679
|
+
return res
|
|
680
|
+
return AppLogs.model_validate_json(res)
|
|
681
|
+
|
|
682
|
+
|
|
669
683
|
def post_manager_task_run(data: RunTask, with_show: bool, long: bool, long_timeout: int, wait: bool, auth: Optional[AUTH], conn_url: Optional[str]=None, *args, **kwargs) -> Optional[Union[Alias.Id, AppLogs]]:
|
|
670
684
|
check_profile_mode(data.profileMode)
|
|
671
685
|
res = send_to_core_modify(MANAGER_TASK_RUN(wait and not long), data, with_show=with_show, show_func=show_logs_func, auth=auth, conn_url=conn_url, *args, **kwargs)
|
|
@@ -677,6 +691,17 @@ def post_manager_task_run(data: RunTask, with_show: bool, long: bool, long_timeo
|
|
|
677
691
|
return AppLogs.model_validate_json(res)
|
|
678
692
|
|
|
679
693
|
|
|
694
|
+
async def post_manager_task_run_async(data: RunTask, with_show: bool, long: bool, long_timeout: int, wait: bool, auth: Optional[AUTH], conn_url: Optional[str]=None, *args, **kwargs) -> Optional[Union[Alias.Id, AppLogs]]:
|
|
695
|
+
check_profile_mode(data.profileMode)
|
|
696
|
+
res = await send_to_core_modify_async(MANAGER_TASK_RUN(wait and not long), data, with_show=with_show, show_func=show_logs_func, auth=auth, conn_url=conn_url, *args, **kwargs)
|
|
697
|
+
if wait and long:
|
|
698
|
+
res = await __get_result(res, timeout=long_timeout, auth=auth)
|
|
699
|
+
if data.withLogs or data.schedule is not None:
|
|
700
|
+
if not wait:
|
|
701
|
+
return res
|
|
702
|
+
return AppLogs.model_validate_json(res)
|
|
703
|
+
|
|
704
|
+
|
|
680
705
|
def post_manager_pipeline(data: MainPipeline, with_show: bool, long: bool, long_timeout: int, return_response: bool, wait: bool, auth: Optional[AUTH], conn_url: Optional[str]=None, *args, **kwargs) -> Union[Alias.Id, AppLogs]:
|
|
681
706
|
check_profile_mode(data.profileMode)
|
|
682
707
|
res = send_to_core_modify(MANAGER_PIPELINE(wait and not long), data, with_show=with_show, show_func=show_logs_func, return_response=return_response, auth=auth, conn_url=conn_url, *args, **kwargs)
|
|
@@ -689,6 +714,18 @@ def post_manager_pipeline(data: MainPipeline, with_show: bool, long: bool, long_
|
|
|
689
714
|
return AppLogs.model_validate_json(res)
|
|
690
715
|
|
|
691
716
|
|
|
717
|
+
async def post_manager_pipeline_async(data: MainPipeline, with_show: bool, long: bool, long_timeout: int, return_response: bool, wait: bool, auth: Optional[AUTH], conn_url: Optional[str]=None, *args, **kwargs) -> Union[Alias.Id, AppLogs]:
|
|
718
|
+
check_profile_mode(data.profileMode)
|
|
719
|
+
res = await send_to_core_modify_async(MANAGER_PIPELINE(wait and not long), data, with_show=with_show, show_func=show_logs_func, return_response=return_response, auth=auth, conn_url=conn_url, *args, **kwargs)
|
|
720
|
+
if return_response:
|
|
721
|
+
return res
|
|
722
|
+
if wait and long:
|
|
723
|
+
res = await __get_result(res, timeout=long_timeout, auth=auth)
|
|
724
|
+
if not wait:
|
|
725
|
+
return res
|
|
726
|
+
return AppLogs.model_validate_json(res)
|
|
727
|
+
|
|
728
|
+
|
|
692
729
|
def post_manager_task_unschedule(data: UnscheduleOperation, with_show: bool, wait: bool, *args, **kwargs) -> Alias.Info:
|
|
693
730
|
return send_to_core_modify(MANAGER_TASK_UNSCHEDULE(wait), data, with_show=with_show, *args, **kwargs)
|
|
694
731
|
|
|
@@ -702,10 +739,23 @@ def post_manager_task_stop(data: StopOperation, with_show: bool, wait: bool, *ar
|
|
|
702
739
|
return AppLogs.model_validate_json(res)
|
|
703
740
|
|
|
704
741
|
|
|
742
|
+
async def post_manager_task_stop_async(data: StopOperation, with_show: bool, wait: bool, *args, **kwargs) -> Optional[Union[Alias.Id, AppLogs]]:
|
|
743
|
+
show_func = show_logs_func if data.withLogs else None
|
|
744
|
+
res = await send_to_core_modify_async(MANAGER_TASK_STOP(wait), data, with_show=with_show, show_func=show_func, *args, **kwargs)
|
|
745
|
+
if data.withLogs:
|
|
746
|
+
if not wait:
|
|
747
|
+
return res
|
|
748
|
+
return AppLogs.model_validate_json(res)
|
|
749
|
+
|
|
750
|
+
|
|
705
751
|
def post_manager_task_stop_all(data: StopOperationMany, wait: bool, *args, **kwargs) -> Alias.Json: # FIXME show
|
|
706
752
|
return send_to_core_modify(MANAGER_TASK_STOP_ALL(wait), data, *args, **kwargs)
|
|
707
753
|
|
|
708
754
|
|
|
755
|
+
async def post_manager_task_stop_all_async(data: StopOperationMany, wait: bool, *args, **kwargs) -> Alias.Json: # FIXME show
|
|
756
|
+
return await send_to_core_modify_async(MANAGER_TASK_STOP_ALL(wait), data, *args, **kwargs)
|
|
757
|
+
|
|
758
|
+
|
|
709
759
|
def post_manager_task_resume(data: Operation, wait: bool, *args, **kwargs) -> Alias.Empty:
|
|
710
760
|
return send_to_core_modify(MANAGER_TASK_RESUME(wait), data, *args, **kwargs)
|
|
711
761
|
|
|
@@ -787,7 +837,8 @@ async def __get_result(id: str, is_text: bool = True, check_time: float = LONG_S
|
|
|
787
837
|
host = Config.HOST_PORT if conn_url is None else conn_url
|
|
788
838
|
assert host is not None, "host port not set"
|
|
789
839
|
if auth is None:
|
|
790
|
-
auth =
|
|
840
|
+
auth = (Config.CORE_USERNAME, Config.CORE_PASSWORD)
|
|
841
|
+
auth = aiohttp.BasicAuth(login=auth[0], password=auth[1], encoding='utf-8')
|
|
791
842
|
|
|
792
843
|
timeout_deadline = None if timeout is None else datetime.datetime.now() + datetime.timedelta(0, timeout)
|
|
793
844
|
while True:
|
|
@@ -811,11 +862,18 @@ async def __get_result(id: str, is_text: bool = True, check_time: float = LONG_S
|
|
|
811
862
|
pass # recreate ClientSession
|
|
812
863
|
|
|
813
864
|
|
|
814
|
-
async def __async_check_response(response: aiohttp.ClientResponse, show_func: Optional[Callable]=None): # noqa: ANN202
|
|
865
|
+
async def __async_check_response(response: aiohttp.ClientResponse, show_func: Optional[Callable]=None, path: Optional[str] = None): # noqa: ANN202
|
|
815
866
|
if not response.ok:
|
|
816
867
|
if show_func is None:
|
|
817
|
-
|
|
868
|
+
if path is not None:
|
|
869
|
+
text = await response.text()
|
|
870
|
+
msg = f"failed: {text}" if len(text) > 0 else "failed"
|
|
871
|
+
Config.logger.error(f"{path} {msg}")
|
|
872
|
+
else:
|
|
873
|
+
Config.logger.error(await response.text())
|
|
818
874
|
else:
|
|
875
|
+
if path is not None:
|
|
876
|
+
Config.logger.error(f"{path} failed")
|
|
819
877
|
show_func(await response.text(), err=True)
|
|
820
878
|
response.raise_for_status()
|
|
821
879
|
|
|
@@ -849,6 +907,27 @@ def send_to_core_get(path: str, with_auth=True, show_func: Optional[Callable]=No
|
|
|
849
907
|
return response.content
|
|
850
908
|
|
|
851
909
|
|
|
910
|
+
# FIXME copypaste
|
|
911
|
+
async def send_to_core_get_async(path: str, with_auth=True, show_func: Optional[Callable]=None, is_text=False, auth: Optional[AUTH]=None, conn_url: Optional[str]=None, async_session = None) -> Optional[Union[str, bytes]]:
|
|
912
|
+
host = Config.HOST_PORT if conn_url is None else conn_url
|
|
913
|
+
assert host is not None, "host port not set"
|
|
914
|
+
if auth is None or not with_auth:
|
|
915
|
+
auth = (Config.CORE_USERNAME, Config.CORE_PASSWORD) if with_auth else None
|
|
916
|
+
if auth is not None:
|
|
917
|
+
auth = aiohttp.BasicAuth(login=auth[0], password=auth[1], encoding='utf-8')
|
|
918
|
+
async with async_session or aiohttp.ClientSession(auth=auth, connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
|
|
919
|
+
async with session.get(f"{host}{path}", headers=HEADERS) as response:
|
|
920
|
+
await __async_check_response(response, show_func, f"{host}{path}")
|
|
921
|
+
if response.status == HTTPStatus.NO_CONTENT:
|
|
922
|
+
return None
|
|
923
|
+
if is_text is True:
|
|
924
|
+
return await response.text()
|
|
925
|
+
elif is_text is False:
|
|
926
|
+
return await response.json()
|
|
927
|
+
else:
|
|
928
|
+
return await response.read()
|
|
929
|
+
|
|
930
|
+
|
|
852
931
|
def send_to_core_modify(path: str, operation: Optional[Any] = None, with_auth: bool=True, with_show: Optional[bool]=None, show_func: Optional[Callable]=None, return_response: bool = False, is_post: bool=True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> str: # noqa: ANN401
|
|
853
932
|
"""modify: post by default, else - delete"""
|
|
854
933
|
host = Config.HOST_PORT if conn_url is None else conn_url
|
|
@@ -877,6 +956,38 @@ def send_to_core_modify(path: str, operation: Optional[Any] = None, with_auth: b
|
|
|
877
956
|
return result
|
|
878
957
|
|
|
879
958
|
|
|
959
|
+
async def send_to_core_modify_async(path: str, operation: Optional[Any] = None, with_auth: bool=True, with_show: Optional[bool]=None, show_func: Optional[Callable]=None, return_response: bool = False, is_post: bool=True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None, async_session=None) -> str: # noqa: ANN401
|
|
960
|
+
"""modify: post by default, else - delete"""
|
|
961
|
+
host = Config.HOST_PORT if conn_url is None else conn_url
|
|
962
|
+
assert host is not None, "host port not set"
|
|
963
|
+
if auth is None:
|
|
964
|
+
auth = (Config.CORE_USERNAME, Config.CORE_PASSWORD)
|
|
965
|
+
auth = aiohttp.BasicAuth(login=auth[0], password=auth[1], encoding='utf-8')
|
|
966
|
+
if operation is not None:
|
|
967
|
+
operation = json.dumps(operation.model_dump())
|
|
968
|
+
|
|
969
|
+
async with async_session or aiohttp.ClientSession(auth=auth if with_auth else None, connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
|
|
970
|
+
if is_post:
|
|
971
|
+
response_cm = session.post(f"{host}{path}", data=operation, headers=HEADERS)
|
|
972
|
+
else:
|
|
973
|
+
response_cm = session.delete(f"{host}{path}", data=operation, headers=HEADERS)
|
|
974
|
+
async with response_cm as response:
|
|
975
|
+
if return_response:
|
|
976
|
+
return response
|
|
977
|
+
await __async_check_response(response, show_func, f"{host}{path}")
|
|
978
|
+
if response.status == HTTPStatus.NO_CONTENT:
|
|
979
|
+
return ""
|
|
980
|
+
result = await response.text()
|
|
981
|
+
if with_show is None:
|
|
982
|
+
with_show = Config.VERBOSE
|
|
983
|
+
if with_show:
|
|
984
|
+
if show_func is None:
|
|
985
|
+
Config.logger.info(result)
|
|
986
|
+
else:
|
|
987
|
+
show_func(result)
|
|
988
|
+
return result
|
|
989
|
+
|
|
990
|
+
|
|
880
991
|
def send_to_core_modify_raw(path: str, data: bytes, with_auth: bool=True, with_show: Optional[bool]=None, show_func: Optional[Callable]=None, is_post: bool=True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> str: # noqa: ANN401
|
|
881
992
|
"""modify: post by default, else - delete"""
|
|
882
993
|
host = Config.HOST_PORT if conn_url is None else conn_url
|
|
@@ -901,11 +1012,41 @@ def send_to_core_modify_raw(path: str, data: bytes, with_auth: bool=True, with_s
|
|
|
901
1012
|
return result
|
|
902
1013
|
|
|
903
1014
|
|
|
1015
|
+
async def send_to_core_modify_raw_async(path: str, data: bytes, with_auth: bool=True, with_show: Optional[bool]=None, show_func: Optional[Callable]=None, is_post: bool=True, auth: Optional[AUTH]=None, conn_url: Optional[str]=None, async_session=None) -> str: # noqa: ANN401
|
|
1016
|
+
"""modify: post by default, else - delete"""
|
|
1017
|
+
host = Config.HOST_PORT if conn_url is None else conn_url
|
|
1018
|
+
assert host is not None, "host port not set"
|
|
1019
|
+
if auth is None:
|
|
1020
|
+
auth = (Config.CORE_USERNAME, Config.CORE_PASSWORD)
|
|
1021
|
+
auth = aiohttp.BasicAuth(login=auth[0], password=auth[1], encoding='utf-8')
|
|
1022
|
+
|
|
1023
|
+
async with async_session or aiohttp.ClientSession(auth=auth if with_auth else None, connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
|
|
1024
|
+
if is_post:
|
|
1025
|
+
response_cm = session.post(f"{host}{path}", data=data, headers=HEADERS_RAW)
|
|
1026
|
+
else:
|
|
1027
|
+
response_cm = session.delete(f"{host}{path}", data=data, headers=HEADERS_RAW)
|
|
1028
|
+
async with response_cm as response:
|
|
1029
|
+
await __async_check_response(response, show_func, f"{host}{path}")
|
|
1030
|
+
if response.status == HTTPStatus.NO_CONTENT:
|
|
1031
|
+
return ""
|
|
1032
|
+
result = await response.text()
|
|
1033
|
+
if with_show is None:
|
|
1034
|
+
with_show = Config.VERBOSE
|
|
1035
|
+
if with_show:
|
|
1036
|
+
if show_func is None:
|
|
1037
|
+
Config.logger.info(result)
|
|
1038
|
+
else:
|
|
1039
|
+
show_func(result)
|
|
1040
|
+
return result
|
|
1041
|
+
|
|
1042
|
+
|
|
904
1043
|
async def send_to_core_post_async(path: str, operation: Optional[str] = None, with_auth=True, with_show=True, show_func: Optional[Callable]=None, auth: Optional[AUTH]=None, conn_url: Optional[str]=None) -> str:
|
|
905
1044
|
host = Config.HOST_PORT if conn_url is None else conn_url
|
|
906
1045
|
assert host is not None, "host port not set"
|
|
907
1046
|
if auth is None or not with_auth:
|
|
908
|
-
auth =
|
|
1047
|
+
auth = (Config.CORE_USERNAME, Config.CORE_PASSWORD) if with_auth else None
|
|
1048
|
+
if auth is not None:
|
|
1049
|
+
auth = aiohttp.BasicAuth(login=auth[0], password=auth[1], encoding='utf-8')
|
|
909
1050
|
if operation is not None:
|
|
910
1051
|
operation = json.dumps(operation.model_dump())
|
|
911
1052
|
|
|
@@ -165,7 +165,7 @@ def get_doc_by_name(
|
|
|
165
165
|
|
|
166
166
|
def create_doc(
|
|
167
167
|
data: Union[Alias.Json, Dict, Type[BaseModel]],
|
|
168
|
-
name: Optional[str],
|
|
168
|
+
name: Optional[str] = None,
|
|
169
169
|
wait: bool = True,
|
|
170
170
|
*,
|
|
171
171
|
auth: Optional[AUTH] = None,
|
|
@@ -1222,13 +1222,17 @@ def check_auth(
|
|
|
1222
1222
|
def ping(
|
|
1223
1223
|
conn_url: Optional[str] = None,
|
|
1224
1224
|
batcher: Optional[Batcher] = None,
|
|
1225
|
+
is_async: bool = False,
|
|
1225
1226
|
) -> Alias.Info:
|
|
1226
1227
|
"""return `pong` """
|
|
1227
1228
|
if batcher is None:
|
|
1228
1229
|
batcher = Config.BATCHER
|
|
1229
1230
|
if batcher is not None:
|
|
1230
1231
|
return batcher.add("ping")
|
|
1231
|
-
|
|
1232
|
+
if is_async:
|
|
1233
|
+
return f.get_ping_async(with_auth=False, conn_url=conn_url)
|
|
1234
|
+
else:
|
|
1235
|
+
return f.get_ping(with_auth=False, conn_url=conn_url)
|
|
1232
1236
|
|
|
1233
1237
|
# UserShare
|
|
1234
1238
|
|
|
@@ -2659,6 +2663,7 @@ def task_full(
|
|
|
2659
2663
|
auth: Optional[AUTH] = None,
|
|
2660
2664
|
conn_url: Optional[str] = None,
|
|
2661
2665
|
batcher: Optional[Batcher] = None,
|
|
2666
|
+
is_async: bool = False,
|
|
2662
2667
|
) -> Union[Alias.Id, AppLogs]:
|
|
2663
2668
|
"""prepare, run and stop task by `task_id`, `cfg_id` and other
|
|
2664
2669
|
|
|
@@ -2711,15 +2716,26 @@ def task_full(
|
|
|
2711
2716
|
)
|
|
2712
2717
|
if batcher is not None:
|
|
2713
2718
|
return batcher.add("sendTask", data=data, result_model=AppLogs)
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2719
|
+
if is_async:
|
|
2720
|
+
return f.post_manager_task_async(
|
|
2721
|
+
data,
|
|
2722
|
+
with_show=with_show,
|
|
2723
|
+
long=long,
|
|
2724
|
+
long_timeout=long_timeout,
|
|
2725
|
+
wait=wait,
|
|
2726
|
+
auth=auth,
|
|
2727
|
+
conn_url=conn_url,
|
|
2728
|
+
)
|
|
2729
|
+
else:
|
|
2730
|
+
return f.post_manager_task(
|
|
2731
|
+
data,
|
|
2732
|
+
with_show=with_show,
|
|
2733
|
+
long=long,
|
|
2734
|
+
long_timeout=long_timeout,
|
|
2735
|
+
wait=wait,
|
|
2736
|
+
auth=auth,
|
|
2737
|
+
conn_url=conn_url,
|
|
2738
|
+
)
|
|
2723
2739
|
|
|
2724
2740
|
|
|
2725
2741
|
def task_prepare(
|
|
@@ -2748,6 +2764,7 @@ def task_prepare(
|
|
|
2748
2764
|
auth: Optional[AUTH] = None,
|
|
2749
2765
|
conn_url: Optional[str] = None,
|
|
2750
2766
|
batcher: Optional[Batcher] = None,
|
|
2767
|
+
is_async: bool = False,
|
|
2751
2768
|
) -> Union[Alias.Id, AppLogs]:
|
|
2752
2769
|
"""prepare task by `task_id`, `cfg_id` and other, return `operation_id`
|
|
2753
2770
|
|
|
@@ -2813,15 +2830,26 @@ def task_prepare(
|
|
|
2813
2830
|
)
|
|
2814
2831
|
if batcher is not None:
|
|
2815
2832
|
return batcher.add("sendTask", data=data, result_model=AppLogs)
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2833
|
+
if is_async:
|
|
2834
|
+
return f.post_manager_task_async(
|
|
2835
|
+
data,
|
|
2836
|
+
with_show=with_show,
|
|
2837
|
+
long=long,
|
|
2838
|
+
long_timeout=long_timeout,
|
|
2839
|
+
wait=wait,
|
|
2840
|
+
auth=auth,
|
|
2841
|
+
conn_url=conn_url,
|
|
2842
|
+
)
|
|
2843
|
+
else:
|
|
2844
|
+
return f.post_manager_task(
|
|
2845
|
+
data,
|
|
2846
|
+
with_show=with_show,
|
|
2847
|
+
long=long,
|
|
2848
|
+
long_timeout=long_timeout,
|
|
2849
|
+
wait=wait,
|
|
2850
|
+
auth=auth,
|
|
2851
|
+
conn_url=conn_url,
|
|
2852
|
+
)
|
|
2825
2853
|
|
|
2826
2854
|
|
|
2827
2855
|
def task_run(
|
|
@@ -2842,6 +2870,7 @@ def task_run(
|
|
|
2842
2870
|
auth: Optional[AUTH] = None,
|
|
2843
2871
|
conn_url: Optional[str] = None,
|
|
2844
2872
|
batcher: Optional[Batcher] = None,
|
|
2873
|
+
is_async: bool = False,
|
|
2845
2874
|
) -> Optional[Union[Alias.Id, AppLogs]]:
|
|
2846
2875
|
"""run prepared task by `operation_id` with `cfg_id` and other overridden parameters
|
|
2847
2876
|
|
|
@@ -2879,15 +2908,26 @@ def task_run(
|
|
|
2879
2908
|
)
|
|
2880
2909
|
if batcher is not None:
|
|
2881
2910
|
return batcher.add("sendTaskRun", data=data, result_model=AppLogs if with_logs or schedule is not None else None)
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2911
|
+
if is_async:
|
|
2912
|
+
return f.post_manager_task_run_async(
|
|
2913
|
+
data,
|
|
2914
|
+
with_show=with_show,
|
|
2915
|
+
long=long,
|
|
2916
|
+
long_timeout=long_timeout,
|
|
2917
|
+
wait=wait,
|
|
2918
|
+
auth=auth,
|
|
2919
|
+
conn_url=conn_url,
|
|
2920
|
+
)
|
|
2921
|
+
else:
|
|
2922
|
+
return f.post_manager_task_run(
|
|
2923
|
+
data,
|
|
2924
|
+
with_show=with_show,
|
|
2925
|
+
long=long,
|
|
2926
|
+
long_timeout=long_timeout,
|
|
2927
|
+
wait=wait,
|
|
2928
|
+
auth=auth,
|
|
2929
|
+
conn_url=conn_url,
|
|
2930
|
+
)
|
|
2891
2931
|
|
|
2892
2932
|
|
|
2893
2933
|
def pipeline_full(
|
|
@@ -2912,6 +2952,7 @@ def pipeline_full(
|
|
|
2912
2952
|
auth: Optional[AUTH] = None,
|
|
2913
2953
|
conn_url: Optional[str] = None,
|
|
2914
2954
|
batcher: Optional[Batcher] = None,
|
|
2955
|
+
is_async: bool = False,
|
|
2915
2956
|
) -> Union[Alias.Id, AppLogs]:
|
|
2916
2957
|
if batcher is None:
|
|
2917
2958
|
batcher = Config.BATCHER
|
|
@@ -2946,16 +2987,28 @@ def pipeline_full(
|
|
|
2946
2987
|
)
|
|
2947
2988
|
if batcher is not None:
|
|
2948
2989
|
return batcher.add("sendPipeline", data=data, result_model=AppLogs)
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2990
|
+
if is_async:
|
|
2991
|
+
return f.post_manager_pipeline_async(
|
|
2992
|
+
data,
|
|
2993
|
+
with_show=with_show,
|
|
2994
|
+
long=long,
|
|
2995
|
+
long_timeout=long_timeout,
|
|
2996
|
+
return_response=return_response,
|
|
2997
|
+
wait=wait,
|
|
2998
|
+
auth=auth,
|
|
2999
|
+
conn_url=conn_url,
|
|
3000
|
+
)
|
|
3001
|
+
else:
|
|
3002
|
+
return f.post_manager_pipeline(
|
|
3003
|
+
data,
|
|
3004
|
+
with_show=with_show,
|
|
3005
|
+
long=long,
|
|
3006
|
+
long_timeout=long_timeout,
|
|
3007
|
+
return_response=return_response,
|
|
3008
|
+
wait=wait,
|
|
3009
|
+
auth=auth,
|
|
3010
|
+
conn_url=conn_url,
|
|
3011
|
+
)
|
|
2959
3012
|
|
|
2960
3013
|
|
|
2961
3014
|
def pipeline_prepare(
|
|
@@ -2980,11 +3033,13 @@ def pipeline_prepare(
|
|
|
2980
3033
|
with_show: bool = True,
|
|
2981
3034
|
long: bool = False,
|
|
2982
3035
|
long_timeout: Optional[int] = WAIT_RESULT_TIMEOUT,
|
|
3036
|
+
return_response: bool = False,
|
|
2983
3037
|
wait: bool = True,
|
|
2984
3038
|
*,
|
|
2985
3039
|
auth: Optional[AUTH] = None,
|
|
2986
3040
|
conn_url: Optional[str] = None,
|
|
2987
3041
|
batcher: Optional[Batcher] = None,
|
|
3042
|
+
is_async: bool = False,
|
|
2988
3043
|
) -> Union[Alias.Id, AppLogs]:
|
|
2989
3044
|
if batcher is None:
|
|
2990
3045
|
batcher = Config.BATCHER
|
|
@@ -3019,15 +3074,28 @@ def pipeline_prepare(
|
|
|
3019
3074
|
)
|
|
3020
3075
|
if batcher is not None:
|
|
3021
3076
|
return batcher.add("sendPipeline", data=data, result_model=AppLogs)
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3077
|
+
if is_async:
|
|
3078
|
+
return f.post_manager_pipeline_async(
|
|
3079
|
+
data,
|
|
3080
|
+
with_show=with_show,
|
|
3081
|
+
long=long,
|
|
3082
|
+
long_timeout=long_timeout,
|
|
3083
|
+
return_response=return_response,
|
|
3084
|
+
wait=wait,
|
|
3085
|
+
auth=auth,
|
|
3086
|
+
conn_url=conn_url,
|
|
3087
|
+
)
|
|
3088
|
+
else:
|
|
3089
|
+
return f.post_manager_pipeline(
|
|
3090
|
+
data,
|
|
3091
|
+
with_show=with_show,
|
|
3092
|
+
long=long,
|
|
3093
|
+
long_timeout=long_timeout,
|
|
3094
|
+
return_response=return_response,
|
|
3095
|
+
wait=wait,
|
|
3096
|
+
auth=auth,
|
|
3097
|
+
conn_url=conn_url,
|
|
3098
|
+
)
|
|
3031
3099
|
|
|
3032
3100
|
|
|
3033
3101
|
def task_unschedule(
|
|
@@ -3060,6 +3128,7 @@ def task_stop(
|
|
|
3060
3128
|
auth: Optional[AUTH] = None,
|
|
3061
3129
|
conn_url: Optional[str] = None,
|
|
3062
3130
|
batcher: Optional[Batcher] = None,
|
|
3131
|
+
is_async: bool = False,
|
|
3063
3132
|
) -> Optional[Union[Alias.Id, AppLogs]]:
|
|
3064
3133
|
"""stop task by `operation_id`
|
|
3065
3134
|
|
|
@@ -3077,9 +3146,14 @@ def task_stop(
|
|
|
3077
3146
|
data = StopOperation(operationId=operation_id, withLogs=with_logs, infoUrl=info_url)
|
|
3078
3147
|
if batcher is not None:
|
|
3079
3148
|
return batcher.add("sendTaskStop", data=data, result_model=AppLogs if with_logs else None)
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3149
|
+
if is_async:
|
|
3150
|
+
return f.post_manager_task_stop_async(
|
|
3151
|
+
data, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url
|
|
3152
|
+
)
|
|
3153
|
+
else:
|
|
3154
|
+
return f.post_manager_task_stop(
|
|
3155
|
+
data, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url
|
|
3156
|
+
)
|
|
3083
3157
|
|
|
3084
3158
|
|
|
3085
3159
|
def task_stop_all(
|
|
@@ -3091,6 +3165,7 @@ def task_stop_all(
|
|
|
3091
3165
|
auth: Optional[AUTH] = None,
|
|
3092
3166
|
conn_url: Optional[str] = None,
|
|
3093
3167
|
batcher: Optional[Batcher] = None,
|
|
3168
|
+
is_async: bool = False,
|
|
3094
3169
|
) -> Alias.Json:
|
|
3095
3170
|
"""stop all tasks"""
|
|
3096
3171
|
if batcher is None:
|
|
@@ -3098,9 +3173,14 @@ def task_stop_all(
|
|
|
3098
3173
|
data = StopOperationMany(withLogs=with_logs, infoUrl=info_url)
|
|
3099
3174
|
if batcher is not None:
|
|
3100
3175
|
return batcher.add("sendTaskStopAll", data=data, result_model=AppLogs if with_logs else None)
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3176
|
+
if is_async:
|
|
3177
|
+
return f.post_manager_task_stop_all_async(
|
|
3178
|
+
data, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url
|
|
3179
|
+
)
|
|
3180
|
+
else:
|
|
3181
|
+
return f.post_manager_task_stop_all(
|
|
3182
|
+
data, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url
|
|
3183
|
+
)
|
|
3104
3184
|
|
|
3105
3185
|
|
|
3106
3186
|
def task_resume(
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.3.36
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/abstract/__init__.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/abstract/abstract.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/abstract/operations.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/abstract/pipeline.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/abstract/statuses.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/admin/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/batch/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/funcs/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/secondary/__init__.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/secondary/config.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/secondary/const.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/secondary/helpers.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/secondary/kafka_utils.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/tools/__init__.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools/tools/abstract.py
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools.egg-info/requires.txt
RENAMED
|
File without changes
|
{malevich_coretools-0.3.36 → malevich_coretools-0.3.38}/malevich_coretools.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|