pyegeria 0.3.9__py3-none-any.whl → 0.4.0__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/Xfeedback_manager_omvs.py +2 -15
- pyegeria/__init__.py +11 -4
- pyegeria/_globals.py +3 -1
- pyegeria/{Xasset_catalog_omvs.py → asset_catalog_omvs.py} +242 -109
- pyegeria/automated_curation_omvs.py +324 -61
- pyegeria/core_guids.py +128 -0
- pyegeria/{Xglossary_manager_omvs.py → glossary_manager_omvs.py} +70 -69
- pyegeria/runtime_manager_omvs.py +967 -0
- pyegeria/valid_metadata_omvs.py +193 -20
- pyegeria-0.4.0.data/scripts/get_guid_info.py +86 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.0.data}/scripts/get_tech_details.py +1 -37
- pyegeria-0.4.0.data/scripts/get_tech_type_elements.py +137 -0
- pyegeria-0.4.0.data/scripts/get_tech_type_template.py +137 -0
- pyegeria-0.4.0.data/scripts/list_assets.py +138 -0
- pyegeria-0.3.9.data/scripts/project_list_viewer.py → pyegeria-0.4.0.data/scripts/list_projects.py +1 -1
- pyegeria-0.3.9.data/scripts/get_relationship_types.py → pyegeria-0.4.0.data/scripts/list_relationship_types.py +9 -8
- pyegeria-0.4.0.data/scripts/list_tech_templates.py +134 -0
- pyegeria-0.3.9.data/scripts/find_todos.py → pyegeria-0.4.0.data/scripts/list_todos.py +2 -1
- pyegeria-0.4.0.data/scripts/list_valid_metadata_values.py +144 -0
- pyegeria-0.4.0.data/scripts/view_asset_graph.py +236 -0
- pyegeria-0.3.9.data/scripts/engine_action_status.py → pyegeria-0.4.0.data/scripts/view_eng_action_status.py +8 -3
- pyegeria-0.3.9.data/scripts/integration_daemon_status.py → pyegeria-0.4.0.data/scripts/view_integ_daemon_status.py +30 -42
- pyegeria-0.4.0.data/scripts/view_platform_status.py +123 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.0.dist-info}/METADATA +5 -2
- pyegeria-0.4.0.dist-info/RECORD +58 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.0.dist-info}/WHEEL +1 -1
- pyegeria-0.3.9.data/scripts/multi-server_status.py +0 -120
- pyegeria-0.3.9.dist-info/RECORD +0 -49
- /pyegeria/{Xaction_author_omvs.py → action_author_omvs.py} +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.0.data}/scripts/Create_Collection_Sample.py +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.0.data}/scripts/Create_Sustainability_Collection_Sample.py +0 -0
- /pyegeria-0.3.9.data/scripts/view_my_profile.py → /pyegeria-0.4.0.data/scripts/get_my_profile.py +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.0.data}/scripts/list_asset_types.py +0 -0
- /pyegeria-0.3.9.data/scripts/get_registered_services.py → /pyegeria-0.4.0.data/scripts/list_registered_services.py +0 -0
- /pyegeria-0.3.9.data/scripts/get_tech_types.py → /pyegeria-0.4.0.data/scripts/list_tech_types.py +0 -0
- /pyegeria-0.3.9.data/scripts/coco_status.py → /pyegeria-0.4.0.data/scripts/view_coco_status.py +0 -0
- /pyegeria-0.3.9.data/scripts/collection_viewer.py → /pyegeria-0.4.0.data/scripts/view_collection.py +0 -0
- /pyegeria-0.3.9.data/scripts/glossary_view.py → /pyegeria-0.4.0.data/scripts/view_glossary.py +0 -0
- /pyegeria-0.3.9.data/scripts/gov_engine_status.py → /pyegeria-0.4.0.data/scripts/view_gov_eng_status.py +0 -0
- /pyegeria-0.3.9.data/scripts/my_todos.py → /pyegeria-0.4.0.data/scripts/view_my_todos.py +0 -0
- /pyegeria-0.3.9.data/scripts/open_todos.py → /pyegeria-0.4.0.data/scripts/view_open_todos.py +0 -0
- /pyegeria-0.3.9.data/scripts/server_status_widget.py → /pyegeria-0.4.0.data/scripts/view_server_list.py +0 -0
- /pyegeria-0.3.9.data/scripts/server_status.py → /pyegeria-0.4.0.data/scripts/view_server_status.py +0 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.0.dist-info}/LICENSE +0 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.0.dist-info}/top_level.txt +0 -0
@@ -11,8 +11,12 @@ from datetime import datetime
|
|
11
11
|
from httpx import Response
|
12
12
|
|
13
13
|
from pyegeria import Client, max_paging_size, body_slimmer
|
14
|
-
from pyegeria._exceptions import (InvalidParameterException, )
|
14
|
+
from pyegeria._exceptions import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException)
|
15
15
|
from ._validators import validate_name, validate_guid, validate_search_string
|
16
|
+
from .core_guids import (FileFolder_template_GUID,
|
17
|
+
PostgreSQL_Server_template_GUID,
|
18
|
+
Apache_Kafka_Server_template_GUID,
|
19
|
+
)
|
16
20
|
|
17
21
|
|
18
22
|
class AutomatedCuration(Client):
|
@@ -139,7 +143,7 @@ class AutomatedCuration(Client):
|
|
139
143
|
return response
|
140
144
|
|
141
145
|
async def _async_create_kafka_server_element_from_template(self, kafka_server: str, host_name: str, port: str,
|
142
|
-
server: str = None) -> str:
|
146
|
+
description: str = None, server: str = None) -> str:
|
143
147
|
""" Create a Kafka server element from a template. Async version.
|
144
148
|
|
145
149
|
Parameters
|
@@ -153,6 +157,9 @@ class AutomatedCuration(Client):
|
|
153
157
|
port : str
|
154
158
|
The port number of the Kafka server.
|
155
159
|
|
160
|
+
description: str, opt
|
161
|
+
A description of the Kafka server.
|
162
|
+
|
156
163
|
server : str, optional
|
157
164
|
The name of the view server to use. Default uses the client instance.
|
158
165
|
|
@@ -162,14 +169,15 @@ class AutomatedCuration(Client):
|
|
162
169
|
The GUID of the Kafka server element.
|
163
170
|
"""
|
164
171
|
|
165
|
-
body = {"templateGUID":
|
172
|
+
body = {"templateGUID": Apache_Kafka_Server_template_GUID, "isOwnAnchor": 'true',
|
166
173
|
"placeholderPropertyValues": {"serverName": kafka_server, "hostIdentifier": host_name,
|
167
|
-
"portNumber": port}}
|
168
|
-
|
174
|
+
"portNumber": port, "description": description}}
|
175
|
+
body_s = body_slimmer(body)
|
176
|
+
response = await self._async_create_element_from_template(body_s, server)
|
169
177
|
return str(response)
|
170
178
|
|
171
179
|
def create_kafka_server_element_from_template(self, kafka_server: str, host_name: str, port: str,
|
172
|
-
server: str = None) -> str:
|
180
|
+
description: str = None, server: str = None) -> str:
|
173
181
|
""" Create a Kafka server element from a template.
|
174
182
|
|
175
183
|
Parameters
|
@@ -183,6 +191,9 @@ class AutomatedCuration(Client):
|
|
183
191
|
port : str
|
184
192
|
The port number of the Kafka server.
|
185
193
|
|
194
|
+
description: str, opt
|
195
|
+
A description of the Kafka server.
|
196
|
+
|
186
197
|
server : str, optional
|
187
198
|
The name of the view server to use. Default uses the client instance.
|
188
199
|
|
@@ -193,11 +204,13 @@ class AutomatedCuration(Client):
|
|
193
204
|
"""
|
194
205
|
loop = asyncio.get_event_loop()
|
195
206
|
response = loop.run_until_complete(
|
196
|
-
self._async_create_kafka_server_element_from_template(kafka_server, host_name, port,
|
207
|
+
self._async_create_kafka_server_element_from_template(kafka_server, host_name, port,
|
208
|
+
description, server))
|
197
209
|
return response
|
198
210
|
|
199
211
|
async def _async_create_postgres_server_element_from_template(self, postgres_server: str, host_name: str, port: str,
|
200
|
-
db_user: str, db_pwd: str,
|
212
|
+
db_user: str, db_pwd: str, description: str = None,
|
213
|
+
server: str = None) -> str:
|
201
214
|
""" Create a Postgres server element from a template. Async version.
|
202
215
|
|
203
216
|
Parameters
|
@@ -217,23 +230,28 @@ class AutomatedCuration(Client):
|
|
217
230
|
db_pwd: str
|
218
231
|
User password to connect to the database
|
219
232
|
|
233
|
+
description: str, opt
|
234
|
+
A description of the Kafka server.
|
235
|
+
|
220
236
|
server : str, optional
|
221
237
|
The name of the view server to use. Default uses the client instance.
|
222
238
|
|
223
239
|
Returns
|
224
240
|
-------
|
225
241
|
str
|
226
|
-
The GUID of the
|
242
|
+
The GUID of the Postgres server element.
|
227
243
|
"""
|
228
|
-
body = {"templateGUID":
|
244
|
+
body = {"templateGUID": PostgreSQL_Server_template_GUID, "isOwnAnchor": 'true',
|
229
245
|
"placeholderPropertyValues": {"serverName": postgres_server, "hostIdentifier": host_name,
|
230
|
-
"portNumber": port, "databaseUserId": db_user,
|
246
|
+
"portNumber": port, "databaseUserId": db_user, "description": description,
|
231
247
|
"databasePassword": db_pwd}}
|
232
|
-
|
248
|
+
body_s = body_slimmer(body)
|
249
|
+
response = await self._async_create_element_from_template(body_s, server)
|
233
250
|
return str(response)
|
234
251
|
|
235
252
|
def create_postgres_server_element_from_template(self, postgres_server: str, host_name: str, port: str,
|
236
|
-
db_user: str, db_pwd: str,
|
253
|
+
db_user: str, db_pwd: str, description: str = None,
|
254
|
+
server: str = None) -> str:
|
237
255
|
""" Create a Postgres server element from a template.
|
238
256
|
|
239
257
|
Parameters
|
@@ -250,6 +268,9 @@ class AutomatedCuration(Client):
|
|
250
268
|
server : str, optional
|
251
269
|
The name of the view server to use. Default uses the client instance.
|
252
270
|
|
271
|
+
description: str, opt
|
272
|
+
A description of the Kafka server.
|
273
|
+
|
253
274
|
db_user: str
|
254
275
|
User name to connect to the database
|
255
276
|
|
@@ -264,7 +285,88 @@ class AutomatedCuration(Client):
|
|
264
285
|
loop = asyncio.get_event_loop()
|
265
286
|
response = loop.run_until_complete(
|
266
287
|
self._async_create_postgres_server_element_from_template(postgres_server, host_name, port, db_user, db_pwd,
|
267
|
-
server))
|
288
|
+
description, server))
|
289
|
+
return response
|
290
|
+
|
291
|
+
async def _async_create_folder_element_from_template(self, path_name: str, folder_name: str, file_system: str,
|
292
|
+
description: str = None, version: str = None,
|
293
|
+
server: str = None) -> str:
|
294
|
+
""" Create a File folder element from a template. Async version.
|
295
|
+
|
296
|
+
Parameters
|
297
|
+
----------
|
298
|
+
path_name : str
|
299
|
+
The name of the fill path including the folder..
|
300
|
+
|
301
|
+
folder_name : str
|
302
|
+
The name of the folder to create.
|
303
|
+
|
304
|
+
file_system : str
|
305
|
+
The unique name for the file system that the folder belongs to. It may be a machine name or URL to a remote
|
306
|
+
file store.
|
307
|
+
|
308
|
+
description: str, opt
|
309
|
+
A description of the Kafka server.
|
310
|
+
|
311
|
+
version: str, opt
|
312
|
+
version of the file folder - typically of the form x.y.z
|
313
|
+
|
314
|
+
server : str, optional
|
315
|
+
The name of the view server to use. Default uses the client instance.
|
316
|
+
|
317
|
+
Returns
|
318
|
+
-------
|
319
|
+
str
|
320
|
+
The GUID of the File Folder element.
|
321
|
+
"""
|
322
|
+
body = {"templateGUID": FileFolder_template_GUID,
|
323
|
+
"isOwnAnchor": 'true',
|
324
|
+
"placeholderPropertyValues": {
|
325
|
+
"directoryPathName": path_name,
|
326
|
+
"directoryName": folder_name,
|
327
|
+
"versionIdentifier": version,
|
328
|
+
"fileSystemName": file_system,
|
329
|
+
"description": description,
|
330
|
+
}
|
331
|
+
}
|
332
|
+
body_s = body_slimmer(body)
|
333
|
+
response = await self._async_create_element_from_template(body_s, server)
|
334
|
+
return str(response)
|
335
|
+
|
336
|
+
def create_folder_element_from_template(self, path_name: str, folder_name: str, file_system: str,
|
337
|
+
description: str = None, version: str = None, server: str = None) -> str:
|
338
|
+
""" Create a File folder element from a template.
|
339
|
+
|
340
|
+
Parameters
|
341
|
+
----------
|
342
|
+
path_name : str
|
343
|
+
The name of the fill path including the folder..
|
344
|
+
|
345
|
+
folder_name : str
|
346
|
+
The name of the folder to create.
|
347
|
+
|
348
|
+
file_system : str
|
349
|
+
The unique name for the file system that the folder belongs to. It may be a machine name or URL to a
|
350
|
+
remote file store.
|
351
|
+
|
352
|
+
description: str, opt
|
353
|
+
A description of the Kafka server.
|
354
|
+
|
355
|
+
version: str, opt
|
356
|
+
version of the file folder - typically of the form x.y.z
|
357
|
+
|
358
|
+
server : str, optional
|
359
|
+
The name of the view server to use. Default uses the client instance.
|
360
|
+
|
361
|
+
Returns
|
362
|
+
-------
|
363
|
+
str
|
364
|
+
The GUID of the Postgres server element.
|
365
|
+
"""
|
366
|
+
loop = asyncio.get_event_loop()
|
367
|
+
response = loop.run_until_complete(
|
368
|
+
self._async_create_folder_element_from_template(path_name, folder_name, file_system,
|
369
|
+
description, version, server))
|
268
370
|
return response
|
269
371
|
|
270
372
|
#
|
@@ -1598,7 +1700,7 @@ class AutomatedCuration(Client):
|
|
1598
1700
|
|
1599
1701
|
async def _async_initiate_engine_action(self, qualified_name: str, domain_identifier: int, display_name: str,
|
1600
1702
|
description: str, request_source_guids: str, action_targets: str,
|
1601
|
-
received_guards: [str], start_time: datetime,
|
1703
|
+
received_guards: [str], start_time: datetime,
|
1602
1704
|
request_type: str, request_parameters: dict, process_name: str,
|
1603
1705
|
request_src_name: str = None, originator_svc_name: str = None,
|
1604
1706
|
originator_eng_name: str = None, server: str = None) -> str:
|
@@ -1616,7 +1718,6 @@ class AutomatedCuration(Client):
|
|
1616
1718
|
action_targets (str): Targets of the governance action.
|
1617
1719
|
received_guards (List[str]): List of guards received for the action.
|
1618
1720
|
start_time (datetime): The start time for the governance action.
|
1619
|
-
gov_engine_name (str): The name of the governance engine associated with the action.
|
1620
1721
|
request_type (str): The type of the governance action request.
|
1621
1722
|
request_parameters (dict): Additional parameters for the governance action.
|
1622
1723
|
process_name (str): The name of the associated governance action process.
|
@@ -1658,7 +1759,7 @@ class AutomatedCuration(Client):
|
|
1658
1759
|
|
1659
1760
|
def initiate_engine_action(self, qualified_name: str, domain_identifier: int, display_name: str, description: str,
|
1660
1761
|
request_source_guids: str, action_targets: str, received_guards: [str],
|
1661
|
-
start_time: datetime,
|
1762
|
+
start_time: datetime, request_type: str, request_parameters: dict,
|
1662
1763
|
process_name: str, request_src_name: str = None, originator_svc_name: str = None,
|
1663
1764
|
originator_eng_name: str = None, server: str = None) -> str:
|
1664
1765
|
""" Create an engine action in the metadata store that will trigger the governance service associated with
|
@@ -1700,7 +1801,7 @@ class AutomatedCuration(Client):
|
|
1700
1801
|
response = loop.run_until_complete(
|
1701
1802
|
self._async_initiate_engine_action(qualified_name, domain_identifier, display_name, description,
|
1702
1803
|
request_source_guids, action_targets, received_guards, start_time,
|
1703
|
-
|
1804
|
+
request_type, request_parameters, process_name,
|
1704
1805
|
request_src_name, originator_svc_name, originator_eng_name, server))
|
1705
1806
|
return response
|
1706
1807
|
|
@@ -1733,7 +1834,7 @@ class AutomatedCuration(Client):
|
|
1733
1834
|
f"{integ_connector_guid}/catalog-targets?startFrom={start_from}&pageSize={page_size}")
|
1734
1835
|
|
1735
1836
|
response = await self._async_make_request("GET", url)
|
1736
|
-
return response.json().get("elements", "no
|
1837
|
+
return response.json().get("elements", "no targets")
|
1737
1838
|
|
1738
1839
|
def get_catalog_targets(self, integ_connector_guid: str, server: str = None, start_from: int = 0,
|
1739
1840
|
page_size: int = max_paging_size) -> list | str:
|
@@ -1762,17 +1863,14 @@ class AutomatedCuration(Client):
|
|
1762
1863
|
self._async_get_catalog_targets(integ_connector_guid, server, start_from, page_size))
|
1763
1864
|
return response
|
1764
1865
|
|
1765
|
-
async def _async_get_catalog_target(self,
|
1766
|
-
|
1767
|
-
|
1768
|
-
Async version.
|
1866
|
+
async def _async_get_catalog_target(self, relationship_guid: str, server: str = None) -> dict | str:
|
1867
|
+
""" Retrieve a specific catalog target associated with an integration connector. Further Information:
|
1868
|
+
https://egeria-project.org/concepts/integration-connector/ . Async version.
|
1769
1869
|
|
1770
1870
|
Parameters:
|
1771
1871
|
----------
|
1772
|
-
|
1773
|
-
The GUID (Globally Unique Identifier)
|
1774
|
-
metadata_element_guid: str
|
1775
|
-
The specific metadata element target we want to retrieve.
|
1872
|
+
relationship_guid: str
|
1873
|
+
The GUID (Globally Unique Identifier) identifying the catalog targets for an integration connector.
|
1776
1874
|
server: str, optional
|
1777
1875
|
The name of the server. If None, will use the default server specified in the instance will be used.
|
1778
1876
|
Returns:
|
@@ -1787,25 +1885,23 @@ class AutomatedCuration(Client):
|
|
1787
1885
|
UserNotAuthorizedException:
|
1788
1886
|
"""
|
1789
1887
|
server = self.server_name if server is None else server
|
1790
|
-
validate_guid(
|
1791
|
-
validate_guid(metadata_element_guid)
|
1888
|
+
validate_guid(relationship_guid)
|
1792
1889
|
|
1793
|
-
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/
|
1794
|
-
f"{
|
1890
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-targets/"
|
1891
|
+
f"{relationship_guid}")
|
1795
1892
|
|
1796
1893
|
response = await self._async_make_request("GET", url)
|
1797
1894
|
return response.json().get("element", "no actions")
|
1798
1895
|
|
1799
|
-
def get_catalog_target(self,
|
1896
|
+
def get_catalog_target(self, relationship_guid: str,
|
1800
1897
|
server: str = None) -> dict | str:
|
1801
|
-
""" Retrieve a specific catalog target associated with an integration connector.
|
1898
|
+
""" Retrieve a specific catalog target associated with an integration connector. Further Information:
|
1899
|
+
https://egeria-project.org/concepts/integration-connector/ .
|
1802
1900
|
|
1803
1901
|
Parameters:
|
1804
1902
|
----------
|
1805
|
-
|
1806
|
-
The GUID (Globally Unique Identifier)
|
1807
|
-
metadata_element_guid: str
|
1808
|
-
The specific metadata element target we want to retrieve.
|
1903
|
+
relationship_guid: str
|
1904
|
+
The GUID (Globally Unique Identifier) identifying the catalog targets for an integration connector.
|
1809
1905
|
server: str, optional
|
1810
1906
|
The name of the server. If None, will use the default server specified in the instance will be used.
|
1811
1907
|
Returns:
|
@@ -1822,13 +1918,13 @@ class AutomatedCuration(Client):
|
|
1822
1918
|
|
1823
1919
|
loop = asyncio.get_event_loop()
|
1824
1920
|
response = loop.run_until_complete(
|
1825
|
-
self._async_get_catalog_target(
|
1921
|
+
self._async_get_catalog_target(relationship_guid, server))
|
1826
1922
|
return response
|
1827
1923
|
|
1828
1924
|
async def _async_add_catalog_target(self, integ_connector_guid: str, metadata_element_guid: str,
|
1829
1925
|
catalog_target_name: str, metadata_src_qual_name: str = None,
|
1830
|
-
config_properties: dict = None, server: str = None) ->
|
1831
|
-
""" Add a catalog target to an integration connector.
|
1926
|
+
config_properties: dict = None, server: str = None) -> str:
|
1927
|
+
""" Add a catalog target to an integration connector and .
|
1832
1928
|
Async version.
|
1833
1929
|
|
1834
1930
|
Parameters:
|
@@ -1847,7 +1943,7 @@ class AutomatedCuration(Client):
|
|
1847
1943
|
The name of the server. If None, will use the default server specified in the instance will be used.
|
1848
1944
|
Returns:
|
1849
1945
|
-------
|
1850
|
-
|
1946
|
+
Relationship GUID for the catalog target,
|
1851
1947
|
|
1852
1948
|
Raises:
|
1853
1949
|
------
|
@@ -1864,12 +1960,12 @@ class AutomatedCuration(Client):
|
|
1864
1960
|
f"{integ_connector_guid}/catalog-targets/{metadata_element_guid}")
|
1865
1961
|
body = {"catalogTargetName": catalog_target_name, "metadataSourceQualifiedName": metadata_src_qual_name,
|
1866
1962
|
"configProperties": config_properties}
|
1867
|
-
await self._async_make_request("POST", url, body)
|
1868
|
-
return
|
1963
|
+
response = await self._async_make_request("POST", url, body)
|
1964
|
+
return response.json().get('guid', "No Guid returned")
|
1869
1965
|
|
1870
1966
|
def add_catalog_target(self, integ_connector_guid: str, metadata_element_guid: str, catalog_target_name: str,
|
1871
1967
|
metadata_src_qual_name: str = None, config_properties: dict = None,
|
1872
|
-
server: str = None) ->
|
1968
|
+
server: str = None) -> str:
|
1873
1969
|
""" Add a catalog target to an integration connector.
|
1874
1970
|
|
1875
1971
|
Parameters:
|
@@ -1898,21 +1994,92 @@ class AutomatedCuration(Client):
|
|
1898
1994
|
UserNotAuthorizedException:
|
1899
1995
|
"""
|
1900
1996
|
loop = asyncio.get_event_loop()
|
1901
|
-
loop.run_until_complete(
|
1997
|
+
response = loop.run_until_complete(
|
1902
1998
|
self._async_add_catalog_target(integ_connector_guid, metadata_element_guid, catalog_target_name,
|
1903
1999
|
metadata_src_qual_name, config_properties, server))
|
2000
|
+
return response
|
2001
|
+
|
2002
|
+
async def _async_update_catalog_target(self, relationship_guid: str,
|
2003
|
+
catalog_target_name: str, metadata_src_qual_name: str = None,
|
2004
|
+
config_properties: dict = None, server: str = None) -> None:
|
2005
|
+
""" Update a catalog target to an integration connector.
|
2006
|
+
Async version.
|
2007
|
+
|
2008
|
+
Parameters:
|
2009
|
+
----------
|
2010
|
+
relationship_guid: str
|
2011
|
+
The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
|
2012
|
+
|
2013
|
+
catalog_target_name : dict
|
2014
|
+
Name of the catalog target to add.
|
2015
|
+
metadata_src_qual_name: str
|
2016
|
+
The qualified name of the metadata source for the catalog target
|
2017
|
+
config_properties: dict
|
2018
|
+
Configuration properties for the catalog target
|
2019
|
+
server: str, optional
|
2020
|
+
The name of the server. If None, will use the default server specified in the instance will be used.
|
2021
|
+
Returns:
|
2022
|
+
-------
|
2023
|
+
None
|
2024
|
+
|
2025
|
+
Raises:
|
2026
|
+
------
|
2027
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2028
|
+
this exception is raised with details from the response content.
|
2029
|
+
PropertyServerException: If the API response indicates a server side error.
|
2030
|
+
UserNotAuthorizedException:
|
2031
|
+
"""
|
2032
|
+
server = self.server_name if server is None else server
|
2033
|
+
validate_guid(relationship_guid)
|
2034
|
+
|
2035
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-targets/"
|
2036
|
+
f"{relationship_guid}/update")
|
2037
|
+
body = {"catalogTargetName": catalog_target_name, "metadataSourceQualifiedName": metadata_src_qual_name,
|
2038
|
+
"configProperties": config_properties}
|
2039
|
+
response = await self._async_make_request("POST", url, body)
|
1904
2040
|
return
|
1905
2041
|
|
1906
|
-
|
1907
|
-
|
1908
|
-
|
2042
|
+
def update_catalog_target(self, relationship_guid: str, catalog_target_name: str,
|
2043
|
+
metadata_src_qual_name: str = None, config_properties: dict = None,
|
2044
|
+
server: str = None) -> None:
|
2045
|
+
""" Add a catalog target to an integration connector.
|
1909
2046
|
|
1910
2047
|
Parameters:
|
1911
2048
|
----------
|
1912
|
-
|
2049
|
+
relationship_guid: str
|
1913
2050
|
The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
|
1914
|
-
|
1915
|
-
|
2051
|
+
catalog_target_name : dict
|
2052
|
+
Name of the catalog target to add.
|
2053
|
+
metadata_src_qual_name: str
|
2054
|
+
The qualified name of the metadata source for the catalog target
|
2055
|
+
config_properties: dict
|
2056
|
+
Configuration properties for the catalog target
|
2057
|
+
server: str, optional
|
2058
|
+
The name of the server. If None, will use the default server specified in the instance will be used.
|
2059
|
+
Returns:
|
2060
|
+
-------
|
2061
|
+
None
|
2062
|
+
|
2063
|
+
Raises:
|
2064
|
+
------
|
2065
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2066
|
+
this exception is raised with details from the response content.
|
2067
|
+
PropertyServerException: If the API response indicates a server side error.
|
2068
|
+
UserNotAuthorizedException:
|
2069
|
+
"""
|
2070
|
+
loop = asyncio.get_event_loop()
|
2071
|
+
loop.run_until_complete(
|
2072
|
+
self._async_update_catalog_target(relationship_guid, catalog_target_name,
|
2073
|
+
metadata_src_qual_name, config_properties, server))
|
2074
|
+
return
|
2075
|
+
|
2076
|
+
async def _async_remove_catalog_target(self, relationship_guid: str, server: str = None) -> None:
|
2077
|
+
""" Remove a catalog target to an integration connector. Async version.
|
2078
|
+
|
2079
|
+
Parameters:
|
2080
|
+
----------
|
2081
|
+
relationship_guid: str
|
2082
|
+
The GUID (Globally Unique Identifier) identifying the catalog target relationship.
|
1916
2083
|
server: str, optional
|
1917
2084
|
The name of the server. If None, will use the default server specified in the instance will be used.
|
1918
2085
|
Returns:
|
@@ -1927,24 +2094,21 @@ class AutomatedCuration(Client):
|
|
1927
2094
|
UserNotAuthorizedException:
|
1928
2095
|
"""
|
1929
2096
|
server = self.server_name if server is None else server
|
1930
|
-
validate_guid(
|
1931
|
-
validate_guid(metadata_element_guid)
|
2097
|
+
validate_guid(relationship_guid)
|
1932
2098
|
|
1933
|
-
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/
|
1934
|
-
f"{
|
2099
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-targets/"
|
2100
|
+
f"{relationship_guid}/remove")
|
1935
2101
|
|
1936
2102
|
await self._async_make_request("POST", url)
|
1937
2103
|
return
|
1938
2104
|
|
1939
|
-
def remove_catalog_target(self,
|
2105
|
+
def remove_catalog_target(self, relationship_guid: str, server: str = None) -> None:
|
1940
2106
|
""" Remove a catalog target to an integration connector.
|
1941
2107
|
|
1942
2108
|
Parameters:
|
1943
2109
|
----------
|
1944
|
-
|
1945
|
-
The GUID (Globally Unique Identifier)
|
1946
|
-
metadata_element_guid: str
|
1947
|
-
The specific metadata element target we want to retrieve.
|
2110
|
+
relationship_guid: str
|
2111
|
+
The GUID (Globally Unique Identifier) identifying the catalog target relationship.
|
1948
2112
|
server: str, optional
|
1949
2113
|
The name of the server. If None, will use the default server specified in the instance will be used.
|
1950
2114
|
Returns:
|
@@ -1960,7 +2124,7 @@ class AutomatedCuration(Client):
|
|
1960
2124
|
"""
|
1961
2125
|
|
1962
2126
|
loop = asyncio.get_event_loop()
|
1963
|
-
loop.run_until_complete(self._async_remove_catalog_target(
|
2127
|
+
loop.run_until_complete(self._async_remove_catalog_target(relationship_guid, server))
|
1964
2128
|
return
|
1965
2129
|
|
1966
2130
|
#
|
@@ -2266,3 +2430,102 @@ class AutomatedCuration(Client):
|
|
2266
2430
|
if governance_actions is not None:
|
2267
2431
|
for x in range(len(governance_actions)):
|
2268
2432
|
self.print_engine_action_summary(governance_actions[x])
|
2433
|
+
|
2434
|
+
async def _async_get_technology_type_elements(self, filter: str, effective_time: str = None, server: str = None,
|
2435
|
+
start_from: int = 0, page_size: int = max_paging_size,
|
2436
|
+
get_templates: bool = False) -> list | str:
|
2437
|
+
""" Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed
|
2438
|
+
in the name. Async version.
|
2439
|
+
|
2440
|
+
Parameters:
|
2441
|
+
----------
|
2442
|
+
filter: str
|
2443
|
+
The name of the deployed technology implementation type to retrieve elements for.
|
2444
|
+
server: str, optional
|
2445
|
+
The name of the server. If None, will use the default server specified in the instance will be used.
|
2446
|
+
|
2447
|
+
effective_time: datetime, [default=None], optional
|
2448
|
+
Effective time of the query. If not specified will default to any effective time. Time format is
|
2449
|
+
"YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
2450
|
+
|
2451
|
+
start_from : int, optional
|
2452
|
+
The index from which to start fetching the engine actions. Default is 0.
|
2453
|
+
|
2454
|
+
page_size : int, optional
|
2455
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
2456
|
+
|
2457
|
+
Returns:
|
2458
|
+
-------
|
2459
|
+
[dict] | str: List of elements describing the technology - or "no tech found" if not found.
|
2460
|
+
|
2461
|
+
Raises:
|
2462
|
+
------
|
2463
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2464
|
+
this exception is raised with details from the response content.
|
2465
|
+
PropertyServerException: If the API response indicates a server side error.
|
2466
|
+
UserNotAuthorizedException:
|
2467
|
+
|
2468
|
+
Notes
|
2469
|
+
-----
|
2470
|
+
For more information see: https://egeria-project.org/concepts/deployed-implementation-type
|
2471
|
+
"""
|
2472
|
+
server = self.server_name if server is None else server
|
2473
|
+
|
2474
|
+
get_templates_s = str(get_templates).lower()
|
2475
|
+
validate_name(filter)
|
2476
|
+
|
2477
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/technology-types/elements?"
|
2478
|
+
f"startFrom={start_from}&pageSize={page_size}&getTemplates={get_templates_s}"
|
2479
|
+
)
|
2480
|
+
body = {"filter": filter,
|
2481
|
+
"effective_time": effective_time
|
2482
|
+
}
|
2483
|
+
|
2484
|
+
response = await self._async_make_request("POST", url, body)
|
2485
|
+
return response.json().get("elements", "no tech found")
|
2486
|
+
|
2487
|
+
def get_technology_type_elements(self, filter: str, effective_time: str = None, server: str = None,
|
2488
|
+
start_from: int = 0, page_size: int = max_paging_size,
|
2489
|
+
get_templates: bool = False) -> list | str:
|
2490
|
+
""" Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed
|
2491
|
+
in the name.
|
2492
|
+
|
2493
|
+
Parameters:
|
2494
|
+
----------
|
2495
|
+
filter: str
|
2496
|
+
The name of the deployed technology implementation type to retrieve elements for.
|
2497
|
+
server: str, optional
|
2498
|
+
The name of the server. If None, will use the default server specified in the instance will be used.
|
2499
|
+
|
2500
|
+
effective_time: datetime, [default=None], optional
|
2501
|
+
Effective time of the query. If not specified will default to any effective time. Time format is
|
2502
|
+
"YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
2503
|
+
|
2504
|
+
start_from : int, optional
|
2505
|
+
The index from which to start fetching the engine actions. Default is 0.
|
2506
|
+
|
2507
|
+
page_size : int, optional
|
2508
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
2509
|
+
|
2510
|
+
Returns:
|
2511
|
+
-------
|
2512
|
+
[dict] | str: List of elements describing the technology - or "no tech found" if not found.
|
2513
|
+
|
2514
|
+
Raises:
|
2515
|
+
------
|
2516
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
2517
|
+
this exception is raised with details from the response content.
|
2518
|
+
PropertyServerException: If the API response indicates a server side error.
|
2519
|
+
UserNotAuthorizedException:
|
2520
|
+
|
2521
|
+
Notes
|
2522
|
+
-----
|
2523
|
+
For more information see: https://egeria-project.org/concepts/deployed-implementation-type
|
2524
|
+
"""
|
2525
|
+
|
2526
|
+
loop = asyncio.get_event_loop()
|
2527
|
+
response = loop.run_until_complete(
|
2528
|
+
self._async_get_technology_type_elements(filter, effective_time, server,
|
2529
|
+
start_from, page_size, get_templates
|
2530
|
+
))
|
2531
|
+
return response
|