pyegeria 5.2.1.1__py3-none-any.whl → 5.3__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.
Files changed (311) hide show
  1. commands/cat/.DS_Store +0 -0
  2. commands/cat/Dr-Egeria_md-orig.py +166 -0
  3. commands/cat/__init__.py +23 -0
  4. commands/cat/dr_egeria_jupyter.py +122 -0
  5. commands/cat/dr_egeria_md.py +247 -0
  6. {pyegeria/commands → commands}/cat/exp_list_glossaries.py +3 -4
  7. {pyegeria/commands → commands}/cat/get_asset_graph.py +4 -4
  8. {pyegeria/commands → commands}/cat/get_collection.py +8 -9
  9. {pyegeria/commands → commands}/cat/get_project_dependencies.py +6 -8
  10. {pyegeria/commands → commands}/cat/get_project_structure.py +6 -8
  11. {pyegeria/commands → commands}/cat/get_tech_type_elements.py +13 -15
  12. {pyegeria/commands → commands}/cat/glossary_actions.py +184 -34
  13. {pyegeria/commands → commands}/cat/list_assets.py +9 -6
  14. commands/cat/list_categories.py +192 -0
  15. {pyegeria/commands → commands}/cat/list_cert_types.py +6 -6
  16. {pyegeria/commands → commands}/cat/list_collections.py +62 -19
  17. commands/cat/list_data_structures.py +223 -0
  18. {pyegeria/commands → commands}/cat/list_deployed_catalogs.py +9 -8
  19. {pyegeria/commands → commands}/cat/list_deployed_database_schemas.py +10 -9
  20. {pyegeria/commands → commands}/cat/list_deployed_databases.py +9 -8
  21. pyegeria/commands/cat/list_servers_deployed_imp.py → commands/cat/list_deployed_servers.py +3 -3
  22. {pyegeria/commands → commands}/cat/list_glossaries.py +57 -15
  23. {pyegeria/commands → commands}/cat/list_projects.py +5 -5
  24. {pyegeria/commands → commands}/cat/list_tech_type_elements.py +3 -3
  25. {pyegeria/commands → commands}/cat/list_tech_types.py +4 -4
  26. {pyegeria/commands → commands}/cat/list_terms.py +93 -45
  27. {pyegeria/commands → commands}/cat/list_todos.py +3 -3
  28. {pyegeria/commands → commands}/cat/list_user_ids.py +9 -8
  29. {pyegeria/commands → commands}/cli/__init__.py +1 -1
  30. {pyegeria/commands → commands}/cli/egeria.py +506 -250
  31. {pyegeria/commands → commands}/cli/egeria_cat.py +127 -50
  32. {pyegeria/commands → commands}/cli/egeria_login_tui.py +15 -17
  33. {pyegeria/commands → commands}/cli/egeria_my.py +22 -15
  34. {pyegeria/commands → commands}/cli/egeria_ops.py +54 -55
  35. {pyegeria/commands → commands}/cli/egeria_tech.py +364 -152
  36. {pyegeria/commands → commands}/cli/ops_config.py +11 -4
  37. commands/cli/txt_custom_v2.tcss +19 -0
  38. commands/my/__init__.py +22 -0
  39. {pyegeria/commands → commands}/my/list_my_profile.py +6 -8
  40. {pyegeria/commands → commands}/my/list_my_roles.py +4 -4
  41. {pyegeria/commands → commands}/my/monitor_my_todos.py +7 -7
  42. {pyegeria/commands → commands}/my/monitor_open_todos.py +7 -7
  43. {pyegeria/commands → commands}/my/todo_actions.py +3 -2
  44. commands/ops/__init__.py +23 -0
  45. {pyegeria/commands → commands}/ops/gov_server_actions.py +5 -4
  46. {pyegeria/commands → commands}/ops/list_archives.py +7 -6
  47. {pyegeria/commands → commands}/ops/list_catalog_targets.py +4 -4
  48. {pyegeria/commands → commands}/ops/load_archive.py +4 -2
  49. {pyegeria/commands → commands}/ops/monitor_asset_events.py +8 -7
  50. {pyegeria/commands → commands}/ops/monitor_engine_activity.py +5 -5
  51. {pyegeria/commands → commands}/ops/monitor_engine_activity_c.py +3 -3
  52. {pyegeria/commands → commands}/ops/monitor_gov_eng_status.py +3 -2
  53. {pyegeria/commands → commands}/ops/monitor_integ_daemon_status.py +23 -15
  54. {pyegeria/commands → commands}/ops/monitor_platform_status.py +5 -4
  55. {pyegeria/commands → commands}/ops/monitor_server_startup.py +7 -7
  56. {pyegeria/commands → commands}/ops/monitor_server_status.py +16 -11
  57. {pyegeria/commands → commands}/ops/orig_monitor_server_list.py +2 -2
  58. {pyegeria/commands → commands}/ops/orig_monitor_server_status.py +3 -3
  59. {pyegeria/commands → commands}/ops/refresh_integration_daemon.py +4 -4
  60. {pyegeria/commands → commands}/ops/restart_integration_daemon.py +3 -3
  61. {pyegeria/commands → commands}/ops/table_integ_daemon_status.py +3 -3
  62. commands/tech/__init__.py +22 -0
  63. commands/tech/generic_actions.py +74 -0
  64. {pyegeria/commands → commands}/tech/get_element_info.py +5 -7
  65. {pyegeria/commands → commands}/tech/get_guid_info.py +4 -5
  66. {pyegeria/commands → commands}/tech/get_tech_details.py +8 -9
  67. {pyegeria/commands → commands}/tech/get_tech_type_template.py +4 -4
  68. pyegeria/commands/tech/list_elements.py → commands/tech/list_all_om_type_elements.py +11 -10
  69. pyegeria/commands/tech/list_elements_x.py → commands/tech/list_all_om_type_elements_x.py +11 -12
  70. pyegeria/commands/tech/list_related_elements.py → commands/tech/list_all_related_elements.py +11 -9
  71. {pyegeria/commands → commands}/tech/list_anchored_elements.py +16 -16
  72. {pyegeria/commands → commands}/tech/list_asset_types.py +4 -4
  73. commands/tech/list_elements_by_classification_by_property_value.py +200 -0
  74. commands/tech/list_elements_by_property_value.py +180 -0
  75. commands/tech/list_elements_by_property_value_x.py +201 -0
  76. {pyegeria/commands → commands}/tech/list_elements_for_classification.py +11 -9
  77. {pyegeria/commands → commands}/tech/list_gov_action_processes.py +5 -6
  78. commands/tech/list_information_supply_chains.py +167 -0
  79. {pyegeria/commands → commands}/tech/list_registered_services.py +3 -3
  80. commands/tech/list_related_elements_with_prop_value.py +221 -0
  81. {pyegeria/commands → commands}/tech/list_related_specification.py +3 -3
  82. {pyegeria/commands → commands}/tech/list_relationship_types.py +4 -5
  83. {pyegeria/commands → commands}/tech/list_relationships.py +3 -3
  84. commands/tech/list_solution_blueprints.py +181 -0
  85. commands/tech/list_solution_components.py +185 -0
  86. commands/tech/list_solution_roles.py +184 -0
  87. {pyegeria/commands → commands}/tech/list_tech_templates.py +3 -3
  88. {pyegeria/commands → commands}/tech/list_valid_metadata_values.py +5 -6
  89. {pyegeria/commands → commands}/tech/table_tech_templates.py +16 -13
  90. {pyegeria/commands → commands}/tech/x_list_related_elements.py +6 -4
  91. md_processing/__init__.py +49 -0
  92. md_processing/data/commands.json +3252 -0
  93. md_processing/dr_egeria_inbox/archive/dr_egeria_intro.md +254 -0
  94. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_more_terms.md +696 -0
  95. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part1.md +254 -0
  96. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part2.md +298 -0
  97. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part3.md +608 -0
  98. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part4.md +94 -0
  99. md_processing/dr_egeria_inbox/archive/freddie_intro.md +284 -0
  100. md_processing/dr_egeria_inbox/archive/freddie_intro_orig.md +275 -0
  101. md_processing/dr_egeria_inbox/archive/test-term.md +110 -0
  102. md_processing/dr_egeria_inbox/cat_test.md +100 -0
  103. md_processing/dr_egeria_inbox/data_field.md +54 -0
  104. md_processing/dr_egeria_inbox/data_spec.md +77 -0
  105. md_processing/dr_egeria_inbox/data_spec_test.md +2406 -0
  106. md_processing/dr_egeria_inbox/data_test.md +86 -0
  107. md_processing/dr_egeria_inbox/dr_egeria_intro_categories.md +168 -0
  108. md_processing/dr_egeria_inbox/dr_egeria_intro_part1.md +280 -0
  109. md_processing/dr_egeria_inbox/dr_egeria_intro_part2.md +313 -0
  110. md_processing/dr_egeria_inbox/dr_egeria_intro_part3.md +1073 -0
  111. md_processing/dr_egeria_inbox/dr_egeria_isc1.md +44 -0
  112. md_processing/dr_egeria_inbox/glossary_creation_experiment.ipynb +341 -0
  113. md_processing/dr_egeria_inbox/glossary_test1.md +324 -0
  114. md_processing/dr_egeria_inbox/rel.md +8 -0
  115. md_processing/dr_egeria_inbox/sb.md +119 -0
  116. md_processing/dr_egeria_inbox/search_test.md +39 -0
  117. md_processing/dr_egeria_inbox/solution-components.md +154 -0
  118. md_processing/dr_egeria_inbox/solution_blueprints.md +118 -0
  119. md_processing/dr_egeria_inbox/synonym_test.md +42 -0
  120. md_processing/dr_egeria_inbox/t2.md +268 -0
  121. md_processing/dr_egeria_outbox/processed-2025-05-15 19:52-data_test.md +94 -0
  122. md_processing/dr_egeria_outbox/processed-2025-05-16 07:39-data_test.md +88 -0
  123. md_processing/dr_egeria_outbox/processed-2025-05-17 16:01-data_field.md +56 -0
  124. md_processing/dr_egeria_outbox/processed-2025-05-18 15:51-data_test.md +103 -0
  125. md_processing/dr_egeria_outbox/processed-2025-05-18 16:47-data_test.md +94 -0
  126. md_processing/dr_egeria_outbox/processed-2025-05-19 07:14-data_test.md +96 -0
  127. md_processing/dr_egeria_outbox/processed-2025-05-19 07:20-data_test.md +100 -0
  128. md_processing/dr_egeria_outbox/processed-2025-05-19 07:22-data_test.md +88 -0
  129. md_processing/dr_egeria_outbox/processed-2025-05-19 09:26-data_test.md +91 -0
  130. md_processing/dr_egeria_outbox/processed-2025-05-19 10:27-data_test.md +91 -0
  131. md_processing/dr_egeria_outbox/processed-2025-05-19 14:04-data_test.md +91 -0
  132. md_processing/md_commands/__init__.py +3 -0
  133. md_processing/md_commands/blueprint_commands.py +303 -0
  134. md_processing/md_commands/data_designer_commands.py +1182 -0
  135. md_processing/md_commands/glossary_commands.py +1144 -0
  136. md_processing/md_commands/project_commands.py +163 -0
  137. md_processing/md_processing_utils/__init__.py +4 -0
  138. md_processing/md_processing_utils/common_md_proc_utils.py +724 -0
  139. md_processing/md_processing_utils/common_md_utils.py +172 -0
  140. md_processing/md_processing_utils/extraction_utils.py +486 -0
  141. md_processing/md_processing_utils/md_processing_constants.py +128 -0
  142. md_processing/md_processing_utils/message_constants.py +19 -0
  143. pyegeria/.DS_Store +0 -0
  144. pyegeria/__init__.py +231 -146
  145. pyegeria/_client.py +36 -13
  146. pyegeria/_exceptions.py +55 -46
  147. pyegeria/_globals.py +11 -1
  148. pyegeria/_validators.py +5 -5
  149. pyegeria/asset_catalog_omvs.py +78 -21
  150. pyegeria/automated_curation_omvs.py +11 -6
  151. pyegeria/classification_manager_omvs.py +41 -37
  152. pyegeria/collection_manager_omvs.py +722 -705
  153. pyegeria/core_omag_server_config.py +1 -1
  154. pyegeria/create_tech_guid_lists.py +13 -13
  155. pyegeria/data_designer_omvs.py +5104 -0
  156. pyegeria/dr.egeria spec.md +9 -0
  157. pyegeria/egeria_cat_client.py +5 -8
  158. pyegeria/egeria_client.py +39 -24
  159. pyegeria/egeria_config_client.py +2 -1
  160. pyegeria/egeria_my_client.py +4 -4
  161. pyegeria/egeria_tech_client.py +40 -18
  162. pyegeria/feedback_manager_omvs.py +1 -1
  163. pyegeria/full_omag_server_config.py +5 -3
  164. pyegeria/glossary_browser_omvs.py +1915 -694
  165. pyegeria/glossary_manager_omvs.py +685 -1842
  166. pyegeria/m_test.py +118 -0
  167. pyegeria/md_processing_helpers.py +58 -0
  168. pyegeria/md_processing_utils.py +2147 -0
  169. pyegeria/md_processing_utils_orig.py +1103 -0
  170. pyegeria/mermaid_utilities.py +1194 -14
  171. pyegeria/metadata_explorer_omvs.py +5 -50
  172. pyegeria/my_profile_omvs.py +3 -2
  173. pyegeria/output_formatter.py +389 -0
  174. pyegeria/platform_services.py +5 -5
  175. pyegeria/project_manager_omvs.py +97 -18
  176. pyegeria/runtime_manager_omvs.py +8 -10
  177. pyegeria/server_operations.py +2 -2
  178. pyegeria/solution_architect_omvs.py +2156 -0
  179. pyegeria/template_manager_omvs.py +13 -13
  180. pyegeria/utils.py +3 -1
  181. pyegeria/valid_metadata_omvs.py +5 -4
  182. pyegeria/x_action_author_omvs.py +3 -6
  183. {pyegeria-5.2.1.1.dist-info → pyegeria-5.3.dist-info}/METADATA +9 -8
  184. pyegeria-5.3.dist-info/RECORD +196 -0
  185. {pyegeria-5.2.1.1.dist-info → pyegeria-5.3.dist-info}/WHEEL +1 -1
  186. pyegeria-5.3.dist-info/entry_points.txt +99 -0
  187. pyegeria/commands/README.md +0 -47
  188. pyegeria/commands/__init__.py +0 -22
  189. pyegeria/commands/cat/__init__.py +0 -1
  190. pyegeria/commands/doc/README.md +0 -145
  191. pyegeria/commands/doc/Visual Command Reference/README.md +0 -511
  192. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/asset-graph 2024-11-20 at 15.56.42.png +0 -0
  193. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/assets-in-domain 2024-11-20 at 15.49.55@2x.png +0 -0
  194. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/elements-of-type 2024-11-20 at 16.01.35.png +0 -0
  195. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/tech-type-elements 2024-11-20 at 16.05.05.png +0 -0
  196. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png +0 -0
  197. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs-2024-11-20 at 16.17.43@2x.png +0 -0
  198. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-11-25 at 20.14.50@2x.png +0 -0
  199. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-12-17 at 15.48.38@2x.png +0 -0
  200. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-11-25 at 20.21.25@2x.png +0 -0
  201. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-12-17 at 15.52.16@2x.png +0 -0
  202. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed_databases 2024-12-16 at 16.40.31@2x.png +0 -0
  203. pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-glossaries 2024-11-25 at 20.30.02.png +0 -0
  204. pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-terms 2024-11-25 at 20.32.11.png +0 -0
  205. pyegeria/commands/doc/Visual Command Reference/cat/show/info/asset-types 2024-11-25 at 20.34.19@2x.png +0 -0
  206. pyegeria/commands/doc/Visual Command Reference/cat/show/info/certification-types 2024-11-25 at 20.37.07.png +0 -0
  207. pyegeria/commands/doc/Visual Command Reference/cat/show/info/collection-graph 2024-12-12 at 11.33.18@2x.png +0 -0
  208. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-collections 2024-12-10 at 14.25.51@2x.png +0 -0
  209. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-todos 2024-12-12 at 11.46.30@2x.png +0 -0
  210. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-user-ids 2024-12-12 at 11.51.09@2x.png +0 -0
  211. pyegeria/commands/doc/Visual Command Reference/cat/show/info/tech-types 2024-12-12 at 11.37.20@2x.png +0 -0
  212. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_dependencies 2024-12-14 at 16.24.39@2x.png +0 -0
  213. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_structure 2024-12-14 at 16.21.35@2x.png +0 -0
  214. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/projects 2024-12-14 at 16.18.10@2x.png +0 -0
  215. pyegeria/commands/doc/Visual Command Reference/hey_egeria tui 2024-12-16 at 16.58.22@2x.png +0 -0
  216. pyegeria/commands/doc/Visual Command Reference/my/show/my_profile 2024-12-14 at 16.29.27@2x.png +0 -0
  217. pyegeria/commands/doc/Visual Command Reference/my/show/my_roles 2024-12-14 at 16.32.10@2x.png +0 -0
  218. pyegeria/commands/doc/Visual Command Reference/my/show/my_todos 2024-12-15 at 16.24.13@2x.png +0 -0
  219. pyegeria/commands/doc/Visual Command Reference/my/show/open_todos 2024-12-14 at 16.36.12@2x.png +0 -0
  220. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/list_engine_activity compressed 2024-12-15 at 16.48.48@2x.png +0 -0
  221. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity 2024-12-15 at 16.32.55@2x.png +0 -0
  222. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity compressed 2024-12-15 at 16.38.29@2x.png +0 -0
  223. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_status 2024-12-15 at 16.51.26.jpeg +0 -0
  224. pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_daemon_status 2024-12-15 at 16.57.12@2x.png +0 -0
  225. pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_targets 2024-12-15 at 17.02.19@2x.png +0 -0
  226. pyegeria/commands/doc/Visual Command Reference/ops/show/platforms/monitor_platform_status 2024-12-15 at 19.53.18@2x.png +0 -0
  227. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status 2024-12-15 at 19.59.39@2x.png +0 -0
  228. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status full 2024-12-15 at 20.01.57@2x.png +0 -0
  229. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_startup_servers 2024-12-15 at 19.56.07@2x.png +0 -0
  230. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_anchored_elements 2024-12-15 at 21.25.41@2x.png +0 -0
  231. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_elements_of_om_type 2024-12-16 at 14.39.59@2x.png +0 -0
  232. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/info_for_guid 2024-12-16 at 11.35.29@2x.png +0 -0
  233. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type 2024-12-16 at 14.24.18@2x.png +0 -0
  234. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type extended 2024-12-16 at 14.28.46@2x.png +0 -0
  235. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_of_om_type_by_classification 2024-12-16 at 14.35.26@2x.png +0 -0
  236. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/related_elements 2024-12-16 at 14.55.01@2x.png +0 -0
  237. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/show_related_specifications 2024-12-16 at 15.04.55@2x.png +0 -0
  238. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/asset_types 2024-12-16 at 15.10.16@2x.png +0 -0
  239. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/detailed_governance_action_processes 2024-12-16 at 15.16.26@2x.png +0 -0
  240. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/governance_action_processes 2024-12-16 at 15.13.01@2x.png +0 -0
  241. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/registered_services 2024-12-16 at 16.44.54@2x.png +0 -0
  242. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-16 at 16.20.34@2x.png +0 -0
  243. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-19 at 10.51.54@2x.png +0 -0
  244. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/valid_metadata_values 2024-12-16 at 15.31.56@2x.png +0 -0
  245. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_tech_type_template_specs 2024-12-16 at 16.03.22@2x.png +0 -0
  246. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_technology_types 2024-12-16 at 15.39.20@2x.png +0 -0
  247. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_details 2024-12-16 at 15.37.21@2x.png +0 -0
  248. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_templates 2024-12-16 at 16.11.48@2x.png +0 -0
  249. pyegeria/commands/doc/glossary/basic-glossary-tui.md +0 -109
  250. pyegeria/commands/doc/glossary/images/delete-glossary-step1 2024-11-06 at 15.47.23@2x.png +0 -0
  251. pyegeria/commands/doc/glossary/images/delete-glossary-step2 2024-11-06 at 15.51.29@2x.png +0 -0
  252. pyegeria/commands/doc/glossary/images/delete-glossary-step3 2024-11-06 at 15.53.19@2x.png +0 -0
  253. pyegeria/commands/doc/glossary/images/delete-glossary-step4 2024-11-06 at 15.55.11@2x.png +0 -0
  254. pyegeria/commands/doc/glossary/images/out-create-glossary example 2024-11-05 at 20.38.04@2x.png +0 -0
  255. pyegeria/commands/doc/glossary/images/out-create-term 2024-11-06 at 20.48.29.png +0 -0
  256. pyegeria/commands/doc/glossary/images/out-delete-term 2024-11-07 at 03.57.25.png +0 -0
  257. pyegeria/commands/doc/glossary/images/out-display-terms-for-glossary-test 2024-11-06 at 20.51.28.png +0 -0
  258. pyegeria/commands/doc/glossary/images/out-export-example 2024-11-07 at 09.54.57.png +0 -0
  259. pyegeria/commands/doc/glossary/images/out-exported-terms 2024-11-06 at 21.06.32.png +0 -0
  260. pyegeria/commands/doc/glossary/images/out-glossary-list example 2024-11-05 at 20.41.02@2x.png +0 -0
  261. pyegeria/commands/doc/glossary/images/out-import-terms 2024-11-07 at 08.15.18.png +0 -0
  262. pyegeria/commands/doc/glossary/images/out-list-all-terms 2024-11-06 at 16.22.20@2x.png +0 -0
  263. pyegeria/commands/doc/glossary/images/out-list-terms-for-example 2024-11-06 at 16.40.12.png +0 -0
  264. pyegeria/commands/doc/glossary/images/out-list-terms-second 2024-11-06 at 16.45.13.png +0 -0
  265. pyegeria/commands/doc/glossary/images/out-pipx install pyegeria 2024-11-10 at 18.12.21.png +0 -0
  266. pyegeria/commands/doc/glossary/images/out-server-status-full 2024-11-10 at 18.25.14.png +0 -0
  267. pyegeria/commands/doc/glossary/images/out-servers-status 2024-11-10 at 18.15.42.png +0 -0
  268. pyegeria/commands/doc/glossary/images/out-upsert-import 2024-11-07 at 19.37.00.png +0 -0
  269. pyegeria/commands/doc/glossary/images/tui-2024-11-10 at 18.26.29.png +0 -0
  270. pyegeria/commands/doc/glossary/images/tui-create-glossary example 2024-11-05 at 20.34.24@2x.png +0 -0
  271. pyegeria/commands/doc/glossary/images/tui-create-term 2024-11-06 at 20.46.35.png +0 -0
  272. pyegeria/commands/doc/glossary/images/tui-delete-term 2024-11-07 at 03.51.57.png +0 -0
  273. pyegeria/commands/doc/glossary/images/tui-display-terms-for-example 2024-11-06 at 20.56.49.png +0 -0
  274. pyegeria/commands/doc/glossary/images/tui-export-example 2024-11-07 at 09.52.59.png +0 -0
  275. pyegeria/commands/doc/glossary/images/tui-hey-egeria 2024-11-10 at 18.31.01.png +0 -0
  276. pyegeria/commands/doc/glossary/images/tui-import-upsert-example 2024-11-07 at 10.08.37.png +0 -0
  277. pyegeria/commands/doc/glossary/images/tui-list-terms-second 2024-11-06 at 16.46.34.png +0 -0
  278. pyegeria/commands/doc/glossary/images/tui-load-archive.png +0 -0
  279. pyegeria/commands/doc/glossary/images/tui-server-status-full 2024-11-10 at 19.14.36.png +0 -0
  280. pyegeria/commands/doc/glossary/images/tui-show-glossaries 2024-11-07 at 20.00.05.png +0 -0
  281. pyegeria/commands/doc/glossary/images/tui-show-glossary-terms 2024-11-05 at 19.37.53@2x.png +0 -0
  282. pyegeria/commands/doc/glossary/images/tui-upsert 2024-11-07 at 11.49.04.png +0 -0
  283. pyegeria/commands/doc/glossary/images/upsert-example.om-terms 2024-11-07 at 11.44.05.png +0 -0
  284. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/README.md +0 -346
  285. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/CleanShot 2024-11-18 at 21.32.03@2x.png +0 -0
  286. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/Xmind 1731421782704.png +0 -0
  287. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/Xmind 1731422134920.png +0 -0
  288. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/hey_egeria 2024-11-12 at 20.38.43.png +0 -0
  289. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/hey_egeria cat 2024-11-12 at 21.41.43.png +0 -0
  290. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/out-integ-status-list 2024-11-12 at 16.45.26.png +0 -0
  291. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/out-integ-status-live 2024-11-12 at 16.44.12@2x.png +0 -0
  292. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/out-server-status 2024-11-10 at 18.15.42@2x.png +0 -0
  293. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/out-server-status-full 2024-11-10 at 18.25.14@2x.png +0 -0
  294. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/short-cut commands 2024-11-12 at 22.22.13.png +0 -0
  295. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-hey-egeria.png +0 -0
  296. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-integration-status-paging.png +0 -0
  297. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-load-archive 2024-11-10 at 19.19.09@2x.png +0 -0
  298. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-show-server-status 2024-11-10 at 18.52.01@2x.png +0 -0
  299. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-show-server-status-full 2024-11-10.png +0 -0
  300. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-status-paging 2024-11-12 at 16.26.14@2x.png +0 -0
  301. pyegeria/commands/ops/__init__.py +0 -22
  302. pyegeria/commands/tech/__init__.py +0 -0
  303. pyegeria-5.2.1.1.dist-info/RECORD +0 -231
  304. pyegeria-5.2.1.1.dist-info/entry_points.txt +0 -81
  305. {pyegeria/commands → commands}/cat/README.md +0 -0
  306. {pyegeria/commands → commands}/my/README.md +0 -0
  307. {pyegeria/commands → commands}/ops/README.md +0 -0
  308. {pyegeria/commands → commands}/ops/x_engine_actions.py +0 -0
  309. {pyegeria/commands → commands}/tech/README.md +0 -0
  310. /pyegeria/commands/my/__init__.py → /md_processing/dr_egeria_inbox/t1.md +0 -0
  311. {pyegeria-5.2.1.1.dist-info → pyegeria-5.3.dist-info}/LICENSE +0 -0
@@ -5,16 +5,25 @@ Copyright Contributors to the ODPi Egeria project.
5
5
  Maintain and explore the contents of nested collections.
6
6
 
7
7
  """
8
+
8
9
  import asyncio
9
- import time
10
10
 
11
11
  # import json
12
12
  from pyegeria._client import Client
13
- from pyegeria._validators import (
14
- validate_guid,
15
- validate_search_string,
16
- )
13
+ from pyegeria._globals import NO_ELEMENTS_FOUND
14
+ from pyegeria._validators import validate_guid, validate_search_string
17
15
  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
+ )
18
27
 
19
28
 
20
29
  class CollectionManager(Client):
@@ -39,32 +48,23 @@ class CollectionManager(Client):
39
48
 
40
49
  """
41
50
 
42
- def __init__(
43
- self,
44
- view_server: str,
45
- platform_url: str,
46
- user_id: str,
47
- user_pwd: str = None,
48
- token: str = None,
49
- ):
51
+ def __init__(self, view_server: str, platform_url: str, user_id: str, user_pwd: str = None, token: str = None, ):
50
52
  self.view_server = view_server
51
53
  self.platform_url = platform_url
52
54
  self.user_id = user_id
53
55
  self.user_pwd = user_pwd
54
56
 
55
- self.collection_command_root: str = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/collections"
57
+ self.collection_command_root: str = (
58
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/collections")
56
59
  Client.__init__(self, view_server, platform_url, user_id, user_pwd, token)
57
60
 
58
61
  #
59
62
  # Retrieving Collections - https://egeria-project.org/concepts/collection
60
63
  #
61
- async def _async_get_linked_collections(
62
- self,
63
- parent_guid: str,
64
- start_from: int = 0,
65
- page_size: int = None,
66
- ) -> list:
67
- """Returns the list of collections that are linked off of the supplied element. Async version.
64
+ async def _async_get_attached_collections(self, parent_guid: str, start_from: int = 0,
65
+ page_size: int = None, ) -> list:
66
+ """Returns the list of collections that are linked off of the supplied element using the ResourceList
67
+ relationship. Async version.
68
68
 
69
69
  Parameters
70
70
  ----------
@@ -101,20 +101,13 @@ class CollectionManager(Client):
101
101
 
102
102
  body = {}
103
103
 
104
- url = (
105
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/"
106
- f"metadata-elements/{parent_guid}/collections?startFrom={start_from}&pageSize={page_size}"
107
- )
104
+ url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/"
105
+ f"metadata-elements/{parent_guid}/collections?startFrom={start_from}&pageSize={page_size}")
108
106
 
109
107
  resp = await self._async_make_request("POST", url, body)
110
108
  return resp.json()
111
109
 
112
- def get_linked_collections(
113
- self,
114
- parent_guid: str,
115
- start_from: int = 0,
116
- page_size: int = None,
117
- ) -> list:
110
+ def get_attached_collections(self, parent_guid: str, start_from: int = 0, page_size: int = None, ) -> list:
118
111
  """Returns the list of collections that are linked off of the supplied element.
119
112
 
120
113
  Parameters
@@ -147,17 +140,11 @@ class CollectionManager(Client):
147
140
 
148
141
  """
149
142
  loop = asyncio.get_event_loop()
150
- resp = loop.run_until_complete(
151
- self._async_get_linked_collections(parent_guid, start_from, page_size)
152
- )
143
+ resp = loop.run_until_complete(self._async_get_attached_collections(parent_guid, start_from, page_size))
153
144
  return resp
154
145
 
155
- async def _async_get_classified_collections(
156
- self,
157
- classification: str,
158
- start_from: int = 0,
159
- page_size: int = None,
160
- ) -> list | str:
146
+ async def _async_get_classified_collections(self, classification: str, start_from: int = 0,
147
+ page_size: int = None, output_format: str = 'JSON') -> list | str | dict:
161
148
  """Returns the list of collections with a particular classification. These classifications
162
149
  are typically "RootCollection", "Folder" or "DigitalProduct". Async version.
163
150
 
@@ -165,19 +152,20 @@ class CollectionManager(Client):
165
152
  ----------
166
153
  classification: str
167
154
  The classification of the collection to inspect.
168
-
169
-
170
-
171
155
  start_from: int, [default=0], optional
172
156
  When multiple pages of results are available, the page number to start from.
173
157
  page_size: int, [default=None]
174
158
  The number of items to return in a single page. If not specified, the default will be taken from
175
159
  the class instance.
160
+ output_format: str, default = "JSON"
161
+ - one of "DICT", "MERMAID" or "JSON"
176
162
 
177
163
  Returns
178
164
  -------
179
- list | str
180
- The list of collections (if found) with the specified classification. Returns a string if none found.
165
+ List | str | dict
166
+
167
+ A list of collections with the provided classification in the output format specified.
168
+ Returns a string if none found.
181
169
 
182
170
  Raises
183
171
  ------
@@ -196,22 +184,20 @@ class CollectionManager(Client):
196
184
 
197
185
  body = {"filter": classification}
198
186
 
199
- url = (
200
- f"{self.collection_command_root}/by-classifications?"
201
- f"startFrom={start_from}&pageSize={page_size}"
202
- )
187
+ url = (f"{self.collection_command_root}/by-classifications?"
188
+ f"startFrom={start_from}&pageSize={page_size}")
203
189
 
204
- resp = await self._async_make_request("POST", url, body)
205
- # result = resp.json().get("elements","No elements found")
206
- result = resp.json().get("elements", "No Elements to return")
207
- return result
208
-
209
- def get_classified_collections(
210
- self,
211
- classification: str,
212
- start_from: int = 0,
213
- page_size: int = None,
214
- ) -> list | str:
190
+ response = await self._async_make_request("POST", url, body)
191
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
192
+ if type(elements) is str:
193
+ return NO_ELEMENTS_FOUND
194
+
195
+ if output_format != 'JSON': # return a simplified markdown representation
196
+ return self.generate_collection_output(elements, filter, output_format)
197
+ return elements
198
+
199
+ def get_classified_collections(self, classification: str, start_from: int = 0,
200
+ page_size: int = None, output_format:str = 'JSON') -> list | str | dict:
215
201
  """Returns the list of collections with a particular classification. These classifications
216
202
  are typically "RootCollection", "Folder" or "DigitalProduct".
217
203
 
@@ -219,19 +205,19 @@ class CollectionManager(Client):
219
205
  ----------
220
206
  classification: str
221
207
  The classification of the collection to inspect.
222
-
223
-
224
-
225
208
  start_from: int, [default=0], optional
226
209
  When multiple pages of results are available, the page number to start from.
227
210
  page_size: int, [default=None]
228
211
  The number of items to return in a single page. If not specified, the default will be taken from
229
212
  the class instance.
213
+ output_format: str, default = "JSON"
214
+ - one of "DICT", "MERMAID" or "JSON"
230
215
  Returns
231
216
  -------
232
- List | str
217
+ List | str | dict
233
218
 
234
- A list of collections linked off of the supplied element.
219
+ A list of collections with the provided classification in the output format specified.
220
+ Returns a string if none found..
235
221
 
236
222
  Raises
237
223
  ------
@@ -245,23 +231,13 @@ class CollectionManager(Client):
245
231
 
246
232
  """
247
233
  loop = asyncio.get_event_loop()
248
- resp = loop.run_until_complete(
249
- self._async_get_classified_collections(
250
- classification, start_from, page_size
251
- )
252
- )
234
+ resp = loop.run_until_complete(self._async_get_classified_collections(classification,
235
+ start_from, page_size, output_format))
253
236
  return resp
254
237
 
255
- async def _async_find_collections(
256
- self,
257
- search_string: str,
258
- effective_time: str = None,
259
- starts_with: bool = False,
260
- ends_with: bool = False,
261
- ignore_case: bool = False,
262
- start_from: int = 0,
263
- page_size: int = None,
264
- ) -> list | str:
238
+ async def _async_find_collections(self, search_string: str, effective_time: str = None, starts_with: bool = False,
239
+ ends_with: bool = False, ignore_case: bool = False, start_from: int = 0, page_size: int = None,
240
+ output_format: str = 'JSON') -> list | str:
265
241
  """Returns the list of collections matching the search string.
266
242
  The search string is located in the request body and is interpreted as a plain string.
267
243
  The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
@@ -272,9 +248,6 @@ class CollectionManager(Client):
272
248
  Search string to use to find matching collections. If the search string is '*' then all glossaries returned.
273
249
  effective_time: str, [default=None], optional
274
250
  Effective time of the query. If not specified will default to any time. ISO8601 format is assumed.
275
-
276
-
277
-
278
251
  starts_with : bool, [default=False], optional
279
252
  Starts with the supplied string.
280
253
  ends_with : bool, [default=False], optional
@@ -286,6 +259,8 @@ class CollectionManager(Client):
286
259
  page_size: int, [default=None]
287
260
  The number of items to return in a single page. If not specified, the default will be taken from
288
261
  the class instance.
262
+ output_format: str, default = "JSON"
263
+ - one of "DICT", "MERMAID" or "JSON"
289
264
  Returns
290
265
  -------
291
266
  List | str
@@ -318,25 +293,22 @@ class CollectionManager(Client):
318
293
  body = {"filter": search_string, "effective_time": effective_time}
319
294
 
320
295
  body_s = body_slimmer(body)
321
- url = (
322
- f"{self.collection_command_root}/"
323
- f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
324
- f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
325
- )
326
-
327
- resp = await self._async_make_request("POST", url, body_s)
328
- return resp.json().get("elements", "No elements found")
329
-
330
- def find_collections(
331
- self,
332
- search_string: str,
333
- effective_time: str = None,
334
- starts_with: bool = False,
335
- ends_with: bool = False,
336
- ignore_case: bool = False,
337
- start_from: int = 0,
338
- page_size: int = None,
339
- ) -> list | str:
296
+ url = (f"{self.collection_command_root}/"
297
+ f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
298
+ f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}")
299
+
300
+ response = await self._async_make_request("POST", url, body_s)
301
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
302
+ if type(elements) is str:
303
+ return NO_ELEMENTS_FOUND
304
+
305
+ if output_format != 'JSON': # return a simplified markdown representation
306
+ return self.generate_collection_output(elements, filter, output_format)
307
+ return elements
308
+
309
+ def find_collections(self, search_string: str, effective_time: str = None, starts_with: bool = False,
310
+ ends_with: bool = False, ignore_case: bool = False, start_from: int = 0, page_size: int = None,
311
+ output_format: str = 'JSON') -> list | str:
340
312
  """Returns the list of collections matching the search string. Async version.
341
313
  The search string is located in the request body and is interpreted as a plain string.
342
314
  The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
@@ -347,9 +319,6 @@ class CollectionManager(Client):
347
319
  Search string to use to find matching collections. If the search string is '*' then all glossaries returned.
348
320
  effective_time: str, [default=None], optional
349
321
  Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
350
-
351
-
352
-
353
322
  starts_with : bool, [default=False], optional
354
323
  Starts with the supplied string.
355
324
  ends_with : bool, [default=False], optional
@@ -361,6 +330,8 @@ class CollectionManager(Client):
361
330
  page_size: int, [default=None]
362
331
  The number of items to return in a single page. If not specified, the default will be taken from
363
332
  the class instance.
333
+ output_format: str, default = "JSON"
334
+ - one of "DICT", "MERMAID" or "JSON"
364
335
  Returns
365
336
  -------
366
337
  List | str
@@ -380,26 +351,13 @@ class CollectionManager(Client):
380
351
  """
381
352
  loop = asyncio.get_event_loop()
382
353
  resp = loop.run_until_complete(
383
- self._async_find_collections(
384
- search_string,
385
- effective_time,
386
- starts_with,
387
- ends_with,
388
- ignore_case,
389
- start_from,
390
- page_size,
391
- )
392
- )
354
+ self._async_find_collections(search_string, effective_time, starts_with, ends_with, ignore_case, start_from,
355
+ page_size, output_format))
393
356
 
394
357
  return resp
395
358
 
396
- async def _async_get_collections_by_name(
397
- self,
398
- name: str,
399
- effective_time: str = None,
400
- start_from: int = 0,
401
- page_size: int = None,
402
- ) -> list | str:
359
+ async def _async_get_collections_by_name(self, name: str, effective_time: str = None, start_from: int = 0,
360
+ page_size: int = None, output_format: str = 'JSON') -> list | str:
403
361
  """Returns the list of collections with a particular name.
404
362
 
405
363
  Parameters
@@ -416,6 +374,8 @@ class CollectionManager(Client):
416
374
  page_size: int, [default=None]
417
375
  The number of items to return in a single page. If not specified, the default will be taken from
418
376
  the class instance.
377
+ output_format: str, default = "JSON"
378
+ - one of "DICT", "MERMAID" or "JSON"
419
379
  Returns
420
380
  -------
421
381
  List | str
@@ -440,25 +400,23 @@ class CollectionManager(Client):
440
400
  validate_search_string(name)
441
401
 
442
402
  body = {
443
- "filter": name,
444
- effective_time: effective_time,
445
- }
403
+ "filter": name, effective_time: effective_time,
404
+ }
446
405
  body_s = body_slimmer(body)
447
- url = (
448
- f"{self.collection_command_root}/"
449
- f"by-name?startFrom={start_from}&pageSize={page_size}"
450
- )
406
+ url = (f"{self.collection_command_root}/"
407
+ f"by-name?startFrom={start_from}&pageSize={page_size}")
451
408
 
452
- resp = await self._async_make_request("POST", url, body_s)
453
- return resp.json().get("elements", "No elements found")
409
+ response = await self._async_make_request("POST", url, body_s)
410
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
411
+ if type(elements) is str:
412
+ return NO_ELEMENTS_FOUND
454
413
 
455
- def get_collections_by_name(
456
- self,
457
- name: str,
458
- effective_time: str = None,
459
- start_from: int = 0,
460
- page_size: int = None,
461
- ) -> list | str:
414
+ if output_format != 'JSON': # return a simplified markdown representation
415
+ return self.generate_collection_output(elements, filter, output_format)
416
+ return elements
417
+
418
+ def get_collections_by_name(self, name: str, effective_time: str = None, start_from: int = 0, page_size: int = None,
419
+ output_format: str = 'JSON') -> list | str:
462
420
  """Returns the list of collections matching the search string. Async version.
463
421
  The search string is located in the request body and is interpreted as a plain string.
464
422
  The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
@@ -469,14 +427,13 @@ class CollectionManager(Client):
469
427
  name to use to find matching collections.
470
428
  effective_time: str, [default=None], optional
471
429
  Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
472
-
473
-
474
-
475
430
  start_from: int, [default=0], optional
476
431
  When multiple pages of results are available, the page number to start from.
477
432
  page_size: int, [default=None]
478
433
  The number of items to return in a single page. If not specified, the default will be taken from
479
434
  the class instance.
435
+ output_format: str, default = "JSON"
436
+ - one of "DICT", "MERMAID" or "JSON"
480
437
 
481
438
  Returns
482
439
  -------
@@ -497,20 +454,12 @@ class CollectionManager(Client):
497
454
  """
498
455
  loop = asyncio.get_event_loop()
499
456
  resp = loop.run_until_complete(
500
- self._async_get_collections_by_name(
501
- name, effective_time, start_from, page_size
502
- )
503
- )
457
+ self._async_get_collections_by_name(name, effective_time, start_from, page_size, output_format))
504
458
 
505
459
  return resp
506
460
 
507
- async def _async_get_collections_by_type(
508
- self,
509
- collection_type: str,
510
- effective_time: str = None,
511
- start_from: int = 0,
512
- page_size: int = None,
513
- ) -> list | str:
461
+ async def _async_get_collections_by_type(self, collection_type: str, effective_time: str = None,
462
+ start_from: int = 0, page_size: int = None, output_format: str = 'JSON') -> list | str:
514
463
  """Returns the list of collections with a particular collectionType. This is an optional text field in the
515
464
  collection element.
516
465
 
@@ -520,14 +469,13 @@ class CollectionManager(Client):
520
469
  collection_type to use to find matching collections.
521
470
  effective_time: str, [default=None], optional
522
471
  Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
523
-
524
-
525
-
526
472
  start_from: int, [default=0], optional
527
473
  When multiple pages of results are available, the page number to start from.
528
474
  page_size: int, [default=None]
529
475
  The number of items to return in a single page. If not specified, the default will be taken from
530
476
  the class instance.
477
+ output_format: str, default = "JSON"
478
+ - one of "DICT", "MERMAID" or "JSON"
531
479
 
532
480
  Returns
533
481
  -------
@@ -553,26 +501,24 @@ class CollectionManager(Client):
553
501
  validate_search_string(collection_type)
554
502
 
555
503
  body = {
556
- "filter": collection_type,
557
- effective_time: effective_time,
558
- }
504
+ "filter": collection_type, effective_time: effective_time,
505
+ }
559
506
  body_s = body_slimmer(body)
560
507
 
561
- url = (
562
- f"{self.collection_command_root}/"
563
- f"by-collection-type?startFrom={start_from}&pageSize={page_size}"
564
- )
508
+ url = (f"{self.collection_command_root}/"
509
+ f"by-collection-type?startFrom={start_from}&pageSize={page_size}")
565
510
 
566
- resp = await self._async_make_request("POST", url, body_s)
567
- return resp.json().get("elements", "No elements found")
511
+ response = await self._async_make_request("POST", url, body_s)
512
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
513
+ if type(elements) is str:
514
+ return NO_ELEMENTS_FOUND
568
515
 
569
- def get_collections_by_type(
570
- self,
571
- collection_type: str,
572
- effective_time: str = None,
573
- start_from: int = 0,
574
- page_size: int = None,
575
- ) -> list | str:
516
+ if output_format != 'JSON': # return a simplified markdown representation
517
+ return self.generate_collection_output(elements, filter, output_format)
518
+ return elements
519
+
520
+ def get_collections_by_type(self, collection_type: str, effective_time: str = None, start_from: int = 0,
521
+ page_size: int = None, output_format: str = 'JSON') -> list | str:
576
522
  """Returns the list of collections matching the search string. Async version.
577
523
  The search string is located in the request body and is interpreted as a plain string.
578
524
  The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
@@ -583,14 +529,13 @@ class CollectionManager(Client):
583
529
  collection type to find.
584
530
  effective_time: str, [default=None], optional
585
531
  Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
586
-
587
-
588
-
589
532
  start_from: int, [default=0], optional
590
533
  When multiple pages of results are available, the page number to start from.
591
534
  page_size: int, [default=None]
592
535
  The number of items to return in a single page. If not specified, the default will be taken from
593
536
  the class instance.
537
+ output_format: str, default = "JSON"
538
+ - one of "DICT", "MERMAID" or "JSON"
594
539
 
595
540
  Returns
596
541
  -------
@@ -611,16 +556,12 @@ class CollectionManager(Client):
611
556
  """
612
557
  loop = asyncio.get_event_loop()
613
558
  resp = loop.run_until_complete(
614
- self._async_get_collections_by_type(
615
- collection_type, effective_time, start_from, page_size
616
- )
617
- )
559
+ self._async_get_collections_by_type(collection_type, effective_time, start_from, page_size, output_format))
618
560
 
619
561
  return resp
620
562
 
621
- async def _async_get_collection(
622
- self, collection_guid: str, effective_time: str = None
623
- ) -> dict | str:
563
+ async def _async_get_collection_by_guid(self, collection_guid: str, effective_time: str = None,
564
+ output_format: str = 'JSON') -> dict | str:
624
565
  """Return the properties of a specific collection. Async version.
625
566
 
626
567
  Parameters
@@ -629,9 +570,8 @@ class CollectionManager(Client):
629
570
  unique identifier of the collection.
630
571
  effective_time: str, [default=None], optional
631
572
  Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
632
-
633
-
634
-
573
+ output_format: str, default = "JSON"
574
+ - one of "DICT", "MERMAID" or "JSON"
635
575
 
636
576
  Returns
637
577
  -------
@@ -656,13 +596,18 @@ class CollectionManager(Client):
656
596
  url = f"{self.collection_command_root}/{collection_guid}"
657
597
  body = {
658
598
  "effective_time": effective_time,
659
- }
660
- resp = await self._async_make_request("GET", url, body)
661
- return resp.json()
599
+ }
600
+ response = await self._async_make_request("GET", url, body)
601
+ elements = response.json().get("element", NO_ELEMENTS_FOUND)
602
+ if type(elements) is str:
603
+ return NO_ELEMENTS_FOUND
662
604
 
663
- def get_collection(
664
- self, collection_guid: str, effective_time: str = None
665
- ) -> dict | str:
605
+ if output_format != 'JSON': # return a simplified markdown representation
606
+ return self.generate_collection_output(elements, filter, output_format)
607
+ return elements
608
+
609
+ def get_collection_by_guid(self, collection_guid: str, effective_time: str = None,
610
+ output_format: str = 'JSON') -> dict | str:
666
611
  """Return the properties of a specific collection.
667
612
 
668
613
  Parameters
@@ -671,9 +616,8 @@ class CollectionManager(Client):
671
616
  unique identifier of the collection.
672
617
  effective_time: str, [default=None], optional
673
618
  Effective time of the query. If not specified will default to any time.
674
-
675
-
676
-
619
+ output_format: str, default = "JSON"
620
+ - one of "DICT", "MERMAID" or "JSON"
677
621
 
678
622
  Returns
679
623
  -------
@@ -694,17 +638,36 @@ class CollectionManager(Client):
694
638
  """
695
639
  loop = asyncio.get_event_loop()
696
640
  resp = loop.run_until_complete(
697
- self._async_get_collection(collection_guid, effective_time)
698
- )
641
+ self._async_get_collection_by_guid(collection_guid, effective_time, output_format))
699
642
 
700
643
  return resp
701
644
 
702
645
  #
703
646
  # Create collection methods
704
647
  #
705
- async def _async_create_collection_w_body(
706
- self, classification_name: str, body: dict
707
- ) -> str:
648
+
649
+ ###
650
+ # =====================================================================================================================
651
+ # Create Collections: https://egeria-project.org/concepts/collection
652
+ # These requests use the following parameters:
653
+ #
654
+ # anchorGUID - the unique identifier of the element that should be the anchor for the new element. Set to null if
655
+ # no anchor,
656
+ # or if this collection is to be its own anchor.
657
+ #
658
+ # isOwnAnchor -this element should be classified as its own anchor or not. The default is false.
659
+ #
660
+ # parentGUID - the optional unique identifier for an element that should be connected to the newly created element.
661
+ # If this property is specified, parentRelationshipTypeName must also be specified
662
+ #
663
+ # parentRelationshipTypeName - the name of the relationship, if any, that should be established between the new
664
+ # element and the parent element.
665
+ # Examples could be "ResourceList" or "DigitalServiceProduct".
666
+ #
667
+ # parentAtEnd1 -identifies which end any parent entity sits on the relationship.
668
+ #
669
+
670
+ async def _async_create_collection_w_body(self, classification_name: str, body: dict) -> str:
708
671
  """Create Collections: https://egeria-project.org/concepts/collection Async version.
709
672
 
710
673
  Parameters
@@ -730,12 +693,40 @@ class CollectionManager(Client):
730
693
  NotAuthorizedException
731
694
  The principle specified by the user_id does not have authorization for the requested action
732
695
 
696
+ Notes:
697
+ -----
698
+
699
+ Sample body:
700
+ {
701
+ "isOwnAnchor" : true,
702
+ "collectionProperties": {
703
+ "class" : "CollectionProperties",
704
+ "qualifiedName": "Must provide a unique name here",
705
+ "name" : "Add display name here",
706
+ "description" : "Add description of the collection here",
707
+ "collectionType": "Add appropriate valid value for type"
708
+ }
709
+ }
710
+ or
711
+ {
712
+ "anchorGUID" : "anchor GUID, if set then isOwnAnchor=false",
713
+ "isOwnAnchor" : false,
714
+ "anchorScopeGUID" : "optional GUID of search scope",
715
+ "parentGUID" : "parent GUID, if set, set all parameters beginning 'parent'",
716
+ "parentRelationshipTypeName" : "open metadata type name",
717
+ "parentAtEnd1": true,
718
+ "collectionProperties": {
719
+ "class" : "CollectionProperties",
720
+ "qualifiedName": "Must provide a unique name here",
721
+ "name" : "Add display name here",
722
+ "description" : "Add description of the collection here",
723
+ "collectionType": "Add appropriate valid value for type"
724
+ }
725
+ }
733
726
  """
734
727
 
735
- url = (
736
- f"{self.collection_command_root}?"
737
- f"classificationName={classification_name}"
738
- )
728
+ url = (f"{self.collection_command_root}?"
729
+ f"classificationName={classification_name}")
739
730
 
740
731
  resp = await self._async_make_request("POST", url, body)
741
732
  return resp.json().get("guid", "No GUID returned")
@@ -768,27 +759,46 @@ class CollectionManager(Client):
768
759
  NotAuthorizedException
769
760
  The principle specified by the user_id does not have authorization for the requested action
770
761
 
762
+
763
+ Notes:
764
+ -----
765
+
766
+ Sample body:
767
+ {
768
+ "isOwnAnchor" : true,
769
+ "collectionProperties": {
770
+ "class" : "CollectionProperties",
771
+ "qualifiedName": "Must provide a unique name here",
772
+ "name" : "Add display name here",
773
+ "description" : "Add description of the collection here",
774
+ "collectionType": "Add appropriate valid value for type"
775
+ }
776
+ }
777
+ or
778
+ {
779
+ "anchorGUID" : "anchor GUID, if set then isOwnAnchor=false",
780
+ "isOwnAnchor" : false,
781
+ "anchorScopeGUID" : "optional GUID of search scope",
782
+ "parentGUID" : "parent GUID, if set, set all parameters beginning 'parent'",
783
+ "parentRelationshipTypeName" : "open metadata type name",
784
+ "parentAtEnd1": true,
785
+ "collectionProperties": {
786
+ "class" : "CollectionProperties",
787
+ "qualifiedName": "Must provide a unique name here",
788
+ "name" : "Add display name here",
789
+ "description" : "Add description of the collection here",
790
+ "collectionType": "Add appropriate valid value for type"
791
+ }
792
+ }
771
793
  """
772
794
  loop = asyncio.get_event_loop()
773
- resp = loop.run_until_complete(
774
- self._async_create_collection_w_body(classification_name, body)
775
- )
795
+ resp = loop.run_until_complete(self._async_create_collection_w_body(classification_name, body))
776
796
  return resp
777
797
 
778
- async def _async_create_collection(
779
- self,
780
- classification_name: str,
781
- anchor_guid: str,
782
- parent_guid: str,
783
- parent_relationship_type_name: str,
784
- parent_at_end1: bool,
785
- display_name: str,
786
- description: str,
787
- collection_type: str,
788
- is_own_anchor: bool = False,
789
- collection_ordering: str = None,
790
- order_property_name: str = None,
791
- ) -> str:
798
+ async def _async_create_collection(self, classification_name: str, anchor_guid: str, parent_guid: str,
799
+ parent_relationship_type_name: str, parent_at_end1: bool, display_name: str, description: str,
800
+ collection_type: str, anchor_scope_guid: str = None, is_own_anchor: bool = False,
801
+ collection_ordering: str = None, order_property_name: str = None, ) -> str:
792
802
  """Create Collections: https://egeria-project.org/concepts/collection Async version.
793
803
 
794
804
  Parameters
@@ -812,9 +822,11 @@ class CollectionManager(Client):
812
822
  description: str
813
823
  A description of the collection.
814
824
  collection_type: str
815
- Add appropriate valid value for the collection type.
825
+ Adds an appropriate valid value for the collection type.
826
+ anchor_scope_guid: str, optional, defaults to None
827
+ optional GUID of search scope
816
828
  is_own_anchor: bool, optional, defaults to False
817
- Indicates if the collection should classified as its own anchor or not.
829
+ Indicates if the collection should be classified as its own anchor or not.
818
830
  collection_ordering: str, optional, defaults to "OTHER"
819
831
  Specifies the sequencing to use in a collection. Examples include "NAME", "OWNER", "DATE_CREATED",
820
832
  "OTHER"
@@ -842,46 +854,28 @@ class CollectionManager(Client):
842
854
  if parent_guid is None:
843
855
  is_own_anchor = False
844
856
  is_own_anchor_s = str(is_own_anchor).lower()
857
+ parent_at_end1_s = str(parent_at_end1).lower()
845
858
 
846
- url = (
847
- f"{self.collection_command_root}?"
848
- f"classificationName={classification_name}"
849
- )
859
+ url = (f"{self.collection_command_root}?"
860
+ f"classificationName={classification_name}")
850
861
 
851
862
  body = {
852
- "anchorGUID": anchor_guid,
853
- "isOwnAnchor": is_own_anchor_s,
854
- "parentGUID": parent_guid,
855
- "parentRelationshipTypeName": parent_relationship_type_name,
856
- "parentAtEnd1": parent_at_end1,
857
- "collectionProperties": {
858
- "class": "CollectionProperties",
859
- "qualifiedName": f"{classification_name}-{display_name}-{time.asctime()}",
860
- "name": display_name,
861
- "description": description,
862
- "collectionType": collection_type,
863
- "collectionOrdering": collection_ordering,
864
- "orderPropertyName": order_property_name,
865
- },
866
- }
863
+ "anchorGUID": anchor_guid, "anchorScopeGUID": anchor_scope_guid, "isOwnAnchor": is_own_anchor_s,
864
+ "parentGUID": parent_guid, "parentRelationshipTypeName": parent_relationship_type_name,
865
+ "parentAtEnd1": parent_at_end1_s, "collectionProperties": {
866
+ "class": "CollectionProperties", "qualifiedName": f"{classification_name}::{display_name}",
867
+ "name": display_name, "description": description, "collectionType": collection_type,
868
+ "collectionOrdering": collection_ordering, "orderPropertyName": order_property_name,
869
+ },
870
+ }
867
871
 
868
- resp = await self._async_make_request("POST", url, body)
872
+ resp = await self._async_make_request("POST", url, body_slimmer(body))
869
873
  return resp.json().get("guid", "No GUID returned")
870
874
 
871
- def create_collection(
872
- self,
873
- classification_name: str,
874
- anchor_guid: str,
875
- parent_guid: str,
876
- parent_relationship_type_name: str,
877
- parent_at_end1: bool,
878
- display_name: str,
879
- description: str,
880
- collection_type: str,
881
- is_own_anchor: bool = False,
882
- collection_ordering: str = "OTHER",
883
- order_property_name: str = "Something",
884
- ) -> str:
875
+ def create_collection(self, classification_name: str, anchor_guid: str, parent_guid: str,
876
+ parent_relationship_type_name: str, parent_at_end1: bool, display_name: str, description: str,
877
+ collection_type: str, anchor_scope_guid: str = None, is_own_anchor: bool = False,
878
+ collection_ordering: str = "OTHER", order_property_name: str = "Something", ) -> str:
885
879
  """Create Collections: https://egeria-project.org/concepts/collection
886
880
 
887
881
  Parameters
@@ -906,9 +900,11 @@ class CollectionManager(Client):
906
900
  description: str
907
901
  A description of the collection.
908
902
  collection_type: str
909
- Add appropriate valid value for the collection type.
903
+ Adds an appropriate valid value for the collection type.
904
+ anchor_scope_guid: str, optional, defaults to None
905
+ optional GUID of search scope
910
906
  is_own_anchor: bool, optional, defaults to False
911
- Indicates if the collection should classified as its own anchor or not.
907
+ Indicates if the collection should be classified as its own anchor or not.
912
908
  collection_ordering: str, optional, defaults to "OTHER"
913
909
  Specifies the sequencing to use in a collection. Examples include "NAME", "OWNER",
914
910
  "DATE_CREATED", "OTHER"
@@ -920,8 +916,6 @@ class CollectionManager(Client):
920
916
  -------
921
917
  str - the guid of the created collection
922
918
 
923
- A JSON dict representing the specified collection. Returns a string if none found.
924
-
925
919
  Raises
926
920
  ------
927
921
  InvalidParameterException
@@ -934,33 +928,14 @@ class CollectionManager(Client):
934
928
  """
935
929
  loop = asyncio.get_event_loop()
936
930
  resp = loop.run_until_complete(
937
- self._async_create_collection(
938
- classification_name,
939
- anchor_guid,
940
- parent_guid,
941
- parent_relationship_type_name,
942
- parent_at_end1,
943
- display_name,
944
- description,
945
- collection_type,
946
- is_own_anchor,
947
- collection_ordering,
948
- order_property_name,
949
- )
950
- )
931
+ self._async_create_collection(classification_name, anchor_guid, parent_guid, parent_relationship_type_name,
932
+ parent_at_end1, display_name, description, collection_type, anchor_scope_guid, is_own_anchor,
933
+ collection_ordering, order_property_name))
951
934
  return resp
952
935
 
953
- async def _async_create_root_collection(
954
- self,
955
- anchor_guid: str,
956
- parent_guid: str,
957
- parent_relationship_type_name: str,
958
- parent_at_end1: bool,
959
- display_name: str,
960
- description: str,
961
- collection_type: str,
962
- is_own_anchor: bool = False,
963
- ) -> str:
936
+ async def _async_create_root_collection(self, anchor_guid: str, parent_guid: str,
937
+ parent_relationship_type_name: str, parent_at_end1: bool, display_name: str, description: str,
938
+ collection_type: str, anchor_scope_guid: str = None, is_own_anchor: bool = False, ) -> str:
964
939
  """Create a new collection with the RootCollection classification. Used to identify the top of a
965
940
  collection hierarchy. Async version.
966
941
 
@@ -982,16 +957,16 @@ class CollectionManager(Client):
982
957
  description: str
983
958
  A description of the collection.
984
959
  collection_type: str
985
- Add appropriate valid value for the collection type.
960
+ Adds an appropriate valid value for the collection type.
961
+ anchor_scope_guid: str, optional, defaults to None
962
+ optional GUID of search scope
986
963
  is_own_anchor: bool, optional, defaults to False
987
- Indicates if the collection should classified as its own anchor or not.
964
+ Indicates if the collection should be classified as its own anchor or not.
988
965
 
989
966
  Returns
990
967
  -------
991
968
  str - the guid of the created collection
992
969
 
993
- A JSON dict representing the specified collection. Returns a string if none found.
994
-
995
970
  Raises
996
971
  ------
997
972
  InvalidParameterException
@@ -1004,37 +979,24 @@ class CollectionManager(Client):
1004
979
  """
1005
980
 
1006
981
  is_own_anchor_s = str(is_own_anchor).lower()
982
+ parent_at_end1_s = str(parent_at_end1).lower()
1007
983
  url = f"{self.collection_command_root}/root-collection"
1008
984
 
1009
985
  body = {
1010
- "anchorGUID": anchor_guid,
1011
- "isOwnAnchor": is_own_anchor_s,
1012
- "parentGUID": parent_guid,
1013
- "parentRelationshipTypeName": parent_relationship_type_name,
1014
- "parentAtEnd1": parent_at_end1,
1015
- "collectionProperties": {
1016
- "class": "CollectionProperties",
1017
- "qualifiedName": f"root-collection-{display_name}-{time.asctime()}",
1018
- "name": display_name,
1019
- "description": description,
1020
- "collectionType": collection_type,
1021
- },
1022
- }
986
+ "anchorGUID": anchor_guid, "isOwnAnchor": is_own_anchor_s, "anchorScopeGUID": anchor_scope_guid,
987
+ "parentGUID": parent_guid, "parentRelationshipTypeName": parent_relationship_type_name,
988
+ "parentAtEnd1": parent_at_end1_s, "collectionProperties": {
989
+ "class": "CollectionProperties", "qualifiedName": f"root-collection::{display_name}",
990
+ "name": display_name, "description": description, "collectionType": collection_type,
991
+ },
992
+ }
1023
993
 
1024
- resp = await self._async_make_request("POST", url, body)
994
+ resp = await self._async_make_request("POST", url, body_slimmer(body))
1025
995
  return resp.json().get("guid", "No GUID Returned")
1026
996
 
1027
- def create_root_collection(
1028
- self,
1029
- anchor_guid: str,
1030
- parent_guid: str,
1031
- parent_relationship_type_name: str,
1032
- parent_at_end1: bool,
1033
- display_name: str,
1034
- description: str,
1035
- collection_type: str,
1036
- is_own_anchor: bool = False,
1037
- ) -> str:
997
+ def create_root_collection(self, anchor_guid: str, parent_guid: str, parent_relationship_type_name: str,
998
+ parent_at_end1: bool, display_name: str, description: str, collection_type: str,
999
+ anchor_scope_guid: str = None, is_own_anchor: bool = False, ) -> str:
1038
1000
  """Create a new collection with the RootCollection classification. Used to identify the top of a
1039
1001
  collection hierarchy.
1040
1002
 
@@ -1057,16 +1019,16 @@ class CollectionManager(Client):
1057
1019
  description: str
1058
1020
  A description of the collection.
1059
1021
  collection_type: str
1060
- Add appropriate valid value for the collection type.
1022
+ Adds an appropriate valid value for the collection type.
1023
+ anchor_scope_guid: str, optional, defaults to None
1024
+ optional GUID of search scope
1061
1025
  is_own_anchor: bool, optional, defaults to False
1062
- Indicates if the collection should classified as its own anchor or not.
1026
+ Indicates if the collection should be classified as its own anchor or not.
1063
1027
 
1064
1028
  Returns
1065
1029
  -------
1066
1030
  str - the guid of the created collection
1067
1031
 
1068
- A JSON dict representing the specified collection. Returns a string if none found.
1069
-
1070
1032
  Raises
1071
1033
  ------
1072
1034
  InvalidParameterException
@@ -1079,32 +1041,15 @@ class CollectionManager(Client):
1079
1041
  """
1080
1042
  loop = asyncio.get_event_loop()
1081
1043
  resp = loop.run_until_complete(
1082
- self._async_create_root_collection(
1083
- anchor_guid,
1084
- parent_guid,
1085
- parent_relationship_type_name,
1086
- parent_at_end1,
1087
- display_name,
1088
- description,
1089
- collection_type,
1090
- is_own_anchor,
1091
- )
1092
- )
1044
+ self._async_create_root_collection(anchor_guid, parent_guid, parent_relationship_type_name, parent_at_end1,
1045
+ display_name, description, collection_type, anchor_scope_guid, is_own_anchor, ))
1093
1046
  return resp
1094
1047
 
1095
- async def _async_create_data_spec_collection(
1096
- self,
1097
- anchor_guid: str,
1098
- parent_guid: str,
1099
- parent_relationship_type_name: str,
1100
- parent_at_end1: bool,
1101
- display_name: str,
1102
- description: str,
1103
- collection_type: str,
1104
- is_own_anchor: bool = True,
1105
- collection_ordering: str = "OTHER",
1106
- order_property_name: str = "Something",
1107
- ) -> str:
1048
+ async def _async_create_data_spec_collection(self, anchor_guid: str, parent_guid: str,
1049
+ parent_relationship_type_name: str, parent_at_end1: bool, display_name: str, description: str,
1050
+ collection_type: str, anchor_scope_guid: str = None, is_own_anchor: bool = True,
1051
+ collection_ordering: str = "OTHER", order_property_name: str = "Something",
1052
+ qualified_name: str = None, ) -> str:
1108
1053
  """Create a new collection with the DataSpec classification. Used to identify a collection of data fields
1109
1054
  and schema types. Async version.
1110
1055
 
@@ -1126,20 +1071,23 @@ class CollectionManager(Client):
1126
1071
  description: str
1127
1072
  A description of the collection.
1128
1073
  collection_type: str
1129
- Add appropriate valid value for the collection type.
1074
+ Adds an appropriate valid value for the collection type.
1075
+ anchor_scope_guid: str, optional, defaults to None
1076
+ optional GUID of search scope
1130
1077
  is_own_anchor: bool, optional, defaults to False
1131
- Indicates if the collection should classified as its own anchor or not.
1078
+ Indicates if the collection should be classified as its own anchor or not.
1132
1079
  collection_ordering: str, optional, defaults to "OTHER"
1133
1080
  Specifies the sequencing to use in a collection. Examples include "NAME", "OWNER",
1134
1081
  "DATE_CREATED", "OTHER"
1135
1082
  order_property_name: str, optional, defaults to "Something"
1136
1083
  Property to use for sequencing if collection_ordering is "OTHER"
1084
+ qualified_name: str, optional, defaults to None
1085
+ If not specified, a unique name will be created for the collection.
1137
1086
 
1138
1087
  Returns
1139
1088
  -------
1140
1089
  str - the guid of the created collection
1141
1090
 
1142
- A JSON dict representing the specified collection. Returns a string if none found.
1143
1091
 
1144
1092
  Raises
1145
1093
  ------
@@ -1152,41 +1100,28 @@ class CollectionManager(Client):
1152
1100
  """
1153
1101
 
1154
1102
  is_own_anchor_s = str(is_own_anchor).lower()
1103
+ parent_at_end1_s = str(parent_at_end1).lower()
1155
1104
  url = f"{self.collection_command_root}/data-spec-collection"
1105
+ if qualified_name is None:
1106
+ qualified_name = self.__create_qualified_name__("DataSpec", display_name)
1156
1107
 
1157
1108
  body = {
1158
- "anchorGUID": anchor_guid,
1159
- "isOwnAnchor": is_own_anchor_s,
1160
- "parentGUID": parent_guid,
1161
- "parentRelationshipTypeName": parent_relationship_type_name,
1162
- "parentAtEnd1": parent_at_end1,
1163
- "collectionProperties": {
1164
- "class": "CollectionProperties",
1165
- "qualifiedName": f"data-spec-collection-{display_name}-{time.asctime()}",
1166
- "name": display_name,
1167
- "description": description,
1168
- "collectionType": collection_type,
1169
- "collectionOrdering": collection_ordering,
1170
- "orderPropertyName": order_property_name,
1171
- },
1172
- }
1109
+ "anchorGUID": anchor_guid, "anchorScopeGUID": anchor_scope_guid, "isOwnAnchor": is_own_anchor_s,
1110
+ "parentGUID": parent_guid, "parentRelationshipTypeName": parent_relationship_type_name,
1111
+ "parentAtEnd1": parent_at_end1_s, "collectionProperties": {
1112
+ "class": "CollectionProperties", "qualifiedName": qualified_name, "name": display_name,
1113
+ "description": description, "collectionType": collection_type,
1114
+ "collectionOrdering": collection_ordering, "orderPropertyName": order_property_name,
1115
+ },
1116
+ }
1173
1117
 
1174
- resp = await self._async_make_request("POST", url, body)
1118
+ resp = await self._async_make_request("POST", url, body_slimmer(body))
1175
1119
  return resp.json().get("guid", "No GUID Returned")
1176
1120
 
1177
- def create_data_spec_collection(
1178
- self,
1179
- anchor_guid: str,
1180
- parent_guid: str,
1181
- parent_relationship_type_name: str,
1182
- parent_at_end1: bool,
1183
- display_name: str,
1184
- description: str,
1185
- collection_type: str,
1186
- is_own_anchor: bool,
1187
- collection_ordering: str = "OTHER",
1188
- order_property_name: str = "Something",
1189
- ) -> str:
1121
+ def create_data_spec_collection(self, anchor_guid: str, parent_guid: str, parent_relationship_type_name: str,
1122
+ parent_at_end1: bool, display_name: str, description: str, collection_type: str,
1123
+ anchor_scope_guid: str = None, is_own_anchor: bool = False, collection_ordering: str = "OTHER",
1124
+ order_property_name: str = "Something", qualified_name: str = None, ) -> str:
1190
1125
  """Create a new collection with the DataSpec classification. Used to identify a collection of data fields
1191
1126
  and schema types.
1192
1127
 
@@ -1208,21 +1143,151 @@ class CollectionManager(Client):
1208
1143
  description: str
1209
1144
  A description of the collection.
1210
1145
  collection_type: str
1211
- Add appropriate valid value for the collection type.
1146
+ Adds an appropriate valid value for the collection type.
1147
+ anchor_scope_guid: str, optional, defaults to None
1148
+ optional GUID of search scope
1212
1149
  is_own_anchor: bool, optional, defaults to False
1213
- Indicates if the collection should classified as its own anchor or not.
1150
+ Indicates if the collection should be classified as its own anchor or not.
1214
1151
  collection_ordering: str, optional, defaults to "OTHER"
1215
1152
  Specifies the sequencing to use in a collection. Examples include "NAME", "OWNER", "DATE_CREATED", "OTHER"
1216
1153
  order_property_name: str, optional, defaults to "Something"
1217
1154
  Property to use for sequencing if collection_ordering is "OTHER"
1155
+ qualified_name: str, optional, defaults to None
1156
+ If not specified, a unique name will be created for the collection.
1218
1157
 
1158
+ Returns
1159
+ -------
1160
+ str - the guid of the created collection
1219
1161
 
1162
+ Raises
1163
+ ------
1164
+ InvalidParameterException
1165
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1166
+ PropertyServerException
1167
+ Raised by the server when an issue arises in processing a valid request
1168
+ NotAuthorizedException
1169
+ The principle specified by the user_id does not have authorization for the requested action
1170
+
1171
+ """
1172
+ loop = asyncio.get_event_loop()
1173
+ resp = loop.run_until_complete(
1174
+ self._async_create_data_spec_collection(anchor_guid, parent_guid, parent_relationship_type_name,
1175
+ parent_at_end1, display_name, description, collection_type, anchor_scope_guid, is_own_anchor,
1176
+ collection_ordering, order_property_name, qualified_name, ))
1177
+ return resp
1178
+
1179
+ async def _async_create_data_dictionary_collection(self, anchor_guid: str, parent_guid: str,
1180
+ parent_relationship_type_name: str, parent_at_end1: bool, display_name: str, description: str,
1181
+ collection_type: str, anchor_scope_guid: str = None, is_own_anchor: bool = True,
1182
+ collection_ordering: str = "OTHER", order_property_name: str = "Something",
1183
+ qualified_name: str = None, ) -> str:
1184
+ """ Create a new collection with the Data Dictionary classification. Used to identify a collection of
1185
+ data fields that represent a data store collection of common data types. Async version.
1220
1186
 
1187
+ Parameters
1188
+ ----------
1189
+ anchor_guid: str
1190
+ The unique identifier of the element that should be the anchor for the new element.
1191
+ Set to null if no anchor, or if this collection is to be its own anchor.
1192
+ parent_guid: str
1193
+ The optional unique identifier for an element that should be connected to the newly created element.
1194
+ If this property is specified, parentRelationshipTypeName must also be specified
1195
+ parent_relationship_type_name: str
1196
+ The name of the relationship, if any, that should be established between the new element and the parent
1197
+ element. Examples could be "ResourceList" or "DigitalServiceProduct".
1198
+ parent_at_end1: bool
1199
+ Identifies which end any parent entity sits on the relationship.
1200
+ display_name: str
1201
+ The display name of the element. Will also be used as the basis of the qualified_name.
1202
+ description: str
1203
+ A description of the collection.
1204
+ collection_type: str
1205
+ Add an appropriate valid value for the collection type.
1206
+ anchor_scope_guid: str, optional, defaults to None
1207
+ GUID for search scope
1208
+ is_own_anchor: bool, optional, defaults to False
1209
+ Indicates if the collection should be classified as its own anchor or not.
1210
+ collection_ordering: str, optional, defaults to "OTHER"
1211
+ Specifies the sequencing to use in a collection. Examples include "NAME", "OWNER",
1212
+ "DATE_CREATED", "OTHER"
1213
+ order_property_name: str, optional, defaults to "Something"
1214
+ Property to use for sequencing if collection_ordering is "OTHER"
1215
+ qualified_name: str, optional, defaults to None
1216
+ If not specified a qualified name will be generated from the display name and the collection type.
1221
1217
  Returns
1222
1218
  -------
1223
1219
  str - the guid of the created collection
1224
1220
 
1225
- A JSON dict representing the specified collection. Returns a string if none found.
1221
+
1222
+ Raises
1223
+ ------
1224
+ InvalidParameterException
1225
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1226
+ PropertyServerException
1227
+ Raised by the server when an issue arises in processing a valid request
1228
+ NotAuthorizedException
1229
+ The principle specified by the user_id does not have authorization for the requested action
1230
+ """
1231
+
1232
+ is_own_anchor_s = str(is_own_anchor).lower()
1233
+ parent_at_end1_s = str(parent_at_end1).lower()
1234
+ url = f"{self.collection_command_root}/data-dictionary-collection"
1235
+ if qualified_name is None:
1236
+ qualified_name = self.__create_qualified_name__("DataDict", display_name)
1237
+
1238
+ body = {
1239
+ "anchorGUID": anchor_guid, "isOwnAnchor": is_own_anchor_s, "anchorScopeGUID": anchor_scope_guid,
1240
+ "parentGUID": parent_guid, "parentRelationshipTypeName": parent_relationship_type_name,
1241
+ "parentAtEnd1": parent_at_end1_s, "collectionProperties": {
1242
+ "class": "CollectionProperties", "qualifiedName": qualified_name, "name": display_name,
1243
+ "description": description, "collectionType": collection_type,
1244
+ "collectionOrdering": collection_ordering, "orderPropertyName": order_property_name,
1245
+ },
1246
+ }
1247
+
1248
+ resp = await self._async_make_request("POST", url, body_slimmer(body))
1249
+ return resp.json().get("guid", "No GUID Returned")
1250
+
1251
+ def create_data_dictionary_collection(self, anchor_guid: str, parent_guid: str, parent_relationship_type_name: str,
1252
+ parent_at_end1: bool, display_name: str, description: str, collection_type: str,
1253
+ anchor_scope_guid: str = None, is_own_anchor: bool = False, collection_ordering: str = "OTHER",
1254
+ order_property_name: str = "Something", qualified_name: str = None, ) -> str:
1255
+ """Create a new collection with the DataSpec classification. Used to identify a collection of data fields
1256
+ and schema types.
1257
+
1258
+ Parameters
1259
+ ----------
1260
+ anchor_guid: str
1261
+ The unique identifier of the element that should be the anchor for the new element.
1262
+ Set to null if no anchor, or if this collection is to be its own anchor.
1263
+ parent_guid: str
1264
+ The optional unique identifier for an element that should be connected to the newly created element.
1265
+ If this property is specified, parentRelationshipTypeName must also be specified
1266
+ parent_relationship_type_name: str
1267
+ The name of the relationship, if any, that should be established between the new element and the parent
1268
+ element. Examples could be "ResourceList" or "DigitalServiceProduct".
1269
+ parent_at_end1: bool
1270
+ Identifies which end any parent entity sits on the relationship.
1271
+ display_name: str
1272
+ The display name of the element. Will also be used as the basis of the qualified_name.
1273
+ description: str
1274
+ A description of the collection.
1275
+ collection_type: str
1276
+ Adds an appropriate valid value for the collection type.
1277
+ anchor_scope_guid: str, optional, defaults to None
1278
+ optional GUID of search scope
1279
+ is_own_anchor: bool, optional, defaults to False
1280
+ Indicates if the collection should be classified as its own anchor or not.
1281
+ collection_ordering: str, optional, defaults to "OTHER"
1282
+ Specifies the sequencing to use in a collection. Examples include "NAME", "OWNER", "DATE_CREATED", "OTHER"
1283
+ order_property_name: str, optional, defaults to "Something"
1284
+ Property to use for sequencing if collection_ordering is "OTHER"
1285
+ qualified_name: str, optional, defaults to None
1286
+ If not specified a qualified name will be generated from the display name and the collection type.
1287
+
1288
+ Returns
1289
+ -------
1290
+ str - the guid of the created collection
1226
1291
 
1227
1292
  Raises
1228
1293
  ------
@@ -1236,34 +1301,15 @@ class CollectionManager(Client):
1236
1301
  """
1237
1302
  loop = asyncio.get_event_loop()
1238
1303
  resp = loop.run_until_complete(
1239
- self._async_create_data_spec_collection(
1240
- anchor_guid,
1241
- parent_guid,
1242
- parent_relationship_type_name,
1243
- parent_at_end1,
1244
- display_name,
1245
- description,
1246
- collection_type,
1247
- is_own_anchor,
1248
- collection_ordering,
1249
- order_property_name,
1250
- )
1251
- )
1304
+ self._async_create_data_dictionary_collection(anchor_guid, parent_guid, parent_relationship_type_name,
1305
+ parent_at_end1, display_name, description, collection_type, anchor_scope_guid, is_own_anchor,
1306
+ collection_ordering, order_property_name, qualified_name))
1252
1307
  return resp
1253
1308
 
1254
- async def _async_create_folder_collection(
1255
- self,
1256
- anchor_guid: str,
1257
- parent_guid: str,
1258
- parent_relationship_type_name: str,
1259
- parent_at_end1: bool,
1260
- display_name: str,
1261
- description: str,
1262
- collection_type: str,
1263
- is_own_anchor: bool = True,
1264
- collection_ordering: str = "OTHER",
1265
- order_property_name: str = "Something",
1266
- ) -> str:
1309
+ async def _async_create_folder_collection(self, anchor_guid: str, parent_guid: str,
1310
+ parent_relationship_type_name: str, parent_at_end1: bool, display_name: str, description: str,
1311
+ collection_type: str, anchor_scope_guid: str = None, is_own_anchor: bool = True,
1312
+ collection_ordering: str = "OTHER", order_property_name: str = "Something", ) -> str:
1267
1313
  """Create a new collection with the Folder classification. This is used to identify the organizing
1268
1314
  collections in a collection hierarchy. Async version.
1269
1315
 
@@ -1285,9 +1331,11 @@ class CollectionManager(Client):
1285
1331
  description: str
1286
1332
  A description of the collection.
1287
1333
  collection_type: str
1288
- Add appropriate valid value for the collection type.
1334
+ Adds an appropriate valid value for the collection type.
1335
+ anchor_scope_guid: str, optional, defaults to None
1336
+ optional GUID of search scope
1289
1337
  is_own_anchor: bool, optional, defaults to False
1290
- Indicates if the collection should classified as its own anchor or not.
1338
+ Indicates if the collection should be classified as its own anchor or not.
1291
1339
  collection_ordering: str, optional, defaults to "OTHER"
1292
1340
  Specifies the sequencing to use in a collection. Examples include "NAME", "OWNER",
1293
1341
  "DATE_CREATED", "OTHER"
@@ -1298,8 +1346,6 @@ class CollectionManager(Client):
1298
1346
  -------
1299
1347
  str - the guid of the created collection
1300
1348
 
1301
- A JSON dict representing the specified collection. Returns a string if none found.
1302
-
1303
1349
  Raises
1304
1350
  ------
1305
1351
  InvalidParameterException
@@ -1312,42 +1358,26 @@ class CollectionManager(Client):
1312
1358
  """
1313
1359
 
1314
1360
  is_own_anchor_s = str(is_own_anchor).lower()
1315
-
1361
+ parent_at_end1_s = str(parent_at_end1).lower()
1316
1362
  url = f"{self.collection_command_root}/folder"
1317
1363
 
1318
1364
  body = {
1319
- "anchorGUID": anchor_guid,
1320
- "isOwnAnchor": is_own_anchor_s,
1321
- "parentGUID": parent_guid,
1322
- "parentRelationshipTypeName": parent_relationship_type_name,
1323
- "parentAtEnd1": parent_at_end1,
1324
- "collectionProperties": {
1325
- "class": "CollectionProperties",
1326
- "qualifiedName": f"folder-collection-{display_name}-{time.asctime()}",
1327
- "name": display_name,
1328
- "description": description,
1329
- "collectionType": collection_type,
1330
- "collectionOrdering": collection_ordering,
1331
- "orderPropertyName": order_property_name,
1332
- },
1333
- }
1365
+ "anchorGUID": anchor_guid, "anchorScopeGUID": anchor_scope_guid, "isOwnAnchor": is_own_anchor_s,
1366
+ "parentGUID": parent_guid, "parentRelationshipTypeName": parent_relationship_type_name,
1367
+ "parentAtEnd1": parent_at_end1_s, "collectionProperties": {
1368
+ "class": "CollectionProperties", "qualifiedName": f"folder-collection::{display_name}",
1369
+ "name": display_name, "description": description, "collectionType": collection_type,
1370
+ "collectionOrdering": collection_ordering, "orderPropertyName": order_property_name,
1371
+ },
1372
+ }
1334
1373
 
1335
- resp = await self._async_make_request("POST", url, body)
1374
+ resp = await self._async_make_request("POST", url, body_slimmer(body))
1336
1375
  return resp.json().get("guid", "No GUID returned")
1337
1376
 
1338
- def create_folder_collection(
1339
- self,
1340
- anchor_guid: str,
1341
- parent_guid: str,
1342
- parent_relationship_type_name: str,
1343
- parent_at_end1: bool,
1344
- display_name: str,
1345
- description: str,
1346
- collection_type: str,
1347
- is_own_anchor: bool,
1348
- collection_ordering: str = "OTHER",
1349
- order_property_name: str = "Something",
1350
- ) -> str:
1377
+ def create_folder_collection(self, anchor_guid: str, parent_guid: str, parent_relationship_type_name: str,
1378
+ parent_at_end1: bool, display_name: str, description: str, collection_type: str,
1379
+ anchor_scope_guid: str = None, is_own_anchor: bool = True, collection_ordering: str = "OTHER",
1380
+ order_property_name: str = "Something", ) -> str:
1351
1381
  """Create a new collection with the Folder classification. This is used to identify the organizing
1352
1382
  collections in a collection hierarchy.
1353
1383
 
@@ -1369,9 +1399,11 @@ class CollectionManager(Client):
1369
1399
  description: str
1370
1400
  A description of the collection.
1371
1401
  collection_type: str
1372
- Add appropriate valid value for the collection type.
1402
+ Adds an appropriate valid value for the collection type.
1403
+ anchor_scope_guid: str, optional, defaults to None
1404
+ optional GUID of search scope
1373
1405
  is_own_anchor: bool, optional, defaults to False
1374
- Indicates if the collection should classified as its own anchor or not.
1406
+ Indicates if the collection should be classified as its own anchor or not.
1375
1407
  collection_ordering: str, optional, defaults to "OTHER"
1376
1408
  Specifies the sequencing to use in a collection. Examples include "NAME", "OWNER", "DATE_CREATED",
1377
1409
  "OTHER"
@@ -1382,7 +1414,6 @@ class CollectionManager(Client):
1382
1414
  -------
1383
1415
  str - the guid of the created collection
1384
1416
 
1385
- A JSON dict representing the specified collection. Returns a string if none found.
1386
1417
 
1387
1418
  Raises
1388
1419
  ------
@@ -1396,19 +1427,9 @@ class CollectionManager(Client):
1396
1427
  """
1397
1428
  loop = asyncio.get_event_loop()
1398
1429
  resp = loop.run_until_complete(
1399
- self._async_create_folder_collection(
1400
- anchor_guid,
1401
- parent_guid,
1402
- parent_relationship_type_name,
1403
- parent_at_end1,
1404
- display_name,
1405
- description,
1406
- collection_type,
1407
- is_own_anchor,
1408
- collection_ordering,
1409
- order_property_name,
1410
- )
1411
- )
1430
+ self._async_create_folder_collection(anchor_guid, parent_guid, parent_relationship_type_name,
1431
+ parent_at_end1, display_name, description, collection_type, anchor_scope_guid, is_own_anchor,
1432
+ collection_ordering, order_property_name, ))
1412
1433
  return resp
1413
1434
 
1414
1435
  async def _async_create_collection_from_template(self, body: dict) -> str:
@@ -1523,9 +1544,7 @@ class CollectionManager(Client):
1523
1544
  }
1524
1545
  """
1525
1546
  loop = asyncio.get_event_loop()
1526
- resp = loop.run_until_complete(
1527
- self._async_create_collection_from_template(body)
1528
- )
1547
+ resp = loop.run_until_complete(self._async_create_collection_from_template(body))
1529
1548
  return resp
1530
1549
 
1531
1550
  async def _async_create_digital_product(self, body: dict) -> str:
@@ -1665,17 +1684,9 @@ class CollectionManager(Client):
1665
1684
  #
1666
1685
  # Manage collections
1667
1686
  #
1668
- async def _async_update_collection(
1669
- self,
1670
- collection_guid: str,
1671
- qualified_name: str = None,
1672
- display_name: str = None,
1673
- description: str = None,
1674
- collection_type: str = None,
1675
- collection_ordering: str = None,
1676
- order_property_name: str = None,
1677
- replace_all_props: bool = False,
1678
- ) -> None:
1687
+ async def _async_update_collection(self, collection_guid: str, qualified_name: str = None, display_name: str = None,
1688
+ description: str = None, collection_type: str = None, collection_ordering: str = None,
1689
+ order_property_name: str = None, replace_all_props: bool = False, ) -> None:
1679
1690
  """Update the properties of a collection. Async version.
1680
1691
 
1681
1692
  Parameters
@@ -1716,35 +1727,21 @@ class CollectionManager(Client):
1716
1727
  """
1717
1728
 
1718
1729
  replace_all_props_s = str(replace_all_props).lower()
1719
- url = (
1720
- f"{self.collection_command_root}/{collection_guid}/update?"
1721
- f"replaceAllProperties={replace_all_props_s}"
1722
- )
1730
+ url = (f"{self.collection_command_root}/{collection_guid}/update?"
1731
+ f"replaceAllProperties={replace_all_props_s}")
1723
1732
 
1724
1733
  body = {
1725
- "class": "CollectionProperties",
1726
- "qualifiedName": qualified_name,
1727
- "name": display_name,
1728
- "description": description,
1729
- "collectionType": collection_type,
1730
- "collectionOrdering": collection_ordering,
1734
+ "class": "CollectionProperties", "qualifiedName": qualified_name, "name": display_name,
1735
+ "description": description, "collectionType": collection_type, "collectionOrdering": collection_ordering,
1731
1736
  "orderPropertyName": order_property_name,
1732
- }
1737
+ }
1733
1738
  body_s = body_slimmer(body)
1734
1739
  await self._async_make_request("POST", url, body_s)
1735
1740
  return
1736
1741
 
1737
- def update_collection(
1738
- self,
1739
- collection_guid,
1740
- qualified_name: str = None,
1741
- display_name: str = None,
1742
- description: str = None,
1743
- collection_type: str = None,
1744
- collection_ordering: str = None,
1745
- order_property_name: str = None,
1746
- replace_all_props: bool = False,
1747
- ) -> None:
1742
+ def update_collection(self, collection_guid, qualified_name: str = None, display_name: str = None,
1743
+ description: str = None, collection_type: str = None, collection_ordering: str = None,
1744
+ order_property_name: str = None, replace_all_props: bool = False, ) -> None:
1748
1745
  """Update the properties of a collection.
1749
1746
 
1750
1747
  Parameters
@@ -1785,25 +1782,11 @@ class CollectionManager(Client):
1785
1782
  """
1786
1783
  loop = asyncio.get_event_loop()
1787
1784
  loop.run_until_complete(
1788
- self._async_update_collection(
1789
- collection_guid,
1790
- qualified_name,
1791
- display_name,
1792
- description,
1793
- collection_type,
1794
- collection_ordering,
1795
- order_property_name,
1796
- replace_all_props,
1797
- )
1798
- )
1785
+ self._async_update_collection(collection_guid, qualified_name, display_name, description, collection_type,
1786
+ collection_ordering, order_property_name, replace_all_props, ))
1799
1787
  return
1800
1788
 
1801
- async def _async_update_digital_product(
1802
- self,
1803
- collection_guid: str,
1804
- body: dict,
1805
- replace_all_props: bool = False,
1806
- ):
1789
+ async def _async_update_digital_product(self, collection_guid: str, body: dict, replace_all_props: bool = False, ):
1807
1790
  """Update the properties of the DigitalProduct classification attached to a collection. Async version.
1808
1791
 
1809
1792
  Parameters
@@ -1852,20 +1835,13 @@ class CollectionManager(Client):
1852
1835
  """
1853
1836
 
1854
1837
  replace_all_props_s = str(replace_all_props).lower()
1855
- url = (
1856
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/digital-products/"
1857
- f"{collection_guid}/update?replaceAllProperties={replace_all_props_s}"
1858
- )
1838
+ url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/digital-products/"
1839
+ f"{collection_guid}/update?replaceAllProperties={replace_all_props_s}")
1859
1840
 
1860
1841
  await self._async_make_request("POST", url, body)
1861
1842
  return
1862
1843
 
1863
- def update_digital_product(
1864
- self,
1865
- collection_guid: str,
1866
- body: dict,
1867
- replace_all_props: bool = False,
1868
- ):
1844
+ def update_digital_product(self, collection_guid: str, body: dict, replace_all_props: bool = False, ):
1869
1845
  """Update the properties of the DigitalProduct classification attached to a collection.
1870
1846
 
1871
1847
  Parameters
@@ -1913,22 +1889,13 @@ class CollectionManager(Client):
1913
1889
  }
1914
1890
  """
1915
1891
  loop = asyncio.get_event_loop()
1916
- loop.run_until_complete(
1917
- self._async_update_digital_product(collection_guid, body, replace_all_props)
1918
- )
1892
+ loop.run_until_complete(self._async_update_digital_product(collection_guid, body, replace_all_props))
1919
1893
  return
1920
1894
 
1921
- async def _async_attach_collection(
1922
- self,
1923
- collection_guid: str,
1924
- element_guid: str,
1925
- resource_use: str,
1926
- resource_use_description: str = None,
1927
- resource_use_props: dict = None,
1928
- watch_resources: bool = False,
1929
- make_anchor: bool = False,
1930
- ) -> None:
1931
- """Connect an existing collection to an element using the ResourceList relationship (0019). Async version.
1895
+ async def _async_attach_collection(self, collection_guid: str, element_guid: str, resource_use: str,
1896
+ resource_use_description: str = None, resource_use_props: dict = None, watch_resources: bool = False,
1897
+ make_anchor: bool = False, ) -> None:
1898
+ """ Connect an existing collection to an element using the ResourceList relationship (0019). Async version.
1932
1899
  Parameters
1933
1900
  ----------
1934
1901
  collection_guid: str
@@ -1938,13 +1905,13 @@ class CollectionManager(Client):
1938
1905
  resource_use: str,
1939
1906
  How the resource is being used.
1940
1907
  resource_use_description: str
1941
- Describe how the resource is being used.
1908
+ Describes how the resource is being used.
1942
1909
  resource_use_props: dict, optional, defaults to None
1943
1910
  The properties of the resource to be used.
1944
1911
  watch_resources, bool, optional, defaults to False
1945
1912
  Whether to watch for the resources to be updated.
1946
1913
  make_anchor, bool, optional, defaults to False
1947
- Whether to make the this an anchor.
1914
+ Whether to make this an anchor.
1948
1915
 
1949
1916
 
1950
1917
  Returns
@@ -1965,31 +1932,19 @@ class CollectionManager(Client):
1965
1932
  watch_resources_s = str(watch_resources).lower()
1966
1933
  make_anchor_s = str(make_anchor).lower()
1967
1934
 
1968
- url = (
1969
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/metadata-elements/"
1970
- f"{element_guid}/collections/{collection_guid}/attach?makeAnchor={make_anchor_s}"
1971
- )
1935
+ url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/metadata-elements/"
1936
+ f"{element_guid}/collections/{collection_guid}/attach?makeAnchor={make_anchor_s}")
1972
1937
 
1973
1938
  body = {
1974
- "class": "ResourceListProperties",
1975
- "resourceUse": resource_use,
1976
- "resourceUseDescription": resource_use_description,
1977
- "watchResource": watch_resources_s,
1939
+ "class": "ResourceListProperties", "resourceUse": resource_use,
1940
+ "resourceUseDescription": resource_use_description, "watchResource": watch_resources_s,
1978
1941
  "resourceUseProperties": resource_use_props,
1979
- }
1942
+ }
1980
1943
  await self._async_make_request("POST", url, body)
1981
- return
1982
1944
 
1983
- def attach_collection(
1984
- self,
1985
- collection_guid: str,
1986
- element_guid: str,
1987
- resource_use: str,
1988
- resource_use_description: str,
1989
- resource_use_props: dict = None,
1990
- watch_resources: bool = False,
1991
- make_anchor: bool = False,
1992
- ) -> None:
1945
+ def attach_collection(self, collection_guid: str, element_guid: str, resource_use: str,
1946
+ resource_use_description: str, resource_use_props: dict = None, watch_resources: bool = False,
1947
+ make_anchor: bool = False, ) -> None:
1993
1948
  """Connect an existing collection to an element using the ResourceList relationship (0019).
1994
1949
  Parameters
1995
1950
  ----------
@@ -2027,21 +1982,11 @@ class CollectionManager(Client):
2027
1982
  """
2028
1983
  loop = asyncio.get_event_loop()
2029
1984
  loop.run_until_complete(
2030
- self._async_attach_collection(
2031
- collection_guid,
2032
- element_guid,
2033
- resource_use,
2034
- resource_use_description,
2035
- resource_use_props,
2036
- watch_resources,
2037
- make_anchor,
2038
- )
2039
- )
1985
+ self._async_attach_collection(collection_guid, element_guid, resource_use, resource_use_description,
1986
+ resource_use_props, watch_resources, make_anchor, ))
2040
1987
  return
2041
1988
 
2042
- async def _async_detach_collection(
2043
- self, collection_guid: str, element_guid: str
2044
- ) -> None:
1989
+ async def _async_detach_collection(self, collection_guid: str, element_guid: str) -> None:
2045
1990
  """Detach an existing collection from an element. If the collection is anchored to the element, it is deleted.
2046
1991
  Async version.
2047
1992
 
@@ -2070,10 +2015,8 @@ class CollectionManager(Client):
2070
2015
 
2071
2016
  """
2072
2017
 
2073
- url = (
2074
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/metadata-elements/"
2075
- f"{element_guid}/collections/{collection_guid}/detach"
2076
- )
2018
+ url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/metadata-elements/"
2019
+ f"{element_guid}/collections/{collection_guid}/detach")
2077
2020
 
2078
2021
  body = {"class": "NullRequestBody"}
2079
2022
 
@@ -2107,12 +2050,10 @@ class CollectionManager(Client):
2107
2050
 
2108
2051
  """
2109
2052
  loop = asyncio.get_event_loop()
2110
- loop.run_until_complete(
2111
- self._async_detach_collection(collection_guid, element_guid)
2112
- )
2053
+ loop.run_until_complete(self._async_detach_collection(collection_guid, element_guid))
2113
2054
  return
2114
2055
 
2115
- async def _async_delete_collection(self, collection_guid: str) -> None:
2056
+ async def _async_delete_collection(self, collection_guid: str, cascade: bool = False) -> None:
2116
2057
  """Delete a collection. It is detected from all parent elements. If members are anchored to the collection
2117
2058
  then they are also deleted. Async version
2118
2059
 
@@ -2122,8 +2063,8 @@ class CollectionManager(Client):
2122
2063
  collection_guid: str
2123
2064
  The guid of the collection to update.
2124
2065
 
2125
- If not provided, the server name associated
2126
- with the instance is used.
2066
+ cascade: bool, optional, defaults to True
2067
+ If true, a cascade delete is performed.
2127
2068
 
2128
2069
  Returns
2129
2070
  -------
@@ -2139,14 +2080,14 @@ class CollectionManager(Client):
2139
2080
  The principle specified by the user_id does not have authorization for the requested action
2140
2081
 
2141
2082
  """
2142
-
2143
- url = f"{self.collection_command_root}/{collection_guid}/delete"
2083
+ cascade_s = str(cascade).lower()
2084
+ url = f"{self.collection_command_root}/{collection_guid}/delete?cascadedDelete={cascade_s}"
2144
2085
  body = {"class": "NullRequestBody"}
2145
2086
 
2146
2087
  await self._async_make_request("POST", url, body)
2147
2088
  return
2148
2089
 
2149
- def delete_collection(self, collection_guid: str) -> None:
2090
+ def delete_collection(self, collection_guid: str, cascade:bool=False) -> None:
2150
2091
  """Delete a collection. It is detected from all parent elements. If members are anchored to the collection
2151
2092
  then they are also deleted.
2152
2093
 
@@ -2155,8 +2096,8 @@ class CollectionManager(Client):
2155
2096
  collection_guid: str
2156
2097
  The guid of the collection to update.
2157
2098
 
2158
- If not provided, the server name associated
2159
- with the instance is used.
2099
+ cascade: bool, optional, defaults to True
2100
+ If true, a cascade delete is performed.
2160
2101
 
2161
2102
  Returns
2162
2103
  -------
@@ -2174,18 +2115,11 @@ class CollectionManager(Client):
2174
2115
 
2175
2116
  """
2176
2117
  loop = asyncio.get_event_loop()
2177
- loop.run_until_complete(self._async_delete_collection(collection_guid))
2118
+ loop.run_until_complete(self._async_delete_collection(collection_guid, cascade))
2178
2119
  return
2179
2120
 
2180
- async def _async_get_collection_members(
2181
- self,
2182
- collection_guid: str = None,
2183
- collection_name: str = None,
2184
- collection_qname: str = None,
2185
- effective_time: str = None,
2186
- start_from: int = 0,
2187
- page_size: int = None,
2188
- ) -> list | str:
2121
+ async def _async_get_collection_members(self, collection_guid: str = None, collection_name: str = None,
2122
+ collection_qname: str = None, start_from: int = 0, page_size: int = None, ) -> list | str:
2189
2123
  """Return a list of elements that are a member of a collection. Async version.
2190
2124
 
2191
2125
  Parameters
@@ -2194,13 +2128,11 @@ class CollectionManager(Client):
2194
2128
  identity of the collection to return members for. If none, collection_name or
2195
2129
  collection_qname are used.
2196
2130
  collection_name: str,
2197
- display name of the collection to return members for. If none, collection_guid
2131
+ display the name of the collection to return members for. If none, collection_guid
2198
2132
  or collection_qname are used.
2199
2133
  collection_qname: str,
2200
2134
  qualified name of the collection to return members for. If none, collection_guid
2201
2135
  or collection_name are used.
2202
- effective_time: str, [default=None], optional
2203
- Effective time of the query. If not specified will default to any time.
2204
2136
  start_from: int, [default=0], optional
2205
2137
  When multiple pages of results are available, the page number to start from.
2206
2138
  page_size: int, [default=None]
@@ -2226,30 +2158,17 @@ class CollectionManager(Client):
2226
2158
 
2227
2159
  if page_size is None:
2228
2160
  page_size = self.page_size
2229
- collection_guid = self.__get_guid__(
2230
- collection_guid,
2231
- collection_name,
2232
- "name",
2233
- collection_qname,
2234
- None,
2235
- )
2236
- url = (
2237
- f"{self.collection_command_root}/{collection_guid}/"
2238
- f"members?startFrom={start_from}&pageSize={page_size}"
2239
- )
2161
+ if collection_guid is None:
2162
+ collection_guid = self.__get_guid__(collection_guid, collection_name, "name", collection_qname, None, )
2163
+
2164
+ url = (f"{self.collection_command_root}/{collection_guid}/"
2165
+ f"members?startFrom={start_from}&pageSize={page_size}")
2240
2166
 
2241
2167
  resp = await self._async_make_request("GET", url)
2242
- return resp.json().get("elements", "No elements found")
2243
-
2244
- def get_collection_members(
2245
- self,
2246
- collection_guid: str = None,
2247
- collection_name: str = None,
2248
- collection_qname: str = None,
2249
- effective_time: str = None,
2250
- start_from: int = 0,
2251
- page_size: int = None,
2252
- ) -> list | str:
2168
+ return resp.json().get("elements", NO_ELEMENTS_FOUND)
2169
+
2170
+ def get_collection_members(self, collection_guid: str = None, collection_name: str = None,
2171
+ collection_qname: str = None, start_from: int = 0, page_size: int = None, ) -> list | str:
2253
2172
  """Return a list of elements that are a member of a collection. Async version.
2254
2173
 
2255
2174
  Parameters
@@ -2258,13 +2177,11 @@ class CollectionManager(Client):
2258
2177
  identity of the collection to return members for. If none, collection_name or
2259
2178
  collection_qname are used.
2260
2179
  collection_name: str,
2261
- display name of the collection to return members for. If none, collection_guid
2180
+ display the name of the collection to return members for. If none, collection_guid
2262
2181
  or collection_qname are used.
2263
2182
  collection_qname: str,
2264
2183
  qualified name of the collection to return members for. If none, collection_guid
2265
2184
  or collection_name are used.
2266
- effective_time: str, [default=None], optional
2267
- Effective time of the query. If not specified will default to any time.
2268
2185
  start_from: int, [default=0], optional
2269
2186
  When multiple pages of results are available, the page number to start from.
2270
2187
  page_size: int, [default=None]
@@ -2289,24 +2206,12 @@ class CollectionManager(Client):
2289
2206
  """
2290
2207
  loop = asyncio.get_event_loop()
2291
2208
  resp = loop.run_until_complete(
2292
- self._async_get_collection_members(
2293
- collection_guid,
2294
- collection_name,
2295
- collection_qname,
2296
- effective_time,
2297
- start_from,
2298
- page_size,
2299
- )
2300
- )
2209
+ self._async_get_collection_members(collection_guid, collection_name, collection_qname, start_from,
2210
+ page_size, ))
2301
2211
 
2302
2212
  return resp
2303
2213
 
2304
- async def _async_add_to_collection(
2305
- self,
2306
- collection_guid: str,
2307
- element_guid: str,
2308
- body: dict = None,
2309
- ) -> None:
2214
+ async def _async_add_to_collection(self, collection_guid: str, element_guid: str, body: dict = None, ) -> None:
2310
2215
  """Add an element to a collection. The request body is optional. Async version.
2311
2216
 
2312
2217
  Parameters
@@ -2355,20 +2260,13 @@ class CollectionManager(Client):
2355
2260
 
2356
2261
  """
2357
2262
 
2358
- url = (
2359
- f"{self.collection_command_root}/{collection_guid}/members/"
2360
- f"{element_guid}/attach"
2361
- )
2263
+ url = (f"{self.collection_command_root}/{collection_guid}/members/"
2264
+ f"{element_guid}/attach")
2362
2265
  body_s = body_slimmer(body)
2363
2266
  await self._async_make_request("POST", url, body_s)
2364
2267
  return
2365
2268
 
2366
- def add_to_collection(
2367
- self,
2368
- collection_guid: str,
2369
- element_guid: str,
2370
- body: dict = None,
2371
- ) -> None:
2269
+ def add_to_collection(self, collection_guid: str, element_guid: str, body: dict = None, ) -> None:
2372
2270
  """Add an element to a collection. The request body is optional.
2373
2271
 
2374
2272
  Parameters
@@ -2417,18 +2315,11 @@ class CollectionManager(Client):
2417
2315
 
2418
2316
  """
2419
2317
  loop = asyncio.get_event_loop()
2420
- loop.run_until_complete(
2421
- self._async_add_to_collection(collection_guid, element_guid, body)
2422
- )
2318
+ loop.run_until_complete(self._async_add_to_collection(collection_guid, element_guid, body))
2423
2319
  return
2424
2320
 
2425
- async def _async_update_collection_membership(
2426
- self,
2427
- collection_guid: str,
2428
- element_guid: str,
2429
- body: dict = None,
2430
- replace_all_props: bool = False,
2431
- ) -> None:
2321
+ async def _async_update_collection_membership(self, collection_guid: str, element_guid: str, body: dict = None,
2322
+ replace_all_props: bool = False, ) -> None:
2432
2323
  """Update an element's membership to a collection. Async version.
2433
2324
 
2434
2325
  Parameters
@@ -2480,21 +2371,14 @@ class CollectionManager(Client):
2480
2371
  """
2481
2372
 
2482
2373
  replace_all_props_s = str(replace_all_props).lower()
2483
- url = (
2484
- f"{self.collection_command_root}/{collection_guid}/members/"
2485
- f"{element_guid}/update?replaceAllProperties={replace_all_props_s}"
2486
- )
2374
+ url = (f"{self.collection_command_root}/{collection_guid}/members/"
2375
+ f"{element_guid}/update?replaceAllProperties={replace_all_props_s}")
2487
2376
  body_s = body_slimmer(body)
2488
2377
  await self._async_make_request("POST", url, body_s)
2489
2378
  return
2490
2379
 
2491
- def update_collection_membership(
2492
- self,
2493
- collection_guid: str,
2494
- element_guid: str,
2495
- body: dict = None,
2496
- replace_all_props: bool = False,
2497
- ) -> None:
2380
+ def update_collection_membership(self, collection_guid: str, element_guid: str, body: dict = None,
2381
+ replace_all_props: bool = False, ) -> None:
2498
2382
  """Update an element's membership to a collection.
2499
2383
 
2500
2384
  Parameters
@@ -2546,15 +2430,10 @@ class CollectionManager(Client):
2546
2430
  """
2547
2431
  loop = asyncio.get_event_loop()
2548
2432
  loop.run_until_complete(
2549
- self._async_update_collection_membership(
2550
- collection_guid, element_guid, body, replace_all_props
2551
- )
2552
- )
2433
+ self._async_update_collection_membership(collection_guid, element_guid, body, replace_all_props))
2553
2434
  return
2554
2435
 
2555
- async def _async_remove_from_collection(
2556
- self, collection_guid: str, element_guid: str
2557
- ) -> None:
2436
+ async def _async_remove_from_collection(self, collection_guid: str, element_guid: str) -> None:
2558
2437
  """Remove an element from a collection. Async version.
2559
2438
 
2560
2439
  Parameters
@@ -2583,10 +2462,8 @@ class CollectionManager(Client):
2583
2462
 
2584
2463
  """
2585
2464
 
2586
- url = (
2587
- f"{self.collection_command_root}/{collection_guid}/members/"
2588
- f"{element_guid}/detach"
2589
- )
2465
+ url = (f"{self.collection_command_root}/{collection_guid}/members/"
2466
+ f"{element_guid}/detach")
2590
2467
  body = {"class": "NullRequestBody"}
2591
2468
  await self._async_make_request("POST", url, body)
2592
2469
  return
@@ -2620,17 +2497,11 @@ class CollectionManager(Client):
2620
2497
 
2621
2498
  """
2622
2499
  loop = asyncio.get_event_loop()
2623
- loop.run_until_complete(
2624
- self._async_remove_from_collection(collection_guid, element_guid)
2625
- )
2500
+ loop.run_until_complete(self._async_remove_from_collection(collection_guid, element_guid))
2626
2501
  return
2627
2502
 
2628
- async def _async_get_member_list(
2629
- self,
2630
- collection_guid: str = None,
2631
- collection_name: str = None,
2632
- collection_qname: str = None,
2633
- ) -> list | bool:
2503
+ async def _async_get_member_list(self, collection_guid: str = None, collection_name: str = None,
2504
+ collection_qname: str = None, ) -> list | bool:
2634
2505
  """Get the member list for the collection - async version.
2635
2506
  Parameters
2636
2507
  ----------
@@ -2660,37 +2531,32 @@ class CollectionManager(Client):
2660
2531
 
2661
2532
  # now find the members of the collection
2662
2533
  member_list = []
2663
- members = await self._async_get_collection_members(
2664
- collection_guid, collection_name, collection_qname
2665
- )
2534
+ members = await self._async_get_collection_members(collection_guid, collection_name, collection_qname)
2666
2535
  if (type(members) is str) or (len(members) == 0):
2667
2536
  return "No members found"
2668
2537
  # finally, construct a list of member information
2669
2538
  for member_rel in members:
2670
2539
  member_guid = member_rel["elementHeader"]["guid"]
2671
- member_resp = await self._async_get_collection(member_guid)
2672
- member = member_resp.get("element", None)
2673
- if member is None:
2540
+ member_resp = await self._async_get_collection_by_guid(member_guid)
2541
+ if isinstance(member_resp,(dict,list)):
2542
+ member = member_resp.get("element", None)
2543
+ if member is None:
2544
+ continue
2545
+ else:
2674
2546
  continue
2675
2547
  # print(json.dumps(member, indent = 4))
2676
2548
 
2677
2549
  member_instance = {
2678
- "name": member["properties"]["name"],
2679
- "qualifiedName": member["properties"]["qualifiedName"],
2680
- "guid": member["elementHeader"]["guid"],
2681
- "description": member["properties"]["description"],
2550
+ "name": member["properties"]["name"], "qualifiedName": member["properties"]["qualifiedName"],
2551
+ "guid": member["elementHeader"]["guid"], "description": member["properties"]["description"],
2682
2552
  "collectionType": member["properties"]["collectionType"],
2683
- }
2553
+ }
2684
2554
  member_list.append(member_instance)
2685
2555
 
2686
2556
  return member_list if len(member_list) > 0 else "No members found"
2687
2557
 
2688
- def get_member_list(
2689
- self,
2690
- collection_guid: str = None,
2691
- collection_name: str = None,
2692
- collection_qname: str = None,
2693
- ) -> list | bool:
2558
+ def get_member_list(self, collection_guid: str = None, collection_name: str = None,
2559
+ collection_qname: str = None, ) -> list | bool:
2694
2560
  """Get the member list for the collection - async version.
2695
2561
  Parameters
2696
2562
  ----------
@@ -2715,13 +2581,164 @@ class CollectionManager(Client):
2715
2581
 
2716
2582
  """
2717
2583
  loop = asyncio.get_event_loop()
2718
- resp = loop.run_until_complete(
2719
- self._async_get_member_list(
2720
- collection_guid, collection_name, collection_qname
2721
- )
2722
- )
2584
+ resp = loop.run_until_complete(self._async_get_member_list(collection_guid, collection_name, collection_qname))
2723
2585
  return resp
2724
2586
 
2587
+ def _extract_collection_properties(self, element: dict) -> dict:
2588
+ """
2589
+ Extract common properties from a collection element.
2590
+
2591
+ Args:
2592
+ element (dict): The collection element
2593
+
2594
+ Returns:
2595
+ dict: Dictionary of extracted properties
2596
+ """
2597
+ guid = element['elementHeader'].get("guid", None)
2598
+ properties = element['properties']
2599
+ display_name = properties.get("name", "") or ""
2600
+ description = properties.get("description", "") or ""
2601
+ qualified_name = properties.get("qualifiedName", "") or ""
2602
+ collection_type = properties.get("collectionType", "") or ""
2603
+ classifications = "\n* ".join(properties.get("classifications", [])) or ""
2604
+ # classification_names = ""
2605
+ # classifications = element['elementHeader'].get("classifications", [])
2606
+ # for classification in classifications:
2607
+ # classification_names += f"{classification['classificationName']}, "
2608
+
2609
+
2610
+
2611
+ return {
2612
+ 'guid': guid,
2613
+ 'properties': properties,
2614
+ 'display_name': display_name,
2615
+ 'description': description,
2616
+ 'qualified_name': qualified_name,
2617
+ 'classifications': classifications,
2618
+ 'collection_type': collection_type
2619
+ }
2620
+
2621
+ def generate_basic_structured_output(self, elements, filter, output_format) -> str | list:
2622
+ """
2623
+ Generate output in the specified format for the given elements.
2624
+
2625
+ Args:
2626
+ elements: Dictionary or list of dictionaries containing element data
2627
+ filter: The search string used to find the elements
2628
+ output_format: The desired output format (MD, FORM, REPORT, LIST, DICT, MERMAID)
2629
+
2630
+ Returns:
2631
+ Formatted output as string or list of dictionaries
2632
+ """
2633
+ # Handle MERMAID and DICT formats using existing methods
2634
+ if output_format == "MERMAID":
2635
+ return extract_mermaid_only(elements)
2636
+ elif output_format == "DICT":
2637
+ return extract_basic_dict(elements)
2638
+
2639
+ # For other formats (MD, FORM, REPORT, LIST), use generate_output
2640
+ elif output_format in ["MD", "FORM", "REPORT", "LIST"]:
2641
+ # Define columns for LIST format
2642
+ columns = [
2643
+ {'name': 'Collection Name', 'key': 'display_name'},
2644
+ {'name': 'Qualified Name', 'key': 'qualified_name'},
2645
+ {'name': 'Collection Type', 'key': 'collection_type'},
2646
+ {'name': 'Classifications', 'key': 'classifications'},
2647
+ {'name': 'Description', 'key': 'description', 'format': True}
2648
+ ]
2649
+
2650
+ return generate_output(
2651
+ elements=elements,
2652
+ search_string=filter,
2653
+ entity_type="Collection",
2654
+ output_format=output_format,
2655
+ extract_properties_func=self._extract_collection_properties,
2656
+ columns=columns if output_format == 'LIST' else None
2657
+ )
2658
+
2659
+ # Default case
2660
+ return None
2661
+
2662
+ def generate_collection_output(self, elements, filter, output_format) -> str | list | dict:
2663
+ """
2664
+ Generate output in the specified format for the given elements.
2665
+
2666
+ Args:
2667
+ elements: Dictionary or list of dictionaries containing element data
2668
+ filter: The search string used to find the elements
2669
+ output_format: The desired output format (MD, FORM, REPORT, LIST, DICT, MERMAID, JSON)
2670
+
2671
+ Returns:
2672
+ Formatted output as string or list of dictionaries
2673
+ """
2674
+ # For LIST and DICT formats, get member information
2675
+ if output_format in ["LIST", "DICT"]:
2676
+ # Get the collection GUID
2677
+ collection_guid = None
2678
+ if isinstance(elements, dict):
2679
+ collection_guid = elements.get('elementHeader', {}).get('guid')
2680
+ elif isinstance(elements, list) and len(elements) > 0:
2681
+ collection_guid = elements[0].get('elementHeader', {}).get('guid')
2682
+
2683
+ # Get member list if we have a valid collection GUID
2684
+ members = []
2685
+ if collection_guid:
2686
+ members = self.get_member_list(collection_guid=collection_guid)
2687
+ if isinstance(members, str): # "No members found" case
2688
+ members = []
2689
+
2690
+ # For DICT format, include all member information in the result
2691
+ if output_format == "DICT":
2692
+ result = self.generate_basic_structured_output(elements, filter, output_format)
2693
+ if isinstance(result, list):
2694
+ for item in result:
2695
+ item['members'] = members
2696
+ return result
2697
+ elif isinstance(result, dict):
2698
+ result['members'] = members
2699
+ return result
2700
+
2701
+ # For LIST format, add a column with bulleted list of qualified names
2702
+ elif output_format == "LIST":
2703
+ # Define columns for LIST format, including the new Members column
2704
+ columns = [
2705
+ {'name': 'Collection Name', 'key': 'display_name'},
2706
+ {'name': 'Qualified Name', 'key': 'qualified_name'},
2707
+ {'name': 'Collection Type', 'key': 'collection_type'},
2708
+ {'name': 'Description', 'key': 'description', 'format': True},
2709
+ {'name': 'Classifications', 'key': 'classifications'},
2710
+ {'name': 'Members', 'key': 'members', 'format': True}
2711
+ ]
2712
+
2713
+ # Create a function to add member information to the properties
2714
+ def get_additional_props(element, guid, output_format):
2715
+ if not members:
2716
+ return {'members': ''}
2717
+
2718
+ # Create a comma-separated list of qualified names (no newlines to avoid table formatting issues)
2719
+ member_list = ", ".join([member.get('qualifiedName', '') for member in members])
2720
+ return {'members': member_list}
2721
+
2722
+ # 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
+
2733
+ # For FORM, REPORT, JSON formats, keep behavior unchanged
2734
+ return self.generate_basic_structured_output(elements, filter, output_format)
2735
+
2736
+ def generate_data_class_output(self, elements, filter, output_format) -> str | list:
2737
+ return self.generate_basic_structured_output(elements, filter, output_format)
2738
+
2739
+ def generate_data_field_output(self, elements, filter, output_format) -> str | list:
2740
+ return self.generate_basic_structured_output(elements, filter, output_format)
2741
+
2725
2742
 
2726
2743
  if __name__ == "__main__":
2727
2744
  print("Main-Collection Manager")