pyegeria 5.3.9.5__py3-none-any.whl → 5.3.9.7__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.
- {pyegeria/commands → commands}/cat/Dr-Egeria_md-orig.py +10 -11
- {pyegeria/commands → commands}/cat/dr_egeria_jupyter.py +4 -4
- {pyegeria/commands → commands}/cat/dr_egeria_md.py +36 -16
- {pyegeria/commands → commands}/cat/list_categories.py +3 -3
- {pyegeria/commands → commands}/cat/list_collections.py +59 -16
- commands/cat/list_data_structures.py +223 -0
- {pyegeria/commands → commands}/cat/list_glossaries.py +3 -3
- {pyegeria/commands → commands}/cat/list_terms.py +4 -4
- {pyegeria/commands → commands}/cli/__init__.py +1 -1
- {pyegeria/commands → commands}/cli/egeria.py +91 -87
- {pyegeria/commands → commands}/cli/egeria_cat.py +29 -29
- {pyegeria/commands → commands}/cli/egeria_login_tui.py +1 -1
- {pyegeria/commands → commands}/cli/egeria_my.py +8 -8
- {pyegeria/commands → commands}/cli/egeria_ops.py +24 -24
- {pyegeria/commands → commands}/cli/egeria_tech.py +34 -34
- commands/tech/generic_actions.py +74 -0
- {pyegeria/commands → commands}/tech/list_information_supply_chains.py +3 -1
- pyegeria/__init__.py +11 -9
- pyegeria/_client.py +2 -49
- pyegeria/collection_manager_omvs.py +484 -735
- pyegeria/data_designer_omvs.py +251 -103
- pyegeria/egeria_client.py +5 -0
- pyegeria/egeria_tech_client.py +10 -1
- pyegeria/glossary_browser_omvs.py +144 -260
- pyegeria/md_processing_helpers.py +1 -1
- pyegeria/md_processing_utils.py +114 -32
- pyegeria/md_processing_utils_orig.py +19 -19
- pyegeria/mermaid_utilities.py +2 -2
- pyegeria/output_formatter.py +389 -0
- {pyegeria-5.3.9.5.dist-info → pyegeria-5.3.9.7.dist-info}/METADATA +1 -1
- pyegeria-5.3.9.7.dist-info/RECORD +141 -0
- pyegeria-5.3.9.7.dist-info/entry_points.txt +99 -0
- pyegeria/commands/README.md +0 -47
- pyegeria/commands/__init__.py +0 -30
- pyegeria/commands/cat/dr_egeria_inbox/glossary_creation_experiment.ipynb +0 -341
- pyegeria/commands/doc/README.md +0 -145
- pyegeria/commands/doc/Visual Command Reference/README.md +0 -511
- pyegeria/commands/doc/Visual Command Reference/cat/show/assets/asset-graph 2024-11-20 at 15.56.42.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/assets/assets-in-domain 2024-11-20 at 15.49.55@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/assets/elements-of-type 2024-11-20 at 16.01.35.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/assets/tech-type-elements 2024-11-20 at 16.05.05.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs-2024-11-20 at 16.17.43@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-11-25 at 20.14.50@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-12-17 at 15.48.38@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-11-25 at 20.21.25@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-12-17 at 15.52.16@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed_databases 2024-12-16 at 16.40.31@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-glossaries 2024-11-25 at 20.30.02.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-terms 2024-11-25 at 20.32.11.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/asset-types 2024-11-25 at 20.34.19@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/certification-types 2024-11-25 at 20.37.07.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/collection-graph 2024-12-12 at 11.33.18@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-collections 2024-12-10 at 14.25.51@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-todos 2024-12-12 at 11.46.30@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-user-ids 2024-12-12 at 11.51.09@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/tech-types 2024-12-12 at 11.37.20@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_dependencies 2024-12-14 at 16.24.39@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_structure 2024-12-14 at 16.21.35@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/projects/projects 2024-12-14 at 16.18.10@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/hey_egeria tui 2024-12-16 at 16.58.22@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/my/show/my_profile 2024-12-14 at 16.29.27@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/my/show/my_roles 2024-12-14 at 16.32.10@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/my/show/my_todos 2024-12-15 at 16.24.13@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/my/show/open_todos 2024-12-14 at 16.36.12@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/engines/list_engine_activity compressed 2024-12-15 at 16.48.48@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity 2024-12-15 at 16.32.55@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity compressed 2024-12-15 at 16.38.29@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_status 2024-12-15 at 16.51.26.jpeg +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_daemon_status 2024-12-15 at 16.57.12@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_targets 2024-12-15 at 17.02.19@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/platforms/monitor_platform_status 2024-12-15 at 19.53.18@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status 2024-12-15 at 19.59.39@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status full 2024-12-15 at 20.01.57@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_startup_servers 2024-12-15 at 19.56.07@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_anchored_elements 2024-12-15 at 21.25.41@2x.png +0 -0
- 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
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/info_for_guid 2024-12-16 at 11.35.29@2x.png +0 -0
- 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
- 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
- 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
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/related_elements 2024-12-16 at 14.55.01@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/show_related_specifications 2024-12-16 at 15.04.55@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/asset_types 2024-12-16 at 15.10.16@2x.png +0 -0
- 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
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/governance_action_processes 2024-12-16 at 15.13.01@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/registered_services 2024-12-16 at 16.44.54@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-16 at 16.20.34@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-19 at 10.51.54@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/valid_metadata_values 2024-12-16 at 15.31.56@2x.png +0 -0
- 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
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_technology_types 2024-12-16 at 15.39.20@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_details 2024-12-16 at 15.37.21@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_templates 2024-12-16 at 16.11.48@2x.png +0 -0
- pyegeria/commands/doc/glossary/basic-glossary-tui.md +0 -109
- pyegeria/commands/doc/glossary/images/delete-glossary-step1 2024-11-06 at 15.47.23@2x.png +0 -0
- pyegeria/commands/doc/glossary/images/delete-glossary-step2 2024-11-06 at 15.51.29@2x.png +0 -0
- pyegeria/commands/doc/glossary/images/delete-glossary-step3 2024-11-06 at 15.53.19@2x.png +0 -0
- pyegeria/commands/doc/glossary/images/delete-glossary-step4 2024-11-06 at 15.55.11@2x.png +0 -0
- pyegeria/commands/doc/glossary/images/out-create-glossary example 2024-11-05 at 20.38.04@2x.png +0 -0
- pyegeria/commands/doc/glossary/images/out-create-term 2024-11-06 at 20.48.29.png +0 -0
- pyegeria/commands/doc/glossary/images/out-delete-term 2024-11-07 at 03.57.25.png +0 -0
- pyegeria/commands/doc/glossary/images/out-display-terms-for-glossary-test 2024-11-06 at 20.51.28.png +0 -0
- pyegeria/commands/doc/glossary/images/out-export-example 2024-11-07 at 09.54.57.png +0 -0
- pyegeria/commands/doc/glossary/images/out-exported-terms 2024-11-06 at 21.06.32.png +0 -0
- pyegeria/commands/doc/glossary/images/out-glossary-list example 2024-11-05 at 20.41.02@2x.png +0 -0
- pyegeria/commands/doc/glossary/images/out-import-terms 2024-11-07 at 08.15.18.png +0 -0
- pyegeria/commands/doc/glossary/images/out-list-all-terms 2024-11-06 at 16.22.20@2x.png +0 -0
- pyegeria/commands/doc/glossary/images/out-list-terms-for-example 2024-11-06 at 16.40.12.png +0 -0
- pyegeria/commands/doc/glossary/images/out-list-terms-second 2024-11-06 at 16.45.13.png +0 -0
- pyegeria/commands/doc/glossary/images/out-pipx install pyegeria 2024-11-10 at 18.12.21.png +0 -0
- pyegeria/commands/doc/glossary/images/out-server-status-full 2024-11-10 at 18.25.14.png +0 -0
- pyegeria/commands/doc/glossary/images/out-servers-status 2024-11-10 at 18.15.42.png +0 -0
- pyegeria/commands/doc/glossary/images/out-upsert-import 2024-11-07 at 19.37.00.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-2024-11-10 at 18.26.29.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-create-glossary example 2024-11-05 at 20.34.24@2x.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-create-term 2024-11-06 at 20.46.35.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-delete-term 2024-11-07 at 03.51.57.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-display-terms-for-example 2024-11-06 at 20.56.49.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-export-example 2024-11-07 at 09.52.59.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-hey-egeria 2024-11-10 at 18.31.01.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-import-upsert-example 2024-11-07 at 10.08.37.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-list-terms-second 2024-11-06 at 16.46.34.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-load-archive.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-server-status-full 2024-11-10 at 19.14.36.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-show-glossaries 2024-11-07 at 20.00.05.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-show-glossary-terms 2024-11-05 at 19.37.53@2x.png +0 -0
- pyegeria/commands/doc/glossary/images/tui-upsert 2024-11-07 at 11.49.04.png +0 -0
- pyegeria/commands/doc/glossary/images/upsert-example.om-terms 2024-11-07 at 11.44.05.png +0 -0
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/README.md +0 -346
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/CleanShot 2024-11-18 at 21.32.03@2x.png +0 -0
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/Xmind 1731421782704.png +0 -0
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/Xmind 1731422134920.png +0 -0
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/hey_egeria 2024-11-12 at 20.38.43.png +0 -0
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/hey_egeria cat 2024-11-12 at 21.41.43.png +0 -0
- 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
- 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
- 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
- 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
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/short-cut commands 2024-11-12 at 22.22.13.png +0 -0
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-hey-egeria.png +0 -0
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-integration-status-paging.png +0 -0
- 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
- 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
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-show-server-status-full 2024-11-10.png +0 -0
- 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
- pyegeria/dr_egeria_state.py +0 -67
- pyegeria/md_processing/__init__.py +0 -51
- pyegeria/md_processing/commands/__init__.py +0 -3
- pyegeria/md_processing/commands/blueprint_commands.py +0 -307
- pyegeria/md_processing/commands/category_commands.py +0 -242
- pyegeria/md_processing/commands/glossary_commands.py +0 -225
- pyegeria/md_processing/commands/project_commands.py +0 -169
- pyegeria/md_processing/commands/term_commands.py +0 -524
- pyegeria/md_processing/utils/__init__.py +0 -3
- pyegeria/md_processing/utils/common_utils.py +0 -101
- pyegeria/md_processing/utils/display_utils.py +0 -53
- pyegeria/md_processing/utils/extraction_utils.py +0 -177
- pyegeria/md_processing/utils/validation_utils.py +0 -208
- pyegeria-5.3.9.5.dist-info/RECORD +0 -265
- pyegeria-5.3.9.5.dist-info/entry_points.txt +0 -98
- {pyegeria/commands → commands}/cat/README.md +0 -0
- {pyegeria/commands → commands}/cat/__init__.py +0 -0
- {pyegeria/commands → commands}/cat/exp_list_glossaries.py +0 -0
- {pyegeria/commands → commands}/cat/get_asset_graph.py +0 -0
- {pyegeria/commands → commands}/cat/get_collection.py +0 -0
- {pyegeria/commands → commands}/cat/get_project_dependencies.py +0 -0
- {pyegeria/commands → commands}/cat/get_project_structure.py +0 -0
- {pyegeria/commands → commands}/cat/get_tech_type_elements.py +0 -0
- {pyegeria/commands → commands}/cat/glossary_actions.py +0 -0
- {pyegeria/commands → commands}/cat/list_assets.py +0 -0
- {pyegeria/commands → commands}/cat/list_cert_types.py +0 -0
- {pyegeria/commands → commands}/cat/list_deployed_catalogs.py +0 -0
- {pyegeria/commands → commands}/cat/list_deployed_database_schemas.py +0 -0
- {pyegeria/commands → commands}/cat/list_deployed_databases.py +0 -0
- {pyegeria/commands → commands}/cat/list_deployed_servers.py +0 -0
- {pyegeria/commands → commands}/cat/list_projects.py +0 -0
- {pyegeria/commands → commands}/cat/list_tech_type_elements.py +0 -0
- {pyegeria/commands → commands}/cat/list_tech_types.py +0 -0
- {pyegeria/commands → commands}/cat/list_todos.py +0 -0
- {pyegeria/commands → commands}/cat/list_user_ids.py +0 -0
- {pyegeria/commands → commands}/cli/ops_config.py +0 -0
- {pyegeria/commands → commands}/cli/txt_custom_v2.tcss +0 -0
- {pyegeria/commands → commands}/my/README.md +0 -0
- {pyegeria/commands → commands}/my/__init__.py +0 -0
- {pyegeria/commands → commands}/my/list_my_profile.py +0 -0
- {pyegeria/commands → commands}/my/list_my_roles.py +0 -0
- {pyegeria/commands → commands}/my/monitor_my_todos.py +0 -0
- {pyegeria/commands → commands}/my/monitor_open_todos.py +0 -0
- {pyegeria/commands → commands}/my/todo_actions.py +0 -0
- {pyegeria/commands → commands}/ops/README.md +0 -0
- {pyegeria/commands → commands}/ops/__init__.py +0 -0
- {pyegeria/commands → commands}/ops/gov_server_actions.py +0 -0
- {pyegeria/commands → commands}/ops/list_archives.py +0 -0
- {pyegeria/commands → commands}/ops/list_catalog_targets.py +0 -0
- {pyegeria/commands → commands}/ops/load_archive.py +0 -0
- {pyegeria/commands → commands}/ops/monitor_asset_events.py +0 -0
- {pyegeria/commands → commands}/ops/monitor_engine_activity.py +0 -0
- {pyegeria/commands → commands}/ops/monitor_engine_activity_c.py +0 -0
- {pyegeria/commands → commands}/ops/monitor_gov_eng_status.py +0 -0
- {pyegeria/commands → commands}/ops/monitor_integ_daemon_status.py +0 -0
- {pyegeria/commands → commands}/ops/monitor_platform_status.py +0 -0
- {pyegeria/commands → commands}/ops/monitor_server_startup.py +0 -0
- {pyegeria/commands → commands}/ops/monitor_server_status.py +0 -0
- {pyegeria/commands → commands}/ops/orig_monitor_server_list.py +0 -0
- {pyegeria/commands → commands}/ops/orig_monitor_server_status.py +0 -0
- {pyegeria/commands → commands}/ops/refresh_integration_daemon.py +0 -0
- {pyegeria/commands → commands}/ops/restart_integration_daemon.py +0 -0
- {pyegeria/commands → commands}/ops/table_integ_daemon_status.py +0 -0
- {pyegeria/commands → commands}/ops/x_engine_actions.py +0 -0
- {pyegeria/commands → commands}/tech/README.md +0 -0
- {pyegeria/commands → commands}/tech/__init__.py +0 -0
- {pyegeria/commands → commands}/tech/get_element_info.py +0 -0
- {pyegeria/commands → commands}/tech/get_guid_info.py +0 -0
- {pyegeria/commands → commands}/tech/get_tech_details.py +0 -0
- {pyegeria/commands → commands}/tech/get_tech_type_template.py +0 -0
- {pyegeria/commands → commands}/tech/list_all_om_type_elements.py +0 -0
- {pyegeria/commands → commands}/tech/list_all_om_type_elements_x.py +0 -0
- {pyegeria/commands → commands}/tech/list_all_related_elements.py +0 -0
- {pyegeria/commands → commands}/tech/list_anchored_elements.py +0 -0
- {pyegeria/commands → commands}/tech/list_asset_types.py +0 -0
- {pyegeria/commands → commands}/tech/list_elements_by_classification_by_property_value.py +0 -0
- {pyegeria/commands → commands}/tech/list_elements_by_property_value.py +0 -0
- {pyegeria/commands → commands}/tech/list_elements_by_property_value_x.py +0 -0
- {pyegeria/commands → commands}/tech/list_elements_for_classification.py +0 -0
- {pyegeria/commands → commands}/tech/list_gov_action_processes.py +0 -0
- {pyegeria/commands → commands}/tech/list_registered_services.py +0 -0
- {pyegeria/commands → commands}/tech/list_related_elements_with_prop_value.py +0 -0
- {pyegeria/commands → commands}/tech/list_related_specification.py +0 -0
- {pyegeria/commands → commands}/tech/list_relationship_types.py +0 -0
- {pyegeria/commands → commands}/tech/list_relationships.py +0 -0
- {pyegeria/commands → commands}/tech/list_solution_blueprints.py +0 -0
- {pyegeria/commands → commands}/tech/list_solution_components.py +0 -0
- {pyegeria/commands → commands}/tech/list_solution_roles.py +0 -0
- {pyegeria/commands → commands}/tech/list_tech_templates.py +0 -0
- {pyegeria/commands → commands}/tech/list_valid_metadata_values.py +0 -0
- {pyegeria/commands → commands}/tech/table_tech_templates.py +0 -0
- {pyegeria/commands → commands}/tech/x_list_related_elements.py +0 -0
- {pyegeria-5.3.9.5.dist-info → pyegeria-5.3.9.7.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.9.5.dist-info → pyegeria-5.3.9.7.dist-info}/WHEEL +0 -0
@@ -7,13 +7,24 @@ Copyright Contributors to the ODPi Egeria project.
|
|
7
7
|
"""
|
8
8
|
|
9
9
|
import asyncio
|
10
|
-
import time
|
11
10
|
|
12
11
|
# import json
|
13
12
|
from pyegeria._client import Client
|
13
|
+
from pyegeria._globals import NO_ELEMENTS_FOUND
|
14
14
|
from pyegeria._validators import validate_guid, validate_search_string
|
15
15
|
from pyegeria.utils import body_slimmer
|
16
|
-
from pyegeria.
|
16
|
+
from pyegeria.output_formatter import (
|
17
|
+
extract_mermaid_only,
|
18
|
+
extract_basic_dict,
|
19
|
+
generate_output,
|
20
|
+
generate_entity_md,
|
21
|
+
generate_entity_md_table,
|
22
|
+
generate_entity_dict,
|
23
|
+
make_preamble,
|
24
|
+
make_md_attribute,
|
25
|
+
MD_SEPARATOR
|
26
|
+
)
|
27
|
+
|
17
28
|
|
18
29
|
class CollectionManager(Client):
|
19
30
|
"""
|
@@ -37,33 +48,21 @@ class CollectionManager(Client):
|
|
37
48
|
|
38
49
|
"""
|
39
50
|
|
40
|
-
def __init__(
|
41
|
-
self,
|
42
|
-
view_server: str,
|
43
|
-
platform_url: str,
|
44
|
-
user_id: str,
|
45
|
-
user_pwd: str = None,
|
46
|
-
token: str = None,
|
47
|
-
):
|
51
|
+
def __init__(self, view_server: str, platform_url: str, user_id: str, user_pwd: str = None, token: str = None, ):
|
48
52
|
self.view_server = view_server
|
49
53
|
self.platform_url = platform_url
|
50
54
|
self.user_id = user_id
|
51
55
|
self.user_pwd = user_pwd
|
52
56
|
|
53
57
|
self.collection_command_root: str = (
|
54
|
-
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/collections"
|
55
|
-
)
|
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_attached_collections(
|
62
|
-
|
63
|
-
parent_guid: str,
|
64
|
-
start_from: int = 0,
|
65
|
-
page_size: int = None,
|
66
|
-
) -> list:
|
64
|
+
async def _async_get_attached_collections(self, parent_guid: str, start_from: int = 0,
|
65
|
+
page_size: int = None, ) -> list:
|
67
66
|
"""Returns the list of collections that are linked off of the supplied element using the ResourceList
|
68
67
|
relationship. Async version.
|
69
68
|
|
@@ -102,20 +101,13 @@ class CollectionManager(Client):
|
|
102
101
|
|
103
102
|
body = {}
|
104
103
|
|
105
|
-
url = (
|
106
|
-
|
107
|
-
f"metadata-elements/{parent_guid}/collections?startFrom={start_from}&pageSize={page_size}"
|
108
|
-
)
|
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}")
|
109
106
|
|
110
107
|
resp = await self._async_make_request("POST", url, body)
|
111
108
|
return resp.json()
|
112
109
|
|
113
|
-
def get_attached_collections(
|
114
|
-
self,
|
115
|
-
parent_guid: str,
|
116
|
-
start_from: int = 0,
|
117
|
-
page_size: int = None,
|
118
|
-
) -> list:
|
110
|
+
def get_attached_collections(self, parent_guid: str, start_from: int = 0, page_size: int = None, ) -> list:
|
119
111
|
"""Returns the list of collections that are linked off of the supplied element.
|
120
112
|
|
121
113
|
Parameters
|
@@ -148,17 +140,11 @@ class CollectionManager(Client):
|
|
148
140
|
|
149
141
|
"""
|
150
142
|
loop = asyncio.get_event_loop()
|
151
|
-
resp = loop.run_until_complete(
|
152
|
-
self._async_get_attached_collections(parent_guid, start_from, page_size)
|
153
|
-
)
|
143
|
+
resp = loop.run_until_complete(self._async_get_attached_collections(parent_guid, start_from, page_size))
|
154
144
|
return resp
|
155
145
|
|
156
|
-
async def _async_get_classified_collections(
|
157
|
-
|
158
|
-
classification: str,
|
159
|
-
start_from: int = 0,
|
160
|
-
page_size: int = None,
|
161
|
-
) -> 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:
|
162
148
|
"""Returns the list of collections with a particular classification. These classifications
|
163
149
|
are typically "RootCollection", "Folder" or "DigitalProduct". Async version.
|
164
150
|
|
@@ -166,19 +152,20 @@ class CollectionManager(Client):
|
|
166
152
|
----------
|
167
153
|
classification: str
|
168
154
|
The classification of the collection to inspect.
|
169
|
-
|
170
|
-
|
171
|
-
|
172
155
|
start_from: int, [default=0], optional
|
173
156
|
When multiple pages of results are available, the page number to start from.
|
174
157
|
page_size: int, [default=None]
|
175
158
|
The number of items to return in a single page. If not specified, the default will be taken from
|
176
159
|
the class instance.
|
160
|
+
output_format: str, default = "JSON"
|
161
|
+
- one of "DICT", "MERMAID" or "JSON"
|
177
162
|
|
178
163
|
Returns
|
179
164
|
-------
|
180
|
-
|
181
|
-
|
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.
|
182
169
|
|
183
170
|
Raises
|
184
171
|
------
|
@@ -197,22 +184,20 @@ class CollectionManager(Client):
|
|
197
184
|
|
198
185
|
body = {"filter": classification}
|
199
186
|
|
200
|
-
url = (
|
201
|
-
|
202
|
-
f"startFrom={start_from}&pageSize={page_size}"
|
203
|
-
)
|
187
|
+
url = (f"{self.collection_command_root}/by-classifications?"
|
188
|
+
f"startFrom={start_from}&pageSize={page_size}")
|
204
189
|
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
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:
|
216
201
|
"""Returns the list of collections with a particular classification. These classifications
|
217
202
|
are typically "RootCollection", "Folder" or "DigitalProduct".
|
218
203
|
|
@@ -220,19 +205,19 @@ class CollectionManager(Client):
|
|
220
205
|
----------
|
221
206
|
classification: str
|
222
207
|
The classification of the collection to inspect.
|
223
|
-
|
224
|
-
|
225
|
-
|
226
208
|
start_from: int, [default=0], optional
|
227
209
|
When multiple pages of results are available, the page number to start from.
|
228
210
|
page_size: int, [default=None]
|
229
211
|
The number of items to return in a single page. If not specified, the default will be taken from
|
230
212
|
the class instance.
|
213
|
+
output_format: str, default = "JSON"
|
214
|
+
- one of "DICT", "MERMAID" or "JSON"
|
231
215
|
Returns
|
232
216
|
-------
|
233
|
-
List | str
|
217
|
+
List | str | dict
|
234
218
|
|
235
|
-
A list of collections
|
219
|
+
A list of collections with the provided classification in the output format specified.
|
220
|
+
Returns a string if none found..
|
236
221
|
|
237
222
|
Raises
|
238
223
|
------
|
@@ -246,23 +231,13 @@ class CollectionManager(Client):
|
|
246
231
|
|
247
232
|
"""
|
248
233
|
loop = asyncio.get_event_loop()
|
249
|
-
resp = loop.run_until_complete(
|
250
|
-
|
251
|
-
classification, start_from, page_size
|
252
|
-
)
|
253
|
-
)
|
234
|
+
resp = loop.run_until_complete(self._async_get_classified_collections(classification,
|
235
|
+
start_from, page_size, output_format))
|
254
236
|
return resp
|
255
237
|
|
256
|
-
async def _async_find_collections(
|
257
|
-
|
258
|
-
|
259
|
-
effective_time: str = None,
|
260
|
-
starts_with: bool = False,
|
261
|
-
ends_with: bool = False,
|
262
|
-
ignore_case: bool = False,
|
263
|
-
start_from: int = 0,
|
264
|
-
page_size: int = None,
|
265
|
-
) -> 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:
|
266
241
|
"""Returns the list of collections matching the search string.
|
267
242
|
The search string is located in the request body and is interpreted as a plain string.
|
268
243
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
@@ -273,9 +248,6 @@ class CollectionManager(Client):
|
|
273
248
|
Search string to use to find matching collections. If the search string is '*' then all glossaries returned.
|
274
249
|
effective_time: str, [default=None], optional
|
275
250
|
Effective time of the query. If not specified will default to any time. ISO8601 format is assumed.
|
276
|
-
|
277
|
-
|
278
|
-
|
279
251
|
starts_with : bool, [default=False], optional
|
280
252
|
Starts with the supplied string.
|
281
253
|
ends_with : bool, [default=False], optional
|
@@ -287,6 +259,8 @@ class CollectionManager(Client):
|
|
287
259
|
page_size: int, [default=None]
|
288
260
|
The number of items to return in a single page. If not specified, the default will be taken from
|
289
261
|
the class instance.
|
262
|
+
output_format: str, default = "JSON"
|
263
|
+
- one of "DICT", "MERMAID" or "JSON"
|
290
264
|
Returns
|
291
265
|
-------
|
292
266
|
List | str
|
@@ -319,25 +293,22 @@ class CollectionManager(Client):
|
|
319
293
|
body = {"filter": search_string, "effective_time": effective_time}
|
320
294
|
|
321
295
|
body_s = body_slimmer(body)
|
322
|
-
url = (
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
)
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
start_from: int = 0,
|
339
|
-
page_size: int = None,
|
340
|
-
) -> 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:
|
341
312
|
"""Returns the list of collections matching the search string. Async version.
|
342
313
|
The search string is located in the request body and is interpreted as a plain string.
|
343
314
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
@@ -348,9 +319,6 @@ class CollectionManager(Client):
|
|
348
319
|
Search string to use to find matching collections. If the search string is '*' then all glossaries returned.
|
349
320
|
effective_time: str, [default=None], optional
|
350
321
|
Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
|
351
|
-
|
352
|
-
|
353
|
-
|
354
322
|
starts_with : bool, [default=False], optional
|
355
323
|
Starts with the supplied string.
|
356
324
|
ends_with : bool, [default=False], optional
|
@@ -362,6 +330,8 @@ class CollectionManager(Client):
|
|
362
330
|
page_size: int, [default=None]
|
363
331
|
The number of items to return in a single page. If not specified, the default will be taken from
|
364
332
|
the class instance.
|
333
|
+
output_format: str, default = "JSON"
|
334
|
+
- one of "DICT", "MERMAID" or "JSON"
|
365
335
|
Returns
|
366
336
|
-------
|
367
337
|
List | str
|
@@ -381,26 +351,13 @@ class CollectionManager(Client):
|
|
381
351
|
"""
|
382
352
|
loop = asyncio.get_event_loop()
|
383
353
|
resp = loop.run_until_complete(
|
384
|
-
self._async_find_collections(
|
385
|
-
|
386
|
-
effective_time,
|
387
|
-
starts_with,
|
388
|
-
ends_with,
|
389
|
-
ignore_case,
|
390
|
-
start_from,
|
391
|
-
page_size,
|
392
|
-
)
|
393
|
-
)
|
354
|
+
self._async_find_collections(search_string, effective_time, starts_with, ends_with, ignore_case, start_from,
|
355
|
+
page_size, output_format))
|
394
356
|
|
395
357
|
return resp
|
396
358
|
|
397
|
-
async def _async_get_collections_by_name(
|
398
|
-
|
399
|
-
name: str,
|
400
|
-
effective_time: str = None,
|
401
|
-
start_from: int = 0,
|
402
|
-
page_size: int = None,
|
403
|
-
) -> 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:
|
404
361
|
"""Returns the list of collections with a particular name.
|
405
362
|
|
406
363
|
Parameters
|
@@ -417,6 +374,8 @@ class CollectionManager(Client):
|
|
417
374
|
page_size: int, [default=None]
|
418
375
|
The number of items to return in a single page. If not specified, the default will be taken from
|
419
376
|
the class instance.
|
377
|
+
output_format: str, default = "JSON"
|
378
|
+
- one of "DICT", "MERMAID" or "JSON"
|
420
379
|
Returns
|
421
380
|
-------
|
422
381
|
List | str
|
@@ -441,25 +400,23 @@ class CollectionManager(Client):
|
|
441
400
|
validate_search_string(name)
|
442
401
|
|
443
402
|
body = {
|
444
|
-
"filter": name,
|
445
|
-
|
446
|
-
}
|
403
|
+
"filter": name, effective_time: effective_time,
|
404
|
+
}
|
447
405
|
body_s = body_slimmer(body)
|
448
|
-
url = (
|
449
|
-
|
450
|
-
f"by-name?startFrom={start_from}&pageSize={page_size}"
|
451
|
-
)
|
406
|
+
url = (f"{self.collection_command_root}/"
|
407
|
+
f"by-name?startFrom={start_from}&pageSize={page_size}")
|
452
408
|
|
453
|
-
|
454
|
-
|
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
|
455
413
|
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
) -> 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:
|
463
420
|
"""Returns the list of collections matching the search string. Async version.
|
464
421
|
The search string is located in the request body and is interpreted as a plain string.
|
465
422
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
@@ -470,14 +427,13 @@ class CollectionManager(Client):
|
|
470
427
|
name to use to find matching collections.
|
471
428
|
effective_time: str, [default=None], optional
|
472
429
|
Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
|
473
|
-
|
474
|
-
|
475
|
-
|
476
430
|
start_from: int, [default=0], optional
|
477
431
|
When multiple pages of results are available, the page number to start from.
|
478
432
|
page_size: int, [default=None]
|
479
433
|
The number of items to return in a single page. If not specified, the default will be taken from
|
480
434
|
the class instance.
|
435
|
+
output_format: str, default = "JSON"
|
436
|
+
- one of "DICT", "MERMAID" or "JSON"
|
481
437
|
|
482
438
|
Returns
|
483
439
|
-------
|
@@ -498,20 +454,12 @@ class CollectionManager(Client):
|
|
498
454
|
"""
|
499
455
|
loop = asyncio.get_event_loop()
|
500
456
|
resp = loop.run_until_complete(
|
501
|
-
self._async_get_collections_by_name(
|
502
|
-
name, effective_time, start_from, page_size
|
503
|
-
)
|
504
|
-
)
|
457
|
+
self._async_get_collections_by_name(name, effective_time, start_from, page_size, output_format))
|
505
458
|
|
506
459
|
return resp
|
507
460
|
|
508
|
-
async def _async_get_collections_by_type(
|
509
|
-
|
510
|
-
collection_type: str,
|
511
|
-
effective_time: str = None,
|
512
|
-
start_from: int = 0,
|
513
|
-
page_size: int = None,
|
514
|
-
) -> 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:
|
515
463
|
"""Returns the list of collections with a particular collectionType. This is an optional text field in the
|
516
464
|
collection element.
|
517
465
|
|
@@ -521,14 +469,13 @@ class CollectionManager(Client):
|
|
521
469
|
collection_type to use to find matching collections.
|
522
470
|
effective_time: str, [default=None], optional
|
523
471
|
Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
|
524
|
-
|
525
|
-
|
526
|
-
|
527
472
|
start_from: int, [default=0], optional
|
528
473
|
When multiple pages of results are available, the page number to start from.
|
529
474
|
page_size: int, [default=None]
|
530
475
|
The number of items to return in a single page. If not specified, the default will be taken from
|
531
476
|
the class instance.
|
477
|
+
output_format: str, default = "JSON"
|
478
|
+
- one of "DICT", "MERMAID" or "JSON"
|
532
479
|
|
533
480
|
Returns
|
534
481
|
-------
|
@@ -554,26 +501,24 @@ class CollectionManager(Client):
|
|
554
501
|
validate_search_string(collection_type)
|
555
502
|
|
556
503
|
body = {
|
557
|
-
"filter": collection_type,
|
558
|
-
|
559
|
-
}
|
504
|
+
"filter": collection_type, effective_time: effective_time,
|
505
|
+
}
|
560
506
|
body_s = body_slimmer(body)
|
561
507
|
|
562
|
-
url = (
|
563
|
-
|
564
|
-
f"by-collection-type?startFrom={start_from}&pageSize={page_size}"
|
565
|
-
)
|
508
|
+
url = (f"{self.collection_command_root}/"
|
509
|
+
f"by-collection-type?startFrom={start_from}&pageSize={page_size}")
|
566
510
|
|
567
|
-
|
568
|
-
|
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
|
569
515
|
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
) -> 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:
|
577
522
|
"""Returns the list of collections matching the search string. Async version.
|
578
523
|
The search string is located in the request body and is interpreted as a plain string.
|
579
524
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
@@ -584,14 +529,13 @@ class CollectionManager(Client):
|
|
584
529
|
collection type to find.
|
585
530
|
effective_time: str, [default=None], optional
|
586
531
|
Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
|
587
|
-
|
588
|
-
|
589
|
-
|
590
532
|
start_from: int, [default=0], optional
|
591
533
|
When multiple pages of results are available, the page number to start from.
|
592
534
|
page_size: int, [default=None]
|
593
535
|
The number of items to return in a single page. If not specified, the default will be taken from
|
594
536
|
the class instance.
|
537
|
+
output_format: str, default = "JSON"
|
538
|
+
- one of "DICT", "MERMAID" or "JSON"
|
595
539
|
|
596
540
|
Returns
|
597
541
|
-------
|
@@ -612,16 +556,12 @@ class CollectionManager(Client):
|
|
612
556
|
"""
|
613
557
|
loop = asyncio.get_event_loop()
|
614
558
|
resp = loop.run_until_complete(
|
615
|
-
self._async_get_collections_by_type(
|
616
|
-
collection_type, effective_time, start_from, page_size
|
617
|
-
)
|
618
|
-
)
|
559
|
+
self._async_get_collections_by_type(collection_type, effective_time, start_from, page_size, output_format))
|
619
560
|
|
620
561
|
return resp
|
621
562
|
|
622
|
-
async def
|
623
|
-
|
624
|
-
) -> 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:
|
625
565
|
"""Return the properties of a specific collection. Async version.
|
626
566
|
|
627
567
|
Parameters
|
@@ -630,9 +570,8 @@ class CollectionManager(Client):
|
|
630
570
|
unique identifier of the collection.
|
631
571
|
effective_time: str, [default=None], optional
|
632
572
|
Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
|
633
|
-
|
634
|
-
|
635
|
-
|
573
|
+
output_format: str, default = "JSON"
|
574
|
+
- one of "DICT", "MERMAID" or "JSON"
|
636
575
|
|
637
576
|
Returns
|
638
577
|
-------
|
@@ -657,13 +596,18 @@ class CollectionManager(Client):
|
|
657
596
|
url = f"{self.collection_command_root}/{collection_guid}"
|
658
597
|
body = {
|
659
598
|
"effective_time": effective_time,
|
660
|
-
|
661
|
-
|
662
|
-
|
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
|
663
604
|
|
664
|
-
|
665
|
-
|
666
|
-
|
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:
|
667
611
|
"""Return the properties of a specific collection.
|
668
612
|
|
669
613
|
Parameters
|
@@ -672,9 +616,8 @@ class CollectionManager(Client):
|
|
672
616
|
unique identifier of the collection.
|
673
617
|
effective_time: str, [default=None], optional
|
674
618
|
Effective time of the query. If not specified will default to any time.
|
675
|
-
|
676
|
-
|
677
|
-
|
619
|
+
output_format: str, default = "JSON"
|
620
|
+
- one of "DICT", "MERMAID" or "JSON"
|
678
621
|
|
679
622
|
Returns
|
680
623
|
-------
|
@@ -695,8 +638,7 @@ class CollectionManager(Client):
|
|
695
638
|
"""
|
696
639
|
loop = asyncio.get_event_loop()
|
697
640
|
resp = loop.run_until_complete(
|
698
|
-
self.
|
699
|
-
)
|
641
|
+
self._async_get_collection_by_guid(collection_guid, effective_time, output_format))
|
700
642
|
|
701
643
|
return resp
|
702
644
|
|
@@ -709,7 +651,8 @@ class CollectionManager(Client):
|
|
709
651
|
# Create Collections: https://egeria-project.org/concepts/collection
|
710
652
|
# These requests use the following parameters:
|
711
653
|
#
|
712
|
-
# anchorGUID - the unique identifier of the element that should be the anchor for the new element. Set to null if
|
654
|
+
# anchorGUID - the unique identifier of the element that should be the anchor for the new element. Set to null if
|
655
|
+
# no anchor,
|
713
656
|
# or if this collection is to be its own anchor.
|
714
657
|
#
|
715
658
|
# isOwnAnchor -this element should be classified as its own anchor or not. The default is false.
|
@@ -717,15 +660,14 @@ class CollectionManager(Client):
|
|
717
660
|
# parentGUID - the optional unique identifier for an element that should be connected to the newly created element.
|
718
661
|
# If this property is specified, parentRelationshipTypeName must also be specified
|
719
662
|
#
|
720
|
-
# parentRelationshipTypeName - the name of the relationship, if any, that should be established between the new
|
663
|
+
# parentRelationshipTypeName - the name of the relationship, if any, that should be established between the new
|
664
|
+
# element and the parent element.
|
721
665
|
# Examples could be "ResourceList" or "DigitalServiceProduct".
|
722
666
|
#
|
723
667
|
# parentAtEnd1 -identifies which end any parent entity sits on the relationship.
|
724
668
|
#
|
725
669
|
|
726
|
-
async def _async_create_collection_w_body(
|
727
|
-
self, classification_name: str, body: dict
|
728
|
-
) -> str:
|
670
|
+
async def _async_create_collection_w_body(self, classification_name: str, body: dict) -> str:
|
729
671
|
"""Create Collections: https://egeria-project.org/concepts/collection Async version.
|
730
672
|
|
731
673
|
Parameters
|
@@ -783,15 +725,12 @@ class CollectionManager(Client):
|
|
783
725
|
}
|
784
726
|
"""
|
785
727
|
|
786
|
-
url = (
|
787
|
-
|
788
|
-
f"classificationName={classification_name}"
|
789
|
-
)
|
728
|
+
url = (f"{self.collection_command_root}?"
|
729
|
+
f"classificationName={classification_name}")
|
790
730
|
|
791
731
|
resp = await self._async_make_request("POST", url, body)
|
792
732
|
return resp.json().get("guid", "No GUID returned")
|
793
733
|
|
794
|
-
|
795
734
|
def create_collection_w_body(self, classification_name: str, body: dict) -> str:
|
796
735
|
"""Create Collections: https://egeria-project.org/concepts/collection
|
797
736
|
|
@@ -853,26 +792,13 @@ class CollectionManager(Client):
|
|
853
792
|
}
|
854
793
|
"""
|
855
794
|
loop = asyncio.get_event_loop()
|
856
|
-
resp = loop.run_until_complete(
|
857
|
-
self._async_create_collection_w_body(classification_name, body)
|
858
|
-
)
|
795
|
+
resp = loop.run_until_complete(self._async_create_collection_w_body(classification_name, body))
|
859
796
|
return resp
|
860
797
|
|
861
|
-
async def _async_create_collection(
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
parent_guid: str,
|
866
|
-
parent_relationship_type_name: str,
|
867
|
-
parent_at_end1: bool,
|
868
|
-
display_name: str,
|
869
|
-
description: str,
|
870
|
-
collection_type: str,
|
871
|
-
anchor_scope_guid: str = None,
|
872
|
-
is_own_anchor: bool = False,
|
873
|
-
collection_ordering: str = None,
|
874
|
-
order_property_name: str = None,
|
875
|
-
) -> 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:
|
876
802
|
"""Create Collections: https://egeria-project.org/concepts/collection Async version.
|
877
803
|
|
878
804
|
Parameters
|
@@ -930,47 +856,26 @@ class CollectionManager(Client):
|
|
930
856
|
is_own_anchor_s = str(is_own_anchor).lower()
|
931
857
|
parent_at_end1_s = str(parent_at_end1).lower()
|
932
858
|
|
933
|
-
url = (
|
934
|
-
|
935
|
-
f"classificationName={classification_name}"
|
936
|
-
)
|
859
|
+
url = (f"{self.collection_command_root}?"
|
860
|
+
f"classificationName={classification_name}")
|
937
861
|
|
938
862
|
body = {
|
939
|
-
"anchorGUID": anchor_guid,
|
940
|
-
"
|
941
|
-
"
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
"qualifiedName": f"{classification_name}::{display_name}",
|
948
|
-
"name": display_name,
|
949
|
-
"description": description,
|
950
|
-
"collectionType": collection_type,
|
951
|
-
"collectionOrdering": collection_ordering,
|
952
|
-
"orderPropertyName": order_property_name,
|
953
|
-
},
|
954
|
-
}
|
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
|
+
}
|
955
871
|
|
956
872
|
resp = await self._async_make_request("POST", url, body_slimmer(body))
|
957
873
|
return resp.json().get("guid", "No GUID returned")
|
958
874
|
|
959
|
-
def create_collection(
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
parent_guid: str,
|
964
|
-
parent_relationship_type_name: str,
|
965
|
-
parent_at_end1: bool,
|
966
|
-
display_name: str,
|
967
|
-
description: str,
|
968
|
-
collection_type: str,
|
969
|
-
anchor_scope_guid: str = None,
|
970
|
-
is_own_anchor: bool = False,
|
971
|
-
collection_ordering: str = "OTHER",
|
972
|
-
order_property_name: str = "Something",
|
973
|
-
) -> 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:
|
974
879
|
"""Create Collections: https://egeria-project.org/concepts/collection
|
975
880
|
|
976
881
|
Parameters
|
@@ -1023,35 +928,14 @@ class CollectionManager(Client):
|
|
1023
928
|
"""
|
1024
929
|
loop = asyncio.get_event_loop()
|
1025
930
|
resp = loop.run_until_complete(
|
1026
|
-
self._async_create_collection(
|
1027
|
-
|
1028
|
-
|
1029
|
-
parent_guid,
|
1030
|
-
parent_relationship_type_name,
|
1031
|
-
parent_at_end1,
|
1032
|
-
display_name,
|
1033
|
-
description,
|
1034
|
-
collection_type,
|
1035
|
-
anchor_scope_guid,
|
1036
|
-
is_own_anchor,
|
1037
|
-
collection_ordering,
|
1038
|
-
order_property_name
|
1039
|
-
)
|
1040
|
-
)
|
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))
|
1041
934
|
return resp
|
1042
935
|
|
1043
|
-
async def _async_create_root_collection(
|
1044
|
-
|
1045
|
-
|
1046
|
-
parent_guid: str,
|
1047
|
-
parent_relationship_type_name: str,
|
1048
|
-
parent_at_end1: bool,
|
1049
|
-
display_name: str,
|
1050
|
-
description: str,
|
1051
|
-
collection_type: str,
|
1052
|
-
anchor_scope_guid: str = None,
|
1053
|
-
is_own_anchor: bool = False,
|
1054
|
-
) -> 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:
|
1055
939
|
"""Create a new collection with the RootCollection classification. Used to identify the top of a
|
1056
940
|
collection hierarchy. Async version.
|
1057
941
|
|
@@ -1099,36 +983,20 @@ class CollectionManager(Client):
|
|
1099
983
|
url = f"{self.collection_command_root}/root-collection"
|
1100
984
|
|
1101
985
|
body = {
|
1102
|
-
"anchorGUID": anchor_guid,
|
1103
|
-
"
|
1104
|
-
"
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
"class": "CollectionProperties",
|
1110
|
-
"qualifiedName": f"root-collection::{display_name}",
|
1111
|
-
"name": display_name,
|
1112
|
-
"description": description,
|
1113
|
-
"collectionType": collection_type,
|
1114
|
-
},
|
1115
|
-
}
|
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
|
+
}
|
1116
993
|
|
1117
994
|
resp = await self._async_make_request("POST", url, body_slimmer(body))
|
1118
995
|
return resp.json().get("guid", "No GUID Returned")
|
1119
996
|
|
1120
|
-
def create_root_collection(
|
1121
|
-
|
1122
|
-
|
1123
|
-
parent_guid: str,
|
1124
|
-
parent_relationship_type_name: str,
|
1125
|
-
parent_at_end1: bool,
|
1126
|
-
display_name: str,
|
1127
|
-
description: str,
|
1128
|
-
collection_type: str,
|
1129
|
-
anchor_scope_guid: str = None,
|
1130
|
-
is_own_anchor: bool = False,
|
1131
|
-
) -> 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:
|
1132
1000
|
"""Create a new collection with the RootCollection classification. Used to identify the top of a
|
1133
1001
|
collection hierarchy.
|
1134
1002
|
|
@@ -1173,34 +1041,15 @@ class CollectionManager(Client):
|
|
1173
1041
|
"""
|
1174
1042
|
loop = asyncio.get_event_loop()
|
1175
1043
|
resp = loop.run_until_complete(
|
1176
|
-
self._async_create_root_collection(
|
1177
|
-
|
1178
|
-
parent_guid,
|
1179
|
-
parent_relationship_type_name,
|
1180
|
-
parent_at_end1,
|
1181
|
-
display_name,
|
1182
|
-
description,
|
1183
|
-
collection_type,
|
1184
|
-
anchor_scope_guid,
|
1185
|
-
is_own_anchor,
|
1186
|
-
)
|
1187
|
-
)
|
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, ))
|
1188
1046
|
return resp
|
1189
1047
|
|
1190
|
-
async def _async_create_data_spec_collection(
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
parent_at_end1: bool,
|
1196
|
-
display_name: str,
|
1197
|
-
description: str,
|
1198
|
-
collection_type: str,
|
1199
|
-
anchor_scope_guid: str = None,
|
1200
|
-
is_own_anchor: bool = True,
|
1201
|
-
collection_ordering: str = "OTHER",
|
1202
|
-
order_property_name: str = "Something",
|
1203
|
-
) -> 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:
|
1204
1053
|
"""Create a new collection with the DataSpec classification. Used to identify a collection of data fields
|
1205
1054
|
and schema types. Async version.
|
1206
1055
|
|
@@ -1232,6 +1081,8 @@ class CollectionManager(Client):
|
|
1232
1081
|
"DATE_CREATED", "OTHER"
|
1233
1082
|
order_property_name: str, optional, defaults to "Something"
|
1234
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.
|
1235
1086
|
|
1236
1087
|
Returns
|
1237
1088
|
-------
|
@@ -1251,42 +1102,26 @@ class CollectionManager(Client):
|
|
1251
1102
|
is_own_anchor_s = str(is_own_anchor).lower()
|
1252
1103
|
parent_at_end1_s = str(parent_at_end1).lower()
|
1253
1104
|
url = f"{self.collection_command_root}/data-spec-collection"
|
1105
|
+
if qualified_name is None:
|
1106
|
+
qualified_name = self.__create_qualified_name__("DataDict", display_name)
|
1254
1107
|
|
1255
1108
|
body = {
|
1256
|
-
"anchorGUID": anchor_guid,
|
1257
|
-
"
|
1258
|
-
"
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
"qualifiedName": f"data-spec-collection::{display_name}",
|
1265
|
-
"name": display_name,
|
1266
|
-
"description": description,
|
1267
|
-
"collectionType": collection_type,
|
1268
|
-
"collectionOrdering": collection_ordering,
|
1269
|
-
"orderPropertyName": order_property_name,
|
1270
|
-
},
|
1271
|
-
}
|
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
|
+
}
|
1272
1117
|
|
1273
1118
|
resp = await self._async_make_request("POST", url, body_slimmer(body))
|
1274
1119
|
return resp.json().get("guid", "No GUID Returned")
|
1275
1120
|
|
1276
|
-
def create_data_spec_collection(
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
parent_relationship_type_name: str,
|
1281
|
-
parent_at_end1: bool,
|
1282
|
-
display_name: str,
|
1283
|
-
description: str,
|
1284
|
-
collection_type: str,
|
1285
|
-
anchor_scope_guid: str = None,
|
1286
|
-
is_own_anchor: bool = False,
|
1287
|
-
collection_ordering: str = "OTHER",
|
1288
|
-
order_property_name: str = "Something",
|
1289
|
-
) -> 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:
|
1290
1125
|
"""Create a new collection with the DataSpec classification. Used to identify a collection of data fields
|
1291
1126
|
and schema types.
|
1292
1127
|
|
@@ -1317,6 +1152,8 @@ class CollectionManager(Client):
|
|
1317
1152
|
Specifies the sequencing to use in a collection. Examples include "NAME", "OWNER", "DATE_CREATED", "OTHER"
|
1318
1153
|
order_property_name: str, optional, defaults to "Something"
|
1319
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.
|
1320
1157
|
|
1321
1158
|
Returns
|
1322
1159
|
-------
|
@@ -1334,36 +1171,16 @@ class CollectionManager(Client):
|
|
1334
1171
|
"""
|
1335
1172
|
loop = asyncio.get_event_loop()
|
1336
1173
|
resp = loop.run_until_complete(
|
1337
|
-
self._async_create_data_spec_collection(
|
1338
|
-
|
1339
|
-
|
1340
|
-
parent_relationship_type_name,
|
1341
|
-
parent_at_end1,
|
1342
|
-
display_name,
|
1343
|
-
description,
|
1344
|
-
collection_type,
|
1345
|
-
anchor_scope_guid,
|
1346
|
-
is_own_anchor,
|
1347
|
-
collection_ordering,
|
1348
|
-
order_property_name,
|
1349
|
-
)
|
1350
|
-
)
|
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, ))
|
1351
1177
|
return resp
|
1352
1178
|
|
1353
|
-
async def _async_create_data_dictionary_collection(
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
parent_at_end1: bool,
|
1359
|
-
display_name: str,
|
1360
|
-
description: str,
|
1361
|
-
collection_type: str,
|
1362
|
-
anchor_scope_guid: str = None,
|
1363
|
-
is_own_anchor: bool = True,
|
1364
|
-
collection_ordering: str = "OTHER",
|
1365
|
-
order_property_name: str = "Something",
|
1366
|
-
) -> str:
|
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:
|
1367
1184
|
""" Create a new collection with the Data Dictionary classification. Used to identify a collection of
|
1368
1185
|
data fields that represent a data store collection of common data types. Async version.
|
1369
1186
|
|
@@ -1395,7 +1212,8 @@ class CollectionManager(Client):
|
|
1395
1212
|
"DATE_CREATED", "OTHER"
|
1396
1213
|
order_property_name: str, optional, defaults to "Something"
|
1397
1214
|
Property to use for sequencing if collection_ordering is "OTHER"
|
1398
|
-
|
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.
|
1399
1217
|
Returns
|
1400
1218
|
-------
|
1401
1219
|
str - the guid of the created collection
|
@@ -1413,43 +1231,27 @@ class CollectionManager(Client):
|
|
1413
1231
|
|
1414
1232
|
is_own_anchor_s = str(is_own_anchor).lower()
|
1415
1233
|
parent_at_end1_s = str(parent_at_end1).lower()
|
1416
|
-
url = f"{self.collection_command_root}/data-
|
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)
|
1417
1237
|
|
1418
1238
|
body = {
|
1419
|
-
"anchorGUID": anchor_guid,
|
1420
|
-
"
|
1421
|
-
"
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
"qualifiedName": f"data-dict-collection::{display_name}",
|
1428
|
-
"name": display_name,
|
1429
|
-
"description": description,
|
1430
|
-
"collectionType": collection_type,
|
1431
|
-
"collectionOrdering": collection_ordering,
|
1432
|
-
"orderPropertyName": order_property_name,
|
1433
|
-
},
|
1434
|
-
}
|
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
|
+
}
|
1435
1247
|
|
1436
1248
|
resp = await self._async_make_request("POST", url, body_slimmer(body))
|
1437
1249
|
return resp.json().get("guid", "No GUID Returned")
|
1438
1250
|
|
1439
|
-
def create_data_dictionary_collection(
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
parent_relationship_type_name: str,
|
1444
|
-
parent_at_end1: bool,
|
1445
|
-
display_name: str,
|
1446
|
-
description: str,
|
1447
|
-
collection_type: str,
|
1448
|
-
anchor_scope_guid: str = None,
|
1449
|
-
is_own_anchor: bool = False,
|
1450
|
-
collection_ordering: str = "OTHER",
|
1451
|
-
order_property_name: str = "Something",
|
1452
|
-
) -> str:
|
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:
|
1453
1255
|
"""Create a new collection with the DataSpec classification. Used to identify a collection of data fields
|
1454
1256
|
and schema types.
|
1455
1257
|
|
@@ -1480,8 +1282,8 @@ class CollectionManager(Client):
|
|
1480
1282
|
Specifies the sequencing to use in a collection. Examples include "NAME", "OWNER", "DATE_CREATED", "OTHER"
|
1481
1283
|
order_property_name: str, optional, defaults to "Something"
|
1482
1284
|
Property to use for sequencing if collection_ordering is "OTHER"
|
1483
|
-
|
1484
|
-
|
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.
|
1485
1287
|
|
1486
1288
|
Returns
|
1487
1289
|
-------
|
@@ -1499,38 +1301,15 @@ class CollectionManager(Client):
|
|
1499
1301
|
"""
|
1500
1302
|
loop = asyncio.get_event_loop()
|
1501
1303
|
resp = loop.run_until_complete(
|
1502
|
-
self._async_create_data_dictionary_collection(
|
1503
|
-
|
1504
|
-
|
1505
|
-
parent_relationship_type_name,
|
1506
|
-
parent_at_end1,
|
1507
|
-
display_name,
|
1508
|
-
description,
|
1509
|
-
collection_type,
|
1510
|
-
anchor_scope_guid,
|
1511
|
-
is_own_anchor,
|
1512
|
-
collection_ordering,
|
1513
|
-
order_property_name,
|
1514
|
-
)
|
1515
|
-
)
|
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))
|
1516
1307
|
return resp
|
1517
1308
|
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
anchor_guid: str,
|
1523
|
-
parent_guid: str,
|
1524
|
-
parent_relationship_type_name: str,
|
1525
|
-
parent_at_end1: bool,
|
1526
|
-
display_name: str,
|
1527
|
-
description: str,
|
1528
|
-
collection_type: str,
|
1529
|
-
anchor_scope_guid: str = None,
|
1530
|
-
is_own_anchor: bool = True,
|
1531
|
-
collection_ordering: str = "OTHER",
|
1532
|
-
order_property_name: str = "Something",
|
1533
|
-
) -> 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:
|
1534
1313
|
"""Create a new collection with the Folder classification. This is used to identify the organizing
|
1535
1314
|
collections in a collection hierarchy. Async version.
|
1536
1315
|
|
@@ -1583,40 +1362,22 @@ class CollectionManager(Client):
|
|
1583
1362
|
url = f"{self.collection_command_root}/folder"
|
1584
1363
|
|
1585
1364
|
body = {
|
1586
|
-
"anchorGUID": anchor_guid,
|
1587
|
-
"
|
1588
|
-
"
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
"qualifiedName": f"folder-collection::{display_name}",
|
1595
|
-
"name": display_name,
|
1596
|
-
"description": description,
|
1597
|
-
"collectionType": collection_type,
|
1598
|
-
"collectionOrdering": collection_ordering,
|
1599
|
-
"orderPropertyName": order_property_name,
|
1600
|
-
},
|
1601
|
-
}
|
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
|
+
}
|
1602
1373
|
|
1603
1374
|
resp = await self._async_make_request("POST", url, body_slimmer(body))
|
1604
1375
|
return resp.json().get("guid", "No GUID returned")
|
1605
1376
|
|
1606
|
-
def create_folder_collection(
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
parent_relationship_type_name: str,
|
1611
|
-
parent_at_end1: bool,
|
1612
|
-
display_name: str,
|
1613
|
-
description: str,
|
1614
|
-
collection_type: str,
|
1615
|
-
anchor_scope_guid: str = None,
|
1616
|
-
is_own_anchor: bool = True,
|
1617
|
-
collection_ordering: str = "OTHER",
|
1618
|
-
order_property_name: str = "Something",
|
1619
|
-
) -> 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:
|
1620
1381
|
"""Create a new collection with the Folder classification. This is used to identify the organizing
|
1621
1382
|
collections in a collection hierarchy.
|
1622
1383
|
|
@@ -1666,20 +1427,9 @@ class CollectionManager(Client):
|
|
1666
1427
|
"""
|
1667
1428
|
loop = asyncio.get_event_loop()
|
1668
1429
|
resp = loop.run_until_complete(
|
1669
|
-
self._async_create_folder_collection(
|
1670
|
-
|
1671
|
-
|
1672
|
-
parent_relationship_type_name,
|
1673
|
-
parent_at_end1,
|
1674
|
-
display_name,
|
1675
|
-
description,
|
1676
|
-
collection_type,
|
1677
|
-
anchor_scope_guid,
|
1678
|
-
is_own_anchor,
|
1679
|
-
collection_ordering,
|
1680
|
-
order_property_name,
|
1681
|
-
)
|
1682
|
-
)
|
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, ))
|
1683
1433
|
return resp
|
1684
1434
|
|
1685
1435
|
async def _async_create_collection_from_template(self, body: dict) -> str:
|
@@ -1794,9 +1544,7 @@ class CollectionManager(Client):
|
|
1794
1544
|
}
|
1795
1545
|
"""
|
1796
1546
|
loop = asyncio.get_event_loop()
|
1797
|
-
resp = loop.run_until_complete(
|
1798
|
-
self._async_create_collection_from_template(body)
|
1799
|
-
)
|
1547
|
+
resp = loop.run_until_complete(self._async_create_collection_from_template(body))
|
1800
1548
|
return resp
|
1801
1549
|
|
1802
1550
|
async def _async_create_digital_product(self, body: dict) -> str:
|
@@ -1936,17 +1684,9 @@ class CollectionManager(Client):
|
|
1936
1684
|
#
|
1937
1685
|
# Manage collections
|
1938
1686
|
#
|
1939
|
-
async def _async_update_collection(
|
1940
|
-
|
1941
|
-
|
1942
|
-
qualified_name: str = None,
|
1943
|
-
display_name: str = None,
|
1944
|
-
description: str = None,
|
1945
|
-
collection_type: str = None,
|
1946
|
-
collection_ordering: str = None,
|
1947
|
-
order_property_name: str = None,
|
1948
|
-
replace_all_props: bool = False,
|
1949
|
-
) -> 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:
|
1950
1690
|
"""Update the properties of a collection. Async version.
|
1951
1691
|
|
1952
1692
|
Parameters
|
@@ -1987,35 +1727,21 @@ class CollectionManager(Client):
|
|
1987
1727
|
"""
|
1988
1728
|
|
1989
1729
|
replace_all_props_s = str(replace_all_props).lower()
|
1990
|
-
url = (
|
1991
|
-
|
1992
|
-
f"replaceAllProperties={replace_all_props_s}"
|
1993
|
-
)
|
1730
|
+
url = (f"{self.collection_command_root}/{collection_guid}/update?"
|
1731
|
+
f"replaceAllProperties={replace_all_props_s}")
|
1994
1732
|
|
1995
1733
|
body = {
|
1996
|
-
"class": "CollectionProperties",
|
1997
|
-
"
|
1998
|
-
"name": display_name,
|
1999
|
-
"description": description,
|
2000
|
-
"collectionType": collection_type,
|
2001
|
-
"collectionOrdering": collection_ordering,
|
1734
|
+
"class": "CollectionProperties", "qualifiedName": qualified_name, "name": display_name,
|
1735
|
+
"description": description, "collectionType": collection_type, "collectionOrdering": collection_ordering,
|
2002
1736
|
"orderPropertyName": order_property_name,
|
2003
|
-
|
1737
|
+
}
|
2004
1738
|
body_s = body_slimmer(body)
|
2005
1739
|
await self._async_make_request("POST", url, body_s)
|
2006
1740
|
return
|
2007
1741
|
|
2008
|
-
def update_collection(
|
2009
|
-
|
2010
|
-
|
2011
|
-
qualified_name: str = None,
|
2012
|
-
display_name: str = None,
|
2013
|
-
description: str = None,
|
2014
|
-
collection_type: str = None,
|
2015
|
-
collection_ordering: str = None,
|
2016
|
-
order_property_name: str = None,
|
2017
|
-
replace_all_props: bool = False,
|
2018
|
-
) -> 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:
|
2019
1745
|
"""Update the properties of a collection.
|
2020
1746
|
|
2021
1747
|
Parameters
|
@@ -2056,25 +1782,11 @@ class CollectionManager(Client):
|
|
2056
1782
|
"""
|
2057
1783
|
loop = asyncio.get_event_loop()
|
2058
1784
|
loop.run_until_complete(
|
2059
|
-
self._async_update_collection(
|
2060
|
-
|
2061
|
-
qualified_name,
|
2062
|
-
display_name,
|
2063
|
-
description,
|
2064
|
-
collection_type,
|
2065
|
-
collection_ordering,
|
2066
|
-
order_property_name,
|
2067
|
-
replace_all_props,
|
2068
|
-
)
|
2069
|
-
)
|
1785
|
+
self._async_update_collection(collection_guid, qualified_name, display_name, description, collection_type,
|
1786
|
+
collection_ordering, order_property_name, replace_all_props, ))
|
2070
1787
|
return
|
2071
1788
|
|
2072
|
-
async def _async_update_digital_product(
|
2073
|
-
self,
|
2074
|
-
collection_guid: str,
|
2075
|
-
body: dict,
|
2076
|
-
replace_all_props: bool = False,
|
2077
|
-
):
|
1789
|
+
async def _async_update_digital_product(self, collection_guid: str, body: dict, replace_all_props: bool = False, ):
|
2078
1790
|
"""Update the properties of the DigitalProduct classification attached to a collection. Async version.
|
2079
1791
|
|
2080
1792
|
Parameters
|
@@ -2123,20 +1835,13 @@ class CollectionManager(Client):
|
|
2123
1835
|
"""
|
2124
1836
|
|
2125
1837
|
replace_all_props_s = str(replace_all_props).lower()
|
2126
|
-
url = (
|
2127
|
-
|
2128
|
-
f"{collection_guid}/update?replaceAllProperties={replace_all_props_s}"
|
2129
|
-
)
|
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}")
|
2130
1840
|
|
2131
1841
|
await self._async_make_request("POST", url, body)
|
2132
1842
|
return
|
2133
1843
|
|
2134
|
-
def update_digital_product(
|
2135
|
-
self,
|
2136
|
-
collection_guid: str,
|
2137
|
-
body: dict,
|
2138
|
-
replace_all_props: bool = False,
|
2139
|
-
):
|
1844
|
+
def update_digital_product(self, collection_guid: str, body: dict, replace_all_props: bool = False, ):
|
2140
1845
|
"""Update the properties of the DigitalProduct classification attached to a collection.
|
2141
1846
|
|
2142
1847
|
Parameters
|
@@ -2184,21 +1889,12 @@ class CollectionManager(Client):
|
|
2184
1889
|
}
|
2185
1890
|
"""
|
2186
1891
|
loop = asyncio.get_event_loop()
|
2187
|
-
loop.run_until_complete(
|
2188
|
-
self._async_update_digital_product(collection_guid, body, replace_all_props)
|
2189
|
-
)
|
1892
|
+
loop.run_until_complete(self._async_update_digital_product(collection_guid, body, replace_all_props))
|
2190
1893
|
return
|
2191
1894
|
|
2192
|
-
async def _async_attach_collection(
|
2193
|
-
|
2194
|
-
|
2195
|
-
element_guid: str,
|
2196
|
-
resource_use: str,
|
2197
|
-
resource_use_description: str = None,
|
2198
|
-
resource_use_props: dict = None,
|
2199
|
-
watch_resources: bool = False,
|
2200
|
-
make_anchor: bool = False,
|
2201
|
-
) -> None:
|
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:
|
2202
1898
|
""" Connect an existing collection to an element using the ResourceList relationship (0019). Async version.
|
2203
1899
|
Parameters
|
2204
1900
|
----------
|
@@ -2236,30 +1932,19 @@ class CollectionManager(Client):
|
|
2236
1932
|
watch_resources_s = str(watch_resources).lower()
|
2237
1933
|
make_anchor_s = str(make_anchor).lower()
|
2238
1934
|
|
2239
|
-
url = (
|
2240
|
-
|
2241
|
-
f"{element_guid}/collections/{collection_guid}/attach?makeAnchor={make_anchor_s}"
|
2242
|
-
)
|
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}")
|
2243
1937
|
|
2244
1938
|
body = {
|
2245
|
-
"class": "ResourceListProperties",
|
2246
|
-
"
|
2247
|
-
"resourceUseDescription": resource_use_description,
|
2248
|
-
"watchResource": watch_resources_s,
|
1939
|
+
"class": "ResourceListProperties", "resourceUse": resource_use,
|
1940
|
+
"resourceUseDescription": resource_use_description, "watchResource": watch_resources_s,
|
2249
1941
|
"resourceUseProperties": resource_use_props,
|
2250
|
-
|
1942
|
+
}
|
2251
1943
|
await self._async_make_request("POST", url, body)
|
2252
1944
|
|
2253
|
-
def attach_collection(
|
2254
|
-
|
2255
|
-
|
2256
|
-
element_guid: str,
|
2257
|
-
resource_use: str,
|
2258
|
-
resource_use_description: str,
|
2259
|
-
resource_use_props: dict = None,
|
2260
|
-
watch_resources: bool = False,
|
2261
|
-
make_anchor: bool = False,
|
2262
|
-
) -> 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:
|
2263
1948
|
"""Connect an existing collection to an element using the ResourceList relationship (0019).
|
2264
1949
|
Parameters
|
2265
1950
|
----------
|
@@ -2297,21 +1982,11 @@ class CollectionManager(Client):
|
|
2297
1982
|
"""
|
2298
1983
|
loop = asyncio.get_event_loop()
|
2299
1984
|
loop.run_until_complete(
|
2300
|
-
self._async_attach_collection(
|
2301
|
-
|
2302
|
-
element_guid,
|
2303
|
-
resource_use,
|
2304
|
-
resource_use_description,
|
2305
|
-
resource_use_props,
|
2306
|
-
watch_resources,
|
2307
|
-
make_anchor,
|
2308
|
-
)
|
2309
|
-
)
|
1985
|
+
self._async_attach_collection(collection_guid, element_guid, resource_use, resource_use_description,
|
1986
|
+
resource_use_props, watch_resources, make_anchor, ))
|
2310
1987
|
return
|
2311
1988
|
|
2312
|
-
async def _async_detach_collection(
|
2313
|
-
self, collection_guid: str, element_guid: str
|
2314
|
-
) -> None:
|
1989
|
+
async def _async_detach_collection(self, collection_guid: str, element_guid: str) -> None:
|
2315
1990
|
"""Detach an existing collection from an element. If the collection is anchored to the element, it is deleted.
|
2316
1991
|
Async version.
|
2317
1992
|
|
@@ -2340,10 +2015,8 @@ class CollectionManager(Client):
|
|
2340
2015
|
|
2341
2016
|
"""
|
2342
2017
|
|
2343
|
-
url = (
|
2344
|
-
|
2345
|
-
f"{element_guid}/collections/{collection_guid}/detach"
|
2346
|
-
)
|
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")
|
2347
2020
|
|
2348
2021
|
body = {"class": "NullRequestBody"}
|
2349
2022
|
|
@@ -2377,12 +2050,10 @@ class CollectionManager(Client):
|
|
2377
2050
|
|
2378
2051
|
"""
|
2379
2052
|
loop = asyncio.get_event_loop()
|
2380
|
-
loop.run_until_complete(
|
2381
|
-
self._async_detach_collection(collection_guid, element_guid)
|
2382
|
-
)
|
2053
|
+
loop.run_until_complete(self._async_detach_collection(collection_guid, element_guid))
|
2383
2054
|
return
|
2384
2055
|
|
2385
|
-
async def _async_delete_collection(self, collection_guid: str) -> None:
|
2056
|
+
async def _async_delete_collection(self, collection_guid: str, cascade: bool = False) -> None:
|
2386
2057
|
"""Delete a collection. It is detected from all parent elements. If members are anchored to the collection
|
2387
2058
|
then they are also deleted. Async version
|
2388
2059
|
|
@@ -2392,8 +2063,8 @@ class CollectionManager(Client):
|
|
2392
2063
|
collection_guid: str
|
2393
2064
|
The guid of the collection to update.
|
2394
2065
|
|
2395
|
-
|
2396
|
-
|
2066
|
+
cascade: bool, optional, defaults to True
|
2067
|
+
If true, a cascade delete is performed.
|
2397
2068
|
|
2398
2069
|
Returns
|
2399
2070
|
-------
|
@@ -2409,14 +2080,14 @@ class CollectionManager(Client):
|
|
2409
2080
|
The principle specified by the user_id does not have authorization for the requested action
|
2410
2081
|
|
2411
2082
|
"""
|
2412
|
-
|
2413
|
-
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}"
|
2414
2085
|
body = {"class": "NullRequestBody"}
|
2415
2086
|
|
2416
2087
|
await self._async_make_request("POST", url, body)
|
2417
2088
|
return
|
2418
2089
|
|
2419
|
-
def delete_collection(self, collection_guid: str) -> None:
|
2090
|
+
def delete_collection(self, collection_guid: str, cascade:bool=False) -> None:
|
2420
2091
|
"""Delete a collection. It is detected from all parent elements. If members are anchored to the collection
|
2421
2092
|
then they are also deleted.
|
2422
2093
|
|
@@ -2425,8 +2096,8 @@ class CollectionManager(Client):
|
|
2425
2096
|
collection_guid: str
|
2426
2097
|
The guid of the collection to update.
|
2427
2098
|
|
2428
|
-
|
2429
|
-
|
2099
|
+
cascade: bool, optional, defaults to True
|
2100
|
+
If true, a cascade delete is performed.
|
2430
2101
|
|
2431
2102
|
Returns
|
2432
2103
|
-------
|
@@ -2444,17 +2115,11 @@ class CollectionManager(Client):
|
|
2444
2115
|
|
2445
2116
|
"""
|
2446
2117
|
loop = asyncio.get_event_loop()
|
2447
|
-
loop.run_until_complete(self._async_delete_collection(collection_guid))
|
2118
|
+
loop.run_until_complete(self._async_delete_collection(collection_guid, cascade))
|
2448
2119
|
return
|
2449
2120
|
|
2450
|
-
async def _async_get_collection_members(
|
2451
|
-
|
2452
|
-
collection_guid: str = None,
|
2453
|
-
collection_name: str = None,
|
2454
|
-
collection_qname: str = None,
|
2455
|
-
start_from: int = 0,
|
2456
|
-
page_size: int = None,
|
2457
|
-
) -> 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:
|
2458
2123
|
"""Return a list of elements that are a member of a collection. Async version.
|
2459
2124
|
|
2460
2125
|
Parameters
|
@@ -2493,29 +2158,15 @@ class CollectionManager(Client):
|
|
2493
2158
|
|
2494
2159
|
if page_size is None:
|
2495
2160
|
page_size = self.page_size
|
2496
|
-
collection_guid = self.__get_guid__(
|
2497
|
-
|
2498
|
-
|
2499
|
-
"name",
|
2500
|
-
collection_qname,
|
2501
|
-
None,
|
2502
|
-
)
|
2503
|
-
url = (
|
2504
|
-
f"{self.collection_command_root}/{collection_guid}/"
|
2505
|
-
f"members?startFrom={start_from}&pageSize={page_size}"
|
2506
|
-
)
|
2161
|
+
collection_guid = self.__get_guid__(collection_guid, collection_name, "name", collection_qname, None, )
|
2162
|
+
url = (f"{self.collection_command_root}/{collection_guid}/"
|
2163
|
+
f"members?startFrom={start_from}&pageSize={page_size}")
|
2507
2164
|
|
2508
2165
|
resp = await self._async_make_request("GET", url)
|
2509
2166
|
return resp.json().get("elements", NO_ELEMENTS_FOUND)
|
2510
2167
|
|
2511
|
-
def get_collection_members(
|
2512
|
-
|
2513
|
-
collection_guid: str = None,
|
2514
|
-
collection_name: str = None,
|
2515
|
-
collection_qname: str = None,
|
2516
|
-
start_from: int = 0,
|
2517
|
-
page_size: int = None,
|
2518
|
-
) -> list | str:
|
2168
|
+
def get_collection_members(self, collection_guid: str = None, collection_name: str = None,
|
2169
|
+
collection_qname: str = None, start_from: int = 0, page_size: int = None, ) -> list | str:
|
2519
2170
|
"""Return a list of elements that are a member of a collection. Async version.
|
2520
2171
|
|
2521
2172
|
Parameters
|
@@ -2553,23 +2204,12 @@ class CollectionManager(Client):
|
|
2553
2204
|
"""
|
2554
2205
|
loop = asyncio.get_event_loop()
|
2555
2206
|
resp = loop.run_until_complete(
|
2556
|
-
self._async_get_collection_members(
|
2557
|
-
|
2558
|
-
collection_name,
|
2559
|
-
collection_qname,
|
2560
|
-
start_from,
|
2561
|
-
page_size,
|
2562
|
-
)
|
2563
|
-
)
|
2207
|
+
self._async_get_collection_members(collection_guid, collection_name, collection_qname, start_from,
|
2208
|
+
page_size, ))
|
2564
2209
|
|
2565
2210
|
return resp
|
2566
2211
|
|
2567
|
-
async def _async_add_to_collection(
|
2568
|
-
self,
|
2569
|
-
collection_guid: str,
|
2570
|
-
element_guid: str,
|
2571
|
-
body: dict = None,
|
2572
|
-
) -> None:
|
2212
|
+
async def _async_add_to_collection(self, collection_guid: str, element_guid: str, body: dict = None, ) -> None:
|
2573
2213
|
"""Add an element to a collection. The request body is optional. Async version.
|
2574
2214
|
|
2575
2215
|
Parameters
|
@@ -2618,20 +2258,13 @@ class CollectionManager(Client):
|
|
2618
2258
|
|
2619
2259
|
"""
|
2620
2260
|
|
2621
|
-
url = (
|
2622
|
-
|
2623
|
-
f"{element_guid}/attach"
|
2624
|
-
)
|
2261
|
+
url = (f"{self.collection_command_root}/{collection_guid}/members/"
|
2262
|
+
f"{element_guid}/attach")
|
2625
2263
|
body_s = body_slimmer(body)
|
2626
2264
|
await self._async_make_request("POST", url, body_s)
|
2627
2265
|
return
|
2628
2266
|
|
2629
|
-
def add_to_collection(
|
2630
|
-
self,
|
2631
|
-
collection_guid: str,
|
2632
|
-
element_guid: str,
|
2633
|
-
body: dict = None,
|
2634
|
-
) -> None:
|
2267
|
+
def add_to_collection(self, collection_guid: str, element_guid: str, body: dict = None, ) -> None:
|
2635
2268
|
"""Add an element to a collection. The request body is optional.
|
2636
2269
|
|
2637
2270
|
Parameters
|
@@ -2680,18 +2313,11 @@ class CollectionManager(Client):
|
|
2680
2313
|
|
2681
2314
|
"""
|
2682
2315
|
loop = asyncio.get_event_loop()
|
2683
|
-
loop.run_until_complete(
|
2684
|
-
self._async_add_to_collection(collection_guid, element_guid, body)
|
2685
|
-
)
|
2316
|
+
loop.run_until_complete(self._async_add_to_collection(collection_guid, element_guid, body))
|
2686
2317
|
return
|
2687
2318
|
|
2688
|
-
async def _async_update_collection_membership(
|
2689
|
-
|
2690
|
-
collection_guid: str,
|
2691
|
-
element_guid: str,
|
2692
|
-
body: dict = None,
|
2693
|
-
replace_all_props: bool = False,
|
2694
|
-
) -> None:
|
2319
|
+
async def _async_update_collection_membership(self, collection_guid: str, element_guid: str, body: dict = None,
|
2320
|
+
replace_all_props: bool = False, ) -> None:
|
2695
2321
|
"""Update an element's membership to a collection. Async version.
|
2696
2322
|
|
2697
2323
|
Parameters
|
@@ -2743,21 +2369,14 @@ class CollectionManager(Client):
|
|
2743
2369
|
"""
|
2744
2370
|
|
2745
2371
|
replace_all_props_s = str(replace_all_props).lower()
|
2746
|
-
url = (
|
2747
|
-
|
2748
|
-
f"{element_guid}/update?replaceAllProperties={replace_all_props_s}"
|
2749
|
-
)
|
2372
|
+
url = (f"{self.collection_command_root}/{collection_guid}/members/"
|
2373
|
+
f"{element_guid}/update?replaceAllProperties={replace_all_props_s}")
|
2750
2374
|
body_s = body_slimmer(body)
|
2751
2375
|
await self._async_make_request("POST", url, body_s)
|
2752
2376
|
return
|
2753
2377
|
|
2754
|
-
def update_collection_membership(
|
2755
|
-
|
2756
|
-
collection_guid: str,
|
2757
|
-
element_guid: str,
|
2758
|
-
body: dict = None,
|
2759
|
-
replace_all_props: bool = False,
|
2760
|
-
) -> None:
|
2378
|
+
def update_collection_membership(self, collection_guid: str, element_guid: str, body: dict = None,
|
2379
|
+
replace_all_props: bool = False, ) -> None:
|
2761
2380
|
"""Update an element's membership to a collection.
|
2762
2381
|
|
2763
2382
|
Parameters
|
@@ -2809,15 +2428,10 @@ class CollectionManager(Client):
|
|
2809
2428
|
"""
|
2810
2429
|
loop = asyncio.get_event_loop()
|
2811
2430
|
loop.run_until_complete(
|
2812
|
-
self._async_update_collection_membership(
|
2813
|
-
collection_guid, element_guid, body, replace_all_props
|
2814
|
-
)
|
2815
|
-
)
|
2431
|
+
self._async_update_collection_membership(collection_guid, element_guid, body, replace_all_props))
|
2816
2432
|
return
|
2817
2433
|
|
2818
|
-
async def _async_remove_from_collection(
|
2819
|
-
self, collection_guid: str, element_guid: str
|
2820
|
-
) -> None:
|
2434
|
+
async def _async_remove_from_collection(self, collection_guid: str, element_guid: str) -> None:
|
2821
2435
|
"""Remove an element from a collection. Async version.
|
2822
2436
|
|
2823
2437
|
Parameters
|
@@ -2846,10 +2460,8 @@ class CollectionManager(Client):
|
|
2846
2460
|
|
2847
2461
|
"""
|
2848
2462
|
|
2849
|
-
url = (
|
2850
|
-
|
2851
|
-
f"{element_guid}/detach"
|
2852
|
-
)
|
2463
|
+
url = (f"{self.collection_command_root}/{collection_guid}/members/"
|
2464
|
+
f"{element_guid}/detach")
|
2853
2465
|
body = {"class": "NullRequestBody"}
|
2854
2466
|
await self._async_make_request("POST", url, body)
|
2855
2467
|
return
|
@@ -2883,17 +2495,11 @@ class CollectionManager(Client):
|
|
2883
2495
|
|
2884
2496
|
"""
|
2885
2497
|
loop = asyncio.get_event_loop()
|
2886
|
-
loop.run_until_complete(
|
2887
|
-
self._async_remove_from_collection(collection_guid, element_guid)
|
2888
|
-
)
|
2498
|
+
loop.run_until_complete(self._async_remove_from_collection(collection_guid, element_guid))
|
2889
2499
|
return
|
2890
2500
|
|
2891
|
-
async def _async_get_member_list(
|
2892
|
-
|
2893
|
-
collection_guid: str = None,
|
2894
|
-
collection_name: str = None,
|
2895
|
-
collection_qname: str = None,
|
2896
|
-
) -> list | bool:
|
2501
|
+
async def _async_get_member_list(self, collection_guid: str = None, collection_name: str = None,
|
2502
|
+
collection_qname: str = None, ) -> list | bool:
|
2897
2503
|
"""Get the member list for the collection - async version.
|
2898
2504
|
Parameters
|
2899
2505
|
----------
|
@@ -2923,9 +2529,7 @@ class CollectionManager(Client):
|
|
2923
2529
|
|
2924
2530
|
# now find the members of the collection
|
2925
2531
|
member_list = []
|
2926
|
-
members = await self._async_get_collection_members(
|
2927
|
-
collection_guid, collection_name, collection_qname
|
2928
|
-
)
|
2532
|
+
members = await self._async_get_collection_members(collection_guid, collection_name, collection_qname)
|
2929
2533
|
if (type(members) is str) or (len(members) == 0):
|
2930
2534
|
return "No members found"
|
2931
2535
|
# finally, construct a list of member information
|
@@ -2938,22 +2542,16 @@ class CollectionManager(Client):
|
|
2938
2542
|
# print(json.dumps(member, indent = 4))
|
2939
2543
|
|
2940
2544
|
member_instance = {
|
2941
|
-
"name": member["properties"]["name"],
|
2942
|
-
"
|
2943
|
-
"guid": member["elementHeader"]["guid"],
|
2944
|
-
"description": member["properties"]["description"],
|
2545
|
+
"name": member["properties"]["name"], "qualifiedName": member["properties"]["qualifiedName"],
|
2546
|
+
"guid": member["elementHeader"]["guid"], "description": member["properties"]["description"],
|
2945
2547
|
"collectionType": member["properties"]["collectionType"],
|
2946
|
-
|
2548
|
+
}
|
2947
2549
|
member_list.append(member_instance)
|
2948
2550
|
|
2949
2551
|
return member_list if len(member_list) > 0 else "No members found"
|
2950
2552
|
|
2951
|
-
def get_member_list(
|
2952
|
-
|
2953
|
-
collection_guid: str = None,
|
2954
|
-
collection_name: str = None,
|
2955
|
-
collection_qname: str = None,
|
2956
|
-
) -> list | bool:
|
2553
|
+
def get_member_list(self, collection_guid: str = None, collection_name: str = None,
|
2554
|
+
collection_qname: str = None, ) -> list | bool:
|
2957
2555
|
"""Get the member list for the collection - async version.
|
2958
2556
|
Parameters
|
2959
2557
|
----------
|
@@ -2978,13 +2576,164 @@ class CollectionManager(Client):
|
|
2978
2576
|
|
2979
2577
|
"""
|
2980
2578
|
loop = asyncio.get_event_loop()
|
2981
|
-
resp = loop.run_until_complete(
|
2982
|
-
self._async_get_member_list(
|
2983
|
-
collection_guid, collection_name, collection_qname
|
2984
|
-
)
|
2985
|
-
)
|
2579
|
+
resp = loop.run_until_complete(self._async_get_member_list(collection_guid, collection_name, collection_qname))
|
2986
2580
|
return resp
|
2987
2581
|
|
2582
|
+
def _extract_collection_properties(self, element: dict) -> dict:
|
2583
|
+
"""
|
2584
|
+
Extract common properties from a collection element.
|
2585
|
+
|
2586
|
+
Args:
|
2587
|
+
element (dict): The collection element
|
2588
|
+
|
2589
|
+
Returns:
|
2590
|
+
dict: Dictionary of extracted properties
|
2591
|
+
"""
|
2592
|
+
guid = element['elementHeader'].get("guid", None)
|
2593
|
+
properties = element['properties']
|
2594
|
+
display_name = properties.get("name", "") or ""
|
2595
|
+
description = properties.get("description", "") or ""
|
2596
|
+
qualified_name = properties.get("qualifiedName", "") or ""
|
2597
|
+
collection_type = properties.get("collectionType", "") or ""
|
2598
|
+
classifications = "\n* ".join(properties.get("classifications", [])) or ""
|
2599
|
+
# classification_names = ""
|
2600
|
+
# classifications = element['elementHeader'].get("classifications", [])
|
2601
|
+
# for classification in classifications:
|
2602
|
+
# classification_names += f"{classification['classificationName']}, "
|
2603
|
+
|
2604
|
+
|
2605
|
+
|
2606
|
+
return {
|
2607
|
+
'guid': guid,
|
2608
|
+
'properties': properties,
|
2609
|
+
'display_name': display_name,
|
2610
|
+
'description': description,
|
2611
|
+
'qualified_name': qualified_name,
|
2612
|
+
'classifications': classifications,
|
2613
|
+
'collection_type': collection_type
|
2614
|
+
}
|
2615
|
+
|
2616
|
+
def generate_basic_structured_output(self, elements, filter, output_format) -> str | list:
|
2617
|
+
"""
|
2618
|
+
Generate output in the specified format for the given elements.
|
2619
|
+
|
2620
|
+
Args:
|
2621
|
+
elements: Dictionary or list of dictionaries containing element data
|
2622
|
+
filter: The search string used to find the elements
|
2623
|
+
output_format: The desired output format (MD, FORM, REPORT, LIST, DICT, MERMAID)
|
2624
|
+
|
2625
|
+
Returns:
|
2626
|
+
Formatted output as string or list of dictionaries
|
2627
|
+
"""
|
2628
|
+
# Handle MERMAID and DICT formats using existing methods
|
2629
|
+
if output_format == "MERMAID":
|
2630
|
+
return extract_mermaid_only(elements)
|
2631
|
+
elif output_format == "DICT":
|
2632
|
+
return extract_basic_dict(elements)
|
2633
|
+
|
2634
|
+
# For other formats (MD, FORM, REPORT, LIST), use generate_output
|
2635
|
+
elif output_format in ["MD", "FORM", "REPORT", "LIST"]:
|
2636
|
+
# Define columns for LIST format
|
2637
|
+
columns = [
|
2638
|
+
{'name': 'Collection Name', 'key': 'display_name'},
|
2639
|
+
{'name': 'Qualified Name', 'key': 'qualified_name'},
|
2640
|
+
{'name': 'Collection Type', 'key': 'collection_type'},
|
2641
|
+
{'name': 'Classifications', 'key': 'classifications'},
|
2642
|
+
{'name': 'Description', 'key': 'description', 'format': True}
|
2643
|
+
]
|
2644
|
+
|
2645
|
+
return generate_output(
|
2646
|
+
elements=elements,
|
2647
|
+
search_string=filter,
|
2648
|
+
entity_type="Collection",
|
2649
|
+
output_format=output_format,
|
2650
|
+
extract_properties_func=self._extract_collection_properties,
|
2651
|
+
columns=columns if output_format == 'LIST' else None
|
2652
|
+
)
|
2653
|
+
|
2654
|
+
# Default case
|
2655
|
+
return None
|
2656
|
+
|
2657
|
+
def generate_collection_output(self, elements, filter, output_format) -> str | list | dict:
|
2658
|
+
"""
|
2659
|
+
Generate output in the specified format for the given elements.
|
2660
|
+
|
2661
|
+
Args:
|
2662
|
+
elements: Dictionary or list of dictionaries containing element data
|
2663
|
+
filter: The search string used to find the elements
|
2664
|
+
output_format: The desired output format (MD, FORM, REPORT, LIST, DICT, MERMAID, JSON)
|
2665
|
+
|
2666
|
+
Returns:
|
2667
|
+
Formatted output as string or list of dictionaries
|
2668
|
+
"""
|
2669
|
+
# For LIST and DICT formats, get member information
|
2670
|
+
if output_format in ["LIST", "DICT"]:
|
2671
|
+
# Get the collection GUID
|
2672
|
+
collection_guid = None
|
2673
|
+
if isinstance(elements, dict):
|
2674
|
+
collection_guid = elements.get('elementHeader', {}).get('guid')
|
2675
|
+
elif isinstance(elements, list) and len(elements) > 0:
|
2676
|
+
collection_guid = elements[0].get('elementHeader', {}).get('guid')
|
2677
|
+
|
2678
|
+
# Get member list if we have a valid collection GUID
|
2679
|
+
members = []
|
2680
|
+
if collection_guid:
|
2681
|
+
members = self.get_member_list(collection_guid=collection_guid)
|
2682
|
+
if isinstance(members, str): # "No members found" case
|
2683
|
+
members = []
|
2684
|
+
|
2685
|
+
# For DICT format, include all member information in the result
|
2686
|
+
if output_format == "DICT":
|
2687
|
+
result = self.generate_basic_structured_output(elements, filter, output_format)
|
2688
|
+
if isinstance(result, list):
|
2689
|
+
for item in result:
|
2690
|
+
item['members'] = members
|
2691
|
+
return result
|
2692
|
+
elif isinstance(result, dict):
|
2693
|
+
result['members'] = members
|
2694
|
+
return result
|
2695
|
+
|
2696
|
+
# For LIST format, add a column with bulleted list of qualified names
|
2697
|
+
elif output_format == "LIST":
|
2698
|
+
# Define columns for LIST format, including the new Members column
|
2699
|
+
columns = [
|
2700
|
+
{'name': 'Collection Name', 'key': 'display_name'},
|
2701
|
+
{'name': 'Qualified Name', 'key': 'qualified_name'},
|
2702
|
+
{'name': 'Collection Type', 'key': 'collection_type'},
|
2703
|
+
{'name': 'Description', 'key': 'description', 'format': True},
|
2704
|
+
{'name': 'Classifications', 'key': 'classifications'},
|
2705
|
+
{'name': 'Members', 'key': 'members', 'format': True}
|
2706
|
+
]
|
2707
|
+
|
2708
|
+
# Create a function to add member information to the properties
|
2709
|
+
def get_additional_props(element, guid, output_format):
|
2710
|
+
if not members:
|
2711
|
+
return {'members': ''}
|
2712
|
+
|
2713
|
+
# Create a comma-separated list of qualified names (no newlines to avoid table formatting issues)
|
2714
|
+
member_list = ", ".join([member.get('qualifiedName', '') for member in members])
|
2715
|
+
return {'members': member_list}
|
2716
|
+
|
2717
|
+
# Generate output with the additional properties
|
2718
|
+
return generate_output(
|
2719
|
+
elements=elements,
|
2720
|
+
search_string=filter,
|
2721
|
+
entity_type="Collection",
|
2722
|
+
output_format=output_format,
|
2723
|
+
extract_properties_func=self._extract_collection_properties,
|
2724
|
+
get_additional_props_func=get_additional_props,
|
2725
|
+
columns=columns
|
2726
|
+
)
|
2727
|
+
|
2728
|
+
# For FORM, REPORT, JSON formats, keep behavior unchanged
|
2729
|
+
return self.generate_basic_structured_output(elements, filter, output_format)
|
2730
|
+
|
2731
|
+
def generate_data_class_output(self, elements, filter, output_format) -> str | list:
|
2732
|
+
return self.generate_basic_structured_output(elements, filter, output_format)
|
2733
|
+
|
2734
|
+
def generate_data_field_output(self, elements, filter, output_format) -> str | list:
|
2735
|
+
return self.generate_basic_structured_output(elements, filter, output_format)
|
2736
|
+
|
2988
2737
|
|
2989
2738
|
if __name__ == "__main__":
|
2990
2739
|
print("Main-Collection Manager")
|