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
pyegeria/platform_services.py
CHANGED
@@ -6,20 +6,21 @@ Copyright Contributors to the ODPi Egeria project.
|
|
6
6
|
|
7
7
|
"""
|
8
8
|
|
9
|
+
import asyncio
|
9
10
|
import inspect
|
10
11
|
import json
|
12
|
+
|
11
13
|
import httpx
|
12
|
-
# import requests
|
13
14
|
|
14
|
-
from pyegeria import
|
15
|
+
from pyegeria import Client, enable_ssl_check
|
15
16
|
from pyegeria._validators import validate_user_id
|
16
|
-
from pyegeria.
|
17
|
+
from pyegeria._exceptions import (
|
17
18
|
OMAGCommonErrorCode,
|
18
19
|
InvalidParameterException,
|
19
20
|
UserNotAuthorizedException,
|
20
|
-
PropertyServerException,
|
21
|
+
PropertyServerException,
|
22
|
+
print_exception_response,
|
21
23
|
)
|
22
|
-
import asyncio
|
23
24
|
|
24
25
|
|
25
26
|
class Platform(Client):
|
@@ -27,7 +28,8 @@ class Platform(Client):
|
|
27
28
|
Client to operate Egeria Platforms - inherits from Server Ops
|
28
29
|
|
29
30
|
Attributes:
|
30
|
-
|
31
|
+
server_name: str
|
32
|
+
Name of the server to use.
|
31
33
|
platform_url : str
|
32
34
|
URL of the server platform to connect to
|
33
35
|
user_id : str
|
@@ -35,71 +37,28 @@ class Platform(Client):
|
|
35
37
|
when the user doesn't pass the user_id on a method call.
|
36
38
|
user_pwd: str
|
37
39
|
The password associated with the user_id. Defaults to None
|
38
|
-
verify_flag: bool
|
39
|
-
Flag to indicate if SSL Certificates should be verified in the HTTP requests.
|
40
|
-
Defaults to False.
|
41
|
-
|
42
|
-
Methods:
|
43
|
-
__init__(self, platform_url: str, end_user_id: str)
|
44
|
-
Initializes the connection - throwing an exception if there is a problem
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
get_platform_origin() -> str
|
49
|
-
|
50
|
-
activate_server_stored_config(server: str = None, timeout: int = 30) -> None
|
51
|
-
|
52
|
-
activate_server_supplied_config(config_body: str, server: str = None, timeout: int = 30) -> None
|
53
|
-
|
54
|
-
get_active_server_instance_status(server: str = None)-> dict | str
|
55
|
-
|
56
|
-
get_known_servers() -> list[str] | str
|
57
|
-
|
58
|
-
is_server_known(server: str = None) -> bool
|
59
|
-
|
60
|
-
is_server_configured(server: str = None) -> bool
|
61
|
-
|
62
|
-
check_server_active(server: str = None)
|
63
|
-
|
64
|
-
get_active_server_list() -> dict | str
|
65
|
-
|
66
|
-
shutdown_platform() -> None:
|
67
|
-
|
68
|
-
shutdown_server(server: str = None) -> None:
|
69
|
-
|
70
|
-
shutdown_unregister_servers() -> None
|
71
|
-
|
72
|
-
shutdown_all_servers() -> None
|
73
|
-
|
74
|
-
activate_server_if_down(server: str) -> bool
|
75
|
-
|
76
|
-
activate_servers_on_platform(server_list: str) -> bool
|
77
|
-
|
78
|
-
activate_platform(self, platform_name: str, hosted_server_names: [str], timeout:int = 60) -> None
|
79
40
|
|
80
41
|
"""
|
81
42
|
|
82
|
-
|
43
|
+
platform_command_root: str
|
83
44
|
|
84
45
|
def __init__(
|
85
|
-
|
86
|
-
server_name: str,
|
87
|
-
platform_url: str,
|
88
|
-
user_id: str,
|
89
|
-
user_pwd: str = None,
|
90
|
-
verify_flag: bool = False,
|
91
|
-
sync_mode: bool = True
|
46
|
+
self, server_name: str, platform_url: str, user_id: str, user_pwd: str = None
|
92
47
|
):
|
93
|
-
validate_user_id(
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
48
|
+
validate_user_id(
|
49
|
+
user_id
|
50
|
+
) # add this check since we aren't using bearer tokens in this class
|
51
|
+
|
52
|
+
Client.__init__(self, server_name, platform_url, user_id, user_pwd)
|
53
|
+
self.admin_command_root = (
|
54
|
+
self.platform_url
|
55
|
+
+ "/open-metadata/platform-services/users/"
|
56
|
+
+ user_id
|
57
|
+
+ "/server-platform"
|
58
|
+
)
|
100
59
|
|
101
60
|
def get_platform_origin(self) -> str:
|
102
|
-
"""
|
61
|
+
"""Get the version and origin of the platform software
|
103
62
|
|
104
63
|
/open-metadata/platform-services/users/{userId}/server-platform/origin
|
105
64
|
Response from this call is a string not JSON..
|
@@ -122,24 +81,34 @@ class Platform(Client):
|
|
122
81
|
The principle specified by the user_id does not have authorization for the requested action
|
123
82
|
"""
|
124
83
|
|
84
|
+
global response
|
125
85
|
calling_frame = inspect.currentframe().f_back
|
126
86
|
caller_method = inspect.getframeinfo(calling_frame).function
|
127
87
|
class_name = __class__.__name__
|
128
88
|
|
129
89
|
url = self.admin_command_root + "/origin"
|
130
|
-
|
90
|
+
|
91
|
+
local_session = httpx.Client(verify=enable_ssl_check)
|
92
|
+
response = " "
|
131
93
|
try:
|
132
94
|
response = local_session.get(url)
|
133
95
|
if response.status_code != 200:
|
134
|
-
msg =
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
96
|
+
msg = (
|
97
|
+
OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
98
|
+
"message_template"
|
99
|
+
].format(
|
100
|
+
response.status_code,
|
101
|
+
caller_method,
|
102
|
+
class_name,
|
103
|
+
url,
|
104
|
+
OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
105
|
+
"message_id"
|
106
|
+
],
|
107
|
+
)
|
108
|
+
+ "==>System reports:'"
|
109
|
+
+ response.reason_phrase
|
110
|
+
+ "'"
|
111
|
+
)
|
143
112
|
exc_msg = json.dumps(
|
144
113
|
{
|
145
114
|
"class": "VoidResponse",
|
@@ -171,24 +140,29 @@ class Platform(Client):
|
|
171
140
|
raise InvalidParameterException(exc_msg)
|
172
141
|
else:
|
173
142
|
return response.text
|
174
|
-
except
|
143
|
+
except InvalidParameterException:
|
175
144
|
raise
|
176
145
|
|
177
146
|
except (
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
147
|
+
httpx.NetworkError,
|
148
|
+
httpx.ProtocolError,
|
149
|
+
httpx.HTTPStatusError,
|
150
|
+
httpx.TimeoutException,
|
182
151
|
) as e:
|
183
|
-
msg =
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
152
|
+
msg = (
|
153
|
+
OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value[
|
154
|
+
"message_template"
|
155
|
+
].format(
|
156
|
+
e.args[0],
|
157
|
+
caller_method,
|
158
|
+
class_name,
|
159
|
+
url,
|
160
|
+
OMAGCommonErrorCode.CLIENT_SIDE_REST_API_ERROR.value["message_id"],
|
161
|
+
)
|
162
|
+
+ "==>System reports:'"
|
163
|
+
+ response.reason_phrase
|
164
|
+
+ "'"
|
165
|
+
)
|
192
166
|
exc_msg = json.dumps(
|
193
167
|
{
|
194
168
|
"class": "VoidResponse",
|
@@ -219,8 +193,10 @@ class Platform(Client):
|
|
219
193
|
)
|
220
194
|
raise InvalidParameterException(exc_msg)
|
221
195
|
|
222
|
-
async def _async_activate_server_stored_config(
|
223
|
-
|
196
|
+
async def _async_activate_server_stored_config(
|
197
|
+
self, server: str = None, timeout: int = 60
|
198
|
+
) -> None:
|
199
|
+
"""Activate a server on the associated platform with the stored configuration. Async version.
|
224
200
|
|
225
201
|
Parameters
|
226
202
|
----------
|
@@ -246,12 +222,15 @@ class Platform(Client):
|
|
246
222
|
|
247
223
|
await self._async_make_request("POST", url, time_out=timeout)
|
248
224
|
|
249
|
-
def activate_server_stored_config(
|
250
|
-
|
225
|
+
def activate_server_stored_config(
|
226
|
+
self, server: str = None, timeout: int = 90
|
227
|
+
) -> None:
|
228
|
+
"""Activate a server on the associated platform with the stored configuration.
|
251
229
|
|
252
230
|
Parameters
|
253
231
|
----------
|
254
232
|
server : Use the server if specified. If None, use the default server associated with the Platform object.
|
233
|
+
timeout: number of seconds to wait for a response before raising an exception
|
255
234
|
|
256
235
|
Returns
|
257
236
|
-------
|
@@ -267,11 +246,15 @@ class Platform(Client):
|
|
267
246
|
The principle specified by the user_id does not have authorization for the requested action
|
268
247
|
"""
|
269
248
|
loop = asyncio.get_event_loop()
|
270
|
-
response = loop.run_until_complete(
|
249
|
+
response = loop.run_until_complete(
|
250
|
+
self._async_activate_server_stored_config(server, timeout)
|
251
|
+
)
|
271
252
|
return response
|
272
253
|
|
273
|
-
async def _async_activate_server_supplied_config(
|
274
|
-
|
254
|
+
async def _async_activate_server_supplied_config(
|
255
|
+
self, config_body: dict, server: str = None, timeout: int = 60
|
256
|
+
) -> None:
|
257
|
+
"""Activate a server on the associated platform with the stored configuration. Async version.
|
275
258
|
|
276
259
|
Parameters
|
277
260
|
----------
|
@@ -301,31 +284,61 @@ class Platform(Client):
|
|
301
284
|
url = self.admin_command_root + "/servers/" + server + "/instance/configuration"
|
302
285
|
await self._async_make_request("POST", url, config_body, time_out=timeout)
|
303
286
|
|
304
|
-
def activate_server_supplied_config(
|
287
|
+
def activate_server_supplied_config(
|
288
|
+
self, config_body: dict, server: str = None, timeout: int = 60
|
289
|
+
) -> None:
|
290
|
+
"""Activate a server on the associated platform with the stored configuration.
|
291
|
+
|
292
|
+
Parameters
|
293
|
+
----------
|
294
|
+
config_body: str
|
295
|
+
Server configuration to use for activation.
|
296
|
+
server : str, optional
|
297
|
+
Use the server if specified. If None, use the default server associated with the Platform object.
|
298
|
+
timeout: int, optional
|
299
|
+
A request timeout in seconds
|
300
|
+
|
301
|
+
Returns
|
302
|
+
-------
|
303
|
+
None
|
304
|
+
|
305
|
+
Raises
|
306
|
+
------
|
307
|
+
InvalidParameterException
|
308
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
309
|
+
PropertyServerException
|
310
|
+
Raised by the server when an issue arises in processing a valid request
|
311
|
+
NotAuthorizedException
|
312
|
+
The principle specified by the user_id does not have authorization for the requested action
|
313
|
+
"""
|
305
314
|
loop = asyncio.get_event_loop()
|
306
|
-
loop.run_until_complete(
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
315
|
+
loop.run_until_complete(
|
316
|
+
self._async_activate_server_supplied_config(config_body, server, timeout)
|
317
|
+
)
|
318
|
+
|
319
|
+
async def _async_get_active_server_instance_status(
|
320
|
+
self, server: str = None
|
321
|
+
) -> dict | str:
|
322
|
+
"""Get the current status of all services running in the specified active server. Async version.
|
323
|
+
|
324
|
+
Parameters
|
325
|
+
----------
|
326
|
+
server : str, optional
|
327
|
+
The current active server we want to get status from.
|
328
|
+
If None, use the default server associated with the Platform object.
|
329
|
+
Returns
|
330
|
+
-------
|
331
|
+
List of server status.
|
332
|
+
|
333
|
+
Raises
|
334
|
+
------
|
335
|
+
InvalidParameterException
|
336
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
337
|
+
PropertyServerException
|
338
|
+
Raised by the server when an issue arises in processing a valid request
|
339
|
+
NotAuthorizedException
|
340
|
+
The principle specified by the user_id does not have authorization for the requested action
|
341
|
+
"""
|
329
342
|
if server is None:
|
330
343
|
server = self.server_name
|
331
344
|
|
@@ -334,32 +347,34 @@ class Platform(Client):
|
|
334
347
|
return response.json().get("serverStatus", "No status found")
|
335
348
|
|
336
349
|
def get_active_server_instance_status(self, server: str = None) -> dict | str:
|
337
|
-
"""
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
350
|
+
"""Get the current status of all services running in the specified active server.
|
351
|
+
|
352
|
+
Parameters
|
353
|
+
----------
|
354
|
+
server : str, optional
|
355
|
+
The current active server we want to get status from.
|
356
|
+
If None, use the default server associated with the Platform object.
|
357
|
+
Returns
|
358
|
+
-------
|
359
|
+
List of server status.
|
360
|
+
|
361
|
+
Raises
|
362
|
+
------
|
363
|
+
InvalidParameterException
|
364
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
365
|
+
PropertyServerException
|
366
|
+
Raised by the server when an issue arises in processing a valid request
|
367
|
+
NotAuthorizedException
|
368
|
+
The principle specified by the user_id does not have authorization for the requested action
|
369
|
+
"""
|
357
370
|
loop = asyncio.get_event_loop()
|
358
|
-
response = loop.run_until_complete(
|
371
|
+
response = loop.run_until_complete(
|
372
|
+
self._async_get_active_server_instance_status(server)
|
373
|
+
)
|
359
374
|
return response
|
360
375
|
|
361
376
|
async def _async_get_known_servers(self) -> list[str] | str:
|
362
|
-
"""
|
377
|
+
"""List all known servers on the associated platform. Async version.
|
363
378
|
|
364
379
|
Parameters
|
365
380
|
----------
|
@@ -382,7 +397,7 @@ class Platform(Client):
|
|
382
397
|
return response.json().get("serverList", "No servers found")
|
383
398
|
|
384
399
|
def get_known_servers(self) -> list[str] | str:
|
385
|
-
"""
|
400
|
+
"""List all known servers on the associated platform.
|
386
401
|
|
387
402
|
Parameters
|
388
403
|
----------
|
@@ -405,7 +420,7 @@ class Platform(Client):
|
|
405
420
|
return response
|
406
421
|
|
407
422
|
async def _async_is_server_known(self, server: str = None) -> bool:
|
408
|
-
"""
|
423
|
+
"""Is the server known? Async version.
|
409
424
|
|
410
425
|
Parameters
|
411
426
|
----------
|
@@ -432,35 +447,36 @@ class Platform(Client):
|
|
432
447
|
return response.json().get("flag")
|
433
448
|
|
434
449
|
def is_server_known(self, server: str = None) -> bool:
|
435
|
-
"""
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
450
|
+
"""Is the server known?
|
451
|
+
|
452
|
+
Parameters
|
453
|
+
----------
|
454
|
+
server : Use the server if specified. If None, use the default server associated with the Platform object.
|
455
|
+
|
456
|
+
Returns
|
457
|
+
-------
|
458
|
+
bool: Returns True if the server is known, False otherwise.
|
459
|
+
|
460
|
+
Raises
|
461
|
+
------
|
462
|
+
InvalidParameterException
|
463
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
464
|
+
PropertyServerException
|
465
|
+
Raised by the server when an issue arises in processing a valid request
|
466
|
+
NotAuthorizedException
|
467
|
+
The principle specified by the user_id does not have authorization for the requested action
|
468
|
+
"""
|
454
469
|
loop = asyncio.get_event_loop()
|
455
470
|
response = loop.run_until_complete(self._async_is_server_known(server))
|
456
471
|
return response
|
457
472
|
|
458
473
|
async def _async_is_server_configured(self, server: str = None) -> bool:
|
459
|
-
"""
|
474
|
+
"""is a server known and configured? Async version.
|
460
475
|
Parameters
|
461
476
|
----------
|
462
477
|
server : str, optional
|
463
|
-
The name of the server to check if configured. If not specified, the server name stored in
|
478
|
+
The name of the server to check if configured. If not specified, the server name stored in
|
479
|
+
`self.view_server` will be used.
|
464
480
|
|
465
481
|
Returns
|
466
482
|
-------
|
@@ -471,23 +487,20 @@ class Platform(Client):
|
|
471
487
|
server = self.server_name
|
472
488
|
url = f"{self.platform_url}/open-metadata/admin-services/users/{self.user_id}/servers/{server}/configuration"
|
473
489
|
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
return True
|
480
|
-
else: return False
|
481
|
-
|
482
|
-
except InvalidParameterException as e:
|
490
|
+
response = await self._async_make_request("GET", url)
|
491
|
+
config = response.json().get("omagserverConfig", "No configuration found")
|
492
|
+
if "auditTrail" in config:
|
493
|
+
return True
|
494
|
+
else:
|
483
495
|
return False
|
484
496
|
|
485
497
|
def is_server_configured(self, server: str = None) -> bool:
|
486
|
-
"""
|
498
|
+
"""is a server known and configured?
|
487
499
|
Parameters
|
488
500
|
----------
|
489
501
|
server : str, optional
|
490
|
-
The name of the server to check if configured. If not specified,
|
502
|
+
The name of the server to check if configured. If not specified,
|
503
|
+
the server name stored in `self.view_server` will be used.
|
491
504
|
|
492
505
|
Returns
|
493
506
|
-------
|
@@ -499,8 +512,8 @@ class Platform(Client):
|
|
499
512
|
return response
|
500
513
|
|
501
514
|
async def _async_get_active_configuration(self, server: str = None) -> dict | str:
|
502
|
-
"""
|
503
|
-
|
515
|
+
"""Return the configuration of the server if it is running. Return invalidParameter Exception if not running.
|
516
|
+
Async version.
|
504
517
|
|
505
518
|
Parameters
|
506
519
|
----------
|
@@ -524,8 +537,7 @@ class Platform(Client):
|
|
524
537
|
return response.json().get("omagserverConfig", "No active configuration found")
|
525
538
|
|
526
539
|
def get_active_configuration(self, server: str = None) -> dict | str:
|
527
|
-
"""
|
528
|
-
Return the configuration of the server if it is running. Return invalidParameter Exception if not running.
|
540
|
+
"""Return the configuration of the server if it is running. Return invalidParameter Exception if not running.
|
529
541
|
|
530
542
|
Parameters
|
531
543
|
----------
|
@@ -541,7 +553,7 @@ class Platform(Client):
|
|
541
553
|
return response
|
542
554
|
|
543
555
|
async def _async_check_server_active(self, server: str = None):
|
544
|
-
"""
|
556
|
+
"""Get status of the server specified. Async version.
|
545
557
|
|
546
558
|
Parameters
|
547
559
|
----------
|
@@ -561,7 +573,7 @@ class Platform(Client):
|
|
561
573
|
return response.json().get("active")
|
562
574
|
|
563
575
|
def check_server_active(self, server: str = None):
|
564
|
-
"""
|
576
|
+
"""Get status of the server specified.
|
565
577
|
|
566
578
|
Parameters
|
567
579
|
----------
|
@@ -599,7 +611,7 @@ class Platform(Client):
|
|
599
611
|
url = self.admin_command_root + "/servers/active"
|
600
612
|
|
601
613
|
response = await self._async_make_request("GET", url)
|
602
|
-
return response.json().get(
|
614
|
+
return response.json().get("serverList", "No servers active")
|
603
615
|
|
604
616
|
def get_active_server_list(self) -> list:
|
605
617
|
"""
|
@@ -626,7 +638,7 @@ class Platform(Client):
|
|
626
638
|
return response
|
627
639
|
|
628
640
|
async def _async_shutdown_platform(self) -> None:
|
629
|
-
"""
|
641
|
+
"""Shutdown the platform. Async version.
|
630
642
|
|
631
643
|
An exception is thrown if a problem occurs during the request.
|
632
644
|
|
@@ -652,7 +664,7 @@ class Platform(Client):
|
|
652
664
|
await self._async_make_request("DELETE", url)
|
653
665
|
|
654
666
|
def shutdown_platform(self) -> None:
|
655
|
-
"""
|
667
|
+
"""Shutdown the platform.
|
656
668
|
|
657
669
|
An exception is thrown if a problem occurs during the request.
|
658
670
|
|
@@ -676,7 +688,7 @@ class Platform(Client):
|
|
676
688
|
loop.run_until_complete(self._async_shutdown_platform())
|
677
689
|
|
678
690
|
async def _async_shutdown_server(self, server: str = None) -> None:
|
679
|
-
"""
|
691
|
+
"""Shutdown a server on the associated platform. Async version.
|
680
692
|
|
681
693
|
Parameters
|
682
694
|
----------
|
@@ -702,7 +714,7 @@ class Platform(Client):
|
|
702
714
|
await self._async_make_request("DELETE", url)
|
703
715
|
|
704
716
|
def shutdown_server(self, server: str = None) -> None:
|
705
|
-
"""
|
717
|
+
"""Shutdown a server on the associated platform.
|
706
718
|
|
707
719
|
Parameters
|
708
720
|
----------
|
@@ -823,8 +835,10 @@ class Platform(Client):
|
|
823
835
|
loop = asyncio.get_event_loop()
|
824
836
|
loop.run_until_complete(self._async_shutdown_all_servers())
|
825
837
|
|
826
|
-
async def _async_activate_server_if_down(
|
827
|
-
|
838
|
+
async def _async_activate_server_if_down(
|
839
|
+
self, server: str, verbose: bool = True, timeout: int = 60
|
840
|
+
) -> bool:
|
841
|
+
"""Activate server if it is down. Async version.
|
828
842
|
|
829
843
|
Parameters
|
830
844
|
----------
|
@@ -874,13 +888,19 @@ class Platform(Client):
|
|
874
888
|
print(f" OMAG Server {server} needs to be configured")
|
875
889
|
return False
|
876
890
|
|
877
|
-
except (
|
891
|
+
except (
|
892
|
+
InvalidParameterException,
|
893
|
+
PropertyServerException,
|
894
|
+
UserNotAuthorizedException,
|
895
|
+
) as e:
|
878
896
|
if verbose:
|
879
897
|
print_exception_response(e)
|
880
|
-
raise
|
898
|
+
raise e
|
881
899
|
|
882
|
-
def activate_server_if_down(
|
883
|
-
|
900
|
+
def activate_server_if_down(
|
901
|
+
self, server: str, verbose: bool = True, timeout: int = 60
|
902
|
+
) -> bool:
|
903
|
+
"""Activate server if it is down.
|
884
904
|
|
885
905
|
Parameters
|
886
906
|
----------
|
@@ -905,11 +925,15 @@ class Platform(Client):
|
|
905
925
|
The principle specified by the user_id does not have authorization for the requested action
|
906
926
|
"""
|
907
927
|
loop = asyncio.get_event_loop()
|
908
|
-
response = loop.run_until_complete(
|
928
|
+
response = loop.run_until_complete(
|
929
|
+
self._async_activate_server_if_down(server, verbose, timeout)
|
930
|
+
)
|
909
931
|
return response
|
910
932
|
|
911
|
-
async def _async_activate_servers_on_platform(
|
912
|
-
|
933
|
+
async def _async_activate_servers_on_platform(
|
934
|
+
self, server_list: [str], verbose=False, timeout: int = 60
|
935
|
+
) -> bool:
|
936
|
+
"""Activate the servers from the list provided. Async version.
|
913
937
|
Parameters
|
914
938
|
----------
|
915
939
|
server_list : str
|
@@ -959,8 +983,10 @@ class Platform(Client):
|
|
959
983
|
print(f"\t\tServer list empty")
|
960
984
|
return False
|
961
985
|
|
962
|
-
def activate_servers_on_platform(
|
963
|
-
|
986
|
+
def activate_servers_on_platform(
|
987
|
+
self, server_list: [str], verbose=False, timeout: int = 60
|
988
|
+
) -> bool:
|
989
|
+
"""Activate the servers from the list provided.
|
964
990
|
Parameters
|
965
991
|
----------
|
966
992
|
server_list : str
|
@@ -992,11 +1018,17 @@ class Platform(Client):
|
|
992
1018
|
is successfully activated, otherwise it returns False.
|
993
1019
|
"""
|
994
1020
|
loop = asyncio.get_event_loop()
|
995
|
-
response = loop.run_until_complete(
|
1021
|
+
response = loop.run_until_complete(
|
1022
|
+
self._async_activate_servers_on_platform(
|
1023
|
+
server_list, verbose, timeout=timeout
|
1024
|
+
)
|
1025
|
+
)
|
996
1026
|
return response
|
997
1027
|
|
998
|
-
async def _async_activate_platform(
|
999
|
-
|
1028
|
+
async def _async_activate_platform(
|
1029
|
+
self, platform_name: str, hosted_server_names: [str], timeout: int = 60
|
1030
|
+
) -> None:
|
1031
|
+
"""Activate an OMAG Server Platform and start the servers requested. Async version.
|
1000
1032
|
|
1001
1033
|
Parameters
|
1002
1034
|
----------
|
@@ -1019,32 +1051,41 @@ class Platform(Client):
|
|
1019
1051
|
|
1020
1052
|
Notes
|
1021
1053
|
-----
|
1022
|
-
This method attempts to activate a platform by checking its status. If the platform is already active and
|
1023
|
-
|
1024
|
-
|
1054
|
+
This method attempts to activate a platform by checking its status. If the platform is already active and
|
1055
|
+
running, it prints a message indicating so and activates any hosted servers
|
1056
|
+
that are down. If the platform is not active, it prints a message indicating so. If there is any exception
|
1057
|
+
while activating the platform or starting the servers, it prints an error message and the exception response.
|
1025
1058
|
"""
|
1026
1059
|
try:
|
1027
1060
|
status = self.get_platform_origin()
|
1028
1061
|
if status:
|
1029
|
-
print(
|
1030
|
-
|
1062
|
+
print(
|
1063
|
+
f"\n\n\t Platform {platform_name} is active and running: \n\t\t{status}"
|
1064
|
+
)
|
1065
|
+
print(
|
1066
|
+
f"\tWill start the following servers if configured: {hosted_server_names}"
|
1067
|
+
)
|
1031
1068
|
for server in hosted_server_names:
|
1032
|
-
activated = await self._async_activate_server_if_down(
|
1069
|
+
activated = await self._async_activate_server_if_down(
|
1070
|
+
server, timeout=timeout
|
1071
|
+
)
|
1033
1072
|
if activated:
|
1034
1073
|
print(f"\t Started server: {server}")
|
1035
1074
|
return
|
1036
1075
|
else:
|
1037
1076
|
print(f" {platform_name}, is down - start it before proceeding")
|
1038
1077
|
except (
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1078
|
+
InvalidParameterException,
|
1079
|
+
PropertyServerException,
|
1080
|
+
UserNotAuthorizedException,
|
1042
1081
|
) as e:
|
1043
1082
|
print(f" {platform_name}, is down - start it before proceeding")
|
1044
1083
|
print_exception_response(e)
|
1045
1084
|
|
1046
|
-
def activate_platform(
|
1047
|
-
|
1085
|
+
def activate_platform(
|
1086
|
+
self, platform_name: str, hosted_server_names: [str], timeout: int = 60
|
1087
|
+
) -> None:
|
1088
|
+
"""Activate an OMAG Server Platform and start the servers requested
|
1048
1089
|
|
1049
1090
|
Parameters
|
1050
1091
|
----------
|
@@ -1067,16 +1108,16 @@ class Platform(Client):
|
|
1067
1108
|
|
1068
1109
|
Notes
|
1069
1110
|
-----
|
1070
|
-
This method attempts to activate a platform by checking its status. If the platform is already active and
|
1071
|
-
|
1072
|
-
|
1111
|
+
This method attempts to activate a platform by checking its status. If the platform is already active and
|
1112
|
+
running, it prints a message indicating so and activates any hosted servers
|
1113
|
+
that are down. If the platform is not active, it prints a message indicating so. If there is any exception
|
1114
|
+
while activating the platform or starting the servers, it prints an error message and the exception response.
|
1073
1115
|
"""
|
1074
1116
|
loop = asyncio.get_event_loop()
|
1075
|
-
loop.run_until_complete(
|
1117
|
+
loop.run_until_complete(
|
1118
|
+
self._async_activate_platform(platform_name, hosted_server_names, timeout)
|
1119
|
+
)
|
1076
1120
|
|
1077
1121
|
|
1078
1122
|
if __name__ == "__main__":
|
1079
|
-
|
1080
|
-
response = p.get_known_servers()
|
1081
|
-
|
1082
|
-
print(response)
|
1123
|
+
print("Main-Platform Services")
|