wmill
The core client for the Windmill platform.
Usage
Basic Usage
The wmill
package has several methods at the top-level for the most frequent operations you will need.
The following are some common examples:
import time
import wmill
def main():
wmill.get_variable("u/user/variable_path")
wmill.run_script("f/pathto/script", args={"arg1": "value1"})
wmill.get_resource("u/user/resource_path")
wmill.set_state({"ts": time.time()})
wmill.get_state()
Advanced Usage
The wmill
package also exposes the Windmill
class, which is the core client for the Windmill platform.
import time
from wmill import Windmill
def main():
client = Windmill(
)
client.version
client.user
client.get("/configs/list_worker_groups")
client.post(
f"/w/{client.workspace}/groups/create",
json={
"name": "my-group",
"summary": "my group summary",
}
)
now = time.time()
client.state = {"ts": now}
assert client.state == {"ts": now}
job_id = client.run_script_async(path="path/to/script")
client.get_job_status(job_id)
client.get_result(job_id)