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,203 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
List catalog targets
|
9
|
+
|
10
|
+
"""
|
11
|
+
import argparse
|
12
|
+
import os
|
13
|
+
import time
|
14
|
+
|
15
|
+
from rich import box
|
16
|
+
from rich.console import Console
|
17
|
+
from rich.markdown import Markdown
|
18
|
+
from rich.prompt import Prompt
|
19
|
+
from rich.table import Table
|
20
|
+
|
21
|
+
from pyegeria import (
|
22
|
+
InvalidParameterException,
|
23
|
+
PropertyServerException,
|
24
|
+
UserNotAuthorizedException,
|
25
|
+
print_exception_response,
|
26
|
+
AutomatedCuration,
|
27
|
+
INTEGRATION_GUIDS,
|
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
|
+
|
46
|
+
def display_catalog_targets(
|
47
|
+
connector: str,
|
48
|
+
view_server: str = EGERIA_VIEW_SERVER,
|
49
|
+
view_url: str = EGERIA_VIEW_SERVER_URL,
|
50
|
+
user: str = EGERIA_USER,
|
51
|
+
user_pass: str = EGERIA_USER_PASSWORD,
|
52
|
+
paging: bool = True,
|
53
|
+
jupyter: bool = EGERIA_JUPYTER,
|
54
|
+
width: int = EGERIA_WIDTH,
|
55
|
+
):
|
56
|
+
"""Display catalog targets for the specified connector as a table.
|
57
|
+
|
58
|
+
Parameters
|
59
|
+
----------
|
60
|
+
connector : str
|
61
|
+
The connector to retrieve catalog targets for.
|
62
|
+
view_server : str
|
63
|
+
The Egeria view server name.
|
64
|
+
view_url : str
|
65
|
+
The URL for the Egeria view server.
|
66
|
+
user : str
|
67
|
+
The user name for authenticating with the Egeria server.
|
68
|
+
user_pass : str
|
69
|
+
The user password for authenticating with the Egeria server.
|
70
|
+
paging : bool, default is True
|
71
|
+
Whether to enable paging mode when displaying the table.
|
72
|
+
jupyter : bool
|
73
|
+
Indicates if the environment is a Jupyter notebook.
|
74
|
+
width : int
|
75
|
+
The width of the console for table printing.
|
76
|
+
"""
|
77
|
+
console = Console(force_terminal=not jupyter, width=width, soft_wrap=True)
|
78
|
+
|
79
|
+
def generate_table() -> Table:
|
80
|
+
"""Make a new table."""
|
81
|
+
table = Table(
|
82
|
+
title=f"All Catalog Targets for Integration Connector {connector} @ {time.asctime()}",
|
83
|
+
style="bold white on black",
|
84
|
+
row_styles=["bold white on black"],
|
85
|
+
header_style="white on dark_blue",
|
86
|
+
title_style="bold white on black",
|
87
|
+
show_lines=True,
|
88
|
+
box=box.ROUNDED,
|
89
|
+
caption=f"Catalog Targets for '{view_server}' @ Platform - {view_url}",
|
90
|
+
expand=True,
|
91
|
+
)
|
92
|
+
table.add_column("Name of Target")
|
93
|
+
table.add_column("Catalog Target")
|
94
|
+
|
95
|
+
# table.add_column("Relationship GUID", no_wrap=True)
|
96
|
+
table.add_column("Configuration Properties")
|
97
|
+
table.add_column("Template Properties")
|
98
|
+
table.add_column("Operational Instructions", max_width=20)
|
99
|
+
# table.add_column("Delete Method")
|
100
|
+
|
101
|
+
if type(cat_targets) is list:
|
102
|
+
for target in cat_targets:
|
103
|
+
target_name = target.get("catalogTargetName", "---")
|
104
|
+
target_source = target.get("metadataSourceQualifiedName", "---")
|
105
|
+
target_rel = target.get("relationshipGUID", "---")
|
106
|
+
target_sync = target.get("permittedSynchronization")
|
107
|
+
target_delete = target.get("deleteMethod", "---")
|
108
|
+
op_instruct = f"* {target_sync}\n* {target_delete}"
|
109
|
+
op_instruct_out = Markdown(op_instruct)
|
110
|
+
# target_guid = target['catalogTargetElement']['guid']
|
111
|
+
connector_unique = target["catalogTargetElement"]["uniqueName"]
|
112
|
+
|
113
|
+
cat_target_out = Markdown(
|
114
|
+
f"* Target Name: {target_name}\n* Target Source: {target_source}\n"
|
115
|
+
f"* Relationship Guid: {target_rel}"
|
116
|
+
)
|
117
|
+
|
118
|
+
config_props = target.get("configurationProperties", "---")
|
119
|
+
if type(config_props) is dict:
|
120
|
+
config_props_md = ""
|
121
|
+
for prop in config_props:
|
122
|
+
config_props_md += f"* {prop}: {config_props[prop]}\n"
|
123
|
+
config_props_out = Markdown(config_props_md)
|
124
|
+
else:
|
125
|
+
config_props_out = "---"
|
126
|
+
|
127
|
+
template_props = target.get("templateProperties", "---")
|
128
|
+
if type(template_props) is dict:
|
129
|
+
template_props_md = ""
|
130
|
+
for prop in template_props:
|
131
|
+
template_props_md += f"* {prop}: {template_props[prop]}\n"
|
132
|
+
template_props_out = Markdown(template_props_md)
|
133
|
+
else:
|
134
|
+
template_props_out = "---"
|
135
|
+
|
136
|
+
table.add_row(
|
137
|
+
connector_unique,
|
138
|
+
cat_target_out,
|
139
|
+
config_props_out,
|
140
|
+
template_props_out,
|
141
|
+
op_instruct_out,
|
142
|
+
)
|
143
|
+
|
144
|
+
return table
|
145
|
+
|
146
|
+
try:
|
147
|
+
a_client = AutomatedCuration(view_server, view_url, user)
|
148
|
+
token = a_client.create_egeria_bearer_token(user, user_pass)
|
149
|
+
connector = connector.strip()
|
150
|
+
if connector not in INTEGRATION_GUIDS.keys():
|
151
|
+
raise Exception
|
152
|
+
|
153
|
+
connector_guid = INTEGRATION_GUIDS[connector]
|
154
|
+
cat_targets = a_client.get_catalog_targets(connector_guid)
|
155
|
+
console = Console(force_terminal=not jupyter, width=width, soft_wrap=True)
|
156
|
+
with console.pager(styles=True):
|
157
|
+
console.print(generate_table(), soft_wrap=True)
|
158
|
+
|
159
|
+
except (
|
160
|
+
InvalidParameterException,
|
161
|
+
PropertyServerException,
|
162
|
+
UserNotAuthorizedException,
|
163
|
+
) as e:
|
164
|
+
print_exception_response(e)
|
165
|
+
except Exception as e:
|
166
|
+
print(f"\n\n===> Perhaps integration connector {connector} is not known?\n\n")
|
167
|
+
console.print_exception()
|
168
|
+
finally:
|
169
|
+
a_client.close_session()
|
170
|
+
|
171
|
+
|
172
|
+
def main():
|
173
|
+
parser = argparse.ArgumentParser()
|
174
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
175
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
176
|
+
parser.add_argument("--userid", help="User Id")
|
177
|
+
parser.add_argument("--password", help="User Password")
|
178
|
+
parser.add_argument("--jupyter", help="Enable for Jupyter terminal compatibility")
|
179
|
+
parser.add_argument("--width", help="Screen width, in characters, to use")
|
180
|
+
|
181
|
+
args = parser.parse_args()
|
182
|
+
|
183
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
184
|
+
url = args.url if args.url is not None else EGERIA_VIEW_SERVER_URL
|
185
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
186
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
187
|
+
jupyter = args.jupyter if args.jupyter is not None else EGERIA_JUPYTER
|
188
|
+
width = args.width if args.width is not None else EGERIA_WIDTH
|
189
|
+
|
190
|
+
try:
|
191
|
+
connector = Prompt.ask(
|
192
|
+
"Enter the Integration Connector to list catalog targets for"
|
193
|
+
).strip()
|
194
|
+
display_catalog_targets(
|
195
|
+
connector, server, url, userid, user_pass, jupyter, width=width
|
196
|
+
)
|
197
|
+
|
198
|
+
except KeyboardInterrupt:
|
199
|
+
pass
|
200
|
+
|
201
|
+
|
202
|
+
if __name__ == "__main__":
|
203
|
+
main()
|
@@ -0,0 +1,75 @@
|
|
1
|
+
"""
|
2
|
+
SPDX-License-Identifier: Apache-2.0
|
3
|
+
Copyright Contributors to the ODPi Egeria project.
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
This script refreshed an integration daemon.
|
8
|
+
|
9
|
+
"""
|
10
|
+
|
11
|
+
import os
|
12
|
+
import click
|
13
|
+
from pyegeria import AutomatedCuration, EgeriaTech
|
14
|
+
from pyegeria._exceptions import (
|
15
|
+
InvalidParameterException,
|
16
|
+
PropertyServerException,
|
17
|
+
UserNotAuthorizedException,
|
18
|
+
print_exception_response,
|
19
|
+
)
|
20
|
+
|
21
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
22
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
23
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
24
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
25
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
26
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
27
|
+
)
|
28
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
29
|
+
EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
|
30
|
+
"EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
|
31
|
+
)
|
32
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
33
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
34
|
+
|
35
|
+
|
36
|
+
@click.command("load-archive")
|
37
|
+
@click.option(
|
38
|
+
"--file_name",
|
39
|
+
default="content-packs/CocoComboArchive.omarchive",
|
40
|
+
help="Full path on the Metadata Server to the archive file to load",
|
41
|
+
)
|
42
|
+
@click.option(
|
43
|
+
"--server_name", default=EGERIA_METADATA_STORE, help="Egeria metadata store to load"
|
44
|
+
)
|
45
|
+
@click.option(
|
46
|
+
"--view-server", default=EGERIA_VIEW_SERVER, help="Egeria view server to connect to"
|
47
|
+
)
|
48
|
+
@click.option(
|
49
|
+
"--url", default=EGERIA_PLATFORM_URL, help="URL of Egeria platform to connect to"
|
50
|
+
)
|
51
|
+
@click.option("--userid", default=EGERIA_USER, help="Egeria admin user")
|
52
|
+
@click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria admin password")
|
53
|
+
@click.option("--timeout", default=120, help="Number of seconds to wait")
|
54
|
+
def load_archive(file_name, server_name, view_server, url, userid, password, timeout):
|
55
|
+
"""Load an Open Metadata Archive"""
|
56
|
+
|
57
|
+
try:
|
58
|
+
s_client = EgeriaTech(view_server, url, userid, password)
|
59
|
+
token = s_client.create_egeria_bearer_token()
|
60
|
+
server_guid = None
|
61
|
+
file_name = file_name.strip()
|
62
|
+
s_client.add_archive_file(file_name, server_guid, server_name, time_out=timeout)
|
63
|
+
|
64
|
+
click.echo(f"Loaded archive: {file_name}")
|
65
|
+
|
66
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
67
|
+
print(
|
68
|
+
f"Perhaps there was a timeout? If so, the command will complete despite the exception\n"
|
69
|
+
f"===> You can check by rerunning the command in a few minutes"
|
70
|
+
)
|
71
|
+
print_exception_response(e)
|
72
|
+
|
73
|
+
|
74
|
+
if __name__ == "__main__":
|
75
|
+
load_archive()
|
@@ -0,0 +1,107 @@
|
|
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 json
|
9
|
+
import os
|
10
|
+
import time
|
11
|
+
import argparse
|
12
|
+
from datetime import datetime
|
13
|
+
from rich.prompt import Prompt
|
14
|
+
from rich.table import Table
|
15
|
+
from rich.live import Live
|
16
|
+
from rich.console import Console
|
17
|
+
from rich.markdown import Markdown
|
18
|
+
from confluent_kafka import Consumer, KafkaException
|
19
|
+
|
20
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
21
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9192")
|
22
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
23
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
24
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
25
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
26
|
+
)
|
27
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
28
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
29
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
30
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
31
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
32
|
+
EGERIA_JUPYTER = os.environ.get("EGERIA_JUPYTER", False)
|
33
|
+
EGERIA_WIDTH = os.environ.get("EGERIA_WIDTH", 200)
|
34
|
+
|
35
|
+
|
36
|
+
def main(ep: str = EGERIA_KAFKA_ENDPOINT):
|
37
|
+
disable_ssl_warnings = True
|
38
|
+
console = Console(width=200)
|
39
|
+
now = datetime.now()
|
40
|
+
current_time = now.strftime("%H:%M:%S")
|
41
|
+
|
42
|
+
earliest_latest = Prompt.ask("Msgs from earliest or latest:", default="earliest")
|
43
|
+
|
44
|
+
# Define the Kafka consumer configuration.
|
45
|
+
config = {
|
46
|
+
"bootstrap.servers": ep, # replace with your Kafka broker(s)
|
47
|
+
"group.id": f"view_asset_events:{current_time}", # replace with your consumer group
|
48
|
+
"auto.offset.reset": earliest_latest, # can be set to 'earliest' or 'latest'
|
49
|
+
}
|
50
|
+
print(f"Kafka config is {json.dumps(config)}")
|
51
|
+
# Initialize a Kafka consumer.
|
52
|
+
consumer = Consumer(config)
|
53
|
+
|
54
|
+
# Subscribe to a Kafka topic.
|
55
|
+
consumer.subscribe(
|
56
|
+
["egeria.omag.server.active-metadata-store.omas.assetconsumer.outTopic"]
|
57
|
+
) # replace with your Kafka topic
|
58
|
+
|
59
|
+
try:
|
60
|
+
while True:
|
61
|
+
msg = consumer.poll(2.0) # timeout set to 1 second
|
62
|
+
|
63
|
+
if msg is None:
|
64
|
+
continue
|
65
|
+
elif msg.error():
|
66
|
+
raise KafkaException(msg.error())
|
67
|
+
else:
|
68
|
+
event = json.loads(msg.value())
|
69
|
+
event_time = event["eventTime"]
|
70
|
+
event_type = event["eventType"]
|
71
|
+
guid = event["elementHeader"]["guid"]
|
72
|
+
|
73
|
+
type_name = event["elementHeader"]["type"]["typeName"]
|
74
|
+
origin = event["elementHeader"]["origin"]["sourceServer"]
|
75
|
+
|
76
|
+
element_properties = event["elementProperties"]
|
77
|
+
element_properties_keys = element_properties.keys()
|
78
|
+
props = " "
|
79
|
+
for key in element_properties_keys:
|
80
|
+
value = element_properties[key]
|
81
|
+
props += f"* {key}: {value}\n"
|
82
|
+
console.rule(style="[bold red]")
|
83
|
+
console.rule(
|
84
|
+
f"\tMessage TimeStamp: {event_time}\t eventType: {event_type}\t typeName: {type_name}\t guid: {guid}"
|
85
|
+
)
|
86
|
+
msg = f"properties: \n[bright white on black]{props}\n\n"
|
87
|
+
msg = Markdown(msg)
|
88
|
+
|
89
|
+
console.print(msg)
|
90
|
+
|
91
|
+
except KeyboardInterrupt:
|
92
|
+
pass
|
93
|
+
|
94
|
+
finally:
|
95
|
+
# Close down consumer to commit final offsets.
|
96
|
+
consumer.close()
|
97
|
+
|
98
|
+
|
99
|
+
if __name__ == "__main__":
|
100
|
+
parser = argparse.ArgumentParser()
|
101
|
+
|
102
|
+
parser.add_argument("--ep", help="Endpoint to connect to")
|
103
|
+
args = parser.parse_args()
|
104
|
+
|
105
|
+
ep = args.ep if args.ep is not None else EGERIA_KAFKA_ENDPOINT
|
106
|
+
|
107
|
+
main(ep)
|
@@ -0,0 +1,270 @@
|
|
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 status display for Engine Actions
|
10
|
+
"""
|
11
|
+
|
12
|
+
import argparse
|
13
|
+
import json
|
14
|
+
import os
|
15
|
+
import sys
|
16
|
+
import time
|
17
|
+
|
18
|
+
from rich import box
|
19
|
+
from rich.console import Console
|
20
|
+
from rich.live import Live
|
21
|
+
from rich.table import Table
|
22
|
+
|
23
|
+
from pyegeria import AutomatedCuration
|
24
|
+
from pyegeria import (
|
25
|
+
InvalidParameterException,
|
26
|
+
PropertyServerException,
|
27
|
+
UserNotAuthorizedException,
|
28
|
+
print_exception_response,
|
29
|
+
)
|
30
|
+
|
31
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
32
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
33
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
34
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
35
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
36
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
37
|
+
)
|
38
|
+
EGERIA_ENGINE_HOST = os.environ.get("INTEGRATION_ENGINE_HOST", "engine-host")
|
39
|
+
EGERIA_ENGINE_HOST_URL = os.environ.get(
|
40
|
+
"INTEGRATION_ENGINE_HOST_URL", "https://localhost:9443"
|
41
|
+
)
|
42
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
43
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
44
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
45
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
46
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
47
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
48
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
49
|
+
|
50
|
+
disable_ssl_warnings = True
|
51
|
+
|
52
|
+
|
53
|
+
def display_engine_activity(
|
54
|
+
row_limit: int = 0,
|
55
|
+
view_server: str = EGERIA_VIEW_SERVER,
|
56
|
+
view_url: str = EGERIA_VIEW_SERVER_URL,
|
57
|
+
user: str = EGERIA_USER,
|
58
|
+
user_pass: str = EGERIA_USER_PASSWORD,
|
59
|
+
paging: bool = True,
|
60
|
+
jupyter: bool = EGERIA_JUPYTER,
|
61
|
+
width: int = EGERIA_WIDTH,
|
62
|
+
):
|
63
|
+
"""Display governance engine activity as a table.
|
64
|
+
|
65
|
+
Parameters
|
66
|
+
----------
|
67
|
+
row_limit : int, opt, default = 0
|
68
|
+
If non-zero, limit the number of rows returned
|
69
|
+
view_server : str
|
70
|
+
The Egeria view server name.
|
71
|
+
view_url : str
|
72
|
+
The URL for the Egeria view server.
|
73
|
+
user : str
|
74
|
+
The user name for authenticating with the Egeria server.
|
75
|
+
user_pass : str
|
76
|
+
The user password for authenticating with the Egeria server.
|
77
|
+
paging : bool, default is True
|
78
|
+
Whether to enable paging mode when displaying the table.
|
79
|
+
jupyter : bool
|
80
|
+
Indicates if the environment is a Jupyter notebook.
|
81
|
+
width : int
|
82
|
+
The width of the console for table printing.
|
83
|
+
"""
|
84
|
+
g_client = AutomatedCuration(view_server, view_url, user, user_pwd=user_pass)
|
85
|
+
|
86
|
+
def generate_table() -> Table:
|
87
|
+
"""Make a new table."""
|
88
|
+
table = Table(
|
89
|
+
title=f"Engine Action Status for Platform {view_url} @ {time.asctime()}",
|
90
|
+
style="bold white on black",
|
91
|
+
row_styles=["bold white on black"],
|
92
|
+
header_style="white on dark_blue",
|
93
|
+
title_style="bold white on black",
|
94
|
+
caption_style="white on black",
|
95
|
+
show_lines=True,
|
96
|
+
box=box.ROUNDED,
|
97
|
+
caption=f"Engine Status for Server '{view_server}' @ Platform - {view_url}",
|
98
|
+
expand=True,
|
99
|
+
)
|
100
|
+
table.add_column("Requested Time")
|
101
|
+
table.add_column("Start Time")
|
102
|
+
table.add_column("Action GUID", no_wrap=True)
|
103
|
+
table.add_column("Engine Name")
|
104
|
+
table.add_column("Request Type")
|
105
|
+
table.add_column("Action Status")
|
106
|
+
table.add_column("Target Element")
|
107
|
+
table.add_column("Completion Time")
|
108
|
+
table.add_column("Process Name")
|
109
|
+
table.add_column("Completion Message")
|
110
|
+
|
111
|
+
token = g_client.create_egeria_bearer_token()
|
112
|
+
action_status = g_client.get_engine_actions()
|
113
|
+
|
114
|
+
if type(action_status) is str:
|
115
|
+
requested_time = " "
|
116
|
+
start_time = " "
|
117
|
+
completion_time = " "
|
118
|
+
engine_name = " "
|
119
|
+
request_type = " "
|
120
|
+
action_status = " "
|
121
|
+
target_element = " "
|
122
|
+
process_name = " "
|
123
|
+
completion_message = " "
|
124
|
+
elif type(action_status) is list:
|
125
|
+
sorted_action_status = sorted(
|
126
|
+
action_status,
|
127
|
+
key=lambda i: i.get("requestedTime", time.asctime()),
|
128
|
+
reverse=True,
|
129
|
+
)
|
130
|
+
row_count = 0
|
131
|
+
for action in sorted_action_status:
|
132
|
+
if row_limit > 0 and row_count >= row_limit:
|
133
|
+
break
|
134
|
+
row_count += 1
|
135
|
+
requested_time = action.get("requestedTime", " ")
|
136
|
+
start_time = action.get("startTime", " ")
|
137
|
+
completion_time = action.get("completionTime", " ")
|
138
|
+
|
139
|
+
engine_name = action["governanceEngineName"]
|
140
|
+
request_type = action["requestType"]
|
141
|
+
action_guid = action["elementHeader"]["guid"]
|
142
|
+
if action["actionStatus"] in (
|
143
|
+
"REQUESTED",
|
144
|
+
"APPROVED",
|
145
|
+
"WAITING",
|
146
|
+
"ACTIVATING",
|
147
|
+
):
|
148
|
+
action_status = f"[yellow]{action['actionStatus']}"
|
149
|
+
elif action["actionStatus"] in ("IN_PROGRESS", "ACTIONED"):
|
150
|
+
action_status = f"[green]{action['actionStatus']}"
|
151
|
+
else:
|
152
|
+
action_status = f"[red]{action['actionStatus']}"
|
153
|
+
|
154
|
+
targets = action.get("actionTargetElements", "Empty")
|
155
|
+
if type(targets) is list:
|
156
|
+
tgt_tab = Table()
|
157
|
+
tgt_tab.add_column("name")
|
158
|
+
tgt_tab.add_column("guid", no_wrap=True)
|
159
|
+
tgt_tab.add_column("type_name")
|
160
|
+
targets_md = ""
|
161
|
+
for target in targets:
|
162
|
+
t_name = target["actionTargetName"]
|
163
|
+
t_guid = target["actionTargetGUID"]
|
164
|
+
t_type = target["targetElement"]["type"]["typeName"]
|
165
|
+
tgt_tab.add_row(t_name, t_guid, t_type)
|
166
|
+
# target_element = json.dumps(target[0]["targetElement"]["elementProperties"]["propertiesAsStrings"])
|
167
|
+
target_element = tgt_tab
|
168
|
+
else:
|
169
|
+
target_element = " "
|
170
|
+
|
171
|
+
process_name = action.get("processName", " ")
|
172
|
+
completion_message = action.get("completionMessage", " ")
|
173
|
+
|
174
|
+
table.add_row(
|
175
|
+
requested_time,
|
176
|
+
start_time,
|
177
|
+
action_guid,
|
178
|
+
engine_name,
|
179
|
+
request_type,
|
180
|
+
action_status,
|
181
|
+
target_element,
|
182
|
+
completion_time,
|
183
|
+
process_name,
|
184
|
+
completion_message,
|
185
|
+
)
|
186
|
+
else:
|
187
|
+
print("Egeria integration daemon not running")
|
188
|
+
sys.exit()
|
189
|
+
|
190
|
+
return table
|
191
|
+
|
192
|
+
try:
|
193
|
+
if paging is True:
|
194
|
+
console = Console(width=width, force_terminal=not jupyter)
|
195
|
+
with console.pager():
|
196
|
+
console.print(generate_table())
|
197
|
+
else:
|
198
|
+
with Live(
|
199
|
+
generate_table(),
|
200
|
+
refresh_per_second=1,
|
201
|
+
screen=True,
|
202
|
+
vertical_overflow="visible",
|
203
|
+
) as live:
|
204
|
+
while True:
|
205
|
+
time.sleep(2)
|
206
|
+
live.update(generate_table())
|
207
|
+
|
208
|
+
except (
|
209
|
+
InvalidParameterException,
|
210
|
+
PropertyServerException,
|
211
|
+
UserNotAuthorizedException,
|
212
|
+
) as e:
|
213
|
+
print_exception_response(e)
|
214
|
+
except KeyboardInterrupt:
|
215
|
+
pass
|
216
|
+
finally:
|
217
|
+
g_client.close_session()
|
218
|
+
|
219
|
+
|
220
|
+
def main_live():
|
221
|
+
parser = argparse.ArgumentParser()
|
222
|
+
parser.add_argument(
|
223
|
+
"--rowlimit", default=0, help="Number of rows to return; 0 for all"
|
224
|
+
)
|
225
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
226
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
227
|
+
parser.add_argument("--userid", help="User Id")
|
228
|
+
parser.add_argument("--password", help="User Password")
|
229
|
+
|
230
|
+
args = parser.parse_args()
|
231
|
+
|
232
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
233
|
+
url = args.url if args.url is not None else EGERIA_VIEW_SERVER_URL
|
234
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
235
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
236
|
+
rowlimit = int(args.rowlimit) if args.rowlimit is not None else 0
|
237
|
+
|
238
|
+
display_engine_activity(
|
239
|
+
rowlimit, server, url, user=userid, user_pass=user_pass, paging=False
|
240
|
+
)
|
241
|
+
|
242
|
+
|
243
|
+
def main_paging():
|
244
|
+
parser = argparse.ArgumentParser()
|
245
|
+
parser.add_argument(
|
246
|
+
"--rowlimit", default=0, help="Number of rows to return; 0 for all"
|
247
|
+
)
|
248
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
249
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
250
|
+
parser.add_argument("--userid", help="User Id")
|
251
|
+
parser.add_argument("--password", help="User Password")
|
252
|
+
|
253
|
+
args = parser.parse_args()
|
254
|
+
|
255
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
256
|
+
url = args.url if args.url is not None else EGERIA_VIEW_SERVER_URL
|
257
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
258
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
259
|
+
rowlimit = int(args.rowlimit) if args.rowlimit is not None else 0
|
260
|
+
|
261
|
+
display_engine_activity(
|
262
|
+
rowlimit, server, url, user=userid, user_pass=user_pass, paging=True
|
263
|
+
)
|
264
|
+
|
265
|
+
|
266
|
+
if __name__ == "__main__":
|
267
|
+
main_live()
|
268
|
+
|
269
|
+
if __name__ == "__main_paging__":
|
270
|
+
main_paging()
|