digitalhub 0.14.0b1__py3-none-any.whl → 0.14.0b3__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.

Files changed (71) hide show
  1. digitalhub/context/builder.py +0 -4
  2. digitalhub/context/context.py +12 -8
  3. digitalhub/entities/_base/_base/entity.py +0 -4
  4. digitalhub/entities/_base/context/entity.py +1 -1
  5. digitalhub/entities/_base/entity/entity.py +0 -8
  6. digitalhub/entities/_base/executable/entity.py +9 -21
  7. digitalhub/entities/_base/material/entity.py +5 -21
  8. digitalhub/entities/_base/unversioned/entity.py +1 -1
  9. digitalhub/entities/_base/versioned/entity.py +1 -1
  10. digitalhub/entities/_processors/base/__init__.py +3 -0
  11. digitalhub/entities/_processors/{base.py → base/crud.py} +12 -232
  12. digitalhub/entities/_processors/base/import_export.py +122 -0
  13. digitalhub/entities/_processors/base/processor.py +302 -0
  14. digitalhub/entities/_processors/base/special_ops.py +108 -0
  15. digitalhub/entities/_processors/context/__init__.py +3 -0
  16. digitalhub/entities/_processors/context/crud.py +654 -0
  17. digitalhub/entities/_processors/context/import_export.py +242 -0
  18. digitalhub/entities/_processors/context/material.py +123 -0
  19. digitalhub/entities/_processors/context/processor.py +400 -0
  20. digitalhub/entities/_processors/context/special_ops.py +476 -0
  21. digitalhub/entities/_processors/processors.py +12 -0
  22. digitalhub/entities/_processors/utils.py +2 -2
  23. digitalhub/entities/artifact/crud.py +1 -1
  24. digitalhub/entities/dataitem/crud.py +6 -3
  25. digitalhub/entities/dataitem/table/entity.py +24 -1
  26. digitalhub/entities/dataitem/utils.py +4 -0
  27. digitalhub/entities/function/_base/entity.py +3 -3
  28. digitalhub/entities/function/crud.py +1 -1
  29. digitalhub/entities/model/_base/entity.py +46 -24
  30. digitalhub/entities/model/crud.py +1 -1
  31. digitalhub/entities/project/_base/entity.py +3 -12
  32. digitalhub/entities/project/crud.py +1 -2
  33. digitalhub/entities/run/_base/builder.py +0 -4
  34. digitalhub/entities/run/_base/entity.py +53 -66
  35. digitalhub/entities/run/crud.py +5 -2
  36. digitalhub/entities/secret/_base/entity.py +1 -5
  37. digitalhub/entities/secret/crud.py +1 -1
  38. digitalhub/entities/task/_base/builder.py +0 -4
  39. digitalhub/entities/task/_base/entity.py +5 -5
  40. digitalhub/entities/task/crud.py +1 -1
  41. digitalhub/entities/trigger/_base/entity.py +1 -5
  42. digitalhub/entities/trigger/crud.py +1 -1
  43. digitalhub/entities/workflow/_base/entity.py +3 -3
  44. digitalhub/entities/workflow/crud.py +1 -1
  45. digitalhub/factory/entity.py +283 -0
  46. digitalhub/factory/registry.py +197 -0
  47. digitalhub/factory/runtime.py +44 -0
  48. digitalhub/runtimes/_base.py +2 -2
  49. digitalhub/stores/client/dhcore/client.py +0 -14
  50. digitalhub/stores/client/dhcore/configurator.py +5 -28
  51. digitalhub/stores/client/dhcore/error_parser.py +0 -4
  52. digitalhub/stores/credentials/configurator.py +4 -29
  53. digitalhub/stores/credentials/handler.py +0 -12
  54. digitalhub/stores/credentials/store.py +0 -4
  55. digitalhub/stores/data/_base/store.py +0 -16
  56. digitalhub/stores/data/builder.py +0 -4
  57. digitalhub/stores/data/remote/store.py +0 -4
  58. digitalhub/stores/data/s3/configurator.py +2 -10
  59. digitalhub/stores/data/s3/store.py +0 -12
  60. digitalhub/stores/data/sql/configurator.py +0 -8
  61. digitalhub/stores/data/sql/store.py +0 -4
  62. digitalhub/stores/readers/data/factory.py +0 -8
  63. digitalhub/stores/readers/data/pandas/reader.py +9 -19
  64. digitalhub/utils/io_utils.py +0 -4
  65. {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b3.dist-info}/METADATA +1 -1
  66. {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b3.dist-info}/RECORD +69 -57
  67. digitalhub/entities/_processors/context.py +0 -1499
  68. digitalhub/factory/factory.py +0 -460
  69. {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b3.dist-info}/WHEEL +0 -0
  70. {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b3.dist-info}/licenses/AUTHORS +0 -0
  71. {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b3.dist-info}/licenses/LICENSE +0 -0
@@ -1,1499 +0,0 @@
1
- # SPDX-FileCopyrightText: © 2025 DSLab - Fondazione Bruno Kessler
2
- #
3
- # SPDX-License-Identifier: Apache-2.0
4
-
5
- from __future__ import annotations
6
-
7
- import typing
8
- from typing import Any
9
-
10
- from digitalhub.entities._commons.enums import ApiCategories, BackendOperations, Relationship, State
11
- from digitalhub.entities._commons.utils import is_valid_key
12
- from digitalhub.entities._constructors.uuid import build_uuid
13
- from digitalhub.entities._processors.utils import (
14
- get_context_from_identifier,
15
- get_context_from_project,
16
- parse_identifier,
17
- )
18
- from digitalhub.factory.factory import factory
19
- from digitalhub.utils.exceptions import EntityAlreadyExistsError, EntityError, EntityNotExistsError
20
- from digitalhub.utils.io_utils import read_yaml
21
- from digitalhub.utils.types import SourcesOrListOfSources
22
-
23
- if typing.TYPE_CHECKING:
24
- from digitalhub.context.context import Context
25
- from digitalhub.entities._base.context.entity import ContextEntity
26
- from digitalhub.entities._base.executable.entity import ExecutableEntity
27
- from digitalhub.entities._base.material.entity import MaterialEntity
28
- from digitalhub.entities._base.unversioned.entity import UnversionedEntity
29
-
30
-
31
- class ContextEntityOperationsProcessor:
32
- """
33
- Processor for context entity operations.
34
-
35
- This class handles CRUD operations and other entity management tasks
36
- for context-level entities (artifacts, functions, workflows, runs, etc.)
37
- within projects. It manages the full lifecycle of versioned and
38
- unversioned entities including creation, reading, updating, deletion,
39
- import/export, and specialized operations like file uploads and metrics.
40
- """
41
-
42
- ##############################
43
- # CRUD context entity
44
- ##############################
45
-
46
- def _create_context_entity(
47
- self,
48
- context: Context,
49
- entity_type: str,
50
- entity_dict: dict,
51
- ) -> dict:
52
- """
53
- Create a context entity in the backend.
54
-
55
- Builds the appropriate API endpoint and sends a create request
56
- to the backend for context-level entities within a project.
57
-
58
- Parameters
59
- ----------
60
- context : Context
61
- The project context instance.
62
- entity_type : str
63
- The type of entity to create (e.g., 'artifact', 'function').
64
- entity_dict : dict
65
- The entity data dictionary to create.
66
-
67
- Returns
68
- -------
69
- dict
70
- The created entity data returned from the backend.
71
- """
72
- api = context.client.build_api(
73
- ApiCategories.CONTEXT.value,
74
- BackendOperations.CREATE.value,
75
- project=context.name,
76
- entity_type=entity_type,
77
- )
78
- return context.client.create_object(api, entity_dict)
79
-
80
- def create_context_entity(
81
- self,
82
- _entity: ContextEntity | None = None,
83
- **kwargs,
84
- ) -> ContextEntity:
85
- """
86
- Create a context entity in the backend.
87
-
88
- Creates a new context entity either from an existing entity object
89
- or by building one from the provided parameters. Handles entity
90
- creation within a project context.
91
-
92
- Parameters
93
- ----------
94
- _entity : ContextEntity, optional
95
- An existing context entity object to create. If None,
96
- a new entity will be built from kwargs.
97
- **kwargs : dict
98
- Parameters for entity creation, including 'project' and
99
- entity-specific parameters.
100
-
101
- Returns
102
- -------
103
- ContextEntity
104
- The created context entity with backend data populated.
105
- """
106
- if _entity is not None:
107
- context = _entity._context()
108
- obj = _entity
109
- else:
110
- context = get_context_from_project(kwargs["project"])
111
- obj: ContextEntity = factory.build_entity_from_params(**kwargs)
112
- new_obj = self._create_context_entity(context, obj.ENTITY_TYPE, obj.to_dict())
113
- return factory.build_entity_from_dict(new_obj)
114
-
115
- def log_material_entity(
116
- self,
117
- **kwargs,
118
- ) -> MaterialEntity:
119
- """
120
- Create a material entity in the backend and upload associated files.
121
-
122
- Creates a new material entity (artifact, dataitem, or model) and
123
- handles file upload operations. Manages upload state transitions
124
- and error handling during the upload process.
125
-
126
- Parameters
127
- ----------
128
- **kwargs : dict
129
- Parameters for entity creation including:
130
- - 'source': file source(s) to upload
131
- - 'project': project name
132
- - other entity-specific parameters
133
-
134
- Returns
135
- -------
136
- MaterialEntity
137
- The created material entity with uploaded files.
138
-
139
- Raises
140
- ------
141
- EntityError
142
- If file upload fails during the process.
143
- """
144
- source: SourcesOrListOfSources = kwargs.pop("source")
145
- context = get_context_from_project(kwargs["project"])
146
- obj = factory.build_entity_from_params(**kwargs)
147
- if context.is_running:
148
- obj.add_relationship(Relationship.PRODUCEDBY.value, context.get_run_ctx())
149
-
150
- new_obj: MaterialEntity = self._create_context_entity(context, obj.ENTITY_TYPE, obj.to_dict())
151
- new_obj = factory.build_entity_from_dict(new_obj)
152
-
153
- new_obj.status.state = State.UPLOADING.value
154
- new_obj = self._update_material_entity(new_obj)
155
-
156
- # Handle file upload
157
- try:
158
- new_obj.upload(source)
159
- uploaded = True
160
- msg = None
161
- except Exception as e:
162
- uploaded = False
163
- msg = str(e.args)
164
-
165
- new_obj.status.message = msg
166
-
167
- # Update status after upload
168
- if uploaded:
169
- new_obj.status.state = State.READY.value
170
- new_obj = self._update_material_entity(new_obj)
171
- else:
172
- new_obj.status.state = State.ERROR.value
173
- new_obj = self._update_material_entity(new_obj)
174
- raise EntityError(msg)
175
-
176
- return new_obj
177
-
178
- def _read_context_entity(
179
- self,
180
- context: Context,
181
- identifier: str,
182
- entity_type: str | None = None,
183
- project: str | None = None,
184
- entity_id: str | None = None,
185
- **kwargs,
186
- ) -> dict:
187
- """
188
- Read a context entity from the backend.
189
-
190
- Retrieves entity data from the backend using either entity ID
191
- for direct access or entity name for latest version lookup.
192
- Handles both specific version reads and latest version queries.
193
-
194
- Parameters
195
- ----------
196
- context : Context
197
- The project context instance.
198
- identifier : str
199
- Entity key (store://...) or entity name identifier.
200
- entity_type : str, optional
201
- The type of entity to read.
202
- project : str, optional
203
- Project name (used for identifier parsing).
204
- entity_id : str, optional
205
- Specific entity ID to read.
206
- **kwargs : dict
207
- Additional parameters to pass to the API call.
208
-
209
- Returns
210
- -------
211
- dict
212
- The entity data retrieved from the backend.
213
- """
214
- project, entity_type, _, entity_name, entity_id = parse_identifier(
215
- identifier,
216
- project=project,
217
- entity_type=entity_type,
218
- entity_id=entity_id,
219
- )
220
-
221
- if entity_id is None:
222
- kwargs["entity_name"] = entity_name
223
- kwargs = context.client.build_parameters(
224
- ApiCategories.CONTEXT.value,
225
- BackendOperations.READ.value,
226
- **kwargs,
227
- )
228
-
229
- if entity_id is None:
230
- api = context.client.build_api(
231
- ApiCategories.CONTEXT.value,
232
- BackendOperations.LIST.value,
233
- project=context.name,
234
- entity_type=entity_type,
235
- )
236
- return context.client.list_first_object(api, **kwargs)
237
-
238
- api = context.client.build_api(
239
- ApiCategories.CONTEXT.value,
240
- BackendOperations.READ.value,
241
- project=context.name,
242
- entity_type=entity_type,
243
- entity_id=entity_id,
244
- )
245
- return context.client.read_object(api, **kwargs)
246
-
247
- def read_context_entity(
248
- self,
249
- identifier: str,
250
- entity_type: str | None = None,
251
- project: str | None = None,
252
- entity_id: str | None = None,
253
- **kwargs,
254
- ) -> ContextEntity:
255
- """
256
- Read a context entity from the backend.
257
-
258
- Retrieves entity data from the backend and constructs a context
259
- entity object. Handles post-processing for metrics and file info.
260
-
261
- Parameters
262
- ----------
263
- identifier : str
264
- Entity key (store://...) or entity name identifier.
265
- entity_type : str, optional
266
- The type of entity to read.
267
- project : str, optional
268
- Project name for context resolution.
269
- entity_id : str, optional
270
- Specific entity ID to read.
271
- **kwargs : dict
272
- Additional parameters to pass to the API call.
273
-
274
- Returns
275
- -------
276
- ContextEntity
277
- The context entity object populated with backend data.
278
- """
279
- context = get_context_from_identifier(identifier, project)
280
- obj = self._read_context_entity(
281
- context,
282
- identifier,
283
- entity_type=entity_type,
284
- project=project,
285
- entity_id=entity_id,
286
- **kwargs,
287
- )
288
- entity = factory.build_entity_from_dict(obj)
289
- return self._post_process_get(entity)
290
-
291
- def read_unversioned_entity(
292
- self,
293
- identifier: str,
294
- entity_type: str | None = None,
295
- project: str | None = None,
296
- entity_id: str | None = None,
297
- **kwargs,
298
- ) -> UnversionedEntity:
299
- """
300
- Read an unversioned entity from the backend.
301
-
302
- Retrieves unversioned entity data (runs, tasks) from the backend.
303
- Handles identifier parsing for entities that don't follow the
304
- standard versioned naming convention.
305
-
306
- Parameters
307
- ----------
308
- identifier : str
309
- Entity key (store://...) or entity ID.
310
- entity_type : str, optional
311
- The type of entity to read.
312
- project : str, optional
313
- Project name for context resolution.
314
- entity_id : str, optional
315
- Specific entity ID to read.
316
- **kwargs : dict
317
- Additional parameters to pass to the API call.
318
-
319
- Returns
320
- -------
321
- UnversionedEntity
322
- The unversioned entity object populated with backend data.
323
- """
324
- if not is_valid_key(identifier):
325
- entity_id = identifier
326
- else:
327
- splt = identifier.split(":")
328
- if len(splt) == 3:
329
- identifier = f"{splt[0]}:{splt[1]}"
330
- return self.read_context_entity(
331
- identifier,
332
- entity_type=entity_type,
333
- project=project,
334
- entity_id=entity_id,
335
- **kwargs,
336
- )
337
-
338
- def import_context_entity(
339
- self,
340
- file: str | None = None,
341
- key: str | None = None,
342
- reset_id: bool = False,
343
- context: str | None = None,
344
- ) -> ContextEntity:
345
- """
346
- Import a context entity from a YAML file or from a storage key.
347
-
348
- Parameters
349
- ----------
350
- file : str
351
- Path to the YAML file containing entity configuration.
352
- key : str
353
- Storage key (store://...) to read the entity from.
354
- reset_id : bool
355
- Flag to determine if the ID of context entities should be reset.
356
- context : str, optional
357
- Project name to use for context resolution. If None, uses
358
- the project specified in the YAML file.
359
-
360
- Returns
361
- -------
362
- ContextEntity
363
- The imported and created context entity.
364
-
365
- Raises
366
- ------
367
- EntityError
368
- If the entity already exists in the backend.
369
- """
370
- if (file is None) == (key is None):
371
- raise ValueError("Provide key or file, not both or none.")
372
-
373
- if file is not None:
374
- dict_obj: dict = read_yaml(file)
375
- else:
376
- ctx = get_context_from_identifier(key)
377
- dict_obj: dict = self._read_context_entity(ctx, key)
378
-
379
- dict_obj["status"] = {}
380
-
381
- if context is None:
382
- context = dict_obj["project"]
383
-
384
- ctx = get_context_from_project(context)
385
- obj = factory.build_entity_from_dict(dict_obj)
386
- if reset_id:
387
- new_id = build_uuid()
388
- obj.id = new_id
389
- obj.metadata.version = new_id
390
- try:
391
- bck_obj = self._create_context_entity(ctx, obj.ENTITY_TYPE, obj.to_dict())
392
- new_obj: ContextEntity = factory.build_entity_from_dict(bck_obj)
393
- except EntityAlreadyExistsError:
394
- raise EntityError(f"Entity {obj.name} already exists. If you want to update it, use load instead.")
395
- return new_obj
396
-
397
- def import_executable_entity(
398
- self,
399
- file: str | None = None,
400
- key: str | None = None,
401
- reset_id: bool = False,
402
- context: str | None = None,
403
- ) -> ExecutableEntity:
404
- """
405
- Import an executable entity from a YAML file or from a storage key.
406
-
407
- Parameters
408
- ----------
409
- file : str
410
- Path to the YAML file containing executable entity configuration.
411
- Can contain a single entity or a list with the executable and tasks.
412
- key : str
413
- Storage key (store://...) to read the entity from.
414
- reset_id : bool
415
- Flag to determine if the ID of executable entities should be reset.
416
- context : str, optional
417
- Project name to use for context resolution.
418
-
419
- Returns
420
- -------
421
- ExecutableEntity
422
- The imported and created executable entity.
423
-
424
- Raises
425
- ------
426
- EntityError
427
- If the entity already exists in the backend.
428
- """
429
- if (file is None) == (key is None):
430
- raise ValueError("Provide key or file, not both or none.")
431
-
432
- if file is not None:
433
- dict_obj: dict | list[dict] = read_yaml(file)
434
- else:
435
- ctx = get_context_from_identifier(key)
436
- dict_obj: dict = self._read_context_entity(ctx, key)
437
-
438
- if isinstance(dict_obj, list):
439
- exec_dict = dict_obj[0]
440
- exec_dict["status"] = {}
441
- tsk_dicts = []
442
- for i in dict_obj[1:]:
443
- i["status"] = {}
444
- tsk_dicts.append(i)
445
- else:
446
- exec_dict = dict_obj
447
- exec_dict["status"] = {}
448
- tsk_dicts = []
449
-
450
- if context is None:
451
- context = exec_dict["project"]
452
-
453
- ctx = get_context_from_project(context)
454
- obj: ExecutableEntity = factory.build_entity_from_dict(exec_dict)
455
-
456
- if reset_id:
457
- new_id = build_uuid()
458
- obj.id = new_id
459
- obj.metadata.version = new_id
460
-
461
- try:
462
- bck_obj = self._create_context_entity(ctx, obj.ENTITY_TYPE, obj.to_dict())
463
- new_obj: ExecutableEntity = factory.build_entity_from_dict(bck_obj)
464
- except EntityAlreadyExistsError:
465
- raise EntityError(f"Entity {obj.name} already exists. If you want to update it, use load instead.")
466
-
467
- new_obj.import_tasks(tsk_dicts)
468
-
469
- return new_obj
470
-
471
- def load_context_entity(
472
- self,
473
- file: str,
474
- ) -> ContextEntity:
475
- """
476
- Load a context entity from a YAML file and update it in the backend.
477
-
478
- Reads entity configuration from a YAML file and updates an existing
479
- entity in the backend. If the entity doesn't exist, it creates a
480
- new one.
481
-
482
- Parameters
483
- ----------
484
- file : str
485
- Path to the YAML file containing entity configuration.
486
-
487
- Returns
488
- -------
489
- ContextEntity
490
- The loaded and updated context entity.
491
- """
492
- dict_obj: dict = read_yaml(file)
493
- context = get_context_from_project(dict_obj["project"])
494
- obj: ContextEntity = factory.build_entity_from_dict(dict_obj)
495
- try:
496
- self._update_context_entity(context, obj.ENTITY_TYPE, obj.id, obj.to_dict())
497
- except EntityNotExistsError:
498
- self._create_context_entity(context, obj.ENTITY_TYPE, obj.to_dict())
499
- return obj
500
-
501
- def load_executable_entity(
502
- self,
503
- file: str,
504
- ) -> ExecutableEntity:
505
- """
506
- Load an executable entity from a YAML file and update it in the backend.
507
-
508
- Reads executable entity configuration from a YAML file and updates
509
- an existing executable entity in the backend. If the entity doesn't
510
- exist, it creates a new one. Also handles task imports.
511
-
512
- Parameters
513
- ----------
514
- file : str
515
- Path to the YAML file containing executable entity configuration.
516
- Can contain a single entity or a list with the executable and tasks.
517
-
518
- Returns
519
- -------
520
- ExecutableEntity
521
- The loaded and updated executable entity.
522
- """
523
- dict_obj: dict | list[dict] = read_yaml(file)
524
- if isinstance(dict_obj, list):
525
- exec_dict = dict_obj[0]
526
- tsk_dicts = dict_obj[1:]
527
- else:
528
- exec_dict = dict_obj
529
- tsk_dicts = []
530
-
531
- context = get_context_from_project(exec_dict["project"])
532
- obj: ExecutableEntity = factory.build_entity_from_dict(exec_dict)
533
-
534
- try:
535
- self._update_context_entity(context, obj.ENTITY_TYPE, obj.id, obj.to_dict())
536
- except EntityNotExistsError:
537
- self._create_context_entity(context, obj.ENTITY_TYPE, obj.to_dict())
538
- obj.import_tasks(tsk_dicts)
539
- return obj
540
-
541
- def _read_context_entity_versions(
542
- self,
543
- context: Context,
544
- identifier: str,
545
- entity_type: str | None = None,
546
- project: str | None = None,
547
- **kwargs,
548
- ) -> list[dict]:
549
- """
550
- Read all versions of a context entity from the backend.
551
-
552
- Retrieves all available versions of a named entity from the
553
- backend using the entity name identifier.
554
-
555
- Parameters
556
- ----------
557
- context : Context
558
- The project context instance.
559
- identifier : str
560
- Entity key (store://...) or entity name identifier.
561
- entity_type : str, optional
562
- The type of entity to read versions for.
563
- project : str, optional
564
- Project name (used for identifier parsing).
565
- **kwargs : dict
566
- Additional parameters to pass to the API call.
567
-
568
- Returns
569
- -------
570
- list[dict]
571
- List of entity data dictionaries for all versions.
572
- """
573
- project, entity_type, _, entity_name, _ = parse_identifier(
574
- identifier,
575
- project=project,
576
- entity_type=entity_type,
577
- )
578
-
579
- kwargs = context.client.build_parameters(
580
- ApiCategories.CONTEXT.value,
581
- BackendOperations.READ_ALL_VERSIONS.value,
582
- entity_name=entity_name,
583
- **kwargs,
584
- )
585
-
586
- api = context.client.build_api(
587
- ApiCategories.CONTEXT.value,
588
- BackendOperations.LIST.value,
589
- project=context.name,
590
- entity_type=entity_type,
591
- )
592
- return context.client.list_objects(api, **kwargs)
593
-
594
- def read_context_entity_versions(
595
- self,
596
- identifier: str,
597
- entity_type: str | None = None,
598
- project: str | None = None,
599
- **kwargs,
600
- ) -> list[ContextEntity]:
601
- """
602
- Read all versions of a context entity from the backend.
603
-
604
- Retrieves all available versions of a named entity and constructs
605
- context entity objects for each version. Applies post-processing
606
- for metrics and file info.
607
-
608
- Parameters
609
- ----------
610
- identifier : str
611
- Entity key (store://...) or entity name identifier.
612
- entity_type : str, optional
613
- The type of entity to read versions for.
614
- project : str, optional
615
- Project name for context resolution.
616
- **kwargs : dict
617
- Additional parameters to pass to the API call.
618
-
619
- Returns
620
- -------
621
- list[ContextEntity]
622
- List of context entity objects for all versions.
623
- """
624
- context = get_context_from_identifier(identifier, project)
625
- objs = self._read_context_entity_versions(
626
- context,
627
- identifier,
628
- entity_type=entity_type,
629
- project=project,
630
- **kwargs,
631
- )
632
- objects = []
633
- for o in objs:
634
- entity: ContextEntity = factory.build_entity_from_dict(o)
635
- entity = self._post_process_get(entity)
636
- objects.append(entity)
637
- return objects
638
-
639
- def _list_context_entities(
640
- self,
641
- context: Context,
642
- entity_type: str,
643
- **kwargs,
644
- ) -> list[dict]:
645
- """
646
- List context entities from the backend.
647
-
648
- Retrieves a list of entities of a specific type from the backend
649
- within the project context.
650
-
651
- Parameters
652
- ----------
653
- context : Context
654
- The project context instance.
655
- entity_type : str
656
- The type of entities to list.
657
- **kwargs : dict
658
- Additional parameters to pass to the API call for filtering
659
- or pagination.
660
-
661
- Returns
662
- -------
663
- list[dict]
664
- List of entity data dictionaries from the backend.
665
- """
666
- api = context.client.build_api(
667
- ApiCategories.CONTEXT.value,
668
- BackendOperations.LIST.value,
669
- project=context.name,
670
- entity_type=entity_type,
671
- )
672
- return context.client.list_objects(api, **kwargs)
673
-
674
- def list_context_entities(
675
- self,
676
- project: str,
677
- entity_type: str,
678
- **kwargs,
679
- ) -> list[ContextEntity]:
680
- """
681
- List all latest version context entities from the backend.
682
-
683
- Retrieves a list of entities of a specific type from the backend
684
- and constructs context entity objects. Only returns the latest
685
- version of each entity. Applies post-processing for metrics and
686
- file info.
687
-
688
- Parameters
689
- ----------
690
- project : str
691
- The project name to list entities from.
692
- entity_type : str
693
- The type of entities to list.
694
- **kwargs : dict
695
- Additional parameters to pass to the API call for filtering
696
- or pagination.
697
-
698
- Returns
699
- -------
700
- list[ContextEntity]
701
- List of context entity objects (latest versions only).
702
- """
703
- context = get_context_from_project(project)
704
- objs = self._list_context_entities(context, entity_type, **kwargs)
705
- objects = []
706
- for o in objs:
707
- entity: ContextEntity = factory.build_entity_from_dict(o)
708
- entity = self._post_process_get(entity)
709
- objects.append(entity)
710
- return objects
711
-
712
- def _update_material_entity(
713
- self,
714
- new_obj: MaterialEntity,
715
- ) -> dict:
716
- """
717
- Update a material entity using a shortcut method.
718
-
719
- Convenience method for updating material entities during
720
- file upload operations.
721
-
722
- Parameters
723
- ----------
724
- new_obj : MaterialEntity
725
- The material entity object to update.
726
-
727
- Returns
728
- -------
729
- dict
730
- Response data from the backend update operation.
731
- """
732
- return self.update_context_entity(
733
- new_obj.project,
734
- new_obj.ENTITY_TYPE,
735
- new_obj.id,
736
- new_obj.to_dict(),
737
- )
738
-
739
- def _update_context_entity(
740
- self,
741
- context: Context,
742
- entity_type: str,
743
- entity_id: str,
744
- entity_dict: dict,
745
- **kwargs,
746
- ) -> dict:
747
- """
748
- Update a context entity in the backend.
749
-
750
- Updates an existing context entity with new data. Entity
751
- specifications are typically immutable, so this primarily
752
- updates status and metadata.
753
-
754
- Parameters
755
- ----------
756
- context : Context
757
- The project context instance.
758
- entity_type : str
759
- The type of entity to update.
760
- entity_id : str
761
- The unique identifier of the entity to update.
762
- entity_dict : dict
763
- The updated entity data dictionary.
764
- **kwargs : dict
765
- Additional parameters to pass to the API call.
766
-
767
- Returns
768
- -------
769
- dict
770
- Response data from the backend update operation.
771
- """
772
- api = context.client.build_api(
773
- ApiCategories.CONTEXT.value,
774
- BackendOperations.UPDATE.value,
775
- project=context.name,
776
- entity_type=entity_type,
777
- entity_id=entity_id,
778
- )
779
- return context.client.update_object(api, entity_dict, **kwargs)
780
-
781
- def update_context_entity(
782
- self,
783
- project: str,
784
- entity_type: str,
785
- entity_id: str,
786
- entity_dict: dict,
787
- **kwargs,
788
- ) -> ContextEntity:
789
- """
790
- Update a context entity in the backend.
791
-
792
- Updates an existing context entity with new data and returns
793
- the updated context entity object. Entity specifications are
794
- typically immutable.
795
-
796
- Parameters
797
- ----------
798
- project : str
799
- The project name containing the entity.
800
- entity_type : str
801
- The type of entity to update.
802
- entity_id : str
803
- The unique identifier of the entity to update.
804
- entity_dict : dict
805
- The updated entity data dictionary.
806
- **kwargs : dict
807
- Additional parameters to pass to the API call.
808
-
809
- Returns
810
- -------
811
- ContextEntity
812
- The updated context entity object.
813
- """
814
- context = get_context_from_project(project)
815
- obj = self._update_context_entity(
816
- context,
817
- entity_type,
818
- entity_id,
819
- entity_dict,
820
- **kwargs,
821
- )
822
- return factory.build_entity_from_dict(obj)
823
-
824
- def _delete_context_entity(
825
- self,
826
- context: Context,
827
- identifier: str,
828
- entity_type: str | None = None,
829
- project: str | None = None,
830
- entity_id: str | None = None,
831
- **kwargs,
832
- ) -> dict:
833
- """
834
- Delete a context entity from the backend.
835
-
836
- Removes an entity from the backend, with options for deleting
837
- specific versions or all versions of a named entity. Handles
838
- cascade deletion if supported.
839
-
840
- Parameters
841
- ----------
842
- context : Context
843
- The project context instance.
844
- identifier : str
845
- Entity key (store://...) or entity name identifier.
846
- entity_type : str, optional
847
- The type of entity to delete.
848
- project : str, optional
849
- Project name (used for identifier parsing).
850
- entity_id : str, optional
851
- Specific entity ID to delete.
852
- **kwargs : dict
853
- Additional parameters including:
854
- - 'delete_all_versions': delete all versions of named entity
855
- - 'cascade': cascade deletion options
856
-
857
- Returns
858
- -------
859
- dict
860
- Response data from the backend delete operation.
861
- """
862
- project, entity_type, _, entity_name, entity_id = parse_identifier(
863
- identifier,
864
- project=project,
865
- entity_type=entity_type,
866
- entity_id=entity_id,
867
- )
868
-
869
- delete_all_versions: bool = kwargs.pop("delete_all_versions", False)
870
- kwargs = context.client.build_parameters(
871
- ApiCategories.CONTEXT.value,
872
- BackendOperations.DELETE.value,
873
- entity_id=entity_id,
874
- entity_name=entity_name,
875
- cascade=kwargs.pop("cascade", None),
876
- delete_all_versions=delete_all_versions,
877
- **kwargs,
878
- )
879
-
880
- if delete_all_versions:
881
- api = context.client.build_api(
882
- ApiCategories.CONTEXT.value,
883
- BackendOperations.LIST.value,
884
- project=context.name,
885
- entity_type=entity_type,
886
- )
887
- else:
888
- api = context.client.build_api(
889
- ApiCategories.CONTEXT.value,
890
- BackendOperations.DELETE.value,
891
- project=context.name,
892
- entity_type=entity_type,
893
- entity_id=entity_id,
894
- )
895
- return context.client.delete_object(api, **kwargs)
896
-
897
- def delete_context_entity(
898
- self,
899
- identifier: str,
900
- project: str | None = None,
901
- entity_type: str | None = None,
902
- entity_id: str | None = None,
903
- **kwargs,
904
- ) -> dict:
905
- """
906
- Delete a context entity from the backend.
907
-
908
- Removes an entity from the backend with support for deleting
909
- specific versions or all versions of a named entity.
910
-
911
- Parameters
912
- ----------
913
- identifier : str
914
- Entity key (store://...) or entity name identifier.
915
- project : str, optional
916
- Project name for context resolution.
917
- entity_type : str, optional
918
- The type of entity to delete.
919
- entity_id : str, optional
920
- Specific entity ID to delete.
921
- **kwargs : dict
922
- Additional parameters including deletion options.
923
-
924
- Returns
925
- -------
926
- dict
927
- Response data from the backend delete operation.
928
- """
929
- context = get_context_from_identifier(identifier, project)
930
- return self._delete_context_entity(
931
- context,
932
- identifier,
933
- entity_type,
934
- context.name,
935
- entity_id,
936
- **kwargs,
937
- )
938
-
939
- def _post_process_get(self, entity: ContextEntity) -> ContextEntity:
940
- """
941
- Post-process a retrieved context entity.
942
-
943
- Applies additional processing to entities after retrieval,
944
- including loading metrics and file information if available.
945
-
946
- Parameters
947
- ----------
948
- entity : ContextEntity
949
- The entity to post-process.
950
-
951
- Returns
952
- -------
953
- ContextEntity
954
- The post-processed entity with additional data loaded.
955
- """
956
- if hasattr(entity.status, "metrics"):
957
- entity._get_metrics()
958
- if hasattr(entity.status, "files"):
959
- entity._get_files_info()
960
- return entity
961
-
962
- ##############################
963
- # Context entity operations
964
- ##############################
965
-
966
- def _build_context_entity_key(
967
- self,
968
- context: Context,
969
- entity_type: str,
970
- entity_kind: str,
971
- entity_name: str,
972
- entity_id: str | None = None,
973
- ) -> str:
974
- """
975
- Build a storage key for a context entity.
976
-
977
- Creates a standardized key string for context entity identification
978
- and storage within a project context.
979
-
980
- Parameters
981
- ----------
982
- context : Context
983
- The project context instance.
984
- entity_type : str
985
- The type of entity.
986
- entity_kind : str
987
- The kind/subtype of entity.
988
- entity_name : str
989
- The name of the entity.
990
- entity_id : str, optional
991
- The unique identifier of the entity version.
992
-
993
- Returns
994
- -------
995
- str
996
- The constructed context entity key string.
997
- """
998
- return context.client.build_key(
999
- ApiCategories.CONTEXT.value,
1000
- project=context.name,
1001
- entity_type=entity_type,
1002
- entity_kind=entity_kind,
1003
- entity_name=entity_name,
1004
- entity_id=entity_id,
1005
- )
1006
-
1007
- def build_context_entity_key(
1008
- self,
1009
- project: str,
1010
- entity_type: str,
1011
- entity_kind: str,
1012
- entity_name: str,
1013
- entity_id: str | None = None,
1014
- ) -> str:
1015
- """
1016
- Build a storage key for a context entity.
1017
-
1018
- Creates a standardized key string for context entity identification
1019
- and storage, resolving the project context automatically.
1020
-
1021
- Parameters
1022
- ----------
1023
- project : str
1024
- The project name containing the entity.
1025
- entity_type : str
1026
- The type of entity.
1027
- entity_kind : str
1028
- The kind/subtype of entity.
1029
- entity_name : str
1030
- The name of the entity.
1031
- entity_id : str, optional
1032
- The unique identifier of the entity version.
1033
-
1034
- Returns
1035
- -------
1036
- str
1037
- The constructed context entity key string.
1038
- """
1039
- context = get_context_from_project(project)
1040
- return self._build_context_entity_key(context, entity_type, entity_kind, entity_name, entity_id)
1041
-
1042
- def read_secret_data(
1043
- self,
1044
- project: str,
1045
- entity_type: str,
1046
- **kwargs,
1047
- ) -> dict:
1048
- """
1049
- Read secret data from the backend.
1050
-
1051
- Retrieves secret data stored in the backend for a specific
1052
- project and entity type.
1053
-
1054
- Parameters
1055
- ----------
1056
- project : str
1057
- The project name containing the secrets.
1058
- entity_type : str
1059
- The type of entity (typically 'secret').
1060
- **kwargs : dict
1061
- Additional parameters to pass to the API call.
1062
-
1063
- Returns
1064
- -------
1065
- dict
1066
- Secret data retrieved from the backend.
1067
- """
1068
- context = get_context_from_project(project)
1069
- api = context.client.build_api(
1070
- ApiCategories.CONTEXT.value,
1071
- BackendOperations.DATA.value,
1072
- project=context.name,
1073
- entity_type=entity_type,
1074
- )
1075
- return context.client.read_object(api, **kwargs)
1076
-
1077
- def update_secret_data(
1078
- self,
1079
- project: str,
1080
- entity_type: str,
1081
- data: dict,
1082
- **kwargs,
1083
- ) -> None:
1084
- """
1085
- Update secret data in the backend.
1086
-
1087
- Stores or updates secret data in the backend for a specific
1088
- project and entity type.
1089
-
1090
- Parameters
1091
- ----------
1092
- project : str
1093
- The project name to store secrets in.
1094
- entity_type : str
1095
- The type of entity (typically 'secret').
1096
- data : dict
1097
- The secret data dictionary to store.
1098
- **kwargs : dict
1099
- Additional parameters to pass to the API call.
1100
-
1101
- Returns
1102
- -------
1103
- None
1104
- """
1105
- context = get_context_from_project(project)
1106
- api = context.client.build_api(
1107
- ApiCategories.CONTEXT.value,
1108
- BackendOperations.DATA.value,
1109
- project=context.name,
1110
- entity_type=entity_type,
1111
- )
1112
- context.client.update_object(api, data, **kwargs)
1113
-
1114
- def read_run_logs(
1115
- self,
1116
- project: str,
1117
- entity_type: str,
1118
- entity_id: str,
1119
- **kwargs,
1120
- ) -> dict:
1121
- """
1122
- Read execution logs from the backend.
1123
-
1124
- Retrieves logs for a specific run or task execution from
1125
- the backend.
1126
-
1127
- Parameters
1128
- ----------
1129
- project : str
1130
- The project name containing the entity.
1131
- entity_type : str
1132
- The type of entity (typically 'run' or 'task').
1133
- entity_id : str
1134
- The unique identifier of the entity to get logs for.
1135
- **kwargs : dict
1136
- Additional parameters to pass to the API call.
1137
-
1138
- Returns
1139
- -------
1140
- dict
1141
- Log data retrieved from the backend.
1142
- """
1143
- context = get_context_from_project(project)
1144
- api = context.client.build_api(
1145
- ApiCategories.CONTEXT.value,
1146
- BackendOperations.LOGS.value,
1147
- project=context.name,
1148
- entity_type=entity_type,
1149
- entity_id=entity_id,
1150
- )
1151
- return context.client.read_object(api, **kwargs)
1152
-
1153
- def stop_entity(
1154
- self,
1155
- project: str,
1156
- entity_type: str,
1157
- entity_id: str,
1158
- **kwargs,
1159
- ) -> None:
1160
- """
1161
- Stop a running entity in the backend.
1162
-
1163
- Sends a stop signal to halt execution of a running entity
1164
- such as a workflow or long-running task.
1165
-
1166
- Parameters
1167
- ----------
1168
- project : str
1169
- The project name containing the entity.
1170
- entity_type : str
1171
- The type of entity to stop.
1172
- entity_id : str
1173
- The unique identifier of the entity to stop.
1174
- **kwargs : dict
1175
- Additional parameters to pass to the API call.
1176
-
1177
- Returns
1178
- -------
1179
- None
1180
- """
1181
- context = get_context_from_project(project)
1182
- api = context.client.build_api(
1183
- ApiCategories.CONTEXT.value,
1184
- BackendOperations.STOP.value,
1185
- project=context.name,
1186
- entity_type=entity_type,
1187
- entity_id=entity_id,
1188
- )
1189
- context.client.create_object(api, **kwargs)
1190
-
1191
- def resume_entity(
1192
- self,
1193
- project: str,
1194
- entity_type: str,
1195
- entity_id: str,
1196
- **kwargs,
1197
- ) -> None:
1198
- """
1199
- Resume a stopped entity in the backend.
1200
-
1201
- Sends a resume signal to restart execution of a previously
1202
- stopped entity such as a workflow or task.
1203
-
1204
- Parameters
1205
- ----------
1206
- project : str
1207
- The project name containing the entity.
1208
- entity_type : str
1209
- The type of entity to resume.
1210
- entity_id : str
1211
- The unique identifier of the entity to resume.
1212
- **kwargs : dict
1213
- Additional parameters to pass to the API call.
1214
-
1215
- Returns
1216
- -------
1217
- None
1218
- """
1219
- context = get_context_from_project(project)
1220
- api = context.client.build_api(
1221
- ApiCategories.CONTEXT.value,
1222
- BackendOperations.RESUME.value,
1223
- project=context.name,
1224
- entity_type=entity_type,
1225
- entity_id=entity_id,
1226
- )
1227
- context.client.create_object(api, **kwargs)
1228
-
1229
- def read_files_info(
1230
- self,
1231
- project: str,
1232
- entity_type: str,
1233
- entity_id: str,
1234
- **kwargs,
1235
- ) -> list[dict]:
1236
- """
1237
- Read file information from the backend.
1238
-
1239
- Retrieves metadata about files associated with an entity,
1240
- including file paths, sizes, and other attributes.
1241
-
1242
- Parameters
1243
- ----------
1244
- project : str
1245
- The project name containing the entity.
1246
- entity_type : str
1247
- The type of entity to get file info for.
1248
- entity_id : str
1249
- The unique identifier of the entity.
1250
- **kwargs : dict
1251
- Additional parameters to pass to the API call.
1252
-
1253
- Returns
1254
- -------
1255
- list[dict]
1256
- List of file information dictionaries from the backend.
1257
- """
1258
- context = get_context_from_project(project)
1259
- api = context.client.build_api(
1260
- ApiCategories.CONTEXT.value,
1261
- BackendOperations.FILES.value,
1262
- project=context.name,
1263
- entity_type=entity_type,
1264
- entity_id=entity_id,
1265
- )
1266
- return context.client.read_object(api, **kwargs)
1267
-
1268
- def update_files_info(
1269
- self,
1270
- project: str,
1271
- entity_type: str,
1272
- entity_id: str,
1273
- entity_list: list[dict],
1274
- **kwargs,
1275
- ) -> None:
1276
- """
1277
- Get files info from backend.
1278
-
1279
- Parameters
1280
- ----------
1281
- project : str
1282
- Project name.
1283
- entity_type : str
1284
- Entity type.
1285
- entity_id : str
1286
- Entity ID.
1287
- entity_list : list[dict]
1288
- Entity list.
1289
- **kwargs : dict
1290
- Parameters to pass to the API call.
1291
-
1292
- Returns
1293
- -------
1294
- None
1295
- """
1296
- context = get_context_from_project(project)
1297
- api = context.client.build_api(
1298
- ApiCategories.CONTEXT.value,
1299
- BackendOperations.FILES.value,
1300
- project=context.name,
1301
- entity_type=entity_type,
1302
- entity_id=entity_id,
1303
- )
1304
- return context.client.update_object(api, entity_list, **kwargs)
1305
-
1306
- def read_metrics(
1307
- self,
1308
- project: str,
1309
- entity_type: str,
1310
- entity_id: str,
1311
- metric_name: str | None = None,
1312
- **kwargs,
1313
- ) -> dict:
1314
- """
1315
- Read metrics from the backend for a specific entity.
1316
-
1317
- Retrieves metrics data associated with an entity. Can fetch either
1318
- all metrics or a specific metric by name. Used for performance
1319
- monitoring and analysis of entity operations.
1320
-
1321
- Parameters
1322
- ----------
1323
- project : str
1324
- The project name containing the entity.
1325
- entity_type : str
1326
- The type of entity to read metrics from.
1327
- entity_id : str
1328
- The unique identifier of the entity.
1329
- metric_name : str, optional
1330
- The name of a specific metric to retrieve.
1331
- If None, retrieves all available metrics.
1332
- **kwargs : dict
1333
- Additional parameters to pass to the API call.
1334
-
1335
- Returns
1336
- -------
1337
- dict
1338
- Dictionary containing metric data from the backend.
1339
- """
1340
- context = get_context_from_project(project)
1341
- api = context.client.build_api(
1342
- ApiCategories.CONTEXT.value,
1343
- BackendOperations.METRICS.value,
1344
- project=context.name,
1345
- entity_type=entity_type,
1346
- entity_id=entity_id,
1347
- metric_name=metric_name,
1348
- )
1349
- return context.client.read_object(api, **kwargs)
1350
-
1351
- def update_metric(
1352
- self,
1353
- project: str,
1354
- entity_type: str,
1355
- entity_id: str,
1356
- metric_name: str,
1357
- metric_value: Any,
1358
- **kwargs,
1359
- ) -> None:
1360
- """
1361
- Update or create a metric value for an entity in the backend.
1362
-
1363
- Updates an existing metric or creates a new one with the specified
1364
- value. Metrics are used for tracking performance, status, and
1365
- other quantitative aspects of entity operations.
1366
-
1367
- Parameters
1368
- ----------
1369
- project : str
1370
- The project name containing the entity.
1371
- entity_type : str
1372
- The type of entity to update metrics for.
1373
- entity_id : str
1374
- The unique identifier of the entity.
1375
- metric_name : str
1376
- The name of the metric to update or create.
1377
- metric_value : Any
1378
- The value to set for the metric.
1379
- Can be numeric, string, or other supported types.
1380
- **kwargs : dict
1381
- Additional parameters to pass to the API call.
1382
-
1383
- Returns
1384
- -------
1385
- None
1386
- """
1387
- context = get_context_from_project(project)
1388
- api = context.client.build_api(
1389
- ApiCategories.CONTEXT.value,
1390
- BackendOperations.METRICS.value,
1391
- project=context.name,
1392
- entity_type=entity_type,
1393
- entity_id=entity_id,
1394
- metric_name=metric_name,
1395
- )
1396
- context.client.update_object(api, metric_value, **kwargs)
1397
-
1398
- def _search(
1399
- self,
1400
- context: Context,
1401
- **kwargs,
1402
- ) -> dict:
1403
- """
1404
- Execute search query against the backend API.
1405
-
1406
- Internal method that performs the actual search operation
1407
- by building API parameters, executing the search request,
1408
- and processing the results into entity objects.
1409
-
1410
- Parameters
1411
- ----------
1412
- context : Context
1413
- The context instance containing client and project information.
1414
- **kwargs : dict
1415
- Search parameters and filters to pass to the API call.
1416
-
1417
- Returns
1418
- -------
1419
- dict
1420
- List of context entity objects matching the search criteria.
1421
- """
1422
- kwargs = context.client.build_parameters(
1423
- ApiCategories.CONTEXT.value,
1424
- BackendOperations.SEARCH.value,
1425
- **kwargs,
1426
- )
1427
- api = context.client.build_api(
1428
- ApiCategories.CONTEXT.value,
1429
- BackendOperations.SEARCH.value,
1430
- project=context.name,
1431
- )
1432
- entities_dict = context.client.read_object(api, **kwargs)
1433
- return [self.read_context_entity(entity["key"]) for entity in entities_dict["content"]]
1434
-
1435
- def search_entity(
1436
- self,
1437
- project: str,
1438
- query: str | None = None,
1439
- entity_types: list[str] | None = None,
1440
- name: str | None = None,
1441
- kind: str | None = None,
1442
- created: str | None = None,
1443
- updated: str | None = None,
1444
- description: str | None = None,
1445
- labels: list[str] | None = None,
1446
- **kwargs,
1447
- ) -> list[ContextEntity]:
1448
- """
1449
- Search for entities in the backend using various criteria.
1450
-
1451
- Performs a flexible search across multiple entity attributes,
1452
- allowing for complex queries and filtering. Returns matching
1453
- entities from the project context.
1454
-
1455
- Parameters
1456
- ----------
1457
- project : str
1458
- The project name to search within.
1459
- query : str, optional
1460
- Free-text search query to match against entity content.
1461
- entity_types : list[str], optional
1462
- List of entity types to filter by.
1463
- If None, searches all entity types.
1464
- name : str, optional
1465
- Entity name pattern to match.
1466
- kind : str, optional
1467
- Entity kind to filter by.
1468
- created : str, optional
1469
- Creation date filter (ISO format).
1470
- updated : str, optional
1471
- Last update date filter (ISO format).
1472
- description : str, optional
1473
- Description pattern to match.
1474
- labels : list[str], optional
1475
- List of label patterns to match.
1476
- **kwargs : dict
1477
- Additional search parameters to pass to the API call.
1478
-
1479
- Returns
1480
- -------
1481
- list[ContextEntity]
1482
- List of matching entity instances from the search.
1483
- """
1484
- context = get_context_from_project(project)
1485
- return self._search(
1486
- context,
1487
- query=query,
1488
- entity_types=entity_types,
1489
- name=name,
1490
- kind=kind,
1491
- created=created,
1492
- updated=updated,
1493
- description=description,
1494
- labels=labels,
1495
- **kwargs,
1496
- )
1497
-
1498
-
1499
- context_processor = ContextEntityOperationsProcessor()