digitalhub 0.13.0b3__py3-none-any.whl → 0.14.9__py3-none-any.whl
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.
- digitalhub/__init__.py +3 -8
- digitalhub/context/api.py +43 -6
- digitalhub/context/builder.py +1 -5
- digitalhub/context/context.py +28 -13
- digitalhub/entities/_base/_base/entity.py +0 -15
- digitalhub/entities/_base/context/entity.py +1 -4
- digitalhub/entities/_base/entity/builder.py +5 -5
- digitalhub/entities/_base/entity/entity.py +0 -8
- digitalhub/entities/_base/executable/entity.py +195 -87
- digitalhub/entities/_base/material/entity.py +11 -23
- digitalhub/entities/_base/material/utils.py +28 -4
- digitalhub/entities/_base/runtime_entity/builder.py +53 -18
- digitalhub/entities/_base/unversioned/entity.py +1 -1
- digitalhub/entities/_base/versioned/entity.py +1 -1
- digitalhub/entities/_commons/enums.py +1 -31
- digitalhub/entities/_commons/metrics.py +64 -30
- digitalhub/entities/_commons/utils.py +119 -30
- digitalhub/entities/_constructors/_resources.py +151 -0
- digitalhub/entities/{_base/entity/_constructors → _constructors}/name.py +18 -0
- digitalhub/entities/_processors/base/crud.py +381 -0
- digitalhub/entities/_processors/base/import_export.py +118 -0
- digitalhub/entities/_processors/base/processor.py +299 -0
- digitalhub/entities/_processors/base/special_ops.py +104 -0
- digitalhub/entities/_processors/context/crud.py +652 -0
- digitalhub/entities/_processors/context/import_export.py +242 -0
- digitalhub/entities/_processors/context/material.py +123 -0
- digitalhub/entities/_processors/context/processor.py +400 -0
- digitalhub/entities/_processors/context/special_ops.py +476 -0
- digitalhub/entities/_processors/processors.py +12 -0
- digitalhub/entities/_processors/utils.py +38 -102
- digitalhub/entities/artifact/crud.py +58 -22
- digitalhub/entities/artifact/utils.py +28 -13
- digitalhub/entities/builders.py +2 -0
- digitalhub/entities/dataitem/crud.py +63 -20
- digitalhub/entities/dataitem/table/entity.py +27 -22
- digitalhub/entities/dataitem/utils.py +82 -32
- digitalhub/entities/function/_base/entity.py +3 -6
- digitalhub/entities/function/crud.py +55 -24
- digitalhub/entities/model/_base/entity.py +62 -20
- digitalhub/entities/model/crud.py +59 -23
- digitalhub/entities/model/mlflow/utils.py +29 -20
- digitalhub/entities/model/utils.py +28 -13
- digitalhub/entities/project/_base/builder.py +0 -6
- digitalhub/entities/project/_base/entity.py +337 -164
- digitalhub/entities/project/_base/spec.py +4 -4
- digitalhub/entities/project/crud.py +28 -71
- digitalhub/entities/project/utils.py +7 -3
- digitalhub/entities/run/_base/builder.py +0 -4
- digitalhub/entities/run/_base/entity.py +70 -63
- digitalhub/entities/run/crud.py +79 -26
- digitalhub/entities/secret/_base/entity.py +1 -5
- digitalhub/entities/secret/crud.py +31 -28
- digitalhub/entities/task/_base/builder.py +0 -4
- digitalhub/entities/task/_base/entity.py +5 -5
- digitalhub/entities/task/_base/models.py +13 -16
- digitalhub/entities/task/crud.py +61 -29
- digitalhub/entities/trigger/_base/entity.py +1 -5
- digitalhub/entities/trigger/crud.py +89 -30
- digitalhub/entities/workflow/_base/entity.py +3 -8
- digitalhub/entities/workflow/crud.py +55 -24
- digitalhub/factory/entity.py +283 -0
- digitalhub/factory/enums.py +18 -0
- digitalhub/factory/registry.py +197 -0
- digitalhub/factory/runtime.py +44 -0
- digitalhub/factory/utils.py +3 -54
- digitalhub/runtimes/_base.py +2 -2
- digitalhub/stores/client/{dhcore/api_builder.py → api_builder.py} +3 -3
- digitalhub/stores/client/builder.py +19 -31
- digitalhub/stores/client/client.py +322 -0
- digitalhub/stores/client/configurator.py +408 -0
- digitalhub/stores/client/enums.py +50 -0
- digitalhub/stores/client/{dhcore/error_parser.py → error_parser.py} +0 -4
- digitalhub/stores/client/header_manager.py +61 -0
- digitalhub/stores/client/http_handler.py +152 -0
- digitalhub/stores/client/{_base/key_builder.py → key_builder.py} +14 -14
- digitalhub/stores/client/params_builder.py +330 -0
- digitalhub/stores/client/response_processor.py +102 -0
- digitalhub/stores/client/utils.py +35 -0
- digitalhub/stores/{credentials → configurator}/api.py +5 -9
- digitalhub/stores/configurator/configurator.py +123 -0
- digitalhub/stores/{credentials → configurator}/enums.py +27 -10
- digitalhub/stores/configurator/handler.py +213 -0
- digitalhub/stores/{credentials → configurator}/ini_module.py +31 -22
- digitalhub/stores/data/_base/store.py +0 -20
- digitalhub/stores/data/api.py +5 -7
- digitalhub/stores/data/builder.py +53 -27
- digitalhub/stores/data/local/store.py +0 -103
- digitalhub/stores/data/remote/store.py +0 -4
- digitalhub/stores/data/s3/configurator.py +39 -77
- digitalhub/stores/data/s3/store.py +57 -37
- digitalhub/stores/data/sql/configurator.py +66 -46
- digitalhub/stores/data/sql/store.py +171 -104
- digitalhub/stores/readers/data/factory.py +0 -8
- digitalhub/stores/readers/data/pandas/reader.py +9 -19
- digitalhub/utils/file_utils.py +0 -17
- digitalhub/utils/generic_utils.py +1 -14
- digitalhub/utils/git_utils.py +0 -8
- digitalhub/utils/io_utils.py +0 -12
- digitalhub/utils/store_utils.py +44 -0
- {digitalhub-0.13.0b3.dist-info → digitalhub-0.14.9.dist-info}/METADATA +5 -4
- {digitalhub-0.13.0b3.dist-info → digitalhub-0.14.9.dist-info}/RECORD +112 -113
- {digitalhub-0.13.0b3.dist-info → digitalhub-0.14.9.dist-info}/WHEEL +1 -1
- digitalhub/entities/_commons/types.py +0 -9
- digitalhub/entities/_processors/base.py +0 -531
- digitalhub/entities/_processors/context.py +0 -1299
- digitalhub/entities/task/_base/utils.py +0 -22
- digitalhub/factory/factory.py +0 -381
- digitalhub/stores/client/_base/api_builder.py +0 -34
- digitalhub/stores/client/_base/client.py +0 -243
- digitalhub/stores/client/_base/params_builder.py +0 -34
- digitalhub/stores/client/api.py +0 -36
- digitalhub/stores/client/dhcore/client.py +0 -613
- digitalhub/stores/client/dhcore/configurator.py +0 -675
- digitalhub/stores/client/dhcore/enums.py +0 -34
- digitalhub/stores/client/dhcore/key_builder.py +0 -62
- digitalhub/stores/client/dhcore/models.py +0 -40
- digitalhub/stores/client/dhcore/params_builder.py +0 -278
- digitalhub/stores/client/dhcore/utils.py +0 -94
- digitalhub/stores/client/local/api_builder.py +0 -116
- digitalhub/stores/client/local/client.py +0 -573
- digitalhub/stores/client/local/enums.py +0 -15
- digitalhub/stores/client/local/key_builder.py +0 -62
- digitalhub/stores/client/local/params_builder.py +0 -120
- digitalhub/stores/credentials/__init__.py +0 -3
- digitalhub/stores/credentials/configurator.py +0 -210
- digitalhub/stores/credentials/handler.py +0 -176
- digitalhub/stores/credentials/store.py +0 -81
- digitalhub/stores/data/enums.py +0 -15
- digitalhub/stores/data/s3/utils.py +0 -78
- /digitalhub/entities/{_base/entity/_constructors → _constructors}/__init__.py +0 -0
- /digitalhub/entities/{_base/entity/_constructors → _constructors}/metadata.py +0 -0
- /digitalhub/entities/{_base/entity/_constructors → _constructors}/spec.py +0 -0
- /digitalhub/entities/{_base/entity/_constructors → _constructors}/status.py +0 -0
- /digitalhub/entities/{_base/entity/_constructors → _constructors}/uuid.py +0 -0
- /digitalhub/{stores/client/_base → entities/_processors/base}/__init__.py +0 -0
- /digitalhub/{stores/client/dhcore → entities/_processors/context}/__init__.py +0 -0
- /digitalhub/stores/{client/local → configurator}/__init__.py +0 -0
- {digitalhub-0.13.0b3.dist-info → digitalhub-0.14.9.dist-info}/licenses/AUTHORS +0 -0
- {digitalhub-0.13.0b3.dist-info → digitalhub-0.14.9.dist-info}/licenses/LICENSE +0 -0
|
@@ -7,7 +7,7 @@ from __future__ import annotations
|
|
|
7
7
|
import typing
|
|
8
8
|
|
|
9
9
|
from digitalhub.entities._commons.enums import EntityTypes
|
|
10
|
-
from digitalhub.entities._processors.
|
|
10
|
+
from digitalhub.entities._processors.processors import context_processor
|
|
11
11
|
|
|
12
12
|
if typing.TYPE_CHECKING:
|
|
13
13
|
from digitalhub.entities.trigger._base.entity import Trigger
|
|
@@ -41,6 +41,12 @@ def new_trigger(
|
|
|
41
41
|
Object name.
|
|
42
42
|
kind : str
|
|
43
43
|
Kind the object.
|
|
44
|
+
task : str
|
|
45
|
+
Task string.
|
|
46
|
+
function : str
|
|
47
|
+
Function string.
|
|
48
|
+
workflow : str
|
|
49
|
+
Workflow string.
|
|
44
50
|
uuid : str
|
|
45
51
|
ID of the object.
|
|
46
52
|
description : str
|
|
@@ -63,18 +69,31 @@ def new_trigger(
|
|
|
63
69
|
>>> kind="trigger",
|
|
64
70
|
>>> name="my-trigger",)
|
|
65
71
|
"""
|
|
66
|
-
if workflow is None
|
|
67
|
-
|
|
72
|
+
if workflow is None:
|
|
73
|
+
if function is None:
|
|
74
|
+
raise ValueError("Workflow or function must be provided")
|
|
75
|
+
executable_type = "function"
|
|
76
|
+
executable = function
|
|
77
|
+
else:
|
|
78
|
+
executable_type = "workflow"
|
|
79
|
+
executable = workflow
|
|
80
|
+
|
|
81
|
+
# Prepare kwargs
|
|
68
82
|
if kwargs is None:
|
|
69
83
|
kwargs = {}
|
|
84
|
+
kwargs["task"] = task
|
|
85
|
+
kwargs[executable_type] = executable
|
|
86
|
+
|
|
87
|
+
# Template handling
|
|
70
88
|
if template is None:
|
|
71
89
|
template = {}
|
|
90
|
+
if not isinstance(template, dict):
|
|
91
|
+
raise ValueError("Template must be a dictionary")
|
|
72
92
|
template["task"] = task
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if function is not None:
|
|
76
|
-
template["function"] = function
|
|
93
|
+
template[executable_type] = executable
|
|
94
|
+
template["local_execution"] = False
|
|
77
95
|
kwargs["template"] = template
|
|
96
|
+
|
|
78
97
|
return context_processor.create_context_entity(
|
|
79
98
|
project=project,
|
|
80
99
|
name=name,
|
|
@@ -91,7 +110,6 @@ def get_trigger(
|
|
|
91
110
|
identifier: str,
|
|
92
111
|
project: str | None = None,
|
|
93
112
|
entity_id: str | None = None,
|
|
94
|
-
**kwargs,
|
|
95
113
|
) -> Trigger:
|
|
96
114
|
"""
|
|
97
115
|
Get object from backend.
|
|
@@ -104,8 +122,6 @@ def get_trigger(
|
|
|
104
122
|
Project name.
|
|
105
123
|
entity_id : str
|
|
106
124
|
Entity ID.
|
|
107
|
-
**kwargs : dict
|
|
108
|
-
Parameters to pass to the API call.
|
|
109
125
|
|
|
110
126
|
Returns
|
|
111
127
|
-------
|
|
@@ -123,18 +139,16 @@ def get_trigger(
|
|
|
123
139
|
>>> entity_id="my-trigger-id")
|
|
124
140
|
"""
|
|
125
141
|
return context_processor.read_context_entity(
|
|
126
|
-
identifier,
|
|
142
|
+
identifier=identifier,
|
|
127
143
|
entity_type=ENTITY_TYPE,
|
|
128
144
|
project=project,
|
|
129
145
|
entity_id=entity_id,
|
|
130
|
-
**kwargs,
|
|
131
146
|
)
|
|
132
147
|
|
|
133
148
|
|
|
134
149
|
def get_trigger_versions(
|
|
135
150
|
identifier: str,
|
|
136
151
|
project: str | None = None,
|
|
137
|
-
**kwargs,
|
|
138
152
|
) -> list[Trigger]:
|
|
139
153
|
"""
|
|
140
154
|
Get object versions from backend.
|
|
@@ -145,8 +159,6 @@ def get_trigger_versions(
|
|
|
145
159
|
Entity key (store://...) or entity name.
|
|
146
160
|
project : str
|
|
147
161
|
Project name.
|
|
148
|
-
**kwargs : dict
|
|
149
|
-
Parameters to pass to the API call.
|
|
150
162
|
|
|
151
163
|
Returns
|
|
152
164
|
-------
|
|
@@ -163,14 +175,24 @@ def get_trigger_versions(
|
|
|
163
175
|
>>> project="my-project")
|
|
164
176
|
"""
|
|
165
177
|
return context_processor.read_context_entity_versions(
|
|
166
|
-
identifier,
|
|
178
|
+
identifier=identifier,
|
|
167
179
|
entity_type=ENTITY_TYPE,
|
|
168
180
|
project=project,
|
|
169
|
-
**kwargs,
|
|
170
181
|
)
|
|
171
182
|
|
|
172
183
|
|
|
173
|
-
def list_triggers(
|
|
184
|
+
def list_triggers(
|
|
185
|
+
project: str,
|
|
186
|
+
q: str | None = None,
|
|
187
|
+
name: str | None = None,
|
|
188
|
+
kind: str | None = None,
|
|
189
|
+
user: str | None = None,
|
|
190
|
+
state: str | None = None,
|
|
191
|
+
created: str | None = None,
|
|
192
|
+
updated: str | None = None,
|
|
193
|
+
versions: str | None = None,
|
|
194
|
+
task: str | None = None,
|
|
195
|
+
) -> list[Trigger]:
|
|
174
196
|
"""
|
|
175
197
|
List all latest version objects from backend.
|
|
176
198
|
|
|
@@ -178,8 +200,24 @@ def list_triggers(project: str, **kwargs) -> list[Trigger]:
|
|
|
178
200
|
----------
|
|
179
201
|
project : str
|
|
180
202
|
Project name.
|
|
181
|
-
|
|
182
|
-
|
|
203
|
+
q : str
|
|
204
|
+
Query string to filter objects.
|
|
205
|
+
name : str
|
|
206
|
+
Object name.
|
|
207
|
+
kind : str
|
|
208
|
+
Kind of the object.
|
|
209
|
+
user : str
|
|
210
|
+
User that created the object.
|
|
211
|
+
state : str
|
|
212
|
+
Object state.
|
|
213
|
+
created : str
|
|
214
|
+
Creation date filter.
|
|
215
|
+
updated : str
|
|
216
|
+
Update date filter.
|
|
217
|
+
versions : str
|
|
218
|
+
Object version, default is latest.
|
|
219
|
+
task : str
|
|
220
|
+
Task string filter.
|
|
183
221
|
|
|
184
222
|
Returns
|
|
185
223
|
-------
|
|
@@ -193,18 +231,37 @@ def list_triggers(project: str, **kwargs) -> list[Trigger]:
|
|
|
193
231
|
return context_processor.list_context_entities(
|
|
194
232
|
project=project,
|
|
195
233
|
entity_type=ENTITY_TYPE,
|
|
196
|
-
|
|
234
|
+
q=q,
|
|
235
|
+
name=name,
|
|
236
|
+
kind=kind,
|
|
237
|
+
user=user,
|
|
238
|
+
state=state,
|
|
239
|
+
created=created,
|
|
240
|
+
updated=updated,
|
|
241
|
+
versions=versions,
|
|
242
|
+
task=task,
|
|
197
243
|
)
|
|
198
244
|
|
|
199
245
|
|
|
200
|
-
def import_trigger(
|
|
246
|
+
def import_trigger(
|
|
247
|
+
file: str | None = None,
|
|
248
|
+
key: str | None = None,
|
|
249
|
+
reset_id: bool = False,
|
|
250
|
+
context: str | None = None,
|
|
251
|
+
) -> Trigger:
|
|
201
252
|
"""
|
|
202
|
-
Import object from a YAML file
|
|
253
|
+
Import an object from a YAML file or from a storage key.
|
|
203
254
|
|
|
204
255
|
Parameters
|
|
205
256
|
----------
|
|
206
257
|
file : str
|
|
207
|
-
Path to YAML file.
|
|
258
|
+
Path to the YAML file.
|
|
259
|
+
key : str
|
|
260
|
+
Entity key (store://...).
|
|
261
|
+
reset_id : bool
|
|
262
|
+
Flag to determine if the ID of executable entities should be reset.
|
|
263
|
+
context : str
|
|
264
|
+
Project name to use for context resolution.
|
|
208
265
|
|
|
209
266
|
Returns
|
|
210
267
|
-------
|
|
@@ -215,7 +272,12 @@ def import_trigger(file: str) -> Trigger:
|
|
|
215
272
|
--------
|
|
216
273
|
>>> obj = import_trigger("my-trigger.yaml")
|
|
217
274
|
"""
|
|
218
|
-
return context_processor.import_context_entity(
|
|
275
|
+
return context_processor.import_context_entity(
|
|
276
|
+
file,
|
|
277
|
+
key,
|
|
278
|
+
reset_id,
|
|
279
|
+
context,
|
|
280
|
+
)
|
|
219
281
|
|
|
220
282
|
|
|
221
283
|
def load_trigger(file: str) -> Trigger:
|
|
@@ -270,7 +332,6 @@ def delete_trigger(
|
|
|
270
332
|
project: str | None = None,
|
|
271
333
|
entity_id: str | None = None,
|
|
272
334
|
delete_all_versions: bool = False,
|
|
273
|
-
**kwargs,
|
|
274
335
|
) -> dict:
|
|
275
336
|
"""
|
|
276
337
|
Delete object from backend.
|
|
@@ -284,9 +345,8 @@ def delete_trigger(
|
|
|
284
345
|
entity_id : str
|
|
285
346
|
Entity ID.
|
|
286
347
|
delete_all_versions : bool
|
|
287
|
-
Delete all versions of the named entity.
|
|
288
|
-
|
|
289
|
-
Parameters to pass to the API call.
|
|
348
|
+
Delete all versions of the named entity.
|
|
349
|
+
If True, use entity name instead of entity key as identifier.
|
|
290
350
|
|
|
291
351
|
Returns
|
|
292
352
|
-------
|
|
@@ -309,5 +369,4 @@ def delete_trigger(
|
|
|
309
369
|
project=project,
|
|
310
370
|
entity_id=entity_id,
|
|
311
371
|
delete_all_versions=delete_all_versions,
|
|
312
|
-
**kwargs,
|
|
313
372
|
)
|
|
@@ -8,8 +8,7 @@ import typing
|
|
|
8
8
|
|
|
9
9
|
from digitalhub.entities._base.executable.entity import ExecutableEntity
|
|
10
10
|
from digitalhub.entities._commons.enums import EntityTypes, Relationship
|
|
11
|
-
from digitalhub.factory.
|
|
12
|
-
from digitalhub.utils.exceptions import BackendError
|
|
11
|
+
from digitalhub.factory.entity import entity_factory
|
|
13
12
|
|
|
14
13
|
if typing.TYPE_CHECKING:
|
|
15
14
|
from digitalhub.entities._base.entity.metadata import Metadata
|
|
@@ -72,16 +71,12 @@ class Workflow(ExecutableEntity):
|
|
|
72
71
|
Run instance.
|
|
73
72
|
"""
|
|
74
73
|
# Get task and run kind
|
|
75
|
-
task_kind =
|
|
76
|
-
run_kind =
|
|
74
|
+
task_kind = entity_factory.get_task_kind_from_action(self.kind, action)
|
|
75
|
+
run_kind = entity_factory.get_run_kind_from_action(self.kind, action)
|
|
77
76
|
|
|
78
77
|
# Create or update new task
|
|
79
78
|
task = self._get_or_create_task(task_kind)
|
|
80
79
|
|
|
81
|
-
# Raise error if execution is not done by DHCore backend
|
|
82
|
-
if self._context().local:
|
|
83
|
-
raise BackendError("Cannot run workflow with local backend.")
|
|
84
|
-
|
|
85
80
|
# Run task
|
|
86
81
|
run = task.run(run_kind, save=False, local_execution=False, **kwargs)
|
|
87
82
|
|
|
@@ -7,7 +7,7 @@ from __future__ import annotations
|
|
|
7
7
|
import typing
|
|
8
8
|
|
|
9
9
|
from digitalhub.entities._commons.enums import EntityTypes
|
|
10
|
-
from digitalhub.entities._processors.
|
|
10
|
+
from digitalhub.entities._processors.processors import context_processor
|
|
11
11
|
|
|
12
12
|
if typing.TYPE_CHECKING:
|
|
13
13
|
from digitalhub.entities.workflow._base.entity import Workflow
|
|
@@ -75,7 +75,6 @@ def get_workflow(
|
|
|
75
75
|
identifier: str,
|
|
76
76
|
project: str | None = None,
|
|
77
77
|
entity_id: str | None = None,
|
|
78
|
-
**kwargs,
|
|
79
78
|
) -> Workflow:
|
|
80
79
|
"""
|
|
81
80
|
Get object from backend.
|
|
@@ -88,8 +87,6 @@ def get_workflow(
|
|
|
88
87
|
Project name.
|
|
89
88
|
entity_id : str
|
|
90
89
|
Entity ID.
|
|
91
|
-
**kwargs : dict
|
|
92
|
-
Parameters to pass to the API call.
|
|
93
90
|
|
|
94
91
|
Returns
|
|
95
92
|
-------
|
|
@@ -107,18 +104,16 @@ def get_workflow(
|
|
|
107
104
|
>>> entity_id="my-workflow-id")
|
|
108
105
|
"""
|
|
109
106
|
return context_processor.read_context_entity(
|
|
110
|
-
identifier,
|
|
107
|
+
identifier=identifier,
|
|
111
108
|
entity_type=ENTITY_TYPE,
|
|
112
109
|
project=project,
|
|
113
110
|
entity_id=entity_id,
|
|
114
|
-
**kwargs,
|
|
115
111
|
)
|
|
116
112
|
|
|
117
113
|
|
|
118
114
|
def get_workflow_versions(
|
|
119
115
|
identifier: str,
|
|
120
116
|
project: str | None = None,
|
|
121
|
-
**kwargs,
|
|
122
117
|
) -> list[Workflow]:
|
|
123
118
|
"""
|
|
124
119
|
Get object versions from backend.
|
|
@@ -129,8 +124,6 @@ def get_workflow_versions(
|
|
|
129
124
|
Entity key (store://...) or entity name.
|
|
130
125
|
project : str
|
|
131
126
|
Project name.
|
|
132
|
-
**kwargs : dict
|
|
133
|
-
Parameters to pass to the API call.
|
|
134
127
|
|
|
135
128
|
Returns
|
|
136
129
|
-------
|
|
@@ -147,14 +140,23 @@ def get_workflow_versions(
|
|
|
147
140
|
>>> project="my-project")
|
|
148
141
|
"""
|
|
149
142
|
return context_processor.read_context_entity_versions(
|
|
150
|
-
identifier,
|
|
143
|
+
identifier=identifier,
|
|
151
144
|
entity_type=ENTITY_TYPE,
|
|
152
145
|
project=project,
|
|
153
|
-
**kwargs,
|
|
154
146
|
)
|
|
155
147
|
|
|
156
148
|
|
|
157
|
-
def list_workflows(
|
|
149
|
+
def list_workflows(
|
|
150
|
+
project: str,
|
|
151
|
+
q: str | None = None,
|
|
152
|
+
name: str | None = None,
|
|
153
|
+
kind: str | None = None,
|
|
154
|
+
user: str | None = None,
|
|
155
|
+
state: str | None = None,
|
|
156
|
+
created: str | None = None,
|
|
157
|
+
updated: str | None = None,
|
|
158
|
+
versions: str | None = None,
|
|
159
|
+
) -> list[Workflow]:
|
|
158
160
|
"""
|
|
159
161
|
List all latest version objects from backend.
|
|
160
162
|
|
|
@@ -162,8 +164,22 @@ def list_workflows(project: str, **kwargs) -> list[Workflow]:
|
|
|
162
164
|
----------
|
|
163
165
|
project : str
|
|
164
166
|
Project name.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
q : str
|
|
168
|
+
Query string to filter objects.
|
|
169
|
+
name : str
|
|
170
|
+
Object name.
|
|
171
|
+
kind : str
|
|
172
|
+
Kind of the object.
|
|
173
|
+
user : str
|
|
174
|
+
User that created the object.
|
|
175
|
+
state : str
|
|
176
|
+
Object state.
|
|
177
|
+
created : str
|
|
178
|
+
Creation date filter.
|
|
179
|
+
updated : str
|
|
180
|
+
Update date filter.
|
|
181
|
+
versions : str
|
|
182
|
+
Object version, default is latest.
|
|
167
183
|
|
|
168
184
|
Returns
|
|
169
185
|
-------
|
|
@@ -177,18 +193,36 @@ def list_workflows(project: str, **kwargs) -> list[Workflow]:
|
|
|
177
193
|
return context_processor.list_context_entities(
|
|
178
194
|
project=project,
|
|
179
195
|
entity_type=ENTITY_TYPE,
|
|
180
|
-
|
|
196
|
+
q=q,
|
|
197
|
+
name=name,
|
|
198
|
+
kind=kind,
|
|
199
|
+
user=user,
|
|
200
|
+
state=state,
|
|
201
|
+
created=created,
|
|
202
|
+
updated=updated,
|
|
203
|
+
versions=versions,
|
|
181
204
|
)
|
|
182
205
|
|
|
183
206
|
|
|
184
|
-
def import_workflow(
|
|
207
|
+
def import_workflow(
|
|
208
|
+
file: str | None = None,
|
|
209
|
+
key: str | None = None,
|
|
210
|
+
reset_id: bool = False,
|
|
211
|
+
context: str | None = None,
|
|
212
|
+
) -> Workflow:
|
|
185
213
|
"""
|
|
186
|
-
Import object from a YAML file
|
|
214
|
+
Import an object from a YAML file or from a storage key.
|
|
187
215
|
|
|
188
216
|
Parameters
|
|
189
217
|
----------
|
|
190
218
|
file : str
|
|
191
|
-
Path to YAML file.
|
|
219
|
+
Path to the YAML file.
|
|
220
|
+
key : str
|
|
221
|
+
Entity key (store://...).
|
|
222
|
+
reset_id : bool
|
|
223
|
+
Flag to determine if the ID of executable entities should be reset.
|
|
224
|
+
context : str
|
|
225
|
+
Project name to use for context resolution.
|
|
192
226
|
|
|
193
227
|
Returns
|
|
194
228
|
-------
|
|
@@ -199,7 +233,7 @@ def import_workflow(file: str) -> Workflow:
|
|
|
199
233
|
--------
|
|
200
234
|
>>> obj = import_workflow("my-workflow.yaml")
|
|
201
235
|
"""
|
|
202
|
-
return context_processor.import_executable_entity(file)
|
|
236
|
+
return context_processor.import_executable_entity(file, key, reset_id, context)
|
|
203
237
|
|
|
204
238
|
|
|
205
239
|
def load_workflow(file: str) -> Workflow:
|
|
@@ -255,7 +289,6 @@ def delete_workflow(
|
|
|
255
289
|
entity_id: str | None = None,
|
|
256
290
|
delete_all_versions: bool = False,
|
|
257
291
|
cascade: bool = True,
|
|
258
|
-
**kwargs,
|
|
259
292
|
) -> dict:
|
|
260
293
|
"""
|
|
261
294
|
Delete object from backend.
|
|
@@ -269,11 +302,10 @@ def delete_workflow(
|
|
|
269
302
|
entity_id : str
|
|
270
303
|
Entity ID.
|
|
271
304
|
delete_all_versions : bool
|
|
272
|
-
Delete all versions of the named entity.
|
|
305
|
+
Delete all versions of the named entity.
|
|
306
|
+
If True, use entity name instead of entity key as identifier.
|
|
273
307
|
cascade : bool
|
|
274
308
|
Cascade delete.
|
|
275
|
-
**kwargs : dict
|
|
276
|
-
Parameters to pass to the API call.
|
|
277
309
|
|
|
278
310
|
Returns
|
|
279
311
|
-------
|
|
@@ -297,5 +329,4 @@ def delete_workflow(
|
|
|
297
329
|
entity_id=entity_id,
|
|
298
330
|
delete_all_versions=delete_all_versions,
|
|
299
331
|
cascade=cascade,
|
|
300
|
-
**kwargs,
|
|
301
332
|
)
|