malevich-coretools 0.3.36__tar.gz → 0.3.37__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (38) hide show
  1. {malevich_coretools-0.3.36/malevich_coretools.egg-info → malevich_coretools-0.3.37}/PKG-INFO +1 -1
  2. malevich_coretools-0.3.37/VERSION +1 -0
  3. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/funcs/funcs.py +137 -2
  4. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/utils.py +130 -53
  5. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37/malevich_coretools.egg-info}/PKG-INFO +1 -1
  6. malevich_coretools-0.3.36/VERSION +0 -1
  7. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/LICENSE +0 -0
  8. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/MANIFEST.in +0 -0
  9. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/README.md +0 -0
  10. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/__init__.py +0 -0
  11. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/abstract/__init__.py +0 -0
  12. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/abstract/abstract.py +0 -0
  13. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/abstract/operations.py +0 -0
  14. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/abstract/pipeline.py +0 -0
  15. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/abstract/statuses.py +0 -0
  16. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/admin/__init__.py +0 -0
  17. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/admin/utils.py +0 -0
  18. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/batch/__init__.py +0 -0
  19. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/batch/utils.py +0 -0
  20. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/funcs/__init__.py +0 -0
  21. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/funcs/checks.py +0 -0
  22. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/funcs/helpers.py +0 -0
  23. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/secondary/__init__.py +0 -0
  24. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/secondary/config.py +0 -0
  25. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/secondary/const.py +0 -0
  26. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/secondary/helpers.py +0 -0
  27. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/secondary/kafka_utils.py +0 -0
  28. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/tools/__init__.py +0 -0
  29. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/tools/abstract.py +0 -0
  30. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools/tools/vast.py +0 -0
  31. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools.egg-info/SOURCES.txt +0 -0
  32. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools.egg-info/dependency_links.txt +0 -0
  33. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools.egg-info/requires.txt +0 -0
  34. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/malevich_coretools.egg-info/top_level.txt +0 -0
  35. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/pyproject.toml +0 -0
  36. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/requirements.txt +0 -0
  37. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/setup.cfg +0 -0
  38. {malevich_coretools-0.3.36 → malevich_coretools-0.3.37}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: malevich-coretools
3
- Version: 0.3.36
3
+ Version: 0.3.37
4
4
  Author: Andrew Pogrebnoj
5
5
  Author-email: andrew@onjulius.co
6
6
  License-File: LICENSE
@@ -0,0 +1 @@
1
+ 0.3.37
@@ -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
 
@@ -811,11 +861,18 @@ async def __get_result(id: str, is_text: bool = True, check_time: float = LONG_S
811
861
  pass # recreate ClientSession
812
862
 
813
863
 
814
- async def __async_check_response(response: aiohttp.ClientResponse, show_func: Optional[Callable]=None): # noqa: ANN202
864
+ async def __async_check_response(response: aiohttp.ClientResponse, show_func: Optional[Callable]=None, path: Optional[str] = None): # noqa: ANN202
815
865
  if not response.ok:
816
866
  if show_func is None:
817
- Config.logger.error(await response.text())
867
+ if path is not None:
868
+ text = await response.text()
869
+ msg = f"failed: {text}" if len(text) > 0 else "failed"
870
+ Config.logger.error(f"{path} {msg}")
871
+ else:
872
+ Config.logger.error(await response.text())
818
873
  else:
874
+ if path is not None:
875
+ Config.logger.error(f"{path} failed")
819
876
  show_func(await response.text(), err=True)
820
877
  response.raise_for_status()
821
878
 
@@ -849,6 +906,26 @@ def send_to_core_get(path: str, with_auth=True, show_func: Optional[Callable]=No
849
906
  return response.content
850
907
 
851
908
 
909
+ # FIXME copypaste
910
+ 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]]:
911
+ host = Config.HOST_PORT if conn_url is None else conn_url
912
+ assert host is not None, "host port not set"
913
+ if auth is None or not with_auth:
914
+ auth = (Config.CORE_USERNAME, Config.CORE_PASSWORD) if with_auth else None
915
+
916
+ async with async_session or aiohttp.ClientSession(auth=auth, connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
917
+ async with session.get(f"{host}{path}", headers=HEADERS) as response:
918
+ await __async_check_response(response, show_func, f"{host}{path}")
919
+ if response.status == HTTPStatus.NO_CONTENT:
920
+ return None
921
+ if is_text is True:
922
+ return await response.text()
923
+ elif is_text is False:
924
+ return await response.json()
925
+ else:
926
+ return await response.read()
927
+
928
+
852
929
  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
930
  """modify: post by default, else - delete"""
854
931
  host = Config.HOST_PORT if conn_url is None else conn_url
@@ -877,6 +954,37 @@ def send_to_core_modify(path: str, operation: Optional[Any] = None, with_auth: b
877
954
  return result
878
955
 
879
956
 
957
+ 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
958
+ """modify: post by default, else - delete"""
959
+ host = Config.HOST_PORT if conn_url is None else conn_url
960
+ assert host is not None, "host port not set"
961
+ if auth is None:
962
+ auth = (Config.CORE_USERNAME, Config.CORE_PASSWORD)
963
+ if operation is not None:
964
+ operation = json.dumps(operation.model_dump())
965
+
966
+ async with async_session or aiohttp.ClientSession(auth=auth if with_auth else None, connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
967
+ if is_post:
968
+ response_cm = session.post(f"{host}{path}", data=operation, headers=HEADERS)
969
+ else:
970
+ response_cm = session.delete(f"{host}{path}", data=operation, headers=HEADERS)
971
+ async with response_cm as response:
972
+ if return_response:
973
+ return response
974
+ await __async_check_response(response, show_func, f"{host}{path}")
975
+ if response.status == HTTPStatus.NO_CONTENT:
976
+ return ""
977
+ result = await response.text()
978
+ if with_show is None:
979
+ with_show = Config.VERBOSE
980
+ if with_show:
981
+ if show_func is None:
982
+ Config.logger.info(result)
983
+ else:
984
+ show_func(result)
985
+ return result
986
+
987
+
880
988
  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
989
  """modify: post by default, else - delete"""
882
990
  host = Config.HOST_PORT if conn_url is None else conn_url
@@ -901,6 +1009,33 @@ def send_to_core_modify_raw(path: str, data: bytes, with_auth: bool=True, with_s
901
1009
  return result
902
1010
 
903
1011
 
1012
+ 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
1013
+ """modify: post by default, else - delete"""
1014
+ host = Config.HOST_PORT if conn_url is None else conn_url
1015
+ assert host is not None, "host port not set"
1016
+ if auth is None:
1017
+ auth = (Config.CORE_USERNAME, Config.CORE_PASSWORD)
1018
+
1019
+ async with async_session or aiohttp.ClientSession(auth=auth if with_auth else None, connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
1020
+ if is_post:
1021
+ response_cm = session.post(f"{host}{path}", data=data, headers=HEADERS_RAW)
1022
+ else:
1023
+ response_cm = session.delete(f"{host}{path}", data=data, headers=HEADERS_RAW)
1024
+ async with response_cm as response:
1025
+ await __async_check_response(response, show_func, f"{host}{path}")
1026
+ if response.status == HTTPStatus.NO_CONTENT:
1027
+ return ""
1028
+ result = await response.text()
1029
+ if with_show is None:
1030
+ with_show = Config.VERBOSE
1031
+ if with_show:
1032
+ if show_func is None:
1033
+ Config.logger.info(result)
1034
+ else:
1035
+ show_func(result)
1036
+ return result
1037
+
1038
+
904
1039
  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
1040
  host = Config.HOST_PORT if conn_url is None else conn_url
906
1041
  assert host is not None, "host port not set"
@@ -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
- return f.get_ping(with_auth=False, conn_url=conn_url)
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
- return f.post_manager_task(
2715
- data,
2716
- with_show=with_show,
2717
- long=long,
2718
- long_timeout=long_timeout,
2719
- wait=wait,
2720
- auth=auth,
2721
- conn_url=conn_url,
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
- return f.post_manager_task(
2817
- data,
2818
- with_show=with_show,
2819
- long=long,
2820
- long_timeout=long_timeout,
2821
- wait=wait,
2822
- auth=auth,
2823
- conn_url=conn_url,
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
- return f.post_manager_task_run(
2883
- data,
2884
- with_show=with_show,
2885
- long=long,
2886
- long_timeout=long_timeout,
2887
- wait=wait,
2888
- auth=auth,
2889
- conn_url=conn_url,
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
- return f.post_manager_pipeline(
2950
- data,
2951
- with_show=with_show,
2952
- long=long,
2953
- long_timeout=long_timeout,
2954
- return_response=return_response,
2955
- wait=wait,
2956
- auth=auth,
2957
- conn_url=conn_url,
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(
@@ -2985,6 +3038,7 @@ def pipeline_prepare(
2985
3038
  auth: Optional[AUTH] = None,
2986
3039
  conn_url: Optional[str] = None,
2987
3040
  batcher: Optional[Batcher] = None,
3041
+ is_async: bool = False,
2988
3042
  ) -> Union[Alias.Id, AppLogs]:
2989
3043
  if batcher is None:
2990
3044
  batcher = Config.BATCHER
@@ -3019,15 +3073,26 @@ def pipeline_prepare(
3019
3073
  )
3020
3074
  if batcher is not None:
3021
3075
  return batcher.add("sendPipeline", data=data, result_model=AppLogs)
3022
- return f.post_manager_pipeline(
3023
- data,
3024
- with_show=with_show,
3025
- long=long,
3026
- long_timeout=long_timeout,
3027
- wait=wait,
3028
- auth=auth,
3029
- conn_url=conn_url,
3030
- )
3076
+ if is_async:
3077
+ return f.post_manager_pipeline_async(
3078
+ data,
3079
+ with_show=with_show,
3080
+ long=long,
3081
+ long_timeout=long_timeout,
3082
+ wait=wait,
3083
+ auth=auth,
3084
+ conn_url=conn_url,
3085
+ )
3086
+ else:
3087
+ return f.post_manager_pipeline(
3088
+ data,
3089
+ with_show=with_show,
3090
+ long=long,
3091
+ long_timeout=long_timeout,
3092
+ wait=wait,
3093
+ auth=auth,
3094
+ conn_url=conn_url,
3095
+ )
3031
3096
 
3032
3097
 
3033
3098
  def task_unschedule(
@@ -3060,6 +3125,7 @@ def task_stop(
3060
3125
  auth: Optional[AUTH] = None,
3061
3126
  conn_url: Optional[str] = None,
3062
3127
  batcher: Optional[Batcher] = None,
3128
+ is_async: bool = False,
3063
3129
  ) -> Optional[Union[Alias.Id, AppLogs]]:
3064
3130
  """stop task by `operation_id`
3065
3131
 
@@ -3077,9 +3143,14 @@ def task_stop(
3077
3143
  data = StopOperation(operationId=operation_id, withLogs=with_logs, infoUrl=info_url)
3078
3144
  if batcher is not None:
3079
3145
  return batcher.add("sendTaskStop", data=data, result_model=AppLogs if with_logs else None)
3080
- return f.post_manager_task_stop(
3081
- data, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url
3082
- )
3146
+ if is_async:
3147
+ return f.post_manager_task_stop_async(
3148
+ data, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url
3149
+ )
3150
+ else:
3151
+ return f.post_manager_task_stop(
3152
+ data, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url
3153
+ )
3083
3154
 
3084
3155
 
3085
3156
  def task_stop_all(
@@ -3091,6 +3162,7 @@ def task_stop_all(
3091
3162
  auth: Optional[AUTH] = None,
3092
3163
  conn_url: Optional[str] = None,
3093
3164
  batcher: Optional[Batcher] = None,
3165
+ is_async: bool = False,
3094
3166
  ) -> Alias.Json:
3095
3167
  """stop all tasks"""
3096
3168
  if batcher is None:
@@ -3098,9 +3170,14 @@ def task_stop_all(
3098
3170
  data = StopOperationMany(withLogs=with_logs, infoUrl=info_url)
3099
3171
  if batcher is not None:
3100
3172
  return batcher.add("sendTaskStopAll", data=data, result_model=AppLogs if with_logs else None)
3101
- return f.post_manager_task_stop_all(
3102
- data, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url
3103
- )
3173
+ if is_async:
3174
+ return f.post_manager_task_stop_all_async(
3175
+ data, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url
3176
+ )
3177
+ else:
3178
+ return f.post_manager_task_stop_all(
3179
+ data, with_show=with_show, wait=wait, auth=auth, conn_url=conn_url
3180
+ )
3104
3181
 
3105
3182
 
3106
3183
  def task_resume(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: malevich-coretools
3
- Version: 0.3.36
3
+ Version: 0.3.37
4
4
  Author: Andrew Pogrebnoj
5
5
  Author-email: andrew@onjulius.co
6
6
  License-File: LICENSE
@@ -1 +0,0 @@
1
- 0.3.36