pyegeria 0.2.4__py3-none-any.whl → 5.3.0.dev3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyegeria/README.md +35 -0
- pyegeria/__init__.py +345 -14
- pyegeria/_client.py +376 -126
- pyegeria/_deprecated_gov_engine.py +451 -0
- pyegeria/_exceptions.py +6 -6
- pyegeria/_globals.py +7 -1
- pyegeria/_validators.py +9 -6
- pyegeria/asset_catalog_omvs.py +807 -0
- pyegeria/automated_curation_omvs.py +3760 -0
- pyegeria/classification_manager_omvs.py +5238 -0
- pyegeria/collection_manager_omvs.py +2727 -0
- pyegeria/commands/README.md +47 -0
- pyegeria/commands/__init__.py +22 -0
- pyegeria/commands/cat/README.md +16 -0
- pyegeria/commands/cat/__init__.py +1 -0
- pyegeria/commands/cat/exp_list_glossaries.py +156 -0
- pyegeria/commands/cat/get_asset_graph.py +319 -0
- pyegeria/commands/cat/get_collection.py +148 -0
- pyegeria/commands/cat/get_project_dependencies.py +168 -0
- pyegeria/commands/cat/get_project_structure.py +168 -0
- pyegeria/commands/cat/get_tech_type_elements.py +174 -0
- pyegeria/commands/cat/glossary_actions.py +362 -0
- pyegeria/commands/cat/list_assets.py +176 -0
- pyegeria/commands/cat/list_cert_types.py +194 -0
- pyegeria/commands/cat/list_collections.py +162 -0
- pyegeria/commands/cat/list_deployed_catalogs.py +217 -0
- pyegeria/commands/cat/list_deployed_database_schemas.py +251 -0
- pyegeria/commands/cat/list_deployed_databases.py +202 -0
- pyegeria/commands/cat/list_glossaries.py +150 -0
- pyegeria/commands/cat/list_projects.py +221 -0
- pyegeria/commands/cat/list_servers_deployed_imp.py +158 -0
- pyegeria/commands/cat/list_tech_type_elements.py +190 -0
- pyegeria/commands/cat/list_tech_types.py +140 -0
- pyegeria/commands/cat/list_terms.py +242 -0
- pyegeria/commands/cat/list_todos.py +189 -0
- pyegeria/commands/cat/list_user_ids.py +145 -0
- pyegeria/commands/cli/__init__.py +13 -0
- pyegeria/commands/cli/egeria.py +1844 -0
- pyegeria/commands/cli/egeria_cat.py +638 -0
- pyegeria/commands/cli/egeria_login_tui.py +313 -0
- pyegeria/commands/cli/egeria_my.py +248 -0
- pyegeria/commands/cli/egeria_ops.py +502 -0
- pyegeria/commands/cli/egeria_tech.py +618 -0
- pyegeria/commands/cli/ops_config.py +45 -0
- pyegeria/commands/cli/txt_custom_v2.tcss +19 -0
- pyegeria/commands/doc/README.md +145 -0
- pyegeria/commands/doc/Visual Command Reference/README.md +511 -0
- 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 +109 -0
- 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 +346 -0
- 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/commands/my/README.md +17 -0
- pyegeria/commands/my/__init__.py +0 -0
- pyegeria/commands/my/list_my_profile.py +163 -0
- pyegeria/commands/my/list_my_roles.py +151 -0
- pyegeria/commands/my/monitor_my_todos.py +205 -0
- pyegeria/commands/my/monitor_open_todos.py +175 -0
- pyegeria/commands/my/todo_actions.py +242 -0
- pyegeria/commands/ops/README.md +24 -0
- pyegeria/commands/ops/__init__.py +22 -0
- pyegeria/commands/ops/gov_server_actions.py +177 -0
- pyegeria/commands/ops/list_archives.py +161 -0
- pyegeria/commands/ops/list_catalog_targets.py +203 -0
- pyegeria/commands/ops/load_archive.py +75 -0
- pyegeria/commands/ops/monitor_asset_events.py +107 -0
- pyegeria/commands/ops/monitor_engine_activity.py +270 -0
- pyegeria/commands/ops/monitor_engine_activity_c.py +286 -0
- pyegeria/commands/ops/monitor_gov_eng_status.py +288 -0
- pyegeria/commands/ops/monitor_integ_daemon_status.py +321 -0
- pyegeria/commands/ops/monitor_platform_status.py +188 -0
- pyegeria/commands/ops/monitor_server_startup.py +117 -0
- pyegeria/commands/ops/monitor_server_status.py +182 -0
- pyegeria/commands/ops/orig_monitor_server_list.py +140 -0
- pyegeria/commands/ops/orig_monitor_server_status.py +124 -0
- pyegeria/commands/ops/refresh_integration_daemon.py +83 -0
- pyegeria/commands/ops/restart_integration_daemon.py +82 -0
- pyegeria/commands/ops/table_integ_daemon_status.py +237 -0
- pyegeria/commands/ops/x_engine_actions.py +76 -0
- pyegeria/commands/tech/README.md +24 -0
- pyegeria/commands/tech/__init__.py +0 -0
- pyegeria/commands/tech/get_element_info.py +144 -0
- pyegeria/commands/tech/get_guid_info.py +134 -0
- pyegeria/commands/tech/get_tech_details.py +173 -0
- pyegeria/commands/tech/get_tech_type_template.py +166 -0
- pyegeria/commands/tech/list_anchored_elements.py +205 -0
- pyegeria/commands/tech/list_asset_types.py +123 -0
- pyegeria/commands/tech/list_elements.py +168 -0
- pyegeria/commands/tech/list_elements_for_classification.py +171 -0
- pyegeria/commands/tech/list_elements_x.py +191 -0
- pyegeria/commands/tech/list_gov_action_processes.py +139 -0
- pyegeria/commands/tech/list_registered_services.py +180 -0
- pyegeria/commands/tech/list_related_elements.py +207 -0
- pyegeria/commands/tech/list_related_specification.py +169 -0
- pyegeria/commands/tech/list_relationship_types.py +164 -0
- pyegeria/commands/tech/list_relationships.py +179 -0
- pyegeria/commands/tech/list_tech_templates.py +360 -0
- pyegeria/commands/tech/list_valid_metadata_values.py +178 -0
- pyegeria/commands/tech/table_tech_templates.py +238 -0
- pyegeria/commands/tech/x_list_related_elements.py +165 -0
- pyegeria/core_omag_server_config.py +550 -313
- pyegeria/create_tech_guid_lists.py +105 -0
- pyegeria/egeria_cat_client.py +78 -0
- pyegeria/egeria_client.py +117 -0
- pyegeria/egeria_config_client.py +45 -0
- pyegeria/egeria_my_client.py +56 -0
- pyegeria/egeria_tech_client.py +93 -0
- pyegeria/feedback_manager_omvs.py +4573 -0
- pyegeria/full_omag_server_config.py +1337 -0
- pyegeria/glossary_browser_omvs.py +2507 -0
- pyegeria/glossary_manager_omvs.py +3597 -0
- pyegeria/mermaid_utilities.py +218 -0
- pyegeria/metadata_explorer_omvs.py +2371 -0
- pyegeria/my_profile_omvs.py +1021 -0
- pyegeria/platform_services.py +259 -218
- pyegeria/project_manager_omvs.py +1854 -0
- pyegeria/registered_info.py +111 -108
- pyegeria/runtime_manager_omvs.py +2299 -0
- pyegeria/server_operations.py +178 -71
- pyegeria/template_manager_omvs.py +1414 -0
- pyegeria/utils.py +75 -85
- pyegeria/valid_metadata_omvs.py +1911 -0
- pyegeria/x_action_author_omvs.py +200 -0
- pyegeria-5.3.0.dev3.dist-info/METADATA +70 -0
- pyegeria-5.3.0.dev3.dist-info/RECORD +232 -0
- {pyegeria-0.2.4.dist-info → pyegeria-5.3.0.dev3.dist-info}/WHEEL +1 -1
- pyegeria-5.3.0.dev3.dist-info/entry_points.txt +81 -0
- pyegeria/config.toml +0 -11
- pyegeria/curation_omvs.py +0 -458
- pyegeria/exceptions.py +0 -382
- pyegeria/glossary_omvs.py +0 -639
- pyegeria/gov_engine.py +0 -573
- pyegeria-0.2.4.dist-info/METADATA +0 -57
- pyegeria-0.2.4.dist-info/RECORD +0 -19
- {pyegeria-0.2.4.dist-info/licenses → pyegeria-5.3.0.dev3.dist-info}/LICENSE +0 -0
@@ -0,0 +1,807 @@
|
|
1
|
+
"""
|
2
|
+
SPDX-License-Identifier: Apache-2.0
|
3
|
+
Copyright Contributors to the ODPi Egeria project.
|
4
|
+
|
5
|
+
Asset Catalog View Service Methods - Search for assets, retrieve their properties, lineage and related glossary
|
6
|
+
information.
|
7
|
+
|
8
|
+
This file is in active development...
|
9
|
+
|
10
|
+
"""
|
11
|
+
import asyncio
|
12
|
+
import json
|
13
|
+
|
14
|
+
from httpx import Response
|
15
|
+
|
16
|
+
from pyegeria import Client, max_paging_size, body_slimmer, TEMPLATE_GUIDS
|
17
|
+
from pyegeria._exceptions import (
|
18
|
+
InvalidParameterException,
|
19
|
+
)
|
20
|
+
from ._validators import validate_search_string
|
21
|
+
|
22
|
+
|
23
|
+
class AssetCatalog(Client):
|
24
|
+
"""Set up and maintain automation services in Egeria.
|
25
|
+
|
26
|
+
Attributes:
|
27
|
+
view_server : str
|
28
|
+
The name of the View Server to use.
|
29
|
+
platform_url : str
|
30
|
+
URL of the server platform to connect to
|
31
|
+
user_id : str
|
32
|
+
The identity of the user calling the method - this sets a default optionally used by the methods
|
33
|
+
when the user doesn't pass the user_id on a method call.
|
34
|
+
user_pwd: str
|
35
|
+
The password associated with the user_id. Defaults to None
|
36
|
+
|
37
|
+
"""
|
38
|
+
|
39
|
+
def __init__(
|
40
|
+
self,
|
41
|
+
view_server: str,
|
42
|
+
platform_url: str,
|
43
|
+
user_id: str,
|
44
|
+
user_pwd: str = None,
|
45
|
+
token: str = None,
|
46
|
+
):
|
47
|
+
self.view_server = view_server
|
48
|
+
self.platform_url = platform_url
|
49
|
+
self.user_id = user_id
|
50
|
+
self.user_pwd = user_pwd
|
51
|
+
Client.__init__(self, view_server, platform_url, user_id, user_pwd, token=token)
|
52
|
+
|
53
|
+
async def _async_create_element_from_template(self, body: dict) -> str:
|
54
|
+
"""Create a new metadata element from a template. Async version.
|
55
|
+
Parameters
|
56
|
+
----------
|
57
|
+
body : str
|
58
|
+
The json body used to instantiate the template.
|
59
|
+
|
60
|
+
Returns
|
61
|
+
-------
|
62
|
+
Response
|
63
|
+
The guid of the resulting element
|
64
|
+
|
65
|
+
Raises
|
66
|
+
------
|
67
|
+
InvalidParameterException
|
68
|
+
PropertyServerException
|
69
|
+
UserNotAuthorizedException
|
70
|
+
|
71
|
+
Notes
|
72
|
+
-----
|
73
|
+
See also: https://egeria-project.org/features/templated-cataloguing/overview/
|
74
|
+
The full description of the body is shown below:
|
75
|
+
{
|
76
|
+
"typeName" : "",
|
77
|
+
"initialStatus" : "",
|
78
|
+
"initialClassifications" : "",
|
79
|
+
"anchorGUID" : "",
|
80
|
+
"isOwnAnchor" : "",
|
81
|
+
"effectiveFrom" : "",
|
82
|
+
"effectiveTo" : "",
|
83
|
+
"templateGUID" : "",
|
84
|
+
"templateProperties" : {},
|
85
|
+
"placeholderPropertyValues" : {
|
86
|
+
"placeholderPropertyName1" : "placeholderPropertyValue1",
|
87
|
+
"placeholderPropertyName2" : "placeholderPropertyValue2"
|
88
|
+
},
|
89
|
+
"parentGUID" : "",
|
90
|
+
"parentRelationshipTypeName" : "",
|
91
|
+
"parentRelationshipProperties" : "",
|
92
|
+
"parentAtEnd1" : "",
|
93
|
+
"effectiveTime" : ""
|
94
|
+
}
|
95
|
+
"""
|
96
|
+
|
97
|
+
url = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/automated-curation/catalog-templates/new-element"
|
98
|
+
response = await self._async_make_request("POST", url, body)
|
99
|
+
return response.json().get("guid", "GUID failed to be returned")
|
100
|
+
|
101
|
+
def create_element_from_template(self, body: dict) -> str:
|
102
|
+
"""Create a new metadata element from a template. Async version.
|
103
|
+
Parameters
|
104
|
+
----------
|
105
|
+
body : str
|
106
|
+
The json body used to instantiate the template.
|
107
|
+
server : str, optional
|
108
|
+
The name of the view server to use. If not provided, the default server name will be used.
|
109
|
+
|
110
|
+
Returns
|
111
|
+
-------
|
112
|
+
Response
|
113
|
+
The guid of the resulting element
|
114
|
+
|
115
|
+
Raises
|
116
|
+
------
|
117
|
+
InvalidParameterException
|
118
|
+
PropertyServerException
|
119
|
+
UserNotAuthorizedException
|
120
|
+
|
121
|
+
Notes
|
122
|
+
-----
|
123
|
+
See also: https://egeria-project.org/features/templated-cataloguing/overview/
|
124
|
+
The full description of the body is shown below:
|
125
|
+
{
|
126
|
+
"typeName" : "",
|
127
|
+
"initialStatus" : "",
|
128
|
+
"initialClassifications" : "",
|
129
|
+
"anchorGUID" : "",
|
130
|
+
"isOwnAnchor" : "",
|
131
|
+
"effectiveFrom" : "",
|
132
|
+
"effectiveTo" : "",
|
133
|
+
"templateGUID" : "",
|
134
|
+
"templateProperties" : {},
|
135
|
+
"placeholderPropertyValues" : {
|
136
|
+
"placeholderPropertyName1" : "placeholderPropertyValue1",
|
137
|
+
"placeholderPropertyName2" : "placeholderPropertyValue2"
|
138
|
+
},
|
139
|
+
"parentGUID" : "",
|
140
|
+
"parentRelationshipTypeName" : "",
|
141
|
+
"parentRelationshipProperties" : "",
|
142
|
+
"parentAtEnd1" : "",
|
143
|
+
"effectiveTime" : ""
|
144
|
+
}
|
145
|
+
"""
|
146
|
+
loop = asyncio.get_event_loop()
|
147
|
+
response = loop.run_until_complete(
|
148
|
+
self._async_create_element_from_template(body)
|
149
|
+
)
|
150
|
+
return response
|
151
|
+
|
152
|
+
async def _async_create_kafka_server_element_from_template(
|
153
|
+
self, kafka_server: str, host_name: str, port: str
|
154
|
+
) -> str:
|
155
|
+
"""Create a Kafka server element from a template. Async version.
|
156
|
+
|
157
|
+
Parameters
|
158
|
+
----------
|
159
|
+
kafka_server : str
|
160
|
+
The name of the Kafka server.
|
161
|
+
|
162
|
+
host_name : str
|
163
|
+
The host name of the Kafka server.
|
164
|
+
|
165
|
+
port : str
|
166
|
+
The port number of the Kafka server.
|
167
|
+
|
168
|
+
Returns
|
169
|
+
-------
|
170
|
+
str
|
171
|
+
The GUID of the Kafka server element.
|
172
|
+
"""
|
173
|
+
|
174
|
+
body = {
|
175
|
+
"templateGUID": TEMPLATE_GUIDS["Apache Kafka Server"],
|
176
|
+
"isOwnAnchor": "true",
|
177
|
+
"placeholderPropertyValues": {
|
178
|
+
"serverName": kafka_server,
|
179
|
+
"hostIdentifier": host_name,
|
180
|
+
"portNumber": port,
|
181
|
+
},
|
182
|
+
}
|
183
|
+
response = await self._async_create_element_from_template(body)
|
184
|
+
return response
|
185
|
+
|
186
|
+
def create_kafka_server_element_from_template(
|
187
|
+
self, kafka_server: str, host_name: str, port: str
|
188
|
+
) -> str:
|
189
|
+
"""Create a Kafka server element from a template.
|
190
|
+
|
191
|
+
Parameters
|
192
|
+
----------
|
193
|
+
kafka_server : str
|
194
|
+
The name of the Kafka server.
|
195
|
+
|
196
|
+
host_name : str
|
197
|
+
The host name of the Kafka server.
|
198
|
+
|
199
|
+
port : str
|
200
|
+
The port number of the Kafka server.
|
201
|
+
|
202
|
+
Returns
|
203
|
+
-------
|
204
|
+
str
|
205
|
+
The GUID of the Kafka server element.
|
206
|
+
"""
|
207
|
+
loop = asyncio.get_event_loop()
|
208
|
+
response = loop.run_until_complete(
|
209
|
+
self._async_create_kafka_server_element_from_template(
|
210
|
+
kafka_server, host_name, port
|
211
|
+
)
|
212
|
+
)
|
213
|
+
return response
|
214
|
+
|
215
|
+
async def _async_create_postgres_server_element_from_template(
|
216
|
+
self,
|
217
|
+
postgres_server: str,
|
218
|
+
host_name: str,
|
219
|
+
port: str,
|
220
|
+
db_user: str,
|
221
|
+
db_pwd: str,
|
222
|
+
) -> str:
|
223
|
+
"""Create a Postgres server element from a template. Async version.
|
224
|
+
|
225
|
+
Parameters
|
226
|
+
----------
|
227
|
+
postgres_server : str
|
228
|
+
The name of the Postgres server.
|
229
|
+
|
230
|
+
host_name : str
|
231
|
+
The host name of the Postgres server.
|
232
|
+
|
233
|
+
port : str
|
234
|
+
The port number of the Postgres server.
|
235
|
+
|
236
|
+
db_user: str
|
237
|
+
User name to connect to the database
|
238
|
+
|
239
|
+
db_pwd: str
|
240
|
+
User password to connect to the database
|
241
|
+
|
242
|
+
Returns
|
243
|
+
-------
|
244
|
+
str
|
245
|
+
The GUID of the Kafka server element.
|
246
|
+
"""
|
247
|
+
body = {
|
248
|
+
"templateGUID": TEMPLATE_GUIDS["PostgreSQL Server"],
|
249
|
+
"isOwnAnchor": "true",
|
250
|
+
"placeholderPropertyValues": {
|
251
|
+
"serverName": postgres_server,
|
252
|
+
"hostIdentifier": host_name,
|
253
|
+
"portNumber": port,
|
254
|
+
"databaseUserId": db_user,
|
255
|
+
"databasePassword": db_pwd,
|
256
|
+
},
|
257
|
+
}
|
258
|
+
response = await self._async_create_element_from_template(body)
|
259
|
+
return response
|
260
|
+
|
261
|
+
def create_postgres_server_element_from_template(
|
262
|
+
self,
|
263
|
+
postgres_server: str,
|
264
|
+
host_name: str,
|
265
|
+
port: str,
|
266
|
+
db_user: str,
|
267
|
+
db_pwd: str,
|
268
|
+
) -> str:
|
269
|
+
"""Create a Postgres server element from a template.
|
270
|
+
|
271
|
+
Parameters
|
272
|
+
----------
|
273
|
+
postgres_server : str
|
274
|
+
The name of the Postgres server.
|
275
|
+
|
276
|
+
host_name : str
|
277
|
+
The host name of the Postgres server.
|
278
|
+
|
279
|
+
port : str
|
280
|
+
The port number of the Postgres server.
|
281
|
+
|
282
|
+
db_user: str
|
283
|
+
User name to connect to the database
|
284
|
+
|
285
|
+
db_pwd: str
|
286
|
+
User password to connect to the database
|
287
|
+
|
288
|
+
Returns
|
289
|
+
-------
|
290
|
+
str
|
291
|
+
The GUID of the Postgres server element.
|
292
|
+
"""
|
293
|
+
loop = asyncio.get_event_loop()
|
294
|
+
response = loop.run_until_complete(
|
295
|
+
self._async_create_postgres_server_element_from_template(
|
296
|
+
postgres_server, host_name, port, db_user, db_pwd
|
297
|
+
)
|
298
|
+
)
|
299
|
+
return response
|
300
|
+
|
301
|
+
#
|
302
|
+
# Engine Actions
|
303
|
+
#
|
304
|
+
|
305
|
+
async def _async_find_in_asset_domain(
|
306
|
+
self,
|
307
|
+
search_string: str,
|
308
|
+
start_from: int = 0,
|
309
|
+
page_size: int = max_paging_size,
|
310
|
+
starts_with: bool = True,
|
311
|
+
ends_with: bool = False,
|
312
|
+
ignore_case: bool = True,
|
313
|
+
time_out: int = 60,
|
314
|
+
) -> list | str:
|
315
|
+
"""Locate string value in elements that are anchored to assets. Async Version.
|
316
|
+
Asset: https: // egeria - project.org / concepts / asset /
|
317
|
+
|
318
|
+
Parameters
|
319
|
+
----------
|
320
|
+
search_string : str
|
321
|
+
The string used for searching engine actions by name.
|
322
|
+
|
323
|
+
starts_with : bool, optional
|
324
|
+
Whether to search engine actions that start with the given search string. Default is False.
|
325
|
+
|
326
|
+
ends_with : bool, optional
|
327
|
+
Whether to search engine actions that end with the given search string. Default is False.
|
328
|
+
|
329
|
+
ignore_case : bool, optional
|
330
|
+
Whether to ignore case while searching engine actions. Default is False.
|
331
|
+
|
332
|
+
start_from : int, optional
|
333
|
+
The index from which to start fetching the engine actions. Default is 0.
|
334
|
+
|
335
|
+
page_size : int, optional
|
336
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
337
|
+
|
338
|
+
Returns
|
339
|
+
-------
|
340
|
+
List[dict] or str
|
341
|
+
A list of dictionaries representing the engine actions found based on the search query.
|
342
|
+
If no actions are found, returns the string "no actions".
|
343
|
+
|
344
|
+
Raises:
|
345
|
+
------
|
346
|
+
InvalidParameterException
|
347
|
+
PropertyServerException
|
348
|
+
UserNotAuthorizedException
|
349
|
+
|
350
|
+
Notes
|
351
|
+
-----
|
352
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
353
|
+
"""
|
354
|
+
|
355
|
+
validate_search_string(search_string)
|
356
|
+
|
357
|
+
starts_with_s = str(starts_with).lower()
|
358
|
+
ends_with_s = str(ends_with).lower()
|
359
|
+
ignore_case_s = str(ignore_case).lower()
|
360
|
+
|
361
|
+
url = (
|
362
|
+
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/asset-catalog/assets/in-domain/"
|
363
|
+
f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
364
|
+
f"endWith={ends_with_s}&ignoreCase={ignore_case_s}"
|
365
|
+
)
|
366
|
+
body = {"filter": search_string}
|
367
|
+
response = await self._async_make_request("POST", url, body, time_out=time_out)
|
368
|
+
return response.json().get("searchMatches", "no assets found")
|
369
|
+
|
370
|
+
def find_in_asset_domain(
|
371
|
+
self,
|
372
|
+
search_string: str,
|
373
|
+
start_from: int = 0,
|
374
|
+
page_size: int = max_paging_size,
|
375
|
+
starts_with: bool = True,
|
376
|
+
ends_with: bool = False,
|
377
|
+
ignore_case: bool = True,
|
378
|
+
time_out: int = 60,
|
379
|
+
) -> list | str:
|
380
|
+
"""Retrieve the list of engine action metadata elements that contain the search string. Async Version.
|
381
|
+
Parameters
|
382
|
+
----------
|
383
|
+
search_string : str
|
384
|
+
The string used for searching engine actions by name.
|
385
|
+
|
386
|
+
starts_with : bool, optional
|
387
|
+
Whether to search engine actions that start with the given search string. Default is False.
|
388
|
+
|
389
|
+
ends_with : bool, optional
|
390
|
+
Whether to search engine actions that end with the given search string. Default is False.
|
391
|
+
|
392
|
+
ignore_case : bool, optional
|
393
|
+
Whether to ignore case while searching engine actions. Default is False.
|
394
|
+
|
395
|
+
start_from : int, optional
|
396
|
+
The index from which to start fetching the engine actions. Default is 0.
|
397
|
+
|
398
|
+
page_size : int, optional
|
399
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
400
|
+
|
401
|
+
Returns
|
402
|
+
-------
|
403
|
+
List[dict] or str
|
404
|
+
A list of dictionaries representing the engine actions found based on the search query.
|
405
|
+
If no actions are found, returns the string "no actions".
|
406
|
+
|
407
|
+
Raises:
|
408
|
+
------
|
409
|
+
InvalidParameterException
|
410
|
+
PropertyServerException
|
411
|
+
UserNotAuthorizedException
|
412
|
+
|
413
|
+
Notes
|
414
|
+
-----
|
415
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
416
|
+
"""
|
417
|
+
loop = asyncio.get_event_loop()
|
418
|
+
response = loop.run_until_complete(
|
419
|
+
self._async_find_in_asset_domain(
|
420
|
+
search_string,
|
421
|
+
start_from,
|
422
|
+
page_size,
|
423
|
+
starts_with,
|
424
|
+
ends_with,
|
425
|
+
ignore_case,
|
426
|
+
time_out,
|
427
|
+
)
|
428
|
+
)
|
429
|
+
return response
|
430
|
+
|
431
|
+
async def _async_get_asset_graph(
|
432
|
+
self,
|
433
|
+
asset_guid: str,
|
434
|
+
start_from: int = 0,
|
435
|
+
page_size: int = max_paging_size,
|
436
|
+
) -> str | dict:
|
437
|
+
"""Return all the elements that are anchored to an asset plus relationships between these elements and to
|
438
|
+
other elements. Async Version.
|
439
|
+
Parameters
|
440
|
+
----------
|
441
|
+
asset_guid : str
|
442
|
+
The unique identity of the asset to get the graph for.
|
443
|
+
|
444
|
+
start_from : int, optional
|
445
|
+
The index from which to start fetching the engine actions. Default is 0.
|
446
|
+
|
447
|
+
page_size : int, optional
|
448
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
449
|
+
|
450
|
+
Returns
|
451
|
+
-------
|
452
|
+
dict or str
|
453
|
+
A dictionary of the asset graph.
|
454
|
+
|
455
|
+
Raises:
|
456
|
+
------
|
457
|
+
InvalidParameterException
|
458
|
+
PropertyServerException
|
459
|
+
UserNotAuthorizedException
|
460
|
+
|
461
|
+
"""
|
462
|
+
|
463
|
+
url = (
|
464
|
+
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/asset-catalog/assets/{asset_guid}/"
|
465
|
+
f"as-graph?startFrom={start_from}&pageSize={page_size}"
|
466
|
+
)
|
467
|
+
|
468
|
+
response = await self._async_make_request("GET", url)
|
469
|
+
return response.json().get("assetGraph", "no asset found")
|
470
|
+
|
471
|
+
def get_asset_graph(
|
472
|
+
self,
|
473
|
+
asset_guid: str,
|
474
|
+
start_from: int = 0,
|
475
|
+
page_size: int = max_paging_size,
|
476
|
+
) -> str | dict:
|
477
|
+
"""Return all the elements that are anchored to an asset plus relationships between these elements and to
|
478
|
+
other elements.
|
479
|
+
Parameters
|
480
|
+
----------
|
481
|
+
asset_guid : str
|
482
|
+
The unique identity of the asset to get the graph for.
|
483
|
+
|
484
|
+
start_from : int, optional
|
485
|
+
The index from which to start fetching the engine actions. Default is 0.
|
486
|
+
|
487
|
+
page_size : int, optional
|
488
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
489
|
+
|
490
|
+
Returns
|
491
|
+
-------
|
492
|
+
dict or str
|
493
|
+
A dictionary of the asset graph.
|
494
|
+
|
495
|
+
Raises:
|
496
|
+
------
|
497
|
+
InvalidParameterException
|
498
|
+
PropertyServerException
|
499
|
+
UserNotAuthorizedException
|
500
|
+
|
501
|
+
"""
|
502
|
+
|
503
|
+
loop = asyncio.get_event_loop()
|
504
|
+
response = loop.run_until_complete(
|
505
|
+
self._async_get_asset_graph(asset_guid, start_from, page_size)
|
506
|
+
)
|
507
|
+
return response
|
508
|
+
|
509
|
+
def get_asset_mermaid_graph(
|
510
|
+
self,
|
511
|
+
asset_guid: str,
|
512
|
+
start_from: int = 0,
|
513
|
+
page_size: int = max_paging_size,
|
514
|
+
) -> str:
|
515
|
+
"""Return the asset graph as mermaid markdown string.
|
516
|
+
Parameters
|
517
|
+
----------
|
518
|
+
asset_guid : str
|
519
|
+
The unique identity of the asset to get the graph for.
|
520
|
+
|
521
|
+
start_from : int, optional
|
522
|
+
The index from which to start fetching the engine actions. Default is 0.
|
523
|
+
|
524
|
+
page_size : int, optional
|
525
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
526
|
+
|
527
|
+
Returns
|
528
|
+
-------
|
529
|
+
str
|
530
|
+
A mermaid string representing the asset graph.
|
531
|
+
|
532
|
+
Raises:
|
533
|
+
------
|
534
|
+
InvalidParameterException
|
535
|
+
PropertyServerException
|
536
|
+
UserNotAuthorizedException
|
537
|
+
|
538
|
+
"""
|
539
|
+
|
540
|
+
asset_graph = self.get_asset_graph(asset_guid, start_from, page_size)
|
541
|
+
return asset_graph.get("mermaidGraph")
|
542
|
+
|
543
|
+
async def _async_get_asset_lineage_graph(
|
544
|
+
self,
|
545
|
+
asset_guid: str,
|
546
|
+
start_from: int = 0,
|
547
|
+
page_size: int = max_paging_size,
|
548
|
+
) -> str | dict:
|
549
|
+
"""Return the asset lineage including a mermaid markdown string. Async Version.
|
550
|
+
Parameters
|
551
|
+
----------
|
552
|
+
asset_guid : str
|
553
|
+
The unique identity of the asset to get the graph for.
|
554
|
+
|
555
|
+
start_from : int, optional
|
556
|
+
The index from which to start fetching the engine actions. Default is 0.
|
557
|
+
|
558
|
+
page_size : int, optional
|
559
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
560
|
+
|
561
|
+
Returns
|
562
|
+
-------
|
563
|
+
str | dict
|
564
|
+
A dictionary of the asset graph that includes a mermaid markdown string.
|
565
|
+
|
566
|
+
Raises:
|
567
|
+
------
|
568
|
+
InvalidParameterException
|
569
|
+
PropertyServerException
|
570
|
+
UserNotAuthorizedException
|
571
|
+
|
572
|
+
"""
|
573
|
+
|
574
|
+
url = (
|
575
|
+
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/asset-catalog/assets/{asset_guid}/"
|
576
|
+
f"as-lineage-graph?startFrom={start_from}&pageSize={page_size}"
|
577
|
+
)
|
578
|
+
|
579
|
+
response = await self._async_make_request("POST", url)
|
580
|
+
return response.json().get("assetLineageGraph", "no asset found")
|
581
|
+
|
582
|
+
def get_asset_lineage_graph(
|
583
|
+
self,
|
584
|
+
asset_guid: str,
|
585
|
+
start_from: int = 0,
|
586
|
+
page_size: int = max_paging_size,
|
587
|
+
) -> str | dict:
|
588
|
+
"""Return the asset lineage including a mermaid markdown string. Async Version.
|
589
|
+
Parameters
|
590
|
+
----------
|
591
|
+
asset_guid : str
|
592
|
+
The unique identity of the asset to get the graph for.
|
593
|
+
|
594
|
+
start_from : int, optional
|
595
|
+
The index from which to start fetching the engine actions. Default is 0.
|
596
|
+
|
597
|
+
page_size : int, optional
|
598
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
599
|
+
|
600
|
+
Returns
|
601
|
+
-------
|
602
|
+
dict or str
|
603
|
+
A dictionary of the asset graph.
|
604
|
+
|
605
|
+
Raises:
|
606
|
+
------
|
607
|
+
InvalidParameterException
|
608
|
+
PropertyServerException
|
609
|
+
UserNotAuthorizedException
|
610
|
+
|
611
|
+
"""
|
612
|
+
|
613
|
+
loop = asyncio.get_event_loop()
|
614
|
+
response = loop.run_until_complete(
|
615
|
+
self._async_get_asset_lineage_graph(asset_guid, start_from, page_size)
|
616
|
+
)
|
617
|
+
return response
|
618
|
+
|
619
|
+
def get_asset_lineage_mermaid_graph(
|
620
|
+
self,
|
621
|
+
asset_guid: str,
|
622
|
+
start_from: int = 0,
|
623
|
+
page_size: int = max_paging_size,
|
624
|
+
) -> str:
|
625
|
+
"""Return the lineage as mermaid markdown string. Async Version.
|
626
|
+
Parameters
|
627
|
+
----------
|
628
|
+
asset_guid : str
|
629
|
+
The unique identity of the asset to get the graph for.
|
630
|
+
|
631
|
+
start_from : int, optional
|
632
|
+
The index from which to start fetching the engine actions. Default is 0.
|
633
|
+
|
634
|
+
page_size : int, optional
|
635
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
636
|
+
|
637
|
+
Returns
|
638
|
+
-------
|
639
|
+
str
|
640
|
+
A mermaid string representing the lineage.
|
641
|
+
|
642
|
+
Raises:
|
643
|
+
------
|
644
|
+
InvalidParameterException
|
645
|
+
PropertyServerException
|
646
|
+
UserNotAuthorizedException
|
647
|
+
|
648
|
+
"""
|
649
|
+
|
650
|
+
asset_graph = self.get_asset_lineage_graph(asset_guid, start_from, page_size)
|
651
|
+
return asset_graph.get("mermaidGraph")
|
652
|
+
|
653
|
+
async def _async_get_assets_by_metadata_collection_id(
|
654
|
+
self,
|
655
|
+
metadata_collection_id: str,
|
656
|
+
type_name: str = None,
|
657
|
+
effective_time: str = None,
|
658
|
+
start_from: int = 0,
|
659
|
+
page_size: int = max_paging_size,
|
660
|
+
) -> str | list:
|
661
|
+
"""Return a list of assets that come from the requested metadata collection. Can optionally
|
662
|
+
specify an type name as a filter and an effective time. Async Version.
|
663
|
+
|
664
|
+
Parameters
|
665
|
+
----------
|
666
|
+
metadata_collection_id : str
|
667
|
+
The unique identity of the metadata collection to return assets from.
|
668
|
+
|
669
|
+
type_name: str, optional
|
670
|
+
An asset type to optionally filter on. If not specified, all assets in the collection will be returned.
|
671
|
+
|
672
|
+
effective_time: str, optional
|
673
|
+
The effective time to filter on. If not specified, the current time is used.
|
674
|
+
|
675
|
+
start_from : int, optional
|
676
|
+
The index from which to start fetching the engine actions. Default is 0.
|
677
|
+
|
678
|
+
page_size : int, optional
|
679
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
680
|
+
|
681
|
+
Returns
|
682
|
+
-------
|
683
|
+
list or str
|
684
|
+
A list of assets in a [dict].
|
685
|
+
|
686
|
+
Raises:
|
687
|
+
------
|
688
|
+
InvalidParameterException
|
689
|
+
PropertyServerException
|
690
|
+
UserNotAuthorizedException
|
691
|
+
|
692
|
+
"""
|
693
|
+
|
694
|
+
url = (
|
695
|
+
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/asset-catalog/assets/by-metadata-collection-id/"
|
696
|
+
f"{metadata_collection_id}?startFrom={start_from}&pageSize={page_size}"
|
697
|
+
)
|
698
|
+
|
699
|
+
body = {"filter": type_name, "effectiveTime": effective_time}
|
700
|
+
body_s = body_slimmer(body)
|
701
|
+
response = await self._async_make_request("POST", url, body_s)
|
702
|
+
return response.json().get("assets", "no assets found")
|
703
|
+
|
704
|
+
def get_assets_by_metadata_collection_id(
|
705
|
+
self,
|
706
|
+
metadata_collection_id: str,
|
707
|
+
type_name: str = None,
|
708
|
+
effective_time: str = None,
|
709
|
+
start_from: int = 0,
|
710
|
+
page_size: int = max_paging_size,
|
711
|
+
) -> str | list:
|
712
|
+
"""Return a list of assets that come from the requested metadata collection. Can optionally
|
713
|
+
specify an type name as a filter and an effective time. Async Version.
|
714
|
+
|
715
|
+
Parameters
|
716
|
+
----------
|
717
|
+
metadata_collection_id : str
|
718
|
+
The unique identity of the metadata collection to return assets from.
|
719
|
+
|
720
|
+
type_name: str, optional
|
721
|
+
An asset type to optionally filter on. If not specified, all assets in the collection will be returned.
|
722
|
+
|
723
|
+
effective_time: str, optional
|
724
|
+
The effective time to filter on. If not specified, the current time is used.
|
725
|
+
|
726
|
+
start_from : int, optional
|
727
|
+
The index from which to start fetching the engine actions. Default is 0.
|
728
|
+
|
729
|
+
page_size : int, optional
|
730
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
731
|
+
|
732
|
+
Returns
|
733
|
+
-------
|
734
|
+
list or str
|
735
|
+
A list of assets in a [dict].
|
736
|
+
|
737
|
+
Raises:
|
738
|
+
------
|
739
|
+
InvalidParameterException
|
740
|
+
PropertyServerException
|
741
|
+
UserNotAuthorizedException
|
742
|
+
|
743
|
+
"""
|
744
|
+
|
745
|
+
loop = asyncio.get_event_loop()
|
746
|
+
response = loop.run_until_complete(
|
747
|
+
self._async_get_assets_by_metadata_collection_id(
|
748
|
+
metadata_collection_id,
|
749
|
+
type_name,
|
750
|
+
effective_time,
|
751
|
+
start_from,
|
752
|
+
page_size,
|
753
|
+
)
|
754
|
+
)
|
755
|
+
return response
|
756
|
+
|
757
|
+
async def _async_get_asset_types(self) -> str | dict:
|
758
|
+
"""Return all the elements that are anchored to an asset plus relationships between these elements and to
|
759
|
+
other elements. Async Version.
|
760
|
+
Parameters
|
761
|
+
----------
|
762
|
+
|
763
|
+
Returns
|
764
|
+
-------
|
765
|
+
dict or str
|
766
|
+
A dictionary of the asset graph.
|
767
|
+
|
768
|
+
Raises:
|
769
|
+
------
|
770
|
+
InvalidParameterException
|
771
|
+
PropertyServerException
|
772
|
+
UserNotAuthorizedException
|
773
|
+
|
774
|
+
"""
|
775
|
+
|
776
|
+
url = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/asset-catalog/assets/types"
|
777
|
+
|
778
|
+
response = await self._async_make_request("GET", url)
|
779
|
+
|
780
|
+
return response.json().get("types", "No assets found")
|
781
|
+
|
782
|
+
def get_asset_catalog_types(self) -> str | dict:
|
783
|
+
"""Return all the elements that are anchored to an asset plus relationships between these elements and to
|
784
|
+
other elements.
|
785
|
+
Parameters
|
786
|
+
----------
|
787
|
+
|
788
|
+
Returns
|
789
|
+
-------
|
790
|
+
dict or str
|
791
|
+
A dictionary of the asset graph.
|
792
|
+
|
793
|
+
Raises:
|
794
|
+
------
|
795
|
+
InvalidParameterException
|
796
|
+
PropertyServerException
|
797
|
+
UserNotAuthorizedException
|
798
|
+
|
799
|
+
"""
|
800
|
+
|
801
|
+
loop = asyncio.get_event_loop()
|
802
|
+
response = loop.run_until_complete(self._async_get_asset_types())
|
803
|
+
return response
|
804
|
+
|
805
|
+
|
806
|
+
if __name__ == "__main__":
|
807
|
+
print("Main-asset-catalog")
|