pyegeria 0.2.3__py3-none-any.whl → 5.3.0.dev2__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 +319 -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 +615 -264
- 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.dev2.dist-info/METADATA +70 -0
- pyegeria-5.3.0.dev2.dist-info/RECORD +232 -0
- {pyegeria-0.2.3.dist-info → pyegeria-5.3.0.dev2.dist-info}/WHEEL +1 -1
- pyegeria-5.3.0.dev2.dist-info/entry_points.txt +81 -0
- pyegeria/_client-orig.py +0 -480
- pyegeria/automated_curation.py +0 -446
- 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.3.dist-info/METADATA +0 -57
- pyegeria-0.2.3.dist-info/RECORD +0 -22
- {pyegeria-0.2.3.dist-info/licenses → pyegeria-5.3.0.dev2.dist-info}/LICENSE +0 -0
pyegeria/_client-orig.py
DELETED
@@ -1,480 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
SPDX-License-Identifier: Apache-2.0
|
3
|
-
Copyright Contributors to the ODPi Egeria project.
|
4
|
-
|
5
|
-
This is a simple class to create and manage a connection to an Egeria backend. It is the Superclass for the
|
6
|
-
different client capabilities. It also provides the common methods used to make restful requests to Egeria.
|
7
|
-
|
8
|
-
"""
|
9
|
-
import inspect
|
10
|
-
import json
|
11
|
-
import os
|
12
|
-
|
13
|
-
import requests
|
14
|
-
from requests import Response
|
15
|
-
|
16
|
-
from pyegeria._globals import max_paging_size
|
17
|
-
from pyegeria._validators import (
|
18
|
-
validate_name,
|
19
|
-
validate_server_name,
|
20
|
-
validate_url,
|
21
|
-
validate_user_id,
|
22
|
-
is_json
|
23
|
-
)
|
24
|
-
from pyegeria.exceptions import (
|
25
|
-
OMAGCommonErrorCode,
|
26
|
-
InvalidParameterException,
|
27
|
-
PropertyServerException,
|
28
|
-
UserNotAuthorizedException,
|
29
|
-
)
|
30
|
-
|
31
|
-
# class RequestType(Enum):
|
32
|
-
# """
|
33
|
-
# Enum class for RequestType containing 4 values - GET, POST, PUT, PATCH, DELETE
|
34
|
-
# """
|
35
|
-
#
|
36
|
-
# GET = "GET"
|
37
|
-
# POST = "POST"
|
38
|
-
# PUT = "PUT"
|
39
|
-
# PATCH = "PATCH"
|
40
|
-
# DELETE = "DELETE"
|
41
|
-
|
42
|
-
|
43
|
-
...
|
44
|
-
|
45
|
-
|
46
|
-
class Client:
|
47
|
-
"""
|
48
|
-
An abstract class used to establish connectivity for an Egeria Client
|
49
|
-
for a particular server, platform and user.
|
50
|
-
|
51
|
-
Attributes
|
52
|
-
----------
|
53
|
-
server_name : str (required)
|
54
|
-
Name of the OMAG server to use
|
55
|
-
platform_url : str (required)
|
56
|
-
URL of the server platform to connect to
|
57
|
-
user_id : str
|
58
|
-
The identity of the user calling the method - this sets a default optionally used by the methods
|
59
|
-
when the user doesn't pass the user_id on a method call.
|
60
|
-
user_id : str (required)
|
61
|
-
The identity used to connect to the server
|
62
|
-
user_pwd : str
|
63
|
-
The password used to authenticate the server identity
|
64
|
-
|
65
|
-
Methods
|
66
|
-
-------
|
67
|
-
create_egeria_bearer_token(user_Id: str, password: str = None) -> str
|
68
|
-
Create a bearer token using the simple Egeria token service - store the bearer token in the object instance.
|
69
|
-
|
70
|
-
refresh_egeria_bearer_token()-> None
|
71
|
-
Refresh the bearer token using the attributes of the object instance.
|
72
|
-
|
73
|
-
set_bearer_token(token: str) -> None
|
74
|
-
Set the bearer token attribute in the object instance - used when the token is generated
|
75
|
-
by an external service.
|
76
|
-
|
77
|
-
get_token() -> str
|
78
|
-
Retrieve the bearer token.
|
79
|
-
|
80
|
-
make_request(request_type: str, endpoint: str, payload: str | dict = None,
|
81
|
-
time_out: int = 30) -> Response
|
82
|
-
Make an HTTP Restful request and handle potential errors and exceptions.
|
83
|
-
|
84
|
-
"""
|
85
|
-
|
86
|
-
json_header = {"Content-Type": "application/json"}
|
87
|
-
|
88
|
-
def __init__(
|
89
|
-
self,
|
90
|
-
server_name: str,
|
91
|
-
platform_url: str,
|
92
|
-
user_id: str = None,
|
93
|
-
user_pwd: str = None,
|
94
|
-
verify_flag: bool = False,
|
95
|
-
api_key: str = None,
|
96
|
-
page_size: int = max_paging_size,
|
97
|
-
token: str = None,
|
98
|
-
token_src: str = None,
|
99
|
-
):
|
100
|
-
self.server_name = None
|
101
|
-
self.platform_url = None
|
102
|
-
self.user_id = user_id
|
103
|
-
self.user_pwd = user_pwd
|
104
|
-
self.ssl_verify = verify_flag
|
105
|
-
self.page_size = page_size
|
106
|
-
self.token_src = token_src
|
107
|
-
self.token = token
|
108
|
-
|
109
|
-
#
|
110
|
-
# I'm commenting this out since you should only have to use tokens if you want - just have to
|
111
|
-
# create or set the token with the appropriate methods as desired.
|
112
|
-
# if token is None:
|
113
|
-
# token = os.environ.get("Egeria_Bearer_Token", None)
|
114
|
-
# if token is None: # No token found - so make one
|
115
|
-
# self.create_egeria_bearer_token(self.user_id, self.user_pwd)
|
116
|
-
# else:
|
117
|
-
# self.token = token
|
118
|
-
|
119
|
-
if api_key is None:
|
120
|
-
api_key = os.environ.get("API_KEY",None)
|
121
|
-
self.api_key = api_key
|
122
|
-
|
123
|
-
self.headers = {
|
124
|
-
"Content-Type": "application/json",
|
125
|
-
"x-api-key": api_key,
|
126
|
-
}
|
127
|
-
self.text_headers = {
|
128
|
-
"Content-Type": "text/plain",
|
129
|
-
"x-api-key": api_key,
|
130
|
-
}
|
131
|
-
# if no token is set yet, allow it to be set by a subsequent method
|
132
|
-
if token is None:
|
133
|
-
# validate_user_id(user_id)
|
134
|
-
pass
|
135
|
-
else:
|
136
|
-
self.headers["Authorization"] = f"Bearer {token}"
|
137
|
-
self.text_headers["Authorization"] = f"Bearer {token}"
|
138
|
-
|
139
|
-
calling_frame = inspect.currentframe().f_back
|
140
|
-
caller_method = inspect.getframeinfo(calling_frame).function
|
141
|
-
|
142
|
-
v_url = validate_url(platform_url)
|
143
|
-
|
144
|
-
if v_url:
|
145
|
-
self.platform_url = platform_url
|
146
|
-
if validate_server_name(server_name):
|
147
|
-
self.server_name = server_name
|
148
|
-
self.session = requests.Session()
|
149
|
-
|
150
|
-
def create_egeria_bearer_token(self, user_Id: str, password: str = None) -> str:
|
151
|
-
""" Create and set an Egeria Bearer Token for the user
|
152
|
-
Parameters
|
153
|
-
----------
|
154
|
-
user_Id : str
|
155
|
-
The user id to authenticate with.
|
156
|
-
password : str
|
157
|
-
The password for the user.
|
158
|
-
|
159
|
-
Returns
|
160
|
-
-------
|
161
|
-
token
|
162
|
-
The bearer token for the specified user.
|
163
|
-
|
164
|
-
Raises
|
165
|
-
------
|
166
|
-
InvalidParameterException
|
167
|
-
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
168
|
-
PropertyServerException
|
169
|
-
Raised by the server when an issue arises in processing a valid request
|
170
|
-
NotAuthorizedException
|
171
|
-
The principle specified by the user_id does not have authorization for the requested action
|
172
|
-
Notes
|
173
|
-
-----
|
174
|
-
This routine creates a new bearer token for the user and updates the object with it.
|
175
|
-
It uses Egeria's mechanisms to create a token. This is useful if an Egeria token expires.
|
176
|
-
A bearer token from another source can be set with the set_bearer_token() method.
|
177
|
-
|
178
|
-
"""
|
179
|
-
validate_name(user_Id)
|
180
|
-
validate_name(password)
|
181
|
-
|
182
|
-
url = f"{self.platform_url}/api/token"
|
183
|
-
data = {
|
184
|
-
"userId": user_Id,
|
185
|
-
"password": password
|
186
|
-
}
|
187
|
-
response = self.session.post(url, json=data, headers=self.headers, verify=self.ssl_verify, timeout=30)
|
188
|
-
# response = self.make_request("POST", url, data)
|
189
|
-
token = response.text
|
190
|
-
if token:
|
191
|
-
self.token_src = 'Egeria'
|
192
|
-
self.headers["Authorization"] = f"Bearer {token}"
|
193
|
-
self.text_headers["Authorization"] = f"Bearer {token}"
|
194
|
-
return token
|
195
|
-
else:
|
196
|
-
raise InvalidParameterException("No token returned - request issue")
|
197
|
-
|
198
|
-
def refresh_egeria_bearer_token(self)-> None:
|
199
|
-
if (self.token_src == 'Egeria') and validate_user_id(self.user_id) and validate_name(self.user_pwd):
|
200
|
-
self.create_egeria_bearer_token(self.user_id, self.user_pwd)
|
201
|
-
else:
|
202
|
-
raise InvalidParameterException("Invalid token source")
|
203
|
-
# todo - should I turn the above into a regular exception?
|
204
|
-
|
205
|
-
def set_bearer_token(self, token: str) -> None:
|
206
|
-
""" Retrieve and set a Bearer Token
|
207
|
-
Parameters
|
208
|
-
----------
|
209
|
-
token: str
|
210
|
-
A bearer token supplied to the method.
|
211
|
-
|
212
|
-
Returns
|
213
|
-
-------
|
214
|
-
None
|
215
|
-
This method does not return anything.
|
216
|
-
|
217
|
-
Raises
|
218
|
-
------
|
219
|
-
InvalidParameterException
|
220
|
-
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
221
|
-
PropertyServerException
|
222
|
-
Raised by the server when an issue arises in processing a valid request
|
223
|
-
NotAuthorizedException
|
224
|
-
The principle specified by the user_id does not have authorization for the requested action
|
225
|
-
Notes
|
226
|
-
-----
|
227
|
-
This routine sets the bearer token for the current object. The user is responsible for providing the token.
|
228
|
-
|
229
|
-
"""
|
230
|
-
validate_name(token)
|
231
|
-
self.headers["Authorization"] = f"Bearer {token}"
|
232
|
-
self.text_headers["Authorization"] = f"Bearer {token}"
|
233
|
-
|
234
|
-
|
235
|
-
def get_token(self) -> str:
|
236
|
-
return self.text_headers["Authorization"]
|
237
|
-
|
238
|
-
def make_request(
|
239
|
-
self, request_type: str, endpoint: str, payload: str | dict = None, time_out: int = 30) -> Response:
|
240
|
-
"""
|
241
|
-
Function to make an API call via the Requests Library. Raise an exception if the HTTP response code
|
242
|
-
is not 200/201. IF there is a REST communication exception, raise InvalidParameterException.
|
243
|
-
|
244
|
-
:param request_type: Type of Request.
|
245
|
-
Supported Values - GET, POST, (not PUT, PATCH, DELETE).
|
246
|
-
Type - String
|
247
|
-
:param endpoint: API Endpoint. Type - String
|
248
|
-
:param payload: API Request Parameters or Query String.
|
249
|
-
Type - String or Dict
|
250
|
-
:return: Response. Type - JSON Formatted String
|
251
|
-
|
252
|
-
"""
|
253
|
-
class_name = __class__.__name__
|
254
|
-
calling_frame = inspect.currentframe().f_back
|
255
|
-
caller_method = inspect.getframeinfo(calling_frame).function
|
256
|
-
|
257
|
-
|
258
|
-
try:
|
259
|
-
response = ""
|
260
|
-
if request_type == "GET":
|
261
|
-
response = requests.get(
|
262
|
-
endpoint, params=payload, verify=self.ssl_verify, headers=self.headers
|
263
|
-
)
|
264
|
-
elif request_type == "POST":
|
265
|
-
if type(payload) is str:
|
266
|
-
response = requests.post(
|
267
|
-
endpoint,
|
268
|
-
headers=self.text_headers,
|
269
|
-
timeout=time_out,
|
270
|
-
data=payload,
|
271
|
-
verify=self.ssl_verify,
|
272
|
-
)
|
273
|
-
else:
|
274
|
-
response = requests.post(
|
275
|
-
endpoint,
|
276
|
-
headers=self.headers,
|
277
|
-
timeout=time_out,
|
278
|
-
json=payload,
|
279
|
-
verify=self.ssl_verify,
|
280
|
-
)
|
281
|
-
elif request_type == "POST-DATA":
|
282
|
-
response = requests.post(
|
283
|
-
endpoint,
|
284
|
-
headers=self.headers,
|
285
|
-
timeout=time_out,
|
286
|
-
data=payload,
|
287
|
-
verify=self.ssl_verify,
|
288
|
-
)
|
289
|
-
elif request_type == "DELETE":
|
290
|
-
response = requests.delete(endpoint, timeout=30, verify=self.ssl_verify, headers=self.headers)
|
291
|
-
status_code = response.status_code
|
292
|
-
|
293
|
-
if status_code in (200, 201):
|
294
|
-
# Success
|
295
|
-
if is_json(response.text):
|
296
|
-
# now look at the response itself and throw an exception if an issue
|
297
|
-
related_code = response.json().get("relatedHTTPCode")
|
298
|
-
if related_code == 200:
|
299
|
-
return response
|
300
|
-
else:
|
301
|
-
exc_message = response.text
|
302
|
-
raise InvalidParameterException(exc_message)
|
303
|
-
else:
|
304
|
-
msg = OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
305
|
-
"message_template"
|
306
|
-
].format(
|
307
|
-
"**invalid JSON response - check parameters**",
|
308
|
-
caller_method,
|
309
|
-
class_name,
|
310
|
-
endpoint,
|
311
|
-
OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
312
|
-
"message_id"
|
313
|
-
],
|
314
|
-
)
|
315
|
-
exc_msg = json.dumps(
|
316
|
-
{
|
317
|
-
"class": "VoidResponse",
|
318
|
-
"relatedHTTPCode": response.status_code,
|
319
|
-
"exceptionClassName": "InvalidParameterException",
|
320
|
-
"actionDescription": caller_method,
|
321
|
-
"exceptionErrorMessage": msg,
|
322
|
-
"exceptionErrorMessageId": OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
323
|
-
"message_id"
|
324
|
-
],
|
325
|
-
"exceptionErrorMessageParameters": [
|
326
|
-
endpoint,
|
327
|
-
self.server_name,
|
328
|
-
self.user_id,
|
329
|
-
],
|
330
|
-
"exceptionSystemAction": OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
331
|
-
"system_action"
|
332
|
-
],
|
333
|
-
"exceptionUserAction": OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
334
|
-
"user_action"
|
335
|
-
],
|
336
|
-
"exceptionProperties": {
|
337
|
-
"endpoint": endpoint,
|
338
|
-
"server": self.server_name,
|
339
|
-
"user_id": self.user_id,
|
340
|
-
},
|
341
|
-
}
|
342
|
-
)
|
343
|
-
raise InvalidParameterException(exc_msg)
|
344
|
-
|
345
|
-
if response.status_code in (400, 401, 403, 404, 405):
|
346
|
-
# 4xx are client side errors - 400 bad request, 401 unauthorized
|
347
|
-
msg = OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
348
|
-
"message_template"
|
349
|
-
].format(
|
350
|
-
str(response.status_code),
|
351
|
-
caller_method,
|
352
|
-
class_name,
|
353
|
-
endpoint,
|
354
|
-
OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value["message_id"],
|
355
|
-
)
|
356
|
-
exc_msg = json.dumps(
|
357
|
-
{
|
358
|
-
"class": "VoidResponse",
|
359
|
-
"relatedHTTPCode": response.status_code,
|
360
|
-
"exceptionClassName": "InvalidParameterException",
|
361
|
-
"actionDescription": caller_method,
|
362
|
-
"exceptionErrorMessage": msg,
|
363
|
-
"exceptionErrorMessageId": OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
364
|
-
"message_id"
|
365
|
-
],
|
366
|
-
"exceptionErrorMessageParameters": [
|
367
|
-
endpoint,
|
368
|
-
self.server_name,
|
369
|
-
self.user_id,
|
370
|
-
],
|
371
|
-
"exceptionSystemAction": OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
372
|
-
"system_action"
|
373
|
-
],
|
374
|
-
"exceptionUserAction": OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
375
|
-
"user_action"
|
376
|
-
],
|
377
|
-
"exceptionProperties": {
|
378
|
-
"endpoint": endpoint,
|
379
|
-
"server": self.server_name,
|
380
|
-
"user_id": self.user_id,
|
381
|
-
},
|
382
|
-
}
|
383
|
-
)
|
384
|
-
if response.status_code in (401,403,405):
|
385
|
-
raise UserNotAuthorizedException(exc_msg)
|
386
|
-
else:
|
387
|
-
raise InvalidParameterException(exc_msg)
|
388
|
-
|
389
|
-
elif response.status_code in (500, 501, 502, 503, 504):
|
390
|
-
# server errors
|
391
|
-
msg = OMAGCommonErrorCode.EXCEPTION_RESPONSE_FROM_API.value[
|
392
|
-
"message_template"
|
393
|
-
].format(
|
394
|
-
str(response.status_code),
|
395
|
-
caller_method,
|
396
|
-
endpoint,
|
397
|
-
OMAGCommonErrorCode.EXCEPTION_RESPONSE_FROM_API.value["message_id"],
|
398
|
-
)
|
399
|
-
exc_msg = json.dumps(
|
400
|
-
{
|
401
|
-
"class": "VoidResponse",
|
402
|
-
"relatedHTTPCode": response.status_code,
|
403
|
-
"exceptionClassName": "PropertyServerException",
|
404
|
-
"actionDescription": caller_method,
|
405
|
-
"exceptionErrorMessage": msg,
|
406
|
-
"exceptionErrorMessageId": OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
407
|
-
"message_id"
|
408
|
-
],
|
409
|
-
"exceptionErrorMessageParameters": [
|
410
|
-
endpoint,
|
411
|
-
self.server_name,
|
412
|
-
self.user_id,
|
413
|
-
],
|
414
|
-
"exceptionSystemAction": OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
415
|
-
"system_action"
|
416
|
-
],
|
417
|
-
"exceptionUserAction": OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
418
|
-
"user_action"
|
419
|
-
],
|
420
|
-
"exceptionProperties": {
|
421
|
-
"endpoint": endpoint,
|
422
|
-
"server": self.server_name,
|
423
|
-
"user_id": self.user_id,
|
424
|
-
},
|
425
|
-
}
|
426
|
-
)
|
427
|
-
raise PropertyServerException(exc_msg)
|
428
|
-
|
429
|
-
except InvalidParameterException:
|
430
|
-
raise
|
431
|
-
except UserNotAuthorizedException:
|
432
|
-
raise
|
433
|
-
except (
|
434
|
-
requests.ConnectionError,
|
435
|
-
requests.ConnectTimeout,
|
436
|
-
requests.HTTPError,
|
437
|
-
requests.RequestException,
|
438
|
-
requests.Timeout,
|
439
|
-
# InvalidParameterException
|
440
|
-
# HTTPSConnectionPool,
|
441
|
-
) as e:
|
442
|
-
msg = OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
443
|
-
"message_template"
|
444
|
-
].format(
|
445
|
-
e.args[0],
|
446
|
-
caller_method,
|
447
|
-
class_name,
|
448
|
-
endpoint,
|
449
|
-
OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value["message_id"],
|
450
|
-
)
|
451
|
-
exc_msg = json.dumps(
|
452
|
-
{
|
453
|
-
"class": "VoidResponse",
|
454
|
-
"relatedHTTPCode": 400,
|
455
|
-
"exceptionClassName": "InvalidParameterException",
|
456
|
-
"actionDescription": caller_method,
|
457
|
-
"exceptionErrorMessage": msg,
|
458
|
-
"exceptionErrorMessageId": OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
459
|
-
"message_id"
|
460
|
-
],
|
461
|
-
"exceptionErrorMessageParameters": endpoint,
|
462
|
-
"exceptionSystemAction": OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
463
|
-
"system_action"
|
464
|
-
],
|
465
|
-
"exceptionUserAction": OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
466
|
-
"user_action"
|
467
|
-
],
|
468
|
-
"exceptionProperties": {"endpoint": endpoint},
|
469
|
-
}
|
470
|
-
)
|
471
|
-
raise InvalidParameterException(exc_msg)
|
472
|
-
|
473
|
-
|
474
|
-
if __name__ == "__main__":
|
475
|
-
try:
|
476
|
-
connection = Client(
|
477
|
-
"active-metadata-store", "https://127.0.0.1:9443", "garygeeke", "foo"
|
478
|
-
)
|
479
|
-
except Exception as e:
|
480
|
-
print(e)
|