pyegeria 0.6.3__py3-none-any.whl → 0.6.4__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.
@@ -111,6 +111,9 @@ def display_project_list(project_name: str, server: str, url: str,
111
111
  additional_properties = project.get('additionalProperties')
112
112
  if additional_properties is not None:
113
113
  props = json.dumps(additional_properties)
114
+
115
+
116
+
114
117
  table.add_row(
115
118
  name, description, classification, qualified_name, identifier, phase, health, status, start,
116
119
  end, '---')
@@ -103,9 +103,20 @@ def display_engine_activity(server: str, url: str, user: str, user_pass: str, pa
103
103
  else:
104
104
  action_status = f"[red]{action['actionStatus']}"
105
105
 
106
- target = action.get("actionTargetElements", "Empty")
107
- if type(target) is list:
108
- target_element = json.dumps(target[0]["targetElement"]["elementProperties"]["propertiesAsStrings"])
106
+ targets = action.get("actionTargetElements", "Empty")
107
+ if type(targets) is list:
108
+ tgt_tab = Table()
109
+ tgt_tab.add_column('name')
110
+ tgt_tab.add_column('guid', no_wrap=True)
111
+ tgt_tab.add_column('type_name')
112
+ targets_md = ""
113
+ for target in targets:
114
+ t_name = target['actionTargetName']
115
+ t_guid = target['actionTargetGUID']
116
+ t_type = target['targetElement']['type']['typeName']
117
+ tgt_tab.add_row(t_name, t_guid, t_type)
118
+ # target_element = json.dumps(target[0]["targetElement"]["elementProperties"]["propertiesAsStrings"])
119
+ target_element = tgt_tab
109
120
  else:
110
121
  target_element = " "
111
122
 
pyegeria/__init__.py CHANGED
@@ -11,8 +11,9 @@ the server platform and servers.
11
11
 
12
12
  """
13
13
 
14
- from ._globals import (is_debug, disable_ssl_warnings, max_paging_size, TEMPLATE_GUIDS, INTEGRATION_GUIDS
15
- )
14
+ from ._globals import (is_debug, disable_ssl_warnings, max_paging_size, TEMPLATE_GUIDS, INTEGRATION_GUIDS,
15
+ default_time_out
16
+ )
16
17
 
17
18
  if disable_ssl_warnings:
18
19
  from urllib3.exceptions import InsecureRequestWarning
@@ -47,6 +48,7 @@ from .runtime_manager_omvs import RuntimeManager
47
48
  from .action_author_omvs import GovernanceAuthor
48
49
  from .glossary_manager_omvs import GlossaryManager
49
50
  from .create_tech_guid_lists import build_global_guid_lists
51
+ from .classification_manager_omvs import ClassificationManager
50
52
 
51
53
 
52
54
  #
pyegeria/_globals.py CHANGED
@@ -13,6 +13,7 @@ is_debug = False
13
13
  disable_ssl_warnings = True
14
14
  enable_ssl_check = False
15
15
  max_paging_size = 500
16
+ default_time_out = 30
16
17
 
17
18
  comment_types = (
18
19
  "ANSWER",
@@ -9,16 +9,15 @@ Copyright Contributors to the ODPi Egeria project.
9
9
 
10
10
  """
11
11
  import asyncio
12
- from datetime import datetime
13
12
  import json
14
13
 
15
14
  from httpx import Response
16
15
 
17
- from pyegeria import Client, max_paging_size, body_slimmer, TEMPLATE_GUIDS, INTEGRATION_GUIDS
16
+ from pyegeria import Client, max_paging_size, body_slimmer, TEMPLATE_GUIDS
18
17
  from pyegeria._exceptions import (
19
18
  InvalidParameterException,
20
19
  )
21
- from ._validators import validate_name, validate_guid, validate_search_string
20
+ from ._validators import validate_search_string
22
21
 
23
22
 
24
23
  class AssetCatalog(Client):
@@ -34,9 +33,6 @@ class AssetCatalog(Client):
34
33
  when the user doesn't pass the user_id on a method call.
35
34
  user_pwd: str
36
35
  The password associated with the user_id. Defaults to None
37
- verify_flag: bool
38
- Flag to indicate if SSL Certificates should be verified in the HTTP requests.
39
- Defaults to False.
40
36
 
41
37
  """
42
38
 
@@ -46,12 +42,10 @@ class AssetCatalog(Client):
46
42
  platform_url: str,
47
43
  user_id: str,
48
44
  user_pwd: str = None,
49
- verify_flag: bool = False,
50
45
  ):
51
- Client.__init__(self, server_name, platform_url, user_id, user_pwd, verify_flag)
46
+ Client.__init__(self, server_name, platform_url, user_id, user_pwd)
52
47
  self.cur_command_root = f"{platform_url}/servers/"
53
48
 
54
-
55
49
  async def _async_create_element_from_template(self, body: dict, server: str = None) -> str:
56
50
  """ Create a new metadata element from a template. Async version.
57
51
  Parameters
@@ -304,9 +298,9 @@ class AssetCatalog(Client):
304
298
  #
305
299
 
306
300
  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, time_out:int = 60) -> list | str:
301
+ page_size: int = max_paging_size, starts_with: bool = True,
302
+ ends_with: bool = False, ignore_case: bool = True,
303
+ server: str = None, time_out: int = 60) -> list | str:
310
304
  """ Retrieve the list of engine action metadata elements that contain the search string. Async Version.
311
305
  Parameters
312
306
  ----------
@@ -366,9 +360,9 @@ class AssetCatalog(Client):
366
360
  return response.json().get("searchMatches", "no assets found")
367
361
 
368
362
  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, time_out:int = 60) -> list | str:
363
+ page_size: int = max_paging_size, starts_with: bool = True,
364
+ ends_with: bool = False, ignore_case: bool = True,
365
+ server: str = None, time_out: int = 60) -> list | str:
372
366
  """ Retrieve the list of engine action metadata elements that contain the search string. Async Version.
373
367
  Parameters
374
368
  ----------
@@ -411,14 +405,13 @@ class AssetCatalog(Client):
411
405
  """
412
406
  loop = asyncio.get_event_loop()
413
407
  response = loop.run_until_complete(
414
- self._async_find_assets_in_domain(search_string, start_from,page_size,
408
+ self._async_find_assets_in_domain(search_string, start_from, page_size,
415
409
  starts_with, ends_with, ignore_case, server, time_out)
416
410
  )
417
411
  return response
418
412
 
419
-
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:
413
+ async def _async_get_asset_graph(self, asset_guid: str, server: str = None, start_from: int = 0,
414
+ page_size: int = max_paging_size) -> str | dict:
422
415
  """ Return all the elements that are anchored to an asset plus relationships between these elements and to
423
416
  other elements. Async Version.
424
417
  Parameters
@@ -456,7 +449,7 @@ class AssetCatalog(Client):
456
449
  return response.json().get("assetGraph", "no asset found")
457
450
 
458
451
  def get_asset_graph(self, asset_guid: str, server: str = None, start_from: int = 0,
459
- page_size: int = max_paging_size) -> str | dict:
452
+ page_size: int = max_paging_size) -> str | dict:
460
453
  """ Return all the elements that are anchored to an asset plus relationships between these elements and to
461
454
  other elements.
462
455
  Parameters
@@ -488,13 +481,14 @@ class AssetCatalog(Client):
488
481
 
489
482
  loop = asyncio.get_event_loop()
490
483
  response = loop.run_until_complete(
491
- self._async_get_asset_graph(asset_guid, server,start_from, page_size)
484
+ self._async_get_asset_graph(asset_guid, server, start_from, page_size)
492
485
  )
493
486
  return response
494
487
 
495
- async def _async_get_assets_by_metadata_collection_id(self, metadata_collection_id:str, type_name: str = None,
488
+ async def _async_get_assets_by_metadata_collection_id(self, metadata_collection_id: str, type_name: str = None,
496
489
  effective_time: str = None, server: str = None,
497
- start_from: int = 0, page_size: int = max_paging_size) -> str| list:
490
+ start_from: int = 0,
491
+ page_size: int = max_paging_size) -> str | list:
498
492
  """ Return a list of assets that come from the requested metadata collection. Can optionally
499
493
  specify an type name as a filter and an effective time. Async Version.
500
494
 
@@ -545,9 +539,9 @@ class AssetCatalog(Client):
545
539
  return response.json().get("assets", "no assets found")
546
540
 
547
541
  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:
542
+ effective_time: str = None, server: str = None,
543
+ start_from: int = 0,
544
+ page_size: int = max_paging_size) -> str | list:
551
545
  """ Return a list of assets that come from the requested metadata collection. Can optionally
552
546
  specify an type name as a filter and an effective time. Async Version.
553
547
 
@@ -587,12 +581,12 @@ class AssetCatalog(Client):
587
581
  loop = asyncio.get_event_loop()
588
582
  response = loop.run_until_complete(
589
583
  self._async_get_assets_by_metadata_collection_id(metadata_collection_id, type_name,
590
- effective_time,server,start_from,
584
+ effective_time, server, start_from,
591
585
  page_size)
592
586
  )
593
587
  return response
594
588
 
595
- async def _async_get_asset_catalog_types(self, server: str = None) -> str| dict:
589
+ async def _async_get_asset_catalog_types(self, server: str = None) -> str | dict:
596
590
  """ Return all the elements that are anchored to an asset plus relationships between these elements and to
597
591
  other elements. Async Version.
598
592
  Parameters
@@ -627,7 +621,7 @@ class AssetCatalog(Client):
627
621
 
628
622
  response = await self._async_make_request("GET", url)
629
623
 
630
- return response.json().get('types',"No assets found")
624
+ return response.json().get('types', "No assets found")
631
625
 
632
626
  def get_asset_catalog_types(self, server: str = None) -> str | dict:
633
627
  """ Return all the elements that are anchored to an asset plus relationships between these elements and to
@@ -665,6 +659,7 @@ class AssetCatalog(Client):
665
659
  )
666
660
  return response
667
661
 
662
+
668
663
  if __name__ == "__main__":
669
664
  p = AssetCatalog("active-metadata-store", "https://127.0.0.1:9443", "garygeeke", verify_flag=False)
670
665
  response = p.get_assets_by_metadata_collection_id()