mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-24 00:00:46 +00:00
run_inline_script_preview in python client
This commit is contained in:
@@ -276,6 +276,21 @@ class Windmill:
|
||||
cleanup=cleanup, assert_result_is_not_none=assert_result_is_not_none
|
||||
)
|
||||
|
||||
def run_inline_script_preview(
|
||||
self,
|
||||
content: str,
|
||||
language: str,
|
||||
args: dict = None,
|
||||
) -> Any:
|
||||
"""Run a script on the current worker without creating a job"""
|
||||
endpoint = f"/w/{self.workspace}/jobs/run_inline/preview"
|
||||
body = {
|
||||
"content": content,
|
||||
"language": language,
|
||||
"args": args or {},
|
||||
}
|
||||
return self.post(endpoint, json=body).text
|
||||
|
||||
def wait_job(
|
||||
self,
|
||||
job_id,
|
||||
@@ -1527,6 +1542,19 @@ def run_script_by_hash(
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
@init_global_client
|
||||
def run_inline_script_preview(
|
||||
content: str,
|
||||
language: str,
|
||||
args: dict = None,
|
||||
) -> Any:
|
||||
"""Run a script on the current worker without creating a job"""
|
||||
return _client.run_inline_script_preview(
|
||||
content=content,
|
||||
language=language,
|
||||
args=args,
|
||||
)
|
||||
|
||||
|
||||
@init_global_client
|
||||
def username_to_email(username: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user