pyegeria 5.2.0.13__py3-none-any.whl → 5.2.0.42.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/collection_manager_omvs.py +9 -6
- pyegeria/commands/README.md +2 -1
- pyegeria/commands/cat/__init__.py +1 -5
- pyegeria/commands/cat/exp_list_glossaries.py +1 -1
- pyegeria/commands/cat/get_asset_graph.py +1 -1
- pyegeria/commands/cat/get_collection.py +2 -2
- pyegeria/commands/cat/get_project_dependencies.py +1 -1
- pyegeria/commands/cat/get_project_structure.py +1 -1
- pyegeria/commands/cat/get_tech_type_elements.py +2 -2
- pyegeria/commands/cat/glossary_actions.py +9 -3
- pyegeria/commands/cat/list_assets.py +9 -18
- pyegeria/commands/cat/list_cert_types.py +1 -1
- pyegeria/commands/cat/list_collections.py +1 -1
- pyegeria/commands/cat/list_deployed_catalogs.py +5 -3
- pyegeria/commands/cat/list_deployed_database_schemas.py +1 -1
- pyegeria/commands/cat/list_deployed_databases.py +3 -4
- pyegeria/commands/cat/list_glossaries.py +1 -1
- pyegeria/commands/cat/list_projects.py +1 -1
- pyegeria/commands/cat/list_servers_deployed_imp.py +1 -1
- 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 +5 -3
- pyegeria/commands/cat/list_todos.py +1 -1
- pyegeria/commands/cat/list_user_ids.py +1 -1
- pyegeria/commands/cli/egeria.py +75 -77
- pyegeria/commands/cli/egeria_cat.py +44 -44
- pyegeria/commands/cli/egeria_login_tui.py +12 -4
- pyegeria/commands/cli/egeria_my.py +24 -28
- pyegeria/commands/cli/egeria_ops.py +37 -39
- pyegeria/commands/cli/egeria_tech.py +49 -35
- pyegeria/commands/cli/ops_config.py +3 -1
- pyegeria/commands/doc/{command-overview.md → README.md} +50 -5
- pyegeria/commands/doc/Visual Command Reference/README.md +511 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-12-19 at 13.23.11.mov +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-12-19 at 19.56.26.mp4 +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-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-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/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 } +1 -1
- pyegeria/commands/my/list_my_profile.py +1 -1
- pyegeria/commands/my/list_my_roles.py +1 -1
- pyegeria/commands/my/monitor_my_todos.py +18 -6
- pyegeria/commands/my/monitor_open_todos.py +2 -2
- pyegeria/commands/my/todo_actions.py +1 -1
- pyegeria/commands/ops/list_archives.py +1 -1
- pyegeria/commands/ops/list_catalog_targets.py +1 -1
- pyegeria/commands/ops/load_archive.py +1 -1
- pyegeria/commands/ops/monitor_asset_events.py +27 -22
- pyegeria/commands/ops/monitor_engine_activity.py +1 -1
- 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 +12 -9
- pyegeria/commands/ops/monitor_platform_status.py +2 -2
- pyegeria/commands/ops/monitor_server_startup.py +1 -1
- pyegeria/commands/ops/monitor_server_status.py +1 -1
- pyegeria/commands/ops/orig_monitor_server_list.py +1 -1
- pyegeria/commands/ops/orig_monitor_server_status.py +36 -21
- pyegeria/commands/ops/refresh_integration_daemon.py +2 -2
- pyegeria/commands/ops/restart_integration_daemon.py +2 -2
- pyegeria/commands/ops/table_integ_daemon_status.py +1 -1
- pyegeria/commands/tech/get_element_info.py +1 -1
- pyegeria/commands/tech/get_guid_info.py +1 -1
- pyegeria/commands/tech/get_tech_details.py +79 -42
- pyegeria/commands/tech/get_tech_type_template.py +69 -53
- pyegeria/commands/tech/list_anchored_elements.py +19 -16
- pyegeria/commands/tech/list_asset_types.py +1 -1
- pyegeria/commands/tech/list_elements.py +1 -1
- pyegeria/commands/tech/list_elements_for_classification.py +1 -1
- pyegeria/commands/tech/list_elements_x.py +8 -5
- pyegeria/commands/tech/list_gov_action_processes.py +1 -1
- pyegeria/commands/tech/list_registered_services.py +2 -2
- pyegeria/commands/tech/list_related_elements.py +1 -1
- pyegeria/commands/tech/list_related_specification.py +1 -1
- pyegeria/commands/tech/list_relationship_types.py +20 -22
- pyegeria/commands/tech/list_relationships.py +8 -4
- pyegeria/commands/tech/list_tech_templates.py +1 -1
- pyegeria/commands/tech/list_valid_metadata_values.py +1 -1
- pyegeria/commands/tech/table_tech_templates.py +1 -1
- pyegeria/commands/tech/x_list_related_elements.py +1 -1
- pyegeria/create_tech_guid_lists.py +2 -2
- pyegeria/glossary_manager_omvs.py +64 -1
- pyegeria/mermaid_utilities.py +1 -1
- pyegeria/metadata_explorer_omvs.py +96 -47
- pyegeria/server_operations.py +4 -4
- {pyegeria-5.2.0.13.dist-info → pyegeria-5.2.0.42.2.dist-info}/METADATA +1 -1
- pyegeria-5.2.0.42.2.dist-info/RECORD +234 -0
- {pyegeria-5.2.0.13.dist-info → pyegeria-5.2.0.42.2.dist-info}/entry_points.txt +2 -1
- pyegeria/commands/doc/Visual Command Reference/cat/show/assets/deployed-catalogs 2024-11-20 at 16.17.43@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-11-25 at 20.30.02@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-11-25 at 20.31.47@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-11-25 at 20.32.11@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-11-25 at 20.34.19@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-11-25 at 20.36.42@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-11-25 at 20.36.55@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-11-25 at 20.37.07@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-12-06 at 08.46.30@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-12-06 at 11.27.56@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/catalogs 2024-11-25 at 16.28.53@2x.png +0 -0
- pyegeria-5.2.0.13.dist-info/RECORD +0 -195
- /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-5.2.0.13.dist-info → pyegeria-5.2.0.42.2.dist-info}/LICENSE +0 -0
- {pyegeria-5.2.0.13.dist-info → pyegeria-5.2.0.42.2.dist-info}/WHEEL +0 -0
@@ -17,47 +17,63 @@ from rich.prompt import Prompt
|
|
17
17
|
from rich.text import Text
|
18
18
|
from rich.tree import Tree
|
19
19
|
|
20
|
-
from pyegeria import (
|
21
|
-
|
20
|
+
from pyegeria import (
|
21
|
+
UserNotAuthorizedException,
|
22
|
+
PropertyServerException,
|
23
|
+
InvalidParameterException,
|
24
|
+
AutomatedCuration,
|
25
|
+
)
|
22
26
|
from pyegeria._exceptions import (
|
23
27
|
print_exception_response,
|
24
28
|
)
|
25
29
|
|
26
30
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
27
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
28
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
29
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
30
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
32
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
33
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
34
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
35
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
36
|
+
)
|
37
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon")
|
38
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
39
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
40
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
41
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
42
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
43
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
38
44
|
|
39
45
|
# nest_asyncio.apply()
|
40
46
|
|
41
47
|
disable_ssl_warnings = True
|
42
48
|
|
43
49
|
|
44
|
-
def tech_details_viewer(
|
45
|
-
|
50
|
+
def tech_details_viewer(
|
51
|
+
tech: str,
|
52
|
+
server_name: str,
|
53
|
+
platform_url: str,
|
54
|
+
user: str,
|
55
|
+
user_password: str,
|
56
|
+
jupyter: bool = EGERIA_JUPYTER,
|
57
|
+
width: int = EGERIA_WIDTH,
|
58
|
+
):
|
46
59
|
console = Console(width=width, force_terminal=not jupyter)
|
60
|
+
|
47
61
|
# print(f"tech is {tech} of type {type(tech)}")
|
48
62
|
# sys.exit(0)
|
49
|
-
def view_tech_details(
|
63
|
+
def view_tech_details(
|
64
|
+
a_client: AutomatedCuration, root_collection_name: str, tree: Tree
|
65
|
+
) -> Tree:
|
50
66
|
l2: Tree = None
|
51
67
|
tech_details = a_client.get_technology_type_detail(tech)
|
52
68
|
if (type(tech_details) is dict) and (len(tech_details) > 0):
|
53
|
-
name = tech_details.get(
|
54
|
-
qualified_name = tech_details.get(
|
55
|
-
category = tech_details.get(
|
56
|
-
description = tech_details.get(
|
69
|
+
name = tech_details.get("name", "---")
|
70
|
+
qualified_name = tech_details.get("qualifiedName", "---")
|
71
|
+
category = tech_details.get("category", "---")
|
72
|
+
description = tech_details.get("description", "---")
|
57
73
|
|
58
74
|
style = "bold bright_white on black"
|
59
75
|
|
60
|
-
bas_md =
|
76
|
+
bas_md = f"* **Name**: {name}\n"
|
61
77
|
bas_md += f"* **QualifiedName**: {qualified_name}\n"
|
62
78
|
bas_md += f"* **Category**: {category}\n"
|
63
79
|
bas_md += f"* **Technology Description**: {description}\n"
|
@@ -65,49 +81,68 @@ def tech_details_viewer(tech: str, server_name: str, platform_url: str, user: st
|
|
65
81
|
bas_out = Markdown(bas_md)
|
66
82
|
|
67
83
|
l2 = tree.add(Panel(bas_out))
|
68
|
-
ext_ref = tech_details.get(
|
84
|
+
ext_ref = tech_details.get("externalReferences", None)
|
69
85
|
|
70
86
|
if ext_ref is not None:
|
71
87
|
uri = ext_ref[0]["properties"].get("uri", "---")
|
72
88
|
# console.print(f" {type(ext_ref)}, {len(ext_ref)}")
|
73
|
-
l2 = tree.add(Panel(Markdown(f
|
89
|
+
l2 = tree.add(Panel(Markdown(f"* URI: {uri}", style)))
|
74
90
|
|
75
|
-
resource_list = tech_details.get(
|
91
|
+
resource_list = tech_details.get("resourceList", None)
|
76
92
|
if resource_list:
|
77
93
|
t_r = tree.add(Panel("Resource List[bold red]"))
|
78
94
|
for resource in resource_list:
|
79
|
-
resource_use = Text(
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
95
|
+
resource_use = Text(
|
96
|
+
f"[bold bright_white]{resource.get('resourceUse', '---')}"
|
97
|
+
)
|
98
|
+
resource_use_description = Text(
|
99
|
+
f"[bold bright_white]{resource.get('resourceUseDescription', '---')}"
|
100
|
+
)
|
101
|
+
type_name = Text(
|
102
|
+
f"[bold bright_white]{resource['relatedElement']['type'].get('typeName', '---')}"
|
103
|
+
)
|
104
|
+
unique_name = Text(
|
105
|
+
f"[bold bright_white]{resource['relatedElement'].get('uniqueName', '---')}"
|
106
|
+
)
|
107
|
+
related_guid = Text(
|
108
|
+
f"[bold bright_white]{resource['relatedElement'].get('guid', '---')}"
|
109
|
+
)
|
110
|
+
resource_text = (
|
111
|
+
f"[bold red]Resource\n"
|
112
|
+
f"[white]Resource use: {resource_use}[white]\nDescription: "
|
113
|
+
f"{resource_use_description}\n[white]Type Name: {type_name}\n"
|
114
|
+
f"[white]Unique Name: {unique_name}\n[white]Related GUID: {related_guid}\n"
|
115
|
+
)
|
88
116
|
p = Panel.fit(resource_text)
|
89
117
|
tt = t_r.add(p, style=style)
|
90
118
|
else:
|
91
119
|
tt = tree.add(Panel(f"Resource details for {tech} where not found"))
|
92
120
|
|
93
121
|
else:
|
94
|
-
tt = tree.add(
|
122
|
+
tt = tree.add(
|
123
|
+
Panel(
|
124
|
+
f"Tech type {tech} was not found - please check the tech type name"
|
125
|
+
)
|
126
|
+
)
|
95
127
|
|
96
128
|
return tt
|
97
129
|
|
98
130
|
try:
|
99
|
-
tree = Tree(
|
100
|
-
|
101
|
-
|
131
|
+
tree = Tree(
|
132
|
+
f"{tech}",
|
133
|
+
style="bold bright_white on black",
|
134
|
+
guide_style="bold bright_blue",
|
135
|
+
)
|
136
|
+
a_client = AutomatedCuration(server_name, platform_url, user_id=user)
|
102
137
|
|
103
138
|
token = a_client.create_egeria_bearer_token(user, user_password)
|
104
139
|
view_tech_details(a_client, tech, tree)
|
105
140
|
print(tree)
|
106
141
|
|
107
142
|
except (
|
108
|
-
|
109
|
-
|
110
|
-
|
143
|
+
InvalidParameterException,
|
144
|
+
PropertyServerException,
|
145
|
+
UserNotAuthorizedException,
|
111
146
|
) as e:
|
112
147
|
print_exception_response(e)
|
113
148
|
|
@@ -126,9 +161,11 @@ def main():
|
|
126
161
|
userid = args.userid if args.userid is not None else EGERIA_USER
|
127
162
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
128
163
|
try:
|
129
|
-
tech = Prompt.ask(
|
164
|
+
tech = Prompt.ask(
|
165
|
+
"Enter the Technology to start from:", default="PostgreSQL Server"
|
166
|
+
)
|
130
167
|
tech_details_viewer(tech, server, url, userid, user_pass)
|
131
|
-
except
|
168
|
+
except KeyboardInterrupt:
|
132
169
|
pass
|
133
170
|
|
134
171
|
|
@@ -20,21 +20,23 @@ from pyegeria import (
|
|
20
20
|
PropertyServerException,
|
21
21
|
UserNotAuthorizedException,
|
22
22
|
print_exception_response,
|
23
|
-
AutomatedCuration
|
23
|
+
AutomatedCuration,
|
24
24
|
)
|
25
25
|
|
26
26
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
27
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
28
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
29
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
30
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
27
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
28
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
29
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
30
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
31
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
32
|
+
)
|
33
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon")
|
34
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
35
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
36
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
37
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
38
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
39
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
38
40
|
|
39
41
|
|
40
42
|
disable_ssl_warnings = True
|
@@ -42,12 +44,18 @@ console = Console(width=200)
|
|
42
44
|
|
43
45
|
guid_list = []
|
44
46
|
|
45
|
-
def template_viewer(tech_name: str, server_name:str, platform_url:str, user:str, user_pass:str,
|
46
|
-
jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
|
47
47
|
|
48
|
+
def template_viewer(
|
49
|
+
tech_name: str,
|
50
|
+
server_name: str,
|
51
|
+
platform_url: str,
|
52
|
+
user: str,
|
53
|
+
user_pass: str,
|
54
|
+
jupyter: bool = EGERIA_JUPYTER,
|
55
|
+
width: int = EGERIA_WIDTH,
|
56
|
+
):
|
48
57
|
def build_classifications(classification: dict) -> Markdown:
|
49
|
-
|
50
|
-
class_md = ("\n")
|
58
|
+
class_md = "\n"
|
51
59
|
for c in classification:
|
52
60
|
c_type = c["classificationName"]
|
53
61
|
if c_type == "Anchors":
|
@@ -65,53 +73,59 @@ def template_viewer(tech_name: str, server_name:str, platform_url:str, user:str,
|
|
65
73
|
return output
|
66
74
|
|
67
75
|
try:
|
68
|
-
|
69
76
|
console = Console(width=width, force_terminal=not jupyter)
|
70
77
|
|
71
|
-
a_client = AutomatedCuration(server_name, platform_url,
|
72
|
-
user_id=user)
|
78
|
+
a_client = AutomatedCuration(server_name, platform_url, user_id=user)
|
73
79
|
|
74
80
|
token = a_client.create_egeria_bearer_token(user, user_pass)
|
75
|
-
tech_elements = a_client.get_technology_type_elements(
|
81
|
+
tech_elements = a_client.get_technology_type_elements(
|
82
|
+
tech_name, get_templates=True
|
83
|
+
)
|
76
84
|
if (len(tech_elements) >= 1) and (type(tech_elements) is list):
|
77
|
-
tree = Tree(
|
78
|
-
|
85
|
+
tree = Tree(
|
86
|
+
f"Deployed Technology Type: {tech_name}",
|
87
|
+
style="bold bright_white",
|
88
|
+
guide_style="bold bright_blue",
|
89
|
+
)
|
90
|
+
note: str = " "
|
79
91
|
for element in tech_elements:
|
80
|
-
header = element[
|
92
|
+
header = element["elementHeader"]
|
81
93
|
tech_type = header["type"]["typeName"]
|
82
|
-
tech_collection = header["origin"][
|
83
|
-
tech_created_by = header[
|
84
|
-
tech_created_at = header[
|
85
|
-
tech_guid = header[
|
86
|
-
tech_classifications = header[
|
94
|
+
tech_collection = header["origin"]["homeMetadataCollectionName"]
|
95
|
+
tech_created_by = header["versions"]["createdBy"]
|
96
|
+
tech_created_at = header["versions"]["createTime"]
|
97
|
+
tech_guid = header["guid"]
|
98
|
+
tech_classifications = header["classifications"]
|
87
99
|
class_md = build_classifications(tech_classifications)
|
88
100
|
|
89
|
-
referenceables = element[
|
90
|
-
tech_qualified_name = referenceables[
|
91
|
-
extended = referenceables[
|
92
|
-
ex_md:str = ""
|
101
|
+
referenceables = element["referenceableProperties"]
|
102
|
+
tech_qualified_name = referenceables["qualifiedName"]
|
103
|
+
extended = referenceables["extendedProperties"]
|
104
|
+
ex_md: str = ""
|
93
105
|
for key, value in extended.items():
|
94
106
|
ex_md += f"* {key}: {value}\n"
|
95
107
|
|
96
|
-
note = (
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
108
|
+
note = (
|
109
|
+
f"* Qualified Name: {tech_qualified_name}\n"
|
110
|
+
f"* GUID: {tech_guid}\n"
|
111
|
+
f"* Createdy by: {tech_created_by}\n"
|
112
|
+
f"* Created at: {tech_created_at}\n"
|
113
|
+
f"* Home Collection: {tech_collection}\n"
|
114
|
+
f"{class_md}\n"
|
115
|
+
f"{ex_md}\n"
|
116
|
+
)
|
117
|
+
|
118
|
+
interfaces = extended.get("connectorInterfaces", None)
|
106
119
|
if interfaces is not None:
|
107
|
-
interface_type_name = interfaces[
|
108
|
-
interface_array_cnt = interfaces[
|
120
|
+
interface_type_name = interfaces["typeName"]
|
121
|
+
interface_array_cnt = interfaces["arrayCount"]
|
109
122
|
note += f"* Interface Type: {interface_type_name}\n"
|
110
123
|
for i in range(0, int(interface_array_cnt)):
|
111
|
-
note += (
|
112
|
-
|
113
|
-
|
114
|
-
|
124
|
+
note += (
|
125
|
+
f"\t* Type: {interfaces['arrayValues']['propertyValueMap'][str(i)]['typeName']}"
|
126
|
+
f"\tName: {interfaces['arrayValues']['propertiesAsStrings'][str(i)]}\n"
|
127
|
+
)
|
128
|
+
note_md = Panel.fit(Markdown(note), style="bold bright_white on black")
|
115
129
|
t = tree.add(note_md)
|
116
130
|
|
117
131
|
else:
|
@@ -120,7 +134,7 @@ def template_viewer(tech_name: str, server_name:str, platform_url:str, user:str,
|
|
120
134
|
except (
|
121
135
|
InvalidParameterException,
|
122
136
|
PropertyServerException,
|
123
|
-
UserNotAuthorizedException
|
137
|
+
UserNotAuthorizedException,
|
124
138
|
) as e:
|
125
139
|
print_exception_response(e)
|
126
140
|
|
@@ -140,11 +154,13 @@ def main():
|
|
140
154
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
141
155
|
|
142
156
|
try:
|
143
|
-
tech_name = Prompt.ask(
|
144
|
-
|
145
|
-
|
157
|
+
tech_name = Prompt.ask(
|
158
|
+
"Enter the Asset Name to view:", default="Apache Kafka Server"
|
159
|
+
)
|
160
|
+
template_viewer(tech_name, server, url, userid, user_pass)
|
161
|
+
except KeyboardInterrupt:
|
146
162
|
pass
|
147
163
|
|
148
164
|
|
149
165
|
if __name__ == "__main__":
|
150
|
-
main()
|
166
|
+
main()
|
@@ -3,8 +3,6 @@
|
|
3
3
|
SPDX-License-Identifier: Apache-2.0
|
4
4
|
Copyright Contributors to the ODPi Egeria project.
|
5
5
|
|
6
|
-
Unit tests for the Utils helper functions using the Pytest framework.
|
7
|
-
|
8
6
|
|
9
7
|
Retrieve elements based on a search of a specified properties.
|
10
8
|
"""
|
@@ -34,7 +32,7 @@ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
|
34
32
|
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
35
33
|
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
36
34
|
)
|
37
|
-
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "
|
35
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon")
|
38
36
|
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
39
37
|
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
40
38
|
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
@@ -48,7 +46,7 @@ disable_ssl_warnings = True
|
|
48
46
|
|
49
47
|
def display_anchored_elements(
|
50
48
|
search_string: str,
|
51
|
-
prop_list: [str],
|
49
|
+
prop_list: list[str],
|
52
50
|
server: str,
|
53
51
|
url: str,
|
54
52
|
username: str,
|
@@ -59,16 +57,18 @@ def display_anchored_elements(
|
|
59
57
|
):
|
60
58
|
console = Console(width=width, force_terminal=not jupyter, soft_wrap=True)
|
61
59
|
if (search_string is None) or (len(search_string) < 3):
|
62
|
-
|
63
|
-
"Invalid Search String - must be greater than four characters long"
|
60
|
+
print(
|
61
|
+
"\nError --> Invalid Search String - must be greater than four characters long"
|
64
62
|
)
|
63
|
+
sys.exit(3)
|
65
64
|
g_client = EgeriaTech(server, url, username, user_password)
|
66
65
|
token = g_client.create_egeria_bearer_token()
|
66
|
+
print(f"search string is {search_string} and prop_list is {prop_list}\n")
|
67
67
|
|
68
68
|
def generate_table(search_string: str, prop_list: [str]) -> Table:
|
69
69
|
"""Make a new table."""
|
70
70
|
table = Table(
|
71
|
-
title=f"
|
71
|
+
title=f"Elements containing the string {search_string} @ {time.asctime()}",
|
72
72
|
header_style="white on dark_blue",
|
73
73
|
style="bold white on black",
|
74
74
|
row_styles=["bold white on black"],
|
@@ -89,6 +89,7 @@ def display_anchored_elements(
|
|
89
89
|
classification = "Anchors"
|
90
90
|
open_type_name = None
|
91
91
|
property_value = search_string
|
92
|
+
|
92
93
|
property_names = prop_list
|
93
94
|
|
94
95
|
elements = g_client.find_elements_by_classification_with_property_value(
|
@@ -148,11 +149,6 @@ def display_anchored_elements(
|
|
148
149
|
return table
|
149
150
|
|
150
151
|
try:
|
151
|
-
# with Live(generate_table(), refresh_per_second=4, screen=True) as live:
|
152
|
-
# while True:
|
153
|
-
# time.sleep(2)
|
154
|
-
# live.update(generate_table())
|
155
|
-
|
156
152
|
with console.pager(styles=True):
|
157
153
|
console.print(generate_table(search_string, prop_list), soft_wrap=True)
|
158
154
|
|
@@ -164,7 +160,7 @@ def display_anchored_elements(
|
|
164
160
|
console.print_exception()
|
165
161
|
sys.exit(1)
|
166
162
|
|
167
|
-
except
|
163
|
+
except Exception as e:
|
168
164
|
console.print(
|
169
165
|
f"\n\n====> Invalid Search String - must be greater than four characters long"
|
170
166
|
)
|
@@ -191,9 +187,16 @@ def main():
|
|
191
187
|
prop_list = Prompt.ask(
|
192
188
|
"Enter the list of properties to search", default="anchorTypeName"
|
193
189
|
)
|
194
|
-
|
195
|
-
|
196
|
-
|
190
|
+
if search_string == "":
|
191
|
+
print("\nError --> Search string can't be empty")
|
192
|
+
sys.exit(1)
|
193
|
+
elif len(search_string) <= 4:
|
194
|
+
print("\nError --> Search string must be greater than four characters long")
|
195
|
+
sys.exit(2)
|
196
|
+
else:
|
197
|
+
display_anchored_elements(
|
198
|
+
search_string, [prop_list], server, url, userid, user_pass, time_out
|
199
|
+
)
|
197
200
|
except KeyboardInterrupt:
|
198
201
|
pass
|
199
202
|
|
@@ -31,7 +31,7 @@ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
|
31
31
|
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
32
32
|
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
33
33
|
)
|
34
|
-
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "
|
34
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon")
|
35
35
|
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
36
36
|
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
37
37
|
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
@@ -26,7 +26,7 @@ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
|
26
26
|
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
27
27
|
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
28
28
|
)
|
29
|
-
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "
|
29
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon")
|
30
30
|
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
31
31
|
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
32
32
|
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
@@ -26,7 +26,7 @@ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
|
26
26
|
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
27
27
|
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
28
28
|
)
|
29
|
-
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "
|
29
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon")
|
30
30
|
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
31
31
|
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
32
32
|
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
@@ -28,7 +28,7 @@ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
|
28
28
|
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
29
29
|
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
30
30
|
)
|
31
|
-
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "
|
31
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon")
|
32
32
|
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
33
33
|
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
34
34
|
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
@@ -102,13 +102,13 @@ def list_elements_x(
|
|
102
102
|
if type(tags) is list:
|
103
103
|
for tag in tags:
|
104
104
|
tags_md += (
|
105
|
-
f"* tag: {tag.get('name','
|
105
|
+
f"* tag: {tag.get('name','')}\n"
|
106
106
|
f"\t description: {tag.get('description','---')}\n"
|
107
107
|
f"\t assigned by: {tag.get('user','---')}\n"
|
108
108
|
)
|
109
109
|
|
110
110
|
else:
|
111
|
-
tags_md = "
|
111
|
+
tags_md = ""
|
112
112
|
|
113
113
|
likes = c_client.get_attached_likes(el_guid)
|
114
114
|
likes_md = "Likes:\b"
|
@@ -122,9 +122,12 @@ def list_elements_x(
|
|
122
122
|
)
|
123
123
|
|
124
124
|
else:
|
125
|
-
likes_md = "
|
125
|
+
likes_md = ""
|
126
126
|
|
127
|
-
|
127
|
+
if len(tags_md) > 0 and len(likes_md) > 0:
|
128
|
+
feedback_out = f"{tags_md}\n --- \n{likes_md}"
|
129
|
+
else:
|
130
|
+
feedback_out = ""
|
128
131
|
|
129
132
|
comments_out = " "
|
130
133
|
|
@@ -34,7 +34,7 @@ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
|
34
34
|
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
35
35
|
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
36
36
|
)
|
37
|
-
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "
|
37
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon")
|
38
38
|
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
39
39
|
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
40
40
|
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
@@ -31,7 +31,7 @@ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
|
31
31
|
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
32
32
|
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
33
33
|
)
|
34
|
-
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "
|
34
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon")
|
35
35
|
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
36
36
|
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
37
37
|
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
@@ -71,7 +71,7 @@ def display_registered_svcs(
|
|
71
71
|
def generate_table(svc_list) -> Table:
|
72
72
|
"""Make a new table."""
|
73
73
|
table = Table(
|
74
|
-
title=f"
|
74
|
+
title=f"Services for: {url} @ {time.asctime()}",
|
75
75
|
style="bold bright_white on black",
|
76
76
|
row_styles=["bold bright_white on black"],
|
77
77
|
header_style="white on dark_blue",
|
@@ -26,7 +26,7 @@ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
|
26
26
|
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
27
27
|
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
28
28
|
)
|
29
|
-
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "
|
29
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon")
|
30
30
|
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
31
31
|
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
32
32
|
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
@@ -34,7 +34,7 @@ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
|
34
34
|
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
35
35
|
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
36
36
|
)
|
37
|
-
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "
|
37
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon")
|
38
38
|
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
39
39
|
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
40
40
|
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|