pyegeria 5.3.9.9.3__py3-none-any.whl → 5.5.3.3__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.
Potentially problematic release.
This version of pyegeria might be problematic. Click here for more details.
- commands/__init__.py +24 -0
- commands/cat/Dr-Egeria_md-orig.py +2 -2
- commands/cat/__init__.py +1 -17
- commands/cat/collection_actions.py +197 -0
- commands/cat/dr_egeria_command_help.py +372 -0
- commands/cat/dr_egeria_jupyter.py +7 -7
- commands/cat/dr_egeria_md.py +27 -182
- commands/cat/exp_list_glossaries.py +11 -14
- commands/cat/get_asset_graph.py +37 -267
- commands/cat/{get_collection.py → get_collection_tree.py} +10 -18
- commands/cat/get_project_dependencies.py +14 -14
- commands/cat/get_project_structure.py +15 -14
- commands/cat/get_tech_type_elements.py +16 -116
- commands/cat/glossary_actions.py +145 -298
- commands/cat/list_assets.py +3 -11
- commands/cat/list_cert_types.py +17 -63
- commands/cat/list_collections.py +46 -138
- commands/cat/list_deployed_catalogs.py +15 -27
- commands/cat/list_deployed_database_schemas.py +27 -43
- commands/cat/list_deployed_databases.py +16 -31
- commands/cat/list_deployed_servers.py +35 -54
- commands/cat/list_glossaries.py +18 -17
- commands/cat/list_projects.py +10 -12
- commands/cat/list_tech_type_elements.py +21 -37
- commands/cat/list_tech_types.py +13 -25
- commands/cat/list_terms.py +38 -79
- commands/cat/list_todos.py +4 -11
- commands/cat/list_user_ids.py +3 -10
- commands/cat/my_reports.py +559 -0
- commands/cat/run_report.py +394 -0
- commands/cat/run_report_orig.py +528 -0
- commands/cli/egeria.py +222 -247
- commands/cli/egeria_cat.py +68 -81
- commands/cli/egeria_my.py +13 -0
- commands/cli/egeria_ops.py +69 -74
- commands/cli/egeria_tech.py +17 -93
- commands/cli/ops_config.py +3 -6
- commands/{cat/list_categories.py → deprecated/list_data_designer.py} +53 -64
- commands/{cat/list_data_structures.py → deprecated/list_data_structures_full.py} +3 -6
- commands/deprecated/old_get_asset_graph.py +315 -0
- commands/my/__init__.py +0 -2
- commands/my/list_my_profile.py +27 -34
- commands/my/list_my_roles.py +1 -7
- commands/my/monitor_my_todos.py +1 -7
- commands/my/monitor_open_todos.py +6 -7
- commands/my/todo_actions.py +4 -5
- commands/ops/__init__.py +0 -2
- commands/ops/gov_server_actions.py +17 -21
- commands/ops/list_archives.py +17 -38
- commands/ops/list_catalog_targets.py +33 -40
- commands/ops/load_archive.py +35 -26
- commands/ops/{monitor_engine_activity_c.py → monitor_active_engine_activity.py} +51 -82
- commands/ops/{monitor_integ_daemon_status.py → monitor_daemon_status.py} +35 -55
- commands/ops/monitor_engine_activity.py +79 -77
- commands/ops/{monitor_gov_eng_status.py → monitor_engine_status.py} +10 -7
- commands/ops/monitor_platform_status.py +38 -50
- commands/ops/monitor_server_startup.py +6 -11
- commands/ops/monitor_server_status.py +7 -11
- commands/ops/orig_monitor_server_list.py +8 -8
- commands/ops/orig_monitor_server_status.py +1 -5
- commands/ops/refresh_integration_daemon.py +5 -5
- commands/ops/restart_integration_daemon.py +5 -5
- commands/ops/table_integ_daemon_status.py +6 -6
- commands/ops/x_engine_actions.py +7 -7
- commands/tech/__init__.py +0 -2
- commands/tech/{generic_actions.py → element_actions.py} +6 -11
- commands/tech/get_element_info.py +20 -29
- commands/tech/get_guid_info.py +23 -42
- commands/tech/get_tech_details.py +20 -35
- commands/tech/get_tech_type_template.py +28 -39
- commands/tech/list_all_om_type_elements.py +24 -30
- commands/tech/list_all_om_type_elements_x.py +22 -28
- commands/tech/list_all_related_elements.py +19 -28
- commands/tech/list_anchored_elements.py +22 -30
- commands/tech/list_asset_types.py +19 -24
- commands/tech/list_elements_by_classification_by_property_value.py +26 -32
- commands/tech/list_elements_by_property_value.py +19 -25
- commands/tech/list_elements_by_property_value_x.py +20 -28
- commands/tech/list_elements_for_classification.py +28 -41
- commands/tech/list_gov_action_processes.py +16 -27
- commands/tech/list_information_supply_chains.py +22 -30
- commands/tech/list_registered_services.py +14 -26
- commands/tech/list_related_elements_with_prop_value.py +15 -25
- commands/tech/list_related_specification.py +1 -4
- commands/tech/list_relationship_types.py +15 -25
- commands/tech/list_relationships.py +20 -36
- commands/tech/list_solution_blueprints.py +28 -33
- commands/tech/list_solution_components.py +23 -29
- commands/tech/list_solution_roles.py +21 -32
- commands/tech/list_tech_templates.py +51 -54
- commands/tech/list_valid_metadata_values.py +5 -9
- commands/tech/table_tech_templates.py +2 -6
- commands/tech/x_list_related_elements.py +1 -4
- examples/GeoSpatial Products Example.py +524 -0
- examples/Jupyter Notebooks/P-egeria-server-config.ipynb +2137 -0
- examples/Jupyter Notebooks/README.md +2 -0
- examples/Jupyter Notebooks/common/P-environment-check.ipynb +115 -0
- examples/Jupyter Notebooks/common/__init__.py +14 -0
- examples/Jupyter Notebooks/common/common-functions.ipynb +4694 -0
- examples/Jupyter Notebooks/common/environment-check.ipynb +52 -0
- examples/Jupyter Notebooks/common/globals.ipynb +184 -0
- examples/Jupyter Notebooks/common/globals.py +154 -0
- examples/Jupyter Notebooks/common/orig_globals.py +152 -0
- examples/format_sets/all_format_sets.json +910 -0
- examples/format_sets/custom_format_sets.json +268 -0
- examples/format_sets/subset_format_sets.json +187 -0
- examples/format_sets_save_load_example.py +291 -0
- examples/jacquard_data_sets.py +129 -0
- examples/output_formats_example.py +193 -0
- examples/test_jacquard_data_sets.py +54 -0
- examples/test_jacquard_data_sets_scenarios.py +94 -0
- md_processing/__init__.py +90 -0
- md_processing/command_dispatcher.py +33 -0
- md_processing/command_mapping.py +221 -0
- md_processing/data/commands/commands_data_designer.json +537 -0
- md_processing/data/commands/commands_external_reference.json +733 -0
- md_processing/data/commands/commands_feedback.json +155 -0
- md_processing/data/commands/commands_general.json +204 -0
- md_processing/data/commands/commands_glossary.json +218 -0
- md_processing/data/commands/commands_governance.json +3678 -0
- md_processing/data/commands/commands_product_manager.json +865 -0
- md_processing/data/commands/commands_project.json +642 -0
- md_processing/data/commands/commands_solution_architect.json +366 -0
- md_processing/data/commands.json +17568 -0
- md_processing/data/commands_working.json +30641 -0
- md_processing/data/gened_report_specs.py +6584 -0
- md_processing/data/generated_format_sets.json +6533 -0
- md_processing/data/generated_format_sets_old.json +4137 -0
- md_processing/data/generated_format_sets_old.py +45 -0
- md_processing/dr_egeria.py +182 -0
- md_processing/md_commands/__init__.py +3 -0
- md_processing/md_commands/data_designer_commands.py +1276 -0
- md_processing/md_commands/ext_ref_commands.py +530 -0
- md_processing/md_commands/feedback_commands.py +726 -0
- md_processing/md_commands/glossary_commands.py +684 -0
- md_processing/md_commands/governance_officer_commands.py +600 -0
- md_processing/md_commands/product_manager_commands.py +1266 -0
- md_processing/md_commands/project_commands.py +383 -0
- md_processing/md_commands/solution_architect_commands.py +1184 -0
- md_processing/md_commands/view_commands.py +295 -0
- md_processing/md_processing_utils/__init__.py +4 -0
- md_processing/md_processing_utils/common_md_proc_utils.py +1249 -0
- md_processing/md_processing_utils/common_md_utils.py +578 -0
- md_processing/md_processing_utils/determine_width.py +103 -0
- md_processing/md_processing_utils/extraction_utils.py +547 -0
- md_processing/md_processing_utils/gen_report_specs.py +643 -0
- md_processing/md_processing_utils/generate_dr_help.py +193 -0
- md_processing/md_processing_utils/generate_md_cmd_templates.py +144 -0
- md_processing/md_processing_utils/generate_md_templates.py +83 -0
- md_processing/md_processing_utils/md_processing_constants.py +1228 -0
- md_processing/md_processing_utils/message_constants.py +19 -0
- pyegeria/__init__.py +201 -443
- pyegeria/core/__init__.py +40 -0
- pyegeria/core/_base_platform_client.py +574 -0
- pyegeria/core/_base_server_client.py +573 -0
- pyegeria/core/_exceptions.py +457 -0
- pyegeria/core/_globals.py +60 -0
- pyegeria/core/_server_client.py +6073 -0
- pyegeria/core/_validators.py +257 -0
- pyegeria/core/config.py +654 -0
- pyegeria/{create_tech_guid_lists.py → core/create_tech_guid_lists.py} +0 -1
- pyegeria/core/load_config.py +37 -0
- pyegeria/core/logging_configuration.py +207 -0
- pyegeria/core/mcp_adapter.py +144 -0
- pyegeria/core/mcp_server.py +212 -0
- pyegeria/core/utils.py +405 -0
- pyegeria/deprecated/__init__.py +0 -0
- pyegeria/{_client.py → deprecated/_client.py} +62 -24
- pyegeria/{_deprecated_gov_engine.py → deprecated/_deprecated_gov_engine.py} +16 -16
- pyegeria/{classification_manager_omvs.py → deprecated/classification_manager_omvs.py} +1988 -1878
- pyegeria/deprecated/output_formatter_with_machine_keys.py +1127 -0
- pyegeria/{runtime_manager_omvs.py → deprecated/runtime_manager_omvs.py} +216 -229
- pyegeria/{valid_metadata_omvs.py → deprecated/valid_metadata_omvs.py} +93 -93
- pyegeria/{x_action_author_omvs.py → deprecated/x_action_author_omvs.py} +2 -3
- pyegeria/egeria_cat_client.py +25 -51
- pyegeria/egeria_client.py +140 -98
- pyegeria/egeria_config_client.py +48 -24
- pyegeria/egeria_tech_client.py +170 -83
- pyegeria/models/__init__.py +150 -0
- pyegeria/models/collection_models.py +168 -0
- pyegeria/models/models.py +654 -0
- pyegeria/omvs/__init__.py +84 -0
- pyegeria/omvs/action_author.py +342 -0
- pyegeria/omvs/actor_manager.py +5980 -0
- pyegeria/omvs/asset_catalog.py +842 -0
- pyegeria/omvs/asset_maker.py +2736 -0
- pyegeria/omvs/automated_curation.py +4403 -0
- pyegeria/omvs/classification_manager.py +11213 -0
- pyegeria/omvs/collection_manager.py +5780 -0
- pyegeria/omvs/community_matters_omvs.py +468 -0
- pyegeria/{core_omag_server_config.py → omvs/core_omag_server_config.py} +157 -157
- pyegeria/{data_designer_omvs.py → omvs/data_designer.py} +1991 -1691
- pyegeria/omvs/data_discovery.py +869 -0
- pyegeria/omvs/data_engineer.py +372 -0
- pyegeria/omvs/digital_business.py +1133 -0
- pyegeria/omvs/external_links.py +1752 -0
- pyegeria/omvs/feedback_manager.py +834 -0
- pyegeria/{full_omag_server_config.py → omvs/full_omag_server_config.py} +73 -69
- pyegeria/omvs/glossary_manager.py +3231 -0
- pyegeria/omvs/governance_officer.py +3009 -0
- pyegeria/omvs/lineage_linker.py +314 -0
- pyegeria/omvs/location_arena.py +1525 -0
- pyegeria/omvs/metadata_expert.py +668 -0
- pyegeria/omvs/metadata_explorer_omvs.py +2943 -0
- pyegeria/omvs/my_profile.py +1042 -0
- pyegeria/omvs/notification_manager.py +358 -0
- pyegeria/omvs/people_organizer.py +394 -0
- pyegeria/{platform_services.py → omvs/platform_services.py} +113 -193
- pyegeria/omvs/product_manager.py +1825 -0
- pyegeria/omvs/project_manager.py +1907 -0
- pyegeria/omvs/reference_data.py +1140 -0
- pyegeria/omvs/registered_info.py +334 -0
- pyegeria/omvs/runtime_manager.py +2817 -0
- pyegeria/omvs/schema_maker.py +446 -0
- pyegeria/{server_operations.py → omvs/server_operations.py} +27 -26
- pyegeria/omvs/solution_architect.py +6490 -0
- pyegeria/omvs/specification_properties.py +37 -0
- pyegeria/omvs/subject_area.py +1042 -0
- pyegeria/omvs/template_manager_omvs.py +236 -0
- pyegeria/omvs/time_keeper.py +1761 -0
- pyegeria/omvs/valid_metadata.py +3221 -0
- pyegeria/omvs/valid_metadata_lists.py +37 -0
- pyegeria/omvs/valid_type_lists.py +37 -0
- pyegeria/view/__init__.py +28 -0
- pyegeria/view/_output_format_models.py +514 -0
- pyegeria/view/_output_formats.py +14 -0
- pyegeria/view/base_report_formats.py +2719 -0
- pyegeria/view/dr_egeria_reports.py +56 -0
- pyegeria/view/format_set_executor.py +397 -0
- pyegeria/{md_processing_utils.py → view/md_processing_utils.py} +5 -5
- pyegeria/{mermaid_utilities.py → view/mermaid_utilities.py} +2 -154
- pyegeria/view/output_formatter.py +1297 -0
- pyegeria-5.5.3.3.dist-info/METADATA +218 -0
- pyegeria-5.5.3.3.dist-info/RECORD +241 -0
- {pyegeria-5.3.9.9.3.dist-info → pyegeria-5.5.3.3.dist-info}/WHEEL +2 -1
- pyegeria-5.5.3.3.dist-info/entry_points.txt +103 -0
- pyegeria-5.5.3.3.dist-info/top_level.txt +4 -0
- commands/cat/.DS_Store +0 -0
- commands/cat/README.md +0 -16
- commands/cli/txt_custom_v2.tcss +0 -19
- commands/my/README.md +0 -17
- commands/ops/README.md +0 -24
- commands/ops/monitor_asset_events.py +0 -108
- commands/tech/README.md +0 -24
- pyegeria/.DS_Store +0 -0
- pyegeria/README.md +0 -35
- pyegeria/_globals.py +0 -47
- pyegeria/_validators.py +0 -385
- pyegeria/asset_catalog_omvs.py +0 -864
- pyegeria/automated_curation_omvs.py +0 -3765
- pyegeria/collection_manager_omvs.py +0 -2744
- pyegeria/dr.egeria spec.md +0 -9
- pyegeria/egeria_my_client.py +0 -56
- pyegeria/feedback_manager_omvs.py +0 -4573
- pyegeria/glossary_browser_omvs.py +0 -3728
- pyegeria/glossary_manager_omvs.py +0 -2440
- pyegeria/m_test.py +0 -118
- pyegeria/md_processing_helpers.py +0 -58
- pyegeria/md_processing_utils_orig.py +0 -1103
- pyegeria/metadata_explorer_omvs.py +0 -2326
- pyegeria/my_profile_omvs.py +0 -1022
- pyegeria/output_formatter.py +0 -389
- pyegeria/project_manager_omvs.py +0 -1933
- pyegeria/registered_info.py +0 -167
- pyegeria/solution_architect_omvs.py +0 -2156
- pyegeria/template_manager_omvs.py +0 -1414
- pyegeria/utils.py +0 -197
- pyegeria-5.3.9.9.3.dist-info/METADATA +0 -72
- pyegeria-5.3.9.9.3.dist-info/RECORD +0 -143
- pyegeria-5.3.9.9.3.dist-info/entry_points.txt +0 -99
- /pyegeria/{_exceptions.py → deprecated/_exceptions.py} +0 -0
- {pyegeria-5.3.9.9.3.dist-info → pyegeria-5.5.3.3.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,2817 @@
|
|
|
1
|
+
"""
|
|
2
|
+
SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
Copyright Contributors to the ODPi Egeria project.
|
|
4
|
+
|
|
5
|
+
Runtime manager is a view service that supports user interaction with the running platforms.
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import asyncio
|
|
10
|
+
|
|
11
|
+
from loguru import logger
|
|
12
|
+
from requests import Response
|
|
13
|
+
from pyegeria.core.utils import body_slimmer, dynamic_catch
|
|
14
|
+
from pyegeria.core._server_client import ServerClient
|
|
15
|
+
from pyegeria.core._globals import max_paging_size, default_time_out, NO_ELEMENTS_FOUND
|
|
16
|
+
from typing import Any, Optional
|
|
17
|
+
from pyegeria.view.base_report_formats import get_report_spec_match
|
|
18
|
+
from pyegeria.view.base_report_formats import select_report_spec
|
|
19
|
+
from pyegeria.models import (
|
|
20
|
+
SearchStringRequestBody, FilterRequestBody, GetRequestBody, NewElementRequestBody,
|
|
21
|
+
TemplateRequestBody, UpdateElementRequestBody, NewRelationshipRequestBody,
|
|
22
|
+
DeleteElementRequestBody, DeleteRelationshipRequestBody,
|
|
23
|
+
ArchiveRequestBody, NewOpenMetadataElementRequestBody, FindRequestBody
|
|
24
|
+
)
|
|
25
|
+
from pyegeria.view.output_formatter import generate_output, populate_columns_from_properties, \
|
|
26
|
+
_extract_referenceable_properties, get_required_relationships
|
|
27
|
+
|
|
28
|
+
class RuntimeManager(ServerClient):
|
|
29
|
+
"""
|
|
30
|
+
Client to issue Runtime status requests.
|
|
31
|
+
|
|
32
|
+
Attributes:
|
|
33
|
+
|
|
34
|
+
view_server : str
|
|
35
|
+
Name of the server to use.
|
|
36
|
+
platform_url : str
|
|
37
|
+
URL of the server platform to connect to
|
|
38
|
+
user_id : str
|
|
39
|
+
The identity of the user calling the method - this sets a default optionally used by the methods
|
|
40
|
+
when the user doesn't pass the user_id on a method call.
|
|
41
|
+
user_pwd: str
|
|
42
|
+
The password associated with the user_id. Defaults to None
|
|
43
|
+
token: str, optional
|
|
44
|
+
Bearer token
|
|
45
|
+
|
|
46
|
+
Methods:
|
|
47
|
+
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
def __init__(
|
|
51
|
+
self,
|
|
52
|
+
view_server: str,
|
|
53
|
+
platform_url: str,
|
|
54
|
+
user_id: str,
|
|
55
|
+
user_pwd: Optional[str] = None,
|
|
56
|
+
token: Optional[str] = None,
|
|
57
|
+
time_out: int = default_time_out,
|
|
58
|
+
):
|
|
59
|
+
self.view_server = view_server
|
|
60
|
+
self.time_out = time_out
|
|
61
|
+
ServerClient.__init__(self, view_server, platform_url, user_id, user_pwd, token=token)
|
|
62
|
+
self.runtime_command_root = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/runtime-manager"
|
|
63
|
+
# self.platform_guid = "44bf319f-1e41-4da1-b771-2753b92b631a" # this is platform @ 9443 from the core content archive
|
|
64
|
+
self.platform_guid = None
|
|
65
|
+
self.default_platform_name = (
|
|
66
|
+
"Default Local OMAG Server Platform" # this from the core content archive
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
#
|
|
71
|
+
# Integration Connector Methods
|
|
72
|
+
#
|
|
73
|
+
@dynamic_catch
|
|
74
|
+
async def _async_get_integration_connector_config_properties(
|
|
75
|
+
self,
|
|
76
|
+
connector_name: str,
|
|
77
|
+
server_guid: Optional[str] = None,
|
|
78
|
+
display_name: Optional[str] = None,
|
|
79
|
+
qualified_name: Optional[str] = None,
|
|
80
|
+
output_format: str = "JSON",
|
|
81
|
+
report_spec: str | dict = "IntegrationConnector",
|
|
82
|
+
body: Optional[dict | GetRequestBody] = None,
|
|
83
|
+
) -> dict | str:
|
|
84
|
+
"""Retrieve the configuration properties of the named integration connector running in the integration daemon.
|
|
85
|
+
Async version.
|
|
86
|
+
|
|
87
|
+
https://egeria-project.org/concepts/integration-connector/
|
|
88
|
+
|
|
89
|
+
Parameters
|
|
90
|
+
----------
|
|
91
|
+
connector_name : str
|
|
92
|
+
Name of the integration connector to retrieve properties for.
|
|
93
|
+
server_guid : str, default = None
|
|
94
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
95
|
+
display_name: str, default = None
|
|
96
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
97
|
+
qualified_name: str, default = None
|
|
98
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
99
|
+
output_format: str, optional
|
|
100
|
+
The format of the output. Default is "JSON".
|
|
101
|
+
report_spec: str | dict, optional
|
|
102
|
+
The report specification to use. Default is "IntegrationConnector".
|
|
103
|
+
|
|
104
|
+
body : dict | GetRequestBody, optional
|
|
105
|
+
Request body to pass directly to the API.
|
|
106
|
+
|
|
107
|
+
Returns
|
|
108
|
+
-------
|
|
109
|
+
Dict of the connector configuration properties.
|
|
110
|
+
|
|
111
|
+
Raises
|
|
112
|
+
------
|
|
113
|
+
PyegeriaInvalidParameterException
|
|
114
|
+
PyegeriaAPIException
|
|
115
|
+
PyegeriaUnauthorizedException
|
|
116
|
+
|
|
117
|
+
"""
|
|
118
|
+
server_guid = self.__get_guid__(
|
|
119
|
+
server_guid,
|
|
120
|
+
display_name,
|
|
121
|
+
"displayName",
|
|
122
|
+
qualified_name,
|
|
123
|
+
"Integration Daemon",
|
|
124
|
+
)
|
|
125
|
+
url = (
|
|
126
|
+
f"{self.runtime_command_root}/integration-daemon/"
|
|
127
|
+
f"{server_guid}/integration-connectors/{connector_name}/configuration-properties"
|
|
128
|
+
)
|
|
129
|
+
response = await self._async_make_request("GET", url)
|
|
130
|
+
props = response.json().get("properties", {})
|
|
131
|
+
|
|
132
|
+
if output_format == "DICT":
|
|
133
|
+
return props
|
|
134
|
+
|
|
135
|
+
# Convert to Key/Value list for other formats
|
|
136
|
+
elements = [{"Property": k, "Value": v} for k, v in props.items()] if props else []
|
|
137
|
+
|
|
138
|
+
# Use a simple dynamic report spec for properties
|
|
139
|
+
columns_struct = {
|
|
140
|
+
"formats": {
|
|
141
|
+
"attributes": [
|
|
142
|
+
{"key": "Property", "label": "Property", "value": ""},
|
|
143
|
+
{"key": "Value", "label": "Value", "value": ""}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
def extract_kv(elem, cols):
|
|
149
|
+
c_data = populate_columns_from_properties(elem, cols)
|
|
150
|
+
c_list = c_data.get("formats", {}).get("attributes", [])
|
|
151
|
+
for c in c_list:
|
|
152
|
+
c['value'] = elem.get(c['key'])
|
|
153
|
+
return c_data
|
|
154
|
+
|
|
155
|
+
return generate_output(
|
|
156
|
+
elements=elements,
|
|
157
|
+
search_string=connector_name,
|
|
158
|
+
entity_type="Properties",
|
|
159
|
+
output_format=output_format,
|
|
160
|
+
extract_properties_func=extract_kv,
|
|
161
|
+
columns_struct=columns_struct
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
def get_integration_connector_config_properties(
|
|
165
|
+
self,
|
|
166
|
+
connector_name: str,
|
|
167
|
+
server_guid: Optional[str] = None,
|
|
168
|
+
display_name: Optional[str] = None,
|
|
169
|
+
qualified_name: Optional[str] = None,
|
|
170
|
+
output_format: str = "JSON",
|
|
171
|
+
report_spec: str | dict = "IntegrationConnector",
|
|
172
|
+
body: Optional[dict | GetRequestBody] = None,
|
|
173
|
+
) -> dict | str:
|
|
174
|
+
"""Retrieve the configuration properties of the named integration connector running in the integration daemon.
|
|
175
|
+
|
|
176
|
+
https://egeria-project.org/concepts/integration-connector/
|
|
177
|
+
|
|
178
|
+
Parameters
|
|
179
|
+
----------
|
|
180
|
+
connector_name : str
|
|
181
|
+
Name of the integration connector to retrieve properties for.
|
|
182
|
+
server_guid : str, default = None
|
|
183
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
184
|
+
display_name: str, default = None
|
|
185
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
186
|
+
qualified_name: str, default = None
|
|
187
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
188
|
+
output_format: str, optional
|
|
189
|
+
The format of the output. Default is "JSON".
|
|
190
|
+
report_spec: str | dict, optional
|
|
191
|
+
The report specification to use. Default is "IntegrationConnector".
|
|
192
|
+
|
|
193
|
+
body : dict | GetRequestBody, optional
|
|
194
|
+
Request body to pass directly to the API.
|
|
195
|
+
|
|
196
|
+
Returns
|
|
197
|
+
-------
|
|
198
|
+
Dict of the connector configuration properties.
|
|
199
|
+
|
|
200
|
+
Raises
|
|
201
|
+
------
|
|
202
|
+
PyegeriaInvalidParameterException
|
|
203
|
+
PyegeriaAPIException
|
|
204
|
+
PyegeriaUnauthorizedException
|
|
205
|
+
|
|
206
|
+
"""
|
|
207
|
+
loop = asyncio.get_event_loop()
|
|
208
|
+
response = loop.run_until_complete(
|
|
209
|
+
self._async_get_integration_connector_config_properties(
|
|
210
|
+
connector_name, server_guid, display_name, qualified_name, output_format, report_spec, body
|
|
211
|
+
)
|
|
212
|
+
)
|
|
213
|
+
return response
|
|
214
|
+
|
|
215
|
+
async def _async_update_connector_configuration(
|
|
216
|
+
self,
|
|
217
|
+
connector_name: Optional[str] = None,
|
|
218
|
+
server_guid: Optional[str] = None,
|
|
219
|
+
display_name: Optional[str] = None,
|
|
220
|
+
qualified_name: Optional[str] = None,
|
|
221
|
+
merge_update: bool = True,
|
|
222
|
+
config_properties: dict = None,
|
|
223
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
224
|
+
) -> None:
|
|
225
|
+
"""Update the configuration properties of the integration connectors, or specific integration connector
|
|
226
|
+
if a connector name is supplied. This update is in memory and will not persist over a server restart.
|
|
227
|
+
Async version.
|
|
228
|
+
|
|
229
|
+
https://egeria-project.org/concepts/integration-connector/
|
|
230
|
+
|
|
231
|
+
Parameters
|
|
232
|
+
----------
|
|
233
|
+
connector_name : str, default = None
|
|
234
|
+
Name of the integration connector to update properties for. If none, all connectors will be updated.
|
|
235
|
+
server_guid : str, default = None
|
|
236
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
237
|
+
display_name: str, default = None
|
|
238
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
239
|
+
qualified_name: str, default = None
|
|
240
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
241
|
+
|
|
242
|
+
merge_update : bool, optional, default = False
|
|
243
|
+
Specifies whether properties should be over-written or completely replace existing properties. If False
|
|
244
|
+
the values will be replaced; if True, they will be merged.
|
|
245
|
+
config_properties : dict, optional, default = None
|
|
246
|
+
A dict of Property Name, Property Value pairs.
|
|
247
|
+
|
|
248
|
+
body : dict | FilterRequestBody, optional
|
|
249
|
+
Request body to pass directly to the API.
|
|
250
|
+
|
|
251
|
+
Returns
|
|
252
|
+
-------
|
|
253
|
+
None
|
|
254
|
+
|
|
255
|
+
Raises
|
|
256
|
+
------
|
|
257
|
+
PyegeriaInvalidParameterException
|
|
258
|
+
PyegeriaAPIException
|
|
259
|
+
PyegeriaUnauthorizedException
|
|
260
|
+
|
|
261
|
+
"""
|
|
262
|
+
server_guid = self.__get_guid__(
|
|
263
|
+
server_guid,
|
|
264
|
+
display_name,
|
|
265
|
+
"qualifiedName",
|
|
266
|
+
qualified_name,
|
|
267
|
+
"Integration Daemon",
|
|
268
|
+
)
|
|
269
|
+
url = (
|
|
270
|
+
f"{self.runtime_command_root}/integration-daemon/"
|
|
271
|
+
f"{server_guid}/integration-connectors/configuration-properties"
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
if body is None:
|
|
275
|
+
body = {
|
|
276
|
+
"class": "ConnectorConfigPropertiesRequestBody",
|
|
277
|
+
"connectorName": connector_name,
|
|
278
|
+
"mergeUpdate": merge_update,
|
|
279
|
+
"configurationProperties": config_properties,
|
|
280
|
+
}
|
|
281
|
+
await self._async_make_request("POST", url, body_slimmer(body))
|
|
282
|
+
return
|
|
283
|
+
|
|
284
|
+
def update_connector_configuration(
|
|
285
|
+
self,
|
|
286
|
+
connector_name: str,
|
|
287
|
+
server_guid: Optional[str] = None,
|
|
288
|
+
display_name: Optional[str] = None,
|
|
289
|
+
qualified_name: Optional[str] = None,
|
|
290
|
+
merge_update: bool = False,
|
|
291
|
+
config_properties: dict = None,
|
|
292
|
+
body: Optional[dict] = None,
|
|
293
|
+
) -> None:
|
|
294
|
+
"""Update the configuration properties of the integration connectors, or specific integration connector
|
|
295
|
+
if a connector name is supplied. This update is in memory and will not persist over a server restart.
|
|
296
|
+
|
|
297
|
+
https://egeria-project.org/concepts/integration-connector/
|
|
298
|
+
|
|
299
|
+
Parameters
|
|
300
|
+
----------
|
|
301
|
+
server_guid : str, default = None
|
|
302
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
303
|
+
display_name: str, default = None
|
|
304
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
305
|
+
qualified_name: str, default = None
|
|
306
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
307
|
+
connector_name : str
|
|
308
|
+
Name of the integration connector to retrieve properties for.
|
|
309
|
+
merge_update : bool, optional, default = False
|
|
310
|
+
Specifies whether properties should be over-written or completely replace existing properties. If False
|
|
311
|
+
the values will be replaced; if True, they will be merged.
|
|
312
|
+
config_properties : dict, optional, default = None
|
|
313
|
+
A dict of Property Name, Property Value pairs.
|
|
314
|
+
|
|
315
|
+
body : dict, optional
|
|
316
|
+
Request body to pass directly to the API.
|
|
317
|
+
|
|
318
|
+
Returns
|
|
319
|
+
-------
|
|
320
|
+
None
|
|
321
|
+
|
|
322
|
+
Raises
|
|
323
|
+
------
|
|
324
|
+
PyegeriaInvalidParameterException
|
|
325
|
+
PyegeriaAPIException
|
|
326
|
+
PyegeriaUnauthorizedException
|
|
327
|
+
|
|
328
|
+
"""
|
|
329
|
+
loop = asyncio.get_event_loop()
|
|
330
|
+
loop.run_until_complete(
|
|
331
|
+
self._async_update_connector_configuration(
|
|
332
|
+
connector_name,
|
|
333
|
+
server_guid,
|
|
334
|
+
display_name,
|
|
335
|
+
qualified_name,
|
|
336
|
+
merge_update,
|
|
337
|
+
config_properties,
|
|
338
|
+
body,
|
|
339
|
+
)
|
|
340
|
+
)
|
|
341
|
+
return
|
|
342
|
+
|
|
343
|
+
async def _async_update_endpoint_address(
|
|
344
|
+
self,
|
|
345
|
+
connector_name: str,
|
|
346
|
+
endpoint_address: str,
|
|
347
|
+
server_guid: Optional[str] = None,
|
|
348
|
+
display_name: Optional[str] = None,
|
|
349
|
+
qualified_name: Optional[str] = None,
|
|
350
|
+
body: Optional[dict] = None,
|
|
351
|
+
) -> None:
|
|
352
|
+
"""Update the endpoint network address for a specific integration connector. Typically used for discovery.
|
|
353
|
+
This update is in memory and will not persist over a server restart. Async version.
|
|
354
|
+
|
|
355
|
+
https://egeria-project.org/concepts/integration-connector/
|
|
356
|
+
|
|
357
|
+
Parameters
|
|
358
|
+
----------
|
|
359
|
+
server_guid : str, default = None
|
|
360
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
361
|
+
display_name: str, default = None
|
|
362
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
363
|
+
qualified_name: str, default = None
|
|
364
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
365
|
+
connector_name : str
|
|
366
|
+
Name of the integration connector to retrieve properties for.
|
|
367
|
+
endpoint_address : str
|
|
368
|
+
Specifies the new network endpoint address. This is the full address string - can include protocol,
|
|
369
|
+
port, operation, etc.
|
|
370
|
+
|
|
371
|
+
body : dict, optional
|
|
372
|
+
Request body to pass directly to the API.
|
|
373
|
+
|
|
374
|
+
Returns
|
|
375
|
+
-------
|
|
376
|
+
None
|
|
377
|
+
|
|
378
|
+
Raises
|
|
379
|
+
------
|
|
380
|
+
PyegeriaInvalidParameterException
|
|
381
|
+
PyegeriaAPIException
|
|
382
|
+
PyegeriaUnauthorizedException
|
|
383
|
+
|
|
384
|
+
"""
|
|
385
|
+
server_guid = self.__get_guid__(
|
|
386
|
+
server_guid, display_name, "qualifiedName", qualified_name, "Connection"
|
|
387
|
+
)
|
|
388
|
+
url = (
|
|
389
|
+
f"{self.runtime_command_root}/integration-daemon/"
|
|
390
|
+
f"{server_guid}/integration-connectors/{connector_name}/endpoint-network-address"
|
|
391
|
+
)
|
|
392
|
+
|
|
393
|
+
if body is None:
|
|
394
|
+
body = {
|
|
395
|
+
"class": "StringRequestBody",
|
|
396
|
+
"string": endpoint_address,
|
|
397
|
+
}
|
|
398
|
+
await self._async_make_request("POST", url, body)
|
|
399
|
+
return
|
|
400
|
+
|
|
401
|
+
def update_endpoint_address(
|
|
402
|
+
self,
|
|
403
|
+
connector_name: str,
|
|
404
|
+
endpoint_address: str,
|
|
405
|
+
server_guid: Optional[str] = None,
|
|
406
|
+
display_name: Optional[str] = None,
|
|
407
|
+
qualified_name: Optional[str] = None,
|
|
408
|
+
body: Optional[dict] = None,
|
|
409
|
+
) -> None:
|
|
410
|
+
"""Update the endpoint network address for a specific integration connector. Typically used for discovery.
|
|
411
|
+
This update is in memory and will not persist over a server restart. Async version.
|
|
412
|
+
|
|
413
|
+
https://egeria-project.org/concepts/integration-connector/
|
|
414
|
+
|
|
415
|
+
Parameters
|
|
416
|
+
----------
|
|
417
|
+
server_guid : str, default = None
|
|
418
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
419
|
+
display_name: str, default = None
|
|
420
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
421
|
+
qualified_name: str, default = None
|
|
422
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
423
|
+
connector_name : str
|
|
424
|
+
Name of the integration connector to retrieve properties for.
|
|
425
|
+
endpoint_address : str
|
|
426
|
+
Specifies the new network endpoint address. This is the full address string - can include protocol,
|
|
427
|
+
port, operation, etc.
|
|
428
|
+
|
|
429
|
+
body : dict, optional
|
|
430
|
+
Request body to pass directly to the API.
|
|
431
|
+
|
|
432
|
+
Returns
|
|
433
|
+
-------
|
|
434
|
+
None
|
|
435
|
+
|
|
436
|
+
Raises
|
|
437
|
+
------
|
|
438
|
+
PyegeriaInvalidParameterException
|
|
439
|
+
PyegeriaAPIException
|
|
440
|
+
PyegeriaUnauthorizedException
|
|
441
|
+
|
|
442
|
+
"""
|
|
443
|
+
loop = asyncio.get_event_loop()
|
|
444
|
+
loop.run_until_complete(
|
|
445
|
+
self._async_update_endpoint_address(
|
|
446
|
+
connector_name,
|
|
447
|
+
endpoint_address,
|
|
448
|
+
server_guid,
|
|
449
|
+
display_name,
|
|
450
|
+
qualified_name,
|
|
451
|
+
body,
|
|
452
|
+
)
|
|
453
|
+
)
|
|
454
|
+
return
|
|
455
|
+
|
|
456
|
+
async def _async_stop_connector(
|
|
457
|
+
self,
|
|
458
|
+
connector_name: Optional[str] = None,
|
|
459
|
+
server_guid: Optional[str] = None,
|
|
460
|
+
display_name: Optional[str] = None,
|
|
461
|
+
qualified_name: Optional[str] = None,
|
|
462
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
463
|
+
) -> None:
|
|
464
|
+
"""Stop the named integration connector OR all connectors if connector name is None. Async version.
|
|
465
|
+
|
|
466
|
+
Parameters
|
|
467
|
+
----------
|
|
468
|
+
connector_name : str, default = None
|
|
469
|
+
Name of the integration connector to stop. If none, all connectors will be stopped.
|
|
470
|
+
server_guid : str, default = None
|
|
471
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
472
|
+
display_name: str, default = None
|
|
473
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
474
|
+
qualified_name: str, default = None
|
|
475
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
476
|
+
|
|
477
|
+
body : dict | FilterRequestBody, optional
|
|
478
|
+
Request body to pass directly to the API.
|
|
479
|
+
|
|
480
|
+
Returns
|
|
481
|
+
-------
|
|
482
|
+
None
|
|
483
|
+
|
|
484
|
+
Raises
|
|
485
|
+
------
|
|
486
|
+
PyegeriaInvalidParameterException
|
|
487
|
+
PyegeriaAPIException
|
|
488
|
+
PyegeriaUnauthorizedException
|
|
489
|
+
|
|
490
|
+
"""
|
|
491
|
+
server_guid = self.__get_guid__(
|
|
492
|
+
server_guid,
|
|
493
|
+
display_name,
|
|
494
|
+
"qualifiedName",
|
|
495
|
+
qualified_name,
|
|
496
|
+
"Integration Daemon",
|
|
497
|
+
)
|
|
498
|
+
|
|
499
|
+
if connector_name is None:
|
|
500
|
+
url = (
|
|
501
|
+
f"{self.runtime_command_root}/integration-daemon/"
|
|
502
|
+
f"{server_guid}/integration-connectors/stop"
|
|
503
|
+
)
|
|
504
|
+
else:
|
|
505
|
+
url = (
|
|
506
|
+
f"{self.runtime_command_root}/integration-daemon/"
|
|
507
|
+
f"{server_guid}/integration-connectors/{connector_name}/stop"
|
|
508
|
+
)
|
|
509
|
+
|
|
510
|
+
await self._async_make_request("GET", url, body=body)
|
|
511
|
+
return
|
|
512
|
+
|
|
513
|
+
def stop_connector(
|
|
514
|
+
self,
|
|
515
|
+
connector_name: Optional[str] = None,
|
|
516
|
+
server_guid: Optional[str] = None,
|
|
517
|
+
display_name: Optional[str] = None,
|
|
518
|
+
qualified_name: Optional[str] = None,
|
|
519
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
520
|
+
) -> None:
|
|
521
|
+
"""Stop the named integration connector OR all connectors if connector name is None.
|
|
522
|
+
|
|
523
|
+
Parameters
|
|
524
|
+
----------
|
|
525
|
+
connector_name : str, default = None
|
|
526
|
+
Name of the integration connector to stop. If none, all connectors will be stopped.
|
|
527
|
+
server_guid : str, default = None
|
|
528
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
529
|
+
display_name: str, default = None
|
|
530
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
531
|
+
qualified_name: str, default = None
|
|
532
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
533
|
+
|
|
534
|
+
body : dict | FilterRequestBody, optional
|
|
535
|
+
Request body to pass directly to the API.
|
|
536
|
+
|
|
537
|
+
Returns
|
|
538
|
+
-------
|
|
539
|
+
None
|
|
540
|
+
|
|
541
|
+
Raises
|
|
542
|
+
------
|
|
543
|
+
PyegeriaInvalidParameterException
|
|
544
|
+
PyegeriaAPIException
|
|
545
|
+
PyegeriaUnauthorizedException
|
|
546
|
+
|
|
547
|
+
"""
|
|
548
|
+
loop = asyncio.get_event_loop()
|
|
549
|
+
loop.run_until_complete(
|
|
550
|
+
self._async_stop_connector(
|
|
551
|
+
connector_name, server_guid, display_name, qualified_name, body
|
|
552
|
+
)
|
|
553
|
+
)
|
|
554
|
+
return
|
|
555
|
+
|
|
556
|
+
async def _async_start_connector(
|
|
557
|
+
self,
|
|
558
|
+
connector_name: Optional[str] = None,
|
|
559
|
+
server_guid: Optional[str] = None,
|
|
560
|
+
display_name: Optional[str] = None,
|
|
561
|
+
qualified_name: Optional[str] = None,
|
|
562
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
563
|
+
) -> None:
|
|
564
|
+
"""Start the named integration connector OR all connectors if connector name is None. Async version.
|
|
565
|
+
|
|
566
|
+
Parameters
|
|
567
|
+
----------
|
|
568
|
+
connector_name : str, default = None
|
|
569
|
+
Name of the integration connector to start. If none, all connectors will be started.
|
|
570
|
+
server_guid : str, default = None
|
|
571
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
572
|
+
display_name: str, default = None
|
|
573
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
574
|
+
qualified_name: str, default = None
|
|
575
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
576
|
+
|
|
577
|
+
body : dict | FilterRequestBody, optional
|
|
578
|
+
Request body to pass directly to the API.
|
|
579
|
+
|
|
580
|
+
Returns
|
|
581
|
+
-------
|
|
582
|
+
None
|
|
583
|
+
|
|
584
|
+
Raises
|
|
585
|
+
------
|
|
586
|
+
PyegeriaInvalidParameterException
|
|
587
|
+
PyegeriaAPIException
|
|
588
|
+
PyegeriaUnauthorizedException
|
|
589
|
+
|
|
590
|
+
"""
|
|
591
|
+
server_guid = self.__get_guid__(
|
|
592
|
+
server_guid,
|
|
593
|
+
display_name,
|
|
594
|
+
"qualifiedName",
|
|
595
|
+
qualified_name,
|
|
596
|
+
"Integration Daemon",
|
|
597
|
+
)
|
|
598
|
+
|
|
599
|
+
if connector_name is None:
|
|
600
|
+
url = (
|
|
601
|
+
f"{self.runtime_command_root}/integration-daemon/"
|
|
602
|
+
f"{server_guid}/integration-connectors/start"
|
|
603
|
+
)
|
|
604
|
+
else:
|
|
605
|
+
url = (
|
|
606
|
+
f"{self.runtime_command_root}/integration-daemon/"
|
|
607
|
+
f"{server_guid}/integration-connectors/{connector_name}/start"
|
|
608
|
+
)
|
|
609
|
+
|
|
610
|
+
await self._async_make_request("GET", url, body=body)
|
|
611
|
+
return
|
|
612
|
+
|
|
613
|
+
def start_connector(
|
|
614
|
+
self,
|
|
615
|
+
connector_name: Optional[str] = None,
|
|
616
|
+
server_guid: Optional[str] = None,
|
|
617
|
+
display_name: Optional[str] = None,
|
|
618
|
+
qualified_name: Optional[str] = None,
|
|
619
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
620
|
+
) -> None:
|
|
621
|
+
"""Start the named integration connector OR all connectors if connector name is None.
|
|
622
|
+
|
|
623
|
+
Parameters
|
|
624
|
+
----------
|
|
625
|
+
connector_name : str, default = None
|
|
626
|
+
Name of the integration connector to start. If none, all connectors will be started.
|
|
627
|
+
server_guid : str, default = None
|
|
628
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
629
|
+
display_name: str, default = None
|
|
630
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
631
|
+
qualified_name: str, default = None
|
|
632
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
633
|
+
|
|
634
|
+
body : dict | FilterRequestBody, optional
|
|
635
|
+
Request body to pass directly to the API.
|
|
636
|
+
|
|
637
|
+
Returns
|
|
638
|
+
-------
|
|
639
|
+
None
|
|
640
|
+
|
|
641
|
+
Raises
|
|
642
|
+
------
|
|
643
|
+
PyegeriaInvalidParameterException
|
|
644
|
+
PyegeriaAPIException
|
|
645
|
+
PyegeriaUnauthorizedException
|
|
646
|
+
|
|
647
|
+
"""
|
|
648
|
+
loop = asyncio.get_event_loop()
|
|
649
|
+
loop.run_until_complete(
|
|
650
|
+
self._async_start_connector(
|
|
651
|
+
connector_name, server_guid, display_name, qualified_name, body
|
|
652
|
+
)
|
|
653
|
+
)
|
|
654
|
+
return
|
|
655
|
+
|
|
656
|
+
async def _async_connect_to_cohort(
|
|
657
|
+
self, cohort_name: str, server_guid: str = None, server_name: str = None, body: Optional[dict | FilterRequestBody] = None
|
|
658
|
+
) -> None:
|
|
659
|
+
"""Request the named OMAG server to register with the named cohort. Async version.
|
|
660
|
+
|
|
661
|
+
Parameters
|
|
662
|
+
----------
|
|
663
|
+
cohort_name : str
|
|
664
|
+
Name of the cohort to register with.
|
|
665
|
+
server_guid : str, opt
|
|
666
|
+
Identity of the server to act on. If not specified, server_name must be.
|
|
667
|
+
server_name: str, opt
|
|
668
|
+
Name of server to act on. If not specified, server_guid must be.
|
|
669
|
+
|
|
670
|
+
body : dict | FilterRequestBody, optional
|
|
671
|
+
Request body to pass directly to the API.
|
|
672
|
+
|
|
673
|
+
Returns
|
|
674
|
+
-------
|
|
675
|
+
None
|
|
676
|
+
|
|
677
|
+
Raises
|
|
678
|
+
------
|
|
679
|
+
PyegeriaInvalidParameterException
|
|
680
|
+
PyegeriaAPIException
|
|
681
|
+
PyegeriaUnauthorizedException
|
|
682
|
+
|
|
683
|
+
"""
|
|
684
|
+
server_guid = self.__get_guid__(
|
|
685
|
+
server_guid, server_name, "resourceName", tech_type="OMAG Server"
|
|
686
|
+
)
|
|
687
|
+
url = (
|
|
688
|
+
f"{self.runtime_command_root}/omag-servers/"
|
|
689
|
+
f"{server_guid}/cohorts/{cohort_name}"
|
|
690
|
+
)
|
|
691
|
+
await self._async_make_request("POST", url, body=body)
|
|
692
|
+
return
|
|
693
|
+
|
|
694
|
+
def connect_to_cohort(
|
|
695
|
+
self, cohort_name: str, server_guid: str = None, server_name: str = None, body: Optional[dict | FilterRequestBody] = None
|
|
696
|
+
) -> None:
|
|
697
|
+
"""Request the named OMAG server to register with the named cohort.
|
|
698
|
+
|
|
699
|
+
Parameters
|
|
700
|
+
----------
|
|
701
|
+
cohort_name : str
|
|
702
|
+
Name of the cohort to register with.
|
|
703
|
+
server_guid : str, opt
|
|
704
|
+
Identity of the server to act on. If not specified, server_name must be.
|
|
705
|
+
server_name: str, opt
|
|
706
|
+
Name of server to act on. If not specified, server_guid must be.
|
|
707
|
+
|
|
708
|
+
body : dict | FilterRequestBody, optional
|
|
709
|
+
Request body to pass directly to the API.
|
|
710
|
+
|
|
711
|
+
Returns
|
|
712
|
+
-------
|
|
713
|
+
None
|
|
714
|
+
|
|
715
|
+
Raises
|
|
716
|
+
------
|
|
717
|
+
PyegeriaInvalidParameterException
|
|
718
|
+
PyegeriaAPIException
|
|
719
|
+
PyegeriaUnauthorizedException
|
|
720
|
+
|
|
721
|
+
"""
|
|
722
|
+
loop = asyncio.get_event_loop()
|
|
723
|
+
loop.run_until_complete(
|
|
724
|
+
self._async_connect_to_cohort(cohort_name, server_guid, server_name, body)
|
|
725
|
+
)
|
|
726
|
+
return
|
|
727
|
+
|
|
728
|
+
async def _async_disconnect_from_cohort(
|
|
729
|
+
self, cohort_name: str, server_guid: str = None, server_name: str = None, body: Optional[dict | FilterRequestBody] = None
|
|
730
|
+
) -> None:
|
|
731
|
+
"""Request the named OMAG server to disconnect from the named cohort. Async version.
|
|
732
|
+
|
|
733
|
+
Parameters
|
|
734
|
+
----------
|
|
735
|
+
cohort_name : str
|
|
736
|
+
Name of the cohort to register with.
|
|
737
|
+
server_guid : str, opt
|
|
738
|
+
Identity of the server to act on. If not specified, server_name must be.
|
|
739
|
+
server_name: str, opt
|
|
740
|
+
Name of server to act on. If not specified, server_guid must be.
|
|
741
|
+
|
|
742
|
+
body : dict | FilterRequestBody, optional
|
|
743
|
+
Request body to pass directly to the API.
|
|
744
|
+
|
|
745
|
+
Returns
|
|
746
|
+
-------
|
|
747
|
+
None
|
|
748
|
+
|
|
749
|
+
Raises
|
|
750
|
+
------
|
|
751
|
+
PyegeriaInvalidParameterException
|
|
752
|
+
PyegeriaAPIException
|
|
753
|
+
PyegeriaUnauthorizedException
|
|
754
|
+
|
|
755
|
+
"""
|
|
756
|
+
server_guid = self.__get_guid__(
|
|
757
|
+
server_guid, server_name, "resourceName", tech_type="OMAG Server"
|
|
758
|
+
)
|
|
759
|
+
url = (
|
|
760
|
+
f"{self.runtime_command_root}/omag-servers/"
|
|
761
|
+
f"{server_guid}/cohorts/{cohort_name}"
|
|
762
|
+
)
|
|
763
|
+
await self._async_make_request("DELETE", url, body=body)
|
|
764
|
+
return
|
|
765
|
+
|
|
766
|
+
def disconnect_from_cohort(
|
|
767
|
+
self, cohort_name: str, server_guid: str = None, server_name: str = None, body: Optional[dict | FilterRequestBody] = None
|
|
768
|
+
) -> None:
|
|
769
|
+
"""Request the named OMAG server to disconnect from the named cohort.
|
|
770
|
+
|
|
771
|
+
Parameters
|
|
772
|
+
----------
|
|
773
|
+
cohort_name : str
|
|
774
|
+
Name of the cohort to register with.
|
|
775
|
+
server_guid : str, opt
|
|
776
|
+
Identity of the server to act on. If not specified, server_name must be.
|
|
777
|
+
server_name: str, opt
|
|
778
|
+
Name of server to act on. If not specified, server_guid must be.
|
|
779
|
+
|
|
780
|
+
body : dict | FilterRequestBody, optional
|
|
781
|
+
Request body to pass directly to the API.
|
|
782
|
+
|
|
783
|
+
Returns
|
|
784
|
+
-------
|
|
785
|
+
None
|
|
786
|
+
|
|
787
|
+
Raises
|
|
788
|
+
------
|
|
789
|
+
PyegeriaInvalidParameterException
|
|
790
|
+
PyegeriaAPIException
|
|
791
|
+
PyegeriaUnauthorizedException
|
|
792
|
+
|
|
793
|
+
"""
|
|
794
|
+
loop = asyncio.get_event_loop()
|
|
795
|
+
loop.run_until_complete(
|
|
796
|
+
self._async_disconnect_from_cohort(cohort_name, server_guid, server_name, body)
|
|
797
|
+
)
|
|
798
|
+
return
|
|
799
|
+
|
|
800
|
+
async def _async_unregister_from_cohort(
|
|
801
|
+
self, cohort_name: str, server_guid: str = None, server_name: str = None, body: Optional[dict | FilterRequestBody] = None
|
|
802
|
+
) -> None:
|
|
803
|
+
"""Request the named OMAG server to unregister from the named cohort. Async version.
|
|
804
|
+
|
|
805
|
+
Parameters
|
|
806
|
+
----------
|
|
807
|
+
cohort_name : str
|
|
808
|
+
Name of the cohort to register with.
|
|
809
|
+
server_guid : str, opt
|
|
810
|
+
Identity of the server to act on. If not specified, server_name must be.
|
|
811
|
+
server_name: str, opt
|
|
812
|
+
Name of server to act on. If not specified, server_guid must be.
|
|
813
|
+
|
|
814
|
+
body : dict | FilterRequestBody, optional
|
|
815
|
+
Request body to pass directly to the API.
|
|
816
|
+
|
|
817
|
+
Returns
|
|
818
|
+
-------
|
|
819
|
+
None
|
|
820
|
+
|
|
821
|
+
Raises
|
|
822
|
+
------
|
|
823
|
+
PyegeriaInvalidParameterException
|
|
824
|
+
PyegeriaAPIException
|
|
825
|
+
PyegeriaUnauthorizedException
|
|
826
|
+
|
|
827
|
+
"""
|
|
828
|
+
server_guid = self.__get_guid__(
|
|
829
|
+
server_guid, server_name, "resourceName", tech_type="OMAG Server"
|
|
830
|
+
)
|
|
831
|
+
url = (
|
|
832
|
+
f"{self.runtime_command_root}/omag-servers/"
|
|
833
|
+
f"{server_guid}/cohorts/{cohort_name}/unregister"
|
|
834
|
+
)
|
|
835
|
+
await self._async_make_request("POST", url, body=body)
|
|
836
|
+
return
|
|
837
|
+
|
|
838
|
+
def unregister_from_cohort(
|
|
839
|
+
self, cohort_name: str, server_guid: str = None, server_name: str = None, body: Optional[dict | FilterRequestBody] = None
|
|
840
|
+
) -> None:
|
|
841
|
+
"""Request the named OMAG server to unregister from the named cohort.
|
|
842
|
+
|
|
843
|
+
Parameters
|
|
844
|
+
----------
|
|
845
|
+
cohort_name : str
|
|
846
|
+
Name of the cohort to register with.
|
|
847
|
+
server_guid : str, opt
|
|
848
|
+
Identity of the server to act on. If not specified, server_name must be.
|
|
849
|
+
server_name: str, opt
|
|
850
|
+
Name of server to act on. If not specified, server_guid must be.
|
|
851
|
+
|
|
852
|
+
body : dict | FilterRequestBody, optional
|
|
853
|
+
Request body to pass directly to the API.
|
|
854
|
+
|
|
855
|
+
Returns
|
|
856
|
+
-------
|
|
857
|
+
None
|
|
858
|
+
|
|
859
|
+
Raises
|
|
860
|
+
------
|
|
861
|
+
PyegeriaInvalidParameterException
|
|
862
|
+
PyegeriaAPIException
|
|
863
|
+
PyegeriaUnauthorizedException
|
|
864
|
+
|
|
865
|
+
"""
|
|
866
|
+
loop = asyncio.get_event_loop()
|
|
867
|
+
loop.run_until_complete(
|
|
868
|
+
self._async_unregister_from_cohort(cohort_name, server_guid, server_name, body)
|
|
869
|
+
)
|
|
870
|
+
return
|
|
871
|
+
|
|
872
|
+
async def _async_refresh_gov_eng_config(
|
|
873
|
+
self,
|
|
874
|
+
gov_engine_name: Optional[str] = None,
|
|
875
|
+
server_guid: Optional[str] = None,
|
|
876
|
+
display_name: Optional[str] = None,
|
|
877
|
+
qualified_name: Optional[str] = None,
|
|
878
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
879
|
+
) -> None:
|
|
880
|
+
"""Request that the governance engine refresh its configuration by calling the metadata server. This request is
|
|
881
|
+
useful if the metadata server has an outage, particularly while the governance server is initializing.
|
|
882
|
+
This request just ensures that the latest configuration is in use. If gov_engine_name is None, all engines
|
|
883
|
+
will be refreshed. Async version.
|
|
884
|
+
|
|
885
|
+
https://egeria-project.org/concepts/governance-engine-definition/
|
|
886
|
+
|
|
887
|
+
Parameters
|
|
888
|
+
----------
|
|
889
|
+
gov_engine_name: str, default = None
|
|
890
|
+
If None, then all engines will be refreshed - this is the normal case. If an engine is specified only this
|
|
891
|
+
engine will be refreshed.
|
|
892
|
+
server_guid : str, default = None
|
|
893
|
+
Identity of the server to act on. If not specified, qualified_name or display_name must be.
|
|
894
|
+
display_name: str, default = None
|
|
895
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
896
|
+
qualified_name: str, opt, default is None.
|
|
897
|
+
Identity of the server to act on. Either the server_guid , qualified_name, or server_name must
|
|
898
|
+
be provided.
|
|
899
|
+
|
|
900
|
+
body : dict | FilterRequestBody, optional
|
|
901
|
+
Request body to pass directly to the API.
|
|
902
|
+
|
|
903
|
+
Returns
|
|
904
|
+
-------
|
|
905
|
+
None
|
|
906
|
+
|
|
907
|
+
Raises
|
|
908
|
+
------
|
|
909
|
+
PyegeriaInvalidParameterException
|
|
910
|
+
PyegeriaAPIException
|
|
911
|
+
PyegeriaUnauthorizedException
|
|
912
|
+
|
|
913
|
+
"""
|
|
914
|
+
server_guid = self.__get_guid__(
|
|
915
|
+
server_guid,
|
|
916
|
+
display_name,
|
|
917
|
+
"qualifiedName",
|
|
918
|
+
qualified_name,
|
|
919
|
+
"Governance Engine",
|
|
920
|
+
)
|
|
921
|
+
|
|
922
|
+
if gov_engine_name is None:
|
|
923
|
+
url = (
|
|
924
|
+
f"{self.runtime_command_root}/governance-engines/"
|
|
925
|
+
f"{server_guid}/refresh-config"
|
|
926
|
+
)
|
|
927
|
+
else:
|
|
928
|
+
url = (
|
|
929
|
+
f"{self.runtime_command_root}/governance-engines/"
|
|
930
|
+
f"{server_guid}/governance-engines/{gov_engine_name}/refresh-config"
|
|
931
|
+
)
|
|
932
|
+
|
|
933
|
+
await self._async_make_request("GET", url, body=body)
|
|
934
|
+
return
|
|
935
|
+
|
|
936
|
+
async def _async_refresh_integ_group_config(
|
|
937
|
+
self,
|
|
938
|
+
integ_group_name: Optional[str] = None,
|
|
939
|
+
server_guid: Optional[str] = None,
|
|
940
|
+
display_name: Optional[str] = None,
|
|
941
|
+
qualified_name: Optional[str] = None,
|
|
942
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
943
|
+
) -> None:
|
|
944
|
+
"""Request that the integration group refresh its configuration by calling the metadata access server.
|
|
945
|
+
Changes to the connector configuration will result in the affected connectors being restarted.
|
|
946
|
+
This request is useful if the metadata access server has an outage, particularly while the integration
|
|
947
|
+
daemon is initializing. This request just ensures that the latest configuration is in use. Async version.
|
|
948
|
+
|
|
949
|
+
https://egeria-project.org/concepts/integration-connector/
|
|
950
|
+
|
|
951
|
+
Parameters
|
|
952
|
+
----------
|
|
953
|
+
server_guid : str, default = None
|
|
954
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
955
|
+
display_name: str, default = None
|
|
956
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
957
|
+
qualified_name: str, default = None
|
|
958
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
959
|
+
integ_group_name : str, opt, default = None
|
|
960
|
+
|
|
961
|
+
body : dict, optional
|
|
962
|
+
Request body to pass directly to the API.
|
|
963
|
+
|
|
964
|
+
Returns
|
|
965
|
+
-------
|
|
966
|
+
None
|
|
967
|
+
|
|
968
|
+
Raises
|
|
969
|
+
------
|
|
970
|
+
PyegeriaInvalidParameterException
|
|
971
|
+
PyegeriaAPIException
|
|
972
|
+
PyegeriaUnauthorizedException
|
|
973
|
+
|
|
974
|
+
"""
|
|
975
|
+
server_guid = self.__get_guid__(
|
|
976
|
+
server_guid,
|
|
977
|
+
display_name,
|
|
978
|
+
"qualifiedName",
|
|
979
|
+
qualified_name,
|
|
980
|
+
"Integration Daemon",
|
|
981
|
+
)
|
|
982
|
+
url = (
|
|
983
|
+
f"{self.runtime_command_root}/integration-daemon/"
|
|
984
|
+
f"{server_guid}/integration-groups/{integ_group_name}/refresh-config"
|
|
985
|
+
)
|
|
986
|
+
|
|
987
|
+
await self._async_make_request("GET", url, body=body)
|
|
988
|
+
return
|
|
989
|
+
|
|
990
|
+
def refresh_integ_group_config(
|
|
991
|
+
self,
|
|
992
|
+
integ_group_name: Optional[str] = None,
|
|
993
|
+
server_guid: Optional[str] = None,
|
|
994
|
+
display_name: Optional[str] = None,
|
|
995
|
+
qualified_name: Optional[str] = None,
|
|
996
|
+
body: Optional[dict] = None,
|
|
997
|
+
) -> None:
|
|
998
|
+
"""Request that the integration group refresh its configuration by calling the metadata access server.
|
|
999
|
+
Changes to the connector configuration will result in the affected connectors being restarted.
|
|
1000
|
+
This request is useful if the metadata access server has an outage, particularly while the integration
|
|
1001
|
+
daemon is initializing. This request just ensures that the latest configuration is in use.
|
|
1002
|
+
|
|
1003
|
+
https://egeria-project.org/concepts/integration-connector/
|
|
1004
|
+
|
|
1005
|
+
Parameters
|
|
1006
|
+
----------
|
|
1007
|
+
server_guid : str, default = None
|
|
1008
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
1009
|
+
display_name: str, default = None
|
|
1010
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
1011
|
+
qualified_name: str, default = None
|
|
1012
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
1013
|
+
integ_group_name : str, opt, default = None
|
|
1014
|
+
Name of the integration group to refresh. If None, all groups are refreshed.
|
|
1015
|
+
|
|
1016
|
+
body : dict, optional
|
|
1017
|
+
Request body to pass directly to the API.
|
|
1018
|
+
|
|
1019
|
+
Returns
|
|
1020
|
+
-------
|
|
1021
|
+
None
|
|
1022
|
+
|
|
1023
|
+
Raises
|
|
1024
|
+
------
|
|
1025
|
+
PyegeriaInvalidParameterException
|
|
1026
|
+
PyegeriaAPIException
|
|
1027
|
+
PyegeriaUnauthorizedException
|
|
1028
|
+
|
|
1029
|
+
"""
|
|
1030
|
+
loop = asyncio.get_event_loop()
|
|
1031
|
+
loop.run_until_complete(
|
|
1032
|
+
self._async_refresh_integ_group_config(
|
|
1033
|
+
integ_group_name, server_guid, display_name, qualified_name, body
|
|
1034
|
+
)
|
|
1035
|
+
)
|
|
1036
|
+
return
|
|
1037
|
+
|
|
1038
|
+
#
|
|
1039
|
+
# Open Lineage & Archives
|
|
1040
|
+
#
|
|
1041
|
+
async def _async_publish_open_lineage_event(
|
|
1042
|
+
self,
|
|
1043
|
+
ol_event: dict,
|
|
1044
|
+
server_guid: Optional[str] = None,
|
|
1045
|
+
display_name: Optional[str] = None,
|
|
1046
|
+
qualified_name: Optional[str] = None,
|
|
1047
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
1048
|
+
) -> None:
|
|
1049
|
+
"""Send an Open Lineage event to the integration daemon. It will pass it on to the integration connectors that
|
|
1050
|
+
have registered a listener for open lineage events. Async version.
|
|
1051
|
+
|
|
1052
|
+
https://egeria-project.org/features/lineage-management/overview/#the-openlineage-standard
|
|
1053
|
+
|
|
1054
|
+
Parameters
|
|
1055
|
+
----------
|
|
1056
|
+
server_guid : str, default = None
|
|
1057
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
1058
|
+
display_name: str, default = None
|
|
1059
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
1060
|
+
qualified_name: str, default = None
|
|
1061
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
1062
|
+
ol_event : dict
|
|
1063
|
+
Dict containing the user specified Open Lineage event.
|
|
1064
|
+
|
|
1065
|
+
body : dict | FilterRequestBody, optional
|
|
1066
|
+
Request body to pass directly to the API.
|
|
1067
|
+
|
|
1068
|
+
Returns
|
|
1069
|
+
-------
|
|
1070
|
+
None
|
|
1071
|
+
|
|
1072
|
+
Raises
|
|
1073
|
+
------
|
|
1074
|
+
PyegeriaInvalidParameterException
|
|
1075
|
+
PyegeriaAPIException
|
|
1076
|
+
PyegeriaUnauthorizedException
|
|
1077
|
+
|
|
1078
|
+
"""
|
|
1079
|
+
server_guid = self.__get_guid__(
|
|
1080
|
+
server_guid,
|
|
1081
|
+
display_name,
|
|
1082
|
+
"resourceName",
|
|
1083
|
+
qualified_name,
|
|
1084
|
+
)
|
|
1085
|
+
url = (
|
|
1086
|
+
f"{self.runtime_command_root}/integration-daemons/{server_guid}/open-lineage-events/publish-event-string"
|
|
1087
|
+
)
|
|
1088
|
+
|
|
1089
|
+
payload = body if body else ol_event
|
|
1090
|
+
await self._async_make_request("POST", url, payload)
|
|
1091
|
+
|
|
1092
|
+
def publish_open_lineage_event(
|
|
1093
|
+
self,
|
|
1094
|
+
ol_event: dict,
|
|
1095
|
+
server_guid: Optional[str] = None,
|
|
1096
|
+
display_name: Optional[str] = None,
|
|
1097
|
+
qualified_name: Optional[str] = None,
|
|
1098
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
1099
|
+
) -> None:
|
|
1100
|
+
"""Send an Open Lineage event to the integration daemon. It will pass it on to the integration connectors that
|
|
1101
|
+
have registered a listener for open lineage events.
|
|
1102
|
+
|
|
1103
|
+
https://egeria-project.org/features/lineage-management/overview/#the-openlineage-standard
|
|
1104
|
+
|
|
1105
|
+
Parameters
|
|
1106
|
+
----------
|
|
1107
|
+
server_guid : str, default = None
|
|
1108
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
1109
|
+
display_name: str, default = None
|
|
1110
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
1111
|
+
qualified_name: str, default = None
|
|
1112
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
1113
|
+
ol_event : dict
|
|
1114
|
+
Dict containing the user specified Open Lineage event.
|
|
1115
|
+
|
|
1116
|
+
body : dict | FilterRequestBody, optional
|
|
1117
|
+
Request body to pass directly to the API.
|
|
1118
|
+
|
|
1119
|
+
Returns
|
|
1120
|
+
-------
|
|
1121
|
+
None
|
|
1122
|
+
|
|
1123
|
+
Raises
|
|
1124
|
+
------
|
|
1125
|
+
PyegeriaInvalidParameterException
|
|
1126
|
+
PyegeriaAPIException
|
|
1127
|
+
PyegeriaUnauthorizedException
|
|
1128
|
+
|
|
1129
|
+
"""
|
|
1130
|
+
loop = asyncio.get_event_loop()
|
|
1131
|
+
loop.run_until_complete(
|
|
1132
|
+
self._async_publish_open_lineage_event(ol_event, server_guid, display_name, qualified_name, body)
|
|
1133
|
+
)
|
|
1134
|
+
|
|
1135
|
+
|
|
1136
|
+
async def _async_add_archive_content(
|
|
1137
|
+
self,
|
|
1138
|
+
archive_content: dict,
|
|
1139
|
+
server_guid: Optional[str] = None,
|
|
1140
|
+
display_name: Optional[str] = None,
|
|
1141
|
+
qualified_name: Optional[str] = None,
|
|
1142
|
+
time_out: int = 60,
|
|
1143
|
+
body: Optional[dict | ArchiveRequestBody] = None,
|
|
1144
|
+
) -> None:
|
|
1145
|
+
"""An open metadata archive contains metadata types and instances.
|
|
1146
|
+
This operation loads the supplied open metadata archive into the local repository. It can be used with OMAG
|
|
1147
|
+
servers that are of type Open Metadata Store. Async version.
|
|
1148
|
+
|
|
1149
|
+
https://egeria-project.org/concepts/open-metadata-archives/
|
|
1150
|
+
|
|
1151
|
+
Parameters
|
|
1152
|
+
----------
|
|
1153
|
+
server_guid : str, default = None
|
|
1154
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
1155
|
+
display_name: str, default = None
|
|
1156
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
1157
|
+
qualified_name: str, default = None
|
|
1158
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
1159
|
+
archive_content : dict
|
|
1160
|
+
A dict containing the content of the archive to load.
|
|
1161
|
+
time_out : int, optional, default = 60 seconds
|
|
1162
|
+
Timeout for the REST call.
|
|
1163
|
+
|
|
1164
|
+
body : dict | ArchiveRequestBody, optional
|
|
1165
|
+
Request body to pass directly to the API.
|
|
1166
|
+
|
|
1167
|
+
Returns
|
|
1168
|
+
-------
|
|
1169
|
+
None
|
|
1170
|
+
|
|
1171
|
+
Raises
|
|
1172
|
+
------
|
|
1173
|
+
PyegeriaInvalidParameterException
|
|
1174
|
+
PyegeriaAPIException
|
|
1175
|
+
PyegeriaUnauthorizedException
|
|
1176
|
+
|
|
1177
|
+
"""
|
|
1178
|
+
server_guid = self.__get_guid__(
|
|
1179
|
+
server_guid,
|
|
1180
|
+
display_name,
|
|
1181
|
+
"qualifiedName",
|
|
1182
|
+
qualified_name,
|
|
1183
|
+
"Metadata Access Server",
|
|
1184
|
+
)
|
|
1185
|
+
url = (
|
|
1186
|
+
f"{self.runtime_command_root}/metadata-access-stores/{server_guid}/instance/load/open-metadata-archives/"
|
|
1187
|
+
f"archive-content"
|
|
1188
|
+
)
|
|
1189
|
+
|
|
1190
|
+
payload = body if body else archive_content
|
|
1191
|
+
await self._async_make_request("POST", url, payload, time_out=time_out)
|
|
1192
|
+
return
|
|
1193
|
+
|
|
1194
|
+
def add_archive_content(
|
|
1195
|
+
self,
|
|
1196
|
+
archive_content: dict,
|
|
1197
|
+
server_guid: Optional[str] = None,
|
|
1198
|
+
display_name: Optional[str] = None,
|
|
1199
|
+
qualified_name: Optional[str] = None,
|
|
1200
|
+
time_out: int = 60,
|
|
1201
|
+
body: Optional[dict | ArchiveRequestBody] = None,
|
|
1202
|
+
) -> None:
|
|
1203
|
+
"""An open metadata archive contains metadata types and instances.
|
|
1204
|
+
This operation loads the supplied open metadata archive into the local repository. It can be used with OMAG
|
|
1205
|
+
servers that are of type Open Metadata Store.
|
|
1206
|
+
|
|
1207
|
+
https://egeria-project.org/concepts/open-metadata-archives/
|
|
1208
|
+
|
|
1209
|
+
Parameters
|
|
1210
|
+
----------
|
|
1211
|
+
archive_content : dict
|
|
1212
|
+
A dict containing the content of the archive to load.
|
|
1213
|
+
server_guid : str, default = None
|
|
1214
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
1215
|
+
display_name: str, default = None
|
|
1216
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
1217
|
+
qualified_name: str, default = None
|
|
1218
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
1219
|
+
time_out : int, optional, default = 60 seconds
|
|
1220
|
+
Timeout for the REST call.
|
|
1221
|
+
|
|
1222
|
+
body : dict | ArchiveRequestBody, optional
|
|
1223
|
+
Request body to pass directly to the API.
|
|
1224
|
+
|
|
1225
|
+
Returns
|
|
1226
|
+
-------
|
|
1227
|
+
None
|
|
1228
|
+
|
|
1229
|
+
Raises
|
|
1230
|
+
------
|
|
1231
|
+
PyegeriaInvalidParameterException
|
|
1232
|
+
PyegeriaAPIException
|
|
1233
|
+
PyegeriaUnauthorizedException
|
|
1234
|
+
|
|
1235
|
+
"""
|
|
1236
|
+
loop = asyncio.get_event_loop()
|
|
1237
|
+
loop.run_until_complete(
|
|
1238
|
+
self._async_add_archive_content(
|
|
1239
|
+
archive_content, server_guid, display_name, qualified_name, time_out, body
|
|
1240
|
+
)
|
|
1241
|
+
)
|
|
1242
|
+
return
|
|
1243
|
+
|
|
1244
|
+
async def _async_add_archive_file(
|
|
1245
|
+
self,
|
|
1246
|
+
archive_file: str,
|
|
1247
|
+
server_guid: Optional[str] = None,
|
|
1248
|
+
display_name: Optional[str] = None,
|
|
1249
|
+
qualified_name: Optional[str] = None,
|
|
1250
|
+
time_out: int = 120,
|
|
1251
|
+
body: Optional[dict | ArchiveRequestBody] = None,
|
|
1252
|
+
) -> None:
|
|
1253
|
+
"""Add a new open metadata archive to running OMAG Server's repository.
|
|
1254
|
+
An open metadata archive contains metadata types and instances. This operation loads an open metadata archive
|
|
1255
|
+
that is stored in the named file. It can be used with OMAG servers that are of type Open Metadata Store.
|
|
1256
|
+
Async version.
|
|
1257
|
+
|
|
1258
|
+
https://egeria-project.org/concepts/open-metadata-archives/
|
|
1259
|
+
|
|
1260
|
+
Parameters
|
|
1261
|
+
----------
|
|
1262
|
+
archive_file: str
|
|
1263
|
+
Open metadata archive file to load.
|
|
1264
|
+
server_guid : str, default = None
|
|
1265
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
1266
|
+
display_name: str, default = None
|
|
1267
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
1268
|
+
qualified_name: str, default = None
|
|
1269
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
1270
|
+
time_out: int, optional
|
|
1271
|
+
Time out for the rest call.
|
|
1272
|
+
|
|
1273
|
+
body : dict | ArchiveRequestBody, optional
|
|
1274
|
+
Request body to pass directly to the API.
|
|
1275
|
+
|
|
1276
|
+
Returns
|
|
1277
|
+
-------
|
|
1278
|
+
Response
|
|
1279
|
+
None
|
|
1280
|
+
|
|
1281
|
+
Raises
|
|
1282
|
+
------
|
|
1283
|
+
PyegeriaInvalidParameterException
|
|
1284
|
+
PyegeriaAPIException
|
|
1285
|
+
PyegeriaUnauthorizedException
|
|
1286
|
+
|
|
1287
|
+
"""
|
|
1288
|
+
server_guid = self.__get_guid__(
|
|
1289
|
+
server_guid,
|
|
1290
|
+
display_name,
|
|
1291
|
+
"resourceName",
|
|
1292
|
+
qualified_name,
|
|
1293
|
+
"Metadata Access Server",
|
|
1294
|
+
)
|
|
1295
|
+
url = f"{self.runtime_command_root}/metadata-access-stores/{server_guid}/instance/load/open-metadata-archives/file"
|
|
1296
|
+
|
|
1297
|
+
payload = body if body else archive_file
|
|
1298
|
+
await self._async_make_request(
|
|
1299
|
+
"POST-DATA", url, payload, time_out=time_out
|
|
1300
|
+
)
|
|
1301
|
+
return
|
|
1302
|
+
|
|
1303
|
+
def add_archive_file(
|
|
1304
|
+
self,
|
|
1305
|
+
archive_file: str,
|
|
1306
|
+
server_guid: Optional[str] = None,
|
|
1307
|
+
display_name: Optional[str] = None,
|
|
1308
|
+
qualified_name: Optional[str] = None,
|
|
1309
|
+
time_out: int = 120,
|
|
1310
|
+
body: Optional[dict | ArchiveRequestBody] = None,
|
|
1311
|
+
) -> None:
|
|
1312
|
+
"""Add a new open metadata archive to running OMAG Server's repository.
|
|
1313
|
+
An open metadata archive contains metadata types and instances. This operation loads an open metadata archive
|
|
1314
|
+
that is stored in the named file. It can be used with OMAG servers that are of type Open Metadata Store.
|
|
1315
|
+
|
|
1316
|
+
https://egeria-project.org/concepts/open-metadata-archives/
|
|
1317
|
+
|
|
1318
|
+
Parameters
|
|
1319
|
+
----------
|
|
1320
|
+
archive_file: str
|
|
1321
|
+
Open metadata archive file to load.
|
|
1322
|
+
server_guid : str, default = None
|
|
1323
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
1324
|
+
display_name: str, default = None
|
|
1325
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
1326
|
+
qualified_name: str, default = None
|
|
1327
|
+
Unique name of server to act on. If not specified, server_guid or server_name must be.
|
|
1328
|
+
time_out: int, optional, default = 60 seconds
|
|
1329
|
+
|
|
1330
|
+
body : dict | ArchiveRequestBody, optional
|
|
1331
|
+
Request body to pass directly to the API.
|
|
1332
|
+
|
|
1333
|
+
Returns
|
|
1334
|
+
-------
|
|
1335
|
+
Response
|
|
1336
|
+
None
|
|
1337
|
+
|
|
1338
|
+
Raises
|
|
1339
|
+
------
|
|
1340
|
+
PyegeriaInvalidParameterException
|
|
1341
|
+
PyegeriaAPIException
|
|
1342
|
+
PyegeriaUnauthorizedException
|
|
1343
|
+
|
|
1344
|
+
"""
|
|
1345
|
+
|
|
1346
|
+
loop = asyncio.get_event_loop()
|
|
1347
|
+
loop.run_until_complete(
|
|
1348
|
+
self._async_add_archive_file(
|
|
1349
|
+
archive_file, server_guid, display_name, qualified_name, time_out, body
|
|
1350
|
+
)
|
|
1351
|
+
)
|
|
1352
|
+
return
|
|
1353
|
+
|
|
1354
|
+
#
|
|
1355
|
+
# Server & Platform admin
|
|
1356
|
+
#
|
|
1357
|
+
async def _async_shutdown_and_unregister_server(
|
|
1358
|
+
self,
|
|
1359
|
+
server_guid: Optional[str] = None,
|
|
1360
|
+
qualified_name: Optional[str] = None,
|
|
1361
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
1362
|
+
) -> None:
|
|
1363
|
+
"""Shutdown the named OMAG server. The server will also be removed from any open metadata repository cohorts
|
|
1364
|
+
it has registered with. Async version.
|
|
1365
|
+
|
|
1366
|
+
Parameters
|
|
1367
|
+
----------
|
|
1368
|
+
server_guid : str, default = None
|
|
1369
|
+
Identity of the server to act on. If not specified, qualified_name must be.
|
|
1370
|
+
qualified_name: str, default = None
|
|
1371
|
+
Unique name of server to act on. If not specified, server_guid must be.
|
|
1372
|
+
|
|
1373
|
+
body : dict | FilterRequestBody, optional
|
|
1374
|
+
Request body to pass directly to the API.
|
|
1375
|
+
|
|
1376
|
+
Returns
|
|
1377
|
+
-------
|
|
1378
|
+
Response
|
|
1379
|
+
None
|
|
1380
|
+
|
|
1381
|
+
Raises
|
|
1382
|
+
------
|
|
1383
|
+
PyegeriaInvalidParameterException
|
|
1384
|
+
PyegeriaAPIException
|
|
1385
|
+
PyegeriaUnauthorizedException
|
|
1386
|
+
|
|
1387
|
+
"""
|
|
1388
|
+
server_guid = self.__get_guid__(
|
|
1389
|
+
server_guid, property_name="qualifiedName", qualified_name=qualified_name
|
|
1390
|
+
)
|
|
1391
|
+
url = f"{self.runtime_command_root}/omag-servers/{server_guid}"
|
|
1392
|
+
|
|
1393
|
+
await self._async_make_request("DELETE", url, body=body)
|
|
1394
|
+
|
|
1395
|
+
return
|
|
1396
|
+
|
|
1397
|
+
def shutdown_and_unregister_server(
|
|
1398
|
+
self, server_guid: Optional[str] = None, qualified_name: str = None, body: Optional[dict | FilterRequestBody] = None
|
|
1399
|
+
) -> None:
|
|
1400
|
+
"""Shutdown the named OMAG server. The server will also be removed from any open metadata repository cohorts
|
|
1401
|
+
it has registered with.
|
|
1402
|
+
|
|
1403
|
+
Parameters
|
|
1404
|
+
----------
|
|
1405
|
+
server_guid : str, default = None
|
|
1406
|
+
Identity of the server to act on. If not specified, qualified_name must be.
|
|
1407
|
+
qualified_name: str, default = None
|
|
1408
|
+
Unique name of server to act on. If not specified, server_guid must be.
|
|
1409
|
+
body : dict | FilterRequestBody, optional
|
|
1410
|
+
Request body to pass directly to the API.
|
|
1411
|
+
|
|
1412
|
+
Returns
|
|
1413
|
+
-------
|
|
1414
|
+
Response
|
|
1415
|
+
None
|
|
1416
|
+
|
|
1417
|
+
Raises
|
|
1418
|
+
------
|
|
1419
|
+
PyegeriaInvalidParameterException
|
|
1420
|
+
PyegeriaAPIException
|
|
1421
|
+
PyegeriaUnauthorizedException
|
|
1422
|
+
|
|
1423
|
+
"""
|
|
1424
|
+
loop = asyncio.get_event_loop()
|
|
1425
|
+
loop.run_until_complete(
|
|
1426
|
+
self._async_shutdown_and_unregister_server(server_guid, qualified_name, body)
|
|
1427
|
+
)
|
|
1428
|
+
return
|
|
1429
|
+
|
|
1430
|
+
async def _async_activate_server_with_stored_config(
|
|
1431
|
+
self,
|
|
1432
|
+
server_guid: Optional[str] = None,
|
|
1433
|
+
display_name: Optional[str] = None,
|
|
1434
|
+
qualified_name: Optional[str] = None,
|
|
1435
|
+
timeout: int = 240,
|
|
1436
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
1437
|
+
) -> None:
|
|
1438
|
+
"""Activate the named OMAG server using the appropriate configuration document found in the
|
|
1439
|
+
configuration store. Async version.
|
|
1440
|
+
|
|
1441
|
+
https://egeria-project.org/concepts/configuration-document
|
|
1442
|
+
|
|
1443
|
+
Parameters
|
|
1444
|
+
----------
|
|
1445
|
+
server_guid : str, default = None
|
|
1446
|
+
Identity of the server to act on. If not specified, qualified_name or server_name must be.
|
|
1447
|
+
display_name: str, default = None
|
|
1448
|
+
Name of server to act on. If not specified, server_guid or qualified_name must be.
|
|
1449
|
+
qualified_name: str, default = None
|
|
1450
|
+
Unique name of server to act on. If not specified, server_guid must be.
|
|
1451
|
+
timeout: int, optional, default = 240 seconds
|
|
1452
|
+
|
|
1453
|
+
body : dict | FilterRequestBody, optional
|
|
1454
|
+
Request body to pass directly to the API.
|
|
1455
|
+
|
|
1456
|
+
Returns
|
|
1457
|
+
-------
|
|
1458
|
+
None
|
|
1459
|
+
|
|
1460
|
+
Raises
|
|
1461
|
+
------
|
|
1462
|
+
PyegeriaInvalidParameterException
|
|
1463
|
+
PyegeriaAPIException
|
|
1464
|
+
PyegeriaUnauthorizedException
|
|
1465
|
+
|
|
1466
|
+
"""
|
|
1467
|
+
server_guid = self.__get_guid__(
|
|
1468
|
+
server_guid, display_name, "resourceName", qualified_name
|
|
1469
|
+
)
|
|
1470
|
+
|
|
1471
|
+
url = f"{self.runtime_command_root}/omag-servers/{server_guid}/instance"
|
|
1472
|
+
|
|
1473
|
+
await self._async_make_request("POST", url, body=body, time_out=timeout)
|
|
1474
|
+
return
|
|
1475
|
+
|
|
1476
|
+
def activate_server_with_stored_config(
|
|
1477
|
+
self,
|
|
1478
|
+
server_guid: Optional[str] = None,
|
|
1479
|
+
display_name: Optional[str] = None,
|
|
1480
|
+
qualified_name: Optional[str] = None,
|
|
1481
|
+
timeout: int = 240,
|
|
1482
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
1483
|
+
) -> None:
|
|
1484
|
+
"""Activate the named OMAG server using the appropriate configuration document found in the
|
|
1485
|
+
configuration store.
|
|
1486
|
+
|
|
1487
|
+
https://egeria-project.org/concepts/configuration-document
|
|
1488
|
+
|
|
1489
|
+
Parameters
|
|
1490
|
+
----------
|
|
1491
|
+
server_guid : str, default = None
|
|
1492
|
+
Identity of the server to act on. If not specified, server_name must be.
|
|
1493
|
+
display_name: str, default = None
|
|
1494
|
+
Name of server to act on. If not specified, server_guid must be.
|
|
1495
|
+
timeout: int, optional, default = 240 seconds
|
|
1496
|
+
|
|
1497
|
+
body : dict | FilterRequestBody, optional
|
|
1498
|
+
Request body to pass directly to the API.
|
|
1499
|
+
|
|
1500
|
+
Returns
|
|
1501
|
+
-------
|
|
1502
|
+
None
|
|
1503
|
+
|
|
1504
|
+
Raises
|
|
1505
|
+
------
|
|
1506
|
+
PyegeriaInvalidParameterException
|
|
1507
|
+
PyegeriaAPIException
|
|
1508
|
+
PyegeriaUnauthorizedException
|
|
1509
|
+
|
|
1510
|
+
"""
|
|
1511
|
+
loop = asyncio.get_event_loop()
|
|
1512
|
+
loop.run_until_complete(
|
|
1513
|
+
self._async_activate_server_with_stored_config(
|
|
1514
|
+
server_guid, display_name, qualified_name, timeout, body
|
|
1515
|
+
)
|
|
1516
|
+
)
|
|
1517
|
+
return
|
|
1518
|
+
|
|
1519
|
+
async def _async_shutdown_server(
|
|
1520
|
+
self, server_guid: Optional[str] = None, qualified_name: str = None, body: Optional[dict | FilterRequestBody] = None
|
|
1521
|
+
) -> None:
|
|
1522
|
+
"""Temporarily shutdown the named OMAG server. This server can be restarted as a later time. Async version.
|
|
1523
|
+
|
|
1524
|
+
Parameters
|
|
1525
|
+
----------
|
|
1526
|
+
server_guid : str, default = None
|
|
1527
|
+
Identity of the server to act on. If not specified, qualified_name must be.
|
|
1528
|
+
qualified_name: str, default = None
|
|
1529
|
+
Qualified name of server to act on. If not specified, server_guid must be.
|
|
1530
|
+
|
|
1531
|
+
body : dict | FilterRequestBody, optional
|
|
1532
|
+
Request body to pass directly to the API.
|
|
1533
|
+
|
|
1534
|
+
Returns
|
|
1535
|
+
-------
|
|
1536
|
+
Response
|
|
1537
|
+
None
|
|
1538
|
+
|
|
1539
|
+
Raises
|
|
1540
|
+
------
|
|
1541
|
+
PyegeriaInvalidParameterException
|
|
1542
|
+
PyegeriaAPIException
|
|
1543
|
+
PyegeriaUnauthorizedException
|
|
1544
|
+
|
|
1545
|
+
"""
|
|
1546
|
+
server_guid = self.__get_guid__(
|
|
1547
|
+
server_guid, None, "qualifiedName", qualified_name
|
|
1548
|
+
)
|
|
1549
|
+
url = f"{self.runtime_command_root}/omag-servers/{server_guid}/instance"
|
|
1550
|
+
|
|
1551
|
+
await self._async_make_request("DELETE", url, body=body)
|
|
1552
|
+
|
|
1553
|
+
return
|
|
1554
|
+
|
|
1555
|
+
def shutdown_server(
|
|
1556
|
+
self, server_guid: Optional[str] = None, qualified_name: str = None, body: Optional[dict | FilterRequestBody] = None
|
|
1557
|
+
) -> None:
|
|
1558
|
+
"""Temporarily shutdown the named OMAG server. This server can be restarted as a later time.
|
|
1559
|
+
|
|
1560
|
+
Parameters
|
|
1561
|
+
----------
|
|
1562
|
+
server_guid : str, default = None
|
|
1563
|
+
Identity of the server to act on. If not specified, qualified_name must be.
|
|
1564
|
+
qualified_name: str, default = None
|
|
1565
|
+
Qualified name of server to act on. If not specified, server_guid must be.
|
|
1566
|
+
|
|
1567
|
+
body : dict | FilterRequestBody, optional
|
|
1568
|
+
Request body to pass directly to the API.
|
|
1569
|
+
|
|
1570
|
+
Returns
|
|
1571
|
+
-------
|
|
1572
|
+
Response
|
|
1573
|
+
None
|
|
1574
|
+
|
|
1575
|
+
Raises
|
|
1576
|
+
------
|
|
1577
|
+
PyegeriaInvalidParameterException
|
|
1578
|
+
PyegeriaAPIException
|
|
1579
|
+
PyegeriaUnauthorizedException
|
|
1580
|
+
|
|
1581
|
+
"""
|
|
1582
|
+
loop = asyncio.get_event_loop()
|
|
1583
|
+
loop.run_until_complete(
|
|
1584
|
+
self._async_shutdown_server(server_guid, qualified_name, body)
|
|
1585
|
+
)
|
|
1586
|
+
return
|
|
1587
|
+
|
|
1588
|
+
def get_platforms_by_name(
|
|
1589
|
+
self,
|
|
1590
|
+
filter_string: Optional[str] = None,
|
|
1591
|
+
start_from: int = 0,
|
|
1592
|
+
page_size: int = max_paging_size,
|
|
1593
|
+
output_format: str = "JSON",
|
|
1594
|
+
report_spec: str | dict = "Platforms",
|
|
1595
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
1596
|
+
) -> str | list | dict:
|
|
1597
|
+
"""Returns the list of platforms with a particular name. The name is specified in the filter.
|
|
1598
|
+
|
|
1599
|
+
Parameters
|
|
1600
|
+
----------
|
|
1601
|
+
filter_string : str, opt
|
|
1602
|
+
Filter specifies the display name or qualified name of the platforms to return information for. If the
|
|
1603
|
+
value is None, we will default to the default_platform_name that comes from the core content pack.
|
|
1604
|
+
start_from : int, optional
|
|
1605
|
+
The index from which to start fetching the engine actions. Default is 0.
|
|
1606
|
+
page_size : int, optional
|
|
1607
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
|
1608
|
+
output_format: str, optional
|
|
1609
|
+
The format of the output. Default is "JSON".
|
|
1610
|
+
report_spec: str | dict, optional
|
|
1611
|
+
The report specification to use. Default is "Platforms".
|
|
1612
|
+
|
|
1613
|
+
body : dict | FilterRequestBody, optional
|
|
1614
|
+
Request body to pass directly to the API.
|
|
1615
|
+
|
|
1616
|
+
Returns
|
|
1617
|
+
-------
|
|
1618
|
+
Response
|
|
1619
|
+
A list of JSONdict with the platform reports.
|
|
1620
|
+
"""
|
|
1621
|
+
loop = asyncio.get_event_loop()
|
|
1622
|
+
response = loop.run_until_complete(
|
|
1623
|
+
self._async_get_platforms_by_name(
|
|
1624
|
+
filter_string, start_from, page_size, output_format, report_spec, body
|
|
1625
|
+
)
|
|
1626
|
+
)
|
|
1627
|
+
return response
|
|
1628
|
+
|
|
1629
|
+
@dynamic_catch
|
|
1630
|
+
async def _async_get_platforms_by_name(
|
|
1631
|
+
self,
|
|
1632
|
+
filter_string: Optional[str] = None,
|
|
1633
|
+
start_from: int = 0,
|
|
1634
|
+
page_size: int = 0,
|
|
1635
|
+
output_format: str = "JSON",
|
|
1636
|
+
report_spec: str | dict = "Platforms",
|
|
1637
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
1638
|
+
) -> str | list | dict:
|
|
1639
|
+
"""Returns the list of platforms with a particular name. The name is specified in the filter. Async version.
|
|
1640
|
+
|
|
1641
|
+
Parameters
|
|
1642
|
+
----------
|
|
1643
|
+
filter_string : str, opt
|
|
1644
|
+
Filter specifies the display name or qualified name of the platforms to return information for. If the
|
|
1645
|
+
value is None, we will default to the default_platform_name that comes from the core content pack.
|
|
1646
|
+
|
|
1647
|
+
start_from : int, optional
|
|
1648
|
+
The index from which to start fetching the engine actions. Default is 0.
|
|
1649
|
+
|
|
1650
|
+
page_size : int, optional
|
|
1651
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
|
1652
|
+
output_format: str, optional
|
|
1653
|
+
The format of the output. Default is "JSON".
|
|
1654
|
+
report_spec: str | dict, optional
|
|
1655
|
+
The report specification to use. Default is "Platforms".
|
|
1656
|
+
|
|
1657
|
+
body : dict | FilterRequestBody, optional
|
|
1658
|
+
Request body to pass directly to the API.
|
|
1659
|
+
|
|
1660
|
+
Returns
|
|
1661
|
+
-------
|
|
1662
|
+
Response
|
|
1663
|
+
A list of JSONdict with the platform reports.
|
|
1664
|
+
|
|
1665
|
+
Raises
|
|
1666
|
+
------
|
|
1667
|
+
PyegeriaInvalidParameterException
|
|
1668
|
+
PyegeriaAPIException
|
|
1669
|
+
PyegeriaUnauthorizedException
|
|
1670
|
+
|
|
1671
|
+
"""
|
|
1672
|
+
|
|
1673
|
+
if filter_string is None:
|
|
1674
|
+
filter_string = self.default_platform_name
|
|
1675
|
+
|
|
1676
|
+
url = (
|
|
1677
|
+
f"{self.runtime_command_root}/platforms/by-name"
|
|
1678
|
+
)
|
|
1679
|
+
|
|
1680
|
+
return await self._async_get_name_request(
|
|
1681
|
+
url,
|
|
1682
|
+
_type="Platforms",
|
|
1683
|
+
_gen_output=self._generate_platform_output,
|
|
1684
|
+
filter_string=filter_string,
|
|
1685
|
+
start_from=start_from,
|
|
1686
|
+
page_size=page_size,
|
|
1687
|
+
output_format=output_format,
|
|
1688
|
+
report_spec=report_spec,
|
|
1689
|
+
body=body
|
|
1690
|
+
)
|
|
1691
|
+
|
|
1692
|
+
@dynamic_catch
|
|
1693
|
+
async def _async_get_platforms_by_type(
|
|
1694
|
+
self,
|
|
1695
|
+
filter_string: Optional[str] = None,
|
|
1696
|
+
start_from: int = 0,
|
|
1697
|
+
page_size: int = max_paging_size,
|
|
1698
|
+
output_format: str = "JSON",
|
|
1699
|
+
report_spec: str | dict = "Platforms",
|
|
1700
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
1701
|
+
) -> str | list | dict:
|
|
1702
|
+
"""Returns the list of platforms with a particular deployed implementation type. The value is specified in
|
|
1703
|
+
the filter. If it is null, or no request body is supplied, all platforms are returned. Async version.
|
|
1704
|
+
|
|
1705
|
+
Parameters
|
|
1706
|
+
----------
|
|
1707
|
+
filter_string : str, opt
|
|
1708
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
|
1709
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
|
1710
|
+
start_from : int, optional
|
|
1711
|
+
The index from which to start fetching the engine actions. Default is 0.
|
|
1712
|
+
|
|
1713
|
+
page_size : int, optional
|
|
1714
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
|
1715
|
+
output_format: str, optional
|
|
1716
|
+
The format of the output. Default is "JSON".
|
|
1717
|
+
report_spec: str | dict, optional
|
|
1718
|
+
The report specification to use. Default is "Platforms".
|
|
1719
|
+
|
|
1720
|
+
body : dict | GetRequestBody, optional
|
|
1721
|
+
Request body to pass directly to the API.
|
|
1722
|
+
|
|
1723
|
+
Returns
|
|
1724
|
+
-------
|
|
1725
|
+
Response
|
|
1726
|
+
A list of JSONdict with the platform reports.
|
|
1727
|
+
|
|
1728
|
+
Raises
|
|
1729
|
+
------
|
|
1730
|
+
PyegeriaInvalidParameterException
|
|
1731
|
+
PyegeriaAPIException
|
|
1732
|
+
PyegeriaUnauthorizedException
|
|
1733
|
+
|
|
1734
|
+
"""
|
|
1735
|
+
|
|
1736
|
+
if filter_string is None:
|
|
1737
|
+
filter_string = "OMAG Server Platform"
|
|
1738
|
+
|
|
1739
|
+
url = (
|
|
1740
|
+
f"{self.runtime_command_root}/platforms/by-deployed-implementation-type"
|
|
1741
|
+
)
|
|
1742
|
+
|
|
1743
|
+
return await self._async_get_name_request(
|
|
1744
|
+
url,
|
|
1745
|
+
_type="Platforms",
|
|
1746
|
+
_gen_output=self._generate_platform_output,
|
|
1747
|
+
filter_string=filter_string,
|
|
1748
|
+
start_from=start_from,
|
|
1749
|
+
page_size=page_size,
|
|
1750
|
+
output_format=output_format,
|
|
1751
|
+
report_spec=report_spec,
|
|
1752
|
+
body=body
|
|
1753
|
+
)
|
|
1754
|
+
|
|
1755
|
+
def get_platforms_by_type(
|
|
1756
|
+
self,
|
|
1757
|
+
filter_string: Optional[str] = None,
|
|
1758
|
+
start_from: int = 0,
|
|
1759
|
+
page_size: int = max_paging_size,
|
|
1760
|
+
output_format: str = "JSON",
|
|
1761
|
+
report_spec: str | dict = "Platforms",
|
|
1762
|
+
body: Optional[dict | GetRequestBody] = None,
|
|
1763
|
+
) -> str | list | dict:
|
|
1764
|
+
"""Returns the list of platforms with a particular deployed implementation type. The value is specified in
|
|
1765
|
+
the filter. If it is null, or no request body is supplied, all platforms are returned.
|
|
1766
|
+
|
|
1767
|
+
Parameters
|
|
1768
|
+
----------
|
|
1769
|
+
filter_string : str, opt
|
|
1770
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
|
1771
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
|
1772
|
+
start_from : int, optional
|
|
1773
|
+
The index from which to start fetching the engine actions. Default is 0.
|
|
1774
|
+
page_size : int, optional
|
|
1775
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
|
1776
|
+
output_format: str, optional
|
|
1777
|
+
The format of the output. Default is "JSON".
|
|
1778
|
+
report_spec: str | dict, optional
|
|
1779
|
+
The report specification to use. Default is "Platforms".
|
|
1780
|
+
|
|
1781
|
+
body : dict, optional
|
|
1782
|
+
Request body to pass directly to the API.
|
|
1783
|
+
|
|
1784
|
+
Returns
|
|
1785
|
+
-------
|
|
1786
|
+
A list of JSON dict with the platform reports.
|
|
1787
|
+
|
|
1788
|
+
Raises
|
|
1789
|
+
------
|
|
1790
|
+
PyegeriaInvalidParameterException
|
|
1791
|
+
PyegeriaAPIException
|
|
1792
|
+
PyegeriaUnauthorizedException
|
|
1793
|
+
|
|
1794
|
+
"""
|
|
1795
|
+
loop = asyncio.get_event_loop()
|
|
1796
|
+
return loop.run_until_complete(
|
|
1797
|
+
self._async_get_platforms_by_type(
|
|
1798
|
+
filter_string, start_from, page_size, output_format, report_spec, body
|
|
1799
|
+
)
|
|
1800
|
+
)
|
|
1801
|
+
|
|
1802
|
+
async def _async_get_platform_templates_by_type(
|
|
1803
|
+
self,
|
|
1804
|
+
filter_string: Optional[str] = None,
|
|
1805
|
+
effective_time: Optional[str] = None,
|
|
1806
|
+
start_from: int = 0,
|
|
1807
|
+
page_size: int = max_paging_size,
|
|
1808
|
+
output_format: str = "JSON", report_spec: str | dict = "Platforms",
|
|
1809
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
1810
|
+
) -> str | list:
|
|
1811
|
+
"""Returns the list of platform templates for a particular deployed implementation type. The value is
|
|
1812
|
+
specified in the filter. If it is null, or no request body is supplied, all platforms are returned.
|
|
1813
|
+
Async version.
|
|
1814
|
+
|
|
1815
|
+
Parameters
|
|
1816
|
+
----------
|
|
1817
|
+
filter_string : str, opt
|
|
1818
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
|
1819
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
|
1820
|
+
effective_time: str, optional
|
|
1821
|
+
Timeframe to return information for. Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
|
|
1822
|
+
start_from : int, optional
|
|
1823
|
+
The index from which to start fetching the engine actions. Default is 0.
|
|
1824
|
+
page_size : int, optional
|
|
1825
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
|
1826
|
+
output_format: str, optional
|
|
1827
|
+
The format of the output. Default is "JSON".
|
|
1828
|
+
report_spec: str | dict, optional
|
|
1829
|
+
The specification of the report to generate. Default is "Platforms".
|
|
1830
|
+
body : dict | FilterRequestBody, optional
|
|
1831
|
+
Request body to pass directly to the API.
|
|
1832
|
+
|
|
1833
|
+
Returns
|
|
1834
|
+
-------
|
|
1835
|
+
List of JSON dict with the platform reports.
|
|
1836
|
+
|
|
1837
|
+
Raises
|
|
1838
|
+
------
|
|
1839
|
+
PyegeriaInvalidParameterException
|
|
1840
|
+
PyegeriaAPIException
|
|
1841
|
+
PyegeriaUnauthorizedException
|
|
1842
|
+
|
|
1843
|
+
"""
|
|
1844
|
+
|
|
1845
|
+
if filter_string is None:
|
|
1846
|
+
filter_string = "OMAG Server Platform"
|
|
1847
|
+
|
|
1848
|
+
url = (
|
|
1849
|
+
f"{self.runtime_command_root}/platforms/by-deployed-implementation-type"
|
|
1850
|
+
)
|
|
1851
|
+
|
|
1852
|
+
|
|
1853
|
+
return await self._async_get_name_request(
|
|
1854
|
+
url,
|
|
1855
|
+
_type="Platforms",
|
|
1856
|
+
_gen_output=self._generate_platform_output,
|
|
1857
|
+
filter_string=filter_string,
|
|
1858
|
+
classification_names=["Template"],
|
|
1859
|
+
start_from=start_from,
|
|
1860
|
+
page_size=page_size,
|
|
1861
|
+
output_format=output_format,
|
|
1862
|
+
report_spec=report_spec,
|
|
1863
|
+
body=body
|
|
1864
|
+
)
|
|
1865
|
+
|
|
1866
|
+
def get_platform_templates_by_type(
|
|
1867
|
+
self,
|
|
1868
|
+
filter_string: Optional[str] = None,
|
|
1869
|
+
effective_time: Optional[str] = None,
|
|
1870
|
+
start_from: int = 0,
|
|
1871
|
+
page_size: int = max_paging_size,
|
|
1872
|
+
output_format: str = "JSON", report_spec: str | dict = "Platforms",
|
|
1873
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
1874
|
+
) -> str | list:
|
|
1875
|
+
"""Returns the list of platform templates with a particular deployed implementation type. The value is
|
|
1876
|
+
specified in the filter. If it is null, or no request body is supplied, all platforms are returned.
|
|
1877
|
+
|
|
1878
|
+
Parameters
|
|
1879
|
+
----------
|
|
1880
|
+
filter_string : str, opt
|
|
1881
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
|
1882
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
|
1883
|
+
effective_time: str, optional
|
|
1884
|
+
Timeframe to return information for. Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
|
|
1885
|
+
start_from : int, optional
|
|
1886
|
+
The index from which to start fetching the engine actions. Default is 0.
|
|
1887
|
+
page_size : int, optional
|
|
1888
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
|
1889
|
+
output_format: str, optional
|
|
1890
|
+
The format of the output. Default is "JSON".
|
|
1891
|
+
report_spec: str | dict, optional
|
|
1892
|
+
The specification of the report to generate. Default is "Platforms".
|
|
1893
|
+
body : dict | FilterRequestBody, optional
|
|
1894
|
+
Request body to pass directly to the API.
|
|
1895
|
+
|
|
1896
|
+
Returns
|
|
1897
|
+
-------
|
|
1898
|
+
List of JSON dict with the platform reports.
|
|
1899
|
+
|
|
1900
|
+
Raises
|
|
1901
|
+
------
|
|
1902
|
+
PyegeriaInvalidParameterException
|
|
1903
|
+
PyegeriaAPIException
|
|
1904
|
+
PyegeriaUnauthorizedException
|
|
1905
|
+
|
|
1906
|
+
"""
|
|
1907
|
+
loop = asyncio.get_event_loop()
|
|
1908
|
+
response = loop.run_until_complete(
|
|
1909
|
+
self._async_get_platform_templates_by_type(filter_string, effective_time, start_from, page_size, body=body)
|
|
1910
|
+
)
|
|
1911
|
+
return response
|
|
1912
|
+
|
|
1913
|
+
@dynamic_catch
|
|
1914
|
+
async def _async_get_platform_report(
|
|
1915
|
+
self,
|
|
1916
|
+
platform_guid: Optional[str] = None,
|
|
1917
|
+
platform_name: str = None,
|
|
1918
|
+
output_format: str = "JSON",
|
|
1919
|
+
report_spec: str | dict = "Platform-Report"
|
|
1920
|
+
) -> str | list | dict:
|
|
1921
|
+
"""Returns details about the running platform. Async version.
|
|
1922
|
+
|
|
1923
|
+
Parameters
|
|
1924
|
+
----------
|
|
1925
|
+
platform_guid : str
|
|
1926
|
+
The unique identifier for the platform. If not specified, platform_name must be.
|
|
1927
|
+
platform_name: str, default = None
|
|
1928
|
+
Name of server to act on. If not specified, platform_guid must be.
|
|
1929
|
+
output_format: str, optional
|
|
1930
|
+
The format of the output. Default is "JSON".
|
|
1931
|
+
report_spec: str | dict, optional
|
|
1932
|
+
The report specification to use. Default is "Platform-Report".
|
|
1933
|
+
|
|
1934
|
+
Returns
|
|
1935
|
+
-------
|
|
1936
|
+
Response
|
|
1937
|
+
A JSONdict with the platform report.
|
|
1938
|
+
|
|
1939
|
+
Raises
|
|
1940
|
+
------
|
|
1941
|
+
PyegeriaInvalidParameterException
|
|
1942
|
+
PyegeriaAPIException
|
|
1943
|
+
PyegeriaUnauthorizedException
|
|
1944
|
+
|
|
1945
|
+
"""
|
|
1946
|
+
platform_guid = await self.__async_get_guid__(guid=platform_guid, display_name= platform_name, property_name="displayName")
|
|
1947
|
+
url = f"{self.runtime_command_root}/platforms/{platform_guid}/report"
|
|
1948
|
+
|
|
1949
|
+
response = await self._async_make_request("GET",url)
|
|
1950
|
+
elements = response.json().get("element", NO_ELEMENTS_FOUND)
|
|
1951
|
+
if type(elements) is str:
|
|
1952
|
+
elements = response.json().get("elementGraph", NO_ELEMENTS_FOUND)
|
|
1953
|
+
if type(elements) is str:
|
|
1954
|
+
logger.info(NO_ELEMENTS_FOUND)
|
|
1955
|
+
return NO_ELEMENTS_FOUND
|
|
1956
|
+
|
|
1957
|
+
if output_format != 'JSON': # return a simplified markdown representation
|
|
1958
|
+
logger.info(f"Found elements, output format: {output_format} and report_spec: {report_spec}")
|
|
1959
|
+
return self._generate_platform_report_output(elements, "None", "Platform-Report", output_format, report_spec)
|
|
1960
|
+
return elements
|
|
1961
|
+
|
|
1962
|
+
def get_platform_report(
|
|
1963
|
+
self,
|
|
1964
|
+
platform_guid: Optional[str] = None,
|
|
1965
|
+
platform_name: str = None,
|
|
1966
|
+
output_format: str = "JSON",
|
|
1967
|
+
report_spec: str | dict = "Platform-Report",
|
|
1968
|
+
) -> str | list | dict:
|
|
1969
|
+
"""Returns details about the running platform.
|
|
1970
|
+
|
|
1971
|
+
Parameters
|
|
1972
|
+
----------
|
|
1973
|
+
platform_guid : str
|
|
1974
|
+
The unique identifier for the platform. If not specified, platform_name must be.
|
|
1975
|
+
platform_name: str, default = None
|
|
1976
|
+
Name of server to act on. If not specified, platform_guid must be.
|
|
1977
|
+
output_format: str, optional
|
|
1978
|
+
The format of the output. Default is "JSON".
|
|
1979
|
+
report_spec: str | dict, optional
|
|
1980
|
+
The report specification to use. Default is "Platform-Report".
|
|
1981
|
+
|
|
1982
|
+
Returns
|
|
1983
|
+
-------
|
|
1984
|
+
Response
|
|
1985
|
+
A JSONdict with the platform report.
|
|
1986
|
+
|
|
1987
|
+
Raises
|
|
1988
|
+
------
|
|
1989
|
+
PyegeriaInvalidParameterException
|
|
1990
|
+
PyegeriaAPIException
|
|
1991
|
+
PyegeriaUnauthorizedException
|
|
1992
|
+
"""
|
|
1993
|
+
loop = asyncio.get_event_loop()
|
|
1994
|
+
return loop.run_until_complete(
|
|
1995
|
+
self._async_get_platform_report(platform_guid, platform_name, output_format, report_spec)
|
|
1996
|
+
)
|
|
1997
|
+
|
|
1998
|
+
async def _async_get_platform_by_guid(
|
|
1999
|
+
self,
|
|
2000
|
+
platform_guid: str,
|
|
2001
|
+
output_format: str = "JSON",
|
|
2002
|
+
report_spec: str | dict = "Platforms",
|
|
2003
|
+
body: Optional[dict | GetRequestBody] = None
|
|
2004
|
+
) -> str | list:
|
|
2005
|
+
"""Returns details about the platform's catalog entry (asset). Async version.
|
|
2006
|
+
|
|
2007
|
+
Parameters
|
|
2008
|
+
----------
|
|
2009
|
+
platform_guid : str
|
|
2010
|
+
Unique id of the platform to return details of.
|
|
2011
|
+
output_format: str, optional
|
|
2012
|
+
- The format of the output. Default is "JSON".
|
|
2013
|
+
report_spec: str | dict, optional
|
|
2014
|
+
- The specification of the report to generate. Default is "Platforms".
|
|
2015
|
+
body : dict | GetRequestBody, optional
|
|
2016
|
+
Request body to pass directly to the API.
|
|
2017
|
+
|
|
2018
|
+
Returns
|
|
2019
|
+
-------
|
|
2020
|
+
Response
|
|
2021
|
+
A list of JSONdict with the platform reports.
|
|
2022
|
+
|
|
2023
|
+
"""
|
|
2024
|
+
|
|
2025
|
+
url = f"{self.runtime_command_root}/platforms/{platform_guid}"
|
|
2026
|
+
|
|
2027
|
+
response = await self._async_get_guid_request(
|
|
2028
|
+
url=url,
|
|
2029
|
+
_type="SoftwareServerPlatform",
|
|
2030
|
+
_gen_output=self._generate_platform_output,
|
|
2031
|
+
output_format=output_format,
|
|
2032
|
+
report_spec=report_spec,
|
|
2033
|
+
body=body
|
|
2034
|
+
)
|
|
2035
|
+
return response
|
|
2036
|
+
|
|
2037
|
+
def get_platform_by_guid(
|
|
2038
|
+
self,
|
|
2039
|
+
platform_guid: str,
|
|
2040
|
+
output_format: str = "JSON", report_spec: str | dict = "Platforms",
|
|
2041
|
+
body: Optional[dict | GetRequestBody] = None,
|
|
2042
|
+
) -> str | list:
|
|
2043
|
+
"""Returns details about the platform's catalog entry (asset).
|
|
2044
|
+
|
|
2045
|
+
Parameters
|
|
2046
|
+
----------
|
|
2047
|
+
platform_guid : str, opt
|
|
2048
|
+
Identity of the platform to return details about.
|
|
2049
|
+
output_format: str, optional
|
|
2050
|
+
- The format of the output. Default is "JSON".
|
|
2051
|
+
report_spec: str | dict, optional
|
|
2052
|
+
- The specification of the report to generate. Default is "Platforms".
|
|
2053
|
+
|
|
2054
|
+
body : dict | GetRequestBody, optional
|
|
2055
|
+
Request body to pass directly to the API.
|
|
2056
|
+
|
|
2057
|
+
Returns
|
|
2058
|
+
-------
|
|
2059
|
+
List of JSON dict with the platform reports.
|
|
2060
|
+
|
|
2061
|
+
Raises
|
|
2062
|
+
------
|
|
2063
|
+
PyegeriaInvalidParameterException
|
|
2064
|
+
PyegeriaAPIException
|
|
2065
|
+
PyegeriaUnauthorizedException
|
|
2066
|
+
|
|
2067
|
+
"""
|
|
2068
|
+
loop = asyncio.get_event_loop()
|
|
2069
|
+
response = loop.run_until_complete(
|
|
2070
|
+
self._async_get_platform_by_guid(platform_guid, output_format, report_spec, body)
|
|
2071
|
+
)
|
|
2072
|
+
return response
|
|
2073
|
+
|
|
2074
|
+
@dynamic_catch
|
|
2075
|
+
async def _async_get_server_by_guid(
|
|
2076
|
+
self,
|
|
2077
|
+
server_guid: Optional[str] = None,
|
|
2078
|
+
output_format: str = "JSON",
|
|
2079
|
+
report_spec: str | dict = "OMAGServers",
|
|
2080
|
+
body: Optional[dict | GetRequestBody] = None,
|
|
2081
|
+
) -> str | dict:
|
|
2082
|
+
"""Returns details about the server's catalog entry (asset). Async version.
|
|
2083
|
+
|
|
2084
|
+
Parameters
|
|
2085
|
+
----------
|
|
2086
|
+
server_guid : str
|
|
2087
|
+
The unique identifier for the platform.
|
|
2088
|
+
output_format: str, optional
|
|
2089
|
+
- The format of the output. Default is "JSON".
|
|
2090
|
+
report_spec: str | dict, optional
|
|
2091
|
+
- The specification of the report to generate. Default is "OMAGServers".
|
|
2092
|
+
body : dict | GetRequestBody, optional
|
|
2093
|
+
Request body to pass directly to the API.
|
|
2094
|
+
|
|
2095
|
+
Returns
|
|
2096
|
+
-------
|
|
2097
|
+
List of JSON dict with the platform reports.
|
|
2098
|
+
|
|
2099
|
+
Raises
|
|
2100
|
+
------
|
|
2101
|
+
PyegeriaInvalidParameterException
|
|
2102
|
+
PyegeriaAPIException
|
|
2103
|
+
PyegeriaUnauthorizedException
|
|
2104
|
+
"""
|
|
2105
|
+
|
|
2106
|
+
url = f"{self.runtime_command_root}/software-servers/{server_guid}"
|
|
2107
|
+
response = await self._async_get_guid_request(
|
|
2108
|
+
url=url,
|
|
2109
|
+
_type="SoftwareServer",
|
|
2110
|
+
_gen_output=self._generate_omag_server_output,
|
|
2111
|
+
output_format=output_format,
|
|
2112
|
+
report_spec=report_spec,
|
|
2113
|
+
body=body
|
|
2114
|
+
)
|
|
2115
|
+
return response
|
|
2116
|
+
|
|
2117
|
+
|
|
2118
|
+
@dynamic_catch
|
|
2119
|
+
def get_server_by_guid(
|
|
2120
|
+
self,
|
|
2121
|
+
server_guid: Optional[str] = None,
|
|
2122
|
+
output_format: str = "JSON",
|
|
2123
|
+
report_spec: str | dict = "OMAGServers",
|
|
2124
|
+
body: Optional[dict | GetRequestBody] = None,
|
|
2125
|
+
) -> str | dict:
|
|
2126
|
+
"""Returns details about the platform's catalog entry (asset).
|
|
2127
|
+
|
|
2128
|
+
Parameters
|
|
2129
|
+
----------
|
|
2130
|
+
server_guid : str
|
|
2131
|
+
The unique identifier for the platform.
|
|
2132
|
+
output_format: str, optional
|
|
2133
|
+
- The format of the output. Default is "JSON".
|
|
2134
|
+
report_spec: str | dict, optional
|
|
2135
|
+
- The specification of the report to generate. Default is "OMAGServers".
|
|
2136
|
+
body : dict | GetRequestBody, optional
|
|
2137
|
+
Request body to pass directly to the API.
|
|
2138
|
+
|
|
2139
|
+
Returns
|
|
2140
|
+
-------
|
|
2141
|
+
List of JSON dict with the platform reports.
|
|
2142
|
+
|
|
2143
|
+
Raises
|
|
2144
|
+
------
|
|
2145
|
+
PyegeriaInvalidParameterException
|
|
2146
|
+
PyegeriaAPIException
|
|
2147
|
+
PyegeriaUnauthorizedException
|
|
2148
|
+
|
|
2149
|
+
"""
|
|
2150
|
+
loop = asyncio.get_event_loop()
|
|
2151
|
+
response = loop.run_until_complete(
|
|
2152
|
+
self._async_get_server_by_guid(server_guid, output_format=output_format,
|
|
2153
|
+
report_spec=report_spec, body=body)
|
|
2154
|
+
)
|
|
2155
|
+
return response
|
|
2156
|
+
|
|
2157
|
+
@dynamic_catch
|
|
2158
|
+
async def _async_get_servers_by_name(
|
|
2159
|
+
self,
|
|
2160
|
+
filter_string: Optional[str] = None,
|
|
2161
|
+
start_from: int = 0,
|
|
2162
|
+
page_size: int = max_paging_size,
|
|
2163
|
+
output_format: str = "JSON",
|
|
2164
|
+
report_spec: str | dict = "OMAGServers",
|
|
2165
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
2166
|
+
) -> str | list | dict:
|
|
2167
|
+
"""Returns the list of servers with a particular name. The name is specified in the filter. Async version.
|
|
2168
|
+
|
|
2169
|
+
Parameters
|
|
2170
|
+
----------
|
|
2171
|
+
filter_string : str, opt
|
|
2172
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
|
2173
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
|
2174
|
+
start_from : int, optional
|
|
2175
|
+
The index from which to start fetching the engine actions. Default is 0.
|
|
2176
|
+
page_size : int, optional
|
|
2177
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
|
2178
|
+
output_format: str, optional
|
|
2179
|
+
The format of the output. Default is "JSON".
|
|
2180
|
+
report_spec: str | dict, optional
|
|
2181
|
+
The report specification to use. Default is "OMAGServers".
|
|
2182
|
+
|
|
2183
|
+
body : dict | FilterRequestBody, optional
|
|
2184
|
+
Request body to pass directly to the API.
|
|
2185
|
+
|
|
2186
|
+
Returns
|
|
2187
|
+
-------
|
|
2188
|
+
List of JSON dict with the server reports.
|
|
2189
|
+
|
|
2190
|
+
Raises
|
|
2191
|
+
------
|
|
2192
|
+
PyegeriaInvalidParameterException
|
|
2193
|
+
PyegeriaAPIException
|
|
2194
|
+
PyegeriaUnauthorizedException
|
|
2195
|
+
|
|
2196
|
+
"""
|
|
2197
|
+
|
|
2198
|
+
url = f"{self.runtime_command_root}/software-servers/by-name"
|
|
2199
|
+
|
|
2200
|
+
|
|
2201
|
+
return await self._async_get_name_request(
|
|
2202
|
+
url,
|
|
2203
|
+
_type="SoftwareServer",
|
|
2204
|
+
_gen_output=self._generate_omag_server_output,
|
|
2205
|
+
filter_string=filter_string,
|
|
2206
|
+
start_from=start_from,
|
|
2207
|
+
page_size=page_size,
|
|
2208
|
+
output_format=output_format,
|
|
2209
|
+
report_spec=report_spec,
|
|
2210
|
+
body=body
|
|
2211
|
+
)
|
|
2212
|
+
|
|
2213
|
+
@dynamic_catch
|
|
2214
|
+
def get_servers_by_name(
|
|
2215
|
+
self,
|
|
2216
|
+
filter_string: str,
|
|
2217
|
+
start_from: int = 0,
|
|
2218
|
+
page_size: int = 0,
|
|
2219
|
+
output_format: str = "JSON",
|
|
2220
|
+
report_spec: str | dict = "OMAGServers",
|
|
2221
|
+
body: Optional[dict | SearchStringRequestBody] = None,
|
|
2222
|
+
) -> str | list | dict:
|
|
2223
|
+
"""Returns the list of servers with a particular name. The name is specified in the filter.
|
|
2224
|
+
|
|
2225
|
+
Parameters
|
|
2226
|
+
----------
|
|
2227
|
+
filter_string : str, opt
|
|
2228
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
|
2229
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
|
2230
|
+
start_from : int, optional
|
|
2231
|
+
The index from which to start fetching the engine actions. Default is 0.
|
|
2232
|
+
page_size : int, optional
|
|
2233
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
|
2234
|
+
output_format: str, optional
|
|
2235
|
+
The format of the output. Default is "JSON".
|
|
2236
|
+
report_spec: str | dict, optional
|
|
2237
|
+
The report specification to use. Default is "OMAGServers".
|
|
2238
|
+
|
|
2239
|
+
body : dict | SearchStringRequestBody, optional
|
|
2240
|
+
Request body to pass directly to the API.
|
|
2241
|
+
|
|
2242
|
+
Returns
|
|
2243
|
+
-------
|
|
2244
|
+
List of JSON dict with the server reports.
|
|
2245
|
+
|
|
2246
|
+
Raises
|
|
2247
|
+
------
|
|
2248
|
+
PyegeriaInvalidParameterException
|
|
2249
|
+
PyegeriaAPIException
|
|
2250
|
+
PyegeriaUnauthorizedException
|
|
2251
|
+
|
|
2252
|
+
"""
|
|
2253
|
+
loop = asyncio.get_event_loop()
|
|
2254
|
+
response = loop.run_until_complete(
|
|
2255
|
+
self._async_get_servers_by_name(
|
|
2256
|
+
filter_string, start_from, page_size, output_format, report_spec, body
|
|
2257
|
+
)
|
|
2258
|
+
)
|
|
2259
|
+
return response
|
|
2260
|
+
|
|
2261
|
+
@dynamic_catch
|
|
2262
|
+
async def _async_get_servers_by_dep_impl_type(self, filter_string: str,
|
|
2263
|
+
start_from: int = 0, page_size: int = 0, output_format:str="JSON",
|
|
2264
|
+
report_spec: str = "OMAGServers",
|
|
2265
|
+
body: Optional[dict | FilterRequestBody] = None) -> str | list:
|
|
2266
|
+
"""Returns the list of servers with a particular deployed implementation type. The value is specified
|
|
2267
|
+
in the filter. If it is null, or no request body is supplied, all servers are returned.
|
|
2268
|
+
Async version.
|
|
2269
|
+
|
|
2270
|
+
Parameters
|
|
2271
|
+
----------
|
|
2272
|
+
filter_string : str, opt
|
|
2273
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
|
2274
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
|
2275
|
+
start_from : int, optional
|
|
2276
|
+
The index from which to start fetching the engine actions. Default is 0.
|
|
2277
|
+
page_size : int, optional
|
|
2278
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
|
2279
|
+
body : dict | FilterRequestBody, optional
|
|
2280
|
+
Request body to pass directly to the API.
|
|
2281
|
+
|
|
2282
|
+
Returns
|
|
2283
|
+
-------
|
|
2284
|
+
List of JSON dict with the platform reports.
|
|
2285
|
+
|
|
2286
|
+
Raises
|
|
2287
|
+
------
|
|
2288
|
+
PyegeriaInvalidParameterException
|
|
2289
|
+
PyegeriaAPIException
|
|
2290
|
+
PyegeriaUnauthorizedException
|
|
2291
|
+
|
|
2292
|
+
"""
|
|
2293
|
+
|
|
2294
|
+
if filter_string == "*":
|
|
2295
|
+
filter_string = None
|
|
2296
|
+
|
|
2297
|
+
url = f"{self.runtime_command_root}/software-servers/by-deployed-implementation-type"
|
|
2298
|
+
|
|
2299
|
+
return await self._async_get_name_request(
|
|
2300
|
+
url,
|
|
2301
|
+
_type="OMAGServers",
|
|
2302
|
+
_gen_output=self._generate_omag_server_output,
|
|
2303
|
+
filter_string=filter_string,
|
|
2304
|
+
start_from=start_from,
|
|
2305
|
+
page_size=page_size,
|
|
2306
|
+
output_format=output_format,
|
|
2307
|
+
report_spec=report_spec,
|
|
2308
|
+
body=body
|
|
2309
|
+
)
|
|
2310
|
+
|
|
2311
|
+
|
|
2312
|
+
@dynamic_catch
|
|
2313
|
+
def get_servers_by_dep_impl_type(self, search_string: str = "*", effective_time: Optional[str] = None, start_from: int = 0,
|
|
2314
|
+
page_size: int = 0, output_format: str = "JSON", report_spec: str | dict = "OMAGServers",
|
|
2315
|
+
body: Optional[dict | FilterRequestBody] = None) -> str | list:
|
|
2316
|
+
"""Returns the list of servers with a particular deployed implementation type.
|
|
2317
|
+
The value is specified in the filter. If it is null, or no request body is supplied,
|
|
2318
|
+
all servers are returned.
|
|
2319
|
+
|
|
2320
|
+
Parameters
|
|
2321
|
+
----------
|
|
2322
|
+
search_string : str, opt
|
|
2323
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
|
2324
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
|
2325
|
+
effective_time: str, optional
|
|
2326
|
+
Timeframe to return information for. Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
|
|
2327
|
+
start_from : int, optional
|
|
2328
|
+
The index from which to start fetching the engine actions. Default is 0.
|
|
2329
|
+
page_size : int, optional
|
|
2330
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
|
2331
|
+
body : dict | GetRequestBody, optional
|
|
2332
|
+
Request body to pass directly to the API.
|
|
2333
|
+
|
|
2334
|
+
Returns
|
|
2335
|
+
-------
|
|
2336
|
+
Response
|
|
2337
|
+
A lit of JSONdict with the platform reports.
|
|
2338
|
+
|
|
2339
|
+
Raises
|
|
2340
|
+
------
|
|
2341
|
+
PyegeriaInvalidParameterException
|
|
2342
|
+
PyegeriaAPIException
|
|
2343
|
+
PyegeriaUnauthorizedException
|
|
2344
|
+
|
|
2345
|
+
Args:
|
|
2346
|
+
output_format ():
|
|
2347
|
+
report_spec ():
|
|
2348
|
+
|
|
2349
|
+
"""
|
|
2350
|
+
loop = asyncio.get_event_loop()
|
|
2351
|
+
response = loop.run_until_complete(
|
|
2352
|
+
self._async_get_servers_by_dep_impl_type(search_string, start_from,page_size,
|
|
2353
|
+
output_format, report_spec, body)
|
|
2354
|
+
)
|
|
2355
|
+
return response
|
|
2356
|
+
|
|
2357
|
+
async def _async_get_server_templates_by_dep_impl_type(
|
|
2358
|
+
self,
|
|
2359
|
+
filter_string : str,
|
|
2360
|
+
start_from: int = 0,
|
|
2361
|
+
page_size: int = 0,
|
|
2362
|
+
output_format: str = "JSON", report_spec: dict = "OMAGServers",
|
|
2363
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
2364
|
+
) -> str | list:
|
|
2365
|
+
"""Returns the list of server templates with a particular deployed implementation type. The value is
|
|
2366
|
+
specified in the filter. If it is null, or no request body is supplied, all servers are returned.
|
|
2367
|
+
Async version.
|
|
2368
|
+
|
|
2369
|
+
Parameters
|
|
2370
|
+
----------
|
|
2371
|
+
filter_string : str, optional
|
|
2372
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
|
2373
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
|
2374
|
+
effective_time: str, optional
|
|
2375
|
+
Timeframe to return information for. Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
|
|
2376
|
+
start_from : int, optional
|
|
2377
|
+
The index from which to start fetching the engine actions. Default is 0.
|
|
2378
|
+
page_size : int, optional
|
|
2379
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
|
2380
|
+
output_format: str, optional
|
|
2381
|
+
The format of the output. Default is "JSON".
|
|
2382
|
+
report_spec: dict, optional
|
|
2383
|
+
The specification of the report to generate. Default is "OMAGServers".
|
|
2384
|
+
body : dict | FilterRequestBody, optional
|
|
2385
|
+
Request body to pass directly to the API.
|
|
2386
|
+
|
|
2387
|
+
Returns
|
|
2388
|
+
-------
|
|
2389
|
+
List of JSONdict with the platform reports.
|
|
2390
|
+
|
|
2391
|
+
Raises
|
|
2392
|
+
------
|
|
2393
|
+
PyegeriaInvalidParameterException
|
|
2394
|
+
PyegeriaAPIException
|
|
2395
|
+
PyegeriaUnauthorizedException
|
|
2396
|
+
|
|
2397
|
+
"""
|
|
2398
|
+
|
|
2399
|
+
url = (
|
|
2400
|
+
f"{self.runtime_command_root}/software-servers/"
|
|
2401
|
+
f"by-deployed-implementation-type?startFrom={start_from}&pageSize={page_size}&getTemplates=true"
|
|
2402
|
+
)
|
|
2403
|
+
|
|
2404
|
+
return await self._async_get_name_request(
|
|
2405
|
+
url,
|
|
2406
|
+
_type="OMAGServers",
|
|
2407
|
+
_gen_output=self._generate_omag_server_output,
|
|
2408
|
+
classification_names = ["Template"],
|
|
2409
|
+
filter_string=filter_string,
|
|
2410
|
+
start_from=start_from,
|
|
2411
|
+
page_size=page_size,
|
|
2412
|
+
output_format=output_format,
|
|
2413
|
+
report_spec=report_spec,
|
|
2414
|
+
body=body
|
|
2415
|
+
)
|
|
2416
|
+
|
|
2417
|
+
|
|
2418
|
+
def get_server_templates_by_dep_impl_type(
|
|
2419
|
+
self,
|
|
2420
|
+
filter_string : str,
|
|
2421
|
+
start_from: int = 0,
|
|
2422
|
+
page_size: int = max_paging_size,
|
|
2423
|
+
output_format: str = "JSON", report_spec: dict = "OMAGServers",
|
|
2424
|
+
body: Optional[dict | FilterRequestBody] = None,
|
|
2425
|
+
) -> str | list:
|
|
2426
|
+
"""Returns the list of server templates with a particular deployed implementation type.
|
|
2427
|
+
The value is specified in the filter. If it is null, or no request body is supplied,
|
|
2428
|
+
all servers are returned.
|
|
2429
|
+
|
|
2430
|
+
Parameters
|
|
2431
|
+
----------
|
|
2432
|
+
filter_string : str, opt
|
|
2433
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
|
2434
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
|
2435
|
+
start_from : int, optional
|
|
2436
|
+
The index from which to start fetching the engine actions. Default is 0.
|
|
2437
|
+
page_size : int, optional
|
|
2438
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
|
2439
|
+
output_format: str, optional
|
|
2440
|
+
The format of the output. Default is "JSON".
|
|
2441
|
+
report_spec: dict, optional
|
|
2442
|
+
The specification of the report to generate. Default is "OMAGServers".
|
|
2443
|
+
body : dict | FilterRequestBody, optional
|
|
2444
|
+
Request body to pass directly to the API.
|
|
2445
|
+
|
|
2446
|
+
Returns
|
|
2447
|
+
-------
|
|
2448
|
+
List of JSON dict with the platform reports.
|
|
2449
|
+
|
|
2450
|
+
Raises
|
|
2451
|
+
------
|
|
2452
|
+
PyegeriaInvalidParameterException
|
|
2453
|
+
PyegeriaAPIException
|
|
2454
|
+
PyegeriaUnauthorizedException
|
|
2455
|
+
|
|
2456
|
+
"""
|
|
2457
|
+
loop = asyncio.get_event_loop()
|
|
2458
|
+
response = loop.run_until_complete(
|
|
2459
|
+
self._async_get_server_templates_by_dep_impl_type(
|
|
2460
|
+
filter_string, start_from, page_size, output_format,report_spec,body
|
|
2461
|
+
)
|
|
2462
|
+
)
|
|
2463
|
+
return response
|
|
2464
|
+
|
|
2465
|
+
@dynamic_catch
|
|
2466
|
+
async def _async_get_server_report(
|
|
2467
|
+
self,
|
|
2468
|
+
server_guid: Optional[str] = None,
|
|
2469
|
+
server_name: str = None,
|
|
2470
|
+
output_format: str = "JSON",
|
|
2471
|
+
report_spec: str | dict = "OMAGServers",
|
|
2472
|
+
) -> str | list | dict:
|
|
2473
|
+
"""Returns details about the running server. Async version.
|
|
2474
|
+
|
|
2475
|
+
Parameters
|
|
2476
|
+
----------
|
|
2477
|
+
server_guid : str, default = None
|
|
2478
|
+
Identity of the server to act on. If not specified, server_name must be.
|
|
2479
|
+
server_name: str, default = None
|
|
2480
|
+
Name of server to act on. If not specified, server_guid must be.
|
|
2481
|
+
output_format: str, optional
|
|
2482
|
+
The format of the output. Default is "JSON".
|
|
2483
|
+
report_spec: str | dict, optional
|
|
2484
|
+
The report specification to use. Default is "OMAGServers".
|
|
2485
|
+
|
|
2486
|
+
|
|
2487
|
+
Returns
|
|
2488
|
+
-------
|
|
2489
|
+
List of JSON dict with the server reports.
|
|
2490
|
+
|
|
2491
|
+
Raises
|
|
2492
|
+
------
|
|
2493
|
+
PyegeriaInvalidParameterException
|
|
2494
|
+
PyegeriaAPIException
|
|
2495
|
+
PyegeriaUnauthorizedException
|
|
2496
|
+
|
|
2497
|
+
"""
|
|
2498
|
+
server_guid = self.__get_guid__(
|
|
2499
|
+
server_guid, server_name, "resourceName", tech_type="Integration Daemon"
|
|
2500
|
+
)
|
|
2501
|
+
url = f"{self.runtime_command_root}/omag-servers/{server_guid}/instance/report"
|
|
2502
|
+
|
|
2503
|
+
response = await self._async_make_request("GET",url)
|
|
2504
|
+
elements = response.json().get("element", NO_ELEMENTS_FOUND)
|
|
2505
|
+
if type(elements) is str:
|
|
2506
|
+
elements = response.json().get("elementGraph", NO_ELEMENTS_FOUND)
|
|
2507
|
+
if type(elements) is str:
|
|
2508
|
+
logger.info(NO_ELEMENTS_FOUND)
|
|
2509
|
+
return NO_ELEMENTS_FOUND
|
|
2510
|
+
|
|
2511
|
+
if output_format != 'JSON': # return a simplified markdown representation
|
|
2512
|
+
logger.info(f"Found elements, output format: {output_format} and report_spec: {report_spec}")
|
|
2513
|
+
return self._generate_server_report_output(elements, "None", "Server-Report", output_format, report_spec)
|
|
2514
|
+
return elements
|
|
2515
|
+
|
|
2516
|
+
def get_server_report(
|
|
2517
|
+
self,
|
|
2518
|
+
server_guid: Optional[str] = None,
|
|
2519
|
+
server_name: str = None,
|
|
2520
|
+
output_format: str = "JSON",
|
|
2521
|
+
report_spec: str | dict = "OMAGServers",
|
|
2522
|
+
) -> str | list | dict:
|
|
2523
|
+
"""Returns details about the running server.
|
|
2524
|
+
|
|
2525
|
+
Parameters
|
|
2526
|
+
----------
|
|
2527
|
+
server_guid : str, default = None
|
|
2528
|
+
Identity of the server to act on. If not specified, server_name must be.
|
|
2529
|
+
server_name: str, default = None
|
|
2530
|
+
Name of server to act on. If not specified, server_guid must be.
|
|
2531
|
+
output_format: str, optional
|
|
2532
|
+
The format of the output. Default is "JSON".
|
|
2533
|
+
report_spec: str | dict, optional
|
|
2534
|
+
The report specification to use. Default is "OMAGServers".
|
|
2535
|
+
|
|
2536
|
+
Returns
|
|
2537
|
+
-------
|
|
2538
|
+
List of JSON dict with the server reports.
|
|
2539
|
+
|
|
2540
|
+
Raises
|
|
2541
|
+
------
|
|
2542
|
+
PyegeriaInvalidParameterException
|
|
2543
|
+
PyegeriaAPIException
|
|
2544
|
+
PyegeriaUnauthorizedException
|
|
2545
|
+
|
|
2546
|
+
"""
|
|
2547
|
+
loop = asyncio.get_event_loop()
|
|
2548
|
+
return loop.run_until_complete(
|
|
2549
|
+
self._async_get_server_report(server_guid, server_name, output_format, report_spec)
|
|
2550
|
+
)
|
|
2551
|
+
|
|
2552
|
+
def _extract_platform_properties(self, element: dict, columns_struct: dict) -> dict:
|
|
2553
|
+
"""
|
|
2554
|
+
Extract common properties from a Platform element.
|
|
2555
|
+
"""
|
|
2556
|
+
# First, populate from element.properties using the utility
|
|
2557
|
+
col_data = populate_columns_from_properties(element, columns_struct)
|
|
2558
|
+
columns_list = col_data.get("formats", {}).get("attributes", [])
|
|
2559
|
+
|
|
2560
|
+
if "platformUrlRoot" in element:
|
|
2561
|
+
for column in columns_list:
|
|
2562
|
+
key = column.get('key')
|
|
2563
|
+
if key == 'platform_url_root':
|
|
2564
|
+
column['value'] = element.get('platformUrlRoot')
|
|
2565
|
+
elif key == 'version':
|
|
2566
|
+
column['value'] = element.get('version')
|
|
2567
|
+
elif key == 'platform_origin':
|
|
2568
|
+
column['value'] = element.get('platformOrigin')
|
|
2569
|
+
elif key == 'platform_start_time':
|
|
2570
|
+
column['value'] = element.get('startTime')
|
|
2571
|
+
elif key == 'platform_build_properties':
|
|
2572
|
+
column['value'] = element.get('platformBuildProperties')
|
|
2573
|
+
elif key == 'omagservers':
|
|
2574
|
+
column['value'] = element.get('omagservers', element.get('omagServers'))
|
|
2575
|
+
elif key == 'guid':
|
|
2576
|
+
column['value'] = element.get('guid', element.get('elementHeader', {}).get('guid', ''))
|
|
2577
|
+
else:
|
|
2578
|
+
header_props = _extract_referenceable_properties(element)
|
|
2579
|
+
for column in columns_list:
|
|
2580
|
+
key = column.get('key')
|
|
2581
|
+
if key in header_props:
|
|
2582
|
+
column['value'] = header_props.get(key)
|
|
2583
|
+
elif key == 'guid':
|
|
2584
|
+
column['value'] = header_props.get('GUID')
|
|
2585
|
+
|
|
2586
|
+
return col_data
|
|
2587
|
+
|
|
2588
|
+
@dynamic_catch
|
|
2589
|
+
def _generate_platform_output(self, elements: dict | list[dict], filter_string: Optional[str],
|
|
2590
|
+
element_type_name: Optional[str], output_format: str = "DICT",
|
|
2591
|
+
report_spec: dict | str = None) -> str | list[dict]:
|
|
2592
|
+
""" Generate output for Platform elements. """
|
|
2593
|
+
if element_type_name is None:
|
|
2594
|
+
entity_type = "Platforms"
|
|
2595
|
+
else:
|
|
2596
|
+
entity_type = element_type_name
|
|
2597
|
+
|
|
2598
|
+
get_additional_props_func = None
|
|
2599
|
+
output_formats = None
|
|
2600
|
+
|
|
2601
|
+
if report_spec:
|
|
2602
|
+
if isinstance(report_spec, str):
|
|
2603
|
+
output_formats = select_report_spec(report_spec, output_format)
|
|
2604
|
+
elif isinstance(report_spec, dict):
|
|
2605
|
+
output_formats = get_report_spec_match(report_spec, output_format)
|
|
2606
|
+
|
|
2607
|
+
if not output_formats:
|
|
2608
|
+
output_formats = select_report_spec(entity_type, output_format)
|
|
2609
|
+
|
|
2610
|
+
if output_formats is None:
|
|
2611
|
+
output_formats = select_report_spec("Default", output_format)
|
|
2612
|
+
|
|
2613
|
+
return generate_output(
|
|
2614
|
+
elements,
|
|
2615
|
+
filter_string,
|
|
2616
|
+
entity_type,
|
|
2617
|
+
output_format,
|
|
2618
|
+
self._extract_platform_properties,
|
|
2619
|
+
get_additional_props_func,
|
|
2620
|
+
output_formats
|
|
2621
|
+
)
|
|
2622
|
+
|
|
2623
|
+
def _generate_platform_report_output(self, elements: dict | list[dict], filter_string: Optional[str],
|
|
2624
|
+
element_type_name: Optional[str], output_format: str = "DICT",
|
|
2625
|
+
report_spec: dict | str = None) -> str | list[dict]:
|
|
2626
|
+
""" Generate output for Platform Report elements. """
|
|
2627
|
+
if element_type_name is None:
|
|
2628
|
+
entity_type = "SoftwareServerPlatform"
|
|
2629
|
+
else:
|
|
2630
|
+
entity_type = element_type_name
|
|
2631
|
+
|
|
2632
|
+
get_additional_props_func = None
|
|
2633
|
+
output_formats = None
|
|
2634
|
+
|
|
2635
|
+
if report_spec:
|
|
2636
|
+
if isinstance(report_spec, str):
|
|
2637
|
+
output_formats = select_report_spec(report_spec, output_format)
|
|
2638
|
+
elif isinstance(report_spec, dict):
|
|
2639
|
+
output_formats = get_report_spec_match(report_spec, output_format)
|
|
2640
|
+
|
|
2641
|
+
if not output_formats:
|
|
2642
|
+
output_formats = select_report_spec(entity_type, output_format)
|
|
2643
|
+
|
|
2644
|
+
if output_formats is None:
|
|
2645
|
+
output_formats = select_report_spec("Default", output_format)
|
|
2646
|
+
|
|
2647
|
+
return generate_output(
|
|
2648
|
+
elements,
|
|
2649
|
+
filter_string,
|
|
2650
|
+
entity_type,
|
|
2651
|
+
output_format,
|
|
2652
|
+
self._extract_platform_properties,
|
|
2653
|
+
get_additional_props_func,
|
|
2654
|
+
output_formats
|
|
2655
|
+
)
|
|
2656
|
+
|
|
2657
|
+
def _extract_omag_server_properties(self, element: dict, columns_struct: dict) -> dict:
|
|
2658
|
+
"""
|
|
2659
|
+
Extract common properties from an OMAG Server element.
|
|
2660
|
+
"""
|
|
2661
|
+
col_data = populate_columns_from_properties(element, columns_struct)
|
|
2662
|
+
columns_list = col_data.get("formats", {}).get("attributes", [])
|
|
2663
|
+
|
|
2664
|
+
if "serverName" in element:
|
|
2665
|
+
for column in columns_list:
|
|
2666
|
+
key = column.get('key')
|
|
2667
|
+
if key == 'server_name':
|
|
2668
|
+
column['value'] = element.get('serverName')
|
|
2669
|
+
elif key == 'server_type':
|
|
2670
|
+
column['value'] = element.get('serverType')
|
|
2671
|
+
elif key == 'server_active_status':
|
|
2672
|
+
column['value'] = element.get('serverActiveStatus')
|
|
2673
|
+
elif key == 'server_configuration':
|
|
2674
|
+
column['value'] = str(element.get('serverConfiguration', ''))
|
|
2675
|
+
elif key == 'guid':
|
|
2676
|
+
column['value'] = element.get('guid', '')
|
|
2677
|
+
else:
|
|
2678
|
+
header_props = _extract_referenceable_properties(element)
|
|
2679
|
+
for column in columns_list:
|
|
2680
|
+
key = column.get('key')
|
|
2681
|
+
if key in header_props:
|
|
2682
|
+
column['value'] = header_props.get(key)
|
|
2683
|
+
elif key == 'guid':
|
|
2684
|
+
column['value'] = header_props.get('GUID')
|
|
2685
|
+
|
|
2686
|
+
return col_data
|
|
2687
|
+
|
|
2688
|
+
@dynamic_catch
|
|
2689
|
+
def _generate_omag_server_output(self, elements: dict | list[dict], filter_string: Optional[str],
|
|
2690
|
+
element_type_name: Optional[str], output_format: str = "DICT",
|
|
2691
|
+
report_spec: dict | str = None) -> str | list[dict]:
|
|
2692
|
+
""" Generate output for OMAGServer elements. """
|
|
2693
|
+
if element_type_name is None:
|
|
2694
|
+
entity_type = "OMAGServers"
|
|
2695
|
+
else:
|
|
2696
|
+
entity_type = element_type_name
|
|
2697
|
+
|
|
2698
|
+
get_additional_props_func = None
|
|
2699
|
+
output_formats = None
|
|
2700
|
+
|
|
2701
|
+
if report_spec:
|
|
2702
|
+
if isinstance(report_spec, str):
|
|
2703
|
+
output_formats = select_report_spec(report_spec, output_format)
|
|
2704
|
+
elif isinstance(report_spec, dict):
|
|
2705
|
+
output_formats = get_report_spec_match(report_spec, output_format)
|
|
2706
|
+
|
|
2707
|
+
if not output_formats:
|
|
2708
|
+
output_formats = select_report_spec(entity_type, output_format)
|
|
2709
|
+
|
|
2710
|
+
if output_formats is None:
|
|
2711
|
+
output_formats = select_report_spec("Default", output_format)
|
|
2712
|
+
|
|
2713
|
+
return generate_output(
|
|
2714
|
+
elements,
|
|
2715
|
+
filter_string,
|
|
2716
|
+
entity_type,
|
|
2717
|
+
output_format,
|
|
2718
|
+
self._extract_omag_server_properties,
|
|
2719
|
+
get_additional_props_func,
|
|
2720
|
+
output_formats
|
|
2721
|
+
)
|
|
2722
|
+
|
|
2723
|
+
def _generate_server_report_output(self, elements: dict | list[dict], filter_string: Optional[str],
|
|
2724
|
+
element_type_name: Optional[str], output_format: str = "DICT",
|
|
2725
|
+
report_spec: dict | str = None) -> str | list[dict]:
|
|
2726
|
+
""" Generate output for OMAGServer elements. """
|
|
2727
|
+
if element_type_name is None:
|
|
2728
|
+
entity_type = "OMAGServers"
|
|
2729
|
+
else:
|
|
2730
|
+
entity_type = element_type_name
|
|
2731
|
+
|
|
2732
|
+
get_additional_props_func = None
|
|
2733
|
+
output_formats = None
|
|
2734
|
+
|
|
2735
|
+
if report_spec:
|
|
2736
|
+
if isinstance(report_spec, str):
|
|
2737
|
+
output_formats = select_report_spec(report_spec, output_format)
|
|
2738
|
+
elif isinstance(report_spec, dict):
|
|
2739
|
+
output_formats = get_report_spec_match(report_spec, output_format)
|
|
2740
|
+
|
|
2741
|
+
if not output_formats:
|
|
2742
|
+
output_formats = select_report_spec(entity_type, output_format)
|
|
2743
|
+
|
|
2744
|
+
if output_formats is None:
|
|
2745
|
+
output_formats = select_report_spec("Default", output_format)
|
|
2746
|
+
|
|
2747
|
+
return generate_output(
|
|
2748
|
+
elements,
|
|
2749
|
+
filter_string,
|
|
2750
|
+
entity_type,
|
|
2751
|
+
output_format,
|
|
2752
|
+
self._extract_omag_server_properties,
|
|
2753
|
+
get_additional_props_func,
|
|
2754
|
+
output_formats
|
|
2755
|
+
)
|
|
2756
|
+
|
|
2757
|
+
def _extract_integration_connector_properties(self, element: dict, columns_struct: dict) -> dict:
|
|
2758
|
+
""" Extract common properties from an Integration Connector element. """
|
|
2759
|
+
col_data = populate_columns_from_properties(element, columns_struct)
|
|
2760
|
+
columns_list = col_data.get("formats", {}).get("attributes", [])
|
|
2761
|
+
|
|
2762
|
+
if "connectorName" in element:
|
|
2763
|
+
for column in columns_list:
|
|
2764
|
+
key = column.get('key')
|
|
2765
|
+
if key == 'connector_name':
|
|
2766
|
+
column['value'] = element.get('connectorName')
|
|
2767
|
+
elif key == 'connector_type':
|
|
2768
|
+
column['value'] = element.get('connectorType', {}).get('displayName', '')
|
|
2769
|
+
elif key == 'metadata_source_qualified_name':
|
|
2770
|
+
column['value'] = element.get('metadataSourceQualifiedName')
|
|
2771
|
+
elif key == 'status':
|
|
2772
|
+
column['value'] = element.get('status')
|
|
2773
|
+
elif key == 'last_status_change':
|
|
2774
|
+
column['value'] = element.get('lastStatusChange')
|
|
2775
|
+
elif key == 'guid':
|
|
2776
|
+
column['value'] = element.get('guid', '')
|
|
2777
|
+
|
|
2778
|
+
return col_data
|
|
2779
|
+
|
|
2780
|
+
@dynamic_catch
|
|
2781
|
+
def _generate_integration_connector_output(self, elements: dict | list[dict], filter_string: Optional[str],
|
|
2782
|
+
element_type_name: Optional[str], output_format: str = "DICT",
|
|
2783
|
+
report_spec: dict | str = None) -> str | list[dict]:
|
|
2784
|
+
""" Generate output for IntegrationConnector elements. """
|
|
2785
|
+
if element_type_name is None:
|
|
2786
|
+
entity_type = "IntegrationConnectors"
|
|
2787
|
+
else:
|
|
2788
|
+
entity_type = element_type_name
|
|
2789
|
+
|
|
2790
|
+
get_additional_props_func = None
|
|
2791
|
+
output_formats = None
|
|
2792
|
+
|
|
2793
|
+
if report_spec:
|
|
2794
|
+
if isinstance(report_spec, str):
|
|
2795
|
+
output_formats = select_report_spec(report_spec, output_format)
|
|
2796
|
+
elif isinstance(report_spec, dict):
|
|
2797
|
+
output_formats = get_report_spec_match(report_spec, output_format)
|
|
2798
|
+
|
|
2799
|
+
if not output_formats:
|
|
2800
|
+
output_formats = select_report_spec(entity_type, output_format)
|
|
2801
|
+
|
|
2802
|
+
if output_formats is None:
|
|
2803
|
+
output_formats = select_report_spec("Default", output_format)
|
|
2804
|
+
|
|
2805
|
+
return generate_output(
|
|
2806
|
+
elements,
|
|
2807
|
+
filter_string,
|
|
2808
|
+
entity_type,
|
|
2809
|
+
output_format,
|
|
2810
|
+
self._extract_integration_connector_properties,
|
|
2811
|
+
get_additional_props_func,
|
|
2812
|
+
output_formats
|
|
2813
|
+
)
|
|
2814
|
+
|
|
2815
|
+
|
|
2816
|
+
if __name__ == "__main__":
|
|
2817
|
+
print("Main-Runtime Manager")
|