pyegeria 0.7.26__tar.gz → 0.7.28__tar.gz
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-0.7.26 → pyegeria-0.7.28}/PKG-INFO +2 -2
- pyegeria-0.7.28/examples/widgets/cat/get_tech_type_elements.py +174 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/list_glossary.py +55 -25
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/list_projects.py +71 -35
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/list_user_ids.py +57 -40
- pyegeria-0.7.28/examples/widgets/cli/egeria.py +1130 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/monitor_engine_activity.py +70 -30
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/monitor_gov_eng_status.py +49 -24
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/monitor_integ_daemon_status.py +100 -38
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyproject.toml +2 -3
- pyegeria-0.7.26/examples/widgets/cat/get_tech_type_elements.py +0 -158
- pyegeria-0.7.26/examples/widgets/cli/egeria.py +0 -741
- {pyegeria-0.7.26 → pyegeria-0.7.28}/LICENSE +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/README.md +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/doc_samples/Create_Collection_Sample.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/README.md +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/__init__.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/get_asset_graph.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/get_collection.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/get_project_dependencies.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/get_project_structure.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/get_tech_type_template.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/list_assets.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/list_cert_types.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/list_relationships.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/list_tech_types.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cat/list_todos.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cli/__init__.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cli/egeria_cat.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cli/egeria_my.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cli/egeria_ops.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cli/egeria_tech.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/cli/ops_config.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/my/README.md +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/my/__init__.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/my/list_my_profile.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/my/list_my_roles.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/my/monitor_my_todos.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/my/monitor_open_todos.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/my/my_profile_actions.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/my/todo_actions.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/README.md +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/__init__.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/engine_actions.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/integration_daemon_actions.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/list_catalog_targets.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/load_archive.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/monitor_asset_events.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/monitor_coco_status.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/monitor_platform_status.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/monitor_server_list.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/monitor_server_status.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/refresh_integration_daemon.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/ops/restart_integration_daemon.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/README.md +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/__init__.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/get_element_info.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/get_guid_info.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/get_tech_details.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/list_asset_types.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/list_elements.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/list_elements_x.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/list_registered_services.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/list_related_specification.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/list_relationship_types.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/list_tech_templates.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/list_valid_metadata_values.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/examples/widgets/tech/x_list_related_elements.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/Xloaded_resources_omvs.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/__init__.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/_client.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/_deprecated_gov_engine.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/_exceptions.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/_globals.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/_validators.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/action_author_omvs.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/asset_catalog_omvs.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/automated_curation_omvs.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/classification_manager_omvs.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/collection_manager_omvs.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/core_omag_server_config.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/create_tech_guid_lists.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/feedback_manager_omvs.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/full_omag_server_config.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/glossary_browser_omvs.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/glossary_manager_omvs.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/mermaid_utilities.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/my_profile_omvs.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/platform_services.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/project_manager_omvs.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/registered_info.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/runtime_manager_omvs.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/server_operations.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/utils.py +0 -0
- {pyegeria-0.7.26 → pyegeria-0.7.28}/pyegeria/valid_metadata_omvs.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyegeria
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.28
|
4
4
|
Summary: A python client for Egeria
|
5
5
|
Home-page: https://github.com/odpi/egeria-python
|
6
6
|
License: Apache 2.0
|
@@ -18,7 +18,7 @@ Requires-Dist: click (>=8.1.7,<9.0.0)
|
|
18
18
|
Requires-Dist: confluent-kafka (>=2.5.0,<3.0.0)
|
19
19
|
Requires-Dist: httpx (>=0.27.0,<0.28.0)
|
20
20
|
Requires-Dist: jupyter (>=1.0.0,<2.0.0)
|
21
|
-
Requires-Dist: mermaid (>=0.3
|
21
|
+
Requires-Dist: mermaid-py (>=0.5.3,<0.6.0)
|
22
22
|
Requires-Dist: pytest (>=8.2.2,<9.0.0)
|
23
23
|
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
24
24
|
Requires-Dist: rich (>=13.7.1,<14.0.0)
|
@@ -0,0 +1,174 @@
|
|
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 sys
|
9
|
+
import time
|
10
|
+
import argparse
|
11
|
+
import os
|
12
|
+
|
13
|
+
from rich import json
|
14
|
+
from rich.panel import Panel
|
15
|
+
|
16
|
+
from pyegeria import (
|
17
|
+
InvalidParameterException,
|
18
|
+
PropertyServerException,
|
19
|
+
UserNotAuthorizedException,
|
20
|
+
print_exception_response,
|
21
|
+
AutomatedCuration,
|
22
|
+
)
|
23
|
+
from rich.table import Table
|
24
|
+
from rich.live import Live
|
25
|
+
from rich.console import Console
|
26
|
+
from rich.markdown import Markdown
|
27
|
+
from rich.tree import Tree
|
28
|
+
from rich.prompt import Prompt
|
29
|
+
from rich.panel import Panel
|
30
|
+
from rich.text import Text
|
31
|
+
from rich import print
|
32
|
+
|
33
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
34
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
35
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
36
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
37
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
38
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
39
|
+
)
|
40
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
41
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
42
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
43
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
44
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
45
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
46
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
47
|
+
|
48
|
+
|
49
|
+
disable_ssl_warnings = True
|
50
|
+
console = Console(width=200)
|
51
|
+
|
52
|
+
guid_list = []
|
53
|
+
|
54
|
+
|
55
|
+
def tech_viewer(
|
56
|
+
tech_name: str,
|
57
|
+
server_name: str,
|
58
|
+
platform_url: str,
|
59
|
+
user: str,
|
60
|
+
user_pass: str,
|
61
|
+
jupyter: bool = EGERIA_JUPYTER,
|
62
|
+
width: int = EGERIA_WIDTH,
|
63
|
+
):
|
64
|
+
def build_classifications(classification: dict) -> Markdown:
|
65
|
+
class_md = "\n"
|
66
|
+
for c in classification:
|
67
|
+
c_type = c["classificationName"]
|
68
|
+
if c_type == "Anchors":
|
69
|
+
continue
|
70
|
+
class_md += f"* Classification: {c_type}\n"
|
71
|
+
class_props = c.get("classificationProperties", None)
|
72
|
+
if class_props is None:
|
73
|
+
continue
|
74
|
+
for prop in class_props.keys():
|
75
|
+
class_md += f"\t* {prop}: {class_props[prop]}\n"
|
76
|
+
if class_md == "-":
|
77
|
+
output = None
|
78
|
+
else:
|
79
|
+
output = class_md
|
80
|
+
return output
|
81
|
+
|
82
|
+
try:
|
83
|
+
console = Console(width=width, force_terminal=not jupyter)
|
84
|
+
|
85
|
+
a_client = AutomatedCuration(server_name, platform_url, user_id=user)
|
86
|
+
|
87
|
+
token = a_client.create_egeria_bearer_token(user, user_pass)
|
88
|
+
tech_elements = a_client.get_technology_type_elements(
|
89
|
+
tech_name, get_templates=False
|
90
|
+
)
|
91
|
+
if type(tech_elements) is str:
|
92
|
+
console.print(f"No elements found for {tech_name}")
|
93
|
+
sys.exit(1)
|
94
|
+
|
95
|
+
tree = Tree(
|
96
|
+
f"Deployed Technology Type: {tech_name}",
|
97
|
+
style="bold bright_white on black",
|
98
|
+
guide_style="bold bright_blue",
|
99
|
+
)
|
100
|
+
note: str = " "
|
101
|
+
for element in tech_elements:
|
102
|
+
header = element["elementHeader"]
|
103
|
+
tech_type = header["type"]["typeName"]
|
104
|
+
tech_collection = header["origin"]["homeMetadataCollectionName"]
|
105
|
+
tech_created_by = header["versions"]["createdBy"]
|
106
|
+
tech_created_at = header["versions"]["createTime"]
|
107
|
+
tech_guid = header["guid"]
|
108
|
+
tech_classifications = header["classifications"]
|
109
|
+
class_md = build_classifications(tech_classifications)
|
110
|
+
|
111
|
+
referenceables = element["referenceableProperties"]
|
112
|
+
tech_qualified_name = referenceables["qualifiedName"]
|
113
|
+
extended = referenceables["extendedProperties"]
|
114
|
+
ex_md: str = ""
|
115
|
+
for key, value in extended.items():
|
116
|
+
ex_md += f"* {key}: {value}\n"
|
117
|
+
|
118
|
+
note = (
|
119
|
+
f"* Qualified Name: {tech_qualified_name}\n"
|
120
|
+
f"* GUID: {tech_guid}\n"
|
121
|
+
f"* Created by: {tech_created_by}\n"
|
122
|
+
f"* Created at: {tech_created_at}\n"
|
123
|
+
f"* Home Collection: {tech_collection}\n"
|
124
|
+
f"{class_md}\n"
|
125
|
+
f"{ex_md}\n"
|
126
|
+
)
|
127
|
+
|
128
|
+
interfaces = extended.get("connectorInterfaces", None)
|
129
|
+
if interfaces is not None:
|
130
|
+
interface_type_name = interfaces["typeName"]
|
131
|
+
interface_array_cnt = interfaces["arrayCount"]
|
132
|
+
note += f"* Interface Type: {interface_type_name}\n"
|
133
|
+
for i in range(0, int(interface_array_cnt)):
|
134
|
+
note += (
|
135
|
+
f"\t* Type: {interfaces['arrayValues']['propertyValueMap'][str(i)]['typeName']}"
|
136
|
+
f"\tName: {interfaces['arrayValues']['propertiesAsStrings'][str(i)]}\n"
|
137
|
+
)
|
138
|
+
note_md = Panel.fit(Markdown(note), style="bold bright_white")
|
139
|
+
t = tree.add(note_md)
|
140
|
+
|
141
|
+
print(tree)
|
142
|
+
|
143
|
+
except (
|
144
|
+
InvalidParameterException,
|
145
|
+
PropertyServerException,
|
146
|
+
UserNotAuthorizedException,
|
147
|
+
) as e:
|
148
|
+
print_exception_response(e)
|
149
|
+
|
150
|
+
|
151
|
+
def main():
|
152
|
+
parser = argparse.ArgumentParser()
|
153
|
+
|
154
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
155
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
156
|
+
parser.add_argument("--userid", help="User Id")
|
157
|
+
parser.add_argument("--password", help="User Password")
|
158
|
+
args = parser.parse_args()
|
159
|
+
|
160
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
161
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
162
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
163
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
164
|
+
try:
|
165
|
+
tech_name = Prompt.ask(
|
166
|
+
"Enter the Asset Name to view:", default="Apache Kafka Server"
|
167
|
+
)
|
168
|
+
tech_viewer(tech_name, server, url, userid, user_pass)
|
169
|
+
except KeyboardInterrupt:
|
170
|
+
pass
|
171
|
+
|
172
|
+
|
173
|
+
if __name__ == "__main__":
|
174
|
+
main()
|
@@ -28,25 +28,35 @@ from pyegeria.glossary_browser_omvs import GlossaryBrowser
|
|
28
28
|
disable_ssl_warnings = True
|
29
29
|
|
30
30
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
31
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
32
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
33
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
34
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
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"))
|
44
|
+
|
45
|
+
|
46
|
+
def display_glossary_terms(
|
47
|
+
search_string: str,
|
48
|
+
guid: str,
|
49
|
+
server: str,
|
50
|
+
url: str,
|
51
|
+
username: str,
|
52
|
+
user_password: str,
|
53
|
+
jupyter: bool = EGERIA_JUPYTER,
|
54
|
+
width: int = EGERIA_WIDTH,
|
55
|
+
):
|
46
56
|
g_client = GlossaryBrowser(server, url)
|
47
57
|
token = g_client.create_egeria_bearer_token(username, user_password)
|
48
58
|
|
49
|
-
def generate_table(search_string: str =
|
59
|
+
def generate_table(search_string: str = "*") -> Table:
|
50
60
|
"""Make a new table."""
|
51
61
|
table = Table(
|
52
62
|
title=f"Glossary Definitions for Terms like {search_string} @ {time.asctime()}",
|
@@ -58,7 +68,7 @@ def display_glossary_terms(search_string: str, guid: str, server: str, url: str,
|
|
58
68
|
show_lines=True,
|
59
69
|
box=box.ROUNDED,
|
60
70
|
caption=f"Glossary View Server '{server}' @ Platform - {url}",
|
61
|
-
expand=True
|
71
|
+
expand=True,
|
62
72
|
)
|
63
73
|
table.add_column("Display Name")
|
64
74
|
table.add_column("Qualified Name")
|
@@ -67,13 +77,23 @@ def display_glossary_terms(search_string: str, guid: str, server: str, url: str,
|
|
67
77
|
table.add_column("Summary")
|
68
78
|
table.add_column("Description")
|
69
79
|
|
70
|
-
terms = g_client.find_glossary_terms(
|
71
|
-
|
80
|
+
terms = g_client.find_glossary_terms(
|
81
|
+
search_string,
|
82
|
+
guid,
|
83
|
+
starts_with=False,
|
84
|
+
ends_with=False,
|
85
|
+
status_filter=[],
|
86
|
+
page_size=500,
|
87
|
+
)
|
88
|
+
|
89
|
+
sorted_terms = sorted(
|
90
|
+
terms, key=lambda k: k["glossaryTermProperties"]["displayName"]
|
91
|
+
)
|
72
92
|
style = "bright_white on black"
|
73
93
|
if type(terms) is str:
|
74
94
|
return table
|
75
95
|
|
76
|
-
for term in
|
96
|
+
for term in sorted_terms:
|
77
97
|
props = term.get("glossaryTermProperties", "None")
|
78
98
|
if props == "None":
|
79
99
|
return table
|
@@ -85,7 +105,12 @@ def display_glossary_terms(search_string: str, guid: str, server: str, url: str,
|
|
85
105
|
description = Text(props.get("description", " "), style=style)
|
86
106
|
|
87
107
|
table.add_row(
|
88
|
-
display_name,
|
108
|
+
display_name,
|
109
|
+
qualified_name,
|
110
|
+
abbrev,
|
111
|
+
summary,
|
112
|
+
description,
|
113
|
+
style="bold white on black",
|
89
114
|
)
|
90
115
|
|
91
116
|
g_client.close_session()
|
@@ -96,12 +121,17 @@ def display_glossary_terms(search_string: str, guid: str, server: str, url: str,
|
|
96
121
|
# while True:
|
97
122
|
# time.sleep(2)
|
98
123
|
# live.update(generate_table(search_string))
|
99
|
-
console = Console(
|
124
|
+
console = Console(
|
125
|
+
style="bold bright_white on black", width=width, force_terminal=not jupyter
|
126
|
+
)
|
100
127
|
with console.pager(styles=True):
|
101
128
|
console.print(generate_table(search_string))
|
102
129
|
|
103
|
-
|
104
|
-
|
130
|
+
except (
|
131
|
+
InvalidParameterException,
|
132
|
+
PropertyServerException,
|
133
|
+
UserNotAuthorizedException,
|
134
|
+
) as e:
|
105
135
|
console.print_exception()
|
106
136
|
|
107
137
|
|
@@ -126,7 +156,7 @@ def main():
|
|
126
156
|
try:
|
127
157
|
search_string = Prompt.ask("Enter the term you are searching for:", default="*")
|
128
158
|
display_glossary_terms(search_string, guid, server, url, userid, user_pass)
|
129
|
-
except
|
159
|
+
except KeyboardInterrupt:
|
130
160
|
pass
|
131
161
|
|
132
162
|
|
@@ -29,23 +29,34 @@ from pyegeria import (
|
|
29
29
|
from pyegeria import ProjectManager, ClassificationManager
|
30
30
|
|
31
31
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
32
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
33
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
34
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
35
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
32
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
33
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
34
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
35
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
36
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
37
|
+
)
|
38
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
39
|
+
EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
|
40
|
+
"EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
|
41
|
+
)
|
42
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
43
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
44
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
45
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
46
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
47
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
48
|
+
|
49
|
+
|
50
|
+
def display_project_list(
|
51
|
+
project_name: str,
|
52
|
+
server: str,
|
53
|
+
url: str,
|
54
|
+
username: str,
|
55
|
+
user_pass: str,
|
56
|
+
save_output: bool,
|
57
|
+
jupyter: bool = EGERIA_JUPYTER,
|
58
|
+
width: int = EGERIA_WIDTH,
|
59
|
+
):
|
49
60
|
p_client = ProjectManager(server, url, user_id=username)
|
50
61
|
token = p_client.create_egeria_bearer_token(username, user_pass)
|
51
62
|
c_client = ClassificationManager(server, url, token)
|
@@ -58,7 +69,7 @@ def display_project_list(project_name: str, server: str, url: str,
|
|
58
69
|
show_lines=True,
|
59
70
|
box=box.ROUNDED,
|
60
71
|
caption=f"Project list for Server '{server}' @ Platform - {url}",
|
61
|
-
expand=True
|
72
|
+
expand=True,
|
62
73
|
)
|
63
74
|
|
64
75
|
table.add_column("Project Name")
|
@@ -74,7 +85,6 @@ def display_project_list(project_name: str, server: str, url: str,
|
|
74
85
|
table.add_column("End Date")
|
75
86
|
table.add_column("Contracts")
|
76
87
|
|
77
|
-
|
78
88
|
projects = p_client.find_projects(project_name)
|
79
89
|
|
80
90
|
if projects is None:
|
@@ -92,12 +102,16 @@ def display_project_list(project_name: str, server: str, url: str,
|
|
92
102
|
elif type(projects) == str:
|
93
103
|
raise ValueError("-->This is not a known project")
|
94
104
|
else:
|
95
|
-
|
105
|
+
sorted_projects = sorted(
|
106
|
+
projects, key=lambda k: k["properties"].get("name", "---")
|
107
|
+
)
|
108
|
+
|
109
|
+
for project in sorted_projects:
|
96
110
|
classification = ""
|
97
|
-
guid = project[
|
111
|
+
guid = project["elementHeader"]["guid"]
|
98
112
|
props = project["properties"]
|
99
113
|
name = props.get("name", "None")
|
100
|
-
p_class = project[
|
114
|
+
p_class = project["elementHeader"].get("classifications")
|
101
115
|
if p_class:
|
102
116
|
for classif in p_class:
|
103
117
|
classification += f"* {classif.get('classificationName')}\n"
|
@@ -109,28 +123,43 @@ def display_project_list(project_name: str, server: str, url: str,
|
|
109
123
|
description = props.get("description", " ")
|
110
124
|
start = props.get("startDate", " ")[0:10]
|
111
125
|
end = props.get("plannedEndDate", " ")
|
112
|
-
additional_properties = project.get(
|
126
|
+
additional_properties = project.get("additionalProperties")
|
113
127
|
if additional_properties is not None:
|
114
128
|
props = json.dumps(additional_properties)
|
115
129
|
|
116
|
-
governed_by = c_client.get_related_elements(guid,
|
130
|
+
governed_by = c_client.get_related_elements(guid, "GovernedBy")
|
117
131
|
if type(governed_by) is list:
|
118
132
|
for gov in governed_by:
|
119
|
-
rel_guid = gov[
|
120
|
-
rel_title = gov[
|
121
|
-
|
122
|
-
|
133
|
+
rel_guid = gov["relatedElement"]["elementHeader"]["guid"]
|
134
|
+
rel_title = gov["relatedElement"]["properties"].get(
|
135
|
+
"title", "---"
|
136
|
+
)
|
137
|
+
certified_partner = f"{rel_title}: \n"
|
138
|
+
certified = c_client.get_related_elements(
|
139
|
+
rel_guid, "Certification"
|
140
|
+
)
|
123
141
|
if type(certified) is list:
|
124
|
-
|
125
|
-
p_name = rel_elem[
|
142
|
+
for rel_elem in certified:
|
143
|
+
p_name = rel_elem["relatedElement"]["properties"][
|
144
|
+
"name"
|
145
|
+
]
|
126
146
|
certified_partner += f"* {p_name}\n"
|
127
147
|
else:
|
128
148
|
certified_partner = "---"
|
129
149
|
|
130
|
-
|
131
150
|
table.add_row(
|
132
|
-
name,
|
133
|
-
|
151
|
+
name,
|
152
|
+
description,
|
153
|
+
classification,
|
154
|
+
qualified_name,
|
155
|
+
identifier,
|
156
|
+
phase,
|
157
|
+
health,
|
158
|
+
status,
|
159
|
+
start,
|
160
|
+
end,
|
161
|
+
certified_partner,
|
162
|
+
)
|
134
163
|
|
135
164
|
p_client.close_session()
|
136
165
|
return table
|
@@ -140,13 +169,20 @@ def display_project_list(project_name: str, server: str, url: str,
|
|
140
169
|
# while True:
|
141
170
|
# time.sleep(2)
|
142
171
|
# live.update(generate_table())
|
143
|
-
console = Console(
|
172
|
+
console = Console(
|
173
|
+
record=True, width=width, force_terminal=not jupyter, soft_wrap=True
|
174
|
+
)
|
144
175
|
with console.pager():
|
145
176
|
console.print(generate_table(project_name), soft_wrap=True)
|
146
177
|
if save_output:
|
147
178
|
console.save_html("projects.html")
|
148
179
|
|
149
|
-
except (
|
180
|
+
except (
|
181
|
+
InvalidParameterException,
|
182
|
+
PropertyServerException,
|
183
|
+
UserNotAuthorizedException,
|
184
|
+
ValueError,
|
185
|
+
) as e:
|
150
186
|
if type(e) is str:
|
151
187
|
print(e)
|
152
188
|
else:
|
@@ -14,33 +14,38 @@ from pyegeria import (
|
|
14
14
|
PropertyServerException,
|
15
15
|
UserNotAuthorizedException,
|
16
16
|
print_exception_response,
|
17
|
-
|
17
|
+
ClassificationManager,
|
18
18
|
)
|
19
19
|
|
20
20
|
|
21
21
|
console = Console()
|
22
22
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
23
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
24
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
25
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
26
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
23
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
24
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
25
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
26
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
27
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
28
|
+
)
|
29
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
30
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
31
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
32
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
33
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
34
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
35
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
36
|
+
|
37
|
+
|
38
|
+
def list_user_ids(
|
39
|
+
server: str,
|
40
|
+
url: str,
|
41
|
+
username: str,
|
42
|
+
password: str,
|
43
|
+
jupyter: bool = EGERIA_JUPYTER,
|
44
|
+
width: int = EGERIA_WIDTH,
|
39
45
|
):
|
40
|
-
|
41
46
|
c_client = ClassificationManager(server, url, user_id=username, user_pwd=password)
|
42
47
|
token = c_client.create_egeria_bearer_token()
|
43
|
-
elements = c_client.get_elements(
|
48
|
+
elements = c_client.get_elements("UserIdentity")
|
44
49
|
|
45
50
|
def generate_table() -> Table:
|
46
51
|
"""Make a new table."""
|
@@ -61,27 +66,38 @@ def list_user_ids(server: str,
|
|
61
66
|
table.add_column("Job Title")
|
62
67
|
table.add_column("UserId")
|
63
68
|
table.add_column("Created")
|
64
|
-
table.add_column("GUID", width
|
69
|
+
table.add_column("GUID", width=38, no_wrap=True)
|
65
70
|
table.add_column("Qualified Name")
|
66
71
|
|
67
|
-
|
68
72
|
if type(elements) is list:
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
73
|
+
sorted_elements = sorted(
|
74
|
+
elements, key=lambda i: i["properties"].get("userId", "---")
|
75
|
+
)
|
76
|
+
for element in sorted_elements:
|
77
|
+
header = element["elementHeader"]
|
78
|
+
el_q_name = element["properties"].get("qualifiedName", "---")
|
79
|
+
el_create_time = header["versions"]["createTime"][:-10]
|
80
|
+
el_guid = header["guid"]
|
81
|
+
el_user_id = element["properties"].get("userId", "---")
|
82
|
+
full_name = ""
|
83
|
+
job = ""
|
84
|
+
|
85
|
+
profile = c_client.get_related_elements(el_guid, "ProfileIdentity")
|
79
86
|
if type(profile) is list:
|
80
87
|
for rel in profile:
|
81
|
-
full_name = rel[
|
82
|
-
|
83
|
-
|
84
|
-
|
88
|
+
full_name = rel["relatedElement"]["properties"].get(
|
89
|
+
"fullName", "---"
|
90
|
+
)
|
91
|
+
job = rel["relatedElement"]["properties"].get("jobTitle", "---")
|
92
|
+
|
93
|
+
table.add_row(
|
94
|
+
full_name,
|
95
|
+
job,
|
96
|
+
el_user_id,
|
97
|
+
el_create_time,
|
98
|
+
el_guid,
|
99
|
+
el_q_name,
|
100
|
+
)
|
85
101
|
|
86
102
|
return table
|
87
103
|
else:
|
@@ -94,7 +110,11 @@ def list_user_ids(server: str,
|
|
94
110
|
with console.pager(styles=True):
|
95
111
|
console.print(generate_table())
|
96
112
|
|
97
|
-
except (
|
113
|
+
except (
|
114
|
+
InvalidParameterException,
|
115
|
+
PropertyServerException,
|
116
|
+
UserNotAuthorizedException,
|
117
|
+
) as e:
|
98
118
|
print_exception_response(e)
|
99
119
|
print("Perhaps the type name isn't known")
|
100
120
|
finally:
|
@@ -117,12 +137,9 @@ def main():
|
|
117
137
|
|
118
138
|
try:
|
119
139
|
list_user_ids(server, url, userid, password)
|
120
|
-
except
|
140
|
+
except KeyboardInterrupt:
|
121
141
|
pass
|
122
142
|
|
123
143
|
|
124
144
|
if __name__ == "__main__":
|
125
145
|
main()
|
126
|
-
|
127
|
-
|
128
|
-
|