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,173 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
A simple viewer for collections - provide the root and we display the hierarchy
|
7
|
+
|
8
|
+
"""
|
9
|
+
import argparse
|
10
|
+
import os, sys
|
11
|
+
|
12
|
+
from rich import print
|
13
|
+
from rich.console import Console
|
14
|
+
from rich.markdown import Markdown
|
15
|
+
from rich.panel import Panel
|
16
|
+
from rich.prompt import Prompt
|
17
|
+
from rich.text import Text
|
18
|
+
from rich.tree import Tree
|
19
|
+
|
20
|
+
from pyegeria import (
|
21
|
+
UserNotAuthorizedException,
|
22
|
+
PropertyServerException,
|
23
|
+
InvalidParameterException,
|
24
|
+
AutomatedCuration,
|
25
|
+
)
|
26
|
+
from pyegeria._exceptions import (
|
27
|
+
print_exception_response,
|
28
|
+
)
|
29
|
+
|
30
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
31
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
32
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
33
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
34
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
35
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
36
|
+
)
|
37
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
38
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
39
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
40
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
41
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
42
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
43
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
44
|
+
|
45
|
+
# nest_asyncio.apply()
|
46
|
+
|
47
|
+
disable_ssl_warnings = True
|
48
|
+
|
49
|
+
|
50
|
+
def tech_details_viewer(
|
51
|
+
tech: str,
|
52
|
+
server_name: str,
|
53
|
+
platform_url: str,
|
54
|
+
user: str,
|
55
|
+
user_password: str,
|
56
|
+
jupyter: bool = EGERIA_JUPYTER,
|
57
|
+
width: int = EGERIA_WIDTH,
|
58
|
+
):
|
59
|
+
console = Console(width=width, force_terminal=not jupyter)
|
60
|
+
|
61
|
+
# print(f"tech is {tech} of type {type(tech)}")
|
62
|
+
# sys.exit(0)
|
63
|
+
def view_tech_details(
|
64
|
+
a_client: AutomatedCuration, root_collection_name: str, tree: Tree
|
65
|
+
) -> Tree:
|
66
|
+
l2: Tree = None
|
67
|
+
tech_details = a_client.get_technology_type_detail(tech)
|
68
|
+
if (type(tech_details) is dict) and (len(tech_details) > 0):
|
69
|
+
name = tech_details.get("name", "---")
|
70
|
+
qualified_name = tech_details.get("qualifiedName", "---")
|
71
|
+
category = tech_details.get("category", "---")
|
72
|
+
description = tech_details.get("description", "---")
|
73
|
+
|
74
|
+
style = "bold bright_white on black"
|
75
|
+
|
76
|
+
bas_md = f"* **Name**: {name}\n"
|
77
|
+
bas_md += f"* **QualifiedName**: {qualified_name}\n"
|
78
|
+
bas_md += f"* **Category**: {category}\n"
|
79
|
+
bas_md += f"* **Technology Description**: {description}\n"
|
80
|
+
|
81
|
+
bas_out = Markdown(bas_md)
|
82
|
+
|
83
|
+
l2 = tree.add(Panel(bas_out))
|
84
|
+
ext_ref = tech_details.get("externalReferences", None)
|
85
|
+
|
86
|
+
if ext_ref is not None:
|
87
|
+
uri = ext_ref[0]["properties"].get("uri", "---")
|
88
|
+
# console.print(f" {type(ext_ref)}, {len(ext_ref)}")
|
89
|
+
l2 = tree.add(Panel(Markdown(f"* URI: {uri}", style)))
|
90
|
+
|
91
|
+
resource_list = tech_details.get("resourceList", None)
|
92
|
+
if resource_list:
|
93
|
+
t_r = tree.add(Panel("Resource List[bold red]"))
|
94
|
+
for resource in resource_list:
|
95
|
+
resource_use = Text(
|
96
|
+
f"[bold bright_white]{resource.get('resourceUse', '---')}"
|
97
|
+
)
|
98
|
+
resource_use_description = Text(
|
99
|
+
f"[bold bright_white]{resource.get('resourceUseDescription', '---')}"
|
100
|
+
)
|
101
|
+
type_name = Text(
|
102
|
+
f"[bold bright_white]{resource['relatedElement']['type'].get('typeName', '---')}"
|
103
|
+
)
|
104
|
+
unique_name = Text(
|
105
|
+
f"[bold bright_white]{resource['relatedElement'].get('uniqueName', '---')}"
|
106
|
+
)
|
107
|
+
related_guid = Text(
|
108
|
+
f"[bold bright_white]{resource['relatedElement'].get('guid', '---')}"
|
109
|
+
)
|
110
|
+
resource_text = (
|
111
|
+
f"[bold red]Resource\n"
|
112
|
+
f"[white]Resource use: {resource_use}[white]\nDescription: "
|
113
|
+
f"{resource_use_description}\n[white]Type Name: {type_name}\n"
|
114
|
+
f"[white]Unique Name: {unique_name}\n[white]Related GUID: {related_guid}\n"
|
115
|
+
)
|
116
|
+
p = Panel.fit(resource_text)
|
117
|
+
tt = t_r.add(p, style=style)
|
118
|
+
else:
|
119
|
+
tt = tree.add(Panel(f"Resource details for {tech} where not found"))
|
120
|
+
|
121
|
+
else:
|
122
|
+
tt = tree.add(
|
123
|
+
Panel(
|
124
|
+
f"Tech type {tech} was not found - please check the tech type name"
|
125
|
+
)
|
126
|
+
)
|
127
|
+
|
128
|
+
return tt
|
129
|
+
|
130
|
+
try:
|
131
|
+
tree = Tree(
|
132
|
+
f"{tech}",
|
133
|
+
style="bold bright_white on black",
|
134
|
+
guide_style="bold bright_blue",
|
135
|
+
)
|
136
|
+
a_client = AutomatedCuration(server_name, platform_url, user_id=user)
|
137
|
+
|
138
|
+
token = a_client.create_egeria_bearer_token(user, user_password)
|
139
|
+
view_tech_details(a_client, tech, tree)
|
140
|
+
print(tree)
|
141
|
+
|
142
|
+
except (
|
143
|
+
InvalidParameterException,
|
144
|
+
PropertyServerException,
|
145
|
+
UserNotAuthorizedException,
|
146
|
+
) as e:
|
147
|
+
print_exception_response(e)
|
148
|
+
|
149
|
+
|
150
|
+
def main():
|
151
|
+
parser = argparse.ArgumentParser()
|
152
|
+
|
153
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
154
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
155
|
+
parser.add_argument("--userid", help="User Id")
|
156
|
+
parser.add_argument("--password", help="User Password")
|
157
|
+
args = parser.parse_args()
|
158
|
+
|
159
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
160
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
161
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
162
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
163
|
+
try:
|
164
|
+
tech = Prompt.ask(
|
165
|
+
"Enter the Technology to start from:", default="PostgreSQL Server"
|
166
|
+
)
|
167
|
+
tech_details_viewer(tech, server, url, userid, user_pass)
|
168
|
+
except KeyboardInterrupt:
|
169
|
+
pass
|
170
|
+
|
171
|
+
|
172
|
+
if __name__ == "__main__":
|
173
|
+
main()
|
@@ -0,0 +1,166 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
Display the status of cataloged platforms and servers.
|
7
|
+
"""
|
8
|
+
import argparse
|
9
|
+
|
10
|
+
import os
|
11
|
+
from rich import print
|
12
|
+
from rich.console import Console
|
13
|
+
from rich.markdown import Markdown
|
14
|
+
from rich.panel import Panel
|
15
|
+
from rich.prompt import Prompt
|
16
|
+
from rich.tree import Tree
|
17
|
+
|
18
|
+
from pyegeria import (
|
19
|
+
InvalidParameterException,
|
20
|
+
PropertyServerException,
|
21
|
+
UserNotAuthorizedException,
|
22
|
+
print_exception_response,
|
23
|
+
AutomatedCuration,
|
24
|
+
)
|
25
|
+
|
26
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
27
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
28
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
29
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
30
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
31
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
32
|
+
)
|
33
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
34
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
35
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
36
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
37
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
38
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
39
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
40
|
+
|
41
|
+
|
42
|
+
disable_ssl_warnings = True
|
43
|
+
console = Console(width=200)
|
44
|
+
|
45
|
+
guid_list = []
|
46
|
+
|
47
|
+
|
48
|
+
def template_viewer(
|
49
|
+
tech_name: str,
|
50
|
+
server_name: str,
|
51
|
+
platform_url: str,
|
52
|
+
user: str,
|
53
|
+
user_pass: str,
|
54
|
+
jupyter: bool = EGERIA_JUPYTER,
|
55
|
+
width: int = EGERIA_WIDTH,
|
56
|
+
):
|
57
|
+
def build_classifications(classification: dict) -> Markdown:
|
58
|
+
class_md = "\n"
|
59
|
+
for c in classification:
|
60
|
+
c_type = c["classificationName"]
|
61
|
+
if c_type == "Anchors":
|
62
|
+
continue
|
63
|
+
class_md += f"* Classification: {c_type}\n"
|
64
|
+
class_props = c.get("classificationProperties", None)
|
65
|
+
if class_props is None:
|
66
|
+
continue
|
67
|
+
for prop in class_props.keys():
|
68
|
+
class_md += f"\t* {prop}: {class_props[prop]}\n"
|
69
|
+
if class_md == "-":
|
70
|
+
output = None
|
71
|
+
else:
|
72
|
+
output = class_md
|
73
|
+
return output
|
74
|
+
|
75
|
+
try:
|
76
|
+
console = Console(width=width, force_terminal=not jupyter)
|
77
|
+
|
78
|
+
a_client = AutomatedCuration(server_name, platform_url, user_id=user)
|
79
|
+
|
80
|
+
token = a_client.create_egeria_bearer_token(user, user_pass)
|
81
|
+
tech_elements = a_client.get_technology_type_elements(
|
82
|
+
tech_name, get_templates=True
|
83
|
+
)
|
84
|
+
if (len(tech_elements) >= 1) and (type(tech_elements) is list):
|
85
|
+
tree = Tree(
|
86
|
+
f"Deployed Technology Type: {tech_name}",
|
87
|
+
style="bold bright_white",
|
88
|
+
guide_style="bold bright_blue",
|
89
|
+
)
|
90
|
+
note: str = " "
|
91
|
+
for element in tech_elements:
|
92
|
+
header = element["elementHeader"]
|
93
|
+
tech_type = header["type"]["typeName"]
|
94
|
+
tech_collection = header["origin"]["homeMetadataCollectionName"]
|
95
|
+
tech_created_by = header["versions"]["createdBy"]
|
96
|
+
tech_created_at = header["versions"]["createTime"]
|
97
|
+
tech_guid = header["guid"]
|
98
|
+
tech_classifications = header["classifications"]
|
99
|
+
class_md = build_classifications(tech_classifications)
|
100
|
+
|
101
|
+
referenceables = element["referenceableProperties"]
|
102
|
+
tech_qualified_name = referenceables["qualifiedName"]
|
103
|
+
extended = referenceables["extendedProperties"]
|
104
|
+
ex_md: str = ""
|
105
|
+
for key, value in extended.items():
|
106
|
+
ex_md += f"* {key}: {value}\n"
|
107
|
+
|
108
|
+
note = (
|
109
|
+
f"* Qualified Name: {tech_qualified_name}\n"
|
110
|
+
f"* GUID: {tech_guid}\n"
|
111
|
+
f"* Createdy by: {tech_created_by}\n"
|
112
|
+
f"* Created at: {tech_created_at}\n"
|
113
|
+
f"* Home Collection: {tech_collection}\n"
|
114
|
+
f"{class_md}\n"
|
115
|
+
f"{ex_md}\n"
|
116
|
+
)
|
117
|
+
|
118
|
+
interfaces = extended.get("connectorInterfaces", None)
|
119
|
+
if interfaces is not None:
|
120
|
+
interface_type_name = interfaces["typeName"]
|
121
|
+
interface_array_cnt = interfaces["arrayCount"]
|
122
|
+
note += f"* Interface Type: {interface_type_name}\n"
|
123
|
+
for i in range(0, int(interface_array_cnt)):
|
124
|
+
note += (
|
125
|
+
f"\t* Type: {interfaces['arrayValues']['propertyValueMap'][str(i)]['typeName']}"
|
126
|
+
f"\tName: {interfaces['arrayValues']['propertiesAsStrings'][str(i)]}\n"
|
127
|
+
)
|
128
|
+
note_md = Panel.fit(Markdown(note), style="bold bright_white on black")
|
129
|
+
t = tree.add(note_md)
|
130
|
+
|
131
|
+
else:
|
132
|
+
tree = Tree(f"No elements found for {tech_name}", style="red")
|
133
|
+
print(tree)
|
134
|
+
except (
|
135
|
+
InvalidParameterException,
|
136
|
+
PropertyServerException,
|
137
|
+
UserNotAuthorizedException,
|
138
|
+
) as e:
|
139
|
+
print_exception_response(e)
|
140
|
+
|
141
|
+
|
142
|
+
def main():
|
143
|
+
parser = argparse.ArgumentParser()
|
144
|
+
|
145
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
146
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
147
|
+
parser.add_argument("--userid", help="User Id")
|
148
|
+
parser.add_argument("--password", help="User Password")
|
149
|
+
args = parser.parse_args()
|
150
|
+
|
151
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
152
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
153
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
154
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
155
|
+
|
156
|
+
try:
|
157
|
+
tech_name = Prompt.ask(
|
158
|
+
"Enter the Asset Name to view:", default="Apache Kafka Server"
|
159
|
+
)
|
160
|
+
template_viewer(tech_name, server, url, userid, user_pass)
|
161
|
+
except KeyboardInterrupt:
|
162
|
+
pass
|
163
|
+
|
164
|
+
|
165
|
+
if __name__ == "__main__":
|
166
|
+
main()
|
@@ -0,0 +1,205 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
|
7
|
+
Retrieve elements based on a search of a specified properties.
|
8
|
+
"""
|
9
|
+
import argparse
|
10
|
+
import os
|
11
|
+
import sys
|
12
|
+
import time
|
13
|
+
|
14
|
+
from rich import box
|
15
|
+
from rich.console import Console
|
16
|
+
from rich.prompt import Prompt
|
17
|
+
from rich.markdown import Markdown
|
18
|
+
from rich.table import Table
|
19
|
+
|
20
|
+
from pyegeria import (
|
21
|
+
InvalidParameterException,
|
22
|
+
PropertyServerException,
|
23
|
+
UserNotAuthorizedException,
|
24
|
+
print_exception_response,
|
25
|
+
EgeriaTech,
|
26
|
+
)
|
27
|
+
|
28
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
29
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
30
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
31
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
32
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
33
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
34
|
+
)
|
35
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
36
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
37
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
38
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
39
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
40
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
41
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "260"))
|
42
|
+
|
43
|
+
|
44
|
+
disable_ssl_warnings = True
|
45
|
+
|
46
|
+
|
47
|
+
def display_anchored_elements(
|
48
|
+
search_string: str,
|
49
|
+
prop_list: list[str],
|
50
|
+
server: str,
|
51
|
+
url: str,
|
52
|
+
username: str,
|
53
|
+
user_password: str,
|
54
|
+
time_out: int = 60,
|
55
|
+
jupyter: bool = EGERIA_JUPYTER,
|
56
|
+
width: int = EGERIA_WIDTH,
|
57
|
+
):
|
58
|
+
console = Console(width=width, force_terminal=not jupyter, soft_wrap=True)
|
59
|
+
if (search_string is None) or (len(search_string) < 3):
|
60
|
+
print(
|
61
|
+
"\nError --> Invalid Search String - must be greater than four characters long"
|
62
|
+
)
|
63
|
+
sys.exit(3)
|
64
|
+
g_client = EgeriaTech(server, url, username, user_password)
|
65
|
+
token = g_client.create_egeria_bearer_token()
|
66
|
+
print(f"search string is {search_string} and prop_list is {prop_list}\n")
|
67
|
+
|
68
|
+
def generate_table(search_string: str, prop_list: [str]) -> Table:
|
69
|
+
"""Make a new table."""
|
70
|
+
table = Table(
|
71
|
+
title=f"Elements containing the string {search_string} @ {time.asctime()}",
|
72
|
+
header_style="white on dark_blue",
|
73
|
+
style="bold white on black",
|
74
|
+
row_styles=["bold white on black"],
|
75
|
+
title_style="bold white on black",
|
76
|
+
caption_style="white on black",
|
77
|
+
show_lines=True,
|
78
|
+
box=box.ROUNDED,
|
79
|
+
caption=f"View Server '{server}' @ Platform - {url}",
|
80
|
+
expand=True,
|
81
|
+
)
|
82
|
+
# table.add_column("Qualified Name")
|
83
|
+
table.add_column("GUID", no_wrap=True)
|
84
|
+
table.add_column("Properties")
|
85
|
+
|
86
|
+
table.add_column("Classification Props", width=30)
|
87
|
+
table.add_column("Matching Elements")
|
88
|
+
|
89
|
+
classification = "Anchors"
|
90
|
+
open_type_name = None
|
91
|
+
property_value = search_string
|
92
|
+
|
93
|
+
property_names = prop_list
|
94
|
+
|
95
|
+
elements = g_client.find_elements_by_classification_with_property_value(
|
96
|
+
classification, property_value, property_names, open_type_name
|
97
|
+
)
|
98
|
+
if type(elements) is str:
|
99
|
+
return table
|
100
|
+
|
101
|
+
for element in elements:
|
102
|
+
template = False
|
103
|
+
guid = element["elementHeader"].get("guid", "---")
|
104
|
+
classifications = element["elementHeader"]["classifications"]
|
105
|
+
|
106
|
+
class_prop_md = ""
|
107
|
+
for classific in classifications:
|
108
|
+
class_prop = classific.get("classificationProperties", "---")
|
109
|
+
if type(class_prop) is dict:
|
110
|
+
for key in class_prop.keys():
|
111
|
+
class_prop_md += f"* {key}: {class_prop[key]}\n"
|
112
|
+
|
113
|
+
class_prop_out = Markdown(class_prop_md)
|
114
|
+
|
115
|
+
properties = element["properties"]
|
116
|
+
props_md = ""
|
117
|
+
if type(properties) is dict:
|
118
|
+
for key in properties.keys():
|
119
|
+
props_md += f"* {key}: {properties[key]}\n"
|
120
|
+
if key == "category" and properties[key] == "placeholderProperty":
|
121
|
+
template = True
|
122
|
+
props_out = Markdown(props_md)
|
123
|
+
|
124
|
+
if template: # Not interested in template elements in this method
|
125
|
+
continue
|
126
|
+
|
127
|
+
relationship = g_client.get_related_elements(guid, None, None)
|
128
|
+
|
129
|
+
if type(relationship) is list:
|
130
|
+
rel_md = ""
|
131
|
+
for rel in relationship:
|
132
|
+
match_tab = Table(expand=True)
|
133
|
+
match_tab.add_column("Type Name")
|
134
|
+
match_tab.add_column("GUID", no_wrap=True, width=36)
|
135
|
+
match_tab.add_column("Properties")
|
136
|
+
match = rel["relationshipHeader"]
|
137
|
+
match_type_name = match["type"]["typeName"]
|
138
|
+
matching_guid = match["guid"]
|
139
|
+
match_props = rel["relatedElement"]["properties"]
|
140
|
+
match_details_md = ""
|
141
|
+
for key in match_props.keys():
|
142
|
+
match_details_md += f"* {key}: {match_props[key]}\n"
|
143
|
+
match_details_out = Markdown(match_details_md)
|
144
|
+
match_tab.add_row(match_type_name, matching_guid, match_details_out)
|
145
|
+
|
146
|
+
table.add_row(guid, props_out, class_prop_out, match_tab)
|
147
|
+
|
148
|
+
g_client.close_session()
|
149
|
+
return table
|
150
|
+
|
151
|
+
try:
|
152
|
+
with console.pager(styles=True):
|
153
|
+
console.print(generate_table(search_string, prop_list), soft_wrap=True)
|
154
|
+
|
155
|
+
except (
|
156
|
+
InvalidParameterException,
|
157
|
+
PropertyServerException,
|
158
|
+
UserNotAuthorizedException,
|
159
|
+
) as e:
|
160
|
+
console.print_exception()
|
161
|
+
sys.exit(1)
|
162
|
+
|
163
|
+
except Exception as e:
|
164
|
+
console.print(
|
165
|
+
f"\n\n====> Invalid Search String - must be greater than four characters long"
|
166
|
+
)
|
167
|
+
sys.exit(1)
|
168
|
+
|
169
|
+
|
170
|
+
def main():
|
171
|
+
parser = argparse.ArgumentParser()
|
172
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
173
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
174
|
+
parser.add_argument("--userid", help="User Id")
|
175
|
+
parser.add_argument("--password", help="User Password")
|
176
|
+
parser.add_argument("--time_out", help="Time Out")
|
177
|
+
|
178
|
+
args = parser.parse_args()
|
179
|
+
|
180
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
181
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
182
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
183
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
184
|
+
time_out = args.time_out if args.time_out is not None else 60
|
185
|
+
try:
|
186
|
+
search_string = Prompt.ask("Enter an property search string:", default="")
|
187
|
+
prop_list = Prompt.ask(
|
188
|
+
"Enter the list of properties to search", default="anchorTypeName"
|
189
|
+
)
|
190
|
+
if search_string == "":
|
191
|
+
print("\nError --> Search string can't be empty")
|
192
|
+
sys.exit(1)
|
193
|
+
elif len(search_string) <= 4:
|
194
|
+
print("\nError --> Search string must be greater than four characters long")
|
195
|
+
sys.exit(2)
|
196
|
+
else:
|
197
|
+
display_anchored_elements(
|
198
|
+
search_string, [prop_list], server, url, userid, user_pass, time_out
|
199
|
+
)
|
200
|
+
except KeyboardInterrupt:
|
201
|
+
pass
|
202
|
+
|
203
|
+
|
204
|
+
if __name__ == "__main__":
|
205
|
+
main()
|
@@ -0,0 +1,123 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
Unit tests for the Utils helper functions using the Pytest framework.
|
7
|
+
|
8
|
+
|
9
|
+
A simple display for my profile
|
10
|
+
"""
|
11
|
+
import os
|
12
|
+
import argparse
|
13
|
+
import time
|
14
|
+
|
15
|
+
from rich import box
|
16
|
+
from rich.console import Console
|
17
|
+
from rich.table import Table
|
18
|
+
|
19
|
+
from pyegeria import (
|
20
|
+
InvalidParameterException,
|
21
|
+
PropertyServerException,
|
22
|
+
UserNotAuthorizedException,
|
23
|
+
print_exception_response,
|
24
|
+
RegisteredInfo,
|
25
|
+
)
|
26
|
+
|
27
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
28
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
29
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
30
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
31
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
32
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
33
|
+
)
|
34
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
35
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
36
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
37
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
38
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
39
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
40
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
41
|
+
|
42
|
+
|
43
|
+
def display_asset_types(
|
44
|
+
server: str,
|
45
|
+
url: str,
|
46
|
+
username: str,
|
47
|
+
user_password: str,
|
48
|
+
jupyter: bool = EGERIA_JUPYTER,
|
49
|
+
width: int = EGERIA_WIDTH,
|
50
|
+
):
|
51
|
+
r_client = RegisteredInfo(server, url, username)
|
52
|
+
token = r_client.create_egeria_bearer_token(username, user_password)
|
53
|
+
asset_types = r_client.list_asset_types()
|
54
|
+
|
55
|
+
def generate_table() -> Table:
|
56
|
+
"""Make a new table."""
|
57
|
+
table = Table(
|
58
|
+
title=f"Asset Types for: {url} @ {time.asctime()}",
|
59
|
+
style="bold bright_white on black",
|
60
|
+
row_styles=["bold bright_white on black"],
|
61
|
+
header_style="white on dark_blue",
|
62
|
+
title_style="bold white on black",
|
63
|
+
show_lines=True,
|
64
|
+
box=box.ROUNDED,
|
65
|
+
caption=f"Asset Types from Server '{server}' @ Platform - {url}",
|
66
|
+
expand=True,
|
67
|
+
)
|
68
|
+
|
69
|
+
table.add_column("Name")
|
70
|
+
table.add_column("Description")
|
71
|
+
table.add_column("SuperType")
|
72
|
+
table.add_column("Version")
|
73
|
+
|
74
|
+
name = " "
|
75
|
+
description = " "
|
76
|
+
version = " "
|
77
|
+
super_type = " "
|
78
|
+
if len(asset_types) > 0:
|
79
|
+
for a_type in asset_types:
|
80
|
+
name = a_type.get("name", "none")
|
81
|
+
description = a_type.get("description", "none")
|
82
|
+
version = a_type.get("version", " ")
|
83
|
+
super_type = a_type.get("superType", "none")
|
84
|
+
table.add_row(name, description, super_type, str(version))
|
85
|
+
return table
|
86
|
+
|
87
|
+
try:
|
88
|
+
console = Console(width=width, force_terminal=not jupyter)
|
89
|
+
with console.pager(styles=True):
|
90
|
+
console.print(generate_table())
|
91
|
+
|
92
|
+
except (
|
93
|
+
InvalidParameterException,
|
94
|
+
PropertyServerException,
|
95
|
+
UserNotAuthorizedException,
|
96
|
+
) as e:
|
97
|
+
print_exception_response(e)
|
98
|
+
assert e.related_http_code != "200", "Invalid parameters"
|
99
|
+
finally:
|
100
|
+
r_client.close_session()
|
101
|
+
|
102
|
+
|
103
|
+
def main():
|
104
|
+
parser = argparse.ArgumentParser()
|
105
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
106
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
107
|
+
parser.add_argument("--userid", help="User Id")
|
108
|
+
parser.add_argument("--password", help="User Password")
|
109
|
+
|
110
|
+
args = parser.parse_args()
|
111
|
+
|
112
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
113
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
114
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
115
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
116
|
+
# guid = args.guid if args.guid is not None else None
|
117
|
+
guid = None
|
118
|
+
|
119
|
+
display_asset_types(server, url, userid, user_pass)
|
120
|
+
|
121
|
+
|
122
|
+
if __name__ == "__main__":
|
123
|
+
main()
|