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,362 @@
|
|
1
|
+
"""
|
2
|
+
SPDX-License-Identifier: Apache-2.0
|
3
|
+
Copyright Contributors to the ODPi Egeria project.
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
Execute Glossary actions.
|
8
|
+
|
9
|
+
"""
|
10
|
+
import csv
|
11
|
+
import json
|
12
|
+
import os
|
13
|
+
import sys
|
14
|
+
import time
|
15
|
+
from datetime import datetime
|
16
|
+
from rich import box
|
17
|
+
from rich.console import Console
|
18
|
+
from rich.prompt import Prompt
|
19
|
+
from rich.table import Table
|
20
|
+
from rich.text import Text
|
21
|
+
|
22
|
+
import click
|
23
|
+
|
24
|
+
|
25
|
+
from pyegeria import EgeriaTech, body_slimmer
|
26
|
+
from pyegeria._exceptions import (
|
27
|
+
InvalidParameterException,
|
28
|
+
PropertyServerException,
|
29
|
+
print_exception_response,
|
30
|
+
)
|
31
|
+
|
32
|
+
|
33
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
34
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
35
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
36
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
37
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
38
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
39
|
+
)
|
40
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
41
|
+
EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
|
42
|
+
"EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
|
43
|
+
)
|
44
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
45
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
46
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
47
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
48
|
+
EGERIA_WIDTH = os.environ.get("EGERIA_WIDTH", 200)
|
49
|
+
EGERIA_JUPYTER = os.environ.get("EGERIA_JUPYTER", False)
|
50
|
+
EGERIA_HOME_GLOSSARY_GUID = os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None)
|
51
|
+
EGERIA_GLOSSARY_PATH = os.environ.get("EGERIA_GLOSSARY_PATH", None)
|
52
|
+
|
53
|
+
|
54
|
+
@click.command("create-glossary")
|
55
|
+
@click.option("--name", help="Name of Glossary", required=True)
|
56
|
+
@click.option("--language", help="Language of Glossary", default="English")
|
57
|
+
@click.option(
|
58
|
+
"--description",
|
59
|
+
help="Description of Glossary",
|
60
|
+
default="A description goes here",
|
61
|
+
)
|
62
|
+
@click.option(
|
63
|
+
"--usage",
|
64
|
+
help="Purpose of glossary",
|
65
|
+
default="Definitions",
|
66
|
+
)
|
67
|
+
@click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use.")
|
68
|
+
@click.option(
|
69
|
+
"--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
70
|
+
)
|
71
|
+
@click.option("--userid", default=EGERIA_USER, help="Egeria user")
|
72
|
+
@click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
|
73
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
74
|
+
def create_glossary(
|
75
|
+
server: str,
|
76
|
+
url: str,
|
77
|
+
userid: str,
|
78
|
+
password: str,
|
79
|
+
timeout: int,
|
80
|
+
name: str,
|
81
|
+
language: str,
|
82
|
+
description: str,
|
83
|
+
usage: str,
|
84
|
+
) -> None:
|
85
|
+
"""Create a new Glossary"""
|
86
|
+
|
87
|
+
try:
|
88
|
+
m_client = EgeriaTech(server, url, userid, password)
|
89
|
+
token = m_client.create_egeria_bearer_token()
|
90
|
+
|
91
|
+
existing_glossary = m_client.find_glossaries(name)
|
92
|
+
if type(existing_glossary) is list:
|
93
|
+
click.echo(
|
94
|
+
f"\nFound {len(existing_glossary)} existing Glossaries with a similar name!\n"
|
95
|
+
)
|
96
|
+
for glossary in existing_glossary:
|
97
|
+
if (
|
98
|
+
glossary["glossaryProperties"]["qualifiedName"]
|
99
|
+
== "Glossary:" + name
|
100
|
+
):
|
101
|
+
click.echo(
|
102
|
+
(
|
103
|
+
f"\tFound existing glossary: {glossary['glossaryProperties']['qualifiedName']} with id of {glossary['elementHeader']['guid']}\n"
|
104
|
+
"Exiting\n"
|
105
|
+
)
|
106
|
+
)
|
107
|
+
sys.exit(0)
|
108
|
+
else:
|
109
|
+
click.echo(
|
110
|
+
"Found glossaries with similar names but different qualifiedNames...proceeding\n"
|
111
|
+
)
|
112
|
+
|
113
|
+
glossary_guid = m_client.create_glossary(name, description, language, usage)
|
114
|
+
print(f"New glossary {name} created with id of {glossary_guid}")
|
115
|
+
|
116
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
117
|
+
print_exception_response(e)
|
118
|
+
finally:
|
119
|
+
m_client.close_session()
|
120
|
+
|
121
|
+
|
122
|
+
@click.command("delete-glossary")
|
123
|
+
@click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
|
124
|
+
@click.option(
|
125
|
+
"--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
126
|
+
)
|
127
|
+
@click.option("--userid", default=EGERIA_USER, help="Egeria user")
|
128
|
+
@click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
|
129
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
130
|
+
@click.argument("glossary-guid")
|
131
|
+
def delete_glossary(server, url, userid, password, timeout, glossary_guid):
|
132
|
+
"""Delete the glossary specified"""
|
133
|
+
m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
|
134
|
+
token = m_client.create_egeria_bearer_token()
|
135
|
+
try:
|
136
|
+
m_client.delete_glossary(glossary_guid)
|
137
|
+
|
138
|
+
click.echo(f"Deleted glossary: {glossary_guid}")
|
139
|
+
|
140
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
141
|
+
print_exception_response(e)
|
142
|
+
finally:
|
143
|
+
m_client.close_session()
|
144
|
+
|
145
|
+
|
146
|
+
@click.command("create-term")
|
147
|
+
@click.option("--glossary-name", help="Name of Glossary", required=True)
|
148
|
+
@click.option("--term-name", help="Name of Term", required=True)
|
149
|
+
@click.option(
|
150
|
+
"--summary",
|
151
|
+
help="Summary definition",
|
152
|
+
default="Summary goes here",
|
153
|
+
)
|
154
|
+
@click.option(
|
155
|
+
"--description",
|
156
|
+
help="Full description",
|
157
|
+
default="Description goes here",
|
158
|
+
)
|
159
|
+
@click.option("--abbrev", help="Abbreviation", default=None)
|
160
|
+
@click.option("--examples", help="Example usage", default=None)
|
161
|
+
@click.option("--usage", help="Usage notes", default=None)
|
162
|
+
@click.option("--version", help="Version", default="1.0")
|
163
|
+
@click.option(
|
164
|
+
"--status",
|
165
|
+
help="Status",
|
166
|
+
type=click.Choice(
|
167
|
+
["DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", "OTHER"], case_sensitive=False
|
168
|
+
),
|
169
|
+
default="DRAFT",
|
170
|
+
)
|
171
|
+
@click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use.")
|
172
|
+
@click.option(
|
173
|
+
"--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
174
|
+
)
|
175
|
+
@click.option("--userid", default=EGERIA_USER, help="Egeria user")
|
176
|
+
@click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
|
177
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
178
|
+
def create_term(
|
179
|
+
server,
|
180
|
+
url,
|
181
|
+
userid,
|
182
|
+
password,
|
183
|
+
glossary_name,
|
184
|
+
term_name,
|
185
|
+
summary,
|
186
|
+
description,
|
187
|
+
abbrev,
|
188
|
+
examples,
|
189
|
+
usage,
|
190
|
+
version,
|
191
|
+
status,
|
192
|
+
timeout: int = 120,
|
193
|
+
) -> str:
|
194
|
+
"""Create a new term"""
|
195
|
+
m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
|
196
|
+
token = m_client.create_egeria_bearer_token()
|
197
|
+
try:
|
198
|
+
body = {
|
199
|
+
"class": "ReferenceableRequestBody",
|
200
|
+
"elementProperties": {
|
201
|
+
"class": "GlossaryTermProperties",
|
202
|
+
"qualifiedName": f"GlossaryTerm: {term_name} - {datetime.now().isoformat()}",
|
203
|
+
"displayName": term_name,
|
204
|
+
"summary": summary,
|
205
|
+
"description": description,
|
206
|
+
"abbreviation": abbrev,
|
207
|
+
"examples": examples,
|
208
|
+
"usage": usage,
|
209
|
+
"publishVersionIdentifier": version,
|
210
|
+
},
|
211
|
+
"initialStatus": status,
|
212
|
+
}
|
213
|
+
exists = False
|
214
|
+
glossary_info = m_client.find_glossaries(glossary_name)
|
215
|
+
if type(glossary_info) is list:
|
216
|
+
for glossary in glossary_info:
|
217
|
+
if glossary["glossaryProperties"]["displayName"] == glossary_name:
|
218
|
+
exists = True
|
219
|
+
glossary_guid = glossary["elementHeader"]["guid"]
|
220
|
+
|
221
|
+
if not exists:
|
222
|
+
click.echo(f"The glossary name {glossary_name} was not found..exiting\n")
|
223
|
+
sys.exit(0)
|
224
|
+
|
225
|
+
term_guid = m_client.create_controlled_glossary_term(
|
226
|
+
glossary_guid, body_slimmer(body)
|
227
|
+
)
|
228
|
+
|
229
|
+
click.echo(
|
230
|
+
f"Successfully created term {term_name} with GUID {term_guid}, in glossary {glossary_name}.\n"
|
231
|
+
)
|
232
|
+
return term_guid
|
233
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
234
|
+
print_exception_response(e)
|
235
|
+
finally:
|
236
|
+
m_client.close_session()
|
237
|
+
|
238
|
+
|
239
|
+
@click.command("delete-term")
|
240
|
+
@click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
|
241
|
+
@click.option(
|
242
|
+
"--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
243
|
+
)
|
244
|
+
@click.option("--userid", default=EGERIA_USER, help="Egeria user")
|
245
|
+
@click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
|
246
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
247
|
+
@click.argument("term-guid")
|
248
|
+
def delete_term(server, url, userid, password, timeout, term_guid):
|
249
|
+
"""Delete a glossary term"""
|
250
|
+
m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
|
251
|
+
token = m_client.create_egeria_bearer_token()
|
252
|
+
try:
|
253
|
+
term_guid = term_guid.strip()
|
254
|
+
term_info = m_client.get_terms_by_guid(term_guid)
|
255
|
+
|
256
|
+
m_client.delete_term(term_guid)
|
257
|
+
|
258
|
+
click.echo(
|
259
|
+
f"Deleted term with GUID: {term_guid} and Display Name: {term_info['glossaryTermProperties']['displayName']}"
|
260
|
+
)
|
261
|
+
|
262
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
263
|
+
print_exception_response(e)
|
264
|
+
finally:
|
265
|
+
m_client.close_session()
|
266
|
+
|
267
|
+
|
268
|
+
@click.command("import-terms")
|
269
|
+
@click.option("--glossary_name", help="Name of Glossary", required=True)
|
270
|
+
@click.option("--file_name", help="Path of CSV file", required=True)
|
271
|
+
@click.option(
|
272
|
+
"--file_path", help="Path of CSV file", default=EGERIA_GLOSSARY_PATH, required=False
|
273
|
+
)
|
274
|
+
@click.option(
|
275
|
+
"--verbose",
|
276
|
+
is_flag=True,
|
277
|
+
default=True,
|
278
|
+
help="If set, result descriptions are provided",
|
279
|
+
)
|
280
|
+
@click.option(
|
281
|
+
"--upsert",
|
282
|
+
is_flag=True,
|
283
|
+
default=True,
|
284
|
+
help="If set, terms will be updated if they exist; otherwise they would be appended",
|
285
|
+
)
|
286
|
+
@click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
|
287
|
+
@click.option(
|
288
|
+
"--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
289
|
+
)
|
290
|
+
@click.option("--userid", default=EGERIA_USER, help="Egeria user")
|
291
|
+
@click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
|
292
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
293
|
+
def import_terms(
|
294
|
+
glossary_name: str,
|
295
|
+
file_path: str,
|
296
|
+
file_name: str,
|
297
|
+
verbose: bool,
|
298
|
+
upsert: bool,
|
299
|
+
server: str,
|
300
|
+
url: str,
|
301
|
+
userid: str,
|
302
|
+
password: str,
|
303
|
+
timeout: int,
|
304
|
+
):
|
305
|
+
"""Load terms from file into the glossary specified"""
|
306
|
+
m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
|
307
|
+
token = m_client.create_egeria_bearer_token()
|
308
|
+
try:
|
309
|
+
result = m_client.load_terms_from_file(
|
310
|
+
glossary_name,
|
311
|
+
file_name,
|
312
|
+
file_path=file_path,
|
313
|
+
upsert=upsert,
|
314
|
+
verbose=verbose,
|
315
|
+
)
|
316
|
+
|
317
|
+
click.echo(
|
318
|
+
f"Loaded terms from into glossary: {glossary_name} from {file_name}"
|
319
|
+
)
|
320
|
+
if verbose:
|
321
|
+
print(f"\n Verbose output:\n{json.dumps(result, indent = 2)}")
|
322
|
+
|
323
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
324
|
+
print_exception_response(e)
|
325
|
+
finally:
|
326
|
+
m_client.close_session()
|
327
|
+
|
328
|
+
|
329
|
+
@click.command("export-terms")
|
330
|
+
@click.option(
|
331
|
+
"--glossary_guid",
|
332
|
+
help="GUID of Glossary to export",
|
333
|
+
required=True,
|
334
|
+
)
|
335
|
+
@click.option("--file_name", help="Path of CSV file", required=True)
|
336
|
+
@click.option(
|
337
|
+
"--file_path", help="Path of CSV file", default=EGERIA_GLOSSARY_PATH, required=False
|
338
|
+
)
|
339
|
+
@click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
|
340
|
+
@click.option(
|
341
|
+
"--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
342
|
+
)
|
343
|
+
@click.option("--userid", default=EGERIA_USER, help="Egeria user")
|
344
|
+
@click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
|
345
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
346
|
+
def export_terms(
|
347
|
+
glossary_guid: str, file_name, file_path, server, url, userid, password, timeout
|
348
|
+
):
|
349
|
+
"""Export the glossary specified"""
|
350
|
+
m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
|
351
|
+
token = m_client.create_egeria_bearer_token()
|
352
|
+
try:
|
353
|
+
result = m_client.export_glossary_to_csv(glossary_guid, file_name, file_path)
|
354
|
+
|
355
|
+
click.echo(
|
356
|
+
f"Exported {result} terms from glossary: {glossary_guid} into {file_name}"
|
357
|
+
)
|
358
|
+
|
359
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
360
|
+
print_exception_response(e)
|
361
|
+
finally:
|
362
|
+
m_client.close_session()
|
@@ -0,0 +1,176 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
List assets
|
7
|
+
|
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
|
+
from rich.text import Text
|
20
|
+
|
21
|
+
from pyegeria import (
|
22
|
+
InvalidParameterException,
|
23
|
+
PropertyServerException,
|
24
|
+
UserNotAuthorizedException,
|
25
|
+
print_exception_response,
|
26
|
+
AssetCatalog,
|
27
|
+
)
|
28
|
+
|
29
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
30
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
31
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
32
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
33
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
34
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
35
|
+
)
|
36
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
37
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
38
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
39
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
40
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
41
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
42
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
43
|
+
|
44
|
+
|
45
|
+
disable_ssl_warnings = True
|
46
|
+
|
47
|
+
|
48
|
+
def display_assets(
|
49
|
+
search_string: 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
|
+
raise ValueError(
|
61
|
+
"Invalid Search String - must be greater than four characters long"
|
62
|
+
)
|
63
|
+
g_client = AssetCatalog(server, url, username)
|
64
|
+
token = g_client.create_egeria_bearer_token(username, user_password)
|
65
|
+
|
66
|
+
def generate_table(search_string: str = None) -> Table:
|
67
|
+
"""Make a new table."""
|
68
|
+
table = Table(
|
69
|
+
title=f"Assets containing the string {search_string} @ {time.asctime()}",
|
70
|
+
header_style="white on dark_blue",
|
71
|
+
style="bold white on black",
|
72
|
+
row_styles=["bold white on black"],
|
73
|
+
title_style="bold white on black",
|
74
|
+
caption_style="white on black",
|
75
|
+
show_lines=True,
|
76
|
+
box=box.ROUNDED,
|
77
|
+
caption=f"View Server '{server}' @ Platform - {url}",
|
78
|
+
expand=True,
|
79
|
+
)
|
80
|
+
table.add_column("Display Name / Qualified Name / GUID", width=36)
|
81
|
+
table.add_column("Type Name")
|
82
|
+
table.add_column("Technology Type")
|
83
|
+
# table.add_column("Qualified Name",max_width=15)
|
84
|
+
table.add_column("Matching Elements")
|
85
|
+
|
86
|
+
assets = g_client.find_in_asset_domain(
|
87
|
+
search_string,
|
88
|
+
starts_with=True,
|
89
|
+
ends_with=False,
|
90
|
+
ignore_case=True,
|
91
|
+
page_size=100,
|
92
|
+
time_out=time_out,
|
93
|
+
)
|
94
|
+
if type(assets) is str:
|
95
|
+
return table
|
96
|
+
|
97
|
+
for element in assets:
|
98
|
+
properties = element["properties"]
|
99
|
+
header = element["elementHeader"]
|
100
|
+
nested = element.get("matchingElements", "---")
|
101
|
+
qualified_name = properties["qualifiedName"]
|
102
|
+
display_name = Text(f"{properties.get("displayName", "---")}\n\n{qualified_name}\n\n"
|
103
|
+
f"{header['guid']}", justify="center")
|
104
|
+
|
105
|
+
type_name = header["type"]["typeName"]
|
106
|
+
tech_type = properties.get("deployedImplementationType", "---")
|
107
|
+
|
108
|
+
match_tab = Table(expand=True)
|
109
|
+
match_tab.add_column("Type Name")
|
110
|
+
match_tab.add_column("GUID", width=36)
|
111
|
+
match_tab.add_column("Properties")
|
112
|
+
|
113
|
+
for match_t in nested:
|
114
|
+
match = match_t["elementHeader"]
|
115
|
+
match_type_name = match["type"]["typeName"]
|
116
|
+
matching_guid = match["guid"]
|
117
|
+
match_props = match_t["properties"]
|
118
|
+
match_details_md = ""
|
119
|
+
for key in match_props.keys():
|
120
|
+
match_details_md += f"* {key}: {match_props[key]}\n"
|
121
|
+
match_details_out = Markdown(match_details_md)
|
122
|
+
match_tab.add_row(match_type_name, matching_guid, match_details_out)
|
123
|
+
|
124
|
+
table.add_row(display_name, type_name, tech_type, match_tab)
|
125
|
+
|
126
|
+
g_client.close_session()
|
127
|
+
return table
|
128
|
+
|
129
|
+
try:
|
130
|
+
# with Live(generate_table(), refresh_per_second=4, screen=True) as live:
|
131
|
+
# while True:
|
132
|
+
# time.sleep(2)
|
133
|
+
# live.update(generate_table())
|
134
|
+
|
135
|
+
with console.pager(styles=True):
|
136
|
+
console.print(generate_table(search_string), soft_wrap=True)
|
137
|
+
|
138
|
+
except (
|
139
|
+
InvalidParameterException,
|
140
|
+
PropertyServerException,
|
141
|
+
UserNotAuthorizedException,
|
142
|
+
) as e:
|
143
|
+
console.print_exception()
|
144
|
+
sys.exit(1)
|
145
|
+
|
146
|
+
except ValueError as e:
|
147
|
+
console.print(
|
148
|
+
f"\n\n====> Invalid Search String - must be greater than four characters long"
|
149
|
+
)
|
150
|
+
sys.exit(1)
|
151
|
+
|
152
|
+
|
153
|
+
def main():
|
154
|
+
parser = argparse.ArgumentParser()
|
155
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
156
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
157
|
+
parser.add_argument("--userid", help="User Id")
|
158
|
+
parser.add_argument("--password", help="User Password")
|
159
|
+
parser.add_argument("--time_out", help="Time Out")
|
160
|
+
|
161
|
+
args = parser.parse_args()
|
162
|
+
|
163
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
164
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
165
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
166
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
167
|
+
time_out = args.time_out if args.time_out is not None else 60
|
168
|
+
try:
|
169
|
+
search_string = Prompt.ask("Enter an asset search string:", default="")
|
170
|
+
display_assets(search_string, server, url, userid, user_pass, time_out)
|
171
|
+
except KeyboardInterrupt:
|
172
|
+
pass
|
173
|
+
|
174
|
+
|
175
|
+
if __name__ == "__main__":
|
176
|
+
main()
|