digitalhub 0.14.0b3__py3-none-any.whl → 0.14.0b5__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/context/context.py +15 -1
- digitalhub/entities/_base/executable/entity.py +160 -58
- digitalhub/entities/_base/material/entity.py +4 -0
- digitalhub/entities/_base/material/utils.py +28 -0
- digitalhub/entities/_commons/enums.py +0 -31
- digitalhub/entities/_constructors/_resources.py +151 -0
- digitalhub/entities/_constructors/name.py +18 -0
- digitalhub/entities/_processors/base/crud.py +1 -1
- digitalhub/entities/_processors/base/special_ops.py +1 -1
- digitalhub/entities/_processors/context/crud.py +25 -25
- digitalhub/entities/_processors/context/special_ops.py +1 -1
- digitalhub/entities/_processors/utils.py +2 -1
- digitalhub/entities/artifact/crud.py +37 -17
- digitalhub/entities/dataitem/crud.py +37 -13
- digitalhub/entities/dataitem/table/entity.py +3 -0
- digitalhub/entities/function/crud.py +39 -19
- digitalhub/entities/model/crud.py +37 -17
- digitalhub/entities/project/_base/entity.py +5 -5
- digitalhub/entities/project/crud.py +6 -20
- digitalhub/entities/run/_base/entity.py +1 -1
- digitalhub/entities/run/crud.py +54 -21
- digitalhub/entities/secret/crud.py +6 -20
- digitalhub/entities/task/crud.py +40 -25
- digitalhub/entities/trigger/crud.py +43 -19
- digitalhub/entities/workflow/crud.py +39 -16
- digitalhub/stores/client/_base/enums.py +39 -0
- digitalhub/stores/client/_base/key_builder.py +1 -1
- digitalhub/stores/client/_base/params_builder.py +48 -0
- digitalhub/stores/client/dhcore/api_builder.py +2 -1
- digitalhub/stores/client/dhcore/client.py +67 -55
- digitalhub/stores/client/dhcore/params_builder.py +130 -75
- digitalhub/stores/client/local/api_builder.py +1 -1
- digitalhub/stores/client/local/params_builder.py +18 -41
- digitalhub/stores/data/s3/store.py +8 -5
- {digitalhub-0.14.0b3.dist-info → digitalhub-0.14.0b5.dist-info}/METADATA +1 -1
- {digitalhub-0.14.0b3.dist-info → digitalhub-0.14.0b5.dist-info}/RECORD +39 -37
- {digitalhub-0.14.0b3.dist-info → digitalhub-0.14.0b5.dist-info}/WHEEL +0 -0
- {digitalhub-0.14.0b3.dist-info → digitalhub-0.14.0b5.dist-info}/licenses/AUTHORS +0 -0
- {digitalhub-0.14.0b3.dist-info → digitalhub-0.14.0b5.dist-info}/licenses/LICENSE +0 -0
|
@@ -79,7 +79,6 @@ def get_project(
|
|
|
79
79
|
name: str,
|
|
80
80
|
local: bool = False,
|
|
81
81
|
setup_kwargs: dict | None = None,
|
|
82
|
-
**kwargs,
|
|
83
82
|
) -> Project:
|
|
84
83
|
"""
|
|
85
84
|
Retrieves project details from backend.
|
|
@@ -92,8 +91,6 @@ def get_project(
|
|
|
92
91
|
Flag to determine if backend is local.
|
|
93
92
|
setup_kwargs : dict
|
|
94
93
|
Setup keyword arguments passed to setup_project() function.
|
|
95
|
-
**kwargs : dict
|
|
96
|
-
Parameters to pass to the API call.
|
|
97
94
|
|
|
98
95
|
Returns
|
|
99
96
|
-------
|
|
@@ -108,7 +105,6 @@ def get_project(
|
|
|
108
105
|
entity_type=ENTITY_TYPE,
|
|
109
106
|
entity_name=name,
|
|
110
107
|
local=local,
|
|
111
|
-
**kwargs,
|
|
112
108
|
)
|
|
113
109
|
return setup_project(obj, setup_kwargs)
|
|
114
110
|
|
|
@@ -180,7 +176,7 @@ def load_project(
|
|
|
180
176
|
return setup_project(obj, setup_kwargs)
|
|
181
177
|
|
|
182
178
|
|
|
183
|
-
def list_projects(local: bool = False
|
|
179
|
+
def list_projects(local: bool = False) -> list[Project]:
|
|
184
180
|
"""
|
|
185
181
|
List projects in backend.
|
|
186
182
|
|
|
@@ -188,15 +184,13 @@ def list_projects(local: bool = False, **kwargs) -> list[Project]:
|
|
|
188
184
|
----------
|
|
189
185
|
local : bool
|
|
190
186
|
Flag to determine if backend is local.
|
|
191
|
-
**kwargs : dict
|
|
192
|
-
Parameters to pass to the API call.
|
|
193
187
|
|
|
194
188
|
Returns
|
|
195
189
|
-------
|
|
196
190
|
list
|
|
197
191
|
List of objects.
|
|
198
192
|
"""
|
|
199
|
-
return base_processor.list_project_entities(local=local
|
|
193
|
+
return base_processor.list_project_entities(local=local)
|
|
200
194
|
|
|
201
195
|
|
|
202
196
|
def get_or_create_project(
|
|
@@ -282,7 +276,6 @@ def delete_project(
|
|
|
282
276
|
cascade: bool = True,
|
|
283
277
|
clean_context: bool = True,
|
|
284
278
|
local: bool = False,
|
|
285
|
-
**kwargs,
|
|
286
279
|
) -> dict:
|
|
287
280
|
"""
|
|
288
281
|
Delete a project.
|
|
@@ -297,8 +290,6 @@ def delete_project(
|
|
|
297
290
|
Flag to determine if context will be deleted.
|
|
298
291
|
local : bool
|
|
299
292
|
Flag to determine if backend is local.
|
|
300
|
-
**kwargs : dict
|
|
301
|
-
Parameters to pass to the API call.
|
|
302
293
|
|
|
303
294
|
Returns
|
|
304
295
|
-------
|
|
@@ -315,7 +306,6 @@ def delete_project(
|
|
|
315
306
|
local=local,
|
|
316
307
|
cascade=cascade,
|
|
317
308
|
clean_context=clean_context,
|
|
318
|
-
**kwargs,
|
|
319
309
|
)
|
|
320
310
|
|
|
321
311
|
|
|
@@ -329,7 +319,6 @@ def search_entity(
|
|
|
329
319
|
updated: str | None = None,
|
|
330
320
|
description: str | None = None,
|
|
331
321
|
labels: list[str] | None = None,
|
|
332
|
-
**kwargs,
|
|
333
322
|
) -> list[ContextEntity]:
|
|
334
323
|
"""
|
|
335
324
|
Search objects from backend.
|
|
@@ -354,13 +343,11 @@ def search_entity(
|
|
|
354
343
|
Entity description.
|
|
355
344
|
labels : list[str]
|
|
356
345
|
Entity labels.
|
|
357
|
-
**kwargs : dict
|
|
358
|
-
Parameters to pass to the API call.
|
|
359
346
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
347
|
+
Returns
|
|
348
|
+
-------
|
|
349
|
+
list[ContextEntity]
|
|
350
|
+
List of object instances.
|
|
364
351
|
"""
|
|
365
352
|
return context_processor.search_entity(
|
|
366
353
|
project_name,
|
|
@@ -372,5 +359,4 @@ def search_entity(
|
|
|
372
359
|
updated=updated,
|
|
373
360
|
description=description,
|
|
374
361
|
labels=labels,
|
|
375
|
-
**kwargs,
|
|
376
362
|
)
|
|
@@ -312,7 +312,7 @@ class Run(UnversionedEntity):
|
|
|
312
312
|
bool
|
|
313
313
|
True if run is in runnable state, False otherwise.
|
|
314
314
|
"""
|
|
315
|
-
return
|
|
315
|
+
return self.status.state in (State.BUILT.value, State.STOPPED.value)
|
|
316
316
|
|
|
317
317
|
def _set_status(self, status: dict) -> None:
|
|
318
318
|
"""
|
digitalhub/entities/run/crud.py
CHANGED
|
@@ -7,9 +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._commons.utils import is_valid_key
|
|
11
10
|
from digitalhub.entities._processors.processors import context_processor
|
|
12
|
-
from digitalhub.utils.exceptions import EntityError
|
|
13
11
|
|
|
14
12
|
if typing.TYPE_CHECKING:
|
|
15
13
|
from digitalhub.entities.run._base.entity import Run
|
|
@@ -72,7 +70,6 @@ def new_run(
|
|
|
72
70
|
def get_run(
|
|
73
71
|
identifier: str,
|
|
74
72
|
project: str | None = None,
|
|
75
|
-
**kwargs,
|
|
76
73
|
) -> Run:
|
|
77
74
|
"""
|
|
78
75
|
Get object from backend.
|
|
@@ -83,8 +80,6 @@ def get_run(
|
|
|
83
80
|
Entity key (store://...) or entity ID.
|
|
84
81
|
project : str
|
|
85
82
|
Project name.
|
|
86
|
-
**kwargs : dict
|
|
87
|
-
Parameters to pass to the API call.
|
|
88
83
|
|
|
89
84
|
Returns
|
|
90
85
|
-------
|
|
@@ -101,14 +96,26 @@ def get_run(
|
|
|
101
96
|
>>> project="my-project")
|
|
102
97
|
"""
|
|
103
98
|
return context_processor.read_unversioned_entity(
|
|
104
|
-
identifier,
|
|
99
|
+
identifier=identifier,
|
|
105
100
|
entity_type=ENTITY_TYPE,
|
|
106
101
|
project=project,
|
|
107
|
-
**kwargs,
|
|
108
102
|
)
|
|
109
103
|
|
|
110
104
|
|
|
111
|
-
def list_runs(
|
|
105
|
+
def list_runs(
|
|
106
|
+
project: str,
|
|
107
|
+
q: str | None = None,
|
|
108
|
+
name: str | None = None,
|
|
109
|
+
kind: str | None = None,
|
|
110
|
+
user: str | None = None,
|
|
111
|
+
state: str | None = None,
|
|
112
|
+
created: str | None = None,
|
|
113
|
+
updated: str | None = None,
|
|
114
|
+
function: str | None = None,
|
|
115
|
+
workflow: str | None = None,
|
|
116
|
+
task: str | None = None,
|
|
117
|
+
action: str | None = None,
|
|
118
|
+
) -> list[Run]:
|
|
112
119
|
"""
|
|
113
120
|
List all latest version objects from backend.
|
|
114
121
|
|
|
@@ -116,23 +123,52 @@ def list_runs(project: str, **kwargs) -> list[Run]:
|
|
|
116
123
|
----------
|
|
117
124
|
project : str
|
|
118
125
|
Project name.
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
q : str
|
|
127
|
+
Query string to filter objects.
|
|
128
|
+
name : str
|
|
129
|
+
Object name.
|
|
130
|
+
kind : str
|
|
131
|
+
Kind of the object.
|
|
132
|
+
user : str
|
|
133
|
+
User that created the object.
|
|
134
|
+
state : str
|
|
135
|
+
Object state.
|
|
136
|
+
created : str
|
|
137
|
+
Creation date filter.
|
|
138
|
+
updated : str
|
|
139
|
+
Update date filter.
|
|
140
|
+
function : str
|
|
141
|
+
Function key filter.
|
|
142
|
+
workflow : str
|
|
143
|
+
Workflow key filter.
|
|
144
|
+
task : str
|
|
145
|
+
Task string filter.
|
|
146
|
+
action : str
|
|
147
|
+
Action name filter.
|
|
121
148
|
|
|
122
149
|
Returns
|
|
123
150
|
-------
|
|
124
|
-
list[
|
|
151
|
+
list[Model]
|
|
125
152
|
List of object instances.
|
|
126
153
|
|
|
127
154
|
Examples
|
|
128
155
|
--------
|
|
129
156
|
>>> objs = list_runs(project="my-project")
|
|
130
157
|
"""
|
|
131
|
-
# TODO more examples: search by function, latest for task and function
|
|
132
158
|
return context_processor.list_context_entities(
|
|
133
159
|
project=project,
|
|
134
160
|
entity_type=ENTITY_TYPE,
|
|
135
|
-
|
|
161
|
+
q=q,
|
|
162
|
+
name=name,
|
|
163
|
+
kind=kind,
|
|
164
|
+
user=user,
|
|
165
|
+
state=state,
|
|
166
|
+
created=created,
|
|
167
|
+
updated=updated,
|
|
168
|
+
function=function,
|
|
169
|
+
workflow=workflow,
|
|
170
|
+
task=task,
|
|
171
|
+
action=action,
|
|
136
172
|
)
|
|
137
173
|
|
|
138
174
|
|
|
@@ -223,7 +259,7 @@ def update_run(entity: Run) -> Run:
|
|
|
223
259
|
def delete_run(
|
|
224
260
|
identifier: str,
|
|
225
261
|
project: str | None = None,
|
|
226
|
-
|
|
262
|
+
entity_id: str | None = None,
|
|
227
263
|
) -> dict:
|
|
228
264
|
"""
|
|
229
265
|
Delete object from backend.
|
|
@@ -231,11 +267,11 @@ def delete_run(
|
|
|
231
267
|
Parameters
|
|
232
268
|
----------
|
|
233
269
|
identifier : str
|
|
234
|
-
Entity key (store://...) or entity
|
|
270
|
+
Entity key (store://...) or entity name.
|
|
235
271
|
project : str
|
|
236
272
|
Project name.
|
|
237
|
-
|
|
238
|
-
|
|
273
|
+
entity_id : str
|
|
274
|
+
Entity ID.
|
|
239
275
|
|
|
240
276
|
Returns
|
|
241
277
|
-------
|
|
@@ -250,12 +286,9 @@ def delete_run(
|
|
|
250
286
|
... project="my-project",
|
|
251
287
|
... )
|
|
252
288
|
"""
|
|
253
|
-
if not is_valid_key(identifier) and project is None:
|
|
254
|
-
raise EntityError("Specify entity key or entity ID combined with project")
|
|
255
289
|
return context_processor.delete_context_entity(
|
|
256
290
|
identifier=identifier,
|
|
257
291
|
entity_type=ENTITY_TYPE,
|
|
258
292
|
project=project,
|
|
259
|
-
entity_id=
|
|
260
|
-
**kwargs,
|
|
293
|
+
entity_id=entity_id,
|
|
261
294
|
)
|
|
@@ -81,7 +81,6 @@ def get_secret(
|
|
|
81
81
|
identifier: str,
|
|
82
82
|
project: str | None = None,
|
|
83
83
|
entity_id: str | None = None,
|
|
84
|
-
**kwargs,
|
|
85
84
|
) -> Secret:
|
|
86
85
|
"""
|
|
87
86
|
Get object from backend.
|
|
@@ -94,8 +93,6 @@ def get_secret(
|
|
|
94
93
|
Project name.
|
|
95
94
|
entity_id : str
|
|
96
95
|
Entity ID.
|
|
97
|
-
**kwargs : dict
|
|
98
|
-
Parameters to pass to the API call.
|
|
99
96
|
|
|
100
97
|
Returns
|
|
101
98
|
-------
|
|
@@ -115,25 +112,23 @@ def get_secret(
|
|
|
115
112
|
if not is_valid_key(identifier):
|
|
116
113
|
if project is None:
|
|
117
114
|
raise ValueError("Project must be provided.")
|
|
118
|
-
secrets = list_secrets(project=project
|
|
115
|
+
secrets = list_secrets(project=project)
|
|
119
116
|
for secret in secrets:
|
|
120
117
|
if secret.name == identifier:
|
|
121
118
|
return secret
|
|
122
119
|
else:
|
|
123
120
|
raise EntityNotExistsError(f"Secret {identifier} not found.")
|
|
124
121
|
return context_processor.read_context_entity(
|
|
125
|
-
identifier,
|
|
122
|
+
identifier=identifier,
|
|
126
123
|
entity_type=ENTITY_TYPE,
|
|
127
124
|
project=project,
|
|
128
125
|
entity_id=entity_id,
|
|
129
|
-
**kwargs,
|
|
130
126
|
)
|
|
131
127
|
|
|
132
128
|
|
|
133
129
|
def get_secret_versions(
|
|
134
130
|
identifier: str,
|
|
135
131
|
project: str | None = None,
|
|
136
|
-
**kwargs,
|
|
137
132
|
) -> list[Secret]:
|
|
138
133
|
"""
|
|
139
134
|
Get object versions from backend.
|
|
@@ -144,8 +139,6 @@ def get_secret_versions(
|
|
|
144
139
|
Entity key (store://...) or entity name.
|
|
145
140
|
project : str
|
|
146
141
|
Project name.
|
|
147
|
-
**kwargs : dict
|
|
148
|
-
Parameters to pass to the API call.
|
|
149
142
|
|
|
150
143
|
Returns
|
|
151
144
|
-------
|
|
@@ -162,14 +155,13 @@ def get_secret_versions(
|
|
|
162
155
|
>>> project="my-project")
|
|
163
156
|
"""
|
|
164
157
|
return context_processor.read_context_entity_versions(
|
|
165
|
-
identifier,
|
|
158
|
+
identifier=identifier,
|
|
166
159
|
entity_type=ENTITY_TYPE,
|
|
167
160
|
project=project,
|
|
168
|
-
**kwargs,
|
|
169
161
|
)
|
|
170
162
|
|
|
171
163
|
|
|
172
|
-
def list_secrets(project: str
|
|
164
|
+
def list_secrets(project: str) -> list[Secret]:
|
|
173
165
|
"""
|
|
174
166
|
List all latest version objects from backend.
|
|
175
167
|
|
|
@@ -177,8 +169,6 @@ def list_secrets(project: str, **kwargs) -> list[Secret]:
|
|
|
177
169
|
----------
|
|
178
170
|
project : str
|
|
179
171
|
Project name.
|
|
180
|
-
**kwargs : dict
|
|
181
|
-
Parameters to pass to the API call.
|
|
182
172
|
|
|
183
173
|
Returns
|
|
184
174
|
-------
|
|
@@ -192,7 +182,6 @@ def list_secrets(project: str, **kwargs) -> list[Secret]:
|
|
|
192
182
|
return context_processor.list_context_entities(
|
|
193
183
|
project=project,
|
|
194
184
|
entity_type=ENTITY_TYPE,
|
|
195
|
-
**kwargs,
|
|
196
185
|
)
|
|
197
186
|
|
|
198
187
|
|
|
@@ -285,7 +274,6 @@ def delete_secret(
|
|
|
285
274
|
project: str | None = None,
|
|
286
275
|
entity_id: str | None = None,
|
|
287
276
|
delete_all_versions: bool = False,
|
|
288
|
-
**kwargs,
|
|
289
277
|
) -> dict:
|
|
290
278
|
"""
|
|
291
279
|
Delete object from backend.
|
|
@@ -299,9 +287,8 @@ def delete_secret(
|
|
|
299
287
|
entity_id : str
|
|
300
288
|
Entity ID.
|
|
301
289
|
delete_all_versions : bool
|
|
302
|
-
Delete all versions of the named entity.
|
|
303
|
-
|
|
304
|
-
Parameters to pass to the API call.
|
|
290
|
+
Delete all versions of the named entity.
|
|
291
|
+
If True, use entity name instead of entity key as identifier.
|
|
305
292
|
|
|
306
293
|
Returns
|
|
307
294
|
-------
|
|
@@ -324,5 +311,4 @@ def delete_secret(
|
|
|
324
311
|
project=project,
|
|
325
312
|
entity_id=entity_id,
|
|
326
313
|
delete_all_versions=delete_all_versions,
|
|
327
|
-
**kwargs,
|
|
328
314
|
)
|
digitalhub/entities/task/crud.py
CHANGED
|
@@ -7,9 +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._commons.utils import is_valid_key
|
|
11
10
|
from digitalhub.entities._processors.processors import context_processor
|
|
12
|
-
from digitalhub.utils.exceptions import EntityError
|
|
13
11
|
|
|
14
12
|
if typing.TYPE_CHECKING:
|
|
15
13
|
from digitalhub.entities.task._base.entity import Task
|
|
@@ -72,7 +70,6 @@ def new_task(
|
|
|
72
70
|
def get_task(
|
|
73
71
|
identifier: str,
|
|
74
72
|
project: str | None = None,
|
|
75
|
-
**kwargs,
|
|
76
73
|
) -> Task:
|
|
77
74
|
"""
|
|
78
75
|
Get object from backend.
|
|
@@ -83,8 +80,6 @@ def get_task(
|
|
|
83
80
|
Entity key (store://...) or entity ID.
|
|
84
81
|
project : str
|
|
85
82
|
Project name.
|
|
86
|
-
**kwargs : dict
|
|
87
|
-
Parameters to pass to the API call.
|
|
88
83
|
|
|
89
84
|
Returns
|
|
90
85
|
-------
|
|
@@ -101,14 +96,24 @@ def get_task(
|
|
|
101
96
|
>>> project="my-project")
|
|
102
97
|
"""
|
|
103
98
|
return context_processor.read_unversioned_entity(
|
|
104
|
-
identifier,
|
|
99
|
+
identifier=identifier,
|
|
105
100
|
entity_type=ENTITY_TYPE,
|
|
106
101
|
project=project,
|
|
107
|
-
**kwargs,
|
|
108
102
|
)
|
|
109
103
|
|
|
110
104
|
|
|
111
|
-
def list_tasks(
|
|
105
|
+
def list_tasks(
|
|
106
|
+
project: str,
|
|
107
|
+
q: str | None = None,
|
|
108
|
+
name: str | None = None,
|
|
109
|
+
kind: str | None = None,
|
|
110
|
+
user: str | None = None,
|
|
111
|
+
state: str | None = None,
|
|
112
|
+
created: str | None = None,
|
|
113
|
+
updated: str | None = None,
|
|
114
|
+
function: str | None = None,
|
|
115
|
+
workflow: str | None = None,
|
|
116
|
+
) -> list[Task]:
|
|
112
117
|
"""
|
|
113
118
|
List all latest version objects from backend.
|
|
114
119
|
|
|
@@ -116,8 +121,24 @@ def list_tasks(project: str, **kwargs) -> list[Task]:
|
|
|
116
121
|
----------
|
|
117
122
|
project : str
|
|
118
123
|
Project name.
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
q : str
|
|
125
|
+
Query string to filter objects.
|
|
126
|
+
name : str
|
|
127
|
+
Object name.
|
|
128
|
+
kind : str
|
|
129
|
+
Kind of the object.
|
|
130
|
+
user : str
|
|
131
|
+
User that created the object.
|
|
132
|
+
state : str
|
|
133
|
+
Object state.
|
|
134
|
+
created : str
|
|
135
|
+
Creation date filter.
|
|
136
|
+
updated : str
|
|
137
|
+
Update date filter.
|
|
138
|
+
function : str
|
|
139
|
+
Function key filter.
|
|
140
|
+
workflow : str
|
|
141
|
+
Workflow key filter.
|
|
121
142
|
|
|
122
143
|
Returns
|
|
123
144
|
-------
|
|
@@ -131,7 +152,15 @@ def list_tasks(project: str, **kwargs) -> list[Task]:
|
|
|
131
152
|
return context_processor.list_context_entities(
|
|
132
153
|
project=project,
|
|
133
154
|
entity_type=ENTITY_TYPE,
|
|
134
|
-
|
|
155
|
+
q=q,
|
|
156
|
+
name=name,
|
|
157
|
+
kind=kind,
|
|
158
|
+
user=user,
|
|
159
|
+
state=state,
|
|
160
|
+
created=created,
|
|
161
|
+
updated=updated,
|
|
162
|
+
function=function,
|
|
163
|
+
workflow=workflow,
|
|
135
164
|
)
|
|
136
165
|
|
|
137
166
|
|
|
@@ -223,9 +252,7 @@ def delete_task(
|
|
|
223
252
|
identifier: str,
|
|
224
253
|
project: str | None = None,
|
|
225
254
|
entity_id: str | None = None,
|
|
226
|
-
delete_all_versions: bool = False,
|
|
227
255
|
cascade: bool = True,
|
|
228
|
-
**kwargs,
|
|
229
256
|
) -> dict:
|
|
230
257
|
"""
|
|
231
258
|
Delete object from backend.
|
|
@@ -238,8 +265,6 @@ def delete_task(
|
|
|
238
265
|
Project name.
|
|
239
266
|
entity_id : str
|
|
240
267
|
Entity ID.
|
|
241
|
-
delete_all_versions : bool
|
|
242
|
-
Delete all versions of the named entity. If True, use entity name instead of entity key as identifier.
|
|
243
268
|
cascade : bool
|
|
244
269
|
Cascade delete.
|
|
245
270
|
**kwargs : dict
|
|
@@ -252,22 +277,12 @@ def delete_task(
|
|
|
252
277
|
|
|
253
278
|
Examples
|
|
254
279
|
--------
|
|
255
|
-
If delete_all_versions is False:
|
|
256
280
|
>>> obj = delete_task("store://my-task-key")
|
|
257
|
-
|
|
258
|
-
Otherwise:
|
|
259
|
-
>>> obj = delete_task("task-name",
|
|
260
|
-
>>> project="my-project",
|
|
261
|
-
>>> delete_all_versions=True)
|
|
262
281
|
"""
|
|
263
|
-
if not is_valid_key(identifier):
|
|
264
|
-
raise EntityError("Task has no name. Use key instead.")
|
|
265
282
|
return context_processor.delete_context_entity(
|
|
266
283
|
identifier=identifier,
|
|
267
284
|
entity_type=ENTITY_TYPE,
|
|
268
285
|
project=project,
|
|
269
286
|
entity_id=entity_id,
|
|
270
|
-
delete_all_versions=delete_all_versions,
|
|
271
287
|
cascade=cascade,
|
|
272
|
-
**kwargs,
|
|
273
288
|
)
|
|
@@ -91,7 +91,6 @@ def get_trigger(
|
|
|
91
91
|
identifier: str,
|
|
92
92
|
project: str | None = None,
|
|
93
93
|
entity_id: str | None = None,
|
|
94
|
-
**kwargs,
|
|
95
94
|
) -> Trigger:
|
|
96
95
|
"""
|
|
97
96
|
Get object from backend.
|
|
@@ -104,8 +103,6 @@ def get_trigger(
|
|
|
104
103
|
Project name.
|
|
105
104
|
entity_id : str
|
|
106
105
|
Entity ID.
|
|
107
|
-
**kwargs : dict
|
|
108
|
-
Parameters to pass to the API call.
|
|
109
106
|
|
|
110
107
|
Returns
|
|
111
108
|
-------
|
|
@@ -123,18 +120,16 @@ def get_trigger(
|
|
|
123
120
|
>>> entity_id="my-trigger-id")
|
|
124
121
|
"""
|
|
125
122
|
return context_processor.read_context_entity(
|
|
126
|
-
identifier,
|
|
123
|
+
identifier=identifier,
|
|
127
124
|
entity_type=ENTITY_TYPE,
|
|
128
125
|
project=project,
|
|
129
126
|
entity_id=entity_id,
|
|
130
|
-
**kwargs,
|
|
131
127
|
)
|
|
132
128
|
|
|
133
129
|
|
|
134
130
|
def get_trigger_versions(
|
|
135
131
|
identifier: str,
|
|
136
132
|
project: str | None = None,
|
|
137
|
-
**kwargs,
|
|
138
133
|
) -> list[Trigger]:
|
|
139
134
|
"""
|
|
140
135
|
Get object versions from backend.
|
|
@@ -145,8 +140,6 @@ def get_trigger_versions(
|
|
|
145
140
|
Entity key (store://...) or entity name.
|
|
146
141
|
project : str
|
|
147
142
|
Project name.
|
|
148
|
-
**kwargs : dict
|
|
149
|
-
Parameters to pass to the API call.
|
|
150
143
|
|
|
151
144
|
Returns
|
|
152
145
|
-------
|
|
@@ -163,14 +156,24 @@ def get_trigger_versions(
|
|
|
163
156
|
>>> project="my-project")
|
|
164
157
|
"""
|
|
165
158
|
return context_processor.read_context_entity_versions(
|
|
166
|
-
identifier,
|
|
159
|
+
identifier=identifier,
|
|
167
160
|
entity_type=ENTITY_TYPE,
|
|
168
161
|
project=project,
|
|
169
|
-
**kwargs,
|
|
170
162
|
)
|
|
171
163
|
|
|
172
164
|
|
|
173
|
-
def list_triggers(
|
|
165
|
+
def list_triggers(
|
|
166
|
+
project: str,
|
|
167
|
+
q: str | None = None,
|
|
168
|
+
name: str | None = None,
|
|
169
|
+
kind: str | None = None,
|
|
170
|
+
user: str | None = None,
|
|
171
|
+
state: str | None = None,
|
|
172
|
+
created: str | None = None,
|
|
173
|
+
updated: str | None = None,
|
|
174
|
+
version: str | None = None,
|
|
175
|
+
task: str | None = None,
|
|
176
|
+
) -> list[Trigger]:
|
|
174
177
|
"""
|
|
175
178
|
List all latest version objects from backend.
|
|
176
179
|
|
|
@@ -178,8 +181,24 @@ def list_triggers(project: str, **kwargs) -> list[Trigger]:
|
|
|
178
181
|
----------
|
|
179
182
|
project : str
|
|
180
183
|
Project name.
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
q : str
|
|
185
|
+
Query string to filter objects.
|
|
186
|
+
name : str
|
|
187
|
+
Object name.
|
|
188
|
+
kind : str
|
|
189
|
+
Kind of the object.
|
|
190
|
+
user : str
|
|
191
|
+
User that created the object.
|
|
192
|
+
state : str
|
|
193
|
+
Object state.
|
|
194
|
+
created : str
|
|
195
|
+
Creation date filter.
|
|
196
|
+
updated : str
|
|
197
|
+
Update date filter.
|
|
198
|
+
version : str
|
|
199
|
+
Object version, default is latest.
|
|
200
|
+
task : str
|
|
201
|
+
Task string filter.
|
|
183
202
|
|
|
184
203
|
Returns
|
|
185
204
|
-------
|
|
@@ -193,7 +212,15 @@ def list_triggers(project: str, **kwargs) -> list[Trigger]:
|
|
|
193
212
|
return context_processor.list_context_entities(
|
|
194
213
|
project=project,
|
|
195
214
|
entity_type=ENTITY_TYPE,
|
|
196
|
-
|
|
215
|
+
q=q,
|
|
216
|
+
name=name,
|
|
217
|
+
kind=kind,
|
|
218
|
+
user=user,
|
|
219
|
+
state=state,
|
|
220
|
+
created=created,
|
|
221
|
+
updated=updated,
|
|
222
|
+
version=version,
|
|
223
|
+
task=task,
|
|
197
224
|
)
|
|
198
225
|
|
|
199
226
|
|
|
@@ -286,7 +313,6 @@ def delete_trigger(
|
|
|
286
313
|
project: str | None = None,
|
|
287
314
|
entity_id: str | None = None,
|
|
288
315
|
delete_all_versions: bool = False,
|
|
289
|
-
**kwargs,
|
|
290
316
|
) -> dict:
|
|
291
317
|
"""
|
|
292
318
|
Delete object from backend.
|
|
@@ -300,9 +326,8 @@ def delete_trigger(
|
|
|
300
326
|
entity_id : str
|
|
301
327
|
Entity ID.
|
|
302
328
|
delete_all_versions : bool
|
|
303
|
-
Delete all versions of the named entity.
|
|
304
|
-
|
|
305
|
-
Parameters to pass to the API call.
|
|
329
|
+
Delete all versions of the named entity.
|
|
330
|
+
If True, use entity name instead of entity key as identifier.
|
|
306
331
|
|
|
307
332
|
Returns
|
|
308
333
|
-------
|
|
@@ -325,5 +350,4 @@ def delete_trigger(
|
|
|
325
350
|
project=project,
|
|
326
351
|
entity_id=entity_id,
|
|
327
352
|
delete_all_versions=delete_all_versions,
|
|
328
|
-
**kwargs,
|
|
329
353
|
)
|