pyegeria 1.5.1.1.61__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.
- pyegeria/__init__.py +2 -0
- pyegeria/_client.py +7 -2
- pyegeria/asset_catalog_omvs.py +34 -0
- pyegeria/classification_manager_omvs.py +2 -3
- pyegeria/collection_manager_omvs.py +92 -45
- pyegeria/commands/README.md +2 -1
- pyegeria/commands/cat/__init__.py +1 -5
- pyegeria/commands/cat/get_collection.py +23 -14
- pyegeria/commands/cat/get_tech_type_elements.py +1 -1
- pyegeria/commands/cat/glossary_actions.py +28 -8
- pyegeria/commands/cat/list_assets.py +8 -17
- pyegeria/commands/cat/list_cert_types.py +1 -1
- pyegeria/commands/cat/list_collections.py +162 -0
- pyegeria/commands/cat/list_deployed_catalogs.py +6 -3
- pyegeria/commands/cat/list_deployed_database_schemas.py +8 -13
- pyegeria/commands/cat/list_deployed_databases.py +3 -3
- pyegeria/commands/cat/list_tech_type_elements.py +190 -0
- pyegeria/commands/cat/list_tech_types.py +36 -24
- pyegeria/commands/cat/list_terms.py +7 -2
- pyegeria/commands/cli/egeria.py +120 -129
- pyegeria/commands/cli/egeria_cat.py +63 -52
- pyegeria/commands/cli/egeria_login_tui.py +313 -0
- pyegeria/commands/cli/egeria_my.py +25 -33
- pyegeria/commands/cli/egeria_ops.py +38 -40
- pyegeria/commands/cli/egeria_tech.py +55 -41
- pyegeria/commands/cli/ops_config.py +3 -1
- pyegeria/commands/cli/txt_custom_v2.tcss +19 -0
- pyegeria/commands/doc/README.md +145 -0
- pyegeria/commands/doc/Visual Command Reference/README.md +511 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/assets/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 +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/assets/elements-of-type 2024-11-20 at 16.01.35.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/assets/tech-type-elements 2024-11-20 at 16.05.05.png +0 -0
- 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-data-catalogs-2024-11-20 at 16.17.43@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/commands/doc/hey_egeria: a pyegeria command line interface/{hey_egeria: overview.md → README.md } +9 -1
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/CleanShot 2024-11-18 at 21.32.03@2x.png +0 -0
- pyegeria/commands/my/monitor_my_todos.py +17 -5
- pyegeria/commands/my/monitor_open_todos.py +1 -1
- pyegeria/commands/my/todo_actions.py +7 -14
- pyegeria/commands/ops/monitor_asset_events.py +27 -22
- pyegeria/commands/ops/monitor_engine_activity_c.py +1 -1
- pyegeria/commands/ops/monitor_gov_eng_status.py +31 -4
- pyegeria/commands/ops/monitor_integ_daemon_status.py +17 -14
- pyegeria/commands/ops/monitor_platform_status.py +15 -3
- pyegeria/commands/ops/orig_monitor_server_status.py +36 -21
- pyegeria/commands/ops/refresh_integration_daemon.py +1 -1
- pyegeria/commands/ops/restart_integration_daemon.py +1 -1
- pyegeria/commands/ops/x_engine_actions.py +2 -59
- pyegeria/commands/tech/get_tech_details.py +79 -42
- pyegeria/commands/tech/get_tech_type_template.py +69 -53
- pyegeria/commands/tech/{list_element_graph.py → list_anchored_elements.py} +20 -17
- pyegeria/commands/tech/list_elements_x.py +7 -4
- pyegeria/commands/tech/list_registered_services.py +1 -1
- pyegeria/commands/tech/list_relationship_types.py +19 -21
- pyegeria/commands/tech/list_relationships.py +7 -3
- pyegeria/commands/tech/table_tech_templates.py +3 -1
- pyegeria/create_tech_guid_lists.py +2 -2
- pyegeria/egeria_client.py +2 -0
- pyegeria/egeria_tech_client.py +5 -0
- pyegeria/glossary_manager_omvs.py +101 -7
- pyegeria/metadata_explorer_omvs.py +2371 -0
- pyegeria/server_operations.py +4 -4
- pyegeria/template_manager_omvs.py +1 -3
- pyegeria/valid_metadata_omvs.py +1 -1
- {pyegeria-1.5.1.1.61.dist-info → pyegeria-5.2.dist-info}/METADATA +3 -5
- pyegeria-5.2.dist-info/RECORD +232 -0
- {pyegeria-1.5.1.1.61.dist-info → pyegeria-5.2.dist-info}/entry_points.txt +4 -1
- pyegeria/commands/doc/command-overview.md +0 -99
- pyegeria-1.5.1.1.61.dist-info/RECORD +0 -169
- {pyegeria-1.5.1.1.61.dist-info → pyegeria-5.2.dist-info}/LICENSE +0 -0
- {pyegeria-1.5.1.1.61.dist-info → pyegeria-5.2.dist-info}/WHEEL +0 -0
@@ -0,0 +1,162 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
A simple display for collections
|
7
|
+
"""
|
8
|
+
import argparse
|
9
|
+
import os
|
10
|
+
import time
|
11
|
+
|
12
|
+
from rich import box
|
13
|
+
from rich.console import Console
|
14
|
+
from rich.prompt import Prompt
|
15
|
+
from rich.table import Table
|
16
|
+
from rich.text import Text
|
17
|
+
|
18
|
+
from pyegeria import (
|
19
|
+
InvalidParameterException,
|
20
|
+
PropertyServerException,
|
21
|
+
UserNotAuthorizedException,
|
22
|
+
EgeriaTech,
|
23
|
+
print_exception_response,
|
24
|
+
)
|
25
|
+
|
26
|
+
disable_ssl_warnings = True
|
27
|
+
|
28
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
29
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
30
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
31
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
32
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
33
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
34
|
+
)
|
35
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
36
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
37
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
38
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
39
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
40
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
41
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
42
|
+
|
43
|
+
|
44
|
+
def display_collections(
|
45
|
+
search_string: str = "*",
|
46
|
+
view_server: str = EGERIA_VIEW_SERVER,
|
47
|
+
view_url: str = EGERIA_VIEW_SERVER_URL,
|
48
|
+
user: str = EGERIA_USER,
|
49
|
+
user_pass: str = EGERIA_USER_PASSWORD,
|
50
|
+
jupyter: bool = EGERIA_JUPYTER,
|
51
|
+
width: int = EGERIA_WIDTH,
|
52
|
+
):
|
53
|
+
"""Display either a specified glossary or all collections if the search_string is '*'.
|
54
|
+
Parameters
|
55
|
+
----------
|
56
|
+
search_string : str, default is '*'
|
57
|
+
The string used to search for collections.
|
58
|
+
view_server : str
|
59
|
+
The view server name or address where the Egeria services are hosted.
|
60
|
+
view_url : str
|
61
|
+
The URL of the platform the view server is on.
|
62
|
+
user : str
|
63
|
+
The user ID for authentication with the Egeria server.
|
64
|
+
user_pass : str
|
65
|
+
The password for authentication with the Egeria server.
|
66
|
+
jupyter : bool, optional
|
67
|
+
A boolean indicating whether the output is intended for a Jupyter notebook (default is EGERIA_JUPYTER).
|
68
|
+
width : int, optional
|
69
|
+
The width of the console output (default is EGERIA_WIDTH).
|
70
|
+
"""
|
71
|
+
m_client = EgeriaTech(view_server, view_url, user_id=user, user_pwd=user_pass)
|
72
|
+
token = m_client.create_egeria_bearer_token()
|
73
|
+
try:
|
74
|
+
table = Table(
|
75
|
+
title=f"Collection List @ {time.asctime()}",
|
76
|
+
style="bright_white on black",
|
77
|
+
header_style="bright_white on dark_blue",
|
78
|
+
title_style="bold white on black",
|
79
|
+
caption_style="white on black",
|
80
|
+
show_lines=True,
|
81
|
+
box=box.ROUNDED,
|
82
|
+
caption=f"View Server '{view_server}' @ Platform - {view_url}",
|
83
|
+
expand=True,
|
84
|
+
)
|
85
|
+
table.add_column("Collection Name")
|
86
|
+
table.add_column(
|
87
|
+
"Qualified Name & GUID", width=38, no_wrap=True, justify="center"
|
88
|
+
)
|
89
|
+
table.add_column("Home Metadata Collection")
|
90
|
+
table.add_column("Description")
|
91
|
+
table.add_column("Collection Type")
|
92
|
+
|
93
|
+
collections = m_client.find_collections(
|
94
|
+
search_string.strip(), None, False, ends_with=False, ignore_case=True
|
95
|
+
)
|
96
|
+
if type(collections) is list:
|
97
|
+
sorted_collection_list = sorted(
|
98
|
+
collections, key=lambda k: k["properties"]["name"]
|
99
|
+
)
|
100
|
+
for collection in sorted_collection_list:
|
101
|
+
display_name = collection["properties"]["name"]
|
102
|
+
qualified_name = collection["properties"]["qualifiedName"]
|
103
|
+
home_metadata_collection = collection["elementHeader"]["origin"][
|
104
|
+
"homeMetadataCollectionName"
|
105
|
+
]
|
106
|
+
guid = collection["elementHeader"]["guid"]
|
107
|
+
q_name = Text(f"{qualified_name}\n&\n{guid}", justify="center")
|
108
|
+
description = collection["properties"]["description"]
|
109
|
+
collection_type = collection["properties"].get("collectionType", "---")
|
110
|
+
table.add_row(
|
111
|
+
display_name,
|
112
|
+
q_name,
|
113
|
+
home_metadata_collection,
|
114
|
+
description,
|
115
|
+
collection_type,
|
116
|
+
)
|
117
|
+
console = Console(
|
118
|
+
style="bold bright_white on black",
|
119
|
+
width=width,
|
120
|
+
force_terminal=not jupyter,
|
121
|
+
)
|
122
|
+
console.print(table)
|
123
|
+
else:
|
124
|
+
print("==> No collections with that name found")
|
125
|
+
|
126
|
+
except (
|
127
|
+
InvalidParameterException,
|
128
|
+
UserNotAuthorizedException,
|
129
|
+
PropertyServerException,
|
130
|
+
) as e:
|
131
|
+
print_exception_response(e)
|
132
|
+
finally:
|
133
|
+
m_client.close_session()
|
134
|
+
|
135
|
+
|
136
|
+
def main():
|
137
|
+
parser = argparse.ArgumentParser()
|
138
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
139
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
140
|
+
parser.add_argument("--userid", help="User Id")
|
141
|
+
parser.add_argument("--password", help="User Password")
|
142
|
+
|
143
|
+
args = parser.parse_args()
|
144
|
+
|
145
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
146
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
147
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
148
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
149
|
+
|
150
|
+
try:
|
151
|
+
search_string = Prompt.ask(
|
152
|
+
"Enter the collection you are searching for or '*' for all:", default="*"
|
153
|
+
).strip()
|
154
|
+
|
155
|
+
display_collections(search_string, server, url, userid, user_pass)
|
156
|
+
|
157
|
+
except KeyboardInterrupt:
|
158
|
+
pass
|
159
|
+
|
160
|
+
|
161
|
+
if __name__ == "__main__":
|
162
|
+
main()
|
@@ -81,7 +81,8 @@ def list_deployed_catalogs(
|
|
81
81
|
def generate_table() -> Table:
|
82
82
|
"""Make a new table."""
|
83
83
|
table = Table(
|
84
|
-
|
84
|
+
title=f"Catalog List @ {time.asctime()}",
|
85
|
+
caption=f"Catalogs found: {view_url} - {view_server} @ {time.asctime()}",
|
85
86
|
style="bold bright_white on black",
|
86
87
|
row_styles=["bold bright_white on black"],
|
87
88
|
header_style="white on dark_blue",
|
@@ -100,11 +101,13 @@ def list_deployed_catalogs(
|
|
100
101
|
table.add_column("Catalog Schemas")
|
101
102
|
|
102
103
|
if catalog_server in [None, "*"]:
|
103
|
-
cats = c_client.get_elements_by_classification(
|
104
|
+
cats = c_client.get_elements_by_classification(
|
105
|
+
"Anchors", "DataAccessManager"
|
106
|
+
)
|
104
107
|
else:
|
105
108
|
server_guid = c_client.get_guid_for_name(catalog_server)
|
106
109
|
cats = c_client.get_elements_by_classification_with_property_value(
|
107
|
-
"Anchors", server_guid, ["anchorGUID"], "
|
110
|
+
"Anchors", server_guid, ["anchorGUID"], "DataAccessManager"
|
108
111
|
)
|
109
112
|
if type(cats) is list:
|
110
113
|
for cat in cats:
|
@@ -87,6 +87,7 @@ def list_deployed_database_schemas(
|
|
87
87
|
def generate_table() -> Table:
|
88
88
|
"""Make a new table."""
|
89
89
|
table = Table(
|
90
|
+
title=f"Catalog Schema List @ {time.asctime()}",
|
90
91
|
caption=f"Databases found: {view_url} - {view_server} @ {time.asctime()}",
|
91
92
|
style="bold bright_white on black",
|
92
93
|
row_styles=["bold bright_white on black"],
|
@@ -95,17 +96,12 @@ def list_deployed_database_schemas(
|
|
95
96
|
caption_style="white on black",
|
96
97
|
show_lines=True,
|
97
98
|
box=box.ROUNDED,
|
98
|
-
# title=f"Elements for Open Metadata Type: '{om_type}' ",
|
99
99
|
expand=True,
|
100
100
|
# width=500
|
101
101
|
)
|
102
102
|
|
103
103
|
table.add_column("Schema in Catalog")
|
104
104
|
table.add_column("Schema Properties")
|
105
|
-
|
106
|
-
# table.add_column("Home Store")
|
107
|
-
# table.add_column("GUID", width=38, no_wrap=True)
|
108
|
-
# table.add_column("Properties")
|
109
105
|
table.add_column("Cataloged Resource")
|
110
106
|
|
111
107
|
om_type = "DeployedDatabaseSchema"
|
@@ -138,18 +134,21 @@ def list_deployed_database_schemas(
|
|
138
134
|
# get the information about the catalog we are part of
|
139
135
|
el_classification = header["classifications"]
|
140
136
|
for c in el_classification:
|
137
|
+
el_cat_guid = "---"
|
141
138
|
if c["type"]["typeName"] == "Anchors":
|
142
139
|
el_anchor_guid = c["classificationProperties"]["anchorGUID"]
|
143
140
|
el_anchor_type_name = c["classificationProperties"][
|
144
141
|
"anchorTypeName"
|
145
142
|
]
|
146
|
-
|
143
|
+
el_anchor_domain_name = c["classificationProperties"][
|
144
|
+
"anchorDomainName"
|
145
|
+
]
|
146
|
+
el_cat_name = "---"
|
147
|
+
if el_anchor_domain_name == "SoftwareCapability":
|
147
148
|
el_cat = c_client.get_element_by_guid(el_anchor_guid)
|
148
149
|
el_cat_name = el_cat["properties"].get("name", None)
|
149
150
|
if el_cat_name is None:
|
150
|
-
el_cat_name = el_cat["properties"].get(
|
151
|
-
"qualifiedName", "---"
|
152
|
-
)
|
151
|
+
el_cat_name = el_cat["properties"].get("qualifiedName", "")
|
153
152
|
el_cat_guid = el_cat["elementHeader"]["guid"]
|
154
153
|
el_schema_id = (
|
155
154
|
f"{el_name}\n{el_guid}\n\n\t\tin\n\n{el_cat_name}\n{el_cat_guid}"
|
@@ -202,10 +201,6 @@ def list_deployed_database_schemas(
|
|
202
201
|
|
203
202
|
table.add_row(
|
204
203
|
el_schema_id,
|
205
|
-
# el_type,
|
206
|
-
# el_created_out,
|
207
|
-
# el_home,
|
208
|
-
# el_guid,
|
209
204
|
el_props_out,
|
210
205
|
rel_el_out,
|
211
206
|
)
|
@@ -76,6 +76,7 @@ def list_deployed_databases(
|
|
76
76
|
def generate_table() -> Table:
|
77
77
|
"""Make a new table."""
|
78
78
|
table = Table(
|
79
|
+
title=f"Database List @ {time.asctime()}",
|
79
80
|
caption=f"Databases found: {view_url} - {view_server} @ {time.asctime()}",
|
80
81
|
style="bold bright_white on black",
|
81
82
|
row_styles=["bold bright_white on black"],
|
@@ -92,7 +93,6 @@ def list_deployed_databases(
|
|
92
93
|
table.add_column("Qualified Name")
|
93
94
|
table.add_column("Type")
|
94
95
|
table.add_column("Created", width=23)
|
95
|
-
table.add_column("Home Store")
|
96
96
|
table.add_column("GUID", width=38, no_wrap=True)
|
97
97
|
table.add_column("Properties")
|
98
98
|
table.add_column("Schemas")
|
@@ -113,7 +113,8 @@ def list_deployed_databases(
|
|
113
113
|
el_created_by = header["versions"]["createdBy"]
|
114
114
|
el_created_md = (
|
115
115
|
f"* **Created By**: {el_created_by}\n"
|
116
|
-
f"* **Created Time**: {el_create_time}"
|
116
|
+
f"* **Created Time**: {el_create_time}\n"
|
117
|
+
f"* **Home Store**: {el_home}"
|
117
118
|
)
|
118
119
|
el_created_out = Markdown(el_created_md)
|
119
120
|
|
@@ -150,7 +151,6 @@ def list_deployed_databases(
|
|
150
151
|
el_q_name,
|
151
152
|
el_type,
|
152
153
|
el_created_out,
|
153
|
-
el_home,
|
154
154
|
el_guid,
|
155
155
|
el_props_out,
|
156
156
|
rel_el_out,
|
@@ -0,0 +1,190 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
Display the status of cataloged platforms and servers.
|
7
|
+
"""
|
8
|
+
import argparse
|
9
|
+
import os
|
10
|
+
import sys
|
11
|
+
import time
|
12
|
+
|
13
|
+
import rich.box as box
|
14
|
+
from rich import print
|
15
|
+
from rich.console import Console
|
16
|
+
from rich.markdown import Markdown
|
17
|
+
from rich.panel import Panel
|
18
|
+
from rich.prompt import Prompt
|
19
|
+
from rich.table import Table
|
20
|
+
|
21
|
+
from pyegeria import (
|
22
|
+
InvalidParameterException,
|
23
|
+
PropertyServerException,
|
24
|
+
UserNotAuthorizedException,
|
25
|
+
print_exception_response,
|
26
|
+
AutomatedCuration,
|
27
|
+
)
|
28
|
+
|
29
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
30
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
31
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
32
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
33
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
34
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
35
|
+
)
|
36
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
37
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
38
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
39
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
40
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
41
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
42
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
43
|
+
|
44
|
+
|
45
|
+
disable_ssl_warnings = True
|
46
|
+
console = Console(width=200)
|
47
|
+
|
48
|
+
guid_list = []
|
49
|
+
|
50
|
+
|
51
|
+
def list_tech_elements(
|
52
|
+
tech_name: str,
|
53
|
+
server_name: str,
|
54
|
+
platform_url: str,
|
55
|
+
user: str,
|
56
|
+
user_pass: str,
|
57
|
+
jupyter: bool = EGERIA_JUPYTER,
|
58
|
+
width: int = EGERIA_WIDTH,
|
59
|
+
):
|
60
|
+
console = Console(width=width, force_terminal=not jupyter)
|
61
|
+
|
62
|
+
a_client = AutomatedCuration(server_name, platform_url, user_id=user)
|
63
|
+
token = a_client.create_egeria_bearer_token(user, user_pass)
|
64
|
+
|
65
|
+
def build_classifications(classification: dict) -> Markdown:
|
66
|
+
class_md = "\n"
|
67
|
+
for c in classification:
|
68
|
+
c_type = c["classificationName"]
|
69
|
+
if c_type == "Anchors":
|
70
|
+
continue
|
71
|
+
class_md += f"* Classification: {c_type}\n"
|
72
|
+
class_props = c.get("classificationProperties", None)
|
73
|
+
if class_props is None:
|
74
|
+
continue
|
75
|
+
for prop in class_props.keys():
|
76
|
+
class_md += f"\t* {prop}: {class_props[prop]}\n"
|
77
|
+
if class_md == "-":
|
78
|
+
output = None
|
79
|
+
else:
|
80
|
+
output = class_md
|
81
|
+
return output
|
82
|
+
|
83
|
+
def generate_table() -> Table:
|
84
|
+
"""Make a new table."""
|
85
|
+
table = Table(
|
86
|
+
title=f"Tech Type Elements for {tech_name} @ {time.asctime()}",
|
87
|
+
caption=f"{platform_url} - {server_name} @ {time.asctime()}",
|
88
|
+
style="bold bright_white on black",
|
89
|
+
row_styles=["bold bright_white on black"],
|
90
|
+
header_style="white on dark_blue",
|
91
|
+
title_style="bold bright_white on black",
|
92
|
+
caption_style="white on black",
|
93
|
+
show_lines=True,
|
94
|
+
box=box.ROUNDED,
|
95
|
+
expand=True,
|
96
|
+
)
|
97
|
+
|
98
|
+
table.add_column("Qualified Name/GUID", width=38, no_wrap=True)
|
99
|
+
table.add_column("Properties", width=40)
|
100
|
+
table.add_column("Classifications", width=50)
|
101
|
+
|
102
|
+
tech_elements = a_client.get_technology_type_elements(
|
103
|
+
tech_name, get_templates=False
|
104
|
+
)
|
105
|
+
if type(tech_elements) is str:
|
106
|
+
console.print(f"No elements found for {tech_name}")
|
107
|
+
sys.exit(1)
|
108
|
+
|
109
|
+
note: str = " "
|
110
|
+
for element in tech_elements:
|
111
|
+
header = element["elementHeader"]
|
112
|
+
tech_type = header["type"]["typeName"]
|
113
|
+
tech_collection = header["origin"]["homeMetadataCollectionName"]
|
114
|
+
tech_created_by = header["versions"]["createdBy"]
|
115
|
+
tech_created_at = header["versions"]["createTime"]
|
116
|
+
tech_guid = header["guid"]
|
117
|
+
tech_classifications = header["classifications"]
|
118
|
+
class_md = build_classifications(tech_classifications)
|
119
|
+
|
120
|
+
referenceables = element["referenceableProperties"]
|
121
|
+
tech_qualified_name = referenceables["qualifiedName"]
|
122
|
+
extended = referenceables["extendedProperties"]
|
123
|
+
ex_md: str = ""
|
124
|
+
for key, value in extended.items():
|
125
|
+
ex_md += f"* {key}: {value}\n"
|
126
|
+
|
127
|
+
note = (
|
128
|
+
f"{ex_md}\n"
|
129
|
+
f"* Created by: {tech_created_by}\n"
|
130
|
+
f"* Created at: {tech_created_at}\n"
|
131
|
+
f"* Home Collection: {tech_collection}\n"
|
132
|
+
)
|
133
|
+
|
134
|
+
interfaces = extended.get("connectorInterfaces", None)
|
135
|
+
if interfaces is not None:
|
136
|
+
interface_type_name = interfaces["typeName"]
|
137
|
+
interface_array_cnt = interfaces["arrayCount"]
|
138
|
+
note += f"* Interface Type: {interface_type_name}\n"
|
139
|
+
for i in range(0, int(interface_array_cnt)):
|
140
|
+
note += (
|
141
|
+
f"\t* Type: {interfaces['arrayValues']['propertyValueMap'][str(i)]['typeName']}"
|
142
|
+
f"\tName: {interfaces['arrayValues']['propertiesAsStrings'][str(i)]}\n"
|
143
|
+
)
|
144
|
+
note_md = Markdown(note)
|
145
|
+
qn = Markdown(f"\n{tech_qualified_name}\n \n--- \n\n\n{tech_guid}")
|
146
|
+
cm = Markdown(class_md)
|
147
|
+
table.add_row(qn, note_md, cm)
|
148
|
+
return table
|
149
|
+
|
150
|
+
try:
|
151
|
+
console = Console(width=width, force_terminal=not jupyter)
|
152
|
+
|
153
|
+
with console.pager(styles=True):
|
154
|
+
console.print(generate_table())
|
155
|
+
|
156
|
+
except (
|
157
|
+
InvalidParameterException,
|
158
|
+
PropertyServerException,
|
159
|
+
UserNotAuthorizedException,
|
160
|
+
) as e:
|
161
|
+
print_exception_response(e)
|
162
|
+
print("\n\nPerhaps the type name isn't known")
|
163
|
+
finally:
|
164
|
+
a_client.close_session()
|
165
|
+
|
166
|
+
|
167
|
+
def main():
|
168
|
+
parser = argparse.ArgumentParser()
|
169
|
+
|
170
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
171
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
172
|
+
parser.add_argument("--userid", help="User Id")
|
173
|
+
parser.add_argument("--password", help="User Password")
|
174
|
+
args = parser.parse_args()
|
175
|
+
|
176
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
177
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
178
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
179
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
180
|
+
try:
|
181
|
+
tech_name = Prompt.ask(
|
182
|
+
"Enter the tech type to view:", default="PostgreSQL Server"
|
183
|
+
)
|
184
|
+
list_tech_elements(tech_name, server, url, userid, user_pass)
|
185
|
+
except KeyboardInterrupt:
|
186
|
+
pass
|
187
|
+
|
188
|
+
|
189
|
+
if __name__ == "__main__":
|
190
|
+
main()
|
@@ -23,28 +23,37 @@ from pyegeria import (
|
|
23
23
|
PropertyServerException,
|
24
24
|
UserNotAuthorizedException,
|
25
25
|
print_exception_response,
|
26
|
-
AutomatedCuration
|
26
|
+
AutomatedCuration,
|
27
27
|
)
|
28
28
|
|
29
29
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
30
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
31
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
32
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
33
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
30
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
31
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
32
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
33
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
34
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
35
|
+
)
|
36
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
37
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
38
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
39
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
40
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
41
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
42
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
41
43
|
|
42
44
|
|
43
45
|
disable_ssl_warnings = True
|
44
46
|
|
45
47
|
|
46
|
-
def display_tech_types(
|
47
|
-
|
48
|
+
def display_tech_types(
|
49
|
+
search_string: str,
|
50
|
+
server: str,
|
51
|
+
url: str,
|
52
|
+
username: str,
|
53
|
+
user_pass: str,
|
54
|
+
jupyter: bool = EGERIA_JUPYTER,
|
55
|
+
width: int = EGERIA_WIDTH,
|
56
|
+
):
|
48
57
|
a_client = AutomatedCuration(server, url, username)
|
49
58
|
token = a_client.create_egeria_bearer_token(username, user_pass)
|
50
59
|
tech_list = a_client.find_technology_types(search_string, page_size=0)
|
@@ -61,7 +70,7 @@ def display_tech_types(search_string:str, server: str, url: str, username: str,
|
|
61
70
|
show_lines=True,
|
62
71
|
box=box.ROUNDED,
|
63
72
|
caption=f"Technology Types from Server '{server}' @ Platform - {url}",
|
64
|
-
expand=True
|
73
|
+
expand=True,
|
65
74
|
)
|
66
75
|
|
67
76
|
table.add_column("Name")
|
@@ -69,23 +78,20 @@ def display_tech_types(search_string:str, server: str, url: str, username: str,
|
|
69
78
|
table.add_column("Category")
|
70
79
|
table.add_column("Description")
|
71
80
|
|
72
|
-
|
73
81
|
name = " "
|
74
82
|
description = " "
|
75
83
|
version = " "
|
76
84
|
super_type = " "
|
77
85
|
if type(tech_list) is list:
|
78
86
|
for item in tech_list:
|
79
|
-
if
|
87
|
+
if "deployedImplementationType" not in item["qualifiedName"]:
|
80
88
|
continue
|
81
89
|
qualified_name = item.get("qualifiedName", " ")
|
82
90
|
name = item.get("name", "none")
|
83
91
|
category = item.get("category", "none")
|
84
92
|
description = item.get("description", "none")
|
85
93
|
|
86
|
-
table.add_row(
|
87
|
-
name, qualified_name, category, description
|
88
|
-
)
|
94
|
+
table.add_row(name, qualified_name, category, description)
|
89
95
|
return table
|
90
96
|
else:
|
91
97
|
print("Unknown technology type")
|
@@ -96,7 +102,11 @@ def display_tech_types(search_string:str, server: str, url: str, username: str,
|
|
96
102
|
with console.pager(styles=True):
|
97
103
|
console.print(generate_table())
|
98
104
|
|
99
|
-
except (
|
105
|
+
except (
|
106
|
+
InvalidParameterException,
|
107
|
+
PropertyServerException,
|
108
|
+
UserNotAuthorizedException,
|
109
|
+
) as e:
|
100
110
|
print_exception_response(e)
|
101
111
|
assert e.related_http_code != "200", "Invalid parameters"
|
102
112
|
finally:
|
@@ -118,11 +128,13 @@ def main():
|
|
118
128
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
119
129
|
|
120
130
|
try:
|
121
|
-
search_string = Prompt.ask(
|
131
|
+
search_string = Prompt.ask(
|
132
|
+
"Enter the technology you are searching for:", default="*"
|
133
|
+
)
|
122
134
|
display_tech_types(search_string, server, url, userid, user_pass)
|
123
|
-
except
|
135
|
+
except KeyboardInterrupt:
|
124
136
|
pass
|
125
137
|
|
126
138
|
|
127
139
|
if __name__ == "__main__":
|
128
|
-
main()
|
140
|
+
main()
|
@@ -25,6 +25,7 @@ from pyegeria import (
|
|
25
25
|
UserNotAuthorizedException,
|
26
26
|
EgeriaTech,
|
27
27
|
)
|
28
|
+
from pyegeria.commands.cat.glossary_actions import EGERIA_HOME_GLOSSARY_GUID
|
28
29
|
|
29
30
|
disable_ssl_warnings = True
|
30
31
|
|
@@ -42,11 +43,12 @@ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
|
42
43
|
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
43
44
|
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
44
45
|
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
46
|
+
EGERIA_HOME_GLOSSARY_GUID = os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None)
|
45
47
|
|
46
48
|
|
47
49
|
def display_glossary_terms(
|
48
50
|
search_string: str = "*",
|
49
|
-
glossary_guid: str =
|
51
|
+
glossary_guid: str = EGERIA_HOME_GLOSSARY_GUID,
|
50
52
|
glossary_name: str = None,
|
51
53
|
view_server: str = EGERIA_VIEW_SERVER,
|
52
54
|
view_url: str = EGERIA_VIEW_SERVER_URL,
|
@@ -119,6 +121,7 @@ def display_glossary_terms(
|
|
119
121
|
table.add_column("Version Id")
|
120
122
|
table.add_column("Glossary")
|
121
123
|
table.add_column("Status")
|
124
|
+
table.add_column("Example")
|
122
125
|
|
123
126
|
terms = g_client.find_glossary_terms(
|
124
127
|
search_string,
|
@@ -158,6 +161,7 @@ def display_glossary_terms(
|
|
158
161
|
style=style,
|
159
162
|
justify="center",
|
160
163
|
)
|
164
|
+
example = Text(props.get("example", " "), style=style)
|
161
165
|
|
162
166
|
classifications = term["elementHeader"]["classifications"]
|
163
167
|
glossary_guid = None
|
@@ -184,6 +188,7 @@ def display_glossary_terms(
|
|
184
188
|
version,
|
185
189
|
glossary_name,
|
186
190
|
term_status,
|
191
|
+
example,
|
187
192
|
style="bold white on black",
|
188
193
|
)
|
189
194
|
|
@@ -217,7 +222,7 @@ def main():
|
|
217
222
|
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
218
223
|
userid = args.userid if args.userid is not None else EGERIA_USER
|
219
224
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
220
|
-
guid = args.guid if args.guid is not None else
|
225
|
+
guid = args.guid if args.guid is not None else EGERIA_HOME_GLOSSARY_GUID
|
221
226
|
|
222
227
|
try:
|
223
228
|
search_string = Prompt.ask("Enter the term you are searching for:", default="*")
|