pyegeria 5.2__py3-none-any.whl → 5.2.0.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/__init__.py +0 -2
- pyegeria/_client.py +2 -7
- pyegeria/asset_catalog_omvs.py +0 -34
- pyegeria/classification_manager_omvs.py +3 -2
- pyegeria/collection_manager_omvs.py +45 -92
- pyegeria/commands/README.md +1 -2
- pyegeria/commands/cat/__init__.py +5 -1
- pyegeria/commands/cat/get_collection.py +14 -23
- pyegeria/commands/cat/get_tech_type_elements.py +1 -1
- pyegeria/commands/cat/glossary_actions.py +8 -28
- pyegeria/commands/cat/list_assets.py +17 -8
- pyegeria/commands/cat/list_collections.py +5 -10
- pyegeria/commands/cat/list_deployed_catalogs.py +2 -4
- pyegeria/commands/cat/list_deployed_database_schemas.py +14 -8
- pyegeria/commands/cat/list_deployed_databases.py +3 -2
- pyegeria/commands/cat/list_tech_types.py +24 -36
- pyegeria/commands/cat/list_terms.py +2 -4
- pyegeria/commands/cli/egeria.py +117 -106
- pyegeria/commands/cli/egeria_cat.py +54 -53
- pyegeria/commands/cli/egeria_my.py +33 -25
- pyegeria/commands/cli/egeria_ops.py +40 -38
- pyegeria/commands/cli/egeria_tech.py +41 -55
- pyegeria/commands/cli/ops_config.py +1 -3
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-11-20 at 16.17.43@2x.png +0 -0
- pyegeria/commands/doc/{README.md → command-overview.md} +5 -50
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/{README.md → hey_egeria: overview.md } +1 -1
- pyegeria/commands/my/monitor_my_todos.py +5 -17
- pyegeria/commands/my/monitor_open_todos.py +1 -1
- pyegeria/commands/ops/monitor_asset_events.py +22 -27
- pyegeria/commands/ops/monitor_engine_activity_c.py +1 -1
- pyegeria/commands/ops/monitor_gov_eng_status.py +4 -31
- pyegeria/commands/ops/monitor_integ_daemon_status.py +14 -17
- pyegeria/commands/ops/monitor_platform_status.py +1 -1
- pyegeria/commands/ops/orig_monitor_server_status.py +21 -36
- pyegeria/commands/ops/refresh_integration_daemon.py +1 -1
- pyegeria/commands/ops/restart_integration_daemon.py +1 -1
- pyegeria/commands/tech/get_tech_details.py +42 -79
- pyegeria/commands/tech/get_tech_type_template.py +53 -69
- pyegeria/commands/tech/list_anchored_elements.py +15 -18
- pyegeria/commands/tech/list_elements_x.py +4 -7
- pyegeria/commands/tech/list_registered_services.py +1 -1
- pyegeria/commands/tech/list_relationship_types.py +21 -19
- pyegeria/commands/tech/list_relationships.py +3 -7
- pyegeria/commands/tech/table_tech_templates.py +1 -3
- pyegeria/create_tech_guid_lists.py +2 -2
- pyegeria/egeria_client.py +0 -2
- pyegeria/egeria_tech_client.py +0 -5
- pyegeria/glossary_manager_omvs.py +7 -101
- pyegeria/server_operations.py +4 -4
- pyegeria/template_manager_omvs.py +3 -1
- pyegeria/valid_metadata_omvs.py +1 -1
- {pyegeria-5.2.dist-info → pyegeria-5.2.0.1.dist-info}/METADATA +5 -3
- pyegeria-5.2.0.1.dist-info/RECORD +176 -0
- {pyegeria-5.2.dist-info → pyegeria-5.2.0.1.dist-info}/entry_points.txt +0 -2
- pyegeria/commands/cat/list_tech_type_elements.py +0 -190
- pyegeria/commands/cli/egeria_login_tui.py +0 -313
- pyegeria/commands/cli/txt_custom_v2.tcss +0 -19
- pyegeria/commands/doc/Visual Command Reference/README.md +0 -511
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-11-25 at 20.14.50@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-12-17 at 15.48.38@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-11-25 at 20.21.25@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-12-17 at 15.52.16@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed_databases 2024-12-16 at 16.40.31@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-glossaries 2024-11-25 at 20.30.02.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-terms 2024-11-25 at 20.32.11.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/asset-types 2024-11-25 at 20.34.19@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/certification-types 2024-11-25 at 20.37.07.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/collection-graph 2024-12-12 at 11.33.18@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-collections 2024-12-10 at 14.25.51@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-todos 2024-12-12 at 11.46.30@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-user-ids 2024-12-12 at 11.51.09@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/tech-types 2024-12-12 at 11.37.20@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_dependencies 2024-12-14 at 16.24.39@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_structure 2024-12-14 at 16.21.35@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/projects/projects 2024-12-14 at 16.18.10@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/hey_egeria tui 2024-12-16 at 16.58.22@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/my/show/my_profile 2024-12-14 at 16.29.27@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/my/show/my_roles 2024-12-14 at 16.32.10@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/my/show/my_todos 2024-12-15 at 16.24.13@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/my/show/open_todos 2024-12-14 at 16.36.12@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/engines/list_engine_activity compressed 2024-12-15 at 16.48.48@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity 2024-12-15 at 16.32.55@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity compressed 2024-12-15 at 16.38.29@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_status 2024-12-15 at 16.51.26.jpeg +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_daemon_status 2024-12-15 at 16.57.12@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_targets 2024-12-15 at 17.02.19@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/platforms/monitor_platform_status 2024-12-15 at 19.53.18@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status 2024-12-15 at 19.59.39@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status full 2024-12-15 at 20.01.57@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_startup_servers 2024-12-15 at 19.56.07@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_anchored_elements 2024-12-15 at 21.25.41@2x.png +0 -0
- 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
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/info_for_guid 2024-12-16 at 11.35.29@2x.png +0 -0
- 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
- 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
- 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
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/related_elements 2024-12-16 at 14.55.01@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/show_related_specifications 2024-12-16 at 15.04.55@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/asset_types 2024-12-16 at 15.10.16@2x.png +0 -0
- 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
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/governance_action_processes 2024-12-16 at 15.13.01@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/registered_services 2024-12-16 at 16.44.54@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-16 at 16.20.34@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-19 at 10.51.54@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/valid_metadata_values 2024-12-16 at 15.31.56@2x.png +0 -0
- 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
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_technology_types 2024-12-16 at 15.39.20@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_details 2024-12-16 at 15.37.21@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_templates 2024-12-16 at 16.11.48@2x.png +0 -0
- pyegeria/metadata_explorer_omvs.py +0 -2371
- pyegeria-5.2.dist-info/RECORD +0 -232
- /pyegeria/commands/doc/Visual Command Reference/cat/show/assets/{asset-graph 2024-11-20 at 15.56.42.png → Asset-graph 2024-11-20 at 15.56.42.png} +0 -0
- /pyegeria/commands/doc/Visual Command Reference/cat/show/assets/{assets-in-domain 2024-11-20 at 15.49.55@2x.png → Assets-in-domain 2024-11-20 at 15.49.55@2x.png} +0 -0
- /pyegeria/commands/doc/Visual Command Reference/cat/show/{deployed-data/deployed-data-catalogs-2024-11-20 at 16.17.43@2x.png → assets/deployed-catalogs 2024-11-20 at 16.17.43@2x.png} +0 -0
- {pyegeria-5.2.dist-info → pyegeria-5.2.0.1.dist-info}/LICENSE +0 -0
- {pyegeria-5.2.dist-info → pyegeria-5.2.0.1.dist-info}/WHEEL +0 -0
pyegeria/__init__.py
CHANGED
@@ -67,7 +67,6 @@ 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
|
71
70
|
from .mermaid_utilities import load_mermaid, render_mermaid, generate_process_graph
|
72
71
|
from .egeria_my_client import EgeriaMy
|
73
72
|
from .egeria_cat_client import EgeriaCat
|
@@ -75,7 +74,6 @@ from .egeria_tech_client import EgeriaTech
|
|
75
74
|
from .egeria_config_client import EgeriaConfig
|
76
75
|
from .egeria_client import Egeria
|
77
76
|
|
78
|
-
|
79
77
|
#
|
80
78
|
# The following assignments were generated by the `create_tech_guid_lists.py` utility that uses the pyegeria functions
|
81
79
|
# to interrogate Egeria (and the Core Content Pack) for the GUIDS associates with integration connectors and templates.
|
pyegeria/_client.py
CHANGED
@@ -693,11 +693,6 @@ 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
|
-
|
701
696
|
if (not qualified_name) and display_name:
|
702
697
|
if (tech_type) and (property_name == "qualifiedName"):
|
703
698
|
name = f"{tech_type}:{display_name}"
|
@@ -710,7 +705,7 @@ class Client:
|
|
710
705
|
"effectiveTime": None,
|
711
706
|
}
|
712
707
|
url = (
|
713
|
-
f"{self.platform_url}/servers/{view_server}/api/open-metadata/classification-manager/"
|
708
|
+
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/"
|
714
709
|
f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
|
715
710
|
)
|
716
711
|
|
@@ -726,7 +721,7 @@ class Client:
|
|
726
721
|
"effectiveTime": None,
|
727
722
|
}
|
728
723
|
url = (
|
729
|
-
f"{self.platform_url}/servers/{view_server}/api/open-metadata/classification-manager/"
|
724
|
+
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/"
|
730
725
|
f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
|
731
726
|
)
|
732
727
|
|
pyegeria/asset_catalog_omvs.py
CHANGED
@@ -506,40 +506,6 @@ 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
|
-
|
543
509
|
async def _async_get_asset_lineage_graph(
|
544
510
|
self,
|
545
511
|
asset_guid: str,
|
@@ -1,7 +1,8 @@
|
|
1
1
|
"""PDX-License-Identifier: Apache-2.0
|
2
2
|
Copyright Contributors to the ODPi Egeria project.
|
3
3
|
|
4
|
-
This module
|
4
|
+
This module contains an initial version of the classification_manager_omvs
|
5
|
+
module.
|
5
6
|
|
6
7
|
"""
|
7
8
|
|
@@ -70,7 +71,7 @@ class ClassificationManager(Client):
|
|
70
71
|
self.platform_url = platform_url
|
71
72
|
self.user_id = user_id
|
72
73
|
self.user_pwd = user_pwd
|
73
|
-
self.classification_command_root: str = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/
|
74
|
+
self.classification_command_root: str = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/runtime-manager"
|
74
75
|
Client.__init__(
|
75
76
|
self,
|
76
77
|
view_server,
|
@@ -2179,9 +2179,7 @@ class CollectionManager(Client):
|
|
2179
2179
|
|
2180
2180
|
async def _async_get_collection_members(
|
2181
2181
|
self,
|
2182
|
-
collection_guid: str
|
2183
|
-
collection_name: str = None,
|
2184
|
-
collection_qname: str = None,
|
2182
|
+
collection_guid: str,
|
2185
2183
|
effective_time: str = None,
|
2186
2184
|
start_from: int = 0,
|
2187
2185
|
page_size: int = None,
|
@@ -2191,16 +2189,12 @@ class CollectionManager(Client):
|
|
2191
2189
|
Parameters
|
2192
2190
|
----------
|
2193
2191
|
collection_guid: str,
|
2194
|
-
identity of the collection to return members for.
|
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.
|
2192
|
+
identity of the collection to return members for.
|
2202
2193
|
effective_time: str, [default=None], optional
|
2203
2194
|
Effective time of the query. If not specified will default to any time.
|
2195
|
+
|
2196
|
+
|
2197
|
+
|
2204
2198
|
start_from: int, [default=0], optional
|
2205
2199
|
When multiple pages of results are available, the page number to start from.
|
2206
2200
|
page_size: int, [default=None]
|
@@ -2226,13 +2220,7 @@ class CollectionManager(Client):
|
|
2226
2220
|
|
2227
2221
|
if page_size is None:
|
2228
2222
|
page_size = self.page_size
|
2229
|
-
|
2230
|
-
collection_guid,
|
2231
|
-
collection_name,
|
2232
|
-
"name",
|
2233
|
-
collection_qname,
|
2234
|
-
None,
|
2235
|
-
)
|
2223
|
+
|
2236
2224
|
url = (
|
2237
2225
|
f"{self.collection_command_root}/{collection_guid}/"
|
2238
2226
|
f"members?startFrom={start_from}&pageSize={page_size}"
|
@@ -2243,33 +2231,27 @@ class CollectionManager(Client):
|
|
2243
2231
|
|
2244
2232
|
def get_collection_members(
|
2245
2233
|
self,
|
2246
|
-
collection_guid: str
|
2247
|
-
collection_name: str = None,
|
2248
|
-
collection_qname: str = None,
|
2234
|
+
collection_guid: str,
|
2249
2235
|
effective_time: str = None,
|
2250
2236
|
start_from: int = 0,
|
2251
2237
|
page_size: int = None,
|
2252
2238
|
) -> list | str:
|
2253
|
-
"""Return a list of elements that are a member of a collection.
|
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
|
+
|
2254
2248
|
|
2255
|
-
|
2256
|
-
|
2257
|
-
|
2258
|
-
|
2259
|
-
|
2260
|
-
|
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.
|
2249
|
+
|
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.
|
2273
2255
|
Returns
|
2274
2256
|
-------
|
2275
2257
|
List | str
|
@@ -2290,12 +2272,7 @@ class CollectionManager(Client):
|
|
2290
2272
|
loop = asyncio.get_event_loop()
|
2291
2273
|
resp = loop.run_until_complete(
|
2292
2274
|
self._async_get_collection_members(
|
2293
|
-
collection_guid,
|
2294
|
-
collection_name,
|
2295
|
-
collection_qname,
|
2296
|
-
effective_time,
|
2297
|
-
start_from,
|
2298
|
-
page_size,
|
2275
|
+
collection_guid, effective_time, start_from, page_size
|
2299
2276
|
)
|
2300
2277
|
)
|
2301
2278
|
|
@@ -2625,29 +2602,20 @@ class CollectionManager(Client):
|
|
2625
2602
|
)
|
2626
2603
|
return
|
2627
2604
|
|
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:
|
2605
|
+
async def _async_get_member_list(self, root_collection_guid: str) -> list | bool:
|
2634
2606
|
"""Get the member list for the collection - async version.
|
2635
2607
|
Parameters
|
2636
2608
|
----------
|
2637
|
-
|
2638
|
-
|
2639
|
-
|
2640
|
-
|
2641
|
-
|
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.
|
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.
|
2646
2614
|
|
2647
2615
|
Returns
|
2648
2616
|
-------
|
2649
|
-
list |
|
2650
|
-
The list of member information if successful, otherwise
|
2617
|
+
list | bool
|
2618
|
+
The list of member information if successful, otherwise False.
|
2651
2619
|
|
2652
2620
|
Raises
|
2653
2621
|
------
|
@@ -2660,20 +2628,15 @@ class CollectionManager(Client):
|
|
2660
2628
|
|
2661
2629
|
# now find the members of the collection
|
2662
2630
|
member_list = []
|
2663
|
-
members = await self._async_get_collection_members(
|
2664
|
-
|
2665
|
-
|
2666
|
-
if (type(members) is str) or (len(members) == 0):
|
2667
|
-
return "No members found"
|
2631
|
+
members = await self._async_get_collection_members(root_collection_guid)
|
2632
|
+
if type(members) is str:
|
2633
|
+
return False
|
2668
2634
|
# finally, construct a list of member information
|
2669
2635
|
for member_rel in members:
|
2670
2636
|
member_guid = member_rel["elementHeader"]["guid"]
|
2671
2637
|
member_resp = await self._async_get_collection(member_guid)
|
2672
|
-
member = member_resp
|
2673
|
-
if member is None:
|
2674
|
-
continue
|
2638
|
+
member = member_resp["element"]
|
2675
2639
|
# print(json.dumps(member, indent = 4))
|
2676
|
-
|
2677
2640
|
member_instance = {
|
2678
2641
|
"name": member["properties"]["name"],
|
2679
2642
|
"qualifiedName": member["properties"]["qualifiedName"],
|
@@ -2683,26 +2646,18 @@ class CollectionManager(Client):
|
|
2683
2646
|
}
|
2684
2647
|
member_list.append(member_instance)
|
2685
2648
|
|
2686
|
-
return member_list
|
2649
|
+
return member_list
|
2687
2650
|
|
2688
|
-
def get_member_list(
|
2689
|
-
|
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.
|
2651
|
+
def get_member_list(self, root_collection_guid: str) -> list | bool:
|
2652
|
+
"""Get the member list for the collection.
|
2695
2653
|
Parameters
|
2696
2654
|
----------
|
2697
|
-
|
2698
|
-
|
2699
|
-
|
2700
|
-
|
2701
|
-
|
2702
|
-
|
2703
|
-
collection_qname: str,
|
2704
|
-
qualified name of the collection to return members for. If none, collection_guid
|
2705
|
-
or collection_name are used.
|
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
|
+
|
2706
2661
|
Returns
|
2707
2662
|
-------
|
2708
2663
|
list | bool
|
@@ -2716,9 +2671,7 @@ class CollectionManager(Client):
|
|
2716
2671
|
"""
|
2717
2672
|
loop = asyncio.get_event_loop()
|
2718
2673
|
resp = loop.run_until_complete(
|
2719
|
-
self._async_get_member_list(
|
2720
|
-
collection_guid, collection_name, collection_qname
|
2721
|
-
)
|
2674
|
+
self._async_get_member_list(root_collection_guid)
|
2722
2675
|
)
|
2723
2676
|
return resp
|
2724
2677
|
|
pyegeria/commands/README.md
CHANGED
@@ -2,8 +2,7 @@
|
|
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
|
6
|
-
found in the `doc` folder.
|
5
|
+
are built with the **Rich** python package and demonstrate the use of **pyegeria** .
|
7
6
|
|
8
7
|
The commands can either be invoked from one of the command line interfaces or executed directly as python scripts.
|
9
8
|
To invoke the commands directly, install them with pipx by invoking:
|
@@ -1 +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
|
@@ -54,17 +54,11 @@ def collection_viewer(
|
|
54
54
|
"""A simple collection viewer"""
|
55
55
|
|
56
56
|
def walk_collection_hierarchy(
|
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,
|
57
|
+
collection_client: CollectionManager, root_collection_name: str, tree: Tree
|
62
58
|
) -> None:
|
63
59
|
"""Recursively build a Tree with collection contents."""
|
64
|
-
members = collection_client.get_member_list(
|
65
|
-
|
66
|
-
)
|
67
|
-
if type(members) is list:
|
60
|
+
members = collection_client.get_member_list(root_collection_name)
|
61
|
+
if members:
|
68
62
|
for member in members:
|
69
63
|
style = "bold white on black"
|
70
64
|
text_collection_name = Text(
|
@@ -84,27 +78,29 @@ def collection_viewer(
|
|
84
78
|
)
|
85
79
|
tt = tree.add(p, style=style)
|
86
80
|
|
87
|
-
children = collection_client.get_collection_members(
|
88
|
-
collection_guid=member["guid"]
|
89
|
-
)
|
81
|
+
children = collection_client.get_collection_members(member["guid"])
|
90
82
|
if type(children) is list:
|
91
83
|
branch = tt.add(
|
92
84
|
f"[bold magenta on black]Members",
|
93
85
|
style=style,
|
94
86
|
guide_style=style,
|
95
87
|
)
|
96
|
-
walk_collection_hierarchy(
|
88
|
+
walk_collection_hierarchy(
|
89
|
+
collection_client, member["qualifiedName"], branch
|
90
|
+
),
|
97
91
|
else:
|
98
92
|
tt = tree.add(
|
99
|
-
f"[bold magenta on black]No collections
|
93
|
+
f"[bold magenta on black]No collections match {root_collection_name}"
|
100
94
|
)
|
101
95
|
|
102
96
|
try:
|
103
|
-
tree = Tree(
|
97
|
+
tree = Tree(
|
98
|
+
f"[bold bright green on black]{root}", guide_style="bold bright_blue"
|
99
|
+
)
|
104
100
|
c_client = CollectionManager(server_name, platform_url, user_id=user)
|
105
101
|
|
106
102
|
token = c_client.create_egeria_bearer_token(user, user_password)
|
107
|
-
walk_collection_hierarchy(
|
103
|
+
walk_collection_hierarchy(c_client, root, tree)
|
108
104
|
print(tree)
|
109
105
|
|
110
106
|
except (
|
@@ -112,12 +108,7 @@ def collection_viewer(
|
|
112
108
|
PropertyServerException,
|
113
109
|
UserNotAuthorizedException,
|
114
110
|
) as e:
|
115
|
-
|
116
|
-
print("The collection was not found.")
|
117
|
-
else:
|
118
|
-
print_exception_response(e)
|
119
|
-
finally:
|
120
|
-
c_client.close_session()
|
111
|
+
print_exception_response(e)
|
121
112
|
|
122
113
|
|
123
114
|
def main():
|
@@ -137,7 +128,7 @@ def main():
|
|
137
128
|
try:
|
138
129
|
root_collection = Prompt.ask(
|
139
130
|
"Enter the Root Collection to start from:",
|
140
|
-
default="
|
131
|
+
default="Root Sustainability Collection",
|
141
132
|
)
|
142
133
|
collection_viewer(root_collection, server, url, userid, user_pass)
|
143
134
|
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="
|
166
|
+
"Enter the Asset Name to view:", default="Apache Kafka Server"
|
167
167
|
)
|
168
168
|
tech_viewer(tech_name, server, url, userid, user_pass)
|
169
169
|
except KeyboardInterrupt:
|
@@ -47,8 +47,6 @@ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
|
47
47
|
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
48
48
|
EGERIA_WIDTH = os.environ.get("EGERIA_WIDTH", 200)
|
49
49
|
EGERIA_JUPYTER = os.environ.get("EGERIA_JUPYTER", False)
|
50
|
-
EGERIA_HOME_GLOSSARY_GUID = os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None)
|
51
|
-
EGERIA_GLOSSARY_PATH = os.environ.get("EGERIA_GLOSSARY_PATH", None)
|
52
50
|
|
53
51
|
|
54
52
|
@click.command("create-glossary")
|
@@ -127,7 +125,7 @@ def create_glossary(
|
|
127
125
|
@click.option("--userid", default=EGERIA_USER, help="Egeria user")
|
128
126
|
@click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
|
129
127
|
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
130
|
-
@click.argument("glossary-guid"
|
128
|
+
@click.argument("glossary-guid")
|
131
129
|
def delete_glossary(server, url, userid, password, timeout, glossary_guid):
|
132
130
|
"""Delete the glossary specified"""
|
133
131
|
m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
|
@@ -266,11 +264,8 @@ def delete_term(server, url, userid, password, timeout, term_guid):
|
|
266
264
|
|
267
265
|
|
268
266
|
@click.command("import-terms")
|
269
|
-
@click.option("--
|
270
|
-
@click.option("--
|
271
|
-
@click.option(
|
272
|
-
"--file_path", help="Path of CSV file", default=EGERIA_GLOSSARY_PATH, required=False
|
273
|
-
)
|
267
|
+
@click.option("--glossary-name", help="Name of Glossary", required=True)
|
268
|
+
@click.option("--file-name", help="Path of CSV file", required=True)
|
274
269
|
@click.option(
|
275
270
|
"--verbose",
|
276
271
|
is_flag=True,
|
@@ -292,7 +287,6 @@ def delete_term(server, url, userid, password, timeout, term_guid):
|
|
292
287
|
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
293
288
|
def import_terms(
|
294
289
|
glossary_name: str,
|
295
|
-
file_path: str,
|
296
290
|
file_name: str,
|
297
291
|
verbose: bool,
|
298
292
|
upsert: bool,
|
@@ -307,11 +301,7 @@ def import_terms(
|
|
307
301
|
token = m_client.create_egeria_bearer_token()
|
308
302
|
try:
|
309
303
|
result = m_client.load_terms_from_file(
|
310
|
-
glossary_name,
|
311
|
-
file_name,
|
312
|
-
file_path=file_path,
|
313
|
-
upsert=upsert,
|
314
|
-
verbose=verbose,
|
304
|
+
glossary_name, file_name, upsert=upsert, verbose=verbose
|
315
305
|
)
|
316
306
|
|
317
307
|
click.echo(
|
@@ -327,16 +317,8 @@ def import_terms(
|
|
327
317
|
|
328
318
|
|
329
319
|
@click.command("export-terms")
|
330
|
-
@click.option(
|
331
|
-
|
332
|
-
default=EGERIA_HOME_GLOSSARY_GUID,
|
333
|
-
help="GUID of Glossary to export",
|
334
|
-
required=True,
|
335
|
-
)
|
336
|
-
@click.option("--file_name", help="Path of CSV file", required=True)
|
337
|
-
@click.option(
|
338
|
-
"--file_path", help="Path of CSV file", default=EGERIA_GLOSSARY_PATH, required=False
|
339
|
-
)
|
320
|
+
@click.option("--glossary-guid", help="GUID of Glossary to export", required=True)
|
321
|
+
@click.option("--file-name", help="Path of CSV file", required=True)
|
340
322
|
@click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
|
341
323
|
@click.option(
|
342
324
|
"--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
@@ -344,14 +326,12 @@ def import_terms(
|
|
344
326
|
@click.option("--userid", default=EGERIA_USER, help="Egeria user")
|
345
327
|
@click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
|
346
328
|
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
347
|
-
def export_terms(
|
348
|
-
glossary_guid: str, file_name, file_path, server, url, userid, password, timeout
|
349
|
-
):
|
329
|
+
def export_terms(glossary_guid: str, file_name, server, url, userid, password, timeout):
|
350
330
|
"""Export the glossary specified"""
|
351
331
|
m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
|
352
332
|
token = m_client.create_egeria_bearer_token()
|
353
333
|
try:
|
354
|
-
result = m_client.export_glossary_to_csv(glossary_guid, file_name
|
334
|
+
result = m_client.export_glossary_to_csv(glossary_guid, file_name)
|
355
335
|
|
356
336
|
click.echo(
|
357
337
|
f"Exported {result} terms from glossary: {glossary_guid} into {file_name}"
|
@@ -3,8 +3,10 @@
|
|
3
3
|
SPDX-License-Identifier: Apache-2.0
|
4
4
|
Copyright Contributors to the ODPi Egeria project.
|
5
5
|
|
6
|
-
|
6
|
+
Unit tests for the Utils helper functions using the Pytest framework.
|
7
7
|
|
8
|
+
|
9
|
+
A simple display for glossary terms
|
8
10
|
"""
|
9
11
|
import argparse
|
10
12
|
import os
|
@@ -16,7 +18,6 @@ from rich.console import Console
|
|
16
18
|
from rich.prompt import Prompt
|
17
19
|
from rich.markdown import Markdown
|
18
20
|
from rich.table import Table
|
19
|
-
from rich.text import Text
|
20
21
|
|
21
22
|
from pyegeria import (
|
22
23
|
InvalidParameterException,
|
@@ -77,8 +78,9 @@ def display_assets(
|
|
77
78
|
caption=f"View Server '{server}' @ Platform - {url}",
|
78
79
|
expand=True,
|
79
80
|
)
|
80
|
-
table.add_column("Display Name
|
81
|
+
table.add_column("Display Name", max_width=15)
|
81
82
|
table.add_column("Type Name")
|
83
|
+
table.add_column("GUID", no_wrap=True)
|
82
84
|
table.add_column("Technology Type")
|
83
85
|
# table.add_column("Qualified Name",max_width=15)
|
84
86
|
table.add_column("Matching Elements")
|
@@ -98,16 +100,23 @@ def display_assets(
|
|
98
100
|
properties = element["properties"]
|
99
101
|
header = element["elementHeader"]
|
100
102
|
nested = element.get("matchingElements", "---")
|
101
|
-
qualified_name = properties["qualifiedName"]
|
102
|
-
display_name = Text(f"{properties.get("displayName", "---")}\n\n{qualified_name}\n\n"
|
103
|
-
f"{header['guid']}", justify="center")
|
104
103
|
|
104
|
+
display_name = properties.get("displayName", "---")
|
105
|
+
# qualified_name = properties["qualifiedName"] # we decided that qualified name wasn't useful
|
105
106
|
type_name = header["type"]["typeName"]
|
106
107
|
tech_type = properties.get("deployedImplementationType", "---")
|
108
|
+
guid = header["guid"]
|
109
|
+
#### We decided that path wasn't useful
|
110
|
+
# path_name = element.get("extendedProperties", None)
|
111
|
+
# if path_name:
|
112
|
+
# path = path_name.get("pathName"," ")
|
113
|
+
# else:
|
114
|
+
# path = " "
|
115
|
+
match_md = ""
|
107
116
|
|
108
117
|
match_tab = Table(expand=True)
|
109
118
|
match_tab.add_column("Type Name")
|
110
|
-
match_tab.add_column("GUID", width=36)
|
119
|
+
match_tab.add_column("GUID", no_wrap=True, width=36)
|
111
120
|
match_tab.add_column("Properties")
|
112
121
|
|
113
122
|
for match_t in nested:
|
@@ -121,7 +130,7 @@ def display_assets(
|
|
121
130
|
match_details_out = Markdown(match_details_md)
|
122
131
|
match_tab.add_row(match_type_name, matching_guid, match_details_out)
|
123
132
|
|
124
|
-
table.add_row(display_name, type_name, tech_type, match_tab)
|
133
|
+
table.add_row(display_name, type_name, guid, tech_type, match_tab)
|
125
134
|
|
126
135
|
g_client.close_session()
|
127
136
|
return table
|
@@ -7,6 +7,7 @@ A simple display for collections
|
|
7
7
|
"""
|
8
8
|
import argparse
|
9
9
|
import os
|
10
|
+
import sys
|
10
11
|
import time
|
11
12
|
|
12
13
|
from rich import box
|
@@ -91,7 +92,7 @@ def display_collections(
|
|
91
92
|
table.add_column("Collection Type")
|
92
93
|
|
93
94
|
collections = m_client.find_collections(
|
94
|
-
search_string
|
95
|
+
search_string, None, False, ends_with=False, ignore_case=True
|
95
96
|
)
|
96
97
|
if type(collections) is list:
|
97
98
|
sorted_collection_list = sorted(
|
@@ -120,14 +121,8 @@ def display_collections(
|
|
120
121
|
force_terminal=not jupyter,
|
121
122
|
)
|
122
123
|
console.print(table)
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
except (
|
127
|
-
InvalidParameterException,
|
128
|
-
UserNotAuthorizedException,
|
129
|
-
PropertyServerException,
|
130
|
-
) as e:
|
124
|
+
|
125
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
131
126
|
print_exception_response(e)
|
132
127
|
finally:
|
133
128
|
m_client.close_session()
|
@@ -150,7 +145,7 @@ def main():
|
|
150
145
|
try:
|
151
146
|
search_string = Prompt.ask(
|
152
147
|
"Enter the collection you are searching for or '*' for all:", default="*"
|
153
|
-
)
|
148
|
+
)
|
154
149
|
|
155
150
|
display_collections(search_string, server, url, userid, user_pass)
|
156
151
|
|
@@ -101,13 +101,11 @@ def list_deployed_catalogs(
|
|
101
101
|
table.add_column("Catalog Schemas")
|
102
102
|
|
103
103
|
if catalog_server in [None, "*"]:
|
104
|
-
cats = c_client.get_elements_by_classification(
|
105
|
-
"Anchors", "DataAccessManager"
|
106
|
-
)
|
104
|
+
cats = c_client.get_elements_by_classification("Anchors", "DataManager")
|
107
105
|
else:
|
108
106
|
server_guid = c_client.get_guid_for_name(catalog_server)
|
109
107
|
cats = c_client.get_elements_by_classification_with_property_value(
|
110
|
-
"Anchors", server_guid, ["anchorGUID"], "
|
108
|
+
"Anchors", server_guid, ["anchorGUID"], "DataManager"
|
111
109
|
)
|
112
110
|
if type(cats) is list:
|
113
111
|
for cat in cats:
|