pyegeria 0.3.0__py3-none-any.whl → 0.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.
- pyegeria/__init__.py +1 -1
- pyegeria/automated_curation_omvs.py +63 -46
- pyegeria/core_omag_server_config.py +7 -34
- pyegeria/exceptions.py +382 -0
- pyegeria/full_omag_server_config.py +208 -103
- pyegeria/registered_info.py +43 -8
- {pyegeria-0.3.0.dist-info → pyegeria-0.3.3.dist-info}/METADATA +2 -2
- {pyegeria-0.3.0.dist-info → pyegeria-0.3.3.dist-info}/RECORD +11 -10
- {pyegeria-0.3.0.dist-info → pyegeria-0.3.3.dist-info}/LICENSE +0 -0
- {pyegeria-0.3.0.dist-info → pyegeria-0.3.3.dist-info}/WHEEL +0 -0
- {pyegeria-0.3.0.dist-info → pyegeria-0.3.3.dist-info}/top_level.txt +0 -0
pyegeria/__init__.py
CHANGED
@@ -26,7 +26,7 @@ if disable_ssl_warnings:
|
|
26
26
|
|
27
27
|
from ._exceptions import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException,
|
28
28
|
print_exception_response)
|
29
|
-
from .utils import print_response, body_slimmer
|
29
|
+
from .utils import print_response, body_slimmer, wrap_text
|
30
30
|
from ._client import Client
|
31
31
|
from .automated_curation_omvs import AutomatedCuration
|
32
32
|
from .core_omag_server_config import CoreServerConfig
|
@@ -6,15 +6,15 @@ Copyright Contributors to the ODPi Egeria project.
|
|
6
6
|
|
7
7
|
"""
|
8
8
|
import asyncio
|
9
|
-
import json
|
10
9
|
from datetime import datetime
|
11
|
-
|
10
|
+
|
11
|
+
from httpx import Response
|
12
12
|
|
13
13
|
from pyegeria import Client, max_paging_size, body_slimmer
|
14
|
-
from ._validators import validate_name, validate_guid, validate_search_string
|
15
14
|
from pyegeria._exceptions import (
|
16
15
|
InvalidParameterException,
|
17
16
|
)
|
17
|
+
from ._validators import validate_name, validate_guid, validate_search_string
|
18
18
|
|
19
19
|
|
20
20
|
class AutomatedCuration(Client):
|
@@ -92,7 +92,7 @@ class AutomatedCuration(Client):
|
|
92
92
|
|
93
93
|
url = f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-templates/new-element"
|
94
94
|
response = await self._async_make_request("POST", url, body)
|
95
|
-
return response.json().get("guid","GUID failed to be returned")
|
95
|
+
return response.json().get("guid", "GUID failed to be returned")
|
96
96
|
|
97
97
|
def create_element_from_template(self, body: dict, server: str = None) -> str:
|
98
98
|
""" Create a new metadata element from a template. Async version.
|
@@ -145,8 +145,8 @@ class AutomatedCuration(Client):
|
|
145
145
|
)
|
146
146
|
return response
|
147
147
|
|
148
|
-
async def _async_create_kafka_server_element_from_template(self, kafka_server:str, host_name: str, port: str,
|
149
|
-
server:str = None) -> str:
|
148
|
+
async def _async_create_kafka_server_element_from_template(self, kafka_server: str, host_name: str, port: str,
|
149
|
+
server: str = None) -> str:
|
150
150
|
""" Create a Kafka server element from a template. Async version.
|
151
151
|
|
152
152
|
Parameters
|
@@ -210,7 +210,6 @@ class AutomatedCuration(Client):
|
|
210
210
|
)
|
211
211
|
return response
|
212
212
|
|
213
|
-
|
214
213
|
async def _async_create_postgres_server_element_from_template(self, postgres_server: str, host_name: str, port: str,
|
215
214
|
db_user: str, db_pwd: str, server: str = None) -> str:
|
216
215
|
""" Create a Postgres server element from a template. Async version.
|
@@ -247,7 +246,7 @@ class AutomatedCuration(Client):
|
|
247
246
|
"serverName": postgres_server,
|
248
247
|
"hostIdentifier": host_name,
|
249
248
|
"portNumber": port,
|
250
|
-
"databaseUserId"
|
249
|
+
"databaseUserId": db_user,
|
251
250
|
"databasePassword": db_pwd
|
252
251
|
}
|
253
252
|
}
|
@@ -285,14 +284,14 @@ class AutomatedCuration(Client):
|
|
285
284
|
"""
|
286
285
|
loop = asyncio.get_event_loop()
|
287
286
|
response = loop.run_until_complete(
|
288
|
-
self._async_create_postgres_server_element_from_template(postgres_server,host_name,
|
289
|
-
port, db_user,db_pwd,server)
|
287
|
+
self._async_create_postgres_server_element_from_template(postgres_server, host_name,
|
288
|
+
port, db_user, db_pwd, server)
|
290
289
|
)
|
291
290
|
return response
|
292
291
|
|
293
292
|
#
|
294
|
-
# Engine Actions
|
295
|
-
#
|
293
|
+
# Engine Actions
|
294
|
+
#
|
296
295
|
async def _async_get_engine_actions(self, server: str = None, start_from: int = 0,
|
297
296
|
page_size: int = max_paging_size) -> list:
|
298
297
|
""" Retrieve the engine actions that are known to the server. Async version.
|
@@ -562,16 +561,19 @@ class AutomatedCuration(Client):
|
|
562
561
|
name : str
|
563
562
|
The name of the engine action to retrieve.
|
564
563
|
server : str, optional
|
565
|
-
|
564
|
+
The name of the server to retrieve the engine action from. If not provided, the default server specified in
|
565
|
+
the instance will be used.
|
566
566
|
start_from : int, optional
|
567
567
|
The index to start retrieving engine actions from. If not provided, the default value will be used.
|
568
568
|
page_size : int, optional
|
569
|
-
The maximum number of engine actions to retrieve in a single request. If not provided, the default global
|
569
|
+
The maximum number of engine actions to retrieve in a single request. If not provided, the default global
|
570
|
+
maximum paging size will be used.
|
570
571
|
|
571
572
|
Returns
|
572
573
|
-------
|
573
574
|
list of dict | str
|
574
|
-
A list of dictionaries representing the retrieved engine actions, or "no actions" if no engine actions were
|
575
|
+
A list of dictionaries representing the retrieved engine actions, or "no actions" if no engine actions were
|
576
|
+
found with the given name.
|
575
577
|
Raises:
|
576
578
|
------
|
577
579
|
InvalidParameterException
|
@@ -604,16 +606,19 @@ class AutomatedCuration(Client):
|
|
604
606
|
name : str
|
605
607
|
The name of the engine action to retrieve.
|
606
608
|
server : str, optional
|
607
|
-
The name of the server to retrieve the engine action from. If not provided, the default server specified in
|
609
|
+
The name of the server to retrieve the engine action from. If not provided, the default server specified in
|
610
|
+
the instance will be used.
|
608
611
|
start_from : int, optional
|
609
612
|
The index to start retrieving engine actions from. If not provided, the default value will be used.
|
610
613
|
page_size : int, optional
|
611
|
-
The maximum number of engine actions to retrieve in a single request. If not provided, the default global
|
614
|
+
The maximum number of engine actions to retrieve in a single request. If not provided, the default global
|
615
|
+
maximum paging size will be used.
|
612
616
|
|
613
617
|
Returns
|
614
618
|
-------
|
615
619
|
list of dict | str
|
616
|
-
A list of dictionaries representing the retrieved engine actions, or "no actions" if no engine actions were
|
620
|
+
A list of dictionaries representing the retrieved engine actions, or "no actions" if no engine actions were
|
621
|
+
found with the given name.
|
617
622
|
Raises:
|
618
623
|
------
|
619
624
|
InvalidParameterException
|
@@ -745,9 +750,9 @@ class AutomatedCuration(Client):
|
|
745
750
|
)
|
746
751
|
return response
|
747
752
|
|
748
|
-
#
|
749
|
-
# Governance action processes
|
750
|
-
#
|
753
|
+
#
|
754
|
+
# Governance action processes
|
755
|
+
#
|
751
756
|
|
752
757
|
async def _async_get_governance_action_process_by_guid(self, process_guid: str, server: str = None) -> dict | str:
|
753
758
|
""" Retrieve the governance action process metadata element with the supplied unique identifier. Async Version.
|
@@ -863,7 +868,7 @@ class AutomatedCuration(Client):
|
|
863
868
|
"""
|
864
869
|
loop = asyncio.get_event_loop()
|
865
870
|
response = loop.run_until_complete(
|
866
|
-
self.
|
871
|
+
self._async_gov_action_process_graph(process_guid, server)
|
867
872
|
)
|
868
873
|
return response
|
869
874
|
|
@@ -877,11 +882,13 @@ class AutomatedCuration(Client):
|
|
877
882
|
name : str
|
878
883
|
The name of the engine action to retrieve.
|
879
884
|
server : str, optional
|
880
|
-
The name of the server to retrieve the engine action from. If not provided, the default server specified
|
885
|
+
The name of the server to retrieve the engine action from. If not provided, the default server specified
|
886
|
+
in the instance will be used.
|
881
887
|
start_from : int, optional
|
882
888
|
The index to start retrieving engine actions from. If not provided, the default value will be used.
|
883
889
|
page_size : int, optional
|
884
|
-
The maximum number of engine actions to retrieve in a single request. If not provided, the default
|
890
|
+
The maximum number of engine actions to retrieve in a single request. If not provided, the default
|
891
|
+
global maximum paging size will be used.
|
885
892
|
|
886
893
|
Returns
|
887
894
|
-------
|
@@ -916,11 +923,13 @@ class AutomatedCuration(Client):
|
|
916
923
|
name : str
|
917
924
|
The name of the engine action to retrieve.
|
918
925
|
server : str, optional
|
919
|
-
The name of the server to retrieve the engine action from. If not provided, the default server specified
|
926
|
+
The name of the server to retrieve the engine action from. If not provided, the default server specified
|
927
|
+
in the instance will be used.
|
920
928
|
start_from : int, optional
|
921
929
|
The index to start retrieving engine actions from. If not provided, the default value will be used.
|
922
930
|
page_size : int, optional
|
923
|
-
The maximum number of engine actions to retrieve in a single request. If not provided, the default global
|
931
|
+
The maximum number of engine actions to retrieve in a single request. If not provided, the default global
|
932
|
+
maximum paging size will be used.
|
924
933
|
|
925
934
|
Returns
|
926
935
|
-------
|
@@ -1041,8 +1050,8 @@ class AutomatedCuration(Client):
|
|
1041
1050
|
|
1042
1051
|
loop = asyncio.get_event_loop()
|
1043
1052
|
response = loop.run_until_complete(
|
1044
|
-
self.
|
1045
|
-
|
1053
|
+
self._async_find_gov_action_processes(search_string, server, starts_with, ends_with, ignore_case,
|
1054
|
+
start_from, page_size)
|
1046
1055
|
)
|
1047
1056
|
return response
|
1048
1057
|
|
@@ -1117,6 +1126,8 @@ class AutomatedCuration(Client):
|
|
1117
1126
|
- unique name of the requesting governance service (if initiated by a governance engine)
|
1118
1127
|
orig_engine_name: str
|
1119
1128
|
- optional unique name of the governance engine (if initiated by a governance engine).
|
1129
|
+
server: str, optional
|
1130
|
+
- if not specified, the server from the class instance will be used
|
1120
1131
|
|
1121
1132
|
Returns
|
1122
1133
|
-------
|
@@ -1202,7 +1213,8 @@ class AutomatedCuration(Client):
|
|
1202
1213
|
action_type_name: str
|
1203
1214
|
The name of the governance action type to retrieve.
|
1204
1215
|
server: str, optional
|
1205
|
-
The name of the server. If None, will use the default server specified in the instance
|
1216
|
+
The name of the server. If None, will use the default server specified in the instance
|
1217
|
+
will be used.
|
1206
1218
|
Returns:
|
1207
1219
|
-------
|
1208
1220
|
dict: The JSON representation of the governance action type element.
|
@@ -1369,8 +1381,10 @@ class AutomatedCuration(Client):
|
|
1369
1381
|
return response
|
1370
1382
|
|
1371
1383
|
async def _async_initiate_gov_action_type(self, action_type_qualified_name: str, request_source_guids: [str],
|
1372
|
-
action_targets: list, start_time: datetime
|
1373
|
-
|
1384
|
+
action_targets: list, start_time: datetime = None,
|
1385
|
+
request_parameters: dict = None,
|
1386
|
+
orig_service_name: str = None, orig_engine_name: str = None,
|
1387
|
+
server: str = None) -> str:
|
1374
1388
|
""" Using the named governance action type as a template, initiate an engine action. Async version.
|
1375
1389
|
|
1376
1390
|
Parameters
|
@@ -1389,6 +1403,8 @@ class AutomatedCuration(Client):
|
|
1389
1403
|
- unique name of the requesting governance service (if initiated by a governance engine)
|
1390
1404
|
orig_engine_name: str
|
1391
1405
|
- optional unique name of the governance engine (if initiated by a governance engine).
|
1406
|
+
server : str, optional
|
1407
|
+
- The name of the server. If None, will use the default server specified in the instance will be used.
|
1392
1408
|
|
1393
1409
|
Returns
|
1394
1410
|
-------
|
@@ -1439,6 +1455,8 @@ class AutomatedCuration(Client):
|
|
1439
1455
|
- unique name of the requesting governance service (if initiated by a governance engine)
|
1440
1456
|
orig_engine_name: str
|
1441
1457
|
- optional unique name of the governance engine (if initiated by a governance engine).
|
1458
|
+
server : str, optional
|
1459
|
+
- The name of the server. If None, will use the default server specified in the instance will be used.
|
1442
1460
|
|
1443
1461
|
Returns
|
1444
1462
|
-------
|
@@ -1458,7 +1476,7 @@ class AutomatedCuration(Client):
|
|
1458
1476
|
)
|
1459
1477
|
return response
|
1460
1478
|
|
1461
|
-
async def _async_initiate_postgres_server_survey(self, postgres_server_guid: str,
|
1479
|
+
async def _async_initiate_postgres_server_survey(self, postgres_server_guid: str, server: str = None) -> str:
|
1462
1480
|
server = self.server_name if server is None else server
|
1463
1481
|
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
|
1464
1482
|
f"initiate")
|
@@ -1467,9 +1485,9 @@ class AutomatedCuration(Client):
|
|
1467
1485
|
"class": "InitiateGovernanceActionTypeRequestBody",
|
1468
1486
|
"governanceActionTypeQualifiedName": "Egeria:GovernanceActionType:2adeb8f1-0f59-4970-b6f2-6cc25d4d2402survey-postgres-server",
|
1469
1487
|
"actionTargets": [{
|
1470
|
-
"class"
|
1471
|
-
"actionTargetName"
|
1472
|
-
"actionTargetGUID"
|
1488
|
+
"class": "NewActionTarget",
|
1489
|
+
"actionTargetName": "serverToSurvey",
|
1490
|
+
"actionTargetGUID": postgres_server_guid
|
1473
1491
|
}]
|
1474
1492
|
}
|
1475
1493
|
response = await self._async_make_request("POST", url, body)
|
@@ -1507,7 +1525,7 @@ class AutomatedCuration(Client):
|
|
1507
1525
|
def initiate_file_folder_survey(self, file_folder_guid: str, server: str = None) -> str:
|
1508
1526
|
loop = asyncio.get_event_loop()
|
1509
1527
|
response = loop.run_until_complete(
|
1510
|
-
self._async_initiate_file_folder_survey(
|
1528
|
+
self._async_initiate_file_folder_survey(file_folder_guid, server)
|
1511
1529
|
)
|
1512
1530
|
return response
|
1513
1531
|
|
@@ -1536,14 +1554,13 @@ class AutomatedCuration(Client):
|
|
1536
1554
|
)
|
1537
1555
|
return response
|
1538
1556
|
|
1539
|
-
async def run_gov_action_postgres_server_survey(self, postgres_server: str, host_name: str, port: str,):
|
1557
|
+
async def run_gov_action_postgres_server_survey(self, postgres_server: str, host_name: str, port: str, ):
|
1540
1558
|
pass
|
1541
1559
|
# New combo process to do
|
1542
1560
|
# run a process the creates the postgres server catalog entry, runs the server survey
|
1543
1561
|
# creates a survey report
|
1544
1562
|
# adds a to-do list element when done
|
1545
1563
|
|
1546
|
-
|
1547
1564
|
async def _async_initiate_engine_action(self, qualified_name: str, domain_identifier: int, display_name: str,
|
1548
1565
|
description: str, request_source_guids: str, action_targets: str,
|
1549
1566
|
received_guards: [str], start_time: datetime, gov_engine_name: str,
|
@@ -1928,8 +1945,8 @@ class AutomatedCuration(Client):
|
|
1928
1945
|
|
1929
1946
|
loop = asyncio.get_event_loop()
|
1930
1947
|
loop.run_until_complete(
|
1931
|
-
self.
|
1932
|
-
|
1948
|
+
self._async_remove_catalog_target(integ_connector_guid, metadata_element_guid,
|
1949
|
+
server)
|
1933
1950
|
)
|
1934
1951
|
return
|
1935
1952
|
|
@@ -2081,7 +2098,7 @@ class AutomatedCuration(Client):
|
|
2081
2098
|
return response
|
2082
2099
|
|
2083
2100
|
async def _async_find_technology_types(self, search_string: str = "*", server: str = None, start_from: int = 0,
|
2084
|
-
page_size: int = max_paging_size, starts_with: bool=False,
|
2101
|
+
page_size: int = max_paging_size, starts_with: bool = False,
|
2085
2102
|
ends_with: bool = False, ignore_case: bool = True) -> list | str:
|
2086
2103
|
""" Retrieve the list of technology types that contain the search string. Async version.
|
2087
2104
|
|
@@ -2127,7 +2144,7 @@ class AutomatedCuration(Client):
|
|
2127
2144
|
ends_with_s = str(ends_with).lower()
|
2128
2145
|
ignore_case_s = str(ignore_case).lower()
|
2129
2146
|
validate_name(search_string)
|
2130
|
-
if search_string== "*":
|
2147
|
+
if search_string == "*":
|
2131
2148
|
search_string = ""
|
2132
2149
|
|
2133
2150
|
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/technology-types/"
|
@@ -2139,7 +2156,7 @@ class AutomatedCuration(Client):
|
|
2139
2156
|
return response.json().get("elements", "no tech found")
|
2140
2157
|
|
2141
2158
|
def find_technology_types(self, type_name: str = "*", server: str = None, start_from: int = 0,
|
2142
|
-
page_size: int = max_paging_size, starts_with: bool=False,
|
2159
|
+
page_size: int = max_paging_size, starts_with: bool = False,
|
2143
2160
|
ends_with: bool = False, ignore_case: bool = True) -> list | str:
|
2144
2161
|
""" Retrieve the list of technology types that contain the search string. Async version.
|
2145
2162
|
|
@@ -2168,7 +2185,7 @@ class AutomatedCuration(Client):
|
|
2168
2185
|
loop = asyncio.get_event_loop()
|
2169
2186
|
response = loop.run_until_complete(
|
2170
2187
|
self._async_find_technology_types(type_name, server, start_from,
|
2171
|
-
page_size, starts_with,ends_with, ignore_case)
|
2188
|
+
page_size, starts_with, ends_with, ignore_case)
|
2172
2189
|
)
|
2173
2190
|
return response
|
2174
2191
|
|
@@ -2183,6 +2200,6 @@ class AutomatedCuration(Client):
|
|
2183
2200
|
|
2184
2201
|
if __name__ == "__main__":
|
2185
2202
|
p = AutomatedCuration("meow", "https://127.0.0.1:9443", "garygeeke", verify_flag=False)
|
2186
|
-
response = p.
|
2187
|
-
out = response.json()
|
2203
|
+
response = p.get_active_engine_actions()
|
2204
|
+
out = response.json()
|
2188
2205
|
print(out)
|
@@ -2013,7 +2013,12 @@ class CoreServerConfig(Client):
|
|
2013
2013
|
# Cohort Configuration, etc.
|
2014
2014
|
#
|
2015
2015
|
def add_cohort_registration(self, cohort_name: str, server_name: str = None) -> None:
|
2016
|
-
"""
|
2016
|
+
""" Enable registration of server to an open metadata repository cohort using the default topic structure
|
2017
|
+
(DEDICATED_TOPICS). A cohort is a group of open metadata repositories that are sharing metadata.
|
2018
|
+
An OMAG server can connect to zero, one or more cohorts. Each cohort needs a unique name.
|
2019
|
+
The members of the cohort use a shared topic to exchange registration information and events
|
2020
|
+
related to the changes in their supported metadata types and instances. They are also able to query
|
2021
|
+
each other's metadata directly through REST calls.
|
2017
2022
|
|
2018
2023
|
Parameters
|
2019
2024
|
----------
|
@@ -2381,38 +2386,6 @@ class CoreServerConfig(Client):
|
|
2381
2386
|
url = f"{self.admin_command_root}/servers/{server_name}/engine-list"
|
2382
2387
|
self.make_request("DELETE", url)
|
2383
2388
|
|
2384
|
-
# def get_engine_list(self, server_name: str = None) -> list | str:
|
2385
|
-
# """ Get the list of engines from the specified by the server_name parameter.
|
2386
|
-
#
|
2387
|
-
# Parameters
|
2388
|
-
# ----------
|
2389
|
-
#
|
2390
|
-
# server_name : str, optional
|
2391
|
-
# The name of the server. If None, the default server name will be used.
|
2392
|
-
#
|
2393
|
-
# Returns
|
2394
|
-
# -------
|
2395
|
-
# List containing the JSON structure of the Integration Groups configuration.
|
2396
|
-
#
|
2397
|
-
# Raises
|
2398
|
-
# ------
|
2399
|
-
# InvalidParameterException
|
2400
|
-
# If the response code is not 200.
|
2401
|
-
# PropertyServerException:
|
2402
|
-
# Raised by the server when an issue arises in processing a valid request
|
2403
|
-
# NotAuthorizedException:
|
2404
|
-
# The principle specified by the user_id does not have authorization for the requested action
|
2405
|
-
#
|
2406
|
-
# """
|
2407
|
-
# if server_name is None:
|
2408
|
-
# server_name = self.server_name
|
2409
|
-
#
|
2410
|
-
# url = self.admin_command_root + "/servers/" + server_name + "/engine-list"
|
2411
|
-
# response = self.make_request("GET", url)
|
2412
|
-
#
|
2413
|
-
# # return response.json().get("config", "No engine definitions client configuration found")
|
2414
|
-
# return response.json()
|
2415
|
-
|
2416
2389
|
def set_engine_list(self, engine_list: [dict], server_name: str = None) -> None:
|
2417
2390
|
""" Set up the list of governance engine that will use the metadata from the same metadata access server
|
2418
2391
|
as the engine host uses for retrieving the engine configuration.
|
@@ -2566,4 +2539,4 @@ class CoreServerConfig(Client):
|
|
2566
2539
|
|
2567
2540
|
"""
|
2568
2541
|
url = f"{self.admin_command_root}/stores/placeholder-variables"
|
2569
|
-
self.make_request("DELETE", url)
|
2542
|
+
self.make_request("DELETE", url)
|