pyegeria 5.3.10__py3-none-any.whl → 5.4.0.dev3__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.
- commands/cat/debug_log.2025-06-05_20-24-18_123924.log.zip +0 -0
- commands/cat/debug_log.2025-06-10_08-45-03_929921.log.zip +0 -0
- commands/cat/debug_log.2025-06-11_09-57-21_247890.log.zip +0 -0
- commands/cat/debug_log.2025-06-12_16-14-31_212042.log.zip +0 -0
- commands/cat/debug_log.log +1267 -0
- commands/cat/dr_egeria_md.py +32 -5
- commands/cat/list_collections.py +10 -4
- commands/cat/list_data_designer.py +172 -0
- commands/cat/solution_architect_log.log +0 -0
- md_processing/__init__.py +7 -2
- md_processing/data/commands.json +4666 -848
- md_processing/dr_egeria_inbox/data_designer_search_test.md +11 -0
- md_processing/dr_egeria_inbox/data_test.md +106 -13
- md_processing/dr_egeria_inbox/data_test2.md +376 -0
- md_processing/dr_egeria_inbox/{search_test.md → glossary_search_test.md} +1 -0
- md_processing/dr_egeria_inbox/solution-components.md +66 -91
- md_processing/md_commands/data_designer_commands.py +840 -557
- md_processing/md_commands/solution_architect_commands.py +985 -0
- md_processing/md_processing_utils/common_md_proc_utils.py +262 -89
- md_processing/md_processing_utils/common_md_utils.py +11 -4
- md_processing/md_processing_utils/md_processing_constants.py +18 -16
- pyegeria/_client.py +39 -0
- pyegeria/classification_manager_omvs.py +1 -1
- pyegeria/collection_manager_omvs.py +248 -188
- pyegeria/data_designer_omvs.py +217 -9
- pyegeria/governance_officer_omvs.py +2349 -0
- pyegeria/output_formatter.py +24 -12
- pyegeria/solution_architect_omvs.py +4219 -1084
- pyegeria/utils.py +15 -2
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dev3.dist-info}/METADATA +2 -1
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dev3.dist-info}/RECORD +35 -36
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dev3.dist-info}/entry_points.txt +4 -0
- md_processing/dr_egeria_outbox/processed-2025-05-15 19:52-data_test.md +0 -94
- md_processing/dr_egeria_outbox/processed-2025-05-16 07:39-data_test.md +0 -88
- md_processing/dr_egeria_outbox/processed-2025-05-17 16:01-data_field.md +0 -56
- md_processing/dr_egeria_outbox/processed-2025-05-18 15:51-data_test.md +0 -103
- md_processing/dr_egeria_outbox/processed-2025-05-18 16:47-data_test.md +0 -94
- md_processing/dr_egeria_outbox/processed-2025-05-19 07:14-data_test.md +0 -96
- md_processing/dr_egeria_outbox/processed-2025-05-19 07:20-data_test.md +0 -100
- md_processing/dr_egeria_outbox/processed-2025-05-19 07:22-data_test.md +0 -88
- md_processing/dr_egeria_outbox/processed-2025-05-19 09:26-data_test.md +0 -91
- md_processing/dr_egeria_outbox/processed-2025-05-19 10:27-data_test.md +0 -91
- md_processing/dr_egeria_outbox/processed-2025-05-19 14:04-data_test.md +0 -91
- md_processing/md_commands/blueprint_commands.py +0 -303
- /commands/cat/{list_data_structures.py → list_data_structures_full.py} +0 -0
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dev3.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dev3.dist-info}/WHEEL +0 -0
@@ -12,18 +12,8 @@ import asyncio
|
|
12
12
|
from pyegeria._client import Client
|
13
13
|
from pyegeria._globals import NO_ELEMENTS_FOUND
|
14
14
|
from pyegeria._validators import validate_guid, validate_search_string
|
15
|
+
from pyegeria.output_formatter import (extract_mermaid_only, extract_basic_dict, generate_output)
|
15
16
|
from pyegeria.utils import body_slimmer
|
16
|
-
from pyegeria.output_formatter import (
|
17
|
-
extract_mermaid_only,
|
18
|
-
extract_basic_dict,
|
19
|
-
generate_output,
|
20
|
-
generate_entity_md,
|
21
|
-
generate_entity_md_table,
|
22
|
-
generate_entity_dict,
|
23
|
-
make_preamble,
|
24
|
-
make_md_attribute,
|
25
|
-
MD_SEPARATOR
|
26
|
-
)
|
27
17
|
|
28
18
|
|
29
19
|
class CollectionManager(Client):
|
@@ -62,7 +52,7 @@ class CollectionManager(Client):
|
|
62
52
|
# Retrieving Collections - https://egeria-project.org/concepts/collection
|
63
53
|
#
|
64
54
|
async def _async_get_attached_collections(self, parent_guid: str, start_from: int = 0,
|
65
|
-
|
55
|
+
page_size: int = None, ) -> list:
|
66
56
|
"""Returns the list of collections that are linked off of the supplied element using the ResourceList
|
67
57
|
relationship. Async version.
|
68
58
|
|
@@ -143,8 +133,8 @@ class CollectionManager(Client):
|
|
143
133
|
resp = loop.run_until_complete(self._async_get_attached_collections(parent_guid, start_from, page_size))
|
144
134
|
return resp
|
145
135
|
|
146
|
-
async def _async_get_classified_collections(self, classification: str, start_from: int = 0,
|
147
|
-
|
136
|
+
async def _async_get_classified_collections(self, classification: str, start_from: int = 0, page_size: int = None,
|
137
|
+
output_format: str = 'JSON') -> list | str | dict:
|
148
138
|
"""Returns the list of collections with a particular classification. These classifications
|
149
139
|
are typically "RootCollection", "Folder" or "DigitalProduct". Async version.
|
150
140
|
|
@@ -193,11 +183,11 @@ class CollectionManager(Client):
|
|
193
183
|
return NO_ELEMENTS_FOUND
|
194
184
|
|
195
185
|
if output_format != 'JSON': # return a simplified markdown representation
|
196
|
-
return self.generate_collection_output(elements,
|
186
|
+
return self.generate_collection_output(elements, None, classification, output_format)
|
197
187
|
return elements
|
198
188
|
|
199
|
-
def get_classified_collections(self, classification: str, start_from: int = 0,
|
200
|
-
|
189
|
+
def get_classified_collections(self, classification: str, start_from: int = 0, page_size: int = None,
|
190
|
+
output_format: str = 'JSON') -> list | str | dict:
|
201
191
|
"""Returns the list of collections with a particular classification. These classifications
|
202
192
|
are typically "RootCollection", "Folder" or "DigitalProduct".
|
203
193
|
|
@@ -231,13 +221,14 @@ class CollectionManager(Client):
|
|
231
221
|
|
232
222
|
"""
|
233
223
|
loop = asyncio.get_event_loop()
|
234
|
-
resp = loop.run_until_complete(
|
235
|
-
|
224
|
+
resp = loop.run_until_complete(
|
225
|
+
self._async_get_classified_collections(classification, start_from, page_size, output_format))
|
236
226
|
return resp
|
237
227
|
|
238
|
-
async def _async_find_collections(self, search_string: str,
|
239
|
-
|
240
|
-
|
228
|
+
async def _async_find_collections(self, search_string: str, as_of_time=None, effective_time: str = None,
|
229
|
+
starts_with: bool = False, ends_with: bool = False, ignore_case: bool = False,
|
230
|
+
start_from: int = 0, page_size: int = None, output_format: str = 'JSON',
|
231
|
+
output_profile: str = "CORE") -> list | str:
|
241
232
|
"""Returns the list of collections matching the search string.
|
242
233
|
The search string is located in the request body and is interpreted as a plain string.
|
243
234
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
@@ -246,6 +237,8 @@ class CollectionManager(Client):
|
|
246
237
|
----------
|
247
238
|
search_string: str,
|
248
239
|
Search string to use to find matching collections. If the search string is '*' then all glossaries returned.
|
240
|
+
as_of_time: str, optional, [default=None]
|
241
|
+
The point in time to use for querying the repository - ISO8601 format.
|
249
242
|
effective_time: str, [default=None], optional
|
250
243
|
Effective time of the query. If not specified will default to any time. ISO8601 format is assumed.
|
251
244
|
starts_with : bool, [default=False], optional
|
@@ -261,6 +254,8 @@ class CollectionManager(Client):
|
|
261
254
|
the class instance.
|
262
255
|
output_format: str, default = "JSON"
|
263
256
|
- one of "DICT", "MERMAID" or "JSON"
|
257
|
+
output_profile: str, optional, default = "CORE"
|
258
|
+
The desired output profile - BASIC, CORE, FULL
|
264
259
|
Returns
|
265
260
|
-------
|
266
261
|
List | str
|
@@ -277,6 +272,9 @@ class CollectionManager(Client):
|
|
277
272
|
NotAuthorizedException
|
278
273
|
The principle specified by the user_id does not have authorization for the requested action
|
279
274
|
|
275
|
+
Args:
|
276
|
+
as_of_time ():
|
277
|
+
|
280
278
|
"""
|
281
279
|
|
282
280
|
if page_size is None:
|
@@ -290,7 +288,9 @@ class CollectionManager(Client):
|
|
290
288
|
if search_string == "*":
|
291
289
|
search_string = None
|
292
290
|
|
293
|
-
body = {
|
291
|
+
body = {
|
292
|
+
"filter": search_string, "effective_time": effective_time, "asOfTime": as_of_time
|
293
|
+
}
|
294
294
|
|
295
295
|
body_s = body_slimmer(body)
|
296
296
|
url = (f"{self.collection_command_root}/"
|
@@ -303,12 +303,13 @@ class CollectionManager(Client):
|
|
303
303
|
return NO_ELEMENTS_FOUND
|
304
304
|
|
305
305
|
if output_format != 'JSON': # return a simplified markdown representation
|
306
|
-
return self.generate_collection_output(elements,
|
306
|
+
return self.generate_collection_output(elements, None, None, output_format, output_profile)
|
307
307
|
return elements
|
308
308
|
|
309
|
-
def find_collections(self, search_string: str,
|
310
|
-
|
311
|
-
|
309
|
+
def find_collections(self, search_string: str, as_of_time: str = None, effective_time: str = None,
|
310
|
+
starts_with: bool = False, ends_with: bool = False, ignore_case: bool = False,
|
311
|
+
start_from: int = 0, page_size: int = None, output_format: str = 'JSON',
|
312
|
+
output_profile: str = "CORE") -> list | str:
|
312
313
|
"""Returns the list of collections matching the search string. Async version.
|
313
314
|
The search string is located in the request body and is interpreted as a plain string.
|
314
315
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
@@ -317,6 +318,8 @@ class CollectionManager(Client):
|
|
317
318
|
----------
|
318
319
|
search_string: str,
|
319
320
|
Search string to use to find matching collections. If the search string is '*' then all glossaries returned.
|
321
|
+
as_of_time: str, optional, [default=None]
|
322
|
+
The point in time to use for querying the repository - ISO8601 format.
|
320
323
|
effective_time: str, [default=None], optional
|
321
324
|
Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
|
322
325
|
starts_with : bool, [default=False], optional
|
@@ -332,6 +335,8 @@ class CollectionManager(Client):
|
|
332
335
|
the class instance.
|
333
336
|
output_format: str, default = "JSON"
|
334
337
|
- one of "DICT", "MERMAID" or "JSON"
|
338
|
+
output_profile: str, optional, default = "CORE"
|
339
|
+
The desired output profile - BASIC, CORE, FULL
|
335
340
|
Returns
|
336
341
|
-------
|
337
342
|
List | str
|
@@ -351,13 +356,13 @@ class CollectionManager(Client):
|
|
351
356
|
"""
|
352
357
|
loop = asyncio.get_event_loop()
|
353
358
|
resp = loop.run_until_complete(
|
354
|
-
self._async_find_collections(search_string, effective_time, starts_with, ends_with, ignore_case,
|
355
|
-
|
359
|
+
self._async_find_collections(search_string, as_of_time, effective_time, starts_with, ends_with, ignore_case,
|
360
|
+
start_from, page_size, output_format, output_profile))
|
356
361
|
|
357
362
|
return resp
|
358
363
|
|
359
364
|
async def _async_get_collections_by_name(self, name: str, effective_time: str = None, start_from: int = 0,
|
360
|
-
|
365
|
+
page_size: int = None, output_format: str = 'JSON') -> list | str:
|
361
366
|
"""Returns the list of collections with a particular name.
|
362
367
|
|
363
368
|
Parameters
|
@@ -416,7 +421,7 @@ class CollectionManager(Client):
|
|
416
421
|
return elements
|
417
422
|
|
418
423
|
def get_collections_by_name(self, name: str, effective_time: str = None, start_from: int = 0, page_size: int = None,
|
419
|
-
|
424
|
+
output_format: str = 'JSON') -> list | str:
|
420
425
|
"""Returns the list of collections matching the search string. Async version.
|
421
426
|
The search string is located in the request body and is interpreted as a plain string.
|
422
427
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
@@ -459,7 +464,8 @@ class CollectionManager(Client):
|
|
459
464
|
return resp
|
460
465
|
|
461
466
|
async def _async_get_collections_by_type(self, collection_type: str, effective_time: str = None,
|
462
|
-
|
467
|
+
start_from: int = 0, page_size: int = None,
|
468
|
+
output_format: str = 'JSON') -> list | str:
|
463
469
|
"""Returns the list of collections with a particular collectionType. This is an optional text field in the
|
464
470
|
collection element.
|
465
471
|
|
@@ -518,7 +524,7 @@ class CollectionManager(Client):
|
|
518
524
|
return elements
|
519
525
|
|
520
526
|
def get_collections_by_type(self, collection_type: str, effective_time: str = None, start_from: int = 0,
|
521
|
-
|
527
|
+
page_size: int = None, output_format: str = 'JSON') -> list | str:
|
522
528
|
"""Returns the list of collections matching the search string. Async version.
|
523
529
|
The search string is located in the request body and is interpreted as a plain string.
|
524
530
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
@@ -561,7 +567,7 @@ class CollectionManager(Client):
|
|
561
567
|
return resp
|
562
568
|
|
563
569
|
async def _async_get_collection_by_guid(self, collection_guid: str, effective_time: str = None,
|
564
|
-
|
570
|
+
collection_type: str = None, output_format: str = 'JSON') -> dict | str:
|
565
571
|
"""Return the properties of a specific collection. Async version.
|
566
572
|
|
567
573
|
Parameters
|
@@ -570,6 +576,8 @@ class CollectionManager(Client):
|
|
570
576
|
unique identifier of the collection.
|
571
577
|
effective_time: str, [default=None], optional
|
572
578
|
Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
|
579
|
+
collection_type: str, default = None, optional
|
580
|
+
type of collection - Data Dictionary, Data Spec, Data Product, etc.
|
573
581
|
output_format: str, default = "JSON"
|
574
582
|
- one of "DICT", "MERMAID" or "JSON"
|
575
583
|
|
@@ -603,11 +611,11 @@ class CollectionManager(Client):
|
|
603
611
|
return NO_ELEMENTS_FOUND
|
604
612
|
|
605
613
|
if output_format != 'JSON': # return a simplified markdown representation
|
606
|
-
return self.generate_collection_output(elements,
|
614
|
+
return self.generate_collection_output(elements, None, collection_type, output_format)
|
607
615
|
return elements
|
608
616
|
|
609
|
-
def get_collection_by_guid(self, collection_guid: str, effective_time: str = None,
|
610
|
-
|
617
|
+
def get_collection_by_guid(self, collection_guid: str, effective_time: str = None, collection_type: str = None,
|
618
|
+
output_format: str = 'JSON') -> dict | str:
|
611
619
|
"""Return the properties of a specific collection.
|
612
620
|
|
613
621
|
Parameters
|
@@ -616,6 +624,8 @@ class CollectionManager(Client):
|
|
616
624
|
unique identifier of the collection.
|
617
625
|
effective_time: str, [default=None], optional
|
618
626
|
Effective time of the query. If not specified will default to any time.
|
627
|
+
collection_type: str, default = None, optional
|
628
|
+
type of collection - Data Dictionary, Data Spec, Data Product, etc.
|
619
629
|
output_format: str, default = "JSON"
|
620
630
|
- one of "DICT", "MERMAID" or "JSON"
|
621
631
|
|
@@ -638,7 +648,7 @@ class CollectionManager(Client):
|
|
638
648
|
"""
|
639
649
|
loop = asyncio.get_event_loop()
|
640
650
|
resp = loop.run_until_complete(
|
641
|
-
self._async_get_collection_by_guid(collection_guid, effective_time, output_format))
|
651
|
+
self._async_get_collection_by_guid(collection_guid, effective_time, collection_type, output_format))
|
642
652
|
|
643
653
|
return resp
|
644
654
|
|
@@ -796,9 +806,11 @@ class CollectionManager(Client):
|
|
796
806
|
return resp
|
797
807
|
|
798
808
|
async def _async_create_collection(self, classification_name: str, anchor_guid: str, parent_guid: str,
|
799
|
-
|
800
|
-
|
801
|
-
|
809
|
+
parent_relationship_type_name: str, parent_at_end1: bool, display_name: str,
|
810
|
+
description: str, collection_type: str, anchor_scope_guid: str = None,
|
811
|
+
is_own_anchor: bool = False, collection_ordering: str = None,
|
812
|
+
order_property_name: str = None, additional_properties: dict = None,
|
813
|
+
extended_properties: dict = None) -> str:
|
802
814
|
"""Create Collections: https://egeria-project.org/concepts/collection Async version.
|
803
815
|
|
804
816
|
Parameters
|
@@ -832,6 +844,10 @@ class CollectionManager(Client):
|
|
832
844
|
"OTHER"
|
833
845
|
order_property_name: str, optional, defaults to "Something"
|
834
846
|
Property to use for sequencing if collection_ordering is "OTHER"
|
847
|
+
additional_properties: dict, optional, defaults to None
|
848
|
+
User specified Additional properties to add to the collection definition.
|
849
|
+
extended_properties: dict, optional, defaults to None
|
850
|
+
Properties defined by extensions to Egeria types to add to the collection definition.
|
835
851
|
|
836
852
|
|
837
853
|
Returns
|
@@ -866,6 +882,7 @@ class CollectionManager(Client):
|
|
866
882
|
"class": "CollectionProperties", "qualifiedName": f"{classification_name}::{display_name}",
|
867
883
|
"name": display_name, "description": description, "collectionType": collection_type,
|
868
884
|
"collectionOrdering": collection_ordering, "orderPropertyName": order_property_name,
|
885
|
+
"additionalProperties": additional_properties, "extendedProperties": extended_properties
|
869
886
|
},
|
870
887
|
}
|
871
888
|
|
@@ -873,9 +890,10 @@ class CollectionManager(Client):
|
|
873
890
|
return resp.json().get("guid", "No GUID returned")
|
874
891
|
|
875
892
|
def create_collection(self, classification_name: str, anchor_guid: str, parent_guid: str,
|
876
|
-
|
877
|
-
|
878
|
-
|
893
|
+
parent_relationship_type_name: str, parent_at_end1: bool, display_name: str, description: str,
|
894
|
+
collection_type: str, anchor_scope_guid: str = None, is_own_anchor: bool = False,
|
895
|
+
collection_ordering: str = None, order_property_name: str = None,
|
896
|
+
additional_properties: dict = None, extended_properties: dict = None) -> str:
|
879
897
|
"""Create Collections: https://egeria-project.org/concepts/collection
|
880
898
|
|
881
899
|
Parameters
|
@@ -910,6 +928,10 @@ class CollectionManager(Client):
|
|
910
928
|
"DATE_CREATED", "OTHER"
|
911
929
|
order_property_name: str, optional, defaults to "Something"
|
912
930
|
Property to use for sequencing if collection_ordering is "OTHER"
|
931
|
+
additional_properties: dict, optional, defaults to None
|
932
|
+
User specified Additional properties to add to the collection definition.
|
933
|
+
extended_properties: dict, optional, defaults to None
|
934
|
+
Properties defined by extensions to Egeria types to add to the collection definition.
|
913
935
|
|
914
936
|
|
915
937
|
Returns
|
@@ -929,13 +951,16 @@ class CollectionManager(Client):
|
|
929
951
|
loop = asyncio.get_event_loop()
|
930
952
|
resp = loop.run_until_complete(
|
931
953
|
self._async_create_collection(classification_name, anchor_guid, parent_guid, parent_relationship_type_name,
|
932
|
-
|
933
|
-
|
954
|
+
parent_at_end1, display_name, description, collection_type, anchor_scope_guid,
|
955
|
+
is_own_anchor, collection_ordering, order_property_name,
|
956
|
+
additional_properties, extended_properties))
|
934
957
|
return resp
|
935
958
|
|
936
959
|
async def _async_create_root_collection(self, anchor_guid: str, parent_guid: str,
|
937
|
-
|
938
|
-
|
960
|
+
parent_relationship_type_name: str, parent_at_end1: bool, display_name: str,
|
961
|
+
description: str, collection_type: str, anchor_scope_guid: str = None,
|
962
|
+
is_own_anchor: bool = False, additional_properties: dict = None,
|
963
|
+
extended_properties: dict = None) -> str:
|
939
964
|
"""Create a new collection with the RootCollection classification. Used to identify the top of a
|
940
965
|
collection hierarchy. Async version.
|
941
966
|
|
@@ -962,6 +987,10 @@ class CollectionManager(Client):
|
|
962
987
|
optional GUID of search scope
|
963
988
|
is_own_anchor: bool, optional, defaults to False
|
964
989
|
Indicates if the collection should be classified as its own anchor or not.
|
990
|
+
additional_properties: dict, optional, defaults to None
|
991
|
+
User specified Additional properties to add to the collection definition.
|
992
|
+
extended_properties: dict, optional, defaults to None
|
993
|
+
Properties defined by extensions to Egeria types to add to the collection definition.
|
965
994
|
|
966
995
|
Returns
|
967
996
|
-------
|
@@ -978,25 +1007,25 @@ class CollectionManager(Client):
|
|
978
1007
|
|
979
1008
|
"""
|
980
1009
|
|
981
|
-
is_own_anchor_s = str(is_own_anchor).lower()
|
982
|
-
parent_at_end1_s = str(parent_at_end1).lower()
|
983
1010
|
url = f"{self.collection_command_root}/root-collection"
|
984
1011
|
|
985
|
-
body = {
|
986
|
-
"anchorGUID": anchor_guid, "isOwnAnchor":
|
1012
|
+
body = body_slimmer({
|
1013
|
+
"anchorGUID": anchor_guid, "isOwnAnchor": is_own_anchor, "anchorScopeGUID": anchor_scope_guid,
|
987
1014
|
"parentGUID": parent_guid, "parentRelationshipTypeName": parent_relationship_type_name,
|
988
|
-
"parentAtEnd1":
|
989
|
-
"class": "CollectionProperties", "qualifiedName": f"
|
1015
|
+
"parentAtEnd1": parent_at_end1, "collectionProperties": {
|
1016
|
+
"class": "CollectionProperties", "qualifiedName": f"RootCollection::{display_name}",
|
990
1017
|
"name": display_name, "description": description, "collectionType": collection_type,
|
1018
|
+
"additionalProperties": additional_properties, "extendedProperties": extended_properties
|
991
1019
|
},
|
992
|
-
}
|
1020
|
+
})
|
993
1021
|
|
994
|
-
resp = await self._async_make_request("POST", url,
|
1022
|
+
resp = await self._async_make_request("POST", url, body)
|
995
1023
|
return resp.json().get("guid", "No GUID Returned")
|
996
1024
|
|
997
1025
|
def create_root_collection(self, anchor_guid: str, parent_guid: str, parent_relationship_type_name: str,
|
998
|
-
|
999
|
-
|
1026
|
+
parent_at_end1: bool, display_name: str, description: str, collection_type: str,
|
1027
|
+
anchor_scope_guid: str = None, is_own_anchor: bool = False,
|
1028
|
+
additional_properties: dict = None, extended_properties: dict = None) -> str:
|
1000
1029
|
"""Create a new collection with the RootCollection classification. Used to identify the top of a
|
1001
1030
|
collection hierarchy.
|
1002
1031
|
|
@@ -1024,6 +1053,10 @@ class CollectionManager(Client):
|
|
1024
1053
|
optional GUID of search scope
|
1025
1054
|
is_own_anchor: bool, optional, defaults to False
|
1026
1055
|
Indicates if the collection should be classified as its own anchor or not.
|
1056
|
+
additional_properties: dict, optional, defaults to None
|
1057
|
+
User specified Additional properties to add to the collection definition.
|
1058
|
+
extended_properties: dict, optional, defaults to None
|
1059
|
+
Properties defined by extensions to Egeria types to add to the collection definition.
|
1027
1060
|
|
1028
1061
|
Returns
|
1029
1062
|
-------
|
@@ -1042,14 +1075,16 @@ class CollectionManager(Client):
|
|
1042
1075
|
loop = asyncio.get_event_loop()
|
1043
1076
|
resp = loop.run_until_complete(
|
1044
1077
|
self._async_create_root_collection(anchor_guid, parent_guid, parent_relationship_type_name, parent_at_end1,
|
1045
|
-
|
1078
|
+
display_name, description, collection_type, anchor_scope_guid,
|
1079
|
+
is_own_anchor, additional_properties, extended_properties))
|
1046
1080
|
return resp
|
1047
1081
|
|
1048
1082
|
async def _async_create_data_spec_collection(self, anchor_guid: str, parent_guid: str,
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1083
|
+
parent_relationship_type_name: str, parent_at_end1: bool,
|
1084
|
+
display_name: str, description: str, collection_type: str,
|
1085
|
+
anchor_scope_guid: str = None, is_own_anchor: bool = True,
|
1086
|
+
qualified_name: str = None, additional_properties: dict = None,
|
1087
|
+
extended_properties: dict = None) -> str:
|
1053
1088
|
"""Create a new collection with the DataSpec classification. Used to identify a collection of data fields
|
1054
1089
|
and schema types. Async version.
|
1055
1090
|
|
@@ -1076,13 +1111,12 @@ class CollectionManager(Client):
|
|
1076
1111
|
optional GUID of search scope
|
1077
1112
|
is_own_anchor: bool, optional, defaults to False
|
1078
1113
|
Indicates if the collection should be classified as its own anchor or not.
|
1079
|
-
collection_ordering: str, optional, defaults to "OTHER"
|
1080
|
-
Specifies the sequencing to use in a collection. Examples include "NAME", "OWNER",
|
1081
|
-
"DATE_CREATED", "OTHER"
|
1082
|
-
order_property_name: str, optional, defaults to "Something"
|
1083
|
-
Property to use for sequencing if collection_ordering is "OTHER"
|
1084
1114
|
qualified_name: str, optional, defaults to None
|
1085
1115
|
If not specified, a unique name will be created for the collection.
|
1116
|
+
additional_properties: dict, optional, defaults to None
|
1117
|
+
User specified Additional properties to add to the collection definition.
|
1118
|
+
extended_properties: dict, optional, defaults to None
|
1119
|
+
Properties defined by extensions to Egeria types to add to the collection definition.
|
1086
1120
|
|
1087
1121
|
Returns
|
1088
1122
|
-------
|
@@ -1099,29 +1133,28 @@ class CollectionManager(Client):
|
|
1099
1133
|
The principle specified by the user_id does not have authorization for the requested action
|
1100
1134
|
"""
|
1101
1135
|
|
1102
|
-
is_own_anchor_s = str(is_own_anchor).lower()
|
1103
|
-
parent_at_end1_s = str(parent_at_end1).lower()
|
1104
1136
|
url = f"{self.collection_command_root}/data-spec-collection"
|
1105
1137
|
if qualified_name is None:
|
1106
1138
|
qualified_name = self.__create_qualified_name__("DataSpec", display_name)
|
1107
1139
|
|
1108
|
-
body = {
|
1109
|
-
"anchorGUID": anchor_guid, "anchorScopeGUID": anchor_scope_guid, "isOwnAnchor":
|
1140
|
+
body = body_slimmer({
|
1141
|
+
"anchorGUID": anchor_guid, "anchorScopeGUID": anchor_scope_guid, "isOwnAnchor": is_own_anchor,
|
1110
1142
|
"parentGUID": parent_guid, "parentRelationshipTypeName": parent_relationship_type_name,
|
1111
|
-
"parentAtEnd1":
|
1143
|
+
"parentAtEnd1": parent_at_end1, "collectionProperties": {
|
1112
1144
|
"class": "CollectionProperties", "qualifiedName": qualified_name, "name": display_name,
|
1113
1145
|
"description": description, "collectionType": collection_type,
|
1114
|
-
"
|
1146
|
+
"additionalProperties": additional_properties, "extendedProperties": extended_properties
|
1115
1147
|
},
|
1116
|
-
}
|
1148
|
+
})
|
1117
1149
|
|
1118
|
-
resp = await self._async_make_request("POST", url,
|
1150
|
+
resp = await self._async_make_request("POST", url, body)
|
1119
1151
|
return resp.json().get("guid", "No GUID Returned")
|
1120
1152
|
|
1121
1153
|
def create_data_spec_collection(self, anchor_guid: str, parent_guid: str, parent_relationship_type_name: str,
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1154
|
+
parent_at_end1: bool, display_name: str, description: str, collection_type: str,
|
1155
|
+
anchor_scope_guid: str = None, is_own_anchor: bool = False,
|
1156
|
+
qualified_name: str = None, additional_properties: dict = None,
|
1157
|
+
extended_properties: dict = None) -> str:
|
1125
1158
|
"""Create a new collection with the DataSpec classification. Used to identify a collection of data fields
|
1126
1159
|
and schema types.
|
1127
1160
|
|
@@ -1148,12 +1181,12 @@ class CollectionManager(Client):
|
|
1148
1181
|
optional GUID of search scope
|
1149
1182
|
is_own_anchor: bool, optional, defaults to False
|
1150
1183
|
Indicates if the collection should be classified as its own anchor or not.
|
1151
|
-
collection_ordering: str, optional, defaults to "OTHER"
|
1152
|
-
Specifies the sequencing to use in a collection. Examples include "NAME", "OWNER", "DATE_CREATED", "OTHER"
|
1153
|
-
order_property_name: str, optional, defaults to "Something"
|
1154
|
-
Property to use for sequencing if collection_ordering is "OTHER"
|
1155
1184
|
qualified_name: str, optional, defaults to None
|
1156
1185
|
If not specified, a unique name will be created for the collection.
|
1186
|
+
additional_properties: dict, optional, defaults to None
|
1187
|
+
User specified Additional properties to add to the collection definition.
|
1188
|
+
extended_properties: dict, optional, defaults to None
|
1189
|
+
Properties defined by extensions to Egeria types to add to the collection definition.
|
1157
1190
|
|
1158
1191
|
Returns
|
1159
1192
|
-------
|
@@ -1172,15 +1205,17 @@ class CollectionManager(Client):
|
|
1172
1205
|
loop = asyncio.get_event_loop()
|
1173
1206
|
resp = loop.run_until_complete(
|
1174
1207
|
self._async_create_data_spec_collection(anchor_guid, parent_guid, parent_relationship_type_name,
|
1175
|
-
|
1176
|
-
|
1208
|
+
parent_at_end1, display_name, description, collection_type,
|
1209
|
+
anchor_scope_guid, is_own_anchor, qualified_name,
|
1210
|
+
additional_properties, extended_properties))
|
1177
1211
|
return resp
|
1178
1212
|
|
1179
1213
|
async def _async_create_data_dictionary_collection(self, anchor_guid: str, parent_guid: str,
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1214
|
+
parent_relationship_type_name: str, parent_at_end1: bool,
|
1215
|
+
display_name: str, description: str, collection_type: str,
|
1216
|
+
anchor_scope_guid: str = None, is_own_anchor: bool = True,
|
1217
|
+
qualified_name: str = None, additional_properties: dict = None,
|
1218
|
+
extended_properties: dict = None) -> str:
|
1184
1219
|
""" Create a new collection with the Data Dictionary classification. Used to identify a collection of
|
1185
1220
|
data fields that represent a data store collection of common data types. Async version.
|
1186
1221
|
|
@@ -1214,6 +1249,11 @@ class CollectionManager(Client):
|
|
1214
1249
|
Property to use for sequencing if collection_ordering is "OTHER"
|
1215
1250
|
qualified_name: str, optional, defaults to None
|
1216
1251
|
If not specified a qualified name will be generated from the display name and the collection type.
|
1252
|
+
additional_properties: dict, optional, defaults to None
|
1253
|
+
User specified Additional properties to add to the collection definition.
|
1254
|
+
extended_properties: dict, optional, defaults to None
|
1255
|
+
Properties defined by extensions to Egeria types to add to the collection definition.
|
1256
|
+
|
1217
1257
|
Returns
|
1218
1258
|
-------
|
1219
1259
|
str - the guid of the created collection
|
@@ -1241,7 +1281,7 @@ class CollectionManager(Client):
|
|
1241
1281
|
"parentAtEnd1": parent_at_end1_s, "collectionProperties": {
|
1242
1282
|
"class": "CollectionProperties", "qualifiedName": qualified_name, "name": display_name,
|
1243
1283
|
"description": description, "collectionType": collection_type,
|
1244
|
-
"
|
1284
|
+
"additionalProperties": additional_properties, "extendedProperties": extended_properties,
|
1245
1285
|
},
|
1246
1286
|
}
|
1247
1287
|
|
@@ -1249,9 +1289,10 @@ class CollectionManager(Client):
|
|
1249
1289
|
return resp.json().get("guid", "No GUID Returned")
|
1250
1290
|
|
1251
1291
|
def create_data_dictionary_collection(self, anchor_guid: str, parent_guid: str, parent_relationship_type_name: str,
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1292
|
+
parent_at_end1: bool, display_name: str, description: str,
|
1293
|
+
collection_type: str, anchor_scope_guid: str = None,
|
1294
|
+
is_own_anchor: bool = False, qualified_name: str = None,
|
1295
|
+
additional_properties: dict = None, extended_properties: dict = None) -> str:
|
1255
1296
|
"""Create a new collection with the DataSpec classification. Used to identify a collection of data fields
|
1256
1297
|
and schema types.
|
1257
1298
|
|
@@ -1284,6 +1325,10 @@ class CollectionManager(Client):
|
|
1284
1325
|
Property to use for sequencing if collection_ordering is "OTHER"
|
1285
1326
|
qualified_name: str, optional, defaults to None
|
1286
1327
|
If not specified a qualified name will be generated from the display name and the collection type.
|
1328
|
+
additional_properties: dict, optional, defaults to None
|
1329
|
+
User specified Additional properties to add to the collection definition.
|
1330
|
+
extended_properties: dict, optional, defaults to None
|
1331
|
+
Properties defined by extensions to Egeria types to add to the collection definition.
|
1287
1332
|
|
1288
1333
|
Returns
|
1289
1334
|
-------
|
@@ -1302,14 +1347,18 @@ class CollectionManager(Client):
|
|
1302
1347
|
loop = asyncio.get_event_loop()
|
1303
1348
|
resp = loop.run_until_complete(
|
1304
1349
|
self._async_create_data_dictionary_collection(anchor_guid, parent_guid, parent_relationship_type_name,
|
1305
|
-
|
1306
|
-
|
1350
|
+
parent_at_end1, display_name, description, collection_type,
|
1351
|
+
anchor_scope_guid, is_own_anchor, qualified_name,
|
1352
|
+
additional_properties, extended_properties))
|
1307
1353
|
return resp
|
1308
1354
|
|
1309
1355
|
async def _async_create_folder_collection(self, anchor_guid: str, parent_guid: str,
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1356
|
+
parent_relationship_type_name: str, parent_at_end1: bool,
|
1357
|
+
display_name: str, description: str, collection_type: str,
|
1358
|
+
anchor_scope_guid: str = None, is_own_anchor: bool = True,
|
1359
|
+
collection_ordering: str = None, order_property_name: str = None,
|
1360
|
+
additional_properties: dict = None,
|
1361
|
+
extended_properties: dict = None) -> str:
|
1313
1362
|
"""Create a new collection with the Folder classification. This is used to identify the organizing
|
1314
1363
|
collections in a collection hierarchy. Async version.
|
1315
1364
|
|
@@ -1341,6 +1390,10 @@ class CollectionManager(Client):
|
|
1341
1390
|
"DATE_CREATED", "OTHER"
|
1342
1391
|
order_property_name: str, optional, defaults to "Something"
|
1343
1392
|
Property to use for sequencing if collection_ordering is "OTHER"
|
1393
|
+
additional_properties: dict, optional, defaults to None
|
1394
|
+
User specified Additional properties to add to the collection definition.
|
1395
|
+
extended_properties: dict, optional, defaults to None
|
1396
|
+
Properties defined by extensions to Egeria types to add to the collection definition.
|
1344
1397
|
|
1345
1398
|
Returns
|
1346
1399
|
-------
|
@@ -1368,6 +1421,7 @@ class CollectionManager(Client):
|
|
1368
1421
|
"class": "CollectionProperties", "qualifiedName": f"folder-collection::{display_name}",
|
1369
1422
|
"name": display_name, "description": description, "collectionType": collection_type,
|
1370
1423
|
"collectionOrdering": collection_ordering, "orderPropertyName": order_property_name,
|
1424
|
+
"additionalProperties": additional_properties, "extendedProperties": extended_properties
|
1371
1425
|
},
|
1372
1426
|
}
|
1373
1427
|
|
@@ -1375,9 +1429,10 @@ class CollectionManager(Client):
|
|
1375
1429
|
return resp.json().get("guid", "No GUID returned")
|
1376
1430
|
|
1377
1431
|
def create_folder_collection(self, anchor_guid: str, parent_guid: str, parent_relationship_type_name: str,
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1432
|
+
parent_at_end1: bool, display_name: str, description: str, collection_type: str,
|
1433
|
+
anchor_scope_guid: str = None, is_own_anchor: bool = True,
|
1434
|
+
collection_ordering: str = None, order_property_name: str = None,
|
1435
|
+
additional_properties: dict = None, extended_properties: dict = None) -> str:
|
1381
1436
|
"""Create a new collection with the Folder classification. This is used to identify the organizing
|
1382
1437
|
collections in a collection hierarchy.
|
1383
1438
|
|
@@ -1409,6 +1464,10 @@ class CollectionManager(Client):
|
|
1409
1464
|
"OTHER"
|
1410
1465
|
order_property_name: str, optional, defaults to "Something"
|
1411
1466
|
Property to use for sequencing if collection_ordering is "OTHER"
|
1467
|
+
additional_properties: dict, optional, defaults to None
|
1468
|
+
User specified Additional properties to add to the collection definition.
|
1469
|
+
extended_properties: dict, optional, defaults to None
|
1470
|
+
Properties defined by extensions to Egeria types to add to the collection definition.
|
1412
1471
|
|
1413
1472
|
Returns
|
1414
1473
|
-------
|
@@ -1428,8 +1487,9 @@ class CollectionManager(Client):
|
|
1428
1487
|
loop = asyncio.get_event_loop()
|
1429
1488
|
resp = loop.run_until_complete(
|
1430
1489
|
self._async_create_folder_collection(anchor_guid, parent_guid, parent_relationship_type_name,
|
1431
|
-
|
1432
|
-
|
1490
|
+
parent_at_end1, display_name, description, collection_type,
|
1491
|
+
anchor_scope_guid, is_own_anchor, collection_ordering,
|
1492
|
+
order_property_name, additional_properties, extended_properties))
|
1433
1493
|
return resp
|
1434
1494
|
|
1435
1495
|
async def _async_create_collection_from_template(self, body: dict) -> str:
|
@@ -1685,8 +1745,10 @@ class CollectionManager(Client):
|
|
1685
1745
|
# Manage collections
|
1686
1746
|
#
|
1687
1747
|
async def _async_update_collection(self, collection_guid: str, qualified_name: str = None, display_name: str = None,
|
1688
|
-
|
1689
|
-
|
1748
|
+
description: str = None, collection_type: str = None,
|
1749
|
+
collection_ordering: str = None, order_property_name: str = None,
|
1750
|
+
replace_all_props: bool = False, additional_properties: dict = None,
|
1751
|
+
extended_properties: dict = None) -> None:
|
1690
1752
|
"""Update the properties of a collection. Async version.
|
1691
1753
|
|
1692
1754
|
Parameters
|
@@ -1708,9 +1770,11 @@ class CollectionManager(Client):
|
|
1708
1770
|
Property to use for sequencing if collection_ordering is "OTHER"
|
1709
1771
|
replace_all_props: bool, optional, defaults to False
|
1710
1772
|
Whether to replace all properties in the collection.
|
1773
|
+
additional_properties: dict, optional, defaults to None
|
1774
|
+
User specified Additional properties to add to the collection definition.
|
1775
|
+
extended_properties: dict, optional, defaults to None
|
1776
|
+
Properties defined by extensions to Egeria types to add to the collection definition.
|
1711
1777
|
|
1712
|
-
If not provided, the server name associated
|
1713
|
-
with the instance is used.
|
1714
1778
|
|
1715
1779
|
Returns
|
1716
1780
|
-------
|
@@ -1733,15 +1797,17 @@ class CollectionManager(Client):
|
|
1733
1797
|
body = {
|
1734
1798
|
"class": "CollectionProperties", "qualifiedName": qualified_name, "name": display_name,
|
1735
1799
|
"description": description, "collectionType": collection_type, "collectionOrdering": collection_ordering,
|
1736
|
-
"orderPropertyName": order_property_name,
|
1800
|
+
"orderPropertyName": order_property_name, "additionalProperties": additional_properties,
|
1801
|
+
"extendedProperties": extended_properties
|
1737
1802
|
}
|
1738
1803
|
body_s = body_slimmer(body)
|
1739
1804
|
await self._async_make_request("POST", url, body_s)
|
1740
1805
|
return
|
1741
1806
|
|
1742
1807
|
def update_collection(self, collection_guid, qualified_name: str = None, display_name: str = None,
|
1743
|
-
|
1744
|
-
|
1808
|
+
description: str = None, collection_type: str = None, collection_ordering: str = None,
|
1809
|
+
order_property_name: str = None, replace_all_props: bool = False,
|
1810
|
+
additional_properties: dict = None, extended_properties: dict = None) -> None:
|
1745
1811
|
"""Update the properties of a collection.
|
1746
1812
|
|
1747
1813
|
Parameters
|
@@ -1763,9 +1829,11 @@ class CollectionManager(Client):
|
|
1763
1829
|
Property to use for sequencing if collection_ordering is "OTHER"
|
1764
1830
|
replace_all_props: bool, optional, defaults to False
|
1765
1831
|
Whether to replace all properties in the collection.
|
1832
|
+
additional_properties: dict, optional, defaults to None
|
1833
|
+
User specified Additional properties to add to the collection definition.
|
1834
|
+
extended_properties: dict, optional, defaults to None
|
1835
|
+
Properties defined by extensions to Egeria types to add to the collection definition.
|
1766
1836
|
|
1767
|
-
If not provided, the server name associated
|
1768
|
-
with the instance is used.
|
1769
1837
|
|
1770
1838
|
Returns
|
1771
1839
|
-------
|
@@ -1783,7 +1851,8 @@ class CollectionManager(Client):
|
|
1783
1851
|
loop = asyncio.get_event_loop()
|
1784
1852
|
loop.run_until_complete(
|
1785
1853
|
self._async_update_collection(collection_guid, qualified_name, display_name, description, collection_type,
|
1786
|
-
|
1854
|
+
collection_ordering, order_property_name, replace_all_props,
|
1855
|
+
additional_properties, extended_properties))
|
1787
1856
|
return
|
1788
1857
|
|
1789
1858
|
async def _async_update_digital_product(self, collection_guid: str, body: dict, replace_all_props: bool = False, ):
|
@@ -1893,8 +1962,8 @@ class CollectionManager(Client):
|
|
1893
1962
|
return
|
1894
1963
|
|
1895
1964
|
async def _async_attach_collection(self, collection_guid: str, element_guid: str, resource_use: str,
|
1896
|
-
|
1897
|
-
|
1965
|
+
resource_use_description: str = None, resource_use_props: dict = None,
|
1966
|
+
watch_resources: bool = False, make_anchor: bool = False, ) -> None:
|
1898
1967
|
""" Connect an existing collection to an element using the ResourceList relationship (0019). Async version.
|
1899
1968
|
Parameters
|
1900
1969
|
----------
|
@@ -1943,8 +2012,8 @@ class CollectionManager(Client):
|
|
1943
2012
|
await self._async_make_request("POST", url, body)
|
1944
2013
|
|
1945
2014
|
def attach_collection(self, collection_guid: str, element_guid: str, resource_use: str,
|
1946
|
-
|
1947
|
-
|
2015
|
+
resource_use_description: str, resource_use_props: dict = None, watch_resources: bool = False,
|
2016
|
+
make_anchor: bool = False, ) -> None:
|
1948
2017
|
"""Connect an existing collection to an element using the ResourceList relationship (0019).
|
1949
2018
|
Parameters
|
1950
2019
|
----------
|
@@ -1983,7 +2052,7 @@ class CollectionManager(Client):
|
|
1983
2052
|
loop = asyncio.get_event_loop()
|
1984
2053
|
loop.run_until_complete(
|
1985
2054
|
self._async_attach_collection(collection_guid, element_guid, resource_use, resource_use_description,
|
1986
|
-
|
2055
|
+
resource_use_props, watch_resources, make_anchor, ))
|
1987
2056
|
return
|
1988
2057
|
|
1989
2058
|
async def _async_detach_collection(self, collection_guid: str, element_guid: str) -> None:
|
@@ -2087,7 +2156,7 @@ class CollectionManager(Client):
|
|
2087
2156
|
await self._async_make_request("POST", url, body)
|
2088
2157
|
return
|
2089
2158
|
|
2090
|
-
def delete_collection(self, collection_guid: str, cascade:bool=False) -> None:
|
2159
|
+
def delete_collection(self, collection_guid: str, cascade: bool = False) -> None:
|
2091
2160
|
"""Delete a collection. It is detected from all parent elements. If members are anchored to the collection
|
2092
2161
|
then they are also deleted.
|
2093
2162
|
|
@@ -2119,7 +2188,8 @@ class CollectionManager(Client):
|
|
2119
2188
|
return
|
2120
2189
|
|
2121
2190
|
async def _async_get_collection_members(self, collection_guid: str = None, collection_name: str = None,
|
2122
|
-
|
2191
|
+
collection_qname: str = None, start_from: int = 0,
|
2192
|
+
page_size: int = None, ) -> list | str:
|
2123
2193
|
"""Return a list of elements that are a member of a collection. Async version.
|
2124
2194
|
|
2125
2195
|
Parameters
|
@@ -2168,7 +2238,8 @@ class CollectionManager(Client):
|
|
2168
2238
|
return resp.json().get("elements", NO_ELEMENTS_FOUND)
|
2169
2239
|
|
2170
2240
|
def get_collection_members(self, collection_guid: str = None, collection_name: str = None,
|
2171
|
-
|
2241
|
+
collection_qname: str = None, start_from: int = 0,
|
2242
|
+
page_size: int = None, ) -> list | str:
|
2172
2243
|
"""Return a list of elements that are a member of a collection. Async version.
|
2173
2244
|
|
2174
2245
|
Parameters
|
@@ -2207,7 +2278,7 @@ class CollectionManager(Client):
|
|
2207
2278
|
loop = asyncio.get_event_loop()
|
2208
2279
|
resp = loop.run_until_complete(
|
2209
2280
|
self._async_get_collection_members(collection_guid, collection_name, collection_qname, start_from,
|
2210
|
-
|
2281
|
+
page_size, ))
|
2211
2282
|
|
2212
2283
|
return resp
|
2213
2284
|
|
@@ -2319,7 +2390,7 @@ class CollectionManager(Client):
|
|
2319
2390
|
return
|
2320
2391
|
|
2321
2392
|
async def _async_update_collection_membership(self, collection_guid: str, element_guid: str, body: dict = None,
|
2322
|
-
|
2393
|
+
replace_all_props: bool = False, ) -> None:
|
2323
2394
|
"""Update an element's membership to a collection. Async version.
|
2324
2395
|
|
2325
2396
|
Parameters
|
@@ -2378,7 +2449,7 @@ class CollectionManager(Client):
|
|
2378
2449
|
return
|
2379
2450
|
|
2380
2451
|
def update_collection_membership(self, collection_guid: str, element_guid: str, body: dict = None,
|
2381
|
-
|
2452
|
+
replace_all_props: bool = False, ) -> None:
|
2382
2453
|
"""Update an element's membership to a collection.
|
2383
2454
|
|
2384
2455
|
Parameters
|
@@ -2501,7 +2572,7 @@ class CollectionManager(Client):
|
|
2501
2572
|
return
|
2502
2573
|
|
2503
2574
|
async def _async_get_member_list(self, collection_guid: str = None, collection_name: str = None,
|
2504
|
-
|
2575
|
+
collection_qname: str = None, ) -> list | bool:
|
2505
2576
|
"""Get the member list for the collection - async version.
|
2506
2577
|
Parameters
|
2507
2578
|
----------
|
@@ -2537,26 +2608,21 @@ class CollectionManager(Client):
|
|
2537
2608
|
# finally, construct a list of member information
|
2538
2609
|
for member_rel in members:
|
2539
2610
|
member_guid = member_rel["elementHeader"]["guid"]
|
2540
|
-
member_resp = await self._async_get_collection_by_guid(member_guid)
|
2541
|
-
|
2542
|
-
|
2543
|
-
|
2544
|
-
|
2545
|
-
|
2546
|
-
|
2547
|
-
|
2548
|
-
|
2549
|
-
|
2550
|
-
"name": member["properties"]["name"], "qualifiedName": member["properties"]["qualifiedName"],
|
2551
|
-
"guid": member["elementHeader"]["guid"], "description": member["properties"]["description"],
|
2552
|
-
"collectionType": member["properties"]["collectionType"],
|
2553
|
-
}
|
2554
|
-
member_list.append(member_instance)
|
2611
|
+
# member_resp = await self._async_get_collection_by_guid(member_guid)
|
2612
|
+
member = await self._async_get_element_by_guid_(member_guid)
|
2613
|
+
if isinstance(member, dict):
|
2614
|
+
member_instance = {
|
2615
|
+
"name": member["properties"].get('displayName', ''),
|
2616
|
+
"qualifiedName": member["properties"]["qualifiedName"], "guid": member["elementHeader"]["guid"],
|
2617
|
+
"description": member["properties"].get("description", ''),
|
2618
|
+
"type": member["elementHeader"]["type"]['typeName'],
|
2619
|
+
}
|
2620
|
+
member_list.append(member_instance)
|
2555
2621
|
|
2556
2622
|
return member_list if len(member_list) > 0 else "No members found"
|
2557
2623
|
|
2558
2624
|
def get_member_list(self, collection_guid: str = None, collection_name: str = None,
|
2559
|
-
|
2625
|
+
collection_qname: str = None, ) -> list | bool:
|
2560
2626
|
"""Get the member list for the collection - async version.
|
2561
2627
|
Parameters
|
2562
2628
|
----------
|
@@ -2600,25 +2666,22 @@ class CollectionManager(Client):
|
|
2600
2666
|
description = properties.get("description", "") or ""
|
2601
2667
|
qualified_name = properties.get("qualifiedName", "") or ""
|
2602
2668
|
collection_type = properties.get("collectionType", "") or ""
|
2603
|
-
|
2669
|
+
additional_properties = properties.get("additionalProperties", {}) or {}
|
2670
|
+
extended_properties = properties.get("extendedProperties", {}) or {}
|
2671
|
+
classifications = ", ".join(properties.get("classifications", [])) or ""
|
2604
2672
|
# classification_names = ""
|
2605
2673
|
# classifications = element['elementHeader'].get("classifications", [])
|
2606
2674
|
# for classification in classifications:
|
2607
2675
|
# classification_names += f"{classification['classificationName']}, "
|
2608
2676
|
|
2609
|
-
|
2610
|
-
|
2611
2677
|
return {
|
2612
|
-
'guid': guid,
|
2613
|
-
'
|
2614
|
-
'
|
2615
|
-
|
2616
|
-
'qualified_name': qualified_name,
|
2617
|
-
'classifications': classifications,
|
2618
|
-
'collection_type': collection_type
|
2619
|
-
}
|
2678
|
+
'guid': guid, 'properties': properties, 'display_name': display_name, 'description': description,
|
2679
|
+
'qualified_name': qualified_name, 'classifications': classifications, 'collection_type': collection_type,
|
2680
|
+
'additional_properties': additional_properties, 'extended_properties': extended_properties,
|
2681
|
+
}
|
2620
2682
|
|
2621
|
-
def generate_basic_structured_output(self, elements, filter, output_format
|
2683
|
+
def generate_basic_structured_output(self, elements, filter, output_format: str = 'DICT',
|
2684
|
+
collection_type: str = None) -> str | list:
|
2622
2685
|
"""
|
2623
2686
|
Generate output in the specified format for the given elements.
|
2624
2687
|
|
@@ -2639,27 +2702,25 @@ class CollectionManager(Client):
|
|
2639
2702
|
# For other formats (MD, FORM, REPORT, LIST), use generate_output
|
2640
2703
|
elif output_format in ["MD", "FORM", "REPORT", "LIST"]:
|
2641
2704
|
# Define columns for LIST format
|
2642
|
-
columns = [
|
2643
|
-
{'name': 'Collection Name', 'key': 'display_name'},
|
2705
|
+
columns = [{'name': 'Collection Name', 'key': 'display_name'},
|
2644
2706
|
{'name': 'Qualified Name', 'key': 'qualified_name'},
|
2645
2707
|
{'name': 'Collection Type', 'key': 'collection_type'},
|
2646
2708
|
{'name': 'Classifications', 'key': 'classifications'},
|
2647
|
-
{'name': 'Description', 'key': 'description', 'format': True}
|
2648
|
-
|
2649
|
-
|
2650
|
-
|
2651
|
-
|
2652
|
-
|
2653
|
-
|
2654
|
-
output_format=output_format,
|
2655
|
-
|
2656
|
-
columns=columns if output_format == 'LIST' else None
|
2657
|
-
)
|
2709
|
+
{'name': 'Description', 'key': 'description', 'format': True}]
|
2710
|
+
if collection_type is None:
|
2711
|
+
entity_type = "Collection"
|
2712
|
+
else:
|
2713
|
+
entity_type = collection_type
|
2714
|
+
|
2715
|
+
return generate_output(elements=elements, search_string=filter, entity_type=entity_type,
|
2716
|
+
output_format=output_format, extract_properties_func=self._extract_collection_properties,
|
2717
|
+
columns=columns if output_format == 'LIST' else None)
|
2658
2718
|
|
2659
2719
|
# Default case
|
2660
2720
|
return None
|
2661
2721
|
|
2662
|
-
def generate_collection_output(self, elements, filter,
|
2722
|
+
def generate_collection_output(self, elements, filter, collection_type: str, output_format,
|
2723
|
+
output_profile: str = "CORE") -> str | list | dict:
|
2663
2724
|
"""
|
2664
2725
|
Generate output in the specified format for the given elements.
|
2665
2726
|
|
@@ -2667,11 +2728,18 @@ class CollectionManager(Client):
|
|
2667
2728
|
elements: Dictionary or list of dictionaries containing element data
|
2668
2729
|
filter: The search string used to find the elements
|
2669
2730
|
output_format: The desired output format (MD, FORM, REPORT, LIST, DICT, MERMAID, JSON)
|
2670
|
-
|
2731
|
+
output_profile: str, optional, default = "CORE"
|
2732
|
+
The desired output profile - BASIC, CORE, FULL
|
2671
2733
|
Returns:
|
2672
2734
|
Formatted output as string or list of dictionaries
|
2673
2735
|
"""
|
2736
|
+
if collection_type is None:
|
2737
|
+
entity_type = "Collection"
|
2738
|
+
else:
|
2739
|
+
entity_type = collection_type
|
2740
|
+
|
2674
2741
|
# For LIST and DICT formats, get member information
|
2742
|
+
|
2675
2743
|
if output_format in ["LIST", "DICT"]:
|
2676
2744
|
# Get the collection GUID
|
2677
2745
|
collection_guid = None
|
@@ -2689,7 +2757,7 @@ class CollectionManager(Client):
|
|
2689
2757
|
|
2690
2758
|
# For DICT format, include all member information in the result
|
2691
2759
|
if output_format == "DICT":
|
2692
|
-
result = self.generate_basic_structured_output(elements, filter, output_format)
|
2760
|
+
result = self.generate_basic_structured_output(elements, filter, output_format, collection_type)
|
2693
2761
|
if isinstance(result, list):
|
2694
2762
|
for item in result:
|
2695
2763
|
item['members'] = members
|
@@ -2701,14 +2769,12 @@ class CollectionManager(Client):
|
|
2701
2769
|
# For LIST format, add a column with bulleted list of qualified names
|
2702
2770
|
elif output_format == "LIST":
|
2703
2771
|
# Define columns for LIST format, including the new Members column
|
2704
|
-
columns = [
|
2705
|
-
{'name': 'Collection Name', 'key': 'display_name'},
|
2772
|
+
columns = [{'name': 'Collection Name', 'key': 'display_name'},
|
2706
2773
|
{'name': 'Qualified Name', 'key': 'qualified_name'},
|
2707
2774
|
{'name': 'Collection Type', 'key': 'collection_type'},
|
2708
2775
|
{'name': 'Description', 'key': 'description', 'format': True},
|
2709
2776
|
{'name': 'Classifications', 'key': 'classifications'},
|
2710
|
-
{'name': 'Members', 'key': 'members', 'format': True}
|
2711
|
-
]
|
2777
|
+
{'name': 'Members', 'key': 'members', 'format': True}]
|
2712
2778
|
|
2713
2779
|
# Create a function to add member information to the properties
|
2714
2780
|
def get_additional_props(element, guid, output_format):
|
@@ -2720,24 +2786,18 @@ class CollectionManager(Client):
|
|
2720
2786
|
return {'members': member_list}
|
2721
2787
|
|
2722
2788
|
# Generate output with the additional properties
|
2723
|
-
return generate_output(
|
2724
|
-
elements=elements,
|
2725
|
-
search_string=filter,
|
2726
|
-
entity_type="Collection",
|
2727
|
-
output_format=output_format,
|
2728
|
-
extract_properties_func=self._extract_collection_properties,
|
2729
|
-
get_additional_props_func=get_additional_props,
|
2730
|
-
columns=columns
|
2731
|
-
)
|
2732
2789
|
|
2733
|
-
|
2734
|
-
|
2790
|
+
return generate_output(elements=elements, search_string=filter, entity_type=entity_type,
|
2791
|
+
output_format=output_format, extract_properties_func=self._extract_collection_properties,
|
2792
|
+
get_additional_props_func=get_additional_props, columns=columns)
|
2735
2793
|
|
2736
|
-
|
2737
|
-
return self.generate_basic_structured_output(elements, filter, output_format)
|
2794
|
+
# For FORM, REPORT, JSON formats, keep behavior unchanged
|
2795
|
+
return self.generate_basic_structured_output(elements, filter, output_format, collection_type)
|
2738
2796
|
|
2739
|
-
def
|
2740
|
-
|
2797
|
+
# def generate_data_class_output(self, elements, filter, output_format) -> str | list: # return
|
2798
|
+
# self.generate_basic_structured_output(elements, filter, output_format) # # def generate_data_field_output(
|
2799
|
+
# self, elements, filter, output_format) -> str | list: # return self.generate_basic_structured_output(
|
2800
|
+
# elements, filter, output_format)
|
2741
2801
|
|
2742
2802
|
|
2743
2803
|
if __name__ == "__main__":
|