pyegeria 0.3.9__py3-none-any.whl → 0.4.1__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/core_omag_server_config.py +1 -1
- 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.1.data/scripts/get_guid_info.py +86 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.1.data}/scripts/get_tech_details.py +1 -37
- pyegeria-0.4.1.data/scripts/get_tech_type_elements.py +137 -0
- pyegeria-0.4.1.data/scripts/get_tech_type_template.py +137 -0
- pyegeria-0.4.1.data/scripts/list_assets.py +138 -0
- pyegeria-0.3.9.data/scripts/project_list_viewer.py → pyegeria-0.4.1.data/scripts/list_projects.py +1 -1
- pyegeria-0.3.9.data/scripts/get_relationship_types.py → pyegeria-0.4.1.data/scripts/list_relationship_types.py +9 -8
- pyegeria-0.4.1.data/scripts/list_tech_templates.py +134 -0
- pyegeria-0.3.9.data/scripts/find_todos.py → pyegeria-0.4.1.data/scripts/list_todos.py +2 -1
- pyegeria-0.4.1.data/scripts/list_valid_metadata_values.py +144 -0
- pyegeria-0.4.1.data/scripts/view_asset_graph.py +245 -0
- pyegeria-0.3.9.data/scripts/coco_status.py → pyegeria-0.4.1.data/scripts/view_coco_status.py +10 -9
- pyegeria-0.3.9.data/scripts/engine_action_status.py → pyegeria-0.4.1.data/scripts/view_eng_action_status.py +8 -3
- pyegeria-0.4.1.data/scripts/view_integ_daemon_status.py +140 -0
- pyegeria-0.4.1.data/scripts/view_platform_status.py +123 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.1.dist-info}/METADATA +5 -2
- pyegeria-0.4.1.dist-info/RECORD +58 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.1.dist-info}/WHEEL +1 -1
- pyegeria-0.3.9.data/scripts/integration_daemon_status.py +0 -130
- 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.1.data}/scripts/Create_Collection_Sample.py +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.1.data}/scripts/Create_Sustainability_Collection_Sample.py +0 -0
- /pyegeria-0.3.9.data/scripts/view_my_profile.py → /pyegeria-0.4.1.data/scripts/get_my_profile.py +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.1.data}/scripts/list_asset_types.py +0 -0
- /pyegeria-0.3.9.data/scripts/get_registered_services.py → /pyegeria-0.4.1.data/scripts/list_registered_services.py +0 -0
- /pyegeria-0.3.9.data/scripts/get_tech_types.py → /pyegeria-0.4.1.data/scripts/list_tech_types.py +0 -0
- /pyegeria-0.3.9.data/scripts/collection_viewer.py → /pyegeria-0.4.1.data/scripts/view_collection.py +0 -0
- /pyegeria-0.3.9.data/scripts/glossary_view.py → /pyegeria-0.4.1.data/scripts/view_glossary.py +0 -0
- /pyegeria-0.3.9.data/scripts/gov_engine_status.py → /pyegeria-0.4.1.data/scripts/view_gov_eng_status.py +0 -0
- /pyegeria-0.3.9.data/scripts/my_todos.py → /pyegeria-0.4.1.data/scripts/view_my_todos.py +0 -0
- /pyegeria-0.3.9.data/scripts/open_todos.py → /pyegeria-0.4.1.data/scripts/view_open_todos.py +0 -0
- /pyegeria-0.3.9.data/scripts/server_status_widget.py → /pyegeria-0.4.1.data/scripts/view_server_list.py +0 -0
- /pyegeria-0.3.9.data/scripts/server_status.py → /pyegeria-0.4.1.data/scripts/view_server_status.py +0 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.1.dist-info}/LICENSE +0 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.1.dist-info}/top_level.txt +0 -0
@@ -4,6 +4,8 @@ Copyright Contributors to the ODPi Egeria project.
|
|
4
4
|
|
5
5
|
Feedback Manager View Service Methods - Add comments, reviews, tags and notes to elements of interest.
|
6
6
|
|
7
|
+
This work is being actively developed..
|
8
|
+
|
7
9
|
"""
|
8
10
|
import asyncio
|
9
11
|
from datetime import datetime
|
@@ -234,18 +236,3 @@ class FeedbackManager(Client):
|
|
234
236
|
return response
|
235
237
|
|
236
238
|
|
237
|
-
|
238
|
-
async def _async_get_all_technology_types(self, server: str = None, start_from: int = 0,
|
239
|
-
page_size: int = max_paging_size) -> list | str:
|
240
|
-
return await self._async_find_technology_types("*", server, start_from, page_size)
|
241
|
-
|
242
|
-
def get_all_technology_types(self, server: str = None, start_from: int = 0,
|
243
|
-
page_size: int = max_paging_size) -> list | str:
|
244
|
-
return self.find_technology_types("*", server, start_from, page_size)
|
245
|
-
|
246
|
-
|
247
|
-
if __name__ == "__main__":
|
248
|
-
p = AutomatedCuration("meow", "https://127.0.0.1:9443", "garygeeke", verify_flag=False)
|
249
|
-
response = p.get_active_engine_actions()
|
250
|
-
out = response.json()
|
251
|
-
print(out)
|
pyegeria/__init__.py
CHANGED
@@ -11,11 +11,14 @@ the server platform and servers.
|
|
11
11
|
|
12
12
|
"""
|
13
13
|
|
14
|
-
from ._globals import is_debug, disable_ssl_warnings, max_paging_size
|
14
|
+
from ._globals import (is_debug, disable_ssl_warnings, max_paging_size,
|
15
|
+
)
|
16
|
+
from .core_guids import *
|
15
17
|
|
16
18
|
if disable_ssl_warnings:
|
17
19
|
from urllib3.exceptions import InsecureRequestWarning
|
18
20
|
from urllib3 import disable_warnings
|
21
|
+
|
19
22
|
disable_warnings(InsecureRequestWarning)
|
20
23
|
|
21
24
|
from ._exceptions import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException,
|
@@ -29,7 +32,7 @@ from .registered_info import RegisteredInfo
|
|
29
32
|
from .glossary_browser_omvs import GlossaryBrowser
|
30
33
|
from ._validators import (validate_user_id, validate_name, validate_guid, validate_server_name, validate_search_string,
|
31
34
|
validate_url, is_json, validate_public)
|
32
|
-
|
35
|
+
from .asset_catalog_omvs import AssetCatalog
|
33
36
|
|
34
37
|
from .my_profile_omvs import MyProfile
|
35
38
|
from .full_omag_server_config import FullServerConfig
|
@@ -37,7 +40,11 @@ from .server_operations import ServerOps
|
|
37
40
|
from .collection_manager_omvs import CollectionManager
|
38
41
|
from .project_manager_omvs import ProjectManager
|
39
42
|
from .valid_metadata_omvs import ValidMetadataManager
|
40
|
-
from .
|
43
|
+
from .asset_catalog_omvs import AssetCatalog
|
41
44
|
from .Xloaded_resources_omvs import LoadedResources
|
42
45
|
from ._deprecated_gov_engine import GovEng
|
43
|
-
|
46
|
+
from .runtime_manager_omvs import RuntimeManager
|
47
|
+
from .action_author_omvs import GovernanceAuthor
|
48
|
+
from .glossary_manager_omvs import GlossaryManager
|
49
|
+
|
50
|
+
__version__ = "0.4"
|
pyegeria/_globals.py
CHANGED
@@ -8,10 +8,11 @@ This common file is used to set some global values and enumerations used by the
|
|
8
8
|
|
9
9
|
"""
|
10
10
|
|
11
|
+
|
11
12
|
is_debug = False
|
12
13
|
disable_ssl_warnings = True
|
13
14
|
enable_ssl_check = False
|
14
|
-
max_paging_size =
|
15
|
+
max_paging_size = 500
|
15
16
|
|
16
17
|
comment_types = (
|
17
18
|
"ANSWER",
|
@@ -29,3 +30,4 @@ star_ratings = (
|
|
29
30
|
"THREE_STARS",
|
30
31
|
"TWO_STARS",
|
31
32
|
)
|
33
|
+
|
@@ -10,6 +10,7 @@ Copyright Contributors to the ODPi Egeria project.
|
|
10
10
|
"""
|
11
11
|
import asyncio
|
12
12
|
from datetime import datetime
|
13
|
+
import json
|
13
14
|
|
14
15
|
from httpx import Response
|
15
16
|
|
@@ -302,8 +303,10 @@ class AssetCatalog(Client):
|
|
302
303
|
# Engine Actions
|
303
304
|
#
|
304
305
|
|
305
|
-
async def
|
306
|
-
|
306
|
+
async def _async_find_assets_in_domain(self, search_string: str, start_from: int = 0,
|
307
|
+
page_size: int = max_paging_size, starts_with: bool = True,
|
308
|
+
ends_with: bool = False, ignore_case: bool = True,
|
309
|
+
server: str = None) -> list | str:
|
307
310
|
""" Retrieve the list of engine action metadata elements that contain the search string. Async Version.
|
308
311
|
Parameters
|
309
312
|
----------
|
@@ -345,26 +348,28 @@ class AssetCatalog(Client):
|
|
345
348
|
For more information see: https://egeria-project.org/concepts/engine-action
|
346
349
|
"""
|
347
350
|
server = self.server_name if server is None else server
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
url = (f"{self.platform_url}/servers/{server}/open-metadata/
|
356
|
-
f"
|
351
|
+
validate_search_string(search_string)
|
352
|
+
if search_string == "*":
|
353
|
+
search_string = None
|
354
|
+
starts_with_s = str(starts_with).lower()
|
355
|
+
ends_with_s = str(ends_with).lower()
|
356
|
+
ignore_case_s = str(ignore_case).lower()
|
357
|
+
|
358
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/in-domain/"
|
359
|
+
f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
360
|
+
f"endWith={ends_with_s}&ignoreCase={ignore_case_s}"
|
357
361
|
)
|
358
362
|
body = {
|
359
|
-
"
|
360
|
-
"searchString": search_string
|
363
|
+
"filter": search_string
|
361
364
|
}
|
362
365
|
response = await self._async_make_request("POST", url, body)
|
363
|
-
return response.json().get("
|
366
|
+
return response.json().get("searchMatches", "no assets found")
|
364
367
|
|
365
|
-
def
|
366
|
-
|
367
|
-
|
368
|
+
def find_assets_in_domain(self, search_string: str, start_from: int = 0,
|
369
|
+
page_size: int = max_paging_size, starts_with: bool = True,
|
370
|
+
ends_with: bool = False, ignore_case: bool = True,
|
371
|
+
server: str = None) -> list | str:
|
372
|
+
""" Retrieve the list of engine action metadata elements that contain the search string. Async Version.
|
368
373
|
Parameters
|
369
374
|
----------
|
370
375
|
search_string : str
|
@@ -404,136 +409,264 @@ class AssetCatalog(Client):
|
|
404
409
|
-----
|
405
410
|
For more information see: https://egeria-project.org/concepts/engine-action
|
406
411
|
"""
|
407
|
-
|
408
412
|
loop = asyncio.get_event_loop()
|
409
413
|
response = loop.run_until_complete(
|
410
|
-
self.
|
411
|
-
|
414
|
+
self._async_find_assets_in_domain(search_string, start_from,page_size,
|
415
|
+
starts_with, ends_with, ignore_case, server)
|
412
416
|
)
|
413
417
|
return response
|
414
418
|
|
415
419
|
|
416
|
-
async def
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
420
|
+
async def _async_get_asset_graph(self, asset_guid:str, server: str = None, start_from: int = 0,
|
421
|
+
page_size: int = max_paging_size) -> str| dict:
|
422
|
+
""" Return all the elements that are anchored to an asset plus relationships between these elements and to
|
423
|
+
other elements. Async Version.
|
424
|
+
Parameters
|
425
|
+
----------
|
426
|
+
asset_guid : str
|
427
|
+
The unique identity of the asset to get the graph for.
|
424
428
|
|
425
|
-
|
426
|
-
|
429
|
+
server : str, optional
|
430
|
+
The name of the server. If None, will use the default server specified in the instance will be used.
|
427
431
|
|
428
|
-
|
429
|
-
|
432
|
+
start_from : int, optional
|
433
|
+
The index from which to start fetching the engine actions. Default is 0.
|
430
434
|
|
431
|
-
|
432
|
-
|
435
|
+
page_size : int, optional
|
436
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
433
437
|
|
434
|
-
|
435
|
-
|
438
|
+
Returns
|
439
|
+
-------
|
440
|
+
dict or str
|
441
|
+
A dictionary of the asset graph.
|
436
442
|
|
437
|
-
|
438
|
-
|
443
|
+
Raises:
|
444
|
+
------
|
445
|
+
InvalidParameterException
|
446
|
+
PropertyServerException
|
447
|
+
UserNotAuthorizedException
|
439
448
|
|
440
|
-
|
441
|
-
|
449
|
+
"""
|
450
|
+
server = self.server_name if server is None else server
|
442
451
|
|
443
|
-
|
444
|
-
|
445
|
-
List[dict] or str
|
446
|
-
A list of dictionaries representing the engine actions found based on the search query.
|
447
|
-
If no actions are found, returns the string "no actions".
|
452
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/{asset_guid}/"
|
453
|
+
f"as-graph?startFrom={start_from}&pageSize={page_size}")
|
448
454
|
|
449
|
-
|
450
|
-
|
451
|
-
InvalidParameterException
|
452
|
-
PropertyServerException
|
453
|
-
UserNotAuthorizedException
|
455
|
+
response = await self._async_make_request("GET", url)
|
456
|
+
return response.json().get("assetGraph", "no asset found")
|
454
457
|
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
458
|
+
def get_asset_graph(self, asset_guid: str, server: str = None, start_from: int = 0,
|
459
|
+
page_size: int = max_paging_size) -> str | dict:
|
460
|
+
""" Return all the elements that are anchored to an asset plus relationships between these elements and to
|
461
|
+
other elements.
|
462
|
+
Parameters
|
463
|
+
----------
|
464
|
+
asset_guid : str
|
465
|
+
The unique identity of the asset to get the graph for.
|
466
|
+
|
467
|
+
server : str, optional
|
468
|
+
The name of the server. If None, will use the default server specified in the instance will be used.
|
469
|
+
|
470
|
+
start_from : int, optional
|
471
|
+
The index from which to start fetching the engine actions. Default is 0.
|
472
|
+
|
473
|
+
page_size : int, optional
|
474
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
475
|
+
|
476
|
+
Returns
|
477
|
+
-------
|
478
|
+
dict or str
|
479
|
+
A dictionary of the asset graph.
|
480
|
+
|
481
|
+
Raises:
|
482
|
+
------
|
483
|
+
InvalidParameterException
|
484
|
+
PropertyServerException
|
485
|
+
UserNotAuthorizedException
|
486
|
+
|
487
|
+
"""
|
488
|
+
|
489
|
+
loop = asyncio.get_event_loop()
|
490
|
+
response = loop.run_until_complete(
|
491
|
+
self._async_get_asset_graph(asset_guid, server,start_from, page_size)
|
492
|
+
)
|
493
|
+
return response
|
494
|
+
|
495
|
+
async def _async_get_assets_by_metadata_collection_id(self, metadata_collection_id:str, type_name: str = None,
|
496
|
+
effective_time: str = None, server: str = None,
|
497
|
+
start_from: int = 0, page_size: int = max_paging_size) -> str| list:
|
498
|
+
""" Return a list of assets that come from the requested metadata collection. Can optionally
|
499
|
+
specify an type name as a filter and an effective time. Async Version.
|
500
|
+
|
501
|
+
Parameters
|
502
|
+
----------
|
503
|
+
metadata_collection_id : str
|
504
|
+
The unique identity of the metadata collection to return assets from.
|
505
|
+
|
506
|
+
type_name: str, optional
|
507
|
+
An asset type to optionally filter on. If not specified, all assets in the collection will be returned.
|
508
|
+
|
509
|
+
effective_time: str, optional
|
510
|
+
The effective time to filter on. If not specified, the current time is used.
|
511
|
+
|
512
|
+
server : str, optional
|
513
|
+
The name of the server. If None, will use the default server specified in the instance will be used.
|
514
|
+
|
515
|
+
start_from : int, optional
|
516
|
+
The index from which to start fetching the engine actions. Default is 0.
|
517
|
+
|
518
|
+
page_size : int, optional
|
519
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
520
|
+
|
521
|
+
Returns
|
522
|
+
-------
|
523
|
+
list or str
|
524
|
+
A list of assets in a [dict].
|
525
|
+
|
526
|
+
Raises:
|
527
|
+
------
|
528
|
+
InvalidParameterException
|
529
|
+
PropertyServerException
|
530
|
+
UserNotAuthorizedException
|
531
|
+
|
532
|
+
"""
|
459
533
|
server = self.server_name if server is None else server
|
460
|
-
validate_search_string(search_string)
|
461
|
-
if search_string == "*":
|
462
|
-
search_string = None
|
463
|
-
starts_with_s = str(starts_with).lower()
|
464
|
-
ends_with_s = str(ends_with).lower()
|
465
|
-
ignore_case_s = str(ignore_case).lower()
|
466
534
|
|
467
|
-
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/
|
468
|
-
f"
|
469
|
-
|
470
|
-
)
|
535
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/by-metadata-collection-id/"
|
536
|
+
f"{metadata_collection_id}?startFrom={start_from}&pageSize={page_size}")
|
537
|
+
|
471
538
|
body = {
|
472
|
-
"
|
473
|
-
"
|
539
|
+
"filter": type_name,
|
540
|
+
"effectiveTime": effective_time
|
474
541
|
}
|
475
|
-
|
476
|
-
|
542
|
+
body_s = body_slimmer(body)
|
543
|
+
print(json.dumps(body_s))
|
544
|
+
response = await self._async_make_request("POST", url, body_s)
|
545
|
+
return response.json().get("assets", "no assets found")
|
546
|
+
|
547
|
+
def get_assets_by_metadata_collection_id(self, metadata_collection_id: str, type_name: str = None,
|
548
|
+
effective_time: str = None, server: str = None,
|
549
|
+
start_from: int = 0,
|
550
|
+
page_size: int = max_paging_size) -> str | list:
|
551
|
+
""" Return a list of assets that come from the requested metadata collection. Can optionally
|
552
|
+
specify an type name as a filter and an effective time. Async Version.
|
477
553
|
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
Parameters
|
483
|
-
----------
|
484
|
-
search_string : str
|
485
|
-
The string used for searching engine actions by name.
|
554
|
+
Parameters
|
555
|
+
----------
|
556
|
+
metadata_collection_id : str
|
557
|
+
The unique identity of the metadata collection to return assets from.
|
486
558
|
|
487
|
-
|
488
|
-
|
559
|
+
type_name: str, optional
|
560
|
+
An asset type to optionally filter on. If not specified, all assets in the collection will be returned.
|
489
561
|
|
490
|
-
|
491
|
-
|
562
|
+
effective_time: str, optional
|
563
|
+
The effective time to filter on. If not specified, the current time is used.
|
492
564
|
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
ignore_case : bool, optional
|
497
|
-
Whether to ignore case while searching engine actions. Default is False.
|
565
|
+
server : str, optional
|
566
|
+
The name of the server. If None, will use the default server specified in the instance will be used.
|
498
567
|
|
499
|
-
|
500
|
-
|
568
|
+
start_from : int, optional
|
569
|
+
The index from which to start fetching the engine actions. Default is 0.
|
501
570
|
|
502
|
-
|
503
|
-
|
571
|
+
page_size : int, optional
|
572
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
504
573
|
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
If no actions are found, returns the string "no actions".
|
574
|
+
Returns
|
575
|
+
-------
|
576
|
+
list or str
|
577
|
+
A list of assets in a [dict].
|
510
578
|
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
579
|
+
Raises:
|
580
|
+
------
|
581
|
+
InvalidParameterException
|
582
|
+
PropertyServerException
|
583
|
+
UserNotAuthorizedException
|
516
584
|
|
517
|
-
|
518
|
-
-----
|
519
|
-
For more information see: https://egeria-project.org/concepts/engine-action
|
520
|
-
"""
|
585
|
+
"""
|
521
586
|
|
522
587
|
loop = asyncio.get_event_loop()
|
523
588
|
response = loop.run_until_complete(
|
524
|
-
self.
|
525
|
-
|
526
|
-
|
589
|
+
self._async_get_assets_by_metadata_collection_id(metadata_collection_id, type_name,
|
590
|
+
effective_time,server,start_from,
|
591
|
+
page_size)
|
527
592
|
)
|
528
593
|
return response
|
529
594
|
|
530
|
-
async def
|
531
|
-
|
595
|
+
async def _async_get_asset_catalog_types(self, server: str = None) -> str| dict:
|
596
|
+
""" Return all the elements that are anchored to an asset plus relationships between these elements and to
|
597
|
+
other elements. Async Version.
|
598
|
+
Parameters
|
599
|
+
----------
|
600
|
+
asset_guid : str
|
601
|
+
The unique identity of the asset to get the graph for.
|
602
|
+
|
603
|
+
server : str, optional
|
604
|
+
The name of the server. If None, will use the default server specified in the instance will be used.
|
605
|
+
|
606
|
+
start_from : int, optional
|
607
|
+
The index from which to start fetching the engine actions. Default is 0.
|
608
|
+
|
609
|
+
page_size : int, optional
|
610
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
611
|
+
|
612
|
+
Returns
|
613
|
+
-------
|
614
|
+
dict or str
|
615
|
+
A dictionary of the asset graph.
|
616
|
+
|
617
|
+
Raises:
|
618
|
+
------
|
619
|
+
InvalidParameterException
|
620
|
+
PropertyServerException
|
621
|
+
UserNotAuthorizedException
|
532
622
|
|
623
|
+
"""
|
624
|
+
server = self.server_name if server is None else server
|
625
|
+
|
626
|
+
url = f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/types"
|
627
|
+
|
628
|
+
response = await self._async_make_request("GET", url)
|
629
|
+
|
630
|
+
return response.json().get('types',"No assets found")
|
631
|
+
|
632
|
+
def get_asset_catalog_types(self, server: str = None) -> str | dict:
|
633
|
+
""" Return all the elements that are anchored to an asset plus relationships between these elements and to
|
634
|
+
other elements.
|
635
|
+
Parameters
|
636
|
+
----------
|
637
|
+
asset_guid : str
|
638
|
+
The unique identity of the asset to get the graph for.
|
639
|
+
|
640
|
+
server : str, optional
|
641
|
+
The name of the server. If None, will use the default server specified in the instance will be used.
|
642
|
+
|
643
|
+
start_from : int, optional
|
644
|
+
The index from which to start fetching the engine actions. Default is 0.
|
533
645
|
|
646
|
+
page_size : int, optional
|
647
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
648
|
+
|
649
|
+
Returns
|
650
|
+
-------
|
651
|
+
dict or str
|
652
|
+
A dictionary of the asset graph.
|
653
|
+
|
654
|
+
Raises:
|
655
|
+
------
|
656
|
+
InvalidParameterException
|
657
|
+
PropertyServerException
|
658
|
+
UserNotAuthorizedException
|
659
|
+
|
660
|
+
"""
|
661
|
+
|
662
|
+
loop = asyncio.get_event_loop()
|
663
|
+
response = loop.run_until_complete(
|
664
|
+
self._async_get_asset_catalog_types(server)
|
665
|
+
)
|
666
|
+
return response
|
534
667
|
|
535
668
|
if __name__ == "__main__":
|
536
669
|
p = AssetCatalog("active-metadata-store", "https://127.0.0.1:9443", "garygeeke", verify_flag=False)
|
537
|
-
response = p.
|
670
|
+
response = p.get_assets_by_metadata_collection_id()
|
538
671
|
out = response.json()
|
539
672
|
print(out)
|