digitalhub 0.11.0b7__py3-none-any.whl → 0.13.0__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.
Potentially problematic release.
This version of digitalhub might be problematic. Click here for more details.
- digitalhub/__init__.py +4 -1
- digitalhub/context/api.py +9 -5
- digitalhub/context/builder.py +7 -5
- digitalhub/context/context.py +13 -1
- digitalhub/entities/__init__.py +3 -0
- digitalhub/entities/_base/__init__.py +3 -0
- digitalhub/entities/_base/_base/__init__.py +3 -0
- digitalhub/entities/_base/_base/entity.py +4 -0
- digitalhub/entities/_base/context/__init__.py +3 -0
- digitalhub/entities/_base/context/entity.py +4 -0
- digitalhub/entities/_base/entity/__init__.py +3 -0
- digitalhub/entities/_base/entity/_constructors/__init__.py +3 -0
- digitalhub/entities/_base/entity/_constructors/metadata.py +4 -0
- digitalhub/entities/_base/entity/_constructors/name.py +4 -0
- digitalhub/entities/_base/entity/_constructors/spec.py +4 -0
- digitalhub/entities/_base/entity/_constructors/status.py +4 -0
- digitalhub/entities/_base/entity/_constructors/uuid.py +4 -0
- digitalhub/entities/_base/entity/builder.py +4 -0
- digitalhub/entities/_base/entity/entity.py +4 -0
- digitalhub/entities/_base/entity/metadata.py +4 -0
- digitalhub/entities/_base/entity/spec.py +4 -0
- digitalhub/entities/_base/entity/status.py +4 -0
- digitalhub/entities/_base/executable/__init__.py +3 -0
- digitalhub/entities/_base/executable/entity.py +109 -57
- digitalhub/entities/_base/material/__init__.py +3 -0
- digitalhub/entities/_base/material/entity.py +15 -18
- digitalhub/entities/_base/material/spec.py +4 -0
- digitalhub/entities/_base/material/status.py +4 -0
- digitalhub/entities/_base/material/utils.py +5 -1
- digitalhub/entities/_base/runtime_entity/__init__.py +3 -0
- digitalhub/entities/_base/runtime_entity/builder.py +4 -0
- digitalhub/entities/_base/unversioned/__init__.py +3 -0
- digitalhub/entities/_base/unversioned/builder.py +4 -0
- digitalhub/entities/_base/unversioned/entity.py +4 -0
- digitalhub/entities/_base/versioned/__init__.py +3 -0
- digitalhub/entities/_base/versioned/builder.py +4 -0
- digitalhub/entities/_base/versioned/entity.py +4 -0
- digitalhub/entities/_commons/__init__.py +3 -0
- digitalhub/entities/_commons/enums.py +4 -0
- digitalhub/entities/_commons/metrics.py +68 -30
- digitalhub/entities/_commons/utils.py +40 -9
- digitalhub/entities/_processors/__init__.py +3 -0
- digitalhub/entities/_processors/base.py +154 -79
- digitalhub/entities/_processors/context.py +370 -215
- digitalhub/entities/_processors/utils.py +78 -30
- digitalhub/entities/artifact/__init__.py +3 -0
- digitalhub/entities/artifact/_base/__init__.py +3 -0
- digitalhub/entities/artifact/_base/builder.py +4 -0
- digitalhub/entities/artifact/_base/entity.py +4 -0
- digitalhub/entities/artifact/_base/spec.py +4 -0
- digitalhub/entities/artifact/_base/status.py +4 -0
- digitalhub/entities/artifact/artifact/__init__.py +3 -0
- digitalhub/entities/artifact/artifact/builder.py +4 -0
- digitalhub/entities/artifact/artifact/entity.py +4 -0
- digitalhub/entities/artifact/artifact/spec.py +4 -0
- digitalhub/entities/artifact/artifact/status.py +4 -0
- digitalhub/entities/artifact/crud.py +8 -0
- digitalhub/entities/artifact/utils.py +32 -13
- digitalhub/entities/builders.py +4 -0
- digitalhub/entities/dataitem/__init__.py +3 -0
- digitalhub/entities/dataitem/_base/__init__.py +3 -0
- digitalhub/entities/dataitem/_base/builder.py +4 -0
- digitalhub/entities/dataitem/_base/entity.py +4 -0
- digitalhub/entities/dataitem/_base/spec.py +4 -0
- digitalhub/entities/dataitem/_base/status.py +4 -0
- digitalhub/entities/dataitem/crud.py +18 -2
- digitalhub/entities/dataitem/dataitem/__init__.py +3 -0
- digitalhub/entities/dataitem/dataitem/builder.py +4 -0
- digitalhub/entities/dataitem/dataitem/entity.py +4 -0
- digitalhub/entities/dataitem/dataitem/spec.py +4 -0
- digitalhub/entities/dataitem/dataitem/status.py +4 -0
- digitalhub/entities/dataitem/iceberg/__init__.py +3 -0
- digitalhub/entities/dataitem/iceberg/builder.py +4 -0
- digitalhub/entities/dataitem/iceberg/entity.py +4 -0
- digitalhub/entities/dataitem/iceberg/spec.py +4 -0
- digitalhub/entities/dataitem/iceberg/status.py +4 -0
- digitalhub/entities/dataitem/table/__init__.py +3 -0
- digitalhub/entities/dataitem/table/builder.py +4 -0
- digitalhub/entities/dataitem/table/entity.py +7 -3
- digitalhub/entities/dataitem/table/models.py +4 -0
- digitalhub/entities/dataitem/table/spec.py +4 -0
- digitalhub/entities/dataitem/table/status.py +4 -0
- digitalhub/entities/dataitem/table/utils.py +4 -0
- digitalhub/entities/dataitem/utils.py +88 -35
- digitalhub/entities/function/__init__.py +3 -0
- digitalhub/entities/function/_base/__init__.py +3 -0
- digitalhub/entities/function/_base/builder.py +4 -0
- digitalhub/entities/function/_base/entity.py +4 -0
- digitalhub/entities/function/_base/spec.py +4 -0
- digitalhub/entities/function/_base/status.py +4 -0
- digitalhub/entities/function/crud.py +4 -0
- digitalhub/entities/model/__init__.py +3 -0
- digitalhub/entities/model/_base/__init__.py +3 -0
- digitalhub/entities/model/_base/builder.py +4 -0
- digitalhub/entities/model/_base/entity.py +4 -0
- digitalhub/entities/model/_base/spec.py +4 -0
- digitalhub/entities/model/_base/status.py +4 -0
- digitalhub/entities/model/crud.py +8 -0
- digitalhub/entities/model/huggingface/__init__.py +3 -0
- digitalhub/entities/model/huggingface/builder.py +4 -0
- digitalhub/entities/model/huggingface/entity.py +4 -0
- digitalhub/entities/model/huggingface/spec.py +4 -0
- digitalhub/entities/model/huggingface/status.py +4 -0
- digitalhub/entities/model/mlflow/__init__.py +3 -0
- digitalhub/entities/model/mlflow/builder.py +4 -0
- digitalhub/entities/model/mlflow/entity.py +4 -0
- digitalhub/entities/model/mlflow/models.py +4 -0
- digitalhub/entities/model/mlflow/spec.py +4 -0
- digitalhub/entities/model/mlflow/status.py +4 -0
- digitalhub/entities/model/mlflow/utils.py +4 -0
- digitalhub/entities/model/model/__init__.py +3 -0
- digitalhub/entities/model/model/builder.py +4 -0
- digitalhub/entities/model/model/entity.py +4 -0
- digitalhub/entities/model/model/spec.py +4 -0
- digitalhub/entities/model/model/status.py +4 -0
- digitalhub/entities/model/sklearn/__init__.py +3 -0
- digitalhub/entities/model/sklearn/builder.py +4 -0
- digitalhub/entities/model/sklearn/entity.py +4 -0
- digitalhub/entities/model/sklearn/spec.py +4 -0
- digitalhub/entities/model/sklearn/status.py +4 -0
- digitalhub/entities/model/utils.py +32 -13
- digitalhub/entities/project/__init__.py +3 -0
- digitalhub/entities/project/_base/__init__.py +3 -0
- digitalhub/entities/project/_base/builder.py +4 -0
- digitalhub/entities/project/_base/entity.py +4 -2
- digitalhub/entities/project/_base/models.py +4 -0
- digitalhub/entities/project/_base/spec.py +4 -0
- digitalhub/entities/project/_base/status.py +4 -0
- digitalhub/entities/project/crud.py +4 -0
- digitalhub/entities/project/utils.py +4 -0
- digitalhub/entities/run/__init__.py +3 -0
- digitalhub/entities/run/_base/__init__.py +3 -0
- digitalhub/entities/run/_base/builder.py +4 -0
- digitalhub/entities/run/_base/entity.py +6 -2
- digitalhub/entities/run/_base/spec.py +4 -0
- digitalhub/entities/run/_base/status.py +4 -0
- digitalhub/entities/run/crud.py +4 -0
- digitalhub/entities/secret/__init__.py +3 -0
- digitalhub/entities/secret/_base/__init__.py +3 -0
- digitalhub/entities/secret/_base/builder.py +4 -0
- digitalhub/entities/secret/_base/entity.py +4 -0
- digitalhub/entities/secret/_base/spec.py +4 -0
- digitalhub/entities/secret/_base/status.py +4 -0
- digitalhub/entities/secret/crud.py +4 -0
- digitalhub/entities/task/__init__.py +3 -0
- digitalhub/entities/task/_base/__init__.py +3 -0
- digitalhub/entities/task/_base/builder.py +4 -0
- digitalhub/entities/task/_base/entity.py +4 -0
- digitalhub/entities/task/_base/models.py +16 -3
- digitalhub/entities/task/_base/spec.py +4 -0
- digitalhub/entities/task/_base/status.py +4 -0
- digitalhub/entities/task/_base/utils.py +4 -0
- digitalhub/entities/task/crud.py +4 -0
- digitalhub/entities/trigger/__init__.py +3 -0
- digitalhub/entities/trigger/_base/__init__.py +3 -0
- digitalhub/entities/trigger/_base/builder.py +4 -0
- digitalhub/entities/trigger/_base/entity.py +15 -0
- digitalhub/entities/trigger/_base/spec.py +4 -0
- digitalhub/entities/trigger/_base/status.py +4 -0
- digitalhub/entities/trigger/crud.py +4 -0
- digitalhub/entities/trigger/lifecycle/__init__.py +3 -0
- digitalhub/entities/trigger/lifecycle/builder.py +4 -0
- digitalhub/entities/trigger/lifecycle/entity.py +4 -0
- digitalhub/entities/trigger/lifecycle/spec.py +4 -0
- digitalhub/entities/trigger/lifecycle/status.py +4 -0
- digitalhub/entities/trigger/scheduler/__init__.py +3 -0
- digitalhub/entities/trigger/scheduler/builder.py +4 -0
- digitalhub/entities/trigger/scheduler/entity.py +4 -0
- digitalhub/entities/trigger/scheduler/spec.py +4 -0
- digitalhub/entities/trigger/scheduler/status.py +4 -0
- digitalhub/entities/workflow/__init__.py +3 -0
- digitalhub/entities/workflow/_base/__init__.py +3 -0
- digitalhub/entities/workflow/_base/builder.py +4 -0
- digitalhub/entities/workflow/_base/entity.py +4 -0
- digitalhub/entities/workflow/_base/spec.py +4 -0
- digitalhub/entities/workflow/_base/status.py +4 -0
- digitalhub/entities/workflow/crud.py +4 -0
- digitalhub/factory/__init__.py +3 -0
- digitalhub/factory/factory.py +29 -3
- digitalhub/factory/utils.py +15 -3
- digitalhub/runtimes/__init__.py +3 -0
- digitalhub/runtimes/_base.py +5 -1
- digitalhub/runtimes/builder.py +22 -1
- digitalhub/runtimes/enums.py +4 -0
- digitalhub/stores/__init__.py +3 -0
- digitalhub/stores/client/__init__.py +15 -0
- digitalhub/stores/client/_base/__init__.py +3 -0
- digitalhub/stores/client/_base/api_builder.py +18 -0
- digitalhub/stores/client/_base/client.py +97 -0
- digitalhub/stores/client/_base/key_builder.py +32 -0
- digitalhub/stores/client/_base/params_builder.py +18 -0
- digitalhub/stores/client/api.py +14 -5
- digitalhub/stores/client/builder.py +7 -1
- digitalhub/stores/client/dhcore/__init__.py +3 -0
- digitalhub/stores/client/dhcore/api_builder.py +21 -0
- digitalhub/stores/client/dhcore/client.py +329 -70
- digitalhub/stores/client/dhcore/configurator.py +489 -193
- digitalhub/stores/client/dhcore/enums.py +7 -0
- digitalhub/stores/client/dhcore/error_parser.py +39 -1
- digitalhub/stores/client/dhcore/key_builder.py +4 -0
- digitalhub/stores/client/dhcore/models.py +4 -0
- digitalhub/stores/client/dhcore/params_builder.py +117 -17
- digitalhub/stores/client/dhcore/utils.py +44 -22
- digitalhub/stores/client/local/__init__.py +3 -0
- digitalhub/stores/client/local/api_builder.py +21 -0
- digitalhub/stores/client/local/client.py +10 -8
- digitalhub/stores/client/local/enums.py +4 -0
- digitalhub/stores/client/local/key_builder.py +4 -0
- digitalhub/stores/client/local/params_builder.py +4 -0
- digitalhub/stores/credentials/__init__.py +3 -0
- digitalhub/stores/credentials/api.py +35 -0
- digitalhub/stores/credentials/configurator.py +210 -0
- digitalhub/stores/credentials/enums.py +68 -0
- digitalhub/stores/credentials/handler.py +176 -0
- digitalhub/stores/credentials/ini_module.py +164 -0
- digitalhub/stores/credentials/store.py +81 -0
- digitalhub/stores/data/__init__.py +3 -0
- digitalhub/stores/data/_base/__init__.py +3 -0
- digitalhub/stores/data/_base/store.py +31 -9
- digitalhub/stores/data/api.py +53 -9
- digitalhub/stores/data/builder.py +94 -41
- digitalhub/stores/data/enums.py +4 -0
- digitalhub/stores/data/local/__init__.py +3 -0
- digitalhub/stores/data/local/store.py +8 -7
- digitalhub/stores/data/remote/__init__.py +3 -0
- digitalhub/stores/data/remote/store.py +8 -7
- digitalhub/stores/data/s3/__init__.py +3 -0
- digitalhub/stores/data/s3/configurator.py +69 -80
- digitalhub/stores/data/s3/store.py +73 -81
- digitalhub/stores/data/s3/utils.py +14 -10
- digitalhub/stores/data/sql/__init__.py +3 -0
- digitalhub/stores/data/sql/configurator.py +80 -73
- digitalhub/stores/data/sql/store.py +195 -102
- digitalhub/stores/readers/__init__.py +3 -0
- digitalhub/stores/readers/data/__init__.py +3 -0
- digitalhub/stores/readers/data/_base/__init__.py +3 -0
- digitalhub/stores/readers/data/_base/builder.py +4 -0
- digitalhub/stores/readers/data/_base/reader.py +4 -0
- digitalhub/stores/readers/data/api.py +4 -0
- digitalhub/stores/readers/data/factory.py +4 -0
- digitalhub/stores/readers/data/pandas/__init__.py +3 -0
- digitalhub/stores/readers/data/pandas/builder.py +4 -0
- digitalhub/stores/readers/data/pandas/reader.py +4 -0
- digitalhub/stores/readers/query/__init__.py +3 -0
- digitalhub/utils/__init__.py +3 -0
- digitalhub/utils/enums.py +4 -0
- digitalhub/utils/exceptions.py +10 -0
- digitalhub/utils/file_utils.py +57 -30
- digitalhub/utils/generic_utils.py +45 -33
- digitalhub/utils/git_utils.py +28 -14
- digitalhub/utils/io_utils.py +23 -18
- digitalhub/utils/logger.py +4 -0
- digitalhub/utils/types.py +4 -0
- digitalhub/utils/uri_utils.py +35 -31
- digitalhub-0.13.0.dist-info/METADATA +301 -0
- digitalhub-0.13.0.dist-info/RECORD +259 -0
- digitalhub-0.13.0.dist-info/licenses/AUTHORS +5 -0
- digitalhub-0.13.0.dist-info/licenses/LICENSE +201 -0
- digitalhub/entities/_commons/types.py +0 -5
- digitalhub/stores/configurator/__init__.py +0 -0
- digitalhub/stores/configurator/api.py +0 -31
- digitalhub/stores/configurator/configurator.py +0 -198
- digitalhub/stores/configurator/credentials_store.py +0 -65
- digitalhub/stores/configurator/enums.py +0 -21
- digitalhub/stores/configurator/ini_module.py +0 -128
- digitalhub/stores/data/s3/enums.py +0 -16
- digitalhub/stores/data/sql/enums.py +0 -16
- digitalhub/stores/data/utils.py +0 -34
- digitalhub-0.11.0b7.dist-info/METADATA +0 -259
- digitalhub-0.11.0b7.dist-info/RECORD +0 -261
- digitalhub-0.11.0b7.dist-info/licenses/LICENSE.txt +0 -216
- {digitalhub-0.11.0b7.dist-info → digitalhub-0.13.0.dist-info}/WHEEL +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 DSLab - Fondazione Bruno Kessler
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
1
5
|
from __future__ import annotations
|
|
2
6
|
|
|
3
7
|
import typing
|
|
@@ -16,11 +20,12 @@ if typing.TYPE_CHECKING:
|
|
|
16
20
|
|
|
17
21
|
class BaseEntityOperationsProcessor:
|
|
18
22
|
"""
|
|
19
|
-
Processor for
|
|
23
|
+
Processor for base entity operations.
|
|
20
24
|
|
|
21
|
-
This
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
This class handles CRUD operations and other entity management tasks
|
|
26
|
+
for base-level entities (primarily projects). It interacts with the
|
|
27
|
+
client layer to perform backend operations and manages entity lifecycle
|
|
28
|
+
including creation, reading, updating, deletion, and sharing.
|
|
24
29
|
"""
|
|
25
30
|
|
|
26
31
|
##############################
|
|
@@ -35,23 +40,26 @@ class BaseEntityOperationsProcessor:
|
|
|
35
40
|
**kwargs,
|
|
36
41
|
) -> dict:
|
|
37
42
|
"""
|
|
38
|
-
Create
|
|
43
|
+
Create a base entity in the backend.
|
|
44
|
+
|
|
45
|
+
Builds the appropriate API endpoint and sends a create request
|
|
46
|
+
to the backend for base-level entities.
|
|
39
47
|
|
|
40
48
|
Parameters
|
|
41
49
|
----------
|
|
42
50
|
client : Client
|
|
43
|
-
|
|
51
|
+
The client instance to use for the API call.
|
|
44
52
|
entity_type : str
|
|
45
|
-
|
|
53
|
+
The type of entity to create (e.g., 'project').
|
|
46
54
|
entity_dict : dict
|
|
47
|
-
|
|
55
|
+
The entity data dictionary to create.
|
|
48
56
|
**kwargs : dict
|
|
49
|
-
|
|
57
|
+
Additional parameters to pass to the API call.
|
|
50
58
|
|
|
51
59
|
Returns
|
|
52
60
|
-------
|
|
53
61
|
dict
|
|
54
|
-
|
|
62
|
+
The created entity data returned from the backend.
|
|
55
63
|
"""
|
|
56
64
|
api = client.build_api(
|
|
57
65
|
ApiCategories.BASE.value,
|
|
@@ -66,19 +74,25 @@ class BaseEntityOperationsProcessor:
|
|
|
66
74
|
**kwargs,
|
|
67
75
|
) -> Project:
|
|
68
76
|
"""
|
|
69
|
-
Create
|
|
77
|
+
Create a project entity in the backend.
|
|
78
|
+
|
|
79
|
+
Creates a new project either from an existing entity object or
|
|
80
|
+
by building one from the provided parameters. Handles both
|
|
81
|
+
local and remote backend creation.
|
|
70
82
|
|
|
71
83
|
Parameters
|
|
72
84
|
----------
|
|
73
|
-
_entity : Project
|
|
74
|
-
|
|
85
|
+
_entity : Project, optional
|
|
86
|
+
An existing project entity object to create. If None,
|
|
87
|
+
a new entity will be built from kwargs.
|
|
75
88
|
**kwargs : dict
|
|
76
|
-
Parameters
|
|
89
|
+
Parameters for entity creation, including 'local' flag
|
|
90
|
+
and entity-specific parameters.
|
|
77
91
|
|
|
78
92
|
Returns
|
|
79
93
|
-------
|
|
80
94
|
Project
|
|
81
|
-
|
|
95
|
+
The created project entity with backend data populated.
|
|
82
96
|
"""
|
|
83
97
|
if _entity is not None:
|
|
84
98
|
client = _entity._client
|
|
@@ -98,23 +112,26 @@ class BaseEntityOperationsProcessor:
|
|
|
98
112
|
**kwargs,
|
|
99
113
|
) -> dict:
|
|
100
114
|
"""
|
|
101
|
-
Read
|
|
115
|
+
Read a base entity from the backend.
|
|
116
|
+
|
|
117
|
+
Builds the appropriate API endpoint and sends a read request
|
|
118
|
+
to retrieve entity data from the backend.
|
|
102
119
|
|
|
103
120
|
Parameters
|
|
104
121
|
----------
|
|
105
122
|
client : Client
|
|
106
|
-
|
|
123
|
+
The client instance to use for the API call.
|
|
107
124
|
entity_type : str
|
|
108
|
-
|
|
125
|
+
The type of entity to read (e.g., 'project').
|
|
109
126
|
entity_name : str
|
|
110
|
-
|
|
127
|
+
The name identifier of the entity to read.
|
|
111
128
|
**kwargs : dict
|
|
112
|
-
|
|
129
|
+
Additional parameters to pass to the API call.
|
|
113
130
|
|
|
114
131
|
Returns
|
|
115
132
|
-------
|
|
116
133
|
dict
|
|
117
|
-
|
|
134
|
+
The entity data retrieved from the backend.
|
|
118
135
|
"""
|
|
119
136
|
api = client.build_api(
|
|
120
137
|
ApiCategories.BASE.value,
|
|
@@ -131,21 +148,25 @@ class BaseEntityOperationsProcessor:
|
|
|
131
148
|
**kwargs,
|
|
132
149
|
) -> Project:
|
|
133
150
|
"""
|
|
134
|
-
Read
|
|
151
|
+
Read a project entity from the backend.
|
|
152
|
+
|
|
153
|
+
Retrieves project data from the backend and constructs a
|
|
154
|
+
Project entity object with the retrieved data.
|
|
135
155
|
|
|
136
156
|
Parameters
|
|
137
157
|
----------
|
|
138
158
|
entity_type : str
|
|
139
|
-
|
|
159
|
+
The type of entity to read (typically 'project').
|
|
140
160
|
entity_name : str
|
|
141
|
-
|
|
161
|
+
The name identifier of the project to read.
|
|
142
162
|
**kwargs : dict
|
|
143
|
-
|
|
163
|
+
Additional parameters including 'local' flag and
|
|
164
|
+
API call parameters.
|
|
144
165
|
|
|
145
166
|
Returns
|
|
146
167
|
-------
|
|
147
168
|
Project
|
|
148
|
-
|
|
169
|
+
The project entity object populated with backend data.
|
|
149
170
|
"""
|
|
150
171
|
client = get_client(kwargs.pop("local", False))
|
|
151
172
|
obj = self._read_base_entity(client, entity_type, entity_name, **kwargs)
|
|
@@ -158,19 +179,28 @@ class BaseEntityOperationsProcessor:
|
|
|
158
179
|
**kwargs,
|
|
159
180
|
) -> Project:
|
|
160
181
|
"""
|
|
161
|
-
Import
|
|
182
|
+
Import a project entity from a YAML file and create it in the backend.
|
|
183
|
+
|
|
184
|
+
Reads project configuration from a YAML file, creates a new project
|
|
185
|
+
entity in the backend, and imports any related entities defined
|
|
186
|
+
in the file. Raises an error if the project already exists.
|
|
162
187
|
|
|
163
188
|
Parameters
|
|
164
189
|
----------
|
|
165
190
|
file : str
|
|
166
|
-
Path to YAML file.
|
|
191
|
+
Path to the YAML file containing project configuration.
|
|
167
192
|
**kwargs : dict
|
|
168
|
-
Additional
|
|
193
|
+
Additional parameters including 'local' flag.
|
|
169
194
|
|
|
170
195
|
Returns
|
|
171
196
|
-------
|
|
172
197
|
Project
|
|
173
|
-
|
|
198
|
+
The imported and created project entity.
|
|
199
|
+
|
|
200
|
+
Raises
|
|
201
|
+
------
|
|
202
|
+
EntityError
|
|
203
|
+
If the project already exists in the backend.
|
|
174
204
|
"""
|
|
175
205
|
client = get_client(kwargs.pop("local", False))
|
|
176
206
|
obj: dict = read_yaml(file)
|
|
@@ -194,19 +224,23 @@ class BaseEntityOperationsProcessor:
|
|
|
194
224
|
**kwargs,
|
|
195
225
|
) -> Project:
|
|
196
226
|
"""
|
|
197
|
-
Load
|
|
227
|
+
Load a project entity from a YAML file and update it in the backend.
|
|
228
|
+
|
|
229
|
+
Reads project configuration from a YAML file and updates an existing
|
|
230
|
+
project in the backend. If the project doesn't exist, it creates a
|
|
231
|
+
new one. Also loads any related entities defined in the file.
|
|
198
232
|
|
|
199
233
|
Parameters
|
|
200
234
|
----------
|
|
201
235
|
file : str
|
|
202
|
-
Path to YAML file.
|
|
236
|
+
Path to the YAML file containing project configuration.
|
|
203
237
|
**kwargs : dict
|
|
204
|
-
Additional
|
|
238
|
+
Additional parameters including 'local' flag.
|
|
205
239
|
|
|
206
240
|
Returns
|
|
207
241
|
-------
|
|
208
242
|
Project
|
|
209
|
-
|
|
243
|
+
The loaded and updated project entity.
|
|
210
244
|
"""
|
|
211
245
|
client = get_client(kwargs.pop("local", False))
|
|
212
246
|
obj: dict = read_yaml(file)
|
|
@@ -230,21 +264,25 @@ class BaseEntityOperationsProcessor:
|
|
|
230
264
|
**kwargs,
|
|
231
265
|
) -> list[dict]:
|
|
232
266
|
"""
|
|
233
|
-
List
|
|
267
|
+
List base entities from the backend.
|
|
268
|
+
|
|
269
|
+
Builds the appropriate API endpoint and sends a list request
|
|
270
|
+
to retrieve multiple entities from the backend.
|
|
234
271
|
|
|
235
272
|
Parameters
|
|
236
273
|
----------
|
|
237
274
|
client : Client
|
|
238
|
-
|
|
275
|
+
The client instance to use for the API call.
|
|
239
276
|
entity_type : str
|
|
240
|
-
|
|
277
|
+
The type of entities to list (e.g., 'project').
|
|
241
278
|
**kwargs : dict
|
|
242
|
-
|
|
279
|
+
Additional parameters to pass to the API call for filtering
|
|
280
|
+
or pagination.
|
|
243
281
|
|
|
244
282
|
Returns
|
|
245
283
|
-------
|
|
246
284
|
list[dict]
|
|
247
|
-
List of
|
|
285
|
+
List of entity data dictionaries from the backend.
|
|
248
286
|
"""
|
|
249
287
|
api = client.build_api(
|
|
250
288
|
ApiCategories.BASE.value,
|
|
@@ -259,19 +297,23 @@ class BaseEntityOperationsProcessor:
|
|
|
259
297
|
**kwargs,
|
|
260
298
|
) -> list[Project]:
|
|
261
299
|
"""
|
|
262
|
-
List
|
|
300
|
+
List project entities from the backend.
|
|
301
|
+
|
|
302
|
+
Retrieves a list of projects from the backend and converts
|
|
303
|
+
them to Project entity objects.
|
|
263
304
|
|
|
264
305
|
Parameters
|
|
265
306
|
----------
|
|
266
307
|
entity_type : str
|
|
267
|
-
|
|
308
|
+
The type of entities to list (typically 'project').
|
|
268
309
|
**kwargs : dict
|
|
269
|
-
|
|
310
|
+
Additional parameters including 'local' flag and
|
|
311
|
+
API call parameters for filtering or pagination.
|
|
270
312
|
|
|
271
313
|
Returns
|
|
272
314
|
-------
|
|
273
315
|
list[Project]
|
|
274
|
-
List of objects.
|
|
316
|
+
List of project entity objects.
|
|
275
317
|
"""
|
|
276
318
|
client = get_client(kwargs.pop("local", False))
|
|
277
319
|
objs = self._list_base_entities(client, entity_type, **kwargs)
|
|
@@ -291,25 +333,28 @@ class BaseEntityOperationsProcessor:
|
|
|
291
333
|
**kwargs,
|
|
292
334
|
) -> dict:
|
|
293
335
|
"""
|
|
294
|
-
Update
|
|
336
|
+
Update a base entity in the backend.
|
|
337
|
+
|
|
338
|
+
Builds the appropriate API endpoint and sends an update request
|
|
339
|
+
to modify an existing entity in the backend.
|
|
295
340
|
|
|
296
341
|
Parameters
|
|
297
342
|
----------
|
|
298
343
|
client : Client
|
|
299
|
-
|
|
344
|
+
The client instance to use for the API call.
|
|
300
345
|
entity_type : str
|
|
301
|
-
|
|
346
|
+
The type of entity to update (e.g., 'project').
|
|
302
347
|
entity_name : str
|
|
303
|
-
|
|
348
|
+
The name identifier of the entity to update.
|
|
304
349
|
entity_dict : dict
|
|
305
|
-
|
|
350
|
+
The updated entity data dictionary.
|
|
306
351
|
**kwargs : dict
|
|
307
|
-
|
|
352
|
+
Additional parameters to pass to the API call.
|
|
308
353
|
|
|
309
354
|
Returns
|
|
310
355
|
-------
|
|
311
356
|
dict
|
|
312
|
-
|
|
357
|
+
The updated entity data returned from the backend.
|
|
313
358
|
"""
|
|
314
359
|
api = client.build_api(
|
|
315
360
|
ApiCategories.BASE.value,
|
|
@@ -327,23 +372,27 @@ class BaseEntityOperationsProcessor:
|
|
|
327
372
|
**kwargs,
|
|
328
373
|
) -> Project:
|
|
329
374
|
"""
|
|
330
|
-
Update
|
|
375
|
+
Update a project entity in the backend.
|
|
376
|
+
|
|
377
|
+
Updates an existing project with new data and returns the
|
|
378
|
+
updated Project entity object.
|
|
331
379
|
|
|
332
380
|
Parameters
|
|
333
381
|
----------
|
|
334
382
|
entity_type : str
|
|
335
|
-
|
|
383
|
+
The type of entity to update (typically 'project').
|
|
336
384
|
entity_name : str
|
|
337
|
-
|
|
385
|
+
The name identifier of the project to update.
|
|
338
386
|
entity_dict : dict
|
|
339
|
-
|
|
387
|
+
The updated project data dictionary.
|
|
340
388
|
**kwargs : dict
|
|
341
|
-
|
|
389
|
+
Additional parameters including 'local' flag and
|
|
390
|
+
API call parameters.
|
|
342
391
|
|
|
343
392
|
Returns
|
|
344
393
|
-------
|
|
345
394
|
Project
|
|
346
|
-
|
|
395
|
+
The updated project entity object.
|
|
347
396
|
"""
|
|
348
397
|
client = get_client(kwargs.pop("local", False))
|
|
349
398
|
obj = self._update_base_entity(client, entity_type, entity_name, entity_dict, **kwargs)
|
|
@@ -358,23 +407,27 @@ class BaseEntityOperationsProcessor:
|
|
|
358
407
|
**kwargs,
|
|
359
408
|
) -> dict:
|
|
360
409
|
"""
|
|
361
|
-
Delete
|
|
410
|
+
Delete a base entity from the backend.
|
|
411
|
+
|
|
412
|
+
Builds the appropriate API endpoint and parameters, then sends
|
|
413
|
+
a delete request to remove the entity from the backend.
|
|
362
414
|
|
|
363
415
|
Parameters
|
|
364
416
|
----------
|
|
365
417
|
client : Client
|
|
366
|
-
|
|
418
|
+
The client instance to use for the API call.
|
|
367
419
|
entity_type : str
|
|
368
|
-
|
|
420
|
+
The type of entity to delete (e.g., 'project').
|
|
369
421
|
entity_name : str
|
|
370
|
-
|
|
422
|
+
The name identifier of the entity to delete.
|
|
371
423
|
**kwargs : dict
|
|
372
|
-
|
|
424
|
+
Additional parameters to pass to the API call, such as
|
|
425
|
+
cascade deletion options.
|
|
373
426
|
|
|
374
427
|
Returns
|
|
375
428
|
-------
|
|
376
429
|
dict
|
|
377
|
-
Response from backend.
|
|
430
|
+
Response data from the backend delete operation.
|
|
378
431
|
"""
|
|
379
432
|
kwargs = client.build_parameters(
|
|
380
433
|
ApiCategories.BASE.value,
|
|
@@ -396,21 +449,25 @@ class BaseEntityOperationsProcessor:
|
|
|
396
449
|
**kwargs,
|
|
397
450
|
) -> dict:
|
|
398
451
|
"""
|
|
399
|
-
Delete
|
|
452
|
+
Delete a project entity from the backend.
|
|
453
|
+
|
|
454
|
+
Deletes a project from the backend and optionally cleans up
|
|
455
|
+
the associated context. Handles both local and remote backends.
|
|
400
456
|
|
|
401
457
|
Parameters
|
|
402
458
|
----------
|
|
403
459
|
entity_type : str
|
|
404
|
-
|
|
460
|
+
The type of entity to delete (typically 'project').
|
|
405
461
|
entity_name : str
|
|
406
|
-
|
|
462
|
+
The name identifier of the project to delete.
|
|
407
463
|
**kwargs : dict
|
|
408
|
-
|
|
464
|
+
Additional parameters including 'local' flag, 'clean_context'
|
|
465
|
+
flag (default True), and API call parameters.
|
|
409
466
|
|
|
410
467
|
Returns
|
|
411
468
|
-------
|
|
412
469
|
dict
|
|
413
|
-
Response from backend.
|
|
470
|
+
Response data from the backend delete operation.
|
|
414
471
|
"""
|
|
415
472
|
if kwargs.pop("clean_context", True):
|
|
416
473
|
delete_context(entity_name)
|
|
@@ -432,19 +489,22 @@ class BaseEntityOperationsProcessor:
|
|
|
432
489
|
entity_id: str,
|
|
433
490
|
) -> str:
|
|
434
491
|
"""
|
|
435
|
-
Build
|
|
492
|
+
Build a storage key for a base entity.
|
|
493
|
+
|
|
494
|
+
Creates a standardized key string that can be used to identify
|
|
495
|
+
and store the entity in various contexts.
|
|
436
496
|
|
|
437
497
|
Parameters
|
|
438
498
|
----------
|
|
439
499
|
client : Client
|
|
440
|
-
|
|
500
|
+
The client instance to use for key building.
|
|
441
501
|
entity_id : str
|
|
442
|
-
|
|
502
|
+
The unique identifier of the entity.
|
|
443
503
|
|
|
444
504
|
Returns
|
|
445
505
|
-------
|
|
446
506
|
str
|
|
447
|
-
|
|
507
|
+
The constructed entity key string.
|
|
448
508
|
"""
|
|
449
509
|
return client.build_key(ApiCategories.BASE.value, entity_id)
|
|
450
510
|
|
|
@@ -454,19 +514,22 @@ class BaseEntityOperationsProcessor:
|
|
|
454
514
|
**kwargs,
|
|
455
515
|
) -> str:
|
|
456
516
|
"""
|
|
457
|
-
Build
|
|
517
|
+
Build a storage key for a project entity.
|
|
518
|
+
|
|
519
|
+
Creates a standardized key string for project identification
|
|
520
|
+
and storage, handling both local and remote client contexts.
|
|
458
521
|
|
|
459
522
|
Parameters
|
|
460
523
|
----------
|
|
461
524
|
entity_id : str
|
|
462
|
-
|
|
525
|
+
The unique identifier of the project entity.
|
|
463
526
|
**kwargs : dict
|
|
464
|
-
|
|
527
|
+
Additional parameters including 'local' flag.
|
|
465
528
|
|
|
466
529
|
Returns
|
|
467
530
|
-------
|
|
468
531
|
str
|
|
469
|
-
|
|
532
|
+
The constructed project entity key string.
|
|
470
533
|
"""
|
|
471
534
|
client = get_client(kwargs.pop("local", False))
|
|
472
535
|
return self._build_base_entity_key(client, entity_id)
|
|
@@ -478,20 +541,32 @@ class BaseEntityOperationsProcessor:
|
|
|
478
541
|
**kwargs,
|
|
479
542
|
) -> None:
|
|
480
543
|
"""
|
|
481
|
-
Share
|
|
544
|
+
Share or unshare a project entity with a user.
|
|
545
|
+
|
|
546
|
+
Manages project access permissions by sharing the project with
|
|
547
|
+
a specified user or removing user access. Handles both sharing
|
|
548
|
+
and unsharing operations based on the 'unshare' parameter.
|
|
482
549
|
|
|
483
550
|
Parameters
|
|
484
551
|
----------
|
|
485
552
|
entity_type : str
|
|
486
|
-
|
|
553
|
+
The type of entity to share (typically 'project').
|
|
487
554
|
entity_name : str
|
|
488
|
-
|
|
555
|
+
The name identifier of the project to share.
|
|
489
556
|
**kwargs : dict
|
|
490
|
-
|
|
557
|
+
Additional parameters including:
|
|
558
|
+
- 'user': username to share with/unshare from
|
|
559
|
+
- 'unshare': boolean flag for unsharing (default False)
|
|
560
|
+
- 'local': boolean flag for local backend
|
|
491
561
|
|
|
492
562
|
Returns
|
|
493
563
|
-------
|
|
494
564
|
None
|
|
565
|
+
|
|
566
|
+
Raises
|
|
567
|
+
------
|
|
568
|
+
ValueError
|
|
569
|
+
If trying to unshare from a user who doesn't have access.
|
|
495
570
|
"""
|
|
496
571
|
client = get_client(kwargs.pop("local", False))
|
|
497
572
|
api = client.build_api(
|