digitalhub 0.8.0b0__py3-none-any.whl → 0.8.0b2__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 (159) hide show
  1. digitalhub/__init__.py +62 -94
  2. digitalhub/client/__init__.py +0 -0
  3. digitalhub/client/builder.py +105 -0
  4. digitalhub/client/objects/__init__.py +0 -0
  5. digitalhub/client/objects/base.py +56 -0
  6. digitalhub/client/objects/dhcore.py +681 -0
  7. digitalhub/client/objects/local.py +533 -0
  8. digitalhub/context/__init__.py +0 -0
  9. digitalhub/context/builder.py +178 -0
  10. digitalhub/context/context.py +136 -0
  11. digitalhub/datastores/__init__.py +0 -0
  12. digitalhub/datastores/builder.py +134 -0
  13. digitalhub/datastores/objects/__init__.py +0 -0
  14. digitalhub/datastores/objects/base.py +85 -0
  15. digitalhub/datastores/objects/local.py +42 -0
  16. digitalhub/datastores/objects/remote.py +23 -0
  17. digitalhub/datastores/objects/s3.py +38 -0
  18. digitalhub/datastores/objects/sql.py +60 -0
  19. digitalhub/entities/__init__.py +0 -0
  20. digitalhub/entities/_base/__init__.py +0 -0
  21. digitalhub/entities/_base/api.py +346 -0
  22. digitalhub/entities/_base/base.py +82 -0
  23. digitalhub/entities/_base/crud.py +610 -0
  24. digitalhub/entities/_base/entity/__init__.py +0 -0
  25. digitalhub/entities/_base/entity/base.py +132 -0
  26. digitalhub/entities/_base/entity/context.py +118 -0
  27. digitalhub/entities/_base/entity/executable.py +380 -0
  28. digitalhub/entities/_base/entity/material.py +214 -0
  29. digitalhub/entities/_base/entity/unversioned.py +87 -0
  30. digitalhub/entities/_base/entity/versioned.py +94 -0
  31. digitalhub/entities/_base/metadata.py +59 -0
  32. digitalhub/entities/_base/spec/__init__.py +0 -0
  33. digitalhub/entities/_base/spec/base.py +58 -0
  34. digitalhub/entities/_base/spec/material.py +22 -0
  35. digitalhub/entities/_base/state.py +31 -0
  36. digitalhub/entities/_base/status/__init__.py +0 -0
  37. digitalhub/entities/_base/status/base.py +32 -0
  38. digitalhub/entities/_base/status/material.py +49 -0
  39. digitalhub/entities/_builders/__init__.py +0 -0
  40. digitalhub/entities/_builders/metadata.py +60 -0
  41. digitalhub/entities/_builders/name.py +31 -0
  42. digitalhub/entities/_builders/spec.py +43 -0
  43. digitalhub/entities/_builders/status.py +62 -0
  44. digitalhub/entities/_builders/uuid.py +33 -0
  45. digitalhub/entities/artifact/__init__.py +0 -0
  46. digitalhub/entities/artifact/builder.py +133 -0
  47. digitalhub/entities/artifact/crud.py +358 -0
  48. digitalhub/entities/artifact/entity/__init__.py +0 -0
  49. digitalhub/entities/artifact/entity/_base.py +39 -0
  50. digitalhub/entities/artifact/entity/artifact.py +9 -0
  51. digitalhub/entities/artifact/spec.py +39 -0
  52. digitalhub/entities/artifact/status.py +15 -0
  53. digitalhub/entities/dataitem/__init__.py +0 -0
  54. digitalhub/entities/dataitem/builder.py +144 -0
  55. digitalhub/entities/dataitem/crud.py +395 -0
  56. digitalhub/entities/dataitem/entity/__init__.py +0 -0
  57. digitalhub/entities/dataitem/entity/_base.py +75 -0
  58. digitalhub/entities/dataitem/entity/dataitem.py +9 -0
  59. digitalhub/entities/dataitem/entity/iceberg.py +7 -0
  60. digitalhub/entities/dataitem/entity/table.py +125 -0
  61. digitalhub/entities/dataitem/models.py +62 -0
  62. digitalhub/entities/dataitem/spec.py +61 -0
  63. digitalhub/entities/dataitem/status.py +38 -0
  64. digitalhub/entities/entity_types.py +19 -0
  65. digitalhub/entities/function/__init__.py +0 -0
  66. digitalhub/entities/function/builder.py +86 -0
  67. digitalhub/entities/function/crud.py +305 -0
  68. digitalhub/entities/function/entity.py +101 -0
  69. digitalhub/entities/function/models.py +118 -0
  70. digitalhub/entities/function/spec.py +81 -0
  71. digitalhub/entities/function/status.py +9 -0
  72. digitalhub/entities/model/__init__.py +0 -0
  73. digitalhub/entities/model/builder.py +152 -0
  74. digitalhub/entities/model/crud.py +358 -0
  75. digitalhub/entities/model/entity/__init__.py +0 -0
  76. digitalhub/entities/model/entity/_base.py +34 -0
  77. digitalhub/entities/model/entity/huggingface.py +9 -0
  78. digitalhub/entities/model/entity/mlflow.py +90 -0
  79. digitalhub/entities/model/entity/model.py +9 -0
  80. digitalhub/entities/model/entity/sklearn.py +9 -0
  81. digitalhub/entities/model/models.py +26 -0
  82. digitalhub/entities/model/spec.py +146 -0
  83. digitalhub/entities/model/status.py +33 -0
  84. digitalhub/entities/project/__init__.py +0 -0
  85. digitalhub/entities/project/builder.py +82 -0
  86. digitalhub/entities/project/crud.py +350 -0
  87. digitalhub/entities/project/entity.py +2060 -0
  88. digitalhub/entities/project/spec.py +50 -0
  89. digitalhub/entities/project/status.py +9 -0
  90. digitalhub/entities/registries.py +48 -0
  91. digitalhub/entities/run/__init__.py +0 -0
  92. digitalhub/entities/run/builder.py +77 -0
  93. digitalhub/entities/run/crud.py +232 -0
  94. digitalhub/entities/run/entity.py +461 -0
  95. digitalhub/entities/run/spec.py +153 -0
  96. digitalhub/entities/run/status.py +114 -0
  97. digitalhub/entities/secret/__init__.py +0 -0
  98. digitalhub/entities/secret/builder.py +93 -0
  99. digitalhub/entities/secret/crud.py +294 -0
  100. digitalhub/entities/secret/entity.py +73 -0
  101. digitalhub/entities/secret/spec.py +35 -0
  102. digitalhub/entities/secret/status.py +9 -0
  103. digitalhub/entities/task/__init__.py +0 -0
  104. digitalhub/entities/task/builder.py +74 -0
  105. digitalhub/entities/task/crud.py +241 -0
  106. digitalhub/entities/task/entity.py +135 -0
  107. digitalhub/entities/task/models.py +199 -0
  108. digitalhub/entities/task/spec.py +51 -0
  109. digitalhub/entities/task/status.py +9 -0
  110. digitalhub/entities/utils.py +184 -0
  111. digitalhub/entities/workflow/__init__.py +0 -0
  112. digitalhub/entities/workflow/builder.py +91 -0
  113. digitalhub/entities/workflow/crud.py +304 -0
  114. digitalhub/entities/workflow/entity.py +77 -0
  115. digitalhub/entities/workflow/spec.py +15 -0
  116. digitalhub/entities/workflow/status.py +9 -0
  117. digitalhub/readers/__init__.py +0 -0
  118. digitalhub/readers/builder.py +54 -0
  119. digitalhub/readers/objects/__init__.py +0 -0
  120. digitalhub/readers/objects/base.py +70 -0
  121. digitalhub/readers/objects/pandas.py +207 -0
  122. digitalhub/readers/registry.py +15 -0
  123. digitalhub/registry/__init__.py +0 -0
  124. digitalhub/registry/models.py +87 -0
  125. digitalhub/registry/registry.py +74 -0
  126. digitalhub/registry/utils.py +150 -0
  127. digitalhub/runtimes/__init__.py +0 -0
  128. digitalhub/runtimes/base.py +164 -0
  129. digitalhub/runtimes/builder.py +53 -0
  130. digitalhub/runtimes/kind_registry.py +170 -0
  131. digitalhub/stores/__init__.py +0 -0
  132. digitalhub/stores/builder.py +257 -0
  133. digitalhub/stores/objects/__init__.py +0 -0
  134. digitalhub/stores/objects/base.py +189 -0
  135. digitalhub/stores/objects/local.py +230 -0
  136. digitalhub/stores/objects/remote.py +143 -0
  137. digitalhub/stores/objects/s3.py +563 -0
  138. digitalhub/stores/objects/sql.py +328 -0
  139. digitalhub/utils/__init__.py +0 -0
  140. digitalhub/utils/data_utils.py +127 -0
  141. digitalhub/utils/env_utils.py +123 -0
  142. digitalhub/utils/exceptions.py +55 -0
  143. digitalhub/utils/file_utils.py +204 -0
  144. digitalhub/utils/generic_utils.py +207 -0
  145. digitalhub/utils/git_utils.py +148 -0
  146. digitalhub/utils/io_utils.py +79 -0
  147. digitalhub/utils/logger.py +17 -0
  148. digitalhub/utils/uri_utils.py +56 -0
  149. {digitalhub-0.8.0b0.dist-info → digitalhub-0.8.0b2.dist-info}/METADATA +27 -12
  150. digitalhub-0.8.0b2.dist-info/RECORD +161 -0
  151. test/test_crud_artifacts.py +1 -1
  152. test/test_crud_dataitems.py +1 -1
  153. test/test_crud_functions.py +1 -1
  154. test/test_crud_runs.py +1 -1
  155. test/test_crud_tasks.py +1 -1
  156. digitalhub-0.8.0b0.dist-info/RECORD +0 -14
  157. {digitalhub-0.8.0b0.dist-info → digitalhub-0.8.0b2.dist-info}/LICENSE.txt +0 -0
  158. {digitalhub-0.8.0b0.dist-info → digitalhub-0.8.0b2.dist-info}/WHEEL +0 -0
  159. {digitalhub-0.8.0b0.dist-info → digitalhub-0.8.0b2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,610 @@
1
+ from __future__ import annotations
2
+
3
+ import typing
4
+
5
+ from digitalhub.context.builder import get_context
6
+ from digitalhub.entities._base.api import (
7
+ api_base_create,
8
+ api_base_delete,
9
+ api_base_list,
10
+ api_base_read,
11
+ api_base_update,
12
+ api_ctx_create,
13
+ api_ctx_data,
14
+ api_ctx_delete,
15
+ api_ctx_files,
16
+ api_ctx_list,
17
+ api_ctx_logs,
18
+ api_ctx_read,
19
+ api_ctx_resume,
20
+ api_ctx_stop,
21
+ api_ctx_update,
22
+ )
23
+ from digitalhub.entities.utils import parse_entity_key
24
+
25
+ if typing.TYPE_CHECKING:
26
+ from digitalhub.client.objects.base import Client
27
+
28
+
29
+ def create_entity_api_base(
30
+ client: Client,
31
+ entity_type: str,
32
+ entity_dict: dict,
33
+ **kwargs,
34
+ ) -> dict:
35
+ """
36
+ Create object in backend.
37
+
38
+ Parameters
39
+ ----------
40
+ client : Client
41
+ Client instance.
42
+ entity_type : str
43
+ Entity type.
44
+ entity_dict : dict
45
+ Object instance.
46
+ **kwargs : dict
47
+ Parameters to pass to the API call.
48
+
49
+ Returns
50
+ -------
51
+ dict
52
+ Object instance.
53
+ """
54
+ api = api_base_create(entity_type)
55
+ return client.create_object(api, entity_dict, **kwargs)
56
+
57
+
58
+ def read_entity_api_base(
59
+ client: Client,
60
+ entity_type: str,
61
+ entity_name: str,
62
+ **kwargs,
63
+ ) -> dict:
64
+ """
65
+ Read object from backend.
66
+
67
+ Parameters
68
+ ----------
69
+ client : Client
70
+ Client instance.
71
+ entity_type : str
72
+ Entity type.
73
+ entity_name : str
74
+ Entity name.
75
+ **kwargs : dict
76
+ Parameters to pass to the API call.
77
+
78
+ Returns
79
+ -------
80
+ dict
81
+ Object instance.
82
+ """
83
+ api = api_base_read(entity_type, entity_name)
84
+ return client.read_object(api, **kwargs)
85
+
86
+
87
+ def update_entity_api_base(
88
+ client: Client,
89
+ entity_type: str,
90
+ entity_name: str,
91
+ entity_dict: dict,
92
+ **kwargs,
93
+ ) -> dict:
94
+ """
95
+ Update object. Note that object spec are immutable.
96
+
97
+ Parameters
98
+ ----------
99
+ client : Client
100
+ Client instance.
101
+ entity_type : str
102
+ Entity type.
103
+ entity_name : str
104
+ Entity name.
105
+ entity_dict : dict
106
+ Object instance.
107
+ **kwargs : dict
108
+ Parameters to pass to the API call.
109
+
110
+ Returns
111
+ -------
112
+ dict
113
+ Object instance.
114
+ """
115
+ api = api_base_update(entity_type, entity_name)
116
+ return client.update_object(api, entity_dict, **kwargs)
117
+
118
+
119
+ def delete_entity_api_base(
120
+ client: Client,
121
+ entity_type: str,
122
+ entity_name: str,
123
+ **kwargs,
124
+ ) -> dict:
125
+ """
126
+ Delete object from backend.
127
+
128
+ Parameters
129
+ ----------
130
+ client : Client
131
+ Client instance.
132
+ entity_type : str
133
+ Entity type.
134
+ entity_name : str
135
+ Entity name.
136
+ **kwargs : dict
137
+ Parameters to pass to the API call.
138
+
139
+ Returns
140
+ -------
141
+ dict
142
+ Object instance.
143
+ """
144
+ if "params" not in kwargs:
145
+ kwargs["params"] = {}
146
+ if "cascade" in kwargs["params"]:
147
+ kwargs["params"]["cascade"] = str(kwargs["cascade"]).lower()
148
+ if "cascade" in kwargs:
149
+ kwargs["params"]["cascade"] = str(kwargs.pop("cascade")).lower()
150
+ api = api_base_delete(entity_type, entity_name)
151
+ return client.delete_object(api, **kwargs)
152
+
153
+
154
+ def list_entity_api_base(
155
+ client: Client,
156
+ entity_type: str,
157
+ **kwargs,
158
+ ) -> list[dict]:
159
+ """
160
+ List objects from backend.
161
+
162
+ Parameters
163
+ ----------
164
+ entity_type : str
165
+ Entity type.
166
+ **kwargs : dict
167
+ Parameters to pass to the API call.
168
+
169
+ Returns
170
+ -------
171
+ list[dict]
172
+ List of objects.
173
+ """
174
+ api = api_base_list(entity_type)
175
+ return client.list_objects(api, **kwargs)
176
+
177
+
178
+ def create_entity_api_ctx(
179
+ project: str,
180
+ entity_type: str,
181
+ entity_dict: dict,
182
+ **kwargs,
183
+ ) -> dict:
184
+ """
185
+ Create object in backend.
186
+
187
+ Parameters
188
+ ----------
189
+ project : str
190
+ Project name.
191
+ entity_type : str
192
+ Entity type.
193
+ entity_dict : dict
194
+ Object instance.
195
+ **kwargs : dict
196
+ Parameters to pass to the API call.
197
+
198
+ Returns
199
+ -------
200
+ dict
201
+ Object instance.
202
+ """
203
+ api = api_ctx_create(project, entity_type)
204
+ return get_context(project).create_object(api, entity_dict, **kwargs)
205
+
206
+
207
+ def read_entity_api_ctx(
208
+ identifier: str,
209
+ entity_type: str | None = None,
210
+ project: str | None = None,
211
+ entity_id: str | None = None,
212
+ **kwargs,
213
+ ) -> dict:
214
+ """
215
+ Get object from backend.
216
+
217
+ Parameters
218
+ ----------
219
+ identifier : str
220
+ Entity key (store://...) or entity name.
221
+ entity_type : str
222
+ Entity type.
223
+ project : str
224
+ Project name.
225
+ entity_id : str
226
+ Entity ID.
227
+ **kwargs : dict
228
+ Parameters to pass to the API call.
229
+
230
+ Returns
231
+ -------
232
+ dict
233
+ Object instance.
234
+ """
235
+
236
+ if identifier.startswith("store://"):
237
+ project, entity_type, _, _, entity_id = parse_entity_key(identifier)
238
+ api = api_ctx_read(project, entity_type, entity_id)
239
+ return get_context(project).read_object(api, **kwargs)
240
+
241
+ if project is None or entity_type is None:
242
+ raise ValueError("Project and entity type must be specified.")
243
+
244
+ if "params" not in kwargs:
245
+ kwargs["params"] = {}
246
+
247
+ if entity_id is None:
248
+ kwargs["params"]["name"] = identifier
249
+ api = api_ctx_list(project, entity_type)
250
+ return get_context(project).list_first_object(api, **kwargs)
251
+
252
+ api = api_ctx_read(project, entity_type, entity_id)
253
+ return get_context(project).read_object(api, **kwargs)
254
+
255
+
256
+ def read_entity_api_ctx_versions(
257
+ identifier: str,
258
+ entity_type: str | None = None,
259
+ project: str | None = None,
260
+ **kwargs,
261
+ ) -> list[dict]:
262
+ """
263
+ Get all versions object from backend.
264
+
265
+ Parameters
266
+ ----------
267
+ identifier : str
268
+ Entity key (store://...) or entity name.
269
+ entity_type : str
270
+ Entity type.
271
+ project : str
272
+ Project name.
273
+ **kwargs : dict
274
+ Parameters to pass to the API call.
275
+
276
+ Returns
277
+ -------
278
+ list[dict]
279
+ Object instances.
280
+ """
281
+ if not identifier.startswith("store://"):
282
+ if project is None or entity_type is None:
283
+ raise ValueError("Project and entity type must be specified.")
284
+ entity_name = identifier
285
+ else:
286
+ project, entity_type, _, entity_name, _ = parse_entity_key(identifier)
287
+
288
+ if "params" not in kwargs:
289
+ kwargs["params"] = {}
290
+ kwargs["params"]["name"] = entity_name
291
+ kwargs["params"]["versions"] = "all"
292
+
293
+ api = api_ctx_list(project, entity_type)
294
+ return get_context(project).list_objects(api, **kwargs)
295
+
296
+
297
+ def update_entity_api_ctx(
298
+ project: str,
299
+ entity_type: str,
300
+ entity_id: str,
301
+ entity_dict: dict,
302
+ **kwargs,
303
+ ) -> dict:
304
+ """
305
+ Update object. Note that object spec are immutable.
306
+
307
+ Parameters
308
+ ----------
309
+ project : str
310
+ Project name.
311
+ entity_type : str
312
+ Entity type.
313
+ entity_id : str
314
+ Entity ID.
315
+ entity_dict : dict
316
+ Entity dictionary.
317
+ **kwargs : dict
318
+ Parameters to pass to the API call.
319
+
320
+ Returns
321
+ -------
322
+ dict
323
+ Response from backend.
324
+ """
325
+ api = api_ctx_update(project, entity_type, entity_id=entity_id)
326
+ return get_context(project).update_object(api, entity_dict, **kwargs)
327
+
328
+
329
+ def delete_entity_api_ctx(
330
+ identifier: str,
331
+ entity_type: str,
332
+ project: str | None = None,
333
+ entity_id: str | None = None,
334
+ **kwargs,
335
+ ) -> dict:
336
+ """
337
+ Delete object from backend.
338
+
339
+ Parameters
340
+ ----------
341
+ identifier : str
342
+ Entity key (store://...) or entity name.
343
+ entity_type : str
344
+ Entity type.
345
+ project : str
346
+ Project name.
347
+ entity_id : str
348
+ Entity ID.
349
+ **kwargs : dict
350
+ Parameters to pass to the API call.
351
+
352
+ Returns
353
+ -------
354
+ dict
355
+ Response from backend.
356
+ """
357
+ if "params" not in kwargs:
358
+ kwargs["params"] = {}
359
+ if "cascade" in kwargs["params"]:
360
+ kwargs["params"]["cascade"] = str(kwargs["cascade"]).lower()
361
+ if "cascade" in kwargs:
362
+ kwargs["params"]["cascade"] = str(kwargs.pop("cascade")).lower()
363
+
364
+ delete_all_versions: bool = kwargs.pop("delete_all_versions", False)
365
+
366
+ if identifier.startswith("store://"):
367
+ project, _, _, _, entity_id = parse_entity_key(identifier)
368
+ api = api_ctx_delete(project, entity_type, entity_id)
369
+ return get_context(project).delete_object(api, **kwargs)
370
+
371
+ if project is None:
372
+ raise ValueError("Project must be provided.")
373
+
374
+ if entity_id is not None:
375
+ api = api_ctx_delete(project, entity_type, entity_id)
376
+ else:
377
+ kwargs["params"]["name"] = identifier
378
+ api = api_ctx_list(project, entity_type)
379
+ if delete_all_versions:
380
+ return get_context(project).delete_object(api, **kwargs)
381
+ obj = get_context(project).list_first_object(api, **kwargs)
382
+ entity_id = obj["id"]
383
+
384
+ api = api_ctx_delete(project, entity_type, entity_id)
385
+ return get_context(project).delete_object(api, **kwargs)
386
+
387
+
388
+ def list_entity_api_ctx(
389
+ project: str,
390
+ entity_type: str,
391
+ **kwargs,
392
+ ) -> list[dict]:
393
+ """
394
+ List objects from backend.
395
+
396
+ Parameters
397
+ ----------
398
+ project : str
399
+ Project name.
400
+ entity_type : str
401
+ Entity type.
402
+ **kwargs : dict
403
+ Parameters to pass to the API call.
404
+
405
+ Returns
406
+ -------
407
+ list[dict]
408
+ List of objects.
409
+ """
410
+ api = api_ctx_list(project, entity_type)
411
+ return get_context(project).list_objects(api, **kwargs)
412
+
413
+
414
+ def set_data_api(
415
+ project: str,
416
+ entity_type: str,
417
+ data: dict,
418
+ **kwargs,
419
+ ) -> None:
420
+ """
421
+ Set data in backend.
422
+
423
+ Parameters
424
+ ----------
425
+ project : str
426
+ Project name.
427
+ entity_type : str
428
+ Entity type.
429
+ data : dict
430
+ Data dictionary.
431
+ **kwargs : dict
432
+ Parameters to pass to the API call.
433
+
434
+ Returns
435
+ -------
436
+ None
437
+ """
438
+ api = api_ctx_data(project, entity_type)
439
+ get_context(project).update_object(api, data, **kwargs)
440
+
441
+
442
+ def get_data_api(
443
+ project: str,
444
+ entity_type: str,
445
+ **kwargs,
446
+ ) -> dict:
447
+ """
448
+ Read data from backend.
449
+
450
+ Parameters
451
+ ----------
452
+ project : str
453
+ Project name.
454
+ entity_type : str
455
+ Entity type.
456
+ **kwargs : dict
457
+ Parameters to pass to the API call.
458
+
459
+ Returns
460
+ -------
461
+ dict
462
+ Response from backend.
463
+ """
464
+ api = api_ctx_data(project, entity_type)
465
+ return get_context(project).read_object(api, **kwargs)
466
+
467
+
468
+ def logs_api(
469
+ project: str,
470
+ entity_type: str,
471
+ entity_id: str,
472
+ **kwargs,
473
+ ) -> dict:
474
+ """
475
+ Read logs from backend.
476
+
477
+ Parameters
478
+ ----------
479
+ project : str
480
+ Project name.
481
+ entity_type : str
482
+ Entity type.
483
+ entity_id : str
484
+ Entity ID.
485
+ **kwargs : dict
486
+ Parameters to pass to the API call.
487
+
488
+ Returns
489
+ -------
490
+ dict
491
+ Response from backend.
492
+ """
493
+ api = api_ctx_logs(project, entity_type, entity_id)
494
+ return get_context(project).read_object(api, **kwargs)
495
+
496
+
497
+ def stop_api(
498
+ project: str,
499
+ entity_type: str,
500
+ entity_id: str,
501
+ **kwargs,
502
+ ) -> None:
503
+ """
504
+ Stop object in backend.
505
+
506
+ Parameters
507
+ ----------
508
+ project : str
509
+ Project name.
510
+ entity_type : str
511
+ Entity type.
512
+ entity_id : str
513
+ Entity ID.
514
+ **kwargs : dict
515
+ Parameters to pass to the API call.
516
+
517
+ Returns
518
+ -------
519
+ None
520
+ """
521
+ api = api_ctx_stop(project, entity_type, entity_id)
522
+ get_context(project).create_object(api, obj={}, **kwargs)
523
+
524
+
525
+ def resume_api(
526
+ project: str,
527
+ entity_type: str,
528
+ entity_id: str,
529
+ **kwargs,
530
+ ) -> None:
531
+ """
532
+ Resume object in backend.
533
+
534
+ Parameters
535
+ ----------
536
+ project : str
537
+ Project name.
538
+ entity_type : str
539
+ Entity type.
540
+ entity_id : str
541
+ Entity ID.
542
+ **kwargs : dict
543
+ Parameters to pass to the API call.
544
+
545
+ Returns
546
+ -------
547
+ None
548
+ """
549
+ api = api_ctx_resume(project, entity_type, entity_id)
550
+ get_context(project).create_object(api, obj={}, **kwargs)
551
+
552
+
553
+ def files_info_get_api(
554
+ project: str,
555
+ entity_type: str,
556
+ entity_id: str,
557
+ **kwargs,
558
+ ) -> list[dict]:
559
+ """
560
+ Get files info from backend.
561
+
562
+ Parameters
563
+ ----------
564
+ project : str
565
+ Project name.
566
+ entity_type : str
567
+ Entity type.
568
+ entity_id : str
569
+ Entity ID.
570
+ **kwargs : dict
571
+ Parameters to pass to the API call.
572
+
573
+ Returns
574
+ -------
575
+ list[dict]
576
+ Response from backend.
577
+ """
578
+ api = api_ctx_files(project, entity_type, entity_id)
579
+ return get_context(project).read_object(api, **kwargs)
580
+
581
+
582
+ def files_info_put_api(
583
+ project: str,
584
+ entity_type: str,
585
+ entity_id: str,
586
+ entity_list: list[dict],
587
+ **kwargs,
588
+ ) -> None:
589
+ """
590
+ Get files info from backend.
591
+
592
+ Parameters
593
+ ----------
594
+ project : str
595
+ Project name.
596
+ entity_type : str
597
+ Entity type.
598
+ entity_id : str
599
+ Entity ID.
600
+ entity_list : list[dict]
601
+ Entity list.
602
+ **kwargs : dict
603
+ Parameters to pass to the API call.
604
+
605
+ Returns
606
+ -------
607
+ None
608
+ """
609
+ api = api_ctx_files(project, entity_type, entity_id)
610
+ get_context(project).update_object(api, entity_list, **kwargs)
File without changes