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,3760 @@
|
|
1
|
+
"""
|
2
|
+
SPDX-License-Identifier: Apache-2.0
|
3
|
+
Copyright Contributors to the ODPi Egeria project.
|
4
|
+
|
5
|
+
Automated Curation View Service Methods
|
6
|
+
|
7
|
+
"""
|
8
|
+
import asyncio
|
9
|
+
import datetime
|
10
|
+
|
11
|
+
from httpx import Response
|
12
|
+
|
13
|
+
from pyegeria import Client, max_paging_size, body_slimmer, TEMPLATE_GUIDS
|
14
|
+
from pyegeria._exceptions import (
|
15
|
+
InvalidParameterException,
|
16
|
+
PropertyServerException,
|
17
|
+
UserNotAuthorizedException,
|
18
|
+
)
|
19
|
+
from ._validators import validate_name, validate_guid, validate_search_string
|
20
|
+
|
21
|
+
|
22
|
+
class AutomatedCuration(Client):
|
23
|
+
"""Set up and maintain automation services in Egeria.
|
24
|
+
|
25
|
+
Attributes:
|
26
|
+
view_server : str
|
27
|
+
The name of the View Server to use.
|
28
|
+
platform_url : str
|
29
|
+
URL of the server platform to connect to
|
30
|
+
user_id : str
|
31
|
+
The identity of the user calling the method - this sets a default optionally used by the methods
|
32
|
+
when the user doesn't pass the user_id on a method call.
|
33
|
+
user_pwd: str
|
34
|
+
The password associated with the user_id. Defaults to None
|
35
|
+
|
36
|
+
|
37
|
+
"""
|
38
|
+
|
39
|
+
def __init__(
|
40
|
+
self,
|
41
|
+
view_server: str,
|
42
|
+
platform_url: str,
|
43
|
+
user_id: str,
|
44
|
+
user_pwd: str = None,
|
45
|
+
token: str = None,
|
46
|
+
):
|
47
|
+
self.view_server = view_server
|
48
|
+
self.platform_url = platform_url
|
49
|
+
self.user_id = user_id
|
50
|
+
self.user_pwd = user_pwd
|
51
|
+
Client.__init__(self, view_server, platform_url, user_id, user_pwd, token=token)
|
52
|
+
self.curation_command_root = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/automated-curation"
|
53
|
+
|
54
|
+
async def _async_create_element_from_template(self, body: dict) -> str:
|
55
|
+
"""Create a new metadata element from a template. Async version.
|
56
|
+
Parameters
|
57
|
+
----------
|
58
|
+
body : str
|
59
|
+
The json body used to instantiate the template.
|
60
|
+
|
61
|
+
Returns
|
62
|
+
-------
|
63
|
+
Response
|
64
|
+
The guid of the resulting element
|
65
|
+
|
66
|
+
Raises
|
67
|
+
------
|
68
|
+
InvalidParameterException
|
69
|
+
PropertyServerException
|
70
|
+
UserNotAuthorizedException
|
71
|
+
|
72
|
+
Notes
|
73
|
+
-----
|
74
|
+
See also: https://egeria-project.org/features/templated-cataloguing/overview/
|
75
|
+
The full description of the body is shown below:
|
76
|
+
{
|
77
|
+
"typeName" : "",
|
78
|
+
"initialStatus" : "",
|
79
|
+
"initialClassifications" : "",
|
80
|
+
"anchorGUID" : "",
|
81
|
+
"isOwnAnchor" : "",
|
82
|
+
"effectiveFrom" : "",
|
83
|
+
"effectiveTo" : "",
|
84
|
+
"templateGUID" : "",
|
85
|
+
"templateProperties" : {},
|
86
|
+
"placeholderPropertyValues" : {
|
87
|
+
"placeholderPropertyName1" : "placeholderPropertyValue1",
|
88
|
+
"placeholderPropertyName2" : "placeholderPropertyValue2"
|
89
|
+
},
|
90
|
+
"parentGUID" : "",
|
91
|
+
"parentRelationshipTypeName" : "",
|
92
|
+
"parentRelationshipProperties" : "",
|
93
|
+
"parentAtEnd1" : "",
|
94
|
+
"effectiveTime" : ""
|
95
|
+
}
|
96
|
+
"""
|
97
|
+
|
98
|
+
url = f"{self.curation_command_root}/catalog-templates/new-element"
|
99
|
+
response = await self._async_make_request("POST", url, body)
|
100
|
+
return response.json().get("guid", "GUID failed to be returned")
|
101
|
+
|
102
|
+
def create_element_from_template(self, body: dict) -> str:
|
103
|
+
"""Create a new metadata element from a template. Async version.
|
104
|
+
Parameters
|
105
|
+
----------
|
106
|
+
body : str
|
107
|
+
The json body used to instantiate the template.
|
108
|
+
|
109
|
+
|
110
|
+
Returns
|
111
|
+
-------
|
112
|
+
Response
|
113
|
+
The guid of the resulting element
|
114
|
+
|
115
|
+
Raises
|
116
|
+
------
|
117
|
+
InvalidParameterException
|
118
|
+
PropertyServerException
|
119
|
+
UserNotAuthorizedException
|
120
|
+
|
121
|
+
Notes
|
122
|
+
-----
|
123
|
+
See also: https://egeria-project.org/features/templated-cataloguing/overview/
|
124
|
+
The full description of the body is shown below:
|
125
|
+
{
|
126
|
+
"typeName" : "",
|
127
|
+
"initialStatus" : "",
|
128
|
+
"initialClassifications" : "",
|
129
|
+
"anchorGUID" : "",
|
130
|
+
"isOwnAnchor" : "",
|
131
|
+
"effectiveFrom" : "",
|
132
|
+
"effectiveTo" : "",
|
133
|
+
"templateGUID" : "",
|
134
|
+
"templateProperties" : {},
|
135
|
+
"placeholderPropertyValues" : {
|
136
|
+
"placeholderPropertyName1" : "placeholderPropertyValue1",
|
137
|
+
"placeholderPropertyName2" : "placeholderPropertyValue2"
|
138
|
+
},
|
139
|
+
"parentGUID" : "",
|
140
|
+
"parentRelationshipTypeName" : "",
|
141
|
+
"parentRelationshipProperties" : "",
|
142
|
+
"parentAtEnd1" : "",
|
143
|
+
"effectiveTime" : ""
|
144
|
+
}
|
145
|
+
"""
|
146
|
+
loop = asyncio.get_event_loop()
|
147
|
+
response = loop.run_until_complete(
|
148
|
+
self._async_create_element_from_template(body)
|
149
|
+
)
|
150
|
+
return response
|
151
|
+
|
152
|
+
async def _async_create_kafka_server_element_from_template(
|
153
|
+
self,
|
154
|
+
kafka_server: str,
|
155
|
+
host_name: str,
|
156
|
+
port: str,
|
157
|
+
description: str = None,
|
158
|
+
) -> str:
|
159
|
+
"""Create a Kafka server element from a template. Async version.
|
160
|
+
|
161
|
+
Parameters
|
162
|
+
----------
|
163
|
+
kafka_server : str
|
164
|
+
The name of the Kafka server.
|
165
|
+
|
166
|
+
host_name : str
|
167
|
+
The host name of the Kafka server.
|
168
|
+
|
169
|
+
port : str
|
170
|
+
The port number of the Kafka server.
|
171
|
+
|
172
|
+
description: str, opt
|
173
|
+
A description of the Kafka server.
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
Returns
|
178
|
+
-------
|
179
|
+
str
|
180
|
+
The GUID of the Kafka server element.
|
181
|
+
"""
|
182
|
+
|
183
|
+
body = {
|
184
|
+
"templateGUID": TEMPLATE_GUIDS["Apache Kafka Server"],
|
185
|
+
"isOwnAnchor": "true",
|
186
|
+
"placeholderPropertyValues": {
|
187
|
+
"serverName": kafka_server,
|
188
|
+
"hostIdentifier": host_name,
|
189
|
+
"portNumber": port,
|
190
|
+
"description": description,
|
191
|
+
},
|
192
|
+
}
|
193
|
+
body_s = body_slimmer(body)
|
194
|
+
response = await self._async_create_element_from_template(body_s)
|
195
|
+
return str(response)
|
196
|
+
|
197
|
+
def create_kafka_server_element_from_template(
|
198
|
+
self,
|
199
|
+
kafka_server: str,
|
200
|
+
host_name: str,
|
201
|
+
port: str,
|
202
|
+
description: str = None,
|
203
|
+
) -> str:
|
204
|
+
"""Create a Kafka server element from a template.
|
205
|
+
|
206
|
+
Parameters
|
207
|
+
----------
|
208
|
+
kafka_server : str
|
209
|
+
The name of the Kafka server.
|
210
|
+
|
211
|
+
host_name : str
|
212
|
+
The host name of the Kafka server.
|
213
|
+
|
214
|
+
port : str
|
215
|
+
The port number of the Kafka server.
|
216
|
+
|
217
|
+
description: str, opt
|
218
|
+
A description of the Kafka server.
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
Returns
|
223
|
+
-------
|
224
|
+
str
|
225
|
+
The GUID of the Kafka server element.
|
226
|
+
"""
|
227
|
+
loop = asyncio.get_event_loop()
|
228
|
+
response = loop.run_until_complete(
|
229
|
+
self._async_create_kafka_server_element_from_template(
|
230
|
+
kafka_server, host_name, port, description
|
231
|
+
)
|
232
|
+
)
|
233
|
+
return response
|
234
|
+
|
235
|
+
async def _async_create_postgres_server_element_from_template(
|
236
|
+
self,
|
237
|
+
postgres_server: str,
|
238
|
+
host_name: str,
|
239
|
+
port: str,
|
240
|
+
db_user: str,
|
241
|
+
db_pwd: str,
|
242
|
+
description: str = None,
|
243
|
+
) -> str:
|
244
|
+
"""Create a Postgres server element from a template. Async version.
|
245
|
+
|
246
|
+
Parameters
|
247
|
+
----------
|
248
|
+
postgres_server : str
|
249
|
+
The name of the Postgres server.
|
250
|
+
|
251
|
+
host_name : str
|
252
|
+
The host name of the Postgres server.
|
253
|
+
|
254
|
+
port : str
|
255
|
+
The port number of the Postgres server.
|
256
|
+
|
257
|
+
db_user: str
|
258
|
+
User name to connect to the database
|
259
|
+
|
260
|
+
db_pwd: str
|
261
|
+
User password to connect to the database
|
262
|
+
|
263
|
+
description: str, opt
|
264
|
+
A description of the element.
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
Returns
|
269
|
+
-------
|
270
|
+
str
|
271
|
+
The GUID of the Postgres server element.
|
272
|
+
"""
|
273
|
+
body = {
|
274
|
+
"templateGUID": TEMPLATE_GUIDS["PostgreSQL Server"],
|
275
|
+
"isOwnAnchor": "true",
|
276
|
+
"placeholderPropertyValues": {
|
277
|
+
"serverName": postgres_server,
|
278
|
+
"hostIdentifier": host_name,
|
279
|
+
"portNumber": port,
|
280
|
+
"databaseUserId": db_user,
|
281
|
+
"description": description,
|
282
|
+
"databasePassword": db_pwd,
|
283
|
+
},
|
284
|
+
}
|
285
|
+
body_s = body_slimmer(body)
|
286
|
+
response = await self._async_create_element_from_template(body_s)
|
287
|
+
return str(response)
|
288
|
+
|
289
|
+
def create_postgres_server_element_from_template(
|
290
|
+
self,
|
291
|
+
postgres_server: str,
|
292
|
+
host_name: str,
|
293
|
+
port: str,
|
294
|
+
db_user: str,
|
295
|
+
db_pwd: str,
|
296
|
+
description: str = None,
|
297
|
+
) -> str:
|
298
|
+
"""Create a Postgres server element from a template.
|
299
|
+
|
300
|
+
Parameters
|
301
|
+
----------
|
302
|
+
postgres_server : str
|
303
|
+
The name of the Postgres server.
|
304
|
+
|
305
|
+
host_name : str
|
306
|
+
The host name of the Postgres server.
|
307
|
+
|
308
|
+
port : str
|
309
|
+
The port number of the Postgres server.
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
description: str, opt
|
314
|
+
A description of the elementr.
|
315
|
+
|
316
|
+
db_user: str
|
317
|
+
User name to connect to the database
|
318
|
+
|
319
|
+
db_pwd: str
|
320
|
+
User password to connect to the database
|
321
|
+
|
322
|
+
Returns
|
323
|
+
-------
|
324
|
+
str
|
325
|
+
The GUID of the Postgres server element.
|
326
|
+
"""
|
327
|
+
loop = asyncio.get_event_loop()
|
328
|
+
response = loop.run_until_complete(
|
329
|
+
self._async_create_postgres_server_element_from_template(
|
330
|
+
postgres_server, host_name, port, db_user, db_pwd, description
|
331
|
+
)
|
332
|
+
)
|
333
|
+
return response
|
334
|
+
|
335
|
+
async def _async_create_postgres_database_element_from_template(
|
336
|
+
self,
|
337
|
+
postgres_database: str,
|
338
|
+
server_name: str,
|
339
|
+
host_identifier: str,
|
340
|
+
port: str,
|
341
|
+
db_user: str,
|
342
|
+
db_pwd: str,
|
343
|
+
description: str = None,
|
344
|
+
) -> str:
|
345
|
+
"""Create a Postgres database element from a template. Async version.
|
346
|
+
|
347
|
+
Parameters
|
348
|
+
----------
|
349
|
+
postgres_database : str
|
350
|
+
The name of the Postgres database.
|
351
|
+
server_name : str
|
352
|
+
The server name of the Postgres server.
|
353
|
+
host_identifier: str
|
354
|
+
The host IP address or domain name.
|
355
|
+
port : str
|
356
|
+
The port number of the Postgres server.
|
357
|
+
db_user: str
|
358
|
+
User name to connect to the database
|
359
|
+
db_pwd: str
|
360
|
+
User password to connect to the database
|
361
|
+
description: str, opt
|
362
|
+
A description of the element.
|
363
|
+
|
364
|
+
Returns
|
365
|
+
-------
|
366
|
+
str
|
367
|
+
The GUID of the Postgres database element.
|
368
|
+
"""
|
369
|
+
body = {
|
370
|
+
"templateGUID": TEMPLATE_GUIDS["PostgreSQL Relational Database"],
|
371
|
+
"isOwnAnchor": "true",
|
372
|
+
"placeholderPropertyValues": {
|
373
|
+
"databaseName": postgres_database,
|
374
|
+
"serverName": server_name,
|
375
|
+
"hostIdentifier": host_identifier,
|
376
|
+
"portNumber": port,
|
377
|
+
"databaseUserId": db_user,
|
378
|
+
"description": description,
|
379
|
+
"databasePassword": db_pwd,
|
380
|
+
},
|
381
|
+
}
|
382
|
+
body_s = body_slimmer(body)
|
383
|
+
response = await self._async_create_element_from_template(body_s)
|
384
|
+
return str(response)
|
385
|
+
|
386
|
+
def create_postgres_database_element_from_template(
|
387
|
+
self,
|
388
|
+
postgres_database: str,
|
389
|
+
server_name: str,
|
390
|
+
host_identifier: str,
|
391
|
+
port: str,
|
392
|
+
db_user: str,
|
393
|
+
db_pwd: str,
|
394
|
+
description: str = None,
|
395
|
+
) -> str:
|
396
|
+
"""Create a Postgres database element from a template. Async version.
|
397
|
+
|
398
|
+
Parameters
|
399
|
+
----------
|
400
|
+
postgres_database : str
|
401
|
+
The name of the Postgres database.
|
402
|
+
server_name : str
|
403
|
+
The server name of the Postgres server.
|
404
|
+
host_identifier: str
|
405
|
+
The host IP address or domain name.
|
406
|
+
port : str
|
407
|
+
The port number of the Postgres server.
|
408
|
+
db_user: str
|
409
|
+
User name to connect to the database
|
410
|
+
db_pwd: str
|
411
|
+
User password to connect to the database
|
412
|
+
description: str, opt
|
413
|
+
A description of the element.
|
414
|
+
|
415
|
+
Returns
|
416
|
+
-------
|
417
|
+
str
|
418
|
+
The GUID of the Postgres database element.
|
419
|
+
"""
|
420
|
+
loop = asyncio.get_event_loop()
|
421
|
+
response = loop.run_until_complete(
|
422
|
+
self._async_create_postgres_database_element_from_template(
|
423
|
+
postgres_database,
|
424
|
+
server_name,
|
425
|
+
host_identifier,
|
426
|
+
port,
|
427
|
+
db_user,
|
428
|
+
db_pwd,
|
429
|
+
description,
|
430
|
+
)
|
431
|
+
)
|
432
|
+
return response
|
433
|
+
|
434
|
+
async def _async_create_folder_element_from_template(
|
435
|
+
self,
|
436
|
+
path_name: str,
|
437
|
+
folder_name: str,
|
438
|
+
file_system: str,
|
439
|
+
description: str = None,
|
440
|
+
version: str = None,
|
441
|
+
) -> str:
|
442
|
+
"""Create a File folder element from a template.
|
443
|
+
Async version.
|
444
|
+
|
445
|
+
Parameters
|
446
|
+
----------
|
447
|
+
path_name : str
|
448
|
+
The path including the folder..
|
449
|
+
|
450
|
+
folder_name : str
|
451
|
+
The name of the folder to create.
|
452
|
+
|
453
|
+
file_system : str
|
454
|
+
The unique name for the file system that the folder belongs to. It may be a machine name or URL to a
|
455
|
+
remote file store.
|
456
|
+
|
457
|
+
description: str, opt
|
458
|
+
A description of the element.
|
459
|
+
|
460
|
+
version: str, opt
|
461
|
+
version of the element - typically of the form x.y.z
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
Returns
|
466
|
+
-------
|
467
|
+
str
|
468
|
+
The GUID of the File Folder element.
|
469
|
+
"""
|
470
|
+
body = {
|
471
|
+
"templateGUID": TEMPLATE_GUIDS["File System Directory"],
|
472
|
+
"isOwnAnchor": "true",
|
473
|
+
"placeholderPropertyValues": {
|
474
|
+
"directoryPathName": path_name,
|
475
|
+
"directoryName": folder_name,
|
476
|
+
"versionIdentifier": version,
|
477
|
+
"fileSystemName": file_system,
|
478
|
+
"description": description,
|
479
|
+
},
|
480
|
+
}
|
481
|
+
body_s = body_slimmer(body)
|
482
|
+
response = await self._async_create_element_from_template(body_s)
|
483
|
+
return str(response)
|
484
|
+
|
485
|
+
def create_folder_element_from_template(
|
486
|
+
self,
|
487
|
+
path_name: str,
|
488
|
+
folder_name: str,
|
489
|
+
file_system: str,
|
490
|
+
description: str = None,
|
491
|
+
version: str = None,
|
492
|
+
) -> str:
|
493
|
+
"""Create a File folder element from a template.
|
494
|
+
|
495
|
+
Parameters
|
496
|
+
----------
|
497
|
+
path_name : str
|
498
|
+
The path including the folder..
|
499
|
+
|
500
|
+
folder_name : str
|
501
|
+
The name of the folder to create.
|
502
|
+
|
503
|
+
file_system : str
|
504
|
+
The unique name for the file system that the folder belongs to. It may be a machine name or URL to a
|
505
|
+
remote file store.
|
506
|
+
|
507
|
+
description: str, opt
|
508
|
+
A description of the element.
|
509
|
+
|
510
|
+
version: str, opt
|
511
|
+
version of the element - typically of the form x.y.z
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
Returns
|
516
|
+
-------
|
517
|
+
str
|
518
|
+
The GUID of the File Folder element.
|
519
|
+
"""
|
520
|
+
loop = asyncio.get_event_loop()
|
521
|
+
response = loop.run_until_complete(
|
522
|
+
self._async_create_folder_element_from_template(
|
523
|
+
path_name, folder_name, file_system, description, version
|
524
|
+
)
|
525
|
+
)
|
526
|
+
return response
|
527
|
+
|
528
|
+
async def _async_create_uc_server_element_from_template(
|
529
|
+
self,
|
530
|
+
server_name: str,
|
531
|
+
host_url: str,
|
532
|
+
port: str,
|
533
|
+
description: str = None,
|
534
|
+
version: str = None,
|
535
|
+
) -> str:
|
536
|
+
"""Create a Unity Catalog Server element from a template. Async version.
|
537
|
+
|
538
|
+
Parameters
|
539
|
+
----------
|
540
|
+
server_name : str
|
541
|
+
The name of the Unity Catalog server we are configuring.
|
542
|
+
|
543
|
+
host_url : str
|
544
|
+
The URL of the server.
|
545
|
+
|
546
|
+
port : str
|
547
|
+
The port number of the server.
|
548
|
+
|
549
|
+
description: str, opt
|
550
|
+
A description of the server.
|
551
|
+
|
552
|
+
version: str, opt
|
553
|
+
version of the element - typically of the form x.y.z
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
Returns
|
558
|
+
-------
|
559
|
+
str
|
560
|
+
The GUID of the File Folder element.
|
561
|
+
"""
|
562
|
+
body = {
|
563
|
+
"templateGUID": TEMPLATE_GUIDS["Unity Catalog Server"],
|
564
|
+
"isOwnAnchor": "true",
|
565
|
+
"placeholderPropertyValues": {
|
566
|
+
"serverName": server_name,
|
567
|
+
"hostURL": host_url,
|
568
|
+
"versionIdentifier": version,
|
569
|
+
"portNumber": port,
|
570
|
+
"description": description,
|
571
|
+
},
|
572
|
+
}
|
573
|
+
body_s = body_slimmer(body)
|
574
|
+
response = await self._async_create_element_from_template(body_s)
|
575
|
+
return str(response)
|
576
|
+
|
577
|
+
def create_uc_server_element_from_template(
|
578
|
+
self,
|
579
|
+
server_name: str,
|
580
|
+
host_url: str,
|
581
|
+
port: str,
|
582
|
+
description: str = None,
|
583
|
+
version: str = None,
|
584
|
+
) -> str:
|
585
|
+
"""Create a Unity Catalog Server element from a template. Async version.
|
586
|
+
|
587
|
+
Parameters
|
588
|
+
----------
|
589
|
+
server_name : str
|
590
|
+
The name of the Unity Catalog server we are configuring.
|
591
|
+
|
592
|
+
host_url : str
|
593
|
+
The URL of the server.
|
594
|
+
|
595
|
+
port : str
|
596
|
+
The port number of the server.
|
597
|
+
|
598
|
+
description: str, opt
|
599
|
+
A description of the server.
|
600
|
+
|
601
|
+
version: str, opt
|
602
|
+
version of the element - typically of the form x.y.z
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
Returns
|
607
|
+
-------
|
608
|
+
str
|
609
|
+
The GUID of the File Folder element.
|
610
|
+
"""
|
611
|
+
loop = asyncio.get_event_loop()
|
612
|
+
response = loop.run_until_complete(
|
613
|
+
self._async_create_uc_server_element_from_template(
|
614
|
+
server_name, host_url, port, description, version
|
615
|
+
)
|
616
|
+
)
|
617
|
+
return response
|
618
|
+
|
619
|
+
async def _async_create_uc_catalog_element_from_template(
|
620
|
+
self,
|
621
|
+
uc_catalog: str,
|
622
|
+
network_address: str,
|
623
|
+
description: str = None,
|
624
|
+
version: str = None,
|
625
|
+
) -> str:
|
626
|
+
"""Create a Unity Catalog Catalog element from a template. Async version.
|
627
|
+
|
628
|
+
Parameters
|
629
|
+
----------
|
630
|
+
uc_catalog : str
|
631
|
+
The name of the UC catalog we are configuring.
|
632
|
+
|
633
|
+
network_address : str
|
634
|
+
The endpoint of the catalog.
|
635
|
+
|
636
|
+
description: str, opt
|
637
|
+
A description of the server.
|
638
|
+
|
639
|
+
version: str, opt
|
640
|
+
version of the element - typically of the form x.y.z
|
641
|
+
|
642
|
+
|
643
|
+
|
644
|
+
Returns
|
645
|
+
-------
|
646
|
+
str
|
647
|
+
The GUID of the File Folder element.
|
648
|
+
"""
|
649
|
+
body = {
|
650
|
+
"templateGUID": TEMPLATE_GUIDS["Unity Catalog Catalog"],
|
651
|
+
"isOwnAnchor": "true",
|
652
|
+
"placeholderPropertyValues": {
|
653
|
+
"ucCatalogName": uc_catalog,
|
654
|
+
"serverNetworkAddress": network_address,
|
655
|
+
"versionIdentifier": version,
|
656
|
+
"description": description,
|
657
|
+
},
|
658
|
+
}
|
659
|
+
body_s = body_slimmer(body)
|
660
|
+
response = await self._async_create_element_from_template(body_s)
|
661
|
+
return str(response)
|
662
|
+
|
663
|
+
def create_uc_catalog_element_from_template(
|
664
|
+
self,
|
665
|
+
uc_catalog: str,
|
666
|
+
network_address: str,
|
667
|
+
description: str = None,
|
668
|
+
version: str = None,
|
669
|
+
) -> str:
|
670
|
+
"""Create a Unity Catalog Catalog element from a template.
|
671
|
+
|
672
|
+
Parameters
|
673
|
+
----------
|
674
|
+
uc_catalog : str
|
675
|
+
The name of the UC catalog we are configuring.
|
676
|
+
|
677
|
+
network_address : str
|
678
|
+
The endpoint of the catalog.
|
679
|
+
|
680
|
+
description: str, opt
|
681
|
+
A description of the server.
|
682
|
+
|
683
|
+
version: str, opt
|
684
|
+
version of the element - typically of the form x.y.z
|
685
|
+
|
686
|
+
|
687
|
+
|
688
|
+
Returns
|
689
|
+
-------
|
690
|
+
str
|
691
|
+
The GUID of the File Folder element.
|
692
|
+
"""
|
693
|
+
loop = asyncio.get_event_loop()
|
694
|
+
response = loop.run_until_complete(
|
695
|
+
self._async_create_uc_catalog_element_from_template(
|
696
|
+
uc_catalog, network_address, description, version
|
697
|
+
)
|
698
|
+
)
|
699
|
+
return response
|
700
|
+
|
701
|
+
async def _async_create_uc_schema_element_from_template(
|
702
|
+
self,
|
703
|
+
uc_catalog: str,
|
704
|
+
uc_schema: str,
|
705
|
+
network_address: str,
|
706
|
+
description: str = None,
|
707
|
+
version: str = None,
|
708
|
+
) -> str:
|
709
|
+
"""Create a Unity Catalog schema element from a template. Async version.
|
710
|
+
|
711
|
+
Parameters
|
712
|
+
----------
|
713
|
+
uc_catalog : str
|
714
|
+
The name of the UC catalog we are configuring.
|
715
|
+
|
716
|
+
uc_schema: str
|
717
|
+
The name of the UC schema we are configuring.
|
718
|
+
|
719
|
+
network_address : str
|
720
|
+
The endpoint of the catalog.
|
721
|
+
|
722
|
+
description: str, opt
|
723
|
+
A description of the server.
|
724
|
+
|
725
|
+
version: str, opt
|
726
|
+
version of the element - typically of the form x.y.z
|
727
|
+
|
728
|
+
|
729
|
+
|
730
|
+
Returns
|
731
|
+
-------
|
732
|
+
str
|
733
|
+
The GUID of the File Folder element.
|
734
|
+
"""
|
735
|
+
body = {
|
736
|
+
"templateGUID": TEMPLATE_GUIDS["Unity Catalog Schema"],
|
737
|
+
"isOwnAnchor": "true",
|
738
|
+
"placeholderPropertyValues": {
|
739
|
+
"ucCatalogName": uc_catalog,
|
740
|
+
"ucSchemaName": uc_schema,
|
741
|
+
"serverNetworkAddress": network_address,
|
742
|
+
"versionIdentifier": version,
|
743
|
+
"description": description,
|
744
|
+
},
|
745
|
+
}
|
746
|
+
body_s = body_slimmer(body)
|
747
|
+
response = await self._async_create_element_from_template(body_s)
|
748
|
+
return str(response)
|
749
|
+
|
750
|
+
def create_uc_schema_element_from_template(
|
751
|
+
self,
|
752
|
+
uc_catalog: str,
|
753
|
+
uc_schema: str,
|
754
|
+
network_address: str,
|
755
|
+
description: str = None,
|
756
|
+
version: str = None,
|
757
|
+
) -> str:
|
758
|
+
"""Create a Unity Catalog schema element from a template. Async version.
|
759
|
+
|
760
|
+
Parameters
|
761
|
+
----------
|
762
|
+
uc_catalog : str
|
763
|
+
The name of the UC catalog we are configuring.
|
764
|
+
|
765
|
+
uc_schema: str
|
766
|
+
The name of the UC schema we are configuring.
|
767
|
+
|
768
|
+
network_address : str
|
769
|
+
The endpoint of the catalog.
|
770
|
+
|
771
|
+
description: str, opt
|
772
|
+
A description of the server.
|
773
|
+
|
774
|
+
version: str, opt
|
775
|
+
version of the element - typically of the form x.y.z
|
776
|
+
|
777
|
+
|
778
|
+
|
779
|
+
Returns
|
780
|
+
-------
|
781
|
+
str
|
782
|
+
The GUID of the File Folder element.
|
783
|
+
"""
|
784
|
+
loop = asyncio.get_event_loop()
|
785
|
+
response = loop.run_until_complete(
|
786
|
+
self._async_create_uc_schema_element_from_template(
|
787
|
+
uc_catalog, uc_schema, network_address, description, version
|
788
|
+
)
|
789
|
+
)
|
790
|
+
return response
|
791
|
+
|
792
|
+
async def _async_create_uc_table_element_from_template(
|
793
|
+
self,
|
794
|
+
uc_catalog: str,
|
795
|
+
uc_schema: str,
|
796
|
+
uc_table: str,
|
797
|
+
uc_table_type: str,
|
798
|
+
uc_storage_loc: str,
|
799
|
+
uc_data_source_format: str,
|
800
|
+
network_address: str,
|
801
|
+
description: str = None,
|
802
|
+
version: str = None,
|
803
|
+
) -> str:
|
804
|
+
"""Create a Unity Catalog table element from a template. Async version.
|
805
|
+
|
806
|
+
Parameters
|
807
|
+
----------
|
808
|
+
uc_catalog : str
|
809
|
+
The name of the UC catalog we are configuring.
|
810
|
+
|
811
|
+
uc_schema: str
|
812
|
+
The name of the UC schema we are configuring.
|
813
|
+
|
814
|
+
uc_table: str
|
815
|
+
The name of the UC table we are configuring.
|
816
|
+
uc_table_type: str
|
817
|
+
The type of table - expect either Managed or External.
|
818
|
+
uc_storage_loc: str
|
819
|
+
The location where the data associated with this element is stored.
|
820
|
+
uc_data_source_format: str
|
821
|
+
The format of the data source - currently DELTA, CSV, JSON, AVRO, PARQUET, ORC, TEXT.
|
822
|
+
|
823
|
+
network_address : str
|
824
|
+
The endpoint of the catalog.
|
825
|
+
|
826
|
+
description: str, opt
|
827
|
+
A description of the server.
|
828
|
+
|
829
|
+
version: str, opt
|
830
|
+
version of the element - typically of the form x.y.z
|
831
|
+
|
832
|
+
|
833
|
+
|
834
|
+
Returns
|
835
|
+
-------
|
836
|
+
str
|
837
|
+
The GUID of the File Folder element.
|
838
|
+
"""
|
839
|
+
body = {
|
840
|
+
"templateGUID": TEMPLATE_GUIDS["Unity Catalog Table"],
|
841
|
+
"isOwnAnchor": "true",
|
842
|
+
"placeholderPropertyValues": {
|
843
|
+
"ucCatalogName": uc_catalog,
|
844
|
+
"ucSchemaName": uc_schema,
|
845
|
+
"ucTableName": uc_table,
|
846
|
+
"ucTableType": uc_table_type,
|
847
|
+
"ucStorageLocation": uc_storage_loc,
|
848
|
+
"ucDataSourceFormat": uc_data_source_format,
|
849
|
+
"serverNetworkAddress": network_address,
|
850
|
+
"versionIdentifier": version,
|
851
|
+
"description": description,
|
852
|
+
},
|
853
|
+
}
|
854
|
+
body_s = body_slimmer(body)
|
855
|
+
response = await self._async_create_element_from_template(body_s)
|
856
|
+
return str(response)
|
857
|
+
|
858
|
+
def create_uc_table_element_from_template(
|
859
|
+
self,
|
860
|
+
uc_catalog: str,
|
861
|
+
uc_schema: str,
|
862
|
+
uc_table: str,
|
863
|
+
uc_table_type: str,
|
864
|
+
uc_storage_loc: str,
|
865
|
+
uc_data_source_format: str,
|
866
|
+
network_address: str,
|
867
|
+
description: str = None,
|
868
|
+
version: str = None,
|
869
|
+
) -> str:
|
870
|
+
"""Create a Unity Catalog table element from a template.
|
871
|
+
|
872
|
+
Parameters
|
873
|
+
----------
|
874
|
+
uc_catalog : str
|
875
|
+
The name of the UC catalog we are configuring.
|
876
|
+
|
877
|
+
uc_schema: str
|
878
|
+
The name of the UC schema we are configuring.
|
879
|
+
|
880
|
+
uc_table: str
|
881
|
+
The name of the UC table we are configuring.
|
882
|
+
uc_table_type: str
|
883
|
+
The type of table - expect either Managed or External.
|
884
|
+
uc_storage_loc: str
|
885
|
+
The location where the data associated with this element is stored.
|
886
|
+
uc_data_source_format: str
|
887
|
+
The format of the data source - currently DELTA, CSV, JSON, AVRO, PARQUET, ORC, TEXT.
|
888
|
+
|
889
|
+
network_address : str
|
890
|
+
The endpoint of the catalog.
|
891
|
+
|
892
|
+
description: str, opt
|
893
|
+
A description of the server.
|
894
|
+
|
895
|
+
version: str, opt
|
896
|
+
version of the element - typically of the form x.y.z
|
897
|
+
|
898
|
+
|
899
|
+
|
900
|
+
Returns
|
901
|
+
-------
|
902
|
+
str
|
903
|
+
The GUID of the File Folder element.
|
904
|
+
"""
|
905
|
+
loop = asyncio.get_event_loop()
|
906
|
+
response = loop.run_until_complete(
|
907
|
+
self._async_create_uc_table_element_from_template(
|
908
|
+
uc_catalog,
|
909
|
+
uc_schema,
|
910
|
+
uc_table,
|
911
|
+
uc_table_type,
|
912
|
+
uc_storage_loc,
|
913
|
+
uc_data_source_format,
|
914
|
+
network_address,
|
915
|
+
description,
|
916
|
+
version,
|
917
|
+
)
|
918
|
+
)
|
919
|
+
return response
|
920
|
+
|
921
|
+
async def _async_create_uc_function_element_from_template(
|
922
|
+
self,
|
923
|
+
uc_catalog: str,
|
924
|
+
uc_schema: str,
|
925
|
+
uc_function: str,
|
926
|
+
network_address: str,
|
927
|
+
description: str = None,
|
928
|
+
version: str = None,
|
929
|
+
) -> str:
|
930
|
+
"""Create a Unity Catalog function element from a template. Async version.
|
931
|
+
|
932
|
+
Parameters
|
933
|
+
----------
|
934
|
+
uc_catalog : str
|
935
|
+
The name of the UC catalog we are configuring.
|
936
|
+
|
937
|
+
uc_schema: str
|
938
|
+
The name of the UC schema we are configuring.
|
939
|
+
|
940
|
+
uc_function: str
|
941
|
+
The name of the UC function we are configuring.
|
942
|
+
|
943
|
+
network_address : str
|
944
|
+
The endpoint of the catalog.
|
945
|
+
|
946
|
+
description: str, opt
|
947
|
+
A description of the server.
|
948
|
+
|
949
|
+
version: str, opt
|
950
|
+
version of the element - typically of the form x.y.z
|
951
|
+
|
952
|
+
|
953
|
+
|
954
|
+
Returns
|
955
|
+
-------
|
956
|
+
str
|
957
|
+
The GUID of the File Folder element.
|
958
|
+
"""
|
959
|
+
body = {
|
960
|
+
"templateGUID": TEMPLATE_GUIDS["Unity Catalog Function"],
|
961
|
+
"isOwnAnchor": "true",
|
962
|
+
"placeholderPropertyValues": {
|
963
|
+
"ucCatalogName": uc_catalog,
|
964
|
+
"ucSchemaName": uc_schema,
|
965
|
+
"ucFunctionName": uc_function,
|
966
|
+
"serverNetworkAddress": network_address,
|
967
|
+
"versionIdentifier": version,
|
968
|
+
"description": description,
|
969
|
+
},
|
970
|
+
}
|
971
|
+
body_s = body_slimmer(body)
|
972
|
+
response = await self._async_create_element_from_template(body_s)
|
973
|
+
return str(response)
|
974
|
+
|
975
|
+
def create_uc_function_element_from_template(
|
976
|
+
self,
|
977
|
+
uc_catalog: str,
|
978
|
+
uc_schema: str,
|
979
|
+
uc_function: str,
|
980
|
+
network_address: str,
|
981
|
+
description: str = None,
|
982
|
+
version: str = None,
|
983
|
+
) -> str:
|
984
|
+
"""Create a Unity Catalog function element from a template.
|
985
|
+
|
986
|
+
Parameters
|
987
|
+
----------
|
988
|
+
uc_catalog : str
|
989
|
+
The name of the UC catalog we are configuring.
|
990
|
+
|
991
|
+
uc_schema: str
|
992
|
+
The name of the UC schema we are configuring.
|
993
|
+
|
994
|
+
uc_function: str
|
995
|
+
The name of the UC function we are configuring.
|
996
|
+
|
997
|
+
network_address : str
|
998
|
+
The endpoint of the catalog.
|
999
|
+
|
1000
|
+
description: str, opt
|
1001
|
+
A description of the server.
|
1002
|
+
|
1003
|
+
version: str, opt
|
1004
|
+
version of the element - typically of the form x.y.z
|
1005
|
+
|
1006
|
+
|
1007
|
+
|
1008
|
+
Returns
|
1009
|
+
-------
|
1010
|
+
str
|
1011
|
+
The GUID of the File Folder element.
|
1012
|
+
"""
|
1013
|
+
loop = asyncio.get_event_loop()
|
1014
|
+
response = loop.run_until_complete(
|
1015
|
+
self._async_create_uc_function_element_from_template(
|
1016
|
+
uc_catalog,
|
1017
|
+
uc_schema,
|
1018
|
+
uc_function,
|
1019
|
+
network_address,
|
1020
|
+
description,
|
1021
|
+
version,
|
1022
|
+
)
|
1023
|
+
)
|
1024
|
+
return response
|
1025
|
+
|
1026
|
+
async def _async_create_uc_volume_element_from_template(
|
1027
|
+
self,
|
1028
|
+
uc_catalog: str,
|
1029
|
+
uc_schema: str,
|
1030
|
+
uc_volume: str,
|
1031
|
+
uc_vol_type: str,
|
1032
|
+
uc_storage_loc: str,
|
1033
|
+
network_address: str,
|
1034
|
+
description: str = None,
|
1035
|
+
version: str = None,
|
1036
|
+
) -> str:
|
1037
|
+
"""Create a Unity Catalog volume element from a template. Async version.
|
1038
|
+
|
1039
|
+
Parameters
|
1040
|
+
----------
|
1041
|
+
uc_catalog : str
|
1042
|
+
The name of the UC catalog we are configuring.
|
1043
|
+
|
1044
|
+
uc_schema: str
|
1045
|
+
The name of the UC schema we are configuring.
|
1046
|
+
|
1047
|
+
uc_volume: str
|
1048
|
+
The name of the UC volume we are configuring.
|
1049
|
+
|
1050
|
+
uc_vol_type: str
|
1051
|
+
The volume type of the UC volume we are configuring. Currently Managed or External.
|
1052
|
+
uc_storage_loc: str
|
1053
|
+
The location with the data associated with this element is stored.
|
1054
|
+
|
1055
|
+
network_address : str
|
1056
|
+
The endpoint of the catalog.
|
1057
|
+
|
1058
|
+
description: str, opt
|
1059
|
+
A description of the server.
|
1060
|
+
|
1061
|
+
version: str, opt
|
1062
|
+
version of the element - typically of the form x.y.z
|
1063
|
+
|
1064
|
+
|
1065
|
+
|
1066
|
+
Returns
|
1067
|
+
-------
|
1068
|
+
str
|
1069
|
+
The GUID of the File Folder element.
|
1070
|
+
"""
|
1071
|
+
body = {
|
1072
|
+
"templateGUID": TEMPLATE_GUIDS["Unity Catalog Volume"],
|
1073
|
+
"isOwnAnchor": "true",
|
1074
|
+
"placeholderPropertyValues": {
|
1075
|
+
"ucCatalogName": uc_catalog,
|
1076
|
+
"ucSchemaName": uc_schema,
|
1077
|
+
"ucVolumeName": uc_volume,
|
1078
|
+
"ucVolumeType": uc_vol_type,
|
1079
|
+
"ucStorageLocation": uc_storage_loc,
|
1080
|
+
"serverNetworkAddress": network_address,
|
1081
|
+
"versionIdentifier": version,
|
1082
|
+
"description": description,
|
1083
|
+
},
|
1084
|
+
}
|
1085
|
+
body_s = body_slimmer(body)
|
1086
|
+
response = await self._async_create_element_from_template(body_s)
|
1087
|
+
return str(response)
|
1088
|
+
|
1089
|
+
def create_uc_volume_element_from_template(
|
1090
|
+
self,
|
1091
|
+
uc_catalog: str,
|
1092
|
+
uc_schema: str,
|
1093
|
+
uc_volume: str,
|
1094
|
+
uc_vol_type: str,
|
1095
|
+
uc_storage_loc: str,
|
1096
|
+
network_address: str,
|
1097
|
+
description: str = None,
|
1098
|
+
version: str = None,
|
1099
|
+
) -> str:
|
1100
|
+
"""Create a Unity Catalog volume element from a template. Async version.
|
1101
|
+
|
1102
|
+
Parameters
|
1103
|
+
----------
|
1104
|
+
uc_catalog : str
|
1105
|
+
The name of the UC catalog we are configuring.
|
1106
|
+
|
1107
|
+
uc_schema: str
|
1108
|
+
The name of the UC schema we are configuring.
|
1109
|
+
|
1110
|
+
uc_volume: str
|
1111
|
+
The name of the UC volume we are configuring.
|
1112
|
+
|
1113
|
+
uc_vol_type: str
|
1114
|
+
The volume type of the UC volume we are configuring. Currently Managed or External.
|
1115
|
+
|
1116
|
+
uc_storage_loc: str
|
1117
|
+
The location with the data associated with this element is stored.
|
1118
|
+
|
1119
|
+
network_address : str
|
1120
|
+
The endpoint of the catalog.
|
1121
|
+
|
1122
|
+
description: str, opt
|
1123
|
+
A description of the server.
|
1124
|
+
|
1125
|
+
version: str, opt
|
1126
|
+
version of the element - typically of the form x.y.z
|
1127
|
+
|
1128
|
+
|
1129
|
+
|
1130
|
+
Returns
|
1131
|
+
-------
|
1132
|
+
str
|
1133
|
+
The GUID of the File Folder element.
|
1134
|
+
"""
|
1135
|
+
loop = asyncio.get_event_loop()
|
1136
|
+
response = loop.run_until_complete(
|
1137
|
+
self._async_create_uc_volume_element_from_template(
|
1138
|
+
uc_catalog,
|
1139
|
+
uc_schema,
|
1140
|
+
uc_volume,
|
1141
|
+
uc_vol_type,
|
1142
|
+
uc_storage_loc,
|
1143
|
+
network_address,
|
1144
|
+
description,
|
1145
|
+
version,
|
1146
|
+
)
|
1147
|
+
)
|
1148
|
+
return response
|
1149
|
+
|
1150
|
+
#
|
1151
|
+
# Engine Actions
|
1152
|
+
#
|
1153
|
+
async def _async_get_engine_actions(
|
1154
|
+
self, start_from: int = 0, page_size: int = max_paging_size
|
1155
|
+
) -> list:
|
1156
|
+
"""Retrieve the engine actions that are known to the server. Async version.
|
1157
|
+
Parameters
|
1158
|
+
----------
|
1159
|
+
|
1160
|
+
start_from : int, optional
|
1161
|
+
The starting index of the actions to retrieve. Default is 0.
|
1162
|
+
page_size : int, optional
|
1163
|
+
The maximum number of actions to retrieve per page. Default is the global maximum paging size.
|
1164
|
+
|
1165
|
+
Returns
|
1166
|
+
-------
|
1167
|
+
[dict]
|
1168
|
+
A list of engine action descriptions as JSON.
|
1169
|
+
|
1170
|
+
Raises
|
1171
|
+
------
|
1172
|
+
InvalidParameterException
|
1173
|
+
PropertyServerException
|
1174
|
+
UserNotAuthorizedException
|
1175
|
+
|
1176
|
+
Notes
|
1177
|
+
-----
|
1178
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
1179
|
+
"""
|
1180
|
+
|
1181
|
+
url = (
|
1182
|
+
f"{self.curation_command_root}/engine-actions?"
|
1183
|
+
f"startFrom={start_from}&pageSize={page_size}"
|
1184
|
+
)
|
1185
|
+
|
1186
|
+
response = await self._async_make_request("GET", url)
|
1187
|
+
return response.json().get("elements", "No elements")
|
1188
|
+
|
1189
|
+
def get_engine_actions(
|
1190
|
+
self, start_from: int = 0, page_size: int = max_paging_size
|
1191
|
+
) -> list:
|
1192
|
+
"""Retrieve the engine actions that are known to the server.
|
1193
|
+
Parameters
|
1194
|
+
----------
|
1195
|
+
|
1196
|
+
start_from : int, optional
|
1197
|
+
The starting index of the actions to retrieve. Default is 0.
|
1198
|
+
page_size : int, optional
|
1199
|
+
The maximum number of actions to retrieve per page. Default is the global maximum paging size.
|
1200
|
+
|
1201
|
+
Returns
|
1202
|
+
-------
|
1203
|
+
[dict]
|
1204
|
+
A list of engine action descriptions as JSON.
|
1205
|
+
|
1206
|
+
Raises
|
1207
|
+
------
|
1208
|
+
InvalidParameterException
|
1209
|
+
PropertyServerException
|
1210
|
+
UserNotAuthorizedException
|
1211
|
+
|
1212
|
+
Notes
|
1213
|
+
-----
|
1214
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
1215
|
+
"""
|
1216
|
+
loop = asyncio.get_event_loop()
|
1217
|
+
response = loop.run_until_complete(
|
1218
|
+
self._async_get_engine_actions(start_from, page_size)
|
1219
|
+
)
|
1220
|
+
return response
|
1221
|
+
|
1222
|
+
async def _async_get_engine_action(self, engine_action_guid: str) -> dict:
|
1223
|
+
"""Request the status and properties of an executing engine action request. Async version.
|
1224
|
+
Parameters
|
1225
|
+
----------
|
1226
|
+
engine_action_guid : str
|
1227
|
+
The GUID of the engine action to retrieve.
|
1228
|
+
|
1229
|
+
|
1230
|
+
|
1231
|
+
Returns
|
1232
|
+
-------
|
1233
|
+
dict
|
1234
|
+
The JSON representation of the engine action.
|
1235
|
+
|
1236
|
+
Raises
|
1237
|
+
------
|
1238
|
+
InvalidParameterException
|
1239
|
+
PropertyServerException
|
1240
|
+
UserNotAuthorizedException
|
1241
|
+
|
1242
|
+
Notes
|
1243
|
+
-----
|
1244
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
1245
|
+
"""
|
1246
|
+
|
1247
|
+
url = f"{self.curation_command_root}/engine-actions/" f"{engine_action_guid}"
|
1248
|
+
|
1249
|
+
response = await self._async_make_request("GET", url)
|
1250
|
+
return response.json().get("element", "No element found")
|
1251
|
+
|
1252
|
+
def get_engine_action(self, engine_action_guid: str) -> dict:
|
1253
|
+
"""Request the status and properties of an executing engine action request.
|
1254
|
+
Parameters
|
1255
|
+
----------
|
1256
|
+
engine_action_guid : str
|
1257
|
+
The GUID of the engine action to retrieve.
|
1258
|
+
|
1259
|
+
|
1260
|
+
|
1261
|
+
Returns
|
1262
|
+
-------
|
1263
|
+
dict
|
1264
|
+
The JSON representation of the engine action.
|
1265
|
+
|
1266
|
+
Raises
|
1267
|
+
------
|
1268
|
+
InvalidParameterException
|
1269
|
+
PropertyServerException
|
1270
|
+
UserNotAuthorizedException
|
1271
|
+
|
1272
|
+
Notes
|
1273
|
+
-----
|
1274
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
1275
|
+
"""
|
1276
|
+
loop = asyncio.get_event_loop()
|
1277
|
+
response = loop.run_until_complete(
|
1278
|
+
self._async_get_engine_action(engine_action_guid)
|
1279
|
+
)
|
1280
|
+
return response
|
1281
|
+
|
1282
|
+
async def _async_cancel_engine_action(self, engine_action_guid: str) -> None:
|
1283
|
+
"""Request that an engine action request is cancelled and any running governance service is stopped. Async Ver.
|
1284
|
+
Parameters
|
1285
|
+
----------
|
1286
|
+
engine_action_guid : str
|
1287
|
+
The GUID of the engine action to retrieve.
|
1288
|
+
|
1289
|
+
|
1290
|
+
|
1291
|
+
Returns
|
1292
|
+
-------
|
1293
|
+
dict
|
1294
|
+
The JSON representation of the engine action.
|
1295
|
+
|
1296
|
+
Raises
|
1297
|
+
------
|
1298
|
+
InvalidParameterException
|
1299
|
+
PropertyServerException
|
1300
|
+
UserNotAuthorizedException
|
1301
|
+
|
1302
|
+
Notes
|
1303
|
+
-----
|
1304
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
1305
|
+
"""
|
1306
|
+
|
1307
|
+
validate_guid(engine_action_guid)
|
1308
|
+
|
1309
|
+
url = (
|
1310
|
+
f"{self.curation_command_root}/engine-actions/"
|
1311
|
+
f"{engine_action_guid}/cancel"
|
1312
|
+
)
|
1313
|
+
|
1314
|
+
await self._async_make_request("POST", url)
|
1315
|
+
|
1316
|
+
def cancel_engine_action(self, engine_action_guid: str) -> None:
|
1317
|
+
"""Request that an engine action request is cancelled and any running governance service is stopped.
|
1318
|
+
Parameters
|
1319
|
+
----------
|
1320
|
+
engine_action_guid : str
|
1321
|
+
The GUID of the engine action to retrieve.
|
1322
|
+
|
1323
|
+
|
1324
|
+
|
1325
|
+
Returns
|
1326
|
+
-------
|
1327
|
+
dict
|
1328
|
+
The JSON representation of the engine action.
|
1329
|
+
|
1330
|
+
Raises
|
1331
|
+
------
|
1332
|
+
InvalidParameterException
|
1333
|
+
PropertyServerException
|
1334
|
+
UserNotAuthorizedException
|
1335
|
+
|
1336
|
+
Notes
|
1337
|
+
-----
|
1338
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
1339
|
+
"""
|
1340
|
+
loop = asyncio.get_event_loop()
|
1341
|
+
loop.run_until_complete(self._async_cancel_engine_action(engine_action_guid))
|
1342
|
+
return
|
1343
|
+
|
1344
|
+
async def _async_get_active_engine_actions(
|
1345
|
+
self, start_from: int = 0, page_size: int = max_paging_size
|
1346
|
+
) -> list | str:
|
1347
|
+
"""Retrieve the engine actions that are still in process. Async Version.
|
1348
|
+
|
1349
|
+
Parameters:
|
1350
|
+
----------
|
1351
|
+
|
1352
|
+
start_from : int, optional
|
1353
|
+
The starting index of the actions to retrieve. Default is 0.
|
1354
|
+
page_size : int, optional
|
1355
|
+
The maximum number of actions to retrieve per page. Default is the global maximum paging size.
|
1356
|
+
|
1357
|
+
Returns:
|
1358
|
+
-------
|
1359
|
+
List[dict]: A list of JSON representations of governance action processes matching the provided name.
|
1360
|
+
|
1361
|
+
Raises:
|
1362
|
+
------
|
1363
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
1364
|
+
this exception is raised with details from the response content.
|
1365
|
+
|
1366
|
+
Notes
|
1367
|
+
-----
|
1368
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
1369
|
+
|
1370
|
+
"""
|
1371
|
+
|
1372
|
+
url = (
|
1373
|
+
f"{self.curation_command_root}/engine-actions/active?"
|
1374
|
+
f"startFrom={start_from}&pageSize={page_size}"
|
1375
|
+
)
|
1376
|
+
|
1377
|
+
response = await self._async_make_request("GET", url)
|
1378
|
+
return response.json().get("elements", "no actions")
|
1379
|
+
|
1380
|
+
def get_active_engine_actions(
|
1381
|
+
self, start_from: int = 0, page_size: int = 0
|
1382
|
+
) -> list | str:
|
1383
|
+
"""Retrieve the engine actions that are still in process.
|
1384
|
+
|
1385
|
+
Parameters:
|
1386
|
+
----------
|
1387
|
+
|
1388
|
+
start_from : int, optional
|
1389
|
+
The starting index of the actions to retrieve. Default is 0.
|
1390
|
+
page_size : int, optional
|
1391
|
+
The maximum number of actions to retrieve per page. Default is the global maximum paging size.
|
1392
|
+
|
1393
|
+
Returns
|
1394
|
+
-------
|
1395
|
+
List[dict]: A list of JSON representations of governance action processes matching the provided name.
|
1396
|
+
|
1397
|
+
Raises
|
1398
|
+
------
|
1399
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
1400
|
+
this exception is raised with details from the response content.
|
1401
|
+
Notes
|
1402
|
+
-----
|
1403
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
1404
|
+
|
1405
|
+
"""
|
1406
|
+
loop = asyncio.get_event_loop()
|
1407
|
+
response = loop.run_until_complete(
|
1408
|
+
self._async_get_active_engine_actions(start_from, page_size)
|
1409
|
+
)
|
1410
|
+
return response
|
1411
|
+
|
1412
|
+
async def _async_get_engine_actions_by_name(
|
1413
|
+
self,
|
1414
|
+
name: str,
|
1415
|
+
start_from: int = 0,
|
1416
|
+
page_size: int = max_paging_size,
|
1417
|
+
) -> list | str:
|
1418
|
+
"""Retrieve the list of engine action metadata elements with a matching qualified or display name.
|
1419
|
+
There are no wildcards supported on this request. Async Version.
|
1420
|
+
Parameters
|
1421
|
+
----------
|
1422
|
+
name : str
|
1423
|
+
The name of the engine action to retrieve.
|
1424
|
+
|
1425
|
+
start_from : int, optional
|
1426
|
+
The index to start retrieving engine actions from. If not provided, the default value will be used.
|
1427
|
+
page_size : int, optional
|
1428
|
+
The maximum number of engine actions to retrieve in a single request. If not provided, the default global
|
1429
|
+
maximum paging size will be used.
|
1430
|
+
|
1431
|
+
Returns
|
1432
|
+
-------
|
1433
|
+
list of dict | str
|
1434
|
+
A list of dictionaries representing the retrieved engine actions, or "no actions" if no engine actions were
|
1435
|
+
found with the given name.
|
1436
|
+
Raises:
|
1437
|
+
------
|
1438
|
+
InvalidParameterException
|
1439
|
+
PropertyServerException
|
1440
|
+
UserNotAuthorizedException
|
1441
|
+
|
1442
|
+
Notes
|
1443
|
+
-----
|
1444
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
1445
|
+
|
1446
|
+
"""
|
1447
|
+
|
1448
|
+
validate_name(name)
|
1449
|
+
|
1450
|
+
url = (
|
1451
|
+
f"{self.curation_command_root}/engine-actions/by-name?"
|
1452
|
+
f"startFrom={start_from}&pageSize={page_size}"
|
1453
|
+
)
|
1454
|
+
body = {"filter": name}
|
1455
|
+
response = await self._async_make_request("POST", url, body)
|
1456
|
+
return response.json().get("elements", "no actions")
|
1457
|
+
|
1458
|
+
def get_engine_actions_by_name(
|
1459
|
+
self,
|
1460
|
+
name: str,
|
1461
|
+
start_from: int = 0,
|
1462
|
+
page_size: int = max_paging_size,
|
1463
|
+
) -> list | str:
|
1464
|
+
"""Retrieve the list of engine action metadata elements with a matching qualified or display name.
|
1465
|
+
There are no wildcards supported on this request.
|
1466
|
+
|
1467
|
+
Parameters
|
1468
|
+
----------
|
1469
|
+
name : str
|
1470
|
+
The name of the engine action to retrieve.
|
1471
|
+
|
1472
|
+
start_from : int, optional
|
1473
|
+
The index to start retrieving engine actions from. If not provided, the default value will be used.
|
1474
|
+
page_size : int, optional
|
1475
|
+
The maximum number of engine actions to retrieve in a single request. If not provided, the default global
|
1476
|
+
maximum paging size will be used.
|
1477
|
+
|
1478
|
+
Returns
|
1479
|
+
-------
|
1480
|
+
list of dict | str
|
1481
|
+
A list of dictionaries representing the retrieved engine actions, or "no actions" if no engine actions were
|
1482
|
+
found with the given name.
|
1483
|
+
Raises:
|
1484
|
+
------
|
1485
|
+
InvalidParameterException
|
1486
|
+
PropertyServerException
|
1487
|
+
UserNotAuthorizedException
|
1488
|
+
|
1489
|
+
Notes
|
1490
|
+
-----
|
1491
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
1492
|
+
|
1493
|
+
"""
|
1494
|
+
loop = asyncio.get_event_loop()
|
1495
|
+
response = loop.run_until_complete(
|
1496
|
+
self._async_get_engine_actions_by_name(name, start_from, page_size)
|
1497
|
+
)
|
1498
|
+
return response
|
1499
|
+
|
1500
|
+
async def _async_find_engine_actions(
|
1501
|
+
self,
|
1502
|
+
search_string: str,
|
1503
|
+
starts_with: bool = False,
|
1504
|
+
ends_with: bool = False,
|
1505
|
+
ignore_case: bool = False,
|
1506
|
+
start_from: int = 0,
|
1507
|
+
page_size: int = max_paging_size,
|
1508
|
+
) -> list | str:
|
1509
|
+
"""Retrieve the list of engine action metadata elements that contain the search string. Async Version.
|
1510
|
+
Parameters
|
1511
|
+
----------
|
1512
|
+
search_string : str
|
1513
|
+
The string used for searching engine actions by name.
|
1514
|
+
|
1515
|
+
|
1516
|
+
|
1517
|
+
starts_with : bool, optional
|
1518
|
+
Whether to search engine actions that start with the given search string. Default is False.
|
1519
|
+
|
1520
|
+
ends_with : bool, optional
|
1521
|
+
Whether to search engine actions that end with the given search string. Default is False.
|
1522
|
+
|
1523
|
+
ignore_case : bool, optional
|
1524
|
+
Whether to ignore case while searching engine actions. Default is False.
|
1525
|
+
|
1526
|
+
start_from : int, optional
|
1527
|
+
The index from which to start fetching the engine actions. Default is 0.
|
1528
|
+
|
1529
|
+
page_size : int, optional
|
1530
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
1531
|
+
|
1532
|
+
Returns
|
1533
|
+
-------
|
1534
|
+
List[dict] or str
|
1535
|
+
A list of dictionaries representing the engine actions found based on the search query.
|
1536
|
+
If no actions are found, returns the string "no actions".
|
1537
|
+
|
1538
|
+
Raises:
|
1539
|
+
------
|
1540
|
+
InvalidParameterException
|
1541
|
+
PropertyServerException
|
1542
|
+
UserNotAuthorizedException
|
1543
|
+
|
1544
|
+
Notes
|
1545
|
+
-----
|
1546
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
1547
|
+
"""
|
1548
|
+
|
1549
|
+
validate_search_string(search_string)
|
1550
|
+
if search_string == "*":
|
1551
|
+
search_string = None
|
1552
|
+
starts_with_s = str(starts_with).lower()
|
1553
|
+
ends_with_s = str(ends_with).lower()
|
1554
|
+
ignore_case_s = str(ignore_case).lower()
|
1555
|
+
|
1556
|
+
url = (
|
1557
|
+
f"{self.curation_command_root}/engine-actions/"
|
1558
|
+
f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
1559
|
+
f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
|
1560
|
+
)
|
1561
|
+
body = {"class": "SearchStringRequestBody", "name": search_string}
|
1562
|
+
response = await self._async_make_request("POST", url, body)
|
1563
|
+
return response.json().get("elements", "no actions")
|
1564
|
+
|
1565
|
+
def find_engine_actions(
|
1566
|
+
self,
|
1567
|
+
search_string: str = "*",
|
1568
|
+
starts_with: bool = False,
|
1569
|
+
ends_with: bool = False,
|
1570
|
+
ignore_case: bool = False,
|
1571
|
+
start_from: int = 0,
|
1572
|
+
page_size: int = max_paging_size,
|
1573
|
+
) -> list | str:
|
1574
|
+
"""Retrieve the list of engine action metadata elements that contain the search string.
|
1575
|
+
Parameters
|
1576
|
+
----------
|
1577
|
+
search_string : str
|
1578
|
+
The string used for searching engine actions by name.
|
1579
|
+
|
1580
|
+
|
1581
|
+
|
1582
|
+
starts_with : bool, optional
|
1583
|
+
Whether to search engine actions that start with the given search string. Default is False.
|
1584
|
+
|
1585
|
+
ends_with : bool, optional
|
1586
|
+
Whether to search engine actions that end with the given search string. Default is False.
|
1587
|
+
|
1588
|
+
ignore_case : bool, optional
|
1589
|
+
Whether to ignore case while searching engine actions. Default is False.
|
1590
|
+
|
1591
|
+
start_from : int, optional
|
1592
|
+
The index from which to start fetching the engine actions. Default is 0.
|
1593
|
+
|
1594
|
+
page_size : int, optional
|
1595
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
1596
|
+
|
1597
|
+
Returns
|
1598
|
+
-------
|
1599
|
+
List[dict] or str
|
1600
|
+
A list of dictionaries representing the engine actions found based on the search query.
|
1601
|
+
If no actions are found, returns the string "no actions".
|
1602
|
+
|
1603
|
+
Raises:
|
1604
|
+
------
|
1605
|
+
InvalidParameterException
|
1606
|
+
PropertyServerException
|
1607
|
+
UserNotAuthorizedException
|
1608
|
+
|
1609
|
+
Notes
|
1610
|
+
-----
|
1611
|
+
For more information see: https://egeria-project.org/concepts/engine-action
|
1612
|
+
"""
|
1613
|
+
|
1614
|
+
loop = asyncio.get_event_loop()
|
1615
|
+
response = loop.run_until_complete(
|
1616
|
+
self._async_find_engine_actions(
|
1617
|
+
search_string,
|
1618
|
+
starts_with,
|
1619
|
+
ends_with,
|
1620
|
+
ignore_case,
|
1621
|
+
start_from,
|
1622
|
+
page_size,
|
1623
|
+
)
|
1624
|
+
)
|
1625
|
+
return response
|
1626
|
+
|
1627
|
+
#
|
1628
|
+
# Governance action processes
|
1629
|
+
#
|
1630
|
+
|
1631
|
+
async def _async_get_governance_action_process_by_guid(
|
1632
|
+
self, process_guid: str
|
1633
|
+
) -> dict | str:
|
1634
|
+
"""Retrieve the governance action process metadata element with the supplied unique identifier. Async Version.
|
1635
|
+
|
1636
|
+
Parameters:
|
1637
|
+
----------
|
1638
|
+
process_guid: str
|
1639
|
+
The GUID (Globally Unique Identifier) of the governance action process.
|
1640
|
+
|
1641
|
+
|
1642
|
+
Returns:
|
1643
|
+
-------
|
1644
|
+
dict: The JSON representation of the governance action process element.
|
1645
|
+
|
1646
|
+
Raises:
|
1647
|
+
------
|
1648
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
1649
|
+
this exception is raised with details from the response content.
|
1650
|
+
PropertyServerException: If the API response indicates a server side error.
|
1651
|
+
UserNotAuthorizedException:
|
1652
|
+
"""
|
1653
|
+
|
1654
|
+
validate_guid(process_guid)
|
1655
|
+
|
1656
|
+
url = (
|
1657
|
+
f"{self.curation_command_root}/"
|
1658
|
+
f"governance-action-processes/{process_guid}"
|
1659
|
+
)
|
1660
|
+
|
1661
|
+
response = await self._async_make_request("GET", url)
|
1662
|
+
return response.json().get("element", "no actions")
|
1663
|
+
|
1664
|
+
def get_governance_action_process_by_guid(self, process_guid: str) -> dict | str:
|
1665
|
+
"""Retrieve the governance action process metadata element with the supplied unique identifier.
|
1666
|
+
|
1667
|
+
Parameters:
|
1668
|
+
----------
|
1669
|
+
process_guid: str
|
1670
|
+
The GUID (Globally Unique Identifier) of the governance action process.
|
1671
|
+
|
1672
|
+
Returns:
|
1673
|
+
-------
|
1674
|
+
dict: The JSON representation of the governance action process element.
|
1675
|
+
|
1676
|
+
Raises:
|
1677
|
+
------
|
1678
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
1679
|
+
this exception is raised with details from the response content.
|
1680
|
+
PropertyServerException: If the API response indicates a server side error.
|
1681
|
+
UserNotAuthorizedException:
|
1682
|
+
"""
|
1683
|
+
loop = asyncio.get_event_loop()
|
1684
|
+
response = loop.run_until_complete(
|
1685
|
+
self._async_get_governance_action_process_by_guid(process_guid)
|
1686
|
+
)
|
1687
|
+
return response
|
1688
|
+
|
1689
|
+
async def _async_get_gov_action_process_graph(
|
1690
|
+
self, process_guid: str
|
1691
|
+
) -> dict | str:
|
1692
|
+
"""Retrieve the governance action process metadata element with the supplied unique
|
1693
|
+
identifier along with the flow definition describing its implementation. Async Version.
|
1694
|
+
Parameters
|
1695
|
+
----------
|
1696
|
+
process_guid : str
|
1697
|
+
The process GUID to retrieve the graph for.
|
1698
|
+
|
1699
|
+
Returns
|
1700
|
+
-------
|
1701
|
+
dict or str
|
1702
|
+
A dictionary representing the graph of the governance action process, or the string "no actions"
|
1703
|
+
if no actions are found.
|
1704
|
+
Raises:
|
1705
|
+
------
|
1706
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
1707
|
+
this exception is raised with details from the response content.
|
1708
|
+
PropertyServerException: If the API response indicates a server side error.
|
1709
|
+
UserNotAuthorizedException:
|
1710
|
+
|
1711
|
+
"""
|
1712
|
+
|
1713
|
+
validate_guid(process_guid)
|
1714
|
+
|
1715
|
+
url = (
|
1716
|
+
f"{self.curation_command_root}/"
|
1717
|
+
f"governance-action-processes/{process_guid}/graph"
|
1718
|
+
)
|
1719
|
+
|
1720
|
+
response = await self._async_make_request("POST", url)
|
1721
|
+
return response.json().get("element", "no actions")
|
1722
|
+
|
1723
|
+
def get_gov_action_process_graph(self, process_guid: str) -> dict | str:
|
1724
|
+
"""Retrieve the governance action process metadata element with the supplied unique
|
1725
|
+
identifier along with the flow definition describing its implementation.
|
1726
|
+
Parameters
|
1727
|
+
----------
|
1728
|
+
process_guid : str
|
1729
|
+
The process GUID to retrieve the graph for.
|
1730
|
+
|
1731
|
+
Returns
|
1732
|
+
-------
|
1733
|
+
dict or str
|
1734
|
+
A dictionary representing the graph of the governance action process, or the string "no actions"
|
1735
|
+
if no actions are found.
|
1736
|
+
Raises:
|
1737
|
+
------
|
1738
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
1739
|
+
this exception is raised with details from the response content.
|
1740
|
+
PropertyServerException: If the API response indicates a server side error.
|
1741
|
+
UserNotAuthorizedException:
|
1742
|
+
|
1743
|
+
"""
|
1744
|
+
loop = asyncio.get_event_loop()
|
1745
|
+
response = loop.run_until_complete(
|
1746
|
+
self._async_get_gov_action_process_graph(process_guid)
|
1747
|
+
)
|
1748
|
+
return response
|
1749
|
+
|
1750
|
+
async def _async_get_gov_action_processes_by_name(
|
1751
|
+
self,
|
1752
|
+
name: str,
|
1753
|
+
start_from: int = None,
|
1754
|
+
page_size: int = max_paging_size,
|
1755
|
+
) -> list | str:
|
1756
|
+
"""Retrieve the list of governance action process metadata elements with a matching qualified or display name.
|
1757
|
+
There are no wildcards supported on this request. Async Version.
|
1758
|
+
|
1759
|
+
Parameters
|
1760
|
+
----------
|
1761
|
+
name : str
|
1762
|
+
The name of the engine action to retrieve.
|
1763
|
+
|
1764
|
+
start_from : int, optional
|
1765
|
+
The index to start retrieving engine actions from. If not provided, the default value will be used.
|
1766
|
+
page_size : int, optional
|
1767
|
+
The maximum number of engine actions to retrieve in a single request. If not provided, the default
|
1768
|
+
global maximum paging size will be used.
|
1769
|
+
|
1770
|
+
Returns
|
1771
|
+
-------
|
1772
|
+
list of dict | str
|
1773
|
+
A list of dictionaries representing the retrieved engine actions,
|
1774
|
+
or "no actions" if no engine actions were found with the given name.
|
1775
|
+
Raises:
|
1776
|
+
------
|
1777
|
+
InvalidParameterException
|
1778
|
+
PropertyServerException
|
1779
|
+
UserNotAuthorizedException
|
1780
|
+
"""
|
1781
|
+
|
1782
|
+
validate_name(name)
|
1783
|
+
|
1784
|
+
url = (
|
1785
|
+
f"{self.curation_command_root}/governance-action-processes/"
|
1786
|
+
f"by-name?startFrom={start_from}&pageSize={page_size}"
|
1787
|
+
)
|
1788
|
+
body = {"filter": name}
|
1789
|
+
response = await self._async_make_request("POST", url, body)
|
1790
|
+
return response.json().get("elements", "no actions")
|
1791
|
+
|
1792
|
+
def get_gov_action_processes_by_name(
|
1793
|
+
self,
|
1794
|
+
name: str,
|
1795
|
+
start_from: int = 0,
|
1796
|
+
page_size: int = max_paging_size,
|
1797
|
+
) -> list | str:
|
1798
|
+
"""Retrieve the list of governance action process metadata elements with a matching qualified or display name.
|
1799
|
+
There are no wildcards supported on this request.
|
1800
|
+
|
1801
|
+
Parameters
|
1802
|
+
----------
|
1803
|
+
name : str
|
1804
|
+
The name of the engine action to retrieve.
|
1805
|
+
|
1806
|
+
start_from : int, optional
|
1807
|
+
The index to start retrieving engine actions from. If not provided, the default value will be used.
|
1808
|
+
page_size : int, optional
|
1809
|
+
The maximum number of engine actions to retrieve in a single request. If not provided, the default global
|
1810
|
+
maximum paging size will be used.
|
1811
|
+
|
1812
|
+
Returns
|
1813
|
+
-------
|
1814
|
+
list of dict | str
|
1815
|
+
A list of dictionaries representing the retrieved engine actions,
|
1816
|
+
or "no actions" if no engine actions were found with the given name.
|
1817
|
+
Raises:
|
1818
|
+
------
|
1819
|
+
InvalidParameterException
|
1820
|
+
PropertyServerException
|
1821
|
+
UserNotAuthorizedException
|
1822
|
+
"""
|
1823
|
+
loop = asyncio.get_event_loop()
|
1824
|
+
response = loop.run_until_complete(
|
1825
|
+
self._async_get_gov_action_processes_by_name(name, start_from, page_size)
|
1826
|
+
)
|
1827
|
+
return response
|
1828
|
+
|
1829
|
+
async def _async_find_gov_action_processes(
|
1830
|
+
self,
|
1831
|
+
search_string: str,
|
1832
|
+
starts_with: bool = False,
|
1833
|
+
ends_with: bool = False,
|
1834
|
+
ignore_case: bool = False,
|
1835
|
+
start_from: int = 0,
|
1836
|
+
page_size: int = max_paging_size,
|
1837
|
+
) -> list | str:
|
1838
|
+
"""Retrieve the list of governance action process metadata elements that contain the search string. Async ver.
|
1839
|
+
|
1840
|
+
Parameters
|
1841
|
+
----------
|
1842
|
+
search_string : str
|
1843
|
+
The string used for searching engine actions by name.
|
1844
|
+
|
1845
|
+
|
1846
|
+
|
1847
|
+
starts_with : bool, optional
|
1848
|
+
Whether to search engine actions that start with the given search string. Default is False.
|
1849
|
+
|
1850
|
+
ends_with : bool, optional
|
1851
|
+
Whether to search engine actions that end with the given search string. Default is False.
|
1852
|
+
|
1853
|
+
ignore_case : bool, optional
|
1854
|
+
Whether to ignore case while searching engine actions. Default is False.
|
1855
|
+
|
1856
|
+
start_from : int, optional
|
1857
|
+
The index from which to start fetching the engine actions. Default is 0.
|
1858
|
+
|
1859
|
+
page_size : int, optional
|
1860
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
1861
|
+
|
1862
|
+
Returns
|
1863
|
+
-------
|
1864
|
+
List[dict] or str
|
1865
|
+
A list of dictionaries representing the governance action processes found based on the search query.
|
1866
|
+
If no actions are found, returns the string "no actions".
|
1867
|
+
|
1868
|
+
Raises:
|
1869
|
+
------
|
1870
|
+
InvalidParameterException
|
1871
|
+
PropertyServerException
|
1872
|
+
UserNotAuthorizedException
|
1873
|
+
"""
|
1874
|
+
|
1875
|
+
validate_search_string(search_string)
|
1876
|
+
if search_string == "*":
|
1877
|
+
search_string = None
|
1878
|
+
starts_with_s = str(starts_with).lower()
|
1879
|
+
ends_with_s = str(ends_with).lower()
|
1880
|
+
ignore_case_s = str(ignore_case).lower()
|
1881
|
+
|
1882
|
+
url = (
|
1883
|
+
f"{self.curation_command_root}/governance-action-processes/"
|
1884
|
+
f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
1885
|
+
f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
|
1886
|
+
)
|
1887
|
+
|
1888
|
+
if search_string:
|
1889
|
+
body = {"filter": search_string}
|
1890
|
+
response = await self._async_make_request("POST", url, body)
|
1891
|
+
else:
|
1892
|
+
response = await self._async_make_request("POST", url)
|
1893
|
+
|
1894
|
+
return response.json().get("elements", "no actions")
|
1895
|
+
|
1896
|
+
def find_gov_action_processes(
|
1897
|
+
self,
|
1898
|
+
search_string: str = "*",
|
1899
|
+
starts_with: bool = False,
|
1900
|
+
ends_with: bool = False,
|
1901
|
+
ignore_case: bool = False,
|
1902
|
+
start_from: int = 0,
|
1903
|
+
page_size: int = max_paging_size,
|
1904
|
+
) -> list | str:
|
1905
|
+
"""Retrieve the list of governance action process metadata elements that contain the search string.
|
1906
|
+
|
1907
|
+
Parameters
|
1908
|
+
----------
|
1909
|
+
search_string : str
|
1910
|
+
The string used for searching engine actions by name.
|
1911
|
+
|
1912
|
+
|
1913
|
+
|
1914
|
+
starts_with : bool, optional
|
1915
|
+
Whether to search engine actions that start with the given search string. Default is False.
|
1916
|
+
|
1917
|
+
ends_with : bool, optional
|
1918
|
+
Whether to search engine actions that end with the given search string. Default is False.
|
1919
|
+
|
1920
|
+
ignore_case : bool, optional
|
1921
|
+
Whether to ignore case while searching engine actions. Default is False.
|
1922
|
+
|
1923
|
+
start_from : int, optional
|
1924
|
+
The index from which to start fetching the engine actions. Default is 0.
|
1925
|
+
|
1926
|
+
page_size : int, optional
|
1927
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
1928
|
+
|
1929
|
+
Returns
|
1930
|
+
-------
|
1931
|
+
List[dict] or str
|
1932
|
+
A list of dictionaries representing the governance action processes found based on the search query.
|
1933
|
+
If no actions are found, returns the string "no actions".
|
1934
|
+
|
1935
|
+
Raises:
|
1936
|
+
------
|
1937
|
+
InvalidParameterException
|
1938
|
+
PropertyServerException
|
1939
|
+
UserNotAuthorizedException
|
1940
|
+
"""
|
1941
|
+
|
1942
|
+
loop = asyncio.get_event_loop()
|
1943
|
+
response = loop.run_until_complete(
|
1944
|
+
self._async_find_gov_action_processes(
|
1945
|
+
search_string,
|
1946
|
+
starts_with,
|
1947
|
+
ends_with,
|
1948
|
+
ignore_case,
|
1949
|
+
start_from,
|
1950
|
+
page_size,
|
1951
|
+
)
|
1952
|
+
)
|
1953
|
+
return response
|
1954
|
+
|
1955
|
+
async def _async_initiate_gov_action_process(
|
1956
|
+
self,
|
1957
|
+
action_type_qualified_name: str,
|
1958
|
+
request_source_guids: [str] = None,
|
1959
|
+
action_targets: list = None,
|
1960
|
+
start_time: datetime = None,
|
1961
|
+
request_parameters: dict = None,
|
1962
|
+
orig_service_name: str = None,
|
1963
|
+
orig_engine_name: str = None,
|
1964
|
+
) -> str:
|
1965
|
+
"""Using the named governance action process as a template, initiate a chain of engine actions. Async version.
|
1966
|
+
|
1967
|
+
Parameters
|
1968
|
+
----------
|
1969
|
+
action_type_qualified_name: str
|
1970
|
+
- unique name for the governance process
|
1971
|
+
request_source_guids: [str], optional
|
1972
|
+
- request source elements for the resulting governance action service
|
1973
|
+
action_targets: [str], optional
|
1974
|
+
-list of action target names to GUIDs for the resulting governance action service
|
1975
|
+
start_time: datetime, optional
|
1976
|
+
- time to start the process
|
1977
|
+
request_parameters: [str], optional
|
1978
|
+
- parameters passed into the process
|
1979
|
+
orig_service_name: str, optional
|
1980
|
+
- unique name of the requesting governance service (if initiated by a governance engine)
|
1981
|
+
orig_engine_name: str, optional
|
1982
|
+
- optional unique name of the governance engine (if initiated by a governance engine).
|
1983
|
+
|
1984
|
+
Returns
|
1985
|
+
-------
|
1986
|
+
Unique id (guid) of the newly started governance engine process
|
1987
|
+
|
1988
|
+
Raises
|
1989
|
+
------
|
1990
|
+
InvalidParameterException
|
1991
|
+
PropertyServerException
|
1992
|
+
UserNotAuthorizedException
|
1993
|
+
|
1994
|
+
"""
|
1995
|
+
|
1996
|
+
start_time: datetime = (
|
1997
|
+
datetime.datetime.now() if start_time is None else start_time
|
1998
|
+
)
|
1999
|
+
|
2000
|
+
url = f"{self.curation_command_root}/governance-action-processes/" f"initiate"
|
2001
|
+
body = {
|
2002
|
+
"class": "GovernanceActionProcessRequestBody",
|
2003
|
+
"processQualifiedName": action_type_qualified_name,
|
2004
|
+
"requestSourceGUIDs": request_source_guids,
|
2005
|
+
"actionTargets": action_targets,
|
2006
|
+
"startTime": int(start_time.timestamp() * 1000),
|
2007
|
+
"requestParameters": request_parameters,
|
2008
|
+
"originatorServiceName": orig_service_name,
|
2009
|
+
"originatorEngineName": orig_engine_name,
|
2010
|
+
}
|
2011
|
+
new_body = body_slimmer(body)
|
2012
|
+
response = await self._async_make_request("POST", url, new_body)
|
2013
|
+
return response.json().get("guid", "Action not initiated")
|
2014
|
+
|
2015
|
+
def initiate_gov_action_process(
|
2016
|
+
self,
|
2017
|
+
action_type_qualified_name: str,
|
2018
|
+
request_source_guids: [str] = None,
|
2019
|
+
action_targets: [str] = None,
|
2020
|
+
start_time: datetime = None,
|
2021
|
+
request_parameters: dict = None,
|
2022
|
+
orig_service_name: str = None,
|
2023
|
+
orig_engine_name: str = None,
|
2024
|
+
) -> str:
|
2025
|
+
"""Using the named governance action process as a template, initiate a chain of engine actions.
|
2026
|
+
|
2027
|
+
Parameters
|
2028
|
+
----------
|
2029
|
+
action_type_qualified_name: str
|
2030
|
+
- unique name for the governance process
|
2031
|
+
request_source_guids: [str], optional
|
2032
|
+
- request source elements for the resulting governance action service
|
2033
|
+
action_targets: [str], optional
|
2034
|
+
-list of action target names to GUIDs for the resulting governance action service
|
2035
|
+
start_time: datetime, optional
|
2036
|
+
- time to start the process
|
2037
|
+
request_parameters: [str], optional
|
2038
|
+
- parameters passed into the process
|
2039
|
+
orig_service_name: str, optional
|
2040
|
+
- unique name of the requesting governance service (if initiated by a governance engine)
|
2041
|
+
orig_engine_name: str, optional
|
2042
|
+
- optional unique name of the governance engine (if initiated by a governance engine).
|
2043
|
+
|
2044
|
+
Returns
|
2045
|
+
-------
|
2046
|
+
Unique id (guid) of the newly started governance engine process
|
2047
|
+
|
2048
|
+
Raises
|
2049
|
+
------
|
2050
|
+
InvalidParameterException
|
2051
|
+
PropertyServerException
|
2052
|
+
UserNotAuthorizedException
|
2053
|
+
|
2054
|
+
"""
|
2055
|
+
loop = asyncio.get_event_loop()
|
2056
|
+
response = loop.run_until_complete(
|
2057
|
+
self._async_initiate_gov_action_process(
|
2058
|
+
action_type_qualified_name,
|
2059
|
+
request_source_guids,
|
2060
|
+
action_targets,
|
2061
|
+
start_time,
|
2062
|
+
request_parameters,
|
2063
|
+
orig_service_name,
|
2064
|
+
orig_engine_name,
|
2065
|
+
)
|
2066
|
+
)
|
2067
|
+
return response
|
2068
|
+
|
2069
|
+
async def _async_get_gov_action_types_by_guid(
|
2070
|
+
self, gov_action_type_guid: str
|
2071
|
+
) -> dict | str:
|
2072
|
+
"""Retrieve the governance action type metadata element with the supplied unique identifier. Async version.
|
2073
|
+
|
2074
|
+
Parameters:
|
2075
|
+
----------
|
2076
|
+
gov_action_type_guid: str
|
2077
|
+
The GUID (Globally Unique Identifier) of the governance action type to retrieve.
|
2078
|
+
|
2079
|
+
Returns:
|
2080
|
+
-------
|
2081
|
+
dict: The JSON representation of the governance action type element.
|
2082
|
+
|
2083
|
+
Raises:
|
2084
|
+
------
|
2085
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2086
|
+
this exception is raised with details from the response content.
|
2087
|
+
PropertyServerException: If the API response indicates a server side error.
|
2088
|
+
UserNotAuthorizedException:
|
2089
|
+
"""
|
2090
|
+
|
2091
|
+
validate_guid(gov_action_type_guid)
|
2092
|
+
|
2093
|
+
url = (
|
2094
|
+
f"{self.curation_command_root}/"
|
2095
|
+
f"governance-action-types/{gov_action_type_guid}"
|
2096
|
+
)
|
2097
|
+
|
2098
|
+
response = await self._async_make_request("GET", url)
|
2099
|
+
return response.json().get("element", "no actions")
|
2100
|
+
|
2101
|
+
def get_gov_action_types_by_guid(self, gov_action_type_guid: str) -> dict | str:
|
2102
|
+
"""Retrieve the governance action type metadata element with the supplied unique identifier.
|
2103
|
+
|
2104
|
+
Parameters:
|
2105
|
+
----------
|
2106
|
+
gov_action_type_guid: str
|
2107
|
+
The GUID (Globally Unique Identifier) of the governance action type to retrieve.
|
2108
|
+
|
2109
|
+
Returns:
|
2110
|
+
-------
|
2111
|
+
dict: The JSON representation of the governance action type element.
|
2112
|
+
|
2113
|
+
Raises:
|
2114
|
+
------
|
2115
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2116
|
+
this exception is raised with details from the response content.
|
2117
|
+
PropertyServerException: If the API response indicates a server side error.
|
2118
|
+
UserNotAuthorizedException:
|
2119
|
+
"""
|
2120
|
+
loop = asyncio.get_event_loop()
|
2121
|
+
response = loop.run_until_complete(
|
2122
|
+
self._async_get_gov_action_types_by_guid(gov_action_type_guid)
|
2123
|
+
)
|
2124
|
+
return response
|
2125
|
+
|
2126
|
+
async def _async_get_gov_action_types_by_name(
|
2127
|
+
self,
|
2128
|
+
action_type_name,
|
2129
|
+
start_from: int = 0,
|
2130
|
+
page_size: int = max_paging_size,
|
2131
|
+
) -> list | str:
|
2132
|
+
"""Retrieve the list of governance action type metadata elements with a matching qualified or display name.
|
2133
|
+
There are no wildcards supported on this request. Async version.
|
2134
|
+
|
2135
|
+
Parameters:
|
2136
|
+
----------
|
2137
|
+
action_type_name: str
|
2138
|
+
The name of the governance action type to retrieve.
|
2139
|
+
|
2140
|
+
Returns:
|
2141
|
+
-------
|
2142
|
+
dict: The JSON representation of the governance action type element.
|
2143
|
+
|
2144
|
+
Raises:
|
2145
|
+
------
|
2146
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2147
|
+
this exception is raised with details from the response content.
|
2148
|
+
PropertyServerException: If the API response indicates a server side error.
|
2149
|
+
UserNotAuthorizedException:
|
2150
|
+
"""
|
2151
|
+
|
2152
|
+
validate_name(action_type_name)
|
2153
|
+
|
2154
|
+
url = (
|
2155
|
+
f"{self.curation_command_root}/"
|
2156
|
+
f"governance-action-types/by-name?startFrom={start_from}&pageSize={page_size}"
|
2157
|
+
)
|
2158
|
+
|
2159
|
+
body = {"filter": action_type_name}
|
2160
|
+
|
2161
|
+
response = await self._async_make_request("POST", url, body)
|
2162
|
+
return response.json().get("elements", "no actions")
|
2163
|
+
|
2164
|
+
def get_gov_action_types_by_name(
|
2165
|
+
self,
|
2166
|
+
action_type_name,
|
2167
|
+
start_from: int = 0,
|
2168
|
+
page_size: int = max_paging_size,
|
2169
|
+
) -> list | str:
|
2170
|
+
"""Retrieve the list of governance action type metadata elements with a matching qualified or display name.
|
2171
|
+
There are no wildcards supported on this request. Async version.
|
2172
|
+
|
2173
|
+
Parameters:
|
2174
|
+
----------
|
2175
|
+
action_type_name: str
|
2176
|
+
The name of the governance action type to retrieve.
|
2177
|
+
|
2178
|
+
Returns:
|
2179
|
+
-------
|
2180
|
+
dict: The JSON representation of the governance action type element.
|
2181
|
+
|
2182
|
+
Raises:
|
2183
|
+
------
|
2184
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2185
|
+
this exception is raised with details from the response content.
|
2186
|
+
PropertyServerException: If the API response indicates a server side error.
|
2187
|
+
UserNotAuthorizedException:
|
2188
|
+
"""
|
2189
|
+
loop = asyncio.get_event_loop()
|
2190
|
+
response = loop.run_until_complete(
|
2191
|
+
self._async_get_gov_action_types_by_name(
|
2192
|
+
action_type_name, start_from, page_size
|
2193
|
+
)
|
2194
|
+
)
|
2195
|
+
return response
|
2196
|
+
|
2197
|
+
async def _async_find_gov_action_types(
|
2198
|
+
self,
|
2199
|
+
search_string: str = "*",
|
2200
|
+
starts_with: bool = False,
|
2201
|
+
ends_with: bool = False,
|
2202
|
+
ignore_case: bool = True,
|
2203
|
+
start_from: int = 0,
|
2204
|
+
page_size: int = max_paging_size,
|
2205
|
+
) -> list | str:
|
2206
|
+
"""Retrieve the list of governance action type metadata elements that contain the search string.
|
2207
|
+
Async Version.
|
2208
|
+
|
2209
|
+
Parameters
|
2210
|
+
----------
|
2211
|
+
search_string : str
|
2212
|
+
The string used for searching engine actions by name.
|
2213
|
+
|
2214
|
+
|
2215
|
+
|
2216
|
+
starts_with : bool, optional
|
2217
|
+
Whether to search engine actions that start with the given search string. Default is False.
|
2218
|
+
|
2219
|
+
ends_with : bool, optional
|
2220
|
+
Whether to search engine actions that end with the given search string. Default is False.
|
2221
|
+
|
2222
|
+
ignore_case : bool, optional
|
2223
|
+
Whether to ignore case while searching engine actions. Default is False.
|
2224
|
+
|
2225
|
+
start_from : int, optional
|
2226
|
+
The index from which to start fetching the engine actions. Default is 0.
|
2227
|
+
|
2228
|
+
page_size : int, optional
|
2229
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
2230
|
+
|
2231
|
+
Returns
|
2232
|
+
-------
|
2233
|
+
List[dict] or str
|
2234
|
+
A list of dictionaries representing the governance action types found based on the search query.
|
2235
|
+
If no actions are found, returns the string "no action types".
|
2236
|
+
|
2237
|
+
Raises
|
2238
|
+
------
|
2239
|
+
InvalidParameterException
|
2240
|
+
PropertyServerException
|
2241
|
+
UserNotAuthorizedException
|
2242
|
+
|
2243
|
+
"""
|
2244
|
+
|
2245
|
+
validate_search_string(search_string)
|
2246
|
+
if search_string == "*":
|
2247
|
+
search_string = None
|
2248
|
+
starts_with_s = str(starts_with).lower()
|
2249
|
+
ends_with_s = str(ends_with).lower()
|
2250
|
+
ignore_case_s = str(ignore_case).lower()
|
2251
|
+
|
2252
|
+
url = (
|
2253
|
+
f"{self.curation_command_root}/governance-action-types/"
|
2254
|
+
f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
2255
|
+
f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
|
2256
|
+
)
|
2257
|
+
body = {"filter": search_string}
|
2258
|
+
response = await self._async_make_request("POST", url, body)
|
2259
|
+
return response.json().get("elements", "no action types")
|
2260
|
+
|
2261
|
+
def find_gov_action_types(
|
2262
|
+
self,
|
2263
|
+
search_string: str = "*",
|
2264
|
+
starts_with: bool = False,
|
2265
|
+
ends_with: bool = False,
|
2266
|
+
ignore_case: bool = False,
|
2267
|
+
start_from: int = 0,
|
2268
|
+
page_size: int = max_paging_size,
|
2269
|
+
) -> list | str:
|
2270
|
+
"""Retrieve the list of governance action type metadata elements that contain the search string.
|
2271
|
+
|
2272
|
+
Parameters
|
2273
|
+
----------
|
2274
|
+
search_string : str
|
2275
|
+
The string used for searching engine actions by name.
|
2276
|
+
|
2277
|
+
|
2278
|
+
starts_with : bool, optional
|
2279
|
+
Whether to search engine actions that start with the given search string. Default is False.
|
2280
|
+
|
2281
|
+
ends_with : bool, optional
|
2282
|
+
Whether to search engine actions that end with the given search string. Default is False.
|
2283
|
+
|
2284
|
+
ignore_case : bool, optional
|
2285
|
+
Whether to ignore case while searching engine actions. Default is False.
|
2286
|
+
|
2287
|
+
start_from : int, optional
|
2288
|
+
The index from which to start fetching the engine actions. Default is 0.
|
2289
|
+
|
2290
|
+
page_size : int, optional
|
2291
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
2292
|
+
|
2293
|
+
Returns
|
2294
|
+
-------
|
2295
|
+
List[dict] or str
|
2296
|
+
A list of dictionaries representing the governance action types found based on the search query.
|
2297
|
+
If no actions are found, returns the string "no action types".
|
2298
|
+
|
2299
|
+
Raises
|
2300
|
+
------
|
2301
|
+
InvalidParameterException
|
2302
|
+
PropertyServerException
|
2303
|
+
UserNotAuthorizedException
|
2304
|
+
|
2305
|
+
"""
|
2306
|
+
loop = asyncio.get_event_loop()
|
2307
|
+
response = loop.run_until_complete(
|
2308
|
+
self._async_find_gov_action_types(
|
2309
|
+
search_string,
|
2310
|
+
starts_with,
|
2311
|
+
ends_with,
|
2312
|
+
ignore_case,
|
2313
|
+
start_from,
|
2314
|
+
page_size,
|
2315
|
+
)
|
2316
|
+
)
|
2317
|
+
return response
|
2318
|
+
|
2319
|
+
async def _async_initiate_gov_action_type(
|
2320
|
+
self,
|
2321
|
+
action_type_qualified_name: str,
|
2322
|
+
request_source_guids: [str],
|
2323
|
+
action_targets: list,
|
2324
|
+
start_time: datetime = None,
|
2325
|
+
request_parameters: dict = None,
|
2326
|
+
orig_service_name: str = None,
|
2327
|
+
orig_engine_name: str = None,
|
2328
|
+
) -> str:
|
2329
|
+
"""Using the named governance action type as a template, initiate an engine action. Async version.
|
2330
|
+
|
2331
|
+
Parameters
|
2332
|
+
----------
|
2333
|
+
action_type_qualified_name: str
|
2334
|
+
- unique name for the governance process
|
2335
|
+
request_source_guids: [str]
|
2336
|
+
- request source elements for the resulting governance action service
|
2337
|
+
action_targets: [str]
|
2338
|
+
-list of action target names to GUIDs for the resulting governance action service
|
2339
|
+
start_time: datetime, default = None
|
2340
|
+
- time to start the process, no earlier than start time. None means now.
|
2341
|
+
request_parameters: [str]
|
2342
|
+
- parameters passed into the process
|
2343
|
+
orig_service_name: str
|
2344
|
+
- unique name of the requesting governance service (if initiated by a governance engine)
|
2345
|
+
orig_engine_name: str
|
2346
|
+
- optional unique name of the governance engine (if initiated by a governance engine).
|
2347
|
+
|
2348
|
+
Returns
|
2349
|
+
-------
|
2350
|
+
Unique id (guid) of the newly started governance engine process
|
2351
|
+
|
2352
|
+
Raises
|
2353
|
+
------
|
2354
|
+
InvalidParameterException
|
2355
|
+
PropertyServerException
|
2356
|
+
UserNotAuthorizedException
|
2357
|
+
|
2358
|
+
"""
|
2359
|
+
|
2360
|
+
url = f"{self.curation_command_root}/governance-action-types/" f"initiate"
|
2361
|
+
start = int(start_time.timestamp() * 1000) if start_time else None
|
2362
|
+
body = {
|
2363
|
+
"class": "InitiateGovernanceActionTypeRequestBody",
|
2364
|
+
"governanceActionTypeQualifiedName": action_type_qualified_name,
|
2365
|
+
"requestSourceGUIDs": request_source_guids,
|
2366
|
+
"actionTargets": action_targets,
|
2367
|
+
"startDate": start,
|
2368
|
+
"requestParameters": request_parameters,
|
2369
|
+
"originatorServiceName": orig_service_name,
|
2370
|
+
"originatorEngineName": orig_engine_name,
|
2371
|
+
}
|
2372
|
+
new_body = body_slimmer(body)
|
2373
|
+
response = await self._async_make_request("POST", url, new_body)
|
2374
|
+
return response.json().get("guid", "Action not initiated")
|
2375
|
+
|
2376
|
+
def initiate_gov_action_type(
|
2377
|
+
self,
|
2378
|
+
action_type_qualified_name: str,
|
2379
|
+
request_source_guids: [str],
|
2380
|
+
action_targets: list,
|
2381
|
+
start_time: datetime = None,
|
2382
|
+
request_parameters: dict = None,
|
2383
|
+
orig_service_name: str = None,
|
2384
|
+
orig_engine_name: str = None,
|
2385
|
+
) -> str:
|
2386
|
+
"""Using the named governance action type as a template, initiate an engine action.
|
2387
|
+
|
2388
|
+
Parameters
|
2389
|
+
----------
|
2390
|
+
action_type_qualified_name: str
|
2391
|
+
- unique name for the governance process
|
2392
|
+
request_source_guids: [str]
|
2393
|
+
- request source elements for the resulting governance action service
|
2394
|
+
action_targets: [str]
|
2395
|
+
-list of action target names to GUIDs for the resulting governance action service
|
2396
|
+
start_time: datetime, default = None
|
2397
|
+
- time to start the process, no earlier than start time. None means now.
|
2398
|
+
request_parameters: [str]
|
2399
|
+
- parameters passed into the process
|
2400
|
+
orig_service_name: str
|
2401
|
+
- unique name of the requesting governance service (if initiated by a governance engine)
|
2402
|
+
orig_engine_name: str
|
2403
|
+
- optional unique name of the governance engine (if initiated by a governance engine).
|
2404
|
+
|
2405
|
+
Returns
|
2406
|
+
-------
|
2407
|
+
Unique id (guid) of the newly started governance engine process
|
2408
|
+
|
2409
|
+
Raises
|
2410
|
+
------
|
2411
|
+
InvalidParameterException
|
2412
|
+
PropertyServerException
|
2413
|
+
UserNotAuthorizedException
|
2414
|
+
"""
|
2415
|
+
loop = asyncio.get_event_loop()
|
2416
|
+
response = loop.run_until_complete(
|
2417
|
+
self._async_initiate_gov_action_type(
|
2418
|
+
action_type_qualified_name,
|
2419
|
+
request_source_guids,
|
2420
|
+
action_targets,
|
2421
|
+
start_time,
|
2422
|
+
request_parameters,
|
2423
|
+
orig_service_name,
|
2424
|
+
orig_engine_name,
|
2425
|
+
)
|
2426
|
+
)
|
2427
|
+
return response
|
2428
|
+
|
2429
|
+
#
|
2430
|
+
# Initiate surveys
|
2431
|
+
#
|
2432
|
+
|
2433
|
+
async def _async_initiate_survey(self, survey_name: str, resource_guid: str) -> str:
|
2434
|
+
"""Initiate a survey of the survey_name on the target resource. Async Version.
|
2435
|
+
|
2436
|
+
Parameters
|
2437
|
+
----------
|
2438
|
+
survey_name: str
|
2439
|
+
The name of the survey to initiate.
|
2440
|
+
resource_guid : str
|
2441
|
+
The GUID of the resource to be surveyed.
|
2442
|
+
|
2443
|
+
Returns
|
2444
|
+
-------
|
2445
|
+
str
|
2446
|
+
The GUID of the initiated action or "Action not initiated" if the action was not initiated.
|
2447
|
+
|
2448
|
+
"""
|
2449
|
+
|
2450
|
+
url = f"{self.curation_command_root}/governance-action-types/initiate"
|
2451
|
+
|
2452
|
+
body = {
|
2453
|
+
"class": "InitiateGovernanceActionTypeRequestBody",
|
2454
|
+
"governanceActionTypeQualifiedName": survey_name,
|
2455
|
+
"actionTargets": [
|
2456
|
+
{
|
2457
|
+
"class": "NewActionTarget",
|
2458
|
+
"actionTargetName": "serverToSurvey",
|
2459
|
+
"actionTargetGUID": resource_guid,
|
2460
|
+
}
|
2461
|
+
],
|
2462
|
+
}
|
2463
|
+
response = await self._async_make_request("POST", url, body)
|
2464
|
+
return response.json().get("guid", "Action not initiated")
|
2465
|
+
|
2466
|
+
def initiate_postgres_database_survey(self, postgres_database_guid: str) -> str:
|
2467
|
+
"""Initiate a postgres database survey"""
|
2468
|
+
loop = asyncio.get_event_loop()
|
2469
|
+
response = loop.run_until_complete(
|
2470
|
+
self._async_initiate_survey(
|
2471
|
+
"PostgreSQLSurveys:survey-postgres-database", postgres_database_guid
|
2472
|
+
)
|
2473
|
+
)
|
2474
|
+
return response
|
2475
|
+
|
2476
|
+
def initiate_postgres_server_survey(self, postgres_server_guid: str) -> str:
|
2477
|
+
"""Initiate a postgres server survey"""
|
2478
|
+
loop = asyncio.get_event_loop()
|
2479
|
+
response = loop.run_until_complete(
|
2480
|
+
self._async_initiate_survey(
|
2481
|
+
"PostgreSQLSurveys:survey-postgres-server", postgres_server_guid
|
2482
|
+
)
|
2483
|
+
)
|
2484
|
+
return response
|
2485
|
+
|
2486
|
+
def initiate_file_folder_survey(
|
2487
|
+
self,
|
2488
|
+
file_folder_guid: str,
|
2489
|
+
survey_name: str = "FileSurveys:survey-folder",
|
2490
|
+
) -> str:
|
2491
|
+
"""Initiate a file folder survey - async version
|
2492
|
+
|
2493
|
+
Parameters:
|
2494
|
+
----------
|
2495
|
+
file_folder_guid: str
|
2496
|
+
The GUID of the File Folder that we wish to survey.
|
2497
|
+
survey_name: str, optional
|
2498
|
+
The unique name of the survey routine to execute. Default surveys all folders.
|
2499
|
+
|
2500
|
+
Returns:
|
2501
|
+
-------
|
2502
|
+
str:
|
2503
|
+
The guid of the survey being run.
|
2504
|
+
|
2505
|
+
Raises:
|
2506
|
+
------
|
2507
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2508
|
+
this exception is raised with details from the response content.
|
2509
|
+
PropertyServerException: If the API response indicates a server side error.
|
2510
|
+
UserNotAuthorizedException:
|
2511
|
+
|
2512
|
+
Notes:
|
2513
|
+
There are multiple kinds of file folder surveys available, each with their own purpose. They are described
|
2514
|
+
in the Core Content Brain.
|
2515
|
+
|
2516
|
+
File Folder Survey Names currently include::
|
2517
|
+
- Egeria:GovernanceActionType:AssetSurvey:survey-folders
|
2518
|
+
- Egeria:GovernanceActionType:AssetSurvey:survey-folder-and-files
|
2519
|
+
- Egeria:GovernanceActionType:AssetSurvey:survey-all-folders
|
2520
|
+
- Egeria:GovernanceActionType:AssetSurvey:survey-all-folders-and-files
|
2521
|
+
|
2522
|
+
|
2523
|
+
"""
|
2524
|
+
loop = asyncio.get_event_loop()
|
2525
|
+
response = loop.run_until_complete(
|
2526
|
+
self._async_initiate_survey(
|
2527
|
+
survey_name,
|
2528
|
+
file_folder_guid,
|
2529
|
+
)
|
2530
|
+
)
|
2531
|
+
return response
|
2532
|
+
|
2533
|
+
def initiate_file_survey(self, file_guid: str) -> str:
|
2534
|
+
"""Initiate a file survey"""
|
2535
|
+
loop = asyncio.get_event_loop()
|
2536
|
+
response = loop.run_until_complete(
|
2537
|
+
self._async_initiate_survey("FileSurveys:survey-data-file", file_guid)
|
2538
|
+
)
|
2539
|
+
return response
|
2540
|
+
|
2541
|
+
def initiate_kafka_server_survey(self, kafka_server_guid: str) -> str:
|
2542
|
+
"""Initiate survey of a kafka server.
|
2543
|
+
Parameters
|
2544
|
+
----------
|
2545
|
+
kafka_server_guid : str
|
2546
|
+
The GUID of the Kafka server to be surveyed.
|
2547
|
+
|
2548
|
+
|
2549
|
+
Returns
|
2550
|
+
-------
|
2551
|
+
str
|
2552
|
+
The GUID of the initiated action or "Action not initiated" if the action was not initiated.
|
2553
|
+
|
2554
|
+
"""
|
2555
|
+
loop = asyncio.get_event_loop()
|
2556
|
+
response = loop.run_until_complete(
|
2557
|
+
self._async_initiate_survey(
|
2558
|
+
"ApacheKafkaSurveys:survey-kafka-server", kafka_server_guid
|
2559
|
+
)
|
2560
|
+
)
|
2561
|
+
return response
|
2562
|
+
|
2563
|
+
def initiate_uc_server_survey(self, uc_server_guid: str) -> str:
|
2564
|
+
"""Initiate survey of a Unity Catalog server. Async Version.
|
2565
|
+
Parameters
|
2566
|
+
----------
|
2567
|
+
uc_server_guid : str
|
2568
|
+
The GUID of the Kafka server to be surveyed.
|
2569
|
+
|
2570
|
+
|
2571
|
+
Returns
|
2572
|
+
-------
|
2573
|
+
str
|
2574
|
+
The GUID of the initiated action or "Action not initiated" if the action was not initiated.
|
2575
|
+
|
2576
|
+
"""
|
2577
|
+
loop = asyncio.get_event_loop()
|
2578
|
+
response = loop.run_until_complete(
|
2579
|
+
self._async_initiate_survey(
|
2580
|
+
"UnityCatalogSurveys:survey-unity-catalog-server", uc_server_guid
|
2581
|
+
)
|
2582
|
+
)
|
2583
|
+
return response
|
2584
|
+
|
2585
|
+
def initiate_uc_schema_survey(self, uc_schema_guid: str) -> str:
|
2586
|
+
"""Initiate survey of a Unity Catalog schema. Async Version.
|
2587
|
+
Parameters
|
2588
|
+
----------
|
2589
|
+
uc_schema_guid : str
|
2590
|
+
The GUID of the Kafka server to be surveyed.
|
2591
|
+
|
2592
|
+
|
2593
|
+
|
2594
|
+
Returns
|
2595
|
+
-------
|
2596
|
+
str
|
2597
|
+
The GUID of the initiated action or "Action not initiated" if the action was not initiated.
|
2598
|
+
|
2599
|
+
"""
|
2600
|
+
loop = asyncio.get_event_loop()
|
2601
|
+
response = loop.run_until_complete(
|
2602
|
+
self._async_initiate_survey(
|
2603
|
+
"UnityCatalogSurveys:survey-unity-catalog-schema", uc_schema_guid
|
2604
|
+
)
|
2605
|
+
)
|
2606
|
+
return response
|
2607
|
+
|
2608
|
+
# async def _async_initiate_uc_function_survey(self, uc_server_guid: str) -> str:
|
2609
|
+
# """ Initiate survey of a Unity Catalog server. Async Version.
|
2610
|
+
# Parameters
|
2611
|
+
# ----------
|
2612
|
+
# Unity Catalog_server_guid : str
|
2613
|
+
# The GUID of the Kafka server to be surveyed.
|
2614
|
+
#
|
2615
|
+
# server : str, optional
|
2616
|
+
# The name of the server. If not provided, the default server name is used.
|
2617
|
+
#
|
2618
|
+
# Returns
|
2619
|
+
# -------
|
2620
|
+
# str
|
2621
|
+
# The GUID of the initiated action or "Action not initiated" if the action was not initiated.
|
2622
|
+
#
|
2623
|
+
# """
|
2624
|
+
# server = self.view_server if server is None else server
|
2625
|
+
# url = (f"{self.curation_command_root}/governance-action-types/"
|
2626
|
+
# f"initiate")
|
2627
|
+
#
|
2628
|
+
# body = {"class": "InitiateGovernanceActionTypeRequestBody",
|
2629
|
+
# "governanceActionTypeQualifiedName": "AssetSurvey:survey-unity-catalog-server", "actionTargets": [
|
2630
|
+
# {"class": "NewActionTarget", "actionTargetName": "serverToSurvey", "actionTargetGUID": uc_server_guid}]}
|
2631
|
+
# response = await self._async_make_request("POST", url, body)
|
2632
|
+
# return response.json().get("guid", "Action not initiated")
|
2633
|
+
#
|
2634
|
+
# def initiate_uc_function_survey(self, uc_server_guid: str) -> str:
|
2635
|
+
# """ Initiate survey of a Unity Catalog server. Async Version.
|
2636
|
+
# Parameters
|
2637
|
+
# ----------
|
2638
|
+
# Unity Catalog_server_guid : str
|
2639
|
+
# The GUID of the Kafka server to be surveyed.
|
2640
|
+
#
|
2641
|
+
# server : str, optional
|
2642
|
+
# The name of the server. If not provided, the default server name is used.
|
2643
|
+
#
|
2644
|
+
# Returns
|
2645
|
+
# -------
|
2646
|
+
# str
|
2647
|
+
# The GUID of the initiated action or "Action not initiated" if the action was not initiated.
|
2648
|
+
#
|
2649
|
+
# """
|
2650
|
+
# loop = asyncio.get_event_loop()
|
2651
|
+
# response = loop.run_until_complete(self._async_initiate_uc_server_survey(uc_server_guid))
|
2652
|
+
# return response
|
2653
|
+
#
|
2654
|
+
# async def _async_initiate_uc_server_survey(self, uc_server_guid: str) -> str:
|
2655
|
+
# """ Initiate survey of a Unity Catalog server. Async Version.
|
2656
|
+
# Parameters
|
2657
|
+
# ----------
|
2658
|
+
# Unity Catalog_server_guid : str
|
2659
|
+
# The GUID of the Kafka server to be surveyed.
|
2660
|
+
#
|
2661
|
+
# server : str, optional
|
2662
|
+
# The name of the server. If not provided, the default server name is used.
|
2663
|
+
#
|
2664
|
+
# Returns
|
2665
|
+
# -------
|
2666
|
+
# str
|
2667
|
+
# The GUID of the initiated action or "Action not initiated" if the action was not initiated.
|
2668
|
+
#
|
2669
|
+
# """
|
2670
|
+
# server = self.view_server if server is None else server
|
2671
|
+
# url = (f"{self.curation_command_root}/governance-action-types/"
|
2672
|
+
# f"initiate")
|
2673
|
+
#
|
2674
|
+
# body = {"class": "InitiateGovernanceActionTypeRequestBody",
|
2675
|
+
# "governanceActionTypeQualifiedName": "AssetSurvey:survey-unity-catalog-server", "actionTargets": [
|
2676
|
+
# {"class": "NewActionTarget", "actionTargetName": "serverToSurvey", "actionTargetGUID": uc_server_guid}]}
|
2677
|
+
# response = await self._async_make_request("POST", url, body)
|
2678
|
+
# return response.json().get("guid", "Action not initiated")
|
2679
|
+
#
|
2680
|
+
# def initiate_uc_server_survey(self, uc_server_guid: str) -> str:
|
2681
|
+
# """ Initiate survey of a Unity Catalog server. Async Version.
|
2682
|
+
# Parameters
|
2683
|
+
# ----------
|
2684
|
+
# Unity Catalog_server_guid : str
|
2685
|
+
# The GUID of the Kafka server to be surveyed.
|
2686
|
+
#
|
2687
|
+
# server : str, optional
|
2688
|
+
# The name of the server. If not provided, the default server name is used.
|
2689
|
+
#
|
2690
|
+
# Returns
|
2691
|
+
# -------
|
2692
|
+
# str
|
2693
|
+
# The GUID of the initiated action or "Action not initiated" if the action was not initiated.
|
2694
|
+
#
|
2695
|
+
# """
|
2696
|
+
# loop = asyncio.get_event_loop()
|
2697
|
+
# response = loop.run_until_complete(self._async_initiate_uc_server_survey(uc_server_guid))
|
2698
|
+
# return response
|
2699
|
+
#
|
2700
|
+
# async def _async_initiate_uc_server_survey(self, uc_server_guid: str) -> str:
|
2701
|
+
# """ Initiate survey of a Unity Catalog server. Async Version.
|
2702
|
+
# Parameters
|
2703
|
+
# ----------
|
2704
|
+
# Unity Catalog_server_guid : str
|
2705
|
+
# The GUID of the Kafka server to be surveyed.
|
2706
|
+
#
|
2707
|
+
# server : str, optional
|
2708
|
+
# The name of the server. If not provided, the default server name is used.
|
2709
|
+
#
|
2710
|
+
# Returns
|
2711
|
+
# -------
|
2712
|
+
# str
|
2713
|
+
# The GUID of the initiated action or "Action not initiated" if the action was not initiated.
|
2714
|
+
#
|
2715
|
+
# """
|
2716
|
+
# server = self.view_server if server is None else server
|
2717
|
+
# url = (f"{self.curation_command_root}/governance-action-types/"
|
2718
|
+
# f"initiate")
|
2719
|
+
#
|
2720
|
+
# body = {"class": "InitiateGovernanceActionTypeRequestBody",
|
2721
|
+
# "governanceActionTypeQualifiedName": "AssetSurvey:survey-unity-catalog-server", "actionTargets": [
|
2722
|
+
# {"class": "NewActionTarget", "actionTargetName": "serverToSurvey", "actionTargetGUID": uc_server_guid}]}
|
2723
|
+
# response = await self._async_make_request("POST", url, body)
|
2724
|
+
# return response.json().get("guid", "Action not initiated")
|
2725
|
+
#
|
2726
|
+
# def initiate_uc_server_survey(self, uc_server_guid: str) -> str:
|
2727
|
+
# """ Initiate survey of a Unity Catalog server. Async Version.
|
2728
|
+
# Parameters
|
2729
|
+
# ----------
|
2730
|
+
# Unity Catalog_server_guid : str
|
2731
|
+
# The GUID of the Kafka server to be surveyed.
|
2732
|
+
#
|
2733
|
+
# server : str, optional
|
2734
|
+
# The name of the server. If not provided, the default server name is used.
|
2735
|
+
#
|
2736
|
+
# Returns
|
2737
|
+
# -------
|
2738
|
+
# str
|
2739
|
+
# The GUID of the initiated action or "Action not initiated" if the action was not initiated.
|
2740
|
+
#
|
2741
|
+
# """
|
2742
|
+
# loop = asyncio.get_event_loop()
|
2743
|
+
# response = loop.run_until_complete(self._async_initiate_uc_server_survey(uc_server_guid))
|
2744
|
+
# return response
|
2745
|
+
|
2746
|
+
#
|
2747
|
+
# Initiate general engine action
|
2748
|
+
#
|
2749
|
+
|
2750
|
+
async def _async_initiate_engine_action(
|
2751
|
+
self,
|
2752
|
+
qualified_name: str,
|
2753
|
+
domain_identifier: int,
|
2754
|
+
display_name: str,
|
2755
|
+
description: str,
|
2756
|
+
request_source_guids: str,
|
2757
|
+
action_targets: str,
|
2758
|
+
received_guards: [str],
|
2759
|
+
start_time: datetime,
|
2760
|
+
request_type: str,
|
2761
|
+
request_parameters: dict,
|
2762
|
+
process_name: str,
|
2763
|
+
request_src_name: str = None,
|
2764
|
+
originator_svc_name: str = None,
|
2765
|
+
originator_eng_name: str = None,
|
2766
|
+
) -> str:
|
2767
|
+
"""Create an engine action in the metadata store that will trigger the governance service associated with
|
2768
|
+
the supplied request type. The engine action remains to act as a record of the actions taken for auditing.
|
2769
|
+
Async version.
|
2770
|
+
|
2771
|
+
Parameters
|
2772
|
+
----------
|
2773
|
+
qualified_name (str): The qualified name of the governance action.
|
2774
|
+
domain_identifier (int): The domain identifier for the governance action.
|
2775
|
+
display_name (str): The display name of the governance action.
|
2776
|
+
description (str): The description of the governance action.
|
2777
|
+
request_source_guids (str): GUIDs of the sources initiating the request.
|
2778
|
+
action_targets (str): Targets of the governance action.
|
2779
|
+
received_guards (List[str]): List of guards received for the action.
|
2780
|
+
start_time (datetime): The start time for the governance action.
|
2781
|
+
request_type (str): The type of the governance action request.
|
2782
|
+
request_parameters (dict): Additional parameters for the governance action.
|
2783
|
+
process_name (str): The name of the associated governance action process.
|
2784
|
+
request_src_name (str, optional): The name of the request source. Defaults to None.
|
2785
|
+
originator_svc_name (str, optional): The name of the originator service. Defaults to None.
|
2786
|
+
originator_eng_name (str, optional): The name of the originator engine. Defaults to None.
|
2787
|
+
|
2788
|
+
Returns
|
2789
|
+
-------
|
2790
|
+
str: The GUID (Globally Unique Identifier) of the initiated governance action.
|
2791
|
+
|
2792
|
+
Raises
|
2793
|
+
------
|
2794
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2795
|
+
this exception is raised with details from the response content.
|
2796
|
+
|
2797
|
+
Note
|
2798
|
+
----
|
2799
|
+
The `start_time` parameter should be a `datetime` object representing the start time of the
|
2800
|
+
governance action.
|
2801
|
+
|
2802
|
+
|
2803
|
+
"""
|
2804
|
+
|
2805
|
+
url = (
|
2806
|
+
f"{self.curation_command_root}/governance-engines/"
|
2807
|
+
f"engine-actions/initiate"
|
2808
|
+
)
|
2809
|
+
body = {
|
2810
|
+
"class": "GovernanceActionRequestBody",
|
2811
|
+
"qualifiedName": qualified_name + str(int(start_time.timestamp())),
|
2812
|
+
"domainIdentifier": domain_identifier,
|
2813
|
+
"displayName": display_name,
|
2814
|
+
"description": description,
|
2815
|
+
"requestSourceGUIDs": request_source_guids,
|
2816
|
+
"actionTargets": action_targets,
|
2817
|
+
"receivedGuards": received_guards,
|
2818
|
+
"startTime": int(start_time.timestamp() * 1000),
|
2819
|
+
"requestType": request_type,
|
2820
|
+
"requestParameters": request_parameters,
|
2821
|
+
"processName": process_name,
|
2822
|
+
"requestSourceName": request_src_name,
|
2823
|
+
"originatorServiceName": originator_svc_name,
|
2824
|
+
"originatorEngineName": originator_eng_name,
|
2825
|
+
}
|
2826
|
+
new_body = body_slimmer(body)
|
2827
|
+
response = await self._async_make_request("POST", url, new_body)
|
2828
|
+
return response.json().get("guid", "Action not initiated")
|
2829
|
+
|
2830
|
+
def initiate_engine_action(
|
2831
|
+
self,
|
2832
|
+
qualified_name: str,
|
2833
|
+
domain_identifier: int,
|
2834
|
+
display_name: str,
|
2835
|
+
description: str,
|
2836
|
+
request_source_guids: str,
|
2837
|
+
action_targets: str,
|
2838
|
+
received_guards: [str],
|
2839
|
+
start_time: datetime,
|
2840
|
+
request_type: str,
|
2841
|
+
request_parameters: dict,
|
2842
|
+
process_name: str,
|
2843
|
+
request_src_name: str = None,
|
2844
|
+
originator_svc_name: str = None,
|
2845
|
+
originator_eng_name: str = None,
|
2846
|
+
) -> str:
|
2847
|
+
"""Create an engine action in the metadata store that will trigger the governance service associated with
|
2848
|
+
the supplied request type. The engine action remains to act as a record of the actions taken for auditing.
|
2849
|
+
|
2850
|
+
Parameters
|
2851
|
+
----------
|
2852
|
+
qualified_name (str): The qualified name of the governance action.
|
2853
|
+
domain_identifier (int): The domain identifier for the governance action.
|
2854
|
+
display_name (str): The display name of the governance action.
|
2855
|
+
description (str): The description of the governance action.
|
2856
|
+
request_source_guids (str): GUIDs of the sources initiating the request.
|
2857
|
+
action_targets (str): Targets of the governance action.
|
2858
|
+
received_guards (List[str]): List of guards received for the action.
|
2859
|
+
start_time (datetime): The start time for the governance action.
|
2860
|
+
gov_engine_name (str): The name of the governance engine associated with the action.
|
2861
|
+
request_type (str): The type of the governance action request.
|
2862
|
+
request_parameters (dict): Additional parameters for the governance action.
|
2863
|
+
process_name (str): The name of the associated governance action process.
|
2864
|
+
request_src_name (str, optional): The name of the request source. Defaults to None.
|
2865
|
+
originator_svc_name (str, optional): The name of the originator service. Defaults to None.
|
2866
|
+
originator_eng_name (str, optional): The name of the originator engine. Defaults to None.
|
2867
|
+
|
2868
|
+
Returns
|
2869
|
+
-------
|
2870
|
+
str: The GUID (Globally Unique Identifier) of the initiated governance action.
|
2871
|
+
|
2872
|
+
Raises
|
2873
|
+
------
|
2874
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2875
|
+
this exception is raised with details from the response content.
|
2876
|
+
|
2877
|
+
Note
|
2878
|
+
----
|
2879
|
+
The `start_time` parameter should be a `datetime` object representing the start time of the
|
2880
|
+
governance action.
|
2881
|
+
"""
|
2882
|
+
loop = asyncio.get_event_loop()
|
2883
|
+
response = loop.run_until_complete(
|
2884
|
+
self._async_initiate_engine_action(
|
2885
|
+
qualified_name,
|
2886
|
+
domain_identifier,
|
2887
|
+
display_name,
|
2888
|
+
description,
|
2889
|
+
request_source_guids,
|
2890
|
+
action_targets,
|
2891
|
+
received_guards,
|
2892
|
+
start_time,
|
2893
|
+
request_type,
|
2894
|
+
request_parameters,
|
2895
|
+
process_name,
|
2896
|
+
request_src_name,
|
2897
|
+
originator_svc_name,
|
2898
|
+
originator_eng_name,
|
2899
|
+
)
|
2900
|
+
)
|
2901
|
+
return response
|
2902
|
+
|
2903
|
+
async def _async_get_catalog_targets(
|
2904
|
+
self,
|
2905
|
+
integ_connector_guid: str,
|
2906
|
+
start_from: int = 0,
|
2907
|
+
page_size: int = max_paging_size,
|
2908
|
+
) -> list | str:
|
2909
|
+
"""Retrieve the details of the metadata elements identified as catalog targets with an integration connector.
|
2910
|
+
Async version.
|
2911
|
+
|
2912
|
+
Parameters:
|
2913
|
+
----------
|
2914
|
+
integ_connector_guid: str
|
2915
|
+
The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
|
2916
|
+
Returns:
|
2917
|
+
-------
|
2918
|
+
[dict]: The list of catalog targets JSON objects.
|
2919
|
+
|
2920
|
+
Raises:
|
2921
|
+
------
|
2922
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2923
|
+
this exception is raised with details from the response content.
|
2924
|
+
PropertyServerException: If the API response indicates a server side error.
|
2925
|
+
UserNotAuthorizedException:
|
2926
|
+
"""
|
2927
|
+
|
2928
|
+
validate_guid(integ_connector_guid)
|
2929
|
+
|
2930
|
+
url = (
|
2931
|
+
f"{self.curation_command_root}/integration-connectors/"
|
2932
|
+
f"{integ_connector_guid}/catalog-targets?startFrom={start_from}&pageSize={page_size}"
|
2933
|
+
)
|
2934
|
+
|
2935
|
+
response = await self._async_make_request("GET", url)
|
2936
|
+
return response.json().get("elements", "no targets")
|
2937
|
+
|
2938
|
+
def get_catalog_targets(
|
2939
|
+
self,
|
2940
|
+
integ_connector_guid: str,
|
2941
|
+
start_from: int = 0,
|
2942
|
+
page_size: int = max_paging_size,
|
2943
|
+
) -> list | str:
|
2944
|
+
"""Retrieve the details of the metadata elements identified as catalog targets with an integration connector.
|
2945
|
+
|
2946
|
+
Parameters:
|
2947
|
+
----------
|
2948
|
+
integ_connector_guid: str
|
2949
|
+
The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
|
2950
|
+
Returns:
|
2951
|
+
-------
|
2952
|
+
[dict]: The list of catalog targets JSON objects.
|
2953
|
+
|
2954
|
+
Raises:
|
2955
|
+
------
|
2956
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2957
|
+
this exception is raised with details from the response content.
|
2958
|
+
PropertyServerException: If the API response indicates a server side error.
|
2959
|
+
UserNotAuthorizedException:
|
2960
|
+
"""
|
2961
|
+
|
2962
|
+
loop = asyncio.get_event_loop()
|
2963
|
+
response = loop.run_until_complete(
|
2964
|
+
self._async_get_catalog_targets(integ_connector_guid, start_from, page_size)
|
2965
|
+
)
|
2966
|
+
return response
|
2967
|
+
|
2968
|
+
async def _async_get_catalog_target(self, relationship_guid: str) -> dict | str:
|
2969
|
+
"""Retrieve a specific catalog target associated with an integration connector. Further Information:
|
2970
|
+
https://egeria-project.org/concepts/integration-connector/ . Async version.
|
2971
|
+
|
2972
|
+
Parameters:
|
2973
|
+
----------
|
2974
|
+
relationship_guid: str
|
2975
|
+
The GUID (Globally Unique Identifier) identifying the catalog targets for an integration connector.
|
2976
|
+
|
2977
|
+
Returns:
|
2978
|
+
-------
|
2979
|
+
dict: JSON structure of the catalog target.
|
2980
|
+
|
2981
|
+
Raises:
|
2982
|
+
------
|
2983
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2984
|
+
this exception is raised with details from the response content.
|
2985
|
+
PropertyServerException: If the API response indicates a server side error.
|
2986
|
+
UserNotAuthorizedException:
|
2987
|
+
"""
|
2988
|
+
|
2989
|
+
validate_guid(relationship_guid)
|
2990
|
+
|
2991
|
+
url = f"{self.curation_command_root}/catalog-targets/" f"{relationship_guid}"
|
2992
|
+
|
2993
|
+
response = await self._async_make_request("GET", url)
|
2994
|
+
return response.json().get("element", "no actions")
|
2995
|
+
|
2996
|
+
def get_catalog_target(self, relationship_guid: str) -> dict | str:
|
2997
|
+
"""Retrieve a specific catalog target associated with an integration connector. Further Information:
|
2998
|
+
https://egeria-project.org/concepts/integration-connector/ .
|
2999
|
+
|
3000
|
+
Parameters:
|
3001
|
+
----------
|
3002
|
+
relationship_guid: str
|
3003
|
+
The GUID (Globally Unique Identifier) identifying the catalog targets for an integration connector.
|
3004
|
+
|
3005
|
+
Returns:
|
3006
|
+
-------
|
3007
|
+
dict: JSON structure of the catalog target.
|
3008
|
+
|
3009
|
+
Raises:
|
3010
|
+
------
|
3011
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3012
|
+
this exception is raised with details from the response content.
|
3013
|
+
PropertyServerException: If the API response indicates a server side error.
|
3014
|
+
UserNotAuthorizedException:
|
3015
|
+
"""
|
3016
|
+
|
3017
|
+
loop = asyncio.get_event_loop()
|
3018
|
+
response = loop.run_until_complete(
|
3019
|
+
self._async_get_catalog_target(relationship_guid)
|
3020
|
+
)
|
3021
|
+
return response
|
3022
|
+
|
3023
|
+
async def _async_add_catalog_target(
|
3024
|
+
self,
|
3025
|
+
integ_connector_guid: str,
|
3026
|
+
metadata_element_guid: str,
|
3027
|
+
catalog_target_name: str,
|
3028
|
+
connection_name: str = None,
|
3029
|
+
metadata_src_qual_name: str = None,
|
3030
|
+
config_properties: dict = None,
|
3031
|
+
template_properties: dict = None,
|
3032
|
+
permitted_sync: str = "BOTH_DIRECTIONS",
|
3033
|
+
delete_method: str = "ARCHIVE",
|
3034
|
+
) -> str:
|
3035
|
+
"""Add a catalog target to an integration connector and .
|
3036
|
+
Async version.
|
3037
|
+
|
3038
|
+
Parameters:
|
3039
|
+
----------
|
3040
|
+
integ_connector_guid: str
|
3041
|
+
The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
|
3042
|
+
metadata_element_guid: str
|
3043
|
+
The specific metadata element target we want to retrieve.
|
3044
|
+
catalog_target_name : dict
|
3045
|
+
Name of the catalog target to add.
|
3046
|
+
connection_name: str, default = None
|
3047
|
+
Optional name of connection to use for this catalog target when multiple connections defined.
|
3048
|
+
metadata_src_qual_name: str
|
3049
|
+
The qualified name of the metadata source for the catalog target
|
3050
|
+
config_properties: dict
|
3051
|
+
Configuration properties for the catalog target
|
3052
|
+
template_properties: dict
|
3053
|
+
Template properties to pass
|
3054
|
+
permitted_sync: str, default = BOTH_DIRECTIONS
|
3055
|
+
Direction the metadata is allowed to flow (BOTH_DIRECTIONS, FROM_THIRD_PARTH, TO_THIRD_PARTY
|
3056
|
+
delete_method: str, default = ARCHIVE
|
3057
|
+
Controls the type of delete. Use ARCHIVE for lineage considerations. Alternative is SOFT_DELETE.
|
3058
|
+
Returns:
|
3059
|
+
-------
|
3060
|
+
Relationship GUID for the catalog target,
|
3061
|
+
|
3062
|
+
Raises:
|
3063
|
+
------
|
3064
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3065
|
+
this exception is raised with details from the response content.
|
3066
|
+
PropertyServerException: If the API response indicates a server side error.
|
3067
|
+
UserNotAuthorizedException:
|
3068
|
+
"""
|
3069
|
+
|
3070
|
+
validate_guid(integ_connector_guid)
|
3071
|
+
validate_guid(metadata_element_guid)
|
3072
|
+
|
3073
|
+
url = (
|
3074
|
+
f"{self.curation_command_root}/integration-connectors/"
|
3075
|
+
f"{integ_connector_guid}/catalog-targets/{metadata_element_guid}"
|
3076
|
+
)
|
3077
|
+
body = {
|
3078
|
+
"catalogTargetName": catalog_target_name,
|
3079
|
+
"metadataSourceQualifiedName": metadata_src_qual_name,
|
3080
|
+
"configProperties": config_properties,
|
3081
|
+
"templateProperties": template_properties,
|
3082
|
+
"connectionName": connection_name,
|
3083
|
+
"permittedSynchronization": permitted_sync,
|
3084
|
+
"deleteMethod": delete_method,
|
3085
|
+
}
|
3086
|
+
|
3087
|
+
response = await self._async_make_request("POST", url, body)
|
3088
|
+
return response.json().get("guid", "No Guid returned")
|
3089
|
+
|
3090
|
+
def add_catalog_target(
|
3091
|
+
self,
|
3092
|
+
integ_connector_guid: str,
|
3093
|
+
metadata_element_guid: str,
|
3094
|
+
catalog_target_name: str,
|
3095
|
+
connection_name: str = None,
|
3096
|
+
metadata_src_qual_name: str = None,
|
3097
|
+
config_properties: dict = None,
|
3098
|
+
template_properties: dict = None,
|
3099
|
+
permitted_sync: str = "BOTH_DIRECTIONS",
|
3100
|
+
delete_method: str = "ARCHIVE",
|
3101
|
+
) -> str:
|
3102
|
+
"""Add a catalog target to an integration connector and .
|
3103
|
+
|
3104
|
+
Parameters:
|
3105
|
+
----------
|
3106
|
+
integ_connector_guid: str
|
3107
|
+
The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
|
3108
|
+
metadata_element_guid: str
|
3109
|
+
The specific metadata element target we want to retrieve.
|
3110
|
+
catalog_target_name : dict
|
3111
|
+
Name of the catalog target to add.
|
3112
|
+
connection_name: str, default = None
|
3113
|
+
Optional name of connection to use for this catalog target when multiple connections defined.
|
3114
|
+
metadata_src_qual_name: str
|
3115
|
+
The qualified name of the metadata source for the catalog target
|
3116
|
+
config_properties: dict
|
3117
|
+
Configuration properties for the catalog target
|
3118
|
+
template_properties: dict
|
3119
|
+
Template properties to pass
|
3120
|
+
permitted_sync: str, default = BOTH_DIRECTIONS
|
3121
|
+
Direction the metadata is allowed to flow (BOTH_DIRECTIONS, FROM_THIRD_PARTH, TO_THIRD_PARTY
|
3122
|
+
delete_method: str, default = ARCHIVE
|
3123
|
+
Controls the type of delete. Use ARCHIVE for lineage considerations. Alternative is SOFT_DELETE.
|
3124
|
+
Returns:
|
3125
|
+
-------
|
3126
|
+
Relationship GUID for the catalog target,
|
3127
|
+
|
3128
|
+
Raises:
|
3129
|
+
------
|
3130
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3131
|
+
this exception is raised with details from the response content.
|
3132
|
+
PropertyServerException: If the API response indicates a server side error.
|
3133
|
+
UserNotAuthorizedException:
|
3134
|
+
"""
|
3135
|
+
loop = asyncio.get_event_loop()
|
3136
|
+
response = loop.run_until_complete(
|
3137
|
+
self._async_add_catalog_target(
|
3138
|
+
integ_connector_guid,
|
3139
|
+
metadata_element_guid,
|
3140
|
+
catalog_target_name,
|
3141
|
+
connection_name,
|
3142
|
+
metadata_src_qual_name,
|
3143
|
+
config_properties,
|
3144
|
+
template_properties,
|
3145
|
+
permitted_sync,
|
3146
|
+
delete_method,
|
3147
|
+
)
|
3148
|
+
)
|
3149
|
+
return response
|
3150
|
+
|
3151
|
+
async def _async_update_catalog_target(
|
3152
|
+
self,
|
3153
|
+
relationship_guid: str,
|
3154
|
+
catalog_target_name: str,
|
3155
|
+
connection_name: str = None,
|
3156
|
+
metadata_src_qual_name: str = None,
|
3157
|
+
config_properties: dict = None,
|
3158
|
+
template_properties: dict = None,
|
3159
|
+
permitted_sync: str = "BOTH_DIRECTIONS",
|
3160
|
+
delete_method: str = "ARCHIVE",
|
3161
|
+
) -> None:
|
3162
|
+
"""Update a catalog target to an integration connector.
|
3163
|
+
Async version.
|
3164
|
+
|
3165
|
+
Parameters:
|
3166
|
+
----------
|
3167
|
+
relationship_guid: str
|
3168
|
+
The GUID (Globally Unique Identifier) of the relationship used to retrieve catalog targets.
|
3169
|
+
catalog_target_name : dict
|
3170
|
+
Name of the catalog target to add.
|
3171
|
+
connection_name: str, default = None
|
3172
|
+
Optional name of connection to use for this catalog target when multiple connections defined.
|
3173
|
+
metadata_src_qual_name: str
|
3174
|
+
The qualified name of the metadata source for the catalog target
|
3175
|
+
config_properties: dict
|
3176
|
+
Configuration properties for the catalog target
|
3177
|
+
template_properties: dict
|
3178
|
+
Template properties to pass
|
3179
|
+
permitted_sync: str, default = BOTH_DIRECTIONS
|
3180
|
+
Direction the metadata is allowed to flow (BOTH_DIRECTIONS, FROM_THIRD_PARTH, TO_THIRD_PARTY
|
3181
|
+
delete_method: str, default = ARCHIVE
|
3182
|
+
Controls the type of delete. Use ARCHIVE for lineage considerations. Alternative is SOFT_DELETE.
|
3183
|
+
Returns:
|
3184
|
+
-------
|
3185
|
+
None
|
3186
|
+
|
3187
|
+
Raises:
|
3188
|
+
------
|
3189
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3190
|
+
this exception is raised with details from the response content.
|
3191
|
+
PropertyServerException: If the API response indicates a server side error.
|
3192
|
+
UserNotAuthorizedException:
|
3193
|
+
"""
|
3194
|
+
|
3195
|
+
validate_guid(relationship_guid)
|
3196
|
+
|
3197
|
+
url = (
|
3198
|
+
f"{self.curation_command_root}/catalog-targets/"
|
3199
|
+
f"{relationship_guid}/update"
|
3200
|
+
)
|
3201
|
+
body = {
|
3202
|
+
"catalogTargetName": catalog_target_name,
|
3203
|
+
"metadataSourceQualifiedName": metadata_src_qual_name,
|
3204
|
+
"configProperties": config_properties,
|
3205
|
+
"templateProperties": template_properties,
|
3206
|
+
"connectionName": connection_name,
|
3207
|
+
"permittedSynchronization": permitted_sync,
|
3208
|
+
"deleteMethod": delete_method,
|
3209
|
+
}
|
3210
|
+
await self._async_make_request("POST", url, body)
|
3211
|
+
return
|
3212
|
+
|
3213
|
+
def update_catalog_target(
|
3214
|
+
self,
|
3215
|
+
relationship_guid: str,
|
3216
|
+
catalog_target_name: str,
|
3217
|
+
connection_name: str = None,
|
3218
|
+
metadata_src_qual_name: str = None,
|
3219
|
+
config_properties: dict = None,
|
3220
|
+
template_properties: dict = None,
|
3221
|
+
permitted_sync: str = "BOTH_DIRECTIONS",
|
3222
|
+
delete_method: str = "ARCHIVE",
|
3223
|
+
) -> None:
|
3224
|
+
"""Update a catalog target to an integration connector.
|
3225
|
+
|
3226
|
+
Parameters:
|
3227
|
+
----------
|
3228
|
+
relationship_guid: str
|
3229
|
+
The GUID (Globally Unique Identifier) of the relationship used to retrieve catalog targets.
|
3230
|
+
catalog_target_name : dict
|
3231
|
+
Name of the catalog target to add.
|
3232
|
+
connection_name: str, default = None
|
3233
|
+
Optional name of connection to use for this catalog target when multiple connections defined.
|
3234
|
+
metadata_src_qual_name: str
|
3235
|
+
The qualified name of the metadata source for the catalog target
|
3236
|
+
config_properties: dict
|
3237
|
+
Configuration properties for the catalog target
|
3238
|
+
template_properties: dict
|
3239
|
+
Template properties to pass
|
3240
|
+
permitted_sync: str, default = BOTH_DIRECTIONS
|
3241
|
+
Direction the metadata is allowed to flow (BOTH_DIRECTIONS, FROM_THIRD_PARTH, TO_THIRD_PARTY
|
3242
|
+
delete_method: str, default = ARCHIVE
|
3243
|
+
Controls the type of delete. Use ARCHIVE for lineage considerations. Alternative is SOFT_DELETE.
|
3244
|
+
server: str, optional
|
3245
|
+
"""
|
3246
|
+
|
3247
|
+
loop = asyncio.get_event_loop()
|
3248
|
+
loop.run_until_complete(
|
3249
|
+
self._async_update_catalog_target(
|
3250
|
+
relationship_guid,
|
3251
|
+
catalog_target_name,
|
3252
|
+
connection_name,
|
3253
|
+
metadata_src_qual_name,
|
3254
|
+
config_properties,
|
3255
|
+
template_properties,
|
3256
|
+
permitted_sync,
|
3257
|
+
delete_method,
|
3258
|
+
)
|
3259
|
+
)
|
3260
|
+
return
|
3261
|
+
|
3262
|
+
async def _async_remove_catalog_target(self, relationship_guid: str) -> None:
|
3263
|
+
"""Remove a catalog target to an integration connector. Async version.
|
3264
|
+
|
3265
|
+
Parameters:
|
3266
|
+
----------
|
3267
|
+
relationship_guid: str
|
3268
|
+
The GUID (Globally Unique Identifier) identifying the catalog target relationship.
|
3269
|
+
|
3270
|
+
Returns:
|
3271
|
+
-------
|
3272
|
+
None
|
3273
|
+
|
3274
|
+
Raises:
|
3275
|
+
------
|
3276
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3277
|
+
this exception is raised with details from the response content.
|
3278
|
+
PropertyServerException: If the API response indicates a server side error.
|
3279
|
+
UserNotAuthorizedException:
|
3280
|
+
"""
|
3281
|
+
|
3282
|
+
validate_guid(relationship_guid)
|
3283
|
+
|
3284
|
+
url = (
|
3285
|
+
f"{self.curation_command_root}/catalog-targets/"
|
3286
|
+
f"{relationship_guid}/remove"
|
3287
|
+
)
|
3288
|
+
|
3289
|
+
await self._async_make_request("POST", url)
|
3290
|
+
return
|
3291
|
+
|
3292
|
+
def remove_catalog_target(self, relationship_guid: str) -> None:
|
3293
|
+
"""Remove a catalog target to an integration connector.
|
3294
|
+
|
3295
|
+
Parameters:
|
3296
|
+
----------
|
3297
|
+
relationship_guid: str
|
3298
|
+
The GUID (Globally Unique Identifier) identifying the catalog target relationship.
|
3299
|
+
|
3300
|
+
Returns:
|
3301
|
+
-------
|
3302
|
+
None
|
3303
|
+
|
3304
|
+
Raises:
|
3305
|
+
------
|
3306
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3307
|
+
this exception is raised with details from the response content.
|
3308
|
+
PropertyServerException: If the API response indicates a server side error.
|
3309
|
+
UserNotAuthorizedException:
|
3310
|
+
"""
|
3311
|
+
|
3312
|
+
loop = asyncio.get_event_loop()
|
3313
|
+
loop.run_until_complete(self._async_remove_catalog_target(relationship_guid))
|
3314
|
+
return
|
3315
|
+
|
3316
|
+
#
|
3317
|
+
# Get information about technologies
|
3318
|
+
#
|
3319
|
+
|
3320
|
+
async def _async_get_tech_types_for_open_metadata_type(
|
3321
|
+
self,
|
3322
|
+
type_name: str,
|
3323
|
+
tech_name: str,
|
3324
|
+
start_from: int = 0,
|
3325
|
+
page_size: int = max_paging_size,
|
3326
|
+
) -> list | str:
|
3327
|
+
"""Retrieve the list of deployed implementation type metadata elements linked to a particular
|
3328
|
+
open metadata type.. Async version.
|
3329
|
+
|
3330
|
+
Parameters:
|
3331
|
+
----------
|
3332
|
+
type_name: str
|
3333
|
+
The technology type we are looking for.
|
3334
|
+
tech_name: str
|
3335
|
+
The technology name we are looking for.
|
3336
|
+
|
3337
|
+
Returns:
|
3338
|
+
-------
|
3339
|
+
[dict] | str: List of elements describing the technology - or "no tech found" if not found.
|
3340
|
+
|
3341
|
+
Raises:
|
3342
|
+
------
|
3343
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3344
|
+
this exception is raised with details from the response content.
|
3345
|
+
PropertyServerException: If the API response indicates a server side error.
|
3346
|
+
UserNotAuthorizedException:
|
3347
|
+
|
3348
|
+
Notes
|
3349
|
+
-----
|
3350
|
+
More information can be found at: https://egeria-project.org/types
|
3351
|
+
"""
|
3352
|
+
|
3353
|
+
# validate_name(type_name)
|
3354
|
+
url = (
|
3355
|
+
f"{self.curation_command_root}/open-metadata-types/"
|
3356
|
+
f"{type_name}/technology-types?startFrom={start_from}&pageSize={page_size}"
|
3357
|
+
)
|
3358
|
+
body = {"filter": tech_name}
|
3359
|
+
|
3360
|
+
response = await self._async_make_request("GET", url, body)
|
3361
|
+
return response.json().get("elements", "no tech found")
|
3362
|
+
|
3363
|
+
def get_tech_types_for_open_metadata_type(
|
3364
|
+
self,
|
3365
|
+
type_name: str,
|
3366
|
+
tech_name: str,
|
3367
|
+
start_from: int = 0,
|
3368
|
+
page_size: int = max_paging_size,
|
3369
|
+
) -> list | str:
|
3370
|
+
"""Retrieve the list of deployed implementation type metadata elements linked to a particular
|
3371
|
+
open metadata type.
|
3372
|
+
|
3373
|
+
Parameters:
|
3374
|
+
----------
|
3375
|
+
type_name: str
|
3376
|
+
The technology type we are looking for.
|
3377
|
+
tech_name: str
|
3378
|
+
The technology name we are looking for.
|
3379
|
+
|
3380
|
+
Returns:
|
3381
|
+
-------
|
3382
|
+
[dict] | str: List of elements describing the technology - or "no tech found" if not found.
|
3383
|
+
|
3384
|
+
Raises:
|
3385
|
+
------
|
3386
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3387
|
+
this exception is raised with details from the response content.
|
3388
|
+
PropertyServerException: If the API response indicates a server side error.
|
3389
|
+
UserNotAuthorizedException:
|
3390
|
+
|
3391
|
+
Notes
|
3392
|
+
-----
|
3393
|
+
More information can be found at: https://egeria-project.org/types
|
3394
|
+
"""
|
3395
|
+
loop = asyncio.get_event_loop()
|
3396
|
+
response = loop.run_until_complete(
|
3397
|
+
self._async_get_tech_types_for_open_metadata_type(
|
3398
|
+
type_name, tech_name, start_from, page_size
|
3399
|
+
)
|
3400
|
+
)
|
3401
|
+
return response
|
3402
|
+
|
3403
|
+
async def _async_get_technology_type_detail(self, type_name: str) -> list | str:
|
3404
|
+
"""Retrieve the details of the named technology type. This name should be the name of the technology type
|
3405
|
+
and contain no wild cards. Async version.
|
3406
|
+
Parameters
|
3407
|
+
----------
|
3408
|
+
type_name : str
|
3409
|
+
The name of the technology type to retrieve detailed information for.
|
3410
|
+
|
3411
|
+
|
3412
|
+
Returns
|
3413
|
+
-------
|
3414
|
+
list[dict] | str
|
3415
|
+
A list of dictionaries containing the detailed information for the specified technology type.
|
3416
|
+
If the technology type is not found, returns the string "no type found".
|
3417
|
+
Raises
|
3418
|
+
------
|
3419
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3420
|
+
this exception is raised with details from the response content.
|
3421
|
+
PropertyServerException: If the API response indicates a server side error.
|
3422
|
+
UserNotAuthorizedException:
|
3423
|
+
|
3424
|
+
Notes
|
3425
|
+
-----
|
3426
|
+
More information can be found at: https://egeria-project.org/concepts/deployed-implementation-type
|
3427
|
+
"""
|
3428
|
+
|
3429
|
+
# validate_name(type_name)
|
3430
|
+
url = f"{self.curation_command_root}/technology-types/by-name"
|
3431
|
+
|
3432
|
+
body = {"filter": type_name}
|
3433
|
+
|
3434
|
+
response = await self._async_make_request("POST", url, body)
|
3435
|
+
return response.json().get("element", "no type found")
|
3436
|
+
|
3437
|
+
def get_technology_type_detail(self, type_name: str) -> list | str:
|
3438
|
+
"""Retrieve the details of the named technology type. This name should be the name of the technology type
|
3439
|
+
and contain no wild cards.
|
3440
|
+
Parameters
|
3441
|
+
----------
|
3442
|
+
type_name : str
|
3443
|
+
The name of the technology type to retrieve detailed information for.
|
3444
|
+
|
3445
|
+
Returns
|
3446
|
+
-------
|
3447
|
+
list[dict] | str
|
3448
|
+
A list of dictionaries containing the detailed information for the specified technology type.
|
3449
|
+
If the technology type is not found, returns the string "no type found".
|
3450
|
+
Raises
|
3451
|
+
------
|
3452
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3453
|
+
this exception is raised with details from the response content.
|
3454
|
+
PropertyServerException: If the API response indicates a server side error.
|
3455
|
+
UserNotAuthorizedException:
|
3456
|
+
|
3457
|
+
Notes
|
3458
|
+
-----
|
3459
|
+
More information can be found at: https://egeria-project.org/concepts/deployed-implementation-type
|
3460
|
+
"""
|
3461
|
+
|
3462
|
+
loop = asyncio.get_event_loop()
|
3463
|
+
response = loop.run_until_complete(
|
3464
|
+
self._async_get_technology_type_detail(type_name)
|
3465
|
+
)
|
3466
|
+
return response
|
3467
|
+
|
3468
|
+
async def _async_find_technology_types(
|
3469
|
+
self,
|
3470
|
+
search_string: str = "*",
|
3471
|
+
start_from: int = 0,
|
3472
|
+
page_size: int = max_paging_size,
|
3473
|
+
starts_with: bool = False,
|
3474
|
+
ends_with: bool = False,
|
3475
|
+
ignore_case: bool = True,
|
3476
|
+
) -> list | str:
|
3477
|
+
"""Retrieve the list of technology types that contain the search string. Async version.
|
3478
|
+
|
3479
|
+
Parameters:
|
3480
|
+
----------
|
3481
|
+
type_name: str
|
3482
|
+
The technology type we are looking for.
|
3483
|
+
starts_with : bool, optional
|
3484
|
+
Whether to search engine actions that start with the given search string. Default is False.
|
3485
|
+
|
3486
|
+
ends_with : bool, optional
|
3487
|
+
Whether to search engine actions that end with the given search string. Default is False.
|
3488
|
+
|
3489
|
+
ignore_case : bool, optional
|
3490
|
+
Whether to ignore case while searching engine actions. Default is True.
|
3491
|
+
|
3492
|
+
start_from : int, optional
|
3493
|
+
The index from which to start fetching the engine actions. Default is 0.
|
3494
|
+
|
3495
|
+
page_size : int, optional
|
3496
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
3497
|
+
Returns:
|
3498
|
+
-------
|
3499
|
+
[dict] | str: List of elements describing the technology - or "no tech found" if not found.
|
3500
|
+
|
3501
|
+
Raises:
|
3502
|
+
------
|
3503
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3504
|
+
this exception is raised with details from the response content.
|
3505
|
+
PropertyServerException: If the API response indicates a server side error.
|
3506
|
+
UserNotAuthorizedException:
|
3507
|
+
|
3508
|
+
Notes
|
3509
|
+
-----
|
3510
|
+
For more information see: https://egeria-project.org/concepts/deployed-implementation-type
|
3511
|
+
"""
|
3512
|
+
|
3513
|
+
starts_with_s = str(starts_with).lower()
|
3514
|
+
ends_with_s = str(ends_with).lower()
|
3515
|
+
ignore_case_s = str(ignore_case).lower()
|
3516
|
+
validate_name(search_string)
|
3517
|
+
if search_string == "*":
|
3518
|
+
search_string = ""
|
3519
|
+
|
3520
|
+
url = (
|
3521
|
+
f"{self.curation_command_root}/technology-types/"
|
3522
|
+
f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
3523
|
+
f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
|
3524
|
+
)
|
3525
|
+
body = {"filter": search_string}
|
3526
|
+
|
3527
|
+
response = await self._async_make_request("POST", url, body)
|
3528
|
+
return response.json().get("elements", "no tech found")
|
3529
|
+
|
3530
|
+
def find_technology_types(
|
3531
|
+
self,
|
3532
|
+
search_string: str = "*",
|
3533
|
+
start_from: int = 0,
|
3534
|
+
page_size: int = max_paging_size,
|
3535
|
+
starts_with: bool = False,
|
3536
|
+
ends_with: bool = False,
|
3537
|
+
ignore_case: bool = True,
|
3538
|
+
) -> list | str:
|
3539
|
+
"""Retrieve the list of technology types that contain the search string. Async version.
|
3540
|
+
|
3541
|
+
Parameters:
|
3542
|
+
----------
|
3543
|
+
type_name: str
|
3544
|
+
The technology type we are looking for.
|
3545
|
+
|
3546
|
+
Returns:
|
3547
|
+
-------
|
3548
|
+
[dict] | str: List of elements describing the technology - or "no tech found" if not found.
|
3549
|
+
|
3550
|
+
Raises:
|
3551
|
+
------
|
3552
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3553
|
+
this exception is raised with details from the response content.
|
3554
|
+
PropertyServerException: If the API response indicates a server side error.
|
3555
|
+
UserNotAuthorizedException:
|
3556
|
+
|
3557
|
+
Notes
|
3558
|
+
-----
|
3559
|
+
For more information see: https://egeria-project.org/concepts/deployed-implementation-type
|
3560
|
+
"""
|
3561
|
+
|
3562
|
+
loop = asyncio.get_event_loop()
|
3563
|
+
response = loop.run_until_complete(
|
3564
|
+
self._async_find_technology_types(
|
3565
|
+
search_string,
|
3566
|
+
start_from,
|
3567
|
+
page_size,
|
3568
|
+
starts_with,
|
3569
|
+
ends_with,
|
3570
|
+
ignore_case,
|
3571
|
+
)
|
3572
|
+
)
|
3573
|
+
return response
|
3574
|
+
|
3575
|
+
async def _async_get_all_technology_types(
|
3576
|
+
self, start_from: int = 0, page_size: int = max_paging_size
|
3577
|
+
) -> list | str:
|
3578
|
+
"""Get all technology types - async version"""
|
3579
|
+
return await self._async_find_technology_types("*", start_from, page_size)
|
3580
|
+
|
3581
|
+
def get_all_technology_types(
|
3582
|
+
self, start_from: int = 0, page_size: int = max_paging_size
|
3583
|
+
) -> list | str:
|
3584
|
+
"""Get all technology types"""
|
3585
|
+
return self.find_technology_types("*", start_from, page_size)
|
3586
|
+
|
3587
|
+
def print_engine_action_summary(self, governance_action: dict):
|
3588
|
+
"""print_governance_action_summary
|
3589
|
+
|
3590
|
+
Print all the governance actions with their status, in the server.
|
3591
|
+
|
3592
|
+
Parameters
|
3593
|
+
----------
|
3594
|
+
|
3595
|
+
Returns
|
3596
|
+
-------
|
3597
|
+
|
3598
|
+
Raises
|
3599
|
+
------
|
3600
|
+
InvalidParameterException
|
3601
|
+
PropertyServerException
|
3602
|
+
UserNotAuthorizedException
|
3603
|
+
"""
|
3604
|
+
if governance_action:
|
3605
|
+
name = governance_action.get("displayName")
|
3606
|
+
if not name:
|
3607
|
+
name = governance_action.get("qualifiedName")
|
3608
|
+
action_status = governance_action.get("action_status")
|
3609
|
+
if governance_action.get("completion_guards"):
|
3610
|
+
completion_guards = governance_action.get("completion_guards")
|
3611
|
+
else:
|
3612
|
+
completion_guards = "\t"
|
3613
|
+
if governance_action.get("process_name"):
|
3614
|
+
process_name = governance_action.get("process_name")
|
3615
|
+
else:
|
3616
|
+
process_name = "\t"
|
3617
|
+
if governance_action.get("completion_message"):
|
3618
|
+
completion_message = governance_action.get("completion_message")
|
3619
|
+
else:
|
3620
|
+
completion_message = ""
|
3621
|
+
print(
|
3622
|
+
action_status
|
3623
|
+
+ "\n\t| "
|
3624
|
+
+ name
|
3625
|
+
+ "\t| "
|
3626
|
+
+ process_name
|
3627
|
+
+ "\t| "
|
3628
|
+
+ "%s" % ", ".join(map(str, completion_guards))
|
3629
|
+
+ "\t| "
|
3630
|
+
+ completion_message
|
3631
|
+
)
|
3632
|
+
|
3633
|
+
def print_engine_actions(self):
|
3634
|
+
"""print_governance_actions
|
3635
|
+
|
3636
|
+
Print all the governance actions with their status, in the server.
|
3637
|
+
|
3638
|
+
Parameters
|
3639
|
+
----------
|
3640
|
+
|
3641
|
+
Returns
|
3642
|
+
-------
|
3643
|
+
|
3644
|
+
Raises
|
3645
|
+
------
|
3646
|
+
InvalidParameterException
|
3647
|
+
PropertyServerException
|
3648
|
+
UserNotAuthorizedException
|
3649
|
+
|
3650
|
+
"""
|
3651
|
+
governance_actions = self.get_engine_actions()
|
3652
|
+
if governance_actions is not None:
|
3653
|
+
for x in range(len(governance_actions)):
|
3654
|
+
self.print_engine_action_summary(governance_actions[x])
|
3655
|
+
|
3656
|
+
async def _async_get_technology_type_elements(
|
3657
|
+
self,
|
3658
|
+
filter: str,
|
3659
|
+
effective_time: str = None,
|
3660
|
+
start_from: int = 0,
|
3661
|
+
page_size: int = max_paging_size,
|
3662
|
+
get_templates: bool = False,
|
3663
|
+
) -> list | str:
|
3664
|
+
"""Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed
|
3665
|
+
in the name. Async version.
|
3666
|
+
|
3667
|
+
Parameters:
|
3668
|
+
----------
|
3669
|
+
filter: str
|
3670
|
+
The name of the deployed technology implementation type to retrieve elements for.
|
3671
|
+
effective_time: datetime, [default=None], optional
|
3672
|
+
Effective time of the query. If not specified will default to any effective time. Time format is
|
3673
|
+
"YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
3674
|
+
|
3675
|
+
start_from : int, optional
|
3676
|
+
The index from which to start fetching the engine actions. Default is 0.
|
3677
|
+
|
3678
|
+
page_size : int, optional
|
3679
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
3680
|
+
|
3681
|
+
Returns:
|
3682
|
+
-------
|
3683
|
+
[dict] | str: List of elements describing the technology - or "no tech found" if not found.
|
3684
|
+
|
3685
|
+
Raises:
|
3686
|
+
------
|
3687
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3688
|
+
this exception is raised with details from the response content.
|
3689
|
+
PropertyServerException: If the API response indicates a server side error.
|
3690
|
+
UserNotAuthorizedException:
|
3691
|
+
|
3692
|
+
Notes
|
3693
|
+
-----
|
3694
|
+
For more information see: https://egeria-project.org/concepts/deployed-implementation-type
|
3695
|
+
"""
|
3696
|
+
|
3697
|
+
get_templates_s = str(get_templates).lower()
|
3698
|
+
validate_name(filter)
|
3699
|
+
|
3700
|
+
url = (
|
3701
|
+
f"{self.curation_command_root}/technology-types/elements?"
|
3702
|
+
f"startFrom={start_from}&pageSize={page_size}&getTemplates={get_templates_s}"
|
3703
|
+
)
|
3704
|
+
body = {"filter": filter, "effective_time": effective_time}
|
3705
|
+
|
3706
|
+
response = await self._async_make_request("POST", url, body)
|
3707
|
+
return response.json().get("elements", "no tech found")
|
3708
|
+
|
3709
|
+
def get_technology_type_elements(
|
3710
|
+
self,
|
3711
|
+
filter: str,
|
3712
|
+
effective_time: str = None,
|
3713
|
+
start_from: int = 0,
|
3714
|
+
page_size: int = max_paging_size,
|
3715
|
+
get_templates: bool = False,
|
3716
|
+
) -> list | str:
|
3717
|
+
"""Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed
|
3718
|
+
in the name.
|
3719
|
+
|
3720
|
+
Parameters:
|
3721
|
+
----------
|
3722
|
+
filter: str
|
3723
|
+
The name of the deployed technology implementation type to retrieve elements for.
|
3724
|
+
effective_time: datetime, [default=None], optional
|
3725
|
+
Effective time of the query. If not specified will default to any effective time. Time format is
|
3726
|
+
"YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
3727
|
+
|
3728
|
+
start_from : int, optional
|
3729
|
+
The index from which to start fetching the engine actions. Default is 0.
|
3730
|
+
|
3731
|
+
page_size : int, optional
|
3732
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
3733
|
+
|
3734
|
+
Returns:
|
3735
|
+
-------
|
3736
|
+
[dict] | str: List of elements describing the technology - or "no tech found" if not found.
|
3737
|
+
|
3738
|
+
Raises:
|
3739
|
+
------
|
3740
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
3741
|
+
this exception is raised with details from the response content.
|
3742
|
+
PropertyServerException: If the API response indicates a server side error.
|
3743
|
+
UserNotAuthorizedException:
|
3744
|
+
|
3745
|
+
Notes
|
3746
|
+
-----
|
3747
|
+
For more information see: https://egeria-project.org/concepts/deployed-implementation-type
|
3748
|
+
"""
|
3749
|
+
|
3750
|
+
loop = asyncio.get_event_loop()
|
3751
|
+
response = loop.run_until_complete(
|
3752
|
+
self._async_get_technology_type_elements(
|
3753
|
+
filter, effective_time, start_from, page_size, get_templates
|
3754
|
+
)
|
3755
|
+
)
|
3756
|
+
return response
|
3757
|
+
|
3758
|
+
|
3759
|
+
if __name__ == "__main__":
|
3760
|
+
print("Main-Automated Curation")
|