wmill 1.295.4__tar.gz → 1.296.1__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 wmill might be problematic. Click here for more details.
- {wmill-1.295.4 → wmill-1.296.1}/PKG-INFO +1 -1
- {wmill-1.295.4 → wmill-1.296.1}/pyproject.toml +1 -1
- {wmill-1.295.4 → wmill-1.296.1}/wmill/client.py +33 -0
- {wmill-1.295.4 → wmill-1.296.1}/README.md +0 -0
- {wmill-1.295.4 → wmill-1.296.1}/wmill/__init__.py +0 -0
- {wmill-1.295.4 → wmill-1.296.1}/wmill/py.typed +0 -0
- {wmill-1.295.4 → wmill-1.296.1}/wmill/s3_reader.py +0 -0
- {wmill-1.295.4 → wmill-1.296.1}/wmill/s3_types.py +0 -0
|
@@ -346,6 +346,24 @@ class Windmill:
|
|
|
346
346
|
def set_state(self, value: Any):
|
|
347
347
|
self.set_resource(value, path=self.state_path, resource_type="state")
|
|
348
348
|
|
|
349
|
+
def set_flow_user_state(self, key: str, value: Any) -> None:
|
|
350
|
+
"""Set the user state of a flow at a given key"""
|
|
351
|
+
flow_id = self.get_root_job_id()
|
|
352
|
+
r = client.post(f"/w/{self.workspace}/jobs/flow/user_states/{flow_id}/{key}", json=value, raise_for_status=False)
|
|
353
|
+
if r.status_code == 404:
|
|
354
|
+
print(f"Job {flow_id} does not exist or is not a flow")
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def get_flow_user_state(self, key: str) -> Any:
|
|
358
|
+
"""Get the user state of a flow at a given key"""
|
|
359
|
+
flow_id = self.get_root_job_id()
|
|
360
|
+
r = client.get(f"/w/{self.workspace}/jobs/flow/user_states/{flow_id}/{key}", raise_for_status=False)
|
|
361
|
+
if r.status_code == 404:
|
|
362
|
+
print(f"Job {flow_id} does not exist or is not a flow")
|
|
363
|
+
return None
|
|
364
|
+
else:
|
|
365
|
+
return r.json()
|
|
366
|
+
|
|
349
367
|
@property
|
|
350
368
|
def version(self):
|
|
351
369
|
return self.get("version").text
|
|
@@ -851,6 +869,21 @@ def set_variable(path: str, value: str, is_secret: bool = False) -> None:
|
|
|
851
869
|
return _client.set_variable(path, value, is_secret)
|
|
852
870
|
|
|
853
871
|
|
|
872
|
+
@init_global_client
|
|
873
|
+
def get_flow_user_state(key: str) -> Any:
|
|
874
|
+
"""
|
|
875
|
+
Get the user state of a flow at a given key
|
|
876
|
+
"""
|
|
877
|
+
return _client.get_flow_user_state(key)
|
|
878
|
+
|
|
879
|
+
@init_global_client
|
|
880
|
+
def set_flow_user_state(key: str, value: Any) -> None:
|
|
881
|
+
"""
|
|
882
|
+
Set the user state of a flow at a given key
|
|
883
|
+
"""
|
|
884
|
+
return _client.set_flow_user_state(key, value)
|
|
885
|
+
|
|
886
|
+
|
|
854
887
|
@init_global_client
|
|
855
888
|
def get_state_path() -> str:
|
|
856
889
|
return _client.state_path
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|