pyegeria 0.8.4.31__py3-none-any.whl → 0.8.4.33__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.
- commands/cat/list_glossary.py +2 -2
- commands/ops/load_archive.py +5 -2
- pyegeria/asset_catalog_omvs.py +35 -105
- pyegeria/automated_curation_omvs.py +212 -486
- pyegeria/core_omag_server_config.py +37 -6
- pyegeria/runtime_manager_omvs.py +370 -163
- {pyegeria-0.8.4.31.dist-info → pyegeria-0.8.4.33.dist-info}/METADATA +2 -1
- {pyegeria-0.8.4.31.dist-info → pyegeria-0.8.4.33.dist-info}/RECORD +11 -11
- {pyegeria-0.8.4.31.dist-info → pyegeria-0.8.4.33.dist-info}/LICENSE +0 -0
- {pyegeria-0.8.4.31.dist-info → pyegeria-0.8.4.33.dist-info}/WHEEL +0 -0
- {pyegeria-0.8.4.31.dist-info → pyegeria-0.8.4.33.dist-info}/entry_points.txt +0 -0
commands/cat/list_glossary.py
CHANGED
@@ -53,8 +53,8 @@ def display_glossary_terms(
|
|
53
53
|
jupyter: bool = EGERIA_JUPYTER,
|
54
54
|
width: int = EGERIA_WIDTH,
|
55
55
|
):
|
56
|
-
g_client = GlossaryBrowser(server, url)
|
57
|
-
token = g_client.create_egeria_bearer_token(
|
56
|
+
g_client = GlossaryBrowser(server, url, username, user_password)
|
57
|
+
token = g_client.create_egeria_bearer_token()
|
58
58
|
|
59
59
|
def generate_table(search_string: str = "*") -> Table:
|
60
60
|
"""Make a new table."""
|
commands/ops/load_archive.py
CHANGED
@@ -58,8 +58,11 @@ def load_archive(file, server, view_server, url, userid, password, timeout):
|
|
58
58
|
try:
|
59
59
|
s_client = EgeriaTech(view_server, url, userid, password)
|
60
60
|
token = s_client.create_egeria_bearer_token()
|
61
|
-
server_guid = s_client.get_guid_for_name(server)
|
62
|
-
|
61
|
+
# server_guid = s_client.get_guid_for_name(server)
|
62
|
+
server_guid = None
|
63
|
+
s_client.add_archive_file(
|
64
|
+
file, server_guid, EGERIA_METADATA_STORE, time_out=timeout
|
65
|
+
)
|
63
66
|
|
64
67
|
click.echo(f"Loaded archive: {file}")
|
65
68
|
|
pyegeria/asset_catalog_omvs.py
CHANGED
@@ -44,19 +44,18 @@ class AssetCatalog(Client):
|
|
44
44
|
user_pwd: str = None,
|
45
45
|
token: str = None,
|
46
46
|
):
|
47
|
+
self.server_name = server_name
|
48
|
+
self.platform_url = platform_url
|
49
|
+
self.user_id = user_id
|
50
|
+
self.user_pwd = user_pwd
|
47
51
|
Client.__init__(self, server_name, platform_url, user_id, user_pwd, token=token)
|
48
|
-
self.cur_command_root = f"{platform_url}/servers/"
|
49
52
|
|
50
|
-
async def _async_create_element_from_template(
|
51
|
-
self, body: dict, server: str = None
|
52
|
-
) -> str:
|
53
|
+
async def _async_create_element_from_template(self, body: dict) -> str:
|
53
54
|
"""Create a new metadata element from a template. Async version.
|
54
55
|
Parameters
|
55
56
|
----------
|
56
57
|
body : str
|
57
58
|
The json body used to instantiate the template.
|
58
|
-
server : str, optional
|
59
|
-
The name of the view server to use. If not provided, the default server name will be used.
|
60
59
|
|
61
60
|
Returns
|
62
61
|
-------
|
@@ -95,13 +94,11 @@ class AssetCatalog(Client):
|
|
95
94
|
}
|
96
95
|
"""
|
97
96
|
|
98
|
-
|
99
|
-
|
100
|
-
url = f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-templates/new-element"
|
97
|
+
url = f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/automated-curation/catalog-templates/new-element"
|
101
98
|
response = await self._async_make_request("POST", url, body)
|
102
99
|
return response.json().get("guid", "GUID failed to be returned")
|
103
100
|
|
104
|
-
def create_element_from_template(self, body: dict
|
101
|
+
def create_element_from_template(self, body: dict) -> str:
|
105
102
|
"""Create a new metadata element from a template. Async version.
|
106
103
|
Parameters
|
107
104
|
----------
|
@@ -148,12 +145,12 @@ class AssetCatalog(Client):
|
|
148
145
|
"""
|
149
146
|
loop = asyncio.get_event_loop()
|
150
147
|
response = loop.run_until_complete(
|
151
|
-
self._async_create_element_from_template(body
|
148
|
+
self._async_create_element_from_template(body)
|
152
149
|
)
|
153
150
|
return response
|
154
151
|
|
155
152
|
async def _async_create_kafka_server_element_from_template(
|
156
|
-
self, kafka_server: str, host_name: str, port: str
|
153
|
+
self, kafka_server: str, host_name: str, port: str
|
157
154
|
) -> str:
|
158
155
|
"""Create a Kafka server element from a template. Async version.
|
159
156
|
|
@@ -168,9 +165,6 @@ class AssetCatalog(Client):
|
|
168
165
|
port : str
|
169
166
|
The port number of the Kafka server.
|
170
167
|
|
171
|
-
server : str, optional
|
172
|
-
The name of the view server to use. Default uses the client instance.
|
173
|
-
|
174
168
|
Returns
|
175
169
|
-------
|
176
170
|
str
|
@@ -186,11 +180,11 @@ class AssetCatalog(Client):
|
|
186
180
|
"portNumber": port,
|
187
181
|
},
|
188
182
|
}
|
189
|
-
response = await self._async_create_element_from_template(body
|
183
|
+
response = await self._async_create_element_from_template(body)
|
190
184
|
return response
|
191
185
|
|
192
186
|
def create_kafka_server_element_from_template(
|
193
|
-
self, kafka_server: str, host_name: str, port: str
|
187
|
+
self, kafka_server: str, host_name: str, port: str
|
194
188
|
) -> str:
|
195
189
|
"""Create a Kafka server element from a template.
|
196
190
|
|
@@ -205,9 +199,6 @@ class AssetCatalog(Client):
|
|
205
199
|
port : str
|
206
200
|
The port number of the Kafka server.
|
207
201
|
|
208
|
-
server : str, optional
|
209
|
-
The name of the view server to use. Default uses the client instance.
|
210
|
-
|
211
202
|
Returns
|
212
203
|
-------
|
213
204
|
str
|
@@ -216,7 +207,7 @@ class AssetCatalog(Client):
|
|
216
207
|
loop = asyncio.get_event_loop()
|
217
208
|
response = loop.run_until_complete(
|
218
209
|
self._async_create_kafka_server_element_from_template(
|
219
|
-
kafka_server, host_name, port
|
210
|
+
kafka_server, host_name, port
|
220
211
|
)
|
221
212
|
)
|
222
213
|
return response
|
@@ -228,7 +219,6 @@ class AssetCatalog(Client):
|
|
228
219
|
port: str,
|
229
220
|
db_user: str,
|
230
221
|
db_pwd: str,
|
231
|
-
server: str = None,
|
232
222
|
) -> str:
|
233
223
|
"""Create a Postgres server element from a template. Async version.
|
234
224
|
|
@@ -249,9 +239,6 @@ class AssetCatalog(Client):
|
|
249
239
|
db_pwd: str
|
250
240
|
User password to connect to the database
|
251
241
|
|
252
|
-
server : str, optional
|
253
|
-
The name of the view server to use. Default uses the client instance.
|
254
|
-
|
255
242
|
Returns
|
256
243
|
-------
|
257
244
|
str
|
@@ -268,7 +255,7 @@ class AssetCatalog(Client):
|
|
268
255
|
"databasePassword": db_pwd,
|
269
256
|
},
|
270
257
|
}
|
271
|
-
response = await self._async_create_element_from_template(body
|
258
|
+
response = await self._async_create_element_from_template(body)
|
272
259
|
return response
|
273
260
|
|
274
261
|
def create_postgres_server_element_from_template(
|
@@ -278,7 +265,6 @@ class AssetCatalog(Client):
|
|
278
265
|
port: str,
|
279
266
|
db_user: str,
|
280
267
|
db_pwd: str,
|
281
|
-
server: str = None,
|
282
268
|
) -> str:
|
283
269
|
"""Create a Postgres server element from a template.
|
284
270
|
|
@@ -293,9 +279,6 @@ class AssetCatalog(Client):
|
|
293
279
|
port : str
|
294
280
|
The port number of the Postgres server.
|
295
281
|
|
296
|
-
server : str, optional
|
297
|
-
The name of the view server to use. Default uses the client instance.
|
298
|
-
|
299
282
|
db_user: str
|
300
283
|
User name to connect to the database
|
301
284
|
|
@@ -310,7 +293,7 @@ class AssetCatalog(Client):
|
|
310
293
|
loop = asyncio.get_event_loop()
|
311
294
|
response = loop.run_until_complete(
|
312
295
|
self._async_create_postgres_server_element_from_template(
|
313
|
-
postgres_server, host_name, port, db_user, db_pwd
|
296
|
+
postgres_server, host_name, port, db_user, db_pwd
|
314
297
|
)
|
315
298
|
)
|
316
299
|
return response
|
@@ -327,7 +310,6 @@ class AssetCatalog(Client):
|
|
327
310
|
starts_with: bool = True,
|
328
311
|
ends_with: bool = False,
|
329
312
|
ignore_case: bool = True,
|
330
|
-
server: str = None,
|
331
313
|
time_out: int = 60,
|
332
314
|
) -> list | str:
|
333
315
|
"""Retrieve the list of engine action metadata elements that contain the search string. Async Version.
|
@@ -336,9 +318,6 @@ class AssetCatalog(Client):
|
|
336
318
|
search_string : str
|
337
319
|
The string used for searching engine actions by name.
|
338
320
|
|
339
|
-
server : str, optional
|
340
|
-
The name of the server. If None, will use the default server specified in the instance will be used.
|
341
|
-
|
342
321
|
starts_with : bool, optional
|
343
322
|
Whether to search engine actions that start with the given search string. Default is False.
|
344
323
|
|
@@ -370,16 +349,15 @@ class AssetCatalog(Client):
|
|
370
349
|
-----
|
371
350
|
For more information see: https://egeria-project.org/concepts/engine-action
|
372
351
|
"""
|
373
|
-
|
352
|
+
|
374
353
|
validate_search_string(search_string)
|
375
|
-
|
376
|
-
# search_string = None
|
354
|
+
|
377
355
|
starts_with_s = str(starts_with).lower()
|
378
356
|
ends_with_s = str(ends_with).lower()
|
379
357
|
ignore_case_s = str(ignore_case).lower()
|
380
358
|
|
381
359
|
url = (
|
382
|
-
f"{self.platform_url}/servers/{
|
360
|
+
f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/asset-catalog/assets/in-domain/"
|
383
361
|
f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
384
362
|
f"endWith={ends_with_s}&ignoreCase={ignore_case_s}"
|
385
363
|
)
|
@@ -395,7 +373,6 @@ class AssetCatalog(Client):
|
|
395
373
|
starts_with: bool = True,
|
396
374
|
ends_with: bool = False,
|
397
375
|
ignore_case: bool = True,
|
398
|
-
server: str = None,
|
399
376
|
time_out: int = 60,
|
400
377
|
) -> list | str:
|
401
378
|
"""Retrieve the list of engine action metadata elements that contain the search string. Async Version.
|
@@ -404,9 +381,6 @@ class AssetCatalog(Client):
|
|
404
381
|
search_string : str
|
405
382
|
The string used for searching engine actions by name.
|
406
383
|
|
407
|
-
server : str, optional
|
408
|
-
The name of the server. If None, will use the default server specified in the instance will be used.
|
409
|
-
|
410
384
|
starts_with : bool, optional
|
411
385
|
Whether to search engine actions that start with the given search string. Default is False.
|
412
386
|
|
@@ -447,7 +421,6 @@ class AssetCatalog(Client):
|
|
447
421
|
starts_with,
|
448
422
|
ends_with,
|
449
423
|
ignore_case,
|
450
|
-
server,
|
451
424
|
time_out,
|
452
425
|
)
|
453
426
|
)
|
@@ -456,7 +429,6 @@ class AssetCatalog(Client):
|
|
456
429
|
async def _async_get_asset_graph(
|
457
430
|
self,
|
458
431
|
asset_guid: str,
|
459
|
-
server: str = None,
|
460
432
|
start_from: int = 0,
|
461
433
|
page_size: int = max_paging_size,
|
462
434
|
) -> str | dict:
|
@@ -467,9 +439,6 @@ class AssetCatalog(Client):
|
|
467
439
|
asset_guid : str
|
468
440
|
The unique identity of the asset to get the graph for.
|
469
441
|
|
470
|
-
server : str, optional
|
471
|
-
The name of the server. If None, will use the default server specified in the instance will be used.
|
472
|
-
|
473
442
|
start_from : int, optional
|
474
443
|
The index from which to start fetching the engine actions. Default is 0.
|
475
444
|
|
@@ -488,10 +457,9 @@ class AssetCatalog(Client):
|
|
488
457
|
UserNotAuthorizedException
|
489
458
|
|
490
459
|
"""
|
491
|
-
server = self.server_name if server is None else server
|
492
460
|
|
493
461
|
url = (
|
494
|
-
f"{self.platform_url}/servers/{
|
462
|
+
f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/asset-catalog/assets/{asset_guid}/"
|
495
463
|
f"as-graph?startFrom={start_from}&pageSize={page_size}"
|
496
464
|
)
|
497
465
|
|
@@ -501,7 +469,6 @@ class AssetCatalog(Client):
|
|
501
469
|
def get_asset_graph(
|
502
470
|
self,
|
503
471
|
asset_guid: str,
|
504
|
-
server: str = None,
|
505
472
|
start_from: int = 0,
|
506
473
|
page_size: int = max_paging_size,
|
507
474
|
) -> str | dict:
|
@@ -512,9 +479,6 @@ class AssetCatalog(Client):
|
|
512
479
|
asset_guid : str
|
513
480
|
The unique identity of the asset to get the graph for.
|
514
481
|
|
515
|
-
server : str, optional
|
516
|
-
The name of the server. If None, will use the default server specified in the instance will be used.
|
517
|
-
|
518
482
|
start_from : int, optional
|
519
483
|
The index from which to start fetching the engine actions. Default is 0.
|
520
484
|
|
@@ -536,7 +500,7 @@ class AssetCatalog(Client):
|
|
536
500
|
|
537
501
|
loop = asyncio.get_event_loop()
|
538
502
|
response = loop.run_until_complete(
|
539
|
-
self._async_get_asset_graph(asset_guid,
|
503
|
+
self._async_get_asset_graph(asset_guid, start_from, page_size)
|
540
504
|
)
|
541
505
|
return response
|
542
506
|
|
@@ -545,7 +509,6 @@ class AssetCatalog(Client):
|
|
545
509
|
metadata_collection_id: str,
|
546
510
|
type_name: str = None,
|
547
511
|
effective_time: str = None,
|
548
|
-
server: str = None,
|
549
512
|
start_from: int = 0,
|
550
513
|
page_size: int = max_paging_size,
|
551
514
|
) -> str | list:
|
@@ -563,9 +526,6 @@ class AssetCatalog(Client):
|
|
563
526
|
effective_time: str, optional
|
564
527
|
The effective time to filter on. If not specified, the current time is used.
|
565
528
|
|
566
|
-
server : str, optional
|
567
|
-
The name of the server. If None, will use the default server specified in the instance will be used.
|
568
|
-
|
569
529
|
start_from : int, optional
|
570
530
|
The index from which to start fetching the engine actions. Default is 0.
|
571
531
|
|
@@ -584,16 +544,14 @@ class AssetCatalog(Client):
|
|
584
544
|
UserNotAuthorizedException
|
585
545
|
|
586
546
|
"""
|
587
|
-
server = self.server_name if server is None else server
|
588
547
|
|
589
548
|
url = (
|
590
|
-
f"{self.platform_url}/servers/{
|
549
|
+
f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/asset-catalog/assets/by-metadata-collection-id/"
|
591
550
|
f"{metadata_collection_id}?startFrom={start_from}&pageSize={page_size}"
|
592
551
|
)
|
593
552
|
|
594
553
|
body = {"filter": type_name, "effectiveTime": effective_time}
|
595
554
|
body_s = body_slimmer(body)
|
596
|
-
print(json.dumps(body_s))
|
597
555
|
response = await self._async_make_request("POST", url, body_s)
|
598
556
|
return response.json().get("assets", "no assets found")
|
599
557
|
|
@@ -602,7 +560,6 @@ class AssetCatalog(Client):
|
|
602
560
|
metadata_collection_id: str,
|
603
561
|
type_name: str = None,
|
604
562
|
effective_time: str = None,
|
605
|
-
server: str = None,
|
606
563
|
start_from: int = 0,
|
607
564
|
page_size: int = max_paging_size,
|
608
565
|
) -> str | list:
|
@@ -620,9 +577,6 @@ class AssetCatalog(Client):
|
|
620
577
|
effective_time: str, optional
|
621
578
|
The effective time to filter on. If not specified, the current time is used.
|
622
579
|
|
623
|
-
server : str, optional
|
624
|
-
The name of the server. If None, will use the default server specified in the instance will be used.
|
625
|
-
|
626
580
|
start_from : int, optional
|
627
581
|
The index from which to start fetching the engine actions. Default is 0.
|
628
582
|
|
@@ -648,66 +602,42 @@ class AssetCatalog(Client):
|
|
648
602
|
metadata_collection_id,
|
649
603
|
type_name,
|
650
604
|
effective_time,
|
651
|
-
server,
|
652
605
|
start_from,
|
653
606
|
page_size,
|
654
607
|
)
|
655
608
|
)
|
656
609
|
return response
|
657
610
|
|
658
|
-
async def
|
611
|
+
async def _async_get_asset_types(self) -> str | dict:
|
659
612
|
"""Return all the elements that are anchored to an asset plus relationships between these elements and to
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
asset_guid : str
|
664
|
-
The unique identity of the asset to get the graph for.
|
665
|
-
|
666
|
-
server : str, optional
|
667
|
-
The name of the server. If None, will use the default server specified in the instance will be used.
|
668
|
-
|
669
|
-
start_from : int, optional
|
670
|
-
The index from which to start fetching the engine actions. Default is 0.
|
671
|
-
|
672
|
-
page_size : int, optional
|
673
|
-
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
613
|
+
other elements. Async Version.
|
614
|
+
Parameters
|
615
|
+
----------
|
674
616
|
|
675
|
-
|
676
|
-
|
617
|
+
Returns
|
618
|
+
-------
|
677
619
|
dict or str
|
678
|
-
|
620
|
+
A dictionary of the asset graph.
|
679
621
|
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
622
|
+
Raises:
|
623
|
+
------
|
624
|
+
InvalidParameterException
|
625
|
+
PropertyServerException
|
626
|
+
UserNotAuthorizedException
|
685
627
|
|
686
628
|
"""
|
687
|
-
server = self.server_name if server is None else server
|
688
629
|
|
689
|
-
url = f"{self.platform_url}/servers/{
|
630
|
+
url = f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/asset-catalog/assets/types"
|
690
631
|
|
691
632
|
response = await self._async_make_request("GET", url)
|
692
633
|
|
693
634
|
return response.json().get("types", "No assets found")
|
694
635
|
|
695
|
-
def get_asset_catalog_types(self
|
636
|
+
def get_asset_catalog_types(self) -> str | dict:
|
696
637
|
"""Return all the elements that are anchored to an asset plus relationships between these elements and to
|
697
638
|
other elements.
|
698
639
|
Parameters
|
699
640
|
----------
|
700
|
-
asset_guid : str
|
701
|
-
The unique identity of the asset to get the graph for.
|
702
|
-
|
703
|
-
server : str, optional
|
704
|
-
The name of the server. If None, will use the default server specified in the instance will be used.
|
705
|
-
|
706
|
-
start_from : int, optional
|
707
|
-
The index from which to start fetching the engine actions. Default is 0.
|
708
|
-
|
709
|
-
page_size : int, optional
|
710
|
-
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
711
641
|
|
712
642
|
Returns
|
713
643
|
-------
|
@@ -723,7 +653,7 @@ class AssetCatalog(Client):
|
|
723
653
|
"""
|
724
654
|
|
725
655
|
loop = asyncio.get_event_loop()
|
726
|
-
response = loop.run_until_complete(self.
|
656
|
+
response = loop.run_until_complete(self._async_get_asset_types())
|
727
657
|
return response
|
728
658
|
|
729
659
|
|