pyegeria 1.5.1.1.60__py3-none-any.whl → 5.2__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.
Files changed (126) hide show
  1. pyegeria/__init__.py +2 -0
  2. pyegeria/_client.py +7 -2
  3. pyegeria/asset_catalog_omvs.py +34 -0
  4. pyegeria/classification_manager_omvs.py +2 -3
  5. pyegeria/collection_manager_omvs.py +92 -45
  6. pyegeria/commands/README.md +2 -1
  7. pyegeria/commands/cat/__init__.py +1 -5
  8. pyegeria/commands/cat/exp_list_glossaries.py +156 -0
  9. pyegeria/commands/cat/get_collection.py +23 -14
  10. pyegeria/commands/cat/get_tech_type_elements.py +1 -1
  11. pyegeria/commands/cat/glossary_actions.py +28 -8
  12. pyegeria/commands/cat/list_assets.py +8 -17
  13. pyegeria/commands/cat/list_cert_types.py +1 -1
  14. pyegeria/commands/cat/list_collections.py +162 -0
  15. pyegeria/commands/cat/list_deployed_catalogs.py +6 -3
  16. pyegeria/commands/cat/list_deployed_database_schemas.py +8 -13
  17. pyegeria/commands/cat/list_deployed_databases.py +3 -3
  18. pyegeria/commands/cat/list_tech_type_elements.py +190 -0
  19. pyegeria/commands/cat/list_tech_types.py +36 -24
  20. pyegeria/commands/cat/list_terms.py +7 -2
  21. pyegeria/commands/cli/egeria.py +120 -129
  22. pyegeria/commands/cli/egeria_cat.py +63 -52
  23. pyegeria/commands/cli/egeria_login_tui.py +313 -0
  24. pyegeria/commands/cli/egeria_my.py +25 -33
  25. pyegeria/commands/cli/egeria_ops.py +38 -40
  26. pyegeria/commands/cli/egeria_tech.py +55 -41
  27. pyegeria/commands/cli/ops_config.py +3 -1
  28. pyegeria/commands/cli/txt_custom_v2.tcss +19 -0
  29. pyegeria/commands/doc/README.md +145 -0
  30. pyegeria/commands/doc/Visual Command Reference/README.md +511 -0
  31. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/asset-graph 2024-11-20 at 15.56.42.png +0 -0
  32. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/assets-in-domain 2024-11-20 at 15.49.55@2x.png +0 -0
  33. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/elements-of-type 2024-11-20 at 16.01.35.png +0 -0
  34. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/tech-type-elements 2024-11-20 at 16.05.05.png +0 -0
  35. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png +0 -0
  36. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs-2024-11-20 at 16.17.43@2x.png +0 -0
  37. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-11-25 at 20.14.50@2x.png +0 -0
  38. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-12-17 at 15.48.38@2x.png +0 -0
  39. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-11-25 at 20.21.25@2x.png +0 -0
  40. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-12-17 at 15.52.16@2x.png +0 -0
  41. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed_databases 2024-12-16 at 16.40.31@2x.png +0 -0
  42. pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-glossaries 2024-11-25 at 20.30.02.png +0 -0
  43. pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-terms 2024-11-25 at 20.32.11.png +0 -0
  44. pyegeria/commands/doc/Visual Command Reference/cat/show/info/asset-types 2024-11-25 at 20.34.19@2x.png +0 -0
  45. pyegeria/commands/doc/Visual Command Reference/cat/show/info/certification-types 2024-11-25 at 20.37.07.png +0 -0
  46. pyegeria/commands/doc/Visual Command Reference/cat/show/info/collection-graph 2024-12-12 at 11.33.18@2x.png +0 -0
  47. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-collections 2024-12-10 at 14.25.51@2x.png +0 -0
  48. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-todos 2024-12-12 at 11.46.30@2x.png +0 -0
  49. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-user-ids 2024-12-12 at 11.51.09@2x.png +0 -0
  50. pyegeria/commands/doc/Visual Command Reference/cat/show/info/tech-types 2024-12-12 at 11.37.20@2x.png +0 -0
  51. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_dependencies 2024-12-14 at 16.24.39@2x.png +0 -0
  52. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_structure 2024-12-14 at 16.21.35@2x.png +0 -0
  53. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/projects 2024-12-14 at 16.18.10@2x.png +0 -0
  54. pyegeria/commands/doc/Visual Command Reference/hey_egeria tui 2024-12-16 at 16.58.22@2x.png +0 -0
  55. pyegeria/commands/doc/Visual Command Reference/my/show/my_profile 2024-12-14 at 16.29.27@2x.png +0 -0
  56. pyegeria/commands/doc/Visual Command Reference/my/show/my_roles 2024-12-14 at 16.32.10@2x.png +0 -0
  57. pyegeria/commands/doc/Visual Command Reference/my/show/my_todos 2024-12-15 at 16.24.13@2x.png +0 -0
  58. pyegeria/commands/doc/Visual Command Reference/my/show/open_todos 2024-12-14 at 16.36.12@2x.png +0 -0
  59. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/list_engine_activity compressed 2024-12-15 at 16.48.48@2x.png +0 -0
  60. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity 2024-12-15 at 16.32.55@2x.png +0 -0
  61. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity compressed 2024-12-15 at 16.38.29@2x.png +0 -0
  62. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_status 2024-12-15 at 16.51.26.jpeg +0 -0
  63. pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_daemon_status 2024-12-15 at 16.57.12@2x.png +0 -0
  64. pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_targets 2024-12-15 at 17.02.19@2x.png +0 -0
  65. pyegeria/commands/doc/Visual Command Reference/ops/show/platforms/monitor_platform_status 2024-12-15 at 19.53.18@2x.png +0 -0
  66. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status 2024-12-15 at 19.59.39@2x.png +0 -0
  67. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status full 2024-12-15 at 20.01.57@2x.png +0 -0
  68. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_startup_servers 2024-12-15 at 19.56.07@2x.png +0 -0
  69. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_anchored_elements 2024-12-15 at 21.25.41@2x.png +0 -0
  70. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_elements_of_om_type 2024-12-16 at 14.39.59@2x.png +0 -0
  71. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/info_for_guid 2024-12-16 at 11.35.29@2x.png +0 -0
  72. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type 2024-12-16 at 14.24.18@2x.png +0 -0
  73. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type extended 2024-12-16 at 14.28.46@2x.png +0 -0
  74. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_of_om_type_by_classification 2024-12-16 at 14.35.26@2x.png +0 -0
  75. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/related_elements 2024-12-16 at 14.55.01@2x.png +0 -0
  76. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/show_related_specifications 2024-12-16 at 15.04.55@2x.png +0 -0
  77. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/asset_types 2024-12-16 at 15.10.16@2x.png +0 -0
  78. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/detailed_governance_action_processes 2024-12-16 at 15.16.26@2x.png +0 -0
  79. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/governance_action_processes 2024-12-16 at 15.13.01@2x.png +0 -0
  80. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/registered_services 2024-12-16 at 16.44.54@2x.png +0 -0
  81. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-16 at 16.20.34@2x.png +0 -0
  82. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-19 at 10.51.54@2x.png +0 -0
  83. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/valid_metadata_values 2024-12-16 at 15.31.56@2x.png +0 -0
  84. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_tech_type_template_specs 2024-12-16 at 16.03.22@2x.png +0 -0
  85. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_technology_types 2024-12-16 at 15.39.20@2x.png +0 -0
  86. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_details 2024-12-16 at 15.37.21@2x.png +0 -0
  87. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_templates 2024-12-16 at 16.11.48@2x.png +0 -0
  88. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/{hey_egeria: overview.md → README.md } +9 -1
  89. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/CleanShot 2024-11-18 at 21.32.03@2x.png +0 -0
  90. pyegeria/commands/my/monitor_my_todos.py +17 -5
  91. pyegeria/commands/my/monitor_open_todos.py +1 -1
  92. pyegeria/commands/my/todo_actions.py +7 -14
  93. pyegeria/commands/ops/monitor_asset_events.py +27 -22
  94. pyegeria/commands/ops/monitor_engine_activity_c.py +1 -1
  95. pyegeria/commands/ops/monitor_gov_eng_status.py +31 -4
  96. pyegeria/commands/ops/monitor_integ_daemon_status.py +17 -14
  97. pyegeria/commands/ops/monitor_platform_status.py +15 -3
  98. pyegeria/commands/ops/monitor_server_status.py +1 -1
  99. pyegeria/commands/ops/orig_monitor_server_status.py +36 -21
  100. pyegeria/commands/ops/refresh_integration_daemon.py +1 -1
  101. pyegeria/commands/ops/restart_integration_daemon.py +1 -1
  102. pyegeria/commands/ops/x_engine_actions.py +2 -59
  103. pyegeria/commands/tech/get_tech_details.py +79 -42
  104. pyegeria/commands/tech/get_tech_type_template.py +69 -53
  105. pyegeria/commands/tech/{list_element_graph.py → list_anchored_elements.py} +20 -17
  106. pyegeria/commands/tech/list_elements_x.py +7 -4
  107. pyegeria/commands/tech/list_registered_services.py +1 -1
  108. pyegeria/commands/tech/list_relationship_types.py +19 -21
  109. pyegeria/commands/tech/list_relationships.py +7 -3
  110. pyegeria/commands/tech/table_tech_templates.py +3 -1
  111. pyegeria/core_omag_server_config.py +36 -0
  112. pyegeria/create_tech_guid_lists.py +2 -2
  113. pyegeria/egeria_client.py +2 -0
  114. pyegeria/egeria_tech_client.py +5 -0
  115. pyegeria/glossary_manager_omvs.py +101 -7
  116. pyegeria/metadata_explorer_omvs.py +2371 -0
  117. pyegeria/server_operations.py +4 -4
  118. pyegeria/template_manager_omvs.py +1 -3
  119. pyegeria/valid_metadata_omvs.py +1 -1
  120. {pyegeria-1.5.1.1.60.dist-info → pyegeria-5.2.dist-info}/METADATA +7 -9
  121. pyegeria-5.2.dist-info/RECORD +232 -0
  122. {pyegeria-1.5.1.1.60.dist-info → pyegeria-5.2.dist-info}/entry_points.txt +4 -1
  123. pyegeria/commands/doc/command-overview.md +0 -99
  124. pyegeria-1.5.1.1.60.dist-info/RECORD +0 -167
  125. {pyegeria-1.5.1.1.60.dist-info → pyegeria-5.2.dist-info}/LICENSE +0 -0
  126. {pyegeria-1.5.1.1.60.dist-info → pyegeria-5.2.dist-info}/WHEEL +0 -0
pyegeria/__init__.py CHANGED
@@ -67,6 +67,7 @@ from .glossary_manager_omvs import GlossaryManager
67
67
  from .create_tech_guid_lists import build_global_guid_lists
68
68
  from .classification_manager_omvs import ClassificationManager
69
69
  from .feedback_manager_omvs import FeedbackManager
70
+ from .metadata_explorer_omvs import MetadataExplorer
70
71
  from .mermaid_utilities import load_mermaid, render_mermaid, generate_process_graph
71
72
  from .egeria_my_client import EgeriaMy
72
73
  from .egeria_cat_client import EgeriaCat
@@ -74,6 +75,7 @@ from .egeria_tech_client import EgeriaTech
74
75
  from .egeria_config_client import EgeriaConfig
75
76
  from .egeria_client import Egeria
76
77
 
78
+
77
79
  #
78
80
  # The following assignments were generated by the `create_tech_guid_lists.py` utility that uses the pyegeria functions
79
81
  # to interrogate Egeria (and the Core Content Pack) for the GUIDS associates with integration connectors and templates.
pyegeria/_client.py CHANGED
@@ -693,6 +693,11 @@ class Client:
693
693
  result = await self._async_make_request("POST", url, body_slimmer(body))
694
694
  return result.json().get("guid", "No elements found")
695
695
 
696
+ try:
697
+ view_server = self.view_server
698
+ except AttributeError:
699
+ view_server = os.environ.get("VIEW_SERVER", "view-server")
700
+
696
701
  if (not qualified_name) and display_name:
697
702
  if (tech_type) and (property_name == "qualifiedName"):
698
703
  name = f"{tech_type}:{display_name}"
@@ -705,7 +710,7 @@ class Client:
705
710
  "effectiveTime": None,
706
711
  }
707
712
  url = (
708
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/"
713
+ f"{self.platform_url}/servers/{view_server}/api/open-metadata/classification-manager/"
709
714
  f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
710
715
  )
711
716
 
@@ -721,7 +726,7 @@ class Client:
721
726
  "effectiveTime": None,
722
727
  }
723
728
  url = (
724
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/"
729
+ f"{self.platform_url}/servers/{view_server}/api/open-metadata/classification-manager/"
725
730
  f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
726
731
  )
727
732
 
@@ -506,6 +506,40 @@ class AssetCatalog(Client):
506
506
  )
507
507
  return response
508
508
 
509
+ def get_asset_mermaid_graph(
510
+ self,
511
+ asset_guid: str,
512
+ start_from: int = 0,
513
+ page_size: int = max_paging_size,
514
+ ) -> str:
515
+ """Return the asset graph as mermaid markdown string.
516
+ Parameters
517
+ ----------
518
+ asset_guid : str
519
+ The unique identity of the asset to get the graph for.
520
+
521
+ start_from : int, optional
522
+ The index from which to start fetching the engine actions. Default is 0.
523
+
524
+ page_size : int, optional
525
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
526
+
527
+ Returns
528
+ -------
529
+ str
530
+ A mermaid string representing the asset graph.
531
+
532
+ Raises:
533
+ ------
534
+ InvalidParameterException
535
+ PropertyServerException
536
+ UserNotAuthorizedException
537
+
538
+ """
539
+
540
+ asset_graph = self.get_asset_graph(asset_guid, start_from, page_size)
541
+ return asset_graph.get("mermaidGraph")
542
+
509
543
  async def _async_get_asset_lineage_graph(
510
544
  self,
511
545
  asset_guid: str,
@@ -1,8 +1,7 @@
1
1
  """PDX-License-Identifier: Apache-2.0
2
2
  Copyright Contributors to the ODPi Egeria project.
3
3
 
4
- This module contains an initial version of the classification_manager_omvs
5
- module.
4
+ This module provides access to the classification_manager_omvs module.
6
5
 
7
6
  """
8
7
 
@@ -71,7 +70,7 @@ class ClassificationManager(Client):
71
70
  self.platform_url = platform_url
72
71
  self.user_id = user_id
73
72
  self.user_pwd = user_pwd
74
- self.classification_command_root: str = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/runtime-manager"
73
+ self.classification_command_root: str = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager"
75
74
  Client.__init__(
76
75
  self,
77
76
  view_server,
@@ -2179,7 +2179,9 @@ class CollectionManager(Client):
2179
2179
 
2180
2180
  async def _async_get_collection_members(
2181
2181
  self,
2182
- collection_guid: str,
2182
+ collection_guid: str = None,
2183
+ collection_name: str = None,
2184
+ collection_qname: str = None,
2183
2185
  effective_time: str = None,
2184
2186
  start_from: int = 0,
2185
2187
  page_size: int = None,
@@ -2189,12 +2191,16 @@ class CollectionManager(Client):
2189
2191
  Parameters
2190
2192
  ----------
2191
2193
  collection_guid: str,
2192
- identity of the collection to return members for.
2194
+ identity of the collection to return members for. If none, collection_name or
2195
+ collection_qname are used.
2196
+ collection_name: str,
2197
+ display name of the collection to return members for. If none, collection_guid
2198
+ or collection_qname are used.
2199
+ collection_qname: str,
2200
+ qualified name of the collection to return members for. If none, collection_guid
2201
+ or collection_name are used.
2193
2202
  effective_time: str, [default=None], optional
2194
2203
  Effective time of the query. If not specified will default to any time.
2195
-
2196
-
2197
-
2198
2204
  start_from: int, [default=0], optional
2199
2205
  When multiple pages of results are available, the page number to start from.
2200
2206
  page_size: int, [default=None]
@@ -2220,7 +2226,13 @@ class CollectionManager(Client):
2220
2226
 
2221
2227
  if page_size is None:
2222
2228
  page_size = self.page_size
2223
-
2229
+ collection_guid = self.__get_guid__(
2230
+ collection_guid,
2231
+ collection_name,
2232
+ "name",
2233
+ collection_qname,
2234
+ None,
2235
+ )
2224
2236
  url = (
2225
2237
  f"{self.collection_command_root}/{collection_guid}/"
2226
2238
  f"members?startFrom={start_from}&pageSize={page_size}"
@@ -2231,27 +2243,33 @@ class CollectionManager(Client):
2231
2243
 
2232
2244
  def get_collection_members(
2233
2245
  self,
2234
- collection_guid: str,
2246
+ collection_guid: str = None,
2247
+ collection_name: str = None,
2248
+ collection_qname: str = None,
2235
2249
  effective_time: str = None,
2236
2250
  start_from: int = 0,
2237
2251
  page_size: int = None,
2238
2252
  ) -> list | str:
2239
- """Return a list of elements that are a member of a collection.
2240
-
2241
- Parameters
2242
- ----------
2243
- collection_guid: str,
2244
- identity of the collection to return members for.
2245
- effective_time: str, [default=None], optional
2246
- Effective time of the query. If not specified will default to any time.
2247
-
2248
-
2253
+ """Return a list of elements that are a member of a collection. Async version.
2249
2254
 
2250
- start_from: int, [default=0], optional
2251
- When multiple pages of results are available, the page number to start from.
2252
- page_size: int, [default=None]
2253
- The number of items to return in a single page. If not specified, the default will be taken from
2254
- the class instance.
2255
+ Parameters
2256
+ ----------
2257
+ collection_guid: str,
2258
+ identity of the collection to return members for. If none, collection_name or
2259
+ collection_qname are used.
2260
+ collection_name: str,
2261
+ display name of the collection to return members for. If none, collection_guid
2262
+ or collection_qname are used.
2263
+ collection_qname: str,
2264
+ qualified name of the collection to return members for. If none, collection_guid
2265
+ or collection_name are used.
2266
+ effective_time: str, [default=None], optional
2267
+ Effective time of the query. If not specified will default to any time.
2268
+ start_from: int, [default=0], optional
2269
+ When multiple pages of results are available, the page number to start from.
2270
+ page_size: int, [default=None]
2271
+ The number of items to return in a single page. If not specified, the default will be taken from
2272
+ the class instance.
2255
2273
  Returns
2256
2274
  -------
2257
2275
  List | str
@@ -2272,7 +2290,12 @@ class CollectionManager(Client):
2272
2290
  loop = asyncio.get_event_loop()
2273
2291
  resp = loop.run_until_complete(
2274
2292
  self._async_get_collection_members(
2275
- collection_guid, effective_time, start_from, page_size
2293
+ collection_guid,
2294
+ collection_name,
2295
+ collection_qname,
2296
+ effective_time,
2297
+ start_from,
2298
+ page_size,
2276
2299
  )
2277
2300
  )
2278
2301
 
@@ -2602,20 +2625,29 @@ class CollectionManager(Client):
2602
2625
  )
2603
2626
  return
2604
2627
 
2605
- async def _async_get_member_list(self, root_collection_guid: str) -> list | bool:
2628
+ async def _async_get_member_list(
2629
+ self,
2630
+ collection_guid: str = None,
2631
+ collection_name: str = None,
2632
+ collection_qname: str = None,
2633
+ ) -> list | bool:
2606
2634
  """Get the member list for the collection - async version.
2607
2635
  Parameters
2608
2636
  ----------
2609
- root_collection_guid : str
2610
- The unique GUID of the root collection.
2611
-
2612
-
2613
- The name of the server. If not provided, the default server name will be used.
2637
+ collection_guid: str,
2638
+ identity of the collection to return members for. If none, collection_name or
2639
+ collection_qname are used.
2640
+ collection_name: str,
2641
+ display name of the collection to return members for. If none, collection_guid
2642
+ or collection_qname are used.
2643
+ collection_qname: str,
2644
+ qualified name of the collection to return members for. If none, collection_guid
2645
+ or collection_name are used.
2614
2646
 
2615
2647
  Returns
2616
2648
  -------
2617
- list | bool
2618
- The list of member information if successful, otherwise False.
2649
+ list | str
2650
+ The list of member information if successful, otherwise the string "No members found"
2619
2651
 
2620
2652
  Raises
2621
2653
  ------
@@ -2628,15 +2660,20 @@ class CollectionManager(Client):
2628
2660
 
2629
2661
  # now find the members of the collection
2630
2662
  member_list = []
2631
- members = await self._async_get_collection_members(root_collection_guid)
2632
- if type(members) is str:
2633
- return False
2663
+ members = await self._async_get_collection_members(
2664
+ collection_guid, collection_name, collection_qname
2665
+ )
2666
+ if (type(members) is str) or (len(members) == 0):
2667
+ return "No members found"
2634
2668
  # finally, construct a list of member information
2635
2669
  for member_rel in members:
2636
2670
  member_guid = member_rel["elementHeader"]["guid"]
2637
2671
  member_resp = await self._async_get_collection(member_guid)
2638
- member = member_resp["element"]
2672
+ member = member_resp.get("element", None)
2673
+ if member is None:
2674
+ continue
2639
2675
  # print(json.dumps(member, indent = 4))
2676
+
2640
2677
  member_instance = {
2641
2678
  "name": member["properties"]["name"],
2642
2679
  "qualifiedName": member["properties"]["qualifiedName"],
@@ -2646,18 +2683,26 @@ class CollectionManager(Client):
2646
2683
  }
2647
2684
  member_list.append(member_instance)
2648
2685
 
2649
- return member_list
2686
+ return member_list if len(member_list) > 0 else "No members found"
2650
2687
 
2651
- def get_member_list(self, root_collection_guid: str) -> list | bool:
2652
- """Get the member list for the collection.
2688
+ def get_member_list(
2689
+ self,
2690
+ collection_guid: str = None,
2691
+ collection_name: str = None,
2692
+ collection_qname: str = None,
2693
+ ) -> list | bool:
2694
+ """Get the member list for the collection - async version.
2653
2695
  Parameters
2654
2696
  ----------
2655
- root_collection_guid : str
2656
- The GUID of the root collection.
2657
-
2658
-
2659
- The name of the server. If not provided, the default server name will be used.
2660
-
2697
+ collection_guid: str,
2698
+ identity of the collection to return members for. If none, collection_name or
2699
+ collection_qname are used.
2700
+ collection_name: str,
2701
+ display name of the collection to return members for. If none, collection_guid
2702
+ or collection_qname are used.
2703
+ collection_qname: str,
2704
+ qualified name of the collection to return members for. If none, collection_guid
2705
+ or collection_name are used.
2661
2706
  Returns
2662
2707
  -------
2663
2708
  list | bool
@@ -2671,7 +2716,9 @@ class CollectionManager(Client):
2671
2716
  """
2672
2717
  loop = asyncio.get_event_loop()
2673
2718
  resp = loop.run_until_complete(
2674
- self._async_get_member_list(root_collection_guid)
2719
+ self._async_get_member_list(
2720
+ collection_guid, collection_name, collection_qname
2721
+ )
2675
2722
  )
2676
2723
  return resp
2677
2724
 
@@ -2,7 +2,8 @@
2
2
  <!-- Copyright Contributors to the Egeria project. -->
3
3
 
4
4
  The Commands in this directory provide a simple but useful command line interface for the Egeria environment. They
5
- are built with the **Rich** python package and demonstrate the use of **pyegeria** .
5
+ are built with the **Rich** python package and demonstrate the use of **pyegeria**. More detailed documentation can be
6
+ found in the `doc` folder.
6
7
 
7
8
  The commands can either be invoked from one of the command line interfaces or executed directly as python scripts.
8
9
  To invoke the commands directly, install them with pipx by invoking:
@@ -1,5 +1 @@
1
- # from .list_glossaries import display_glossaries
2
- # from .list_terms import display_glossary_terms
3
- # from .list_deployed_catalogs import list_deployed_catalogs
4
- # from .list_deployed_database_schemas import list_deployed_database_schemas
5
- # from .list_deployed_databases import list_deployed_databases
1
+ """ Placeholder """
@@ -0,0 +1,156 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ SPDX-License-Identifier: Apache-2.0
4
+ Copyright Contributors to the ODPi Egeria project.
5
+
6
+ Unit tests for the Utils helper functions using the Pytest framework.
7
+
8
+
9
+ A simple display for glossary terms
10
+ """
11
+ import argparse
12
+ import os
13
+ import sys
14
+ import time
15
+
16
+ from rich import box, print
17
+ from rich.console import Console
18
+ from rich.markdown import Markdown
19
+ from rich.prompt import Prompt
20
+ from rich.table import Table
21
+ from rich.text import Text
22
+ from rich_pixels import Pixels
23
+
24
+
25
+ from pyegeria import (
26
+ InvalidParameterException,
27
+ PropertyServerException,
28
+ UserNotAuthorizedException,
29
+ EgeriaTech,
30
+ print_exception_response,
31
+ )
32
+
33
+ disable_ssl_warnings = True
34
+
35
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
36
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
37
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
38
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
39
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
40
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
41
+ )
42
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
43
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
44
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
45
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
46
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
47
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
48
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
49
+
50
+
51
+ def display_glossaries(
52
+ search_string: str = "*",
53
+ view_server: str = EGERIA_VIEW_SERVER,
54
+ view_url: str = EGERIA_VIEW_SERVER_URL,
55
+ user: str = EGERIA_USER,
56
+ user_pass: str = EGERIA_USER_PASSWORD,
57
+ jupyter: bool = EGERIA_JUPYTER,
58
+ width: int = EGERIA_WIDTH,
59
+ ):
60
+ """Display either a specified glossary or all glossaries if the search_string is '*'.
61
+ Parameters
62
+ ----------
63
+ search_string : str, default is '*'
64
+ The string used to search for glossaries.
65
+ view_server : str
66
+ The view server name or address where the Egeria services are hosted.
67
+ view_url : str
68
+ The URL of the platform the view server is on.
69
+ user : str
70
+ The user ID for authentication with the Egeria server.
71
+ user_pass : str
72
+ The password for authentication with the Egeria server.
73
+ jupyter : bool, optional
74
+ A boolean indicating whether the output is intended for a Jupyter notebook (default is EGERIA_JUPYTER).
75
+ width : int, optional
76
+ The width of the console output (default is EGERIA_WIDTH).
77
+ """
78
+ m_client = EgeriaTech(view_server, view_url, user_id=user, user_pwd=user_pass)
79
+ token = m_client.create_egeria_bearer_token()
80
+ try:
81
+ table = Table(
82
+ title=f"Glossary List @ {time.asctime()}",
83
+ style="bright_white on black",
84
+ header_style="bright_white on dark_blue",
85
+ title_style="bold white on black",
86
+ caption_style="white on black",
87
+ show_lines=True,
88
+ box=box.ROUNDED,
89
+ caption=f"View Server '{view_server}' @ Platform - {view_url}",
90
+ expand=True,
91
+ )
92
+ table.add_column("Glossary Name")
93
+ table.add_column(
94
+ "Qualified Name & GUID", width=38, no_wrap=True, justify="center"
95
+ )
96
+ table.add_column("Language")
97
+
98
+ table.add_column("Usage", width=50, justify="center")
99
+
100
+ glossaries = m_client.find_glossaries(search_string)
101
+ if type(glossaries) is list:
102
+ sorted_glossary_list = sorted(
103
+ glossaries, key=lambda k: k["glossaryProperties"]["displayName"]
104
+ )
105
+ for glossary in sorted_glossary_list:
106
+ display_name = glossary["glossaryProperties"]["displayName"]
107
+ qualified_name = glossary["glossaryProperties"]["qualifiedName"]
108
+ guid = glossary["elementHeader"]["guid"]
109
+ q_name = Text(f"{qualified_name}\n&\n{guid}", justify="center")
110
+ language = glossary["glossaryProperties"]["language"]
111
+ description = glossary["glossaryProperties"]["description"]
112
+ usage = glossary["glossaryProperties"]["usage"]
113
+ text = "http://100.83.199.62:8088/superset/dashboard/p/xOgE56dLNaY/"
114
+
115
+ table.add_row(display_name, q_name, language, text)
116
+ console = Console(
117
+ style="bold bright_white on black",
118
+ width=width,
119
+ force_terminal=not jupyter,
120
+ )
121
+ console.print(table)
122
+ print("Visit my [link=https://www.willmcgugan.com]blog[/link]!")
123
+
124
+ except (InvalidParameterException, PropertyServerException) as e:
125
+ print_exception_response(e)
126
+ finally:
127
+ m_client.close_session()
128
+
129
+
130
+ def main():
131
+ parser = argparse.ArgumentParser()
132
+ parser.add_argument("--server", help="Name of the server to display status for")
133
+ parser.add_argument("--url", help="URL Platform to connect to")
134
+ parser.add_argument("--userid", help="User Id")
135
+ parser.add_argument("--password", help="User Password")
136
+
137
+ args = parser.parse_args()
138
+
139
+ server = args.server if args.server is not None else EGERIA_VIEW_SERVER
140
+ url = args.url if args.url is not None else EGERIA_PLATFORM_URL
141
+ userid = args.userid if args.userid is not None else EGERIA_USER
142
+ user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
143
+
144
+ try:
145
+ search_string = Prompt.ask(
146
+ "Enter the glossary you are searching for or '*' for all:", default="*"
147
+ )
148
+
149
+ display_glossaries(search_string, server, url, userid, user_pass)
150
+
151
+ except KeyboardInterrupt:
152
+ pass
153
+
154
+
155
+ if __name__ == "__main__":
156
+ main()
@@ -54,11 +54,17 @@ def collection_viewer(
54
54
  """A simple collection viewer"""
55
55
 
56
56
  def walk_collection_hierarchy(
57
- collection_client: CollectionManager, root_collection_name: str, tree: Tree
57
+ tree: Tree,
58
+ collection_client: CollectionManager,
59
+ root_collection_guid: str = None,
60
+ root_collection_name: str = None,
61
+ root_collection_qname: str = None,
58
62
  ) -> None:
59
63
  """Recursively build a Tree with collection contents."""
60
- members = collection_client.get_member_list(root_collection_name)
61
- if members:
64
+ members = collection_client.get_member_list(
65
+ root_collection_guid, root_collection_name, root_collection_qname
66
+ )
67
+ if type(members) is list:
62
68
  for member in members:
63
69
  style = "bold white on black"
64
70
  text_collection_name = Text(
@@ -78,29 +84,27 @@ def collection_viewer(
78
84
  )
79
85
  tt = tree.add(p, style=style)
80
86
 
81
- children = collection_client.get_collection_members(member["guid"])
87
+ children = collection_client.get_collection_members(
88
+ collection_guid=member["guid"]
89
+ )
82
90
  if type(children) is list:
83
91
  branch = tt.add(
84
92
  f"[bold magenta on black]Members",
85
93
  style=style,
86
94
  guide_style=style,
87
95
  )
88
- walk_collection_hierarchy(
89
- collection_client, member["qualifiedName"], branch
90
- ),
96
+ walk_collection_hierarchy(branch, collection_client, member["guid"])
91
97
  else:
92
98
  tt = tree.add(
93
- f"[bold magenta on black]No collections match {root_collection_name}"
99
+ f"[bold magenta on black]No collections found in {root_collection_name}"
94
100
  )
95
101
 
96
102
  try:
97
- tree = Tree(
98
- f"[bold bright green on black]{root}", guide_style="bold bright_blue"
99
- )
103
+ tree = Tree(f"[bold bright green]{root}", guide_style="bold bright_blue")
100
104
  c_client = CollectionManager(server_name, platform_url, user_id=user)
101
105
 
102
106
  token = c_client.create_egeria_bearer_token(user, user_password)
103
- walk_collection_hierarchy(c_client, root, tree)
107
+ walk_collection_hierarchy(tree, c_client, None, root)
104
108
  print(tree)
105
109
 
106
110
  except (
@@ -108,7 +112,12 @@ def collection_viewer(
108
112
  PropertyServerException,
109
113
  UserNotAuthorizedException,
110
114
  ) as e:
111
- print_exception_response(e)
115
+ if e.exception_error_message_parameters[1] == "No elements found":
116
+ print("The collection was not found.")
117
+ else:
118
+ print_exception_response(e)
119
+ finally:
120
+ c_client.close_session()
112
121
 
113
122
 
114
123
  def main():
@@ -128,7 +137,7 @@ def main():
128
137
  try:
129
138
  root_collection = Prompt.ask(
130
139
  "Enter the Root Collection to start from:",
131
- default="Root Sustainability Collection",
140
+ default="Digital Products Root",
132
141
  )
133
142
  collection_viewer(root_collection, server, url, userid, user_pass)
134
143
  except KeyboardInterrupt:
@@ -163,7 +163,7 @@ def main():
163
163
  user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
164
164
  try:
165
165
  tech_name = Prompt.ask(
166
- "Enter the Asset Name to view:", default="Apache Kafka Server"
166
+ "Enter the Asset Name to view:", default="PostgreSQL Server"
167
167
  )
168
168
  tech_viewer(tech_name, server, url, userid, user_pass)
169
169
  except KeyboardInterrupt: