pyegeria 0.3.9__py3-none-any.whl → 0.4.0__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/Xfeedback_manager_omvs.py +2 -15
- pyegeria/__init__.py +11 -4
- pyegeria/_globals.py +3 -1
- pyegeria/{Xasset_catalog_omvs.py → asset_catalog_omvs.py} +242 -109
- pyegeria/automated_curation_omvs.py +324 -61
- pyegeria/core_guids.py +128 -0
- pyegeria/{Xglossary_manager_omvs.py → glossary_manager_omvs.py} +70 -69
- pyegeria/runtime_manager_omvs.py +967 -0
- pyegeria/valid_metadata_omvs.py +193 -20
- pyegeria-0.4.0.data/scripts/get_guid_info.py +86 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.0.data}/scripts/get_tech_details.py +1 -37
- pyegeria-0.4.0.data/scripts/get_tech_type_elements.py +137 -0
- pyegeria-0.4.0.data/scripts/get_tech_type_template.py +137 -0
- pyegeria-0.4.0.data/scripts/list_assets.py +138 -0
- pyegeria-0.3.9.data/scripts/project_list_viewer.py → pyegeria-0.4.0.data/scripts/list_projects.py +1 -1
- pyegeria-0.3.9.data/scripts/get_relationship_types.py → pyegeria-0.4.0.data/scripts/list_relationship_types.py +9 -8
- pyegeria-0.4.0.data/scripts/list_tech_templates.py +134 -0
- pyegeria-0.3.9.data/scripts/find_todos.py → pyegeria-0.4.0.data/scripts/list_todos.py +2 -1
- pyegeria-0.4.0.data/scripts/list_valid_metadata_values.py +144 -0
- pyegeria-0.4.0.data/scripts/view_asset_graph.py +236 -0
- pyegeria-0.3.9.data/scripts/engine_action_status.py → pyegeria-0.4.0.data/scripts/view_eng_action_status.py +8 -3
- pyegeria-0.3.9.data/scripts/integration_daemon_status.py → pyegeria-0.4.0.data/scripts/view_integ_daemon_status.py +30 -42
- pyegeria-0.4.0.data/scripts/view_platform_status.py +123 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.0.dist-info}/METADATA +5 -2
- pyegeria-0.4.0.dist-info/RECORD +58 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.0.dist-info}/WHEEL +1 -1
- pyegeria-0.3.9.data/scripts/multi-server_status.py +0 -120
- pyegeria-0.3.9.dist-info/RECORD +0 -49
- /pyegeria/{Xaction_author_omvs.py → action_author_omvs.py} +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.0.data}/scripts/Create_Collection_Sample.py +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.0.data}/scripts/Create_Sustainability_Collection_Sample.py +0 -0
- /pyegeria-0.3.9.data/scripts/view_my_profile.py → /pyegeria-0.4.0.data/scripts/get_my_profile.py +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.0.data}/scripts/list_asset_types.py +0 -0
- /pyegeria-0.3.9.data/scripts/get_registered_services.py → /pyegeria-0.4.0.data/scripts/list_registered_services.py +0 -0
- /pyegeria-0.3.9.data/scripts/get_tech_types.py → /pyegeria-0.4.0.data/scripts/list_tech_types.py +0 -0
- /pyegeria-0.3.9.data/scripts/coco_status.py → /pyegeria-0.4.0.data/scripts/view_coco_status.py +0 -0
- /pyegeria-0.3.9.data/scripts/collection_viewer.py → /pyegeria-0.4.0.data/scripts/view_collection.py +0 -0
- /pyegeria-0.3.9.data/scripts/glossary_view.py → /pyegeria-0.4.0.data/scripts/view_glossary.py +0 -0
- /pyegeria-0.3.9.data/scripts/gov_engine_status.py → /pyegeria-0.4.0.data/scripts/view_gov_eng_status.py +0 -0
- /pyegeria-0.3.9.data/scripts/my_todos.py → /pyegeria-0.4.0.data/scripts/view_my_todos.py +0 -0
- /pyegeria-0.3.9.data/scripts/open_todos.py → /pyegeria-0.4.0.data/scripts/view_open_todos.py +0 -0
- /pyegeria-0.3.9.data/scripts/server_status_widget.py → /pyegeria-0.4.0.data/scripts/view_server_list.py +0 -0
- /pyegeria-0.3.9.data/scripts/server_status.py → /pyegeria-0.4.0.data/scripts/view_server_status.py +0 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.0.dist-info}/LICENSE +0 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,236 @@
|
|
1
|
+
#!python
|
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
|
+
|
12
|
+
from rich import json
|
13
|
+
from rich.panel import Panel
|
14
|
+
|
15
|
+
from pyegeria import (
|
16
|
+
InvalidParameterException,
|
17
|
+
PropertyServerException,
|
18
|
+
UserNotAuthorizedException,
|
19
|
+
print_exception_response,
|
20
|
+
AssetCatalog
|
21
|
+
)
|
22
|
+
from rich.table import Table
|
23
|
+
from rich.live import Live
|
24
|
+
from rich.console import Console
|
25
|
+
from rich.markdown import Markdown
|
26
|
+
from rich.tree import Tree
|
27
|
+
from rich.prompt import Prompt
|
28
|
+
from rich.panel import Panel
|
29
|
+
from rich.text import Text
|
30
|
+
from rich import print
|
31
|
+
|
32
|
+
disable_ssl_warnings = True
|
33
|
+
console = Console(width=200)
|
34
|
+
|
35
|
+
platform = "https://127.0.0.1:9443"
|
36
|
+
user = "erinoverview"
|
37
|
+
view_server = "view-server"
|
38
|
+
|
39
|
+
guid_list = []
|
40
|
+
|
41
|
+
def asset_viewer(asset_name: str, server_name:str, platform_url:str, user:str):
|
42
|
+
|
43
|
+
def build_classifications(classification: dict) -> Markdown:
|
44
|
+
|
45
|
+
class_md = "-"
|
46
|
+
for c in classification:
|
47
|
+
c_type = c["classificationName"]
|
48
|
+
if c_type == "Anchors":
|
49
|
+
continue
|
50
|
+
class_md += f"* Classification: {c_type}\n"
|
51
|
+
class_props = c["classificationProperties"]
|
52
|
+
for prop in class_props.keys():
|
53
|
+
class_md += f"* {prop}: {class_props[prop]}\n"
|
54
|
+
if class_md == "-":
|
55
|
+
output = None
|
56
|
+
else:
|
57
|
+
output = class_md
|
58
|
+
return output
|
59
|
+
|
60
|
+
def build_nested_elements(nested_element: dict) -> Markdown:
|
61
|
+
ne_md = " "
|
62
|
+
|
63
|
+
ne_created_by = nested_element["versions"]["createdBy"]
|
64
|
+
ne_created_at = nested_element["versions"]["createTime"]
|
65
|
+
ne_guid = nested_element["guid"]
|
66
|
+
guid_list.append(ne_guid)
|
67
|
+
|
68
|
+
ne_type = nested_element["type"]["typeName"]
|
69
|
+
ne_classifications = nested_element["classifications"]
|
70
|
+
ne_class_md = build_classifications(ne_classifications)
|
71
|
+
# ne_class_md = " " if ne_class_md is None else ne_class_md
|
72
|
+
ne_props = nested_element["properties"]
|
73
|
+
|
74
|
+
ne_prop_md = ""
|
75
|
+
for prop in ne_props.keys():
|
76
|
+
ne_prop_md += f"* {prop}: {ne_props[prop]}\n"
|
77
|
+
ne_md = (f"Nested Element of Type: {ne_type} with GUID: {ne_guid} \n "
|
78
|
+
f"* created by {ne_created_by} at time {ne_created_at}\n"
|
79
|
+
f"{ne_prop_md}\n")
|
80
|
+
if ne_class_md is not None:
|
81
|
+
ne_md += f"* {ne_class_md}"
|
82
|
+
|
83
|
+
output = Markdown(ne_md)
|
84
|
+
return output
|
85
|
+
|
86
|
+
try:
|
87
|
+
|
88
|
+
console = Console(width=200)
|
89
|
+
|
90
|
+
a_client = AssetCatalog(view_server, platform,
|
91
|
+
user_id=user)
|
92
|
+
|
93
|
+
token = a_client.create_egeria_bearer_token(user, "secret")
|
94
|
+
asset_info = a_client.find_assets_in_domain(asset_name)
|
95
|
+
asset_guid = asset_info[0]['guid']
|
96
|
+
guid_list.append(asset_guid)
|
97
|
+
|
98
|
+
asset_graph = a_client.get_asset_graph(asset_guid)
|
99
|
+
if type(asset_graph) is not dict:
|
100
|
+
print(f"\n No Asset found for {asset_name}")
|
101
|
+
sys.exit(1)
|
102
|
+
|
103
|
+
# print(f"\n{json.dumps(asset_graph, indent =2)}\n")
|
104
|
+
tree = Tree(f"{asset_name} ({asset_guid})", style = "bold bright_white",guide_style="bold bright_blue")
|
105
|
+
style = ""
|
106
|
+
|
107
|
+
asset_name = asset_graph["displayName"]
|
108
|
+
qualified_name = asset_graph["qualifiedName"]
|
109
|
+
resource_name = asset_graph["resourceName"]
|
110
|
+
|
111
|
+
asset_type = asset_graph["type"]["typeName"]
|
112
|
+
asset_origin = asset_graph["origin"]["homeMetadataCollectionName"]
|
113
|
+
asset_creation = asset_graph["versions"]["createTime"]
|
114
|
+
asset_created_by = asset_graph["versions"]["createdBy"]
|
115
|
+
asset_classifications = asset_graph["classifications"]
|
116
|
+
asset_nested_elements = asset_graph["anchoredElements"]
|
117
|
+
asset_relationships = asset_graph["relationships"]
|
118
|
+
asset_class_md = build_classifications(asset_classifications)
|
119
|
+
|
120
|
+
|
121
|
+
asset_properties = asset_graph["extendedProperties"]
|
122
|
+
prop_md = ""
|
123
|
+
for prop in asset_properties:
|
124
|
+
prop_md = f"{prop_md}* {prop}: {asset_properties[prop]}\n"
|
125
|
+
|
126
|
+
core_md = (f"**Type: {asset_type} Created by: {asset_created_by} on {asset_creation}**\n"
|
127
|
+
f"* Qualified Name: {qualified_name}\n "
|
128
|
+
f"* Resource Name: {resource_name}\n"
|
129
|
+
f"* Display Name: {asset_name}\n"
|
130
|
+
f"* Asset Origin: {asset_origin}\n{prop_md}"
|
131
|
+
)
|
132
|
+
core_md = Markdown(core_md)
|
133
|
+
p1 = Panel.fit(core_md, style = "bold bright_white")
|
134
|
+
l2 = tree.add(p1)
|
135
|
+
if asset_class_md is not None:
|
136
|
+
p2 = Panel.fit(Markdown(asset_class_md), style = "bold bright_white")
|
137
|
+
l2 = tree.add(p2)
|
138
|
+
|
139
|
+
#
|
140
|
+
# Nested Assets
|
141
|
+
#
|
142
|
+
l2 = tree.add("Nested Elements", style = "bold white")
|
143
|
+
for el in asset_nested_elements:
|
144
|
+
asset_ne_md = build_nested_elements(el)
|
145
|
+
p3 = Panel.fit(asset_ne_md, style = "bold bright_white", title="Nested Elements")
|
146
|
+
l2.add(p3)
|
147
|
+
|
148
|
+
#
|
149
|
+
# Now work on the Relationships
|
150
|
+
#
|
151
|
+
for relationship in asset_relationships:
|
152
|
+
# Find the end guids - if one isn't in our list then display
|
153
|
+
rel_end1 = relationship["end1"]
|
154
|
+
rel_end1_type = rel_end1["type"]["typeName"]
|
155
|
+
rel_end1_guid = rel_end1["guid"]
|
156
|
+
rel_end1_unique_name = rel_end1["uniqueName"]
|
157
|
+
|
158
|
+
rel_end2 = relationship["end2"]
|
159
|
+
rel_end2_type = rel_end2["type"]["typeName"]
|
160
|
+
rel_end2_guid = rel_end2["guid"]
|
161
|
+
rel_end2_unique_name = rel_end2["uniqueName"]
|
162
|
+
|
163
|
+
if (rel_end1_guid not in guid_list) or (rel_end2_guid not in guid_list):
|
164
|
+
rel_end1_class_md = build_classifications(rel_end1["classifications"])
|
165
|
+
rel_end2_class_md = build_classifications(rel_end2["classifications"])
|
166
|
+
|
167
|
+
relationship_guid = relationship["guid"]
|
168
|
+
relationship_type = relationship["type"]["typeName"]
|
169
|
+
relationship_created_by = relationship["versions"]["createdBy"]
|
170
|
+
relationship_creation_time = relationship["versions"]["createTime"]
|
171
|
+
relationship_properties = relationship.get("properties"," ")
|
172
|
+
relationship_md = (f"Relationship Type {relationship_type}\n"
|
173
|
+
f"* GUID: {relationship_guid}\n* Created by: {relationship_created_by} \n"
|
174
|
+
f"* Creation Time: {relationship_creation_time}\n"
|
175
|
+
f"* Properties: {relationship_properties}\n")
|
176
|
+
|
177
|
+
|
178
|
+
rel_md = (
|
179
|
+
f"* Relationship Type: {relationship_type}\n"
|
180
|
+
f"* Relationship GUID: {relationship_guid}\n"
|
181
|
+
f"* Created by: {relationship_created_by} at time {relationship_creation_time}\n"
|
182
|
+
)
|
183
|
+
rel_end1_md = (
|
184
|
+
f"* End1:\n"
|
185
|
+
f"\t* Type: {rel_end1_type}\n"
|
186
|
+
f"\t* GUID: {rel_end1_guid}\n"
|
187
|
+
f"\t* Unique Name: {rel_end1_unique_name}\n"
|
188
|
+
)
|
189
|
+
|
190
|
+
if rel_end1_class_md is not None:
|
191
|
+
rel_end1_md = rel_end1_md + rel_end1_class_md
|
192
|
+
|
193
|
+
rel_end2_md = (
|
194
|
+
f"* End1:\n"
|
195
|
+
f"\t* Type: {rel_end2_type}\n"
|
196
|
+
f"\t* GUID: {rel_end2_guid}\n"
|
197
|
+
f"\t* Unique Name: {rel_end2_unique_name}\n"
|
198
|
+
)
|
199
|
+
|
200
|
+
if rel_end2_class_md is not None:
|
201
|
+
rel_end1_md = rel_end2_md + rel_end2_class_md
|
202
|
+
#
|
203
|
+
# for prop in relationship_properties.keys():
|
204
|
+
# relationship_md += f"* {prop}: {relationship_properties[prop]}\n"
|
205
|
+
|
206
|
+
relationship_md += rel_end1_md + rel_end2_md
|
207
|
+
|
208
|
+
relationship_panel = Panel.fit(Markdown(relationship_md), style="bold bright_white")
|
209
|
+
tree.add(relationship_panel)
|
210
|
+
|
211
|
+
|
212
|
+
print("\n\n")
|
213
|
+
print(tree)
|
214
|
+
|
215
|
+
except (
|
216
|
+
InvalidParameterException,
|
217
|
+
PropertyServerException,
|
218
|
+
UserNotAuthorizedException
|
219
|
+
) as e:
|
220
|
+
print_exception_response(e)
|
221
|
+
|
222
|
+
|
223
|
+
if __name__ == "__main__":
|
224
|
+
parser = argparse.ArgumentParser()
|
225
|
+
|
226
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
227
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
228
|
+
parser.add_argument("--userid", help="User Id")
|
229
|
+
args = parser.parse_args()
|
230
|
+
|
231
|
+
server = args.server if args.server is not None else "view-server"
|
232
|
+
url = args.url if args.url is not None else "https://localhost:9443"
|
233
|
+
userid = args.userid if args.userid is not None else 'erinoverview'
|
234
|
+
|
235
|
+
asset_name = Prompt.ask("Enter the Asset Name to view:", default="TransMorg-Clinical-Trials-Weeklies")
|
236
|
+
asset_viewer(asset_name,server, url, userid)
|
@@ -17,6 +17,7 @@ import time
|
|
17
17
|
from rich import box
|
18
18
|
from rich.console import Console
|
19
19
|
from rich.table import Table
|
20
|
+
from rich.live import Live
|
20
21
|
|
21
22
|
from pyegeria import AutomatedCuration
|
22
23
|
from pyegeria import (
|
@@ -102,9 +103,13 @@ def display_status_engine_actions(server: str, url: str, user: str):
|
|
102
103
|
return table
|
103
104
|
|
104
105
|
try:
|
105
|
-
console = Console()
|
106
|
-
with console.pager():
|
107
|
-
|
106
|
+
# console = Console()
|
107
|
+
# with console.pager():
|
108
|
+
# console.print(generate_table())
|
109
|
+
with Live(generate_table(), refresh_per_second=1, screen=True, vertical_overflow="visible") as live:
|
110
|
+
while True:
|
111
|
+
time.sleep(2)
|
112
|
+
live.update(generate_table())
|
108
113
|
|
109
114
|
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
|
110
115
|
print_exception_response(e)
|
@@ -3,51 +3,38 @@
|
|
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
6
|
|
7
|
+
A simple status display for the Integration Daemon.
|
8
|
+
|
9
|
+
Note that there are a couple of assumptions currently being made that need to get resolved in future
|
10
|
+
versions. First, we assume that the view-server used by AutomatedCuration is called "view-server". Second, we
|
11
|
+
assume that the user password is always "secret".
|
8
12
|
|
9
|
-
A simple status display for Engine Actions
|
10
13
|
"""
|
11
14
|
|
12
15
|
import argparse
|
13
|
-
import json
|
14
16
|
import time
|
15
17
|
|
16
18
|
from rich import box
|
17
19
|
from rich.live import Live
|
20
|
+
from rich.markdown import Markdown
|
18
21
|
from rich.table import Table
|
19
|
-
from rich import console
|
20
22
|
|
23
|
+
from pyegeria import ServerOps, AutomatedCuration
|
21
24
|
from pyegeria._exceptions import (
|
22
25
|
InvalidParameterException,
|
23
26
|
PropertyServerException,
|
24
27
|
UserNotAuthorizedException,
|
25
28
|
print_exception_response,
|
26
29
|
)
|
27
|
-
from pyegeria.server_operations import ServerOps
|
28
30
|
|
29
31
|
disable_ssl_warnings = True
|
30
32
|
|
31
|
-
good_platform1_url = "https://127.0.0.1:9443"
|
32
|
-
good_platform2_url = "https://egeria.pdr-associates.com:7443"
|
33
|
-
bad_platform1_url = "https://localhost:9443"
|
34
|
-
|
35
|
-
good_user_1 = "garygeeke"
|
36
|
-
good_user_2 = "erinoverview"
|
37
|
-
bad_user_1 = "eviledna"
|
38
|
-
bad_user_2 = ""
|
39
|
-
|
40
|
-
good_server_1 = "active-metadata-store"
|
41
|
-
good_server_2 = "simple-metadata-store"
|
42
|
-
good_server_3 = "view-server"
|
43
|
-
good_server_4 = "engine-host"
|
44
|
-
bad_server_1 = "coco"
|
45
|
-
bad_server_2 = ""
|
46
33
|
|
47
|
-
|
48
|
-
def display_integration_daemon_status(server: str = good_server_4, url: str = good_platform1_url,
|
49
|
-
user: str = good_user_1):
|
34
|
+
def display_integration_daemon_status(server: str, url: str, user: str):
|
50
35
|
s_client = ServerOps(server, url, user)
|
36
|
+
a_client = AutomatedCuration("view-server", url, user, "secret")
|
37
|
+
token = a_client.create_egeria_bearer_token()
|
51
38
|
|
52
39
|
def generate_table() -> Table:
|
53
40
|
"""Make a new table."""
|
@@ -71,34 +58,35 @@ def display_integration_daemon_status(server: str = good_server_4, url: str = go
|
|
71
58
|
daemon_status = s_client.get_integration_daemon_status()
|
72
59
|
connector_reports = daemon_status["integrationConnectorReports"]
|
73
60
|
for connector in connector_reports:
|
74
|
-
connector_name = connector
|
75
|
-
connector_status = connector
|
76
|
-
|
77
|
-
|
78
|
-
|
61
|
+
connector_name = connector.get("connectorName", "---")
|
62
|
+
connector_status = connector.get("connectorStatus", "---")
|
63
|
+
connector_guid = connector["connectorGUID"]
|
64
|
+
last_refresh_time = connector.get("lastRefreshTime", "---")
|
65
|
+
refresh_interval = str(connector.get("minMinutesBetweenRefresh", "---"))
|
79
66
|
exception_msg = " "
|
80
67
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
68
|
+
targets = a_client.get_catalog_targets(connector_guid)
|
69
|
+
if type(targets) == list:
|
70
|
+
targets_m = "\n"
|
71
|
+
for target in targets:
|
72
|
+
t_name = target["catalogTargetName"]
|
73
|
+
t_sync = target["permittedSynchronization"]
|
74
|
+
t_unique_name = target["catalogTargetElement"]["uniqueName"]
|
75
|
+
targets_m += f"* Target Name: __{t_name}__\n* Sync: {t_sync}\n* Unique Name: {t_unique_name}\n\n"
|
76
|
+
targets_md = Markdown(targets_m)
|
77
|
+
else:
|
78
|
+
targets_md = " "
|
85
79
|
|
86
80
|
if connector_status in ("RUNNING", "REFRESHING", "WAITING"):
|
87
81
|
connector_status = f"[green]{connector_status}"
|
88
|
-
elif connector_status in ("INITIALIZE FAILED","CONFIG_FAILED","FAILED"):
|
82
|
+
elif connector_status in ("INITIALIZE FAILED", "CONFIG_FAILED", "FAILED"):
|
89
83
|
connector_status = f"[red]{connector_status}"
|
90
84
|
else:
|
91
85
|
connector_status = f"[yellow]{connector_status}"
|
92
86
|
|
93
|
-
# target= action.get("actionTargetElements","Empty")
|
94
|
-
# if type(target) is list:
|
95
|
-
# target_element = json.dumps(target[0]["targetElement"]["elementProperties"]["propertiesAsStrings"])
|
96
|
-
# else:
|
97
|
-
# target_element = " "
|
98
|
-
|
99
87
|
table.add_row(
|
100
|
-
connector_name,connector_status,last_refresh_time,refresh_interval,
|
101
|
-
|
88
|
+
connector_name, connector_status, last_refresh_time, refresh_interval,
|
89
|
+
targets_md, exception_msg
|
102
90
|
)
|
103
91
|
return table
|
104
92
|
|
@@ -119,7 +107,7 @@ def display_integration_daemon_status(server: str = good_server_4, url: str = go
|
|
119
107
|
|
120
108
|
if __name__ == "__main__":
|
121
109
|
parser = argparse.ArgumentParser()
|
122
|
-
parser.add_argument("--server", help="Name of the server to display status for")
|
110
|
+
parser.add_argument("--server", help="Name of the integration server to display status for")
|
123
111
|
parser.add_argument("--url", help="URL Platform to connect to")
|
124
112
|
parser.add_argument("--userid", help="User Id")
|
125
113
|
args = parser.parse_args()
|
@@ -0,0 +1,123 @@
|
|
1
|
+
#!python
|
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
|
+
|
9
|
+
import time
|
10
|
+
import argparse
|
11
|
+
|
12
|
+
from pyegeria._exceptions import (
|
13
|
+
InvalidParameterException,
|
14
|
+
PropertyServerException,
|
15
|
+
UserNotAuthorizedException,
|
16
|
+
print_exception_response,
|
17
|
+
)
|
18
|
+
from rich.table import Table
|
19
|
+
from rich.live import Live
|
20
|
+
from rich.console import Console
|
21
|
+
|
22
|
+
from pyegeria import RuntimeManager
|
23
|
+
|
24
|
+
disable_ssl_warnings = True
|
25
|
+
console = Console(width=200)
|
26
|
+
|
27
|
+
def display_status(server: str, url: str, username: str):
|
28
|
+
r_client = RuntimeManager(server, url, username)
|
29
|
+
token = r_client.create_egeria_bearer_token(username, "secret")
|
30
|
+
def generate_table() -> Table:
|
31
|
+
"""Make a new table."""
|
32
|
+
table = Table(
|
33
|
+
title=f"Server Status for Platform - {time.asctime()}",
|
34
|
+
# style = "black on grey66",
|
35
|
+
header_style="white on dark_blue",
|
36
|
+
caption=f"Status of Platforms - '{url}'",
|
37
|
+
show_lines=True,
|
38
|
+
# expand=True
|
39
|
+
)
|
40
|
+
table.add_column("Platform Name")
|
41
|
+
# table.add_column("Platform GUID")
|
42
|
+
table.add_column("Platform URL")
|
43
|
+
table.add_column("Platform Origin")
|
44
|
+
table.add_column("Description")
|
45
|
+
table.add_column("Platform Started")
|
46
|
+
table.add_column("Servers")
|
47
|
+
|
48
|
+
server_types = {
|
49
|
+
"Metadata Access Store": "Store",
|
50
|
+
"View Server" : "View",
|
51
|
+
"Engine Host Server" : "EngineHost",
|
52
|
+
"Integration Daemon" : "Integration"
|
53
|
+
}
|
54
|
+
|
55
|
+
platform_list = r_client.get_platforms_by_type()
|
56
|
+
for platform in platform_list:
|
57
|
+
platform_name = platform['properties']["name"]
|
58
|
+
platform_guid = platform['elementHeader']["guid"]
|
59
|
+
platform_desc = platform['properties']["description"]
|
60
|
+
server_list = ""
|
61
|
+
try:
|
62
|
+
platform_report = r_client.get_platform_report(platform_guid)
|
63
|
+
platform_url = platform_report.get('platformURLRoot'," ")
|
64
|
+
platform_origin = platform_report.get("platformOrigin"," ")
|
65
|
+
platform_started = platform_report.get("platformStartTime"," ")
|
66
|
+
|
67
|
+
servers = platform_report.get("omagservers",None)
|
68
|
+
|
69
|
+
if servers is not None:
|
70
|
+
for server in servers:
|
71
|
+
server_name = server.get("serverName"," ")
|
72
|
+
server_type = server.get("serverType"," ")
|
73
|
+
server_status = server.get("serverActiveStatus","UNKNOWN")
|
74
|
+
if server_status in("RUNNING", "STARTING"):
|
75
|
+
status_flag = "[green]"
|
76
|
+
elif server_status in ("INACTIVE", "STOPPING"):
|
77
|
+
status_flag = "[red]"
|
78
|
+
else:
|
79
|
+
server_status = "UNKNOWN"
|
80
|
+
status_flag = "[yellow]"
|
81
|
+
|
82
|
+
serv = f"{status_flag}{server_types[server_type]}: {server_name}\n"
|
83
|
+
server_list = server_list + serv
|
84
|
+
|
85
|
+
except (Exception) as e:
|
86
|
+
# console.print_exception(e)
|
87
|
+
platform_url = " "
|
88
|
+
platform_origin = " "
|
89
|
+
platform_started = " "
|
90
|
+
|
91
|
+
table.add_row(platform_name, platform_url, platform_origin, platform_desc,
|
92
|
+
platform_started, server_list)
|
93
|
+
|
94
|
+
|
95
|
+
return table
|
96
|
+
|
97
|
+
|
98
|
+
try:
|
99
|
+
with Live(generate_table(), refresh_per_second=4, screen=True) as live:
|
100
|
+
while True:
|
101
|
+
time.sleep(2)
|
102
|
+
live.update(generate_table())
|
103
|
+
|
104
|
+
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
|
105
|
+
print_exception_response(e)
|
106
|
+
|
107
|
+
|
108
|
+
finally:
|
109
|
+
r_client.close_session()
|
110
|
+
|
111
|
+
|
112
|
+
if __name__ == "__main__":
|
113
|
+
parser = argparse.ArgumentParser()
|
114
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
115
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
116
|
+
parser.add_argument("--userid", help="User Id")
|
117
|
+
args = parser.parse_args()
|
118
|
+
|
119
|
+
server = args.server if args.server is not None else "view-server"
|
120
|
+
url = args.url if args.url is not None else "https://localhost:9443"
|
121
|
+
userid = args.userid if args.userid is not None else 'erinoverview'
|
122
|
+
|
123
|
+
display_status(server, url, userid)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyegeria
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.4.0
|
4
4
|
Summary: A python client for Egeria
|
5
5
|
Home-page: https://egeria-project.org/egeria-python
|
6
6
|
Author: Dan Wolfson
|
@@ -38,13 +38,16 @@ open metadata environment from python. Details about the
|
|
38
38
|
open source Egeria project can be found at [Egeria Project](https://egeria-project.org).
|
39
39
|
|
40
40
|
This package is in active development. There is initial
|
41
|
-
support for many of Egeria's services including
|
41
|
+
support for many of Egeria's services including configuration and operation. This client depends on
|
42
42
|
Egeria 4.4 Snapshot and above - although most of the functions may work on earlier versions of Egeria as well.
|
43
43
|
|
44
44
|
The code is organized to mimic the existing Egeria Java Client structure.
|
45
45
|
|
46
46
|
A new examples folder holds some useful text widgets that help to visualize the status of an Egeria deployment.
|
47
47
|
|
48
|
+
WARNING: files that start with "X" are in-progress placeholders that are not meant to be used..they will mature and
|
49
|
+
evolve.
|
50
|
+
|
48
51
|
All feedback is welcome. Please engage via our [community](http://egeria-project.org/guides/community/),
|
49
52
|
team calls, or via github issues in this repo. If interested in contributing,
|
50
53
|
you can engage via the community or directly reach out to
|
@@ -0,0 +1,58 @@
|
|
1
|
+
pyegeria/Xfeedback_manager_omvs.py,sha256=uNQMOPG08UyIuLzBfYt4uezDyLWdpBgJ2ZuvqumaWuY,9231
|
2
|
+
pyegeria/Xloaded_resources_omvs.py,sha256=_1RKeIfq3ga6nvtOzZ5dWcDFgxNiUOPJhnyMv1iCm9s,3377
|
3
|
+
pyegeria/__init__.py,sha256=PGHAdooCyZwawxAyDzP2Tlj-yjKjdI4oOPtZmw95Qg8,2007
|
4
|
+
pyegeria/_client.py,sha256=uQqfjf0JPacEWcDvbKpCvCypbDmAmGHaFQf_UTPK7VQ,23524
|
5
|
+
pyegeria/_deprecated_gov_engine.py,sha256=_DAEHsksnTKGqL9-TaaMVrfnNOrvatNACfg7pJ-ZX4w,17600
|
6
|
+
pyegeria/_exceptions.py,sha256=NJ7vAhmvusK1ENvY2MMrBB6A6TgpYjzS9QJxFH56b8c,18470
|
7
|
+
pyegeria/_globals.py,sha256=IKk40ogVhdYRagyau2k9pJqcs17UZ43Cx4iOeYRojOk,560
|
8
|
+
pyegeria/_validators.py,sha256=DQuMsATRGxGSBtOrVtXlCgWXGhj6Nh-uqPtCsrUGLxk,12703
|
9
|
+
pyegeria/action_author_omvs.py,sha256=m0wsfmyO-VxRDaPpACeIDw8eVAFu3RVbo45RPCUel9M,6340
|
10
|
+
pyegeria/asset_catalog_omvs.py,sha256=Y-Eh0k-zkJNOChVlLbC2bsTSBVLWhk-0-ewCV4YlyDY,25802
|
11
|
+
pyegeria/automated_curation_omvs.py,sha256=_I_93pWi8d6ya_SRwwoyfhMvqzVmVP-qUVoJh_0yJYI,118272
|
12
|
+
pyegeria/collection_manager_omvs.py,sha256=IyGCbqx2Blm0OwCsC2071EeoNWHXyWGl_6pEtacizAs,112642
|
13
|
+
pyegeria/core_guids.py,sha256=00yTuBk0kdrkNyo-Gb5G8O6jAN0_EyVNLgA3z2f-t1Y,4524
|
14
|
+
pyegeria/core_omag_server_config.py,sha256=A-xec_ivX7YMLZynzIMB7l-aYKNkqQHrUBMznoUuiNU,93098
|
15
|
+
pyegeria/full_omag_server_config.py,sha256=zzIyhCDolbLEJrc9JoBK308Mcq_96swYJopBN7_o4n8,45358
|
16
|
+
pyegeria/glossary_browser_omvs.py,sha256=nUCDSQ8cw8vuYgjfcaj1zLIefVI5j51evxPyXCIc4X8,101716
|
17
|
+
pyegeria/glossary_manager_omvs.py,sha256=AyTNBeOwa7ISOkpjzHHEtpiFzFo0ykcEQ525h_wqfMM,133328
|
18
|
+
pyegeria/my_profile_omvs.py,sha256=w-3aL9s7VlonUGtdKgfMSCeYIbCtJn0zDLTuqUxAYFc,42265
|
19
|
+
pyegeria/platform_services.py,sha256=T2UiAl7tPfOBGL_H2b73XyyHtR0Y36irgbaljZTjD4I,41808
|
20
|
+
pyegeria/project_manager_omvs.py,sha256=_U6m2vquu4eEV7aY8X3hsvfm2zX0EBica1reGWX9amY,77078
|
21
|
+
pyegeria/registered_info.py,sha256=GfMcYz3IO0aNquf8qCrYQ9cA5KplhPx1kNt0_nMMpTM,6475
|
22
|
+
pyegeria/runtime_manager_omvs.py,sha256=WekK7Yeyn6Qu9YmbSDo3m57MN0xOsIm9M8kGHfROZHI,37628
|
23
|
+
pyegeria/server_operations.py,sha256=YBdQJjPOmA1uhrUvzrjUKNGUc5nju9bhvCjF3AbdyWk,16164
|
24
|
+
pyegeria/utils.py,sha256=H0mew9IRcbsEi-pZfaT9HGuPO9CMOwnhOgIltyNvqTY,5240
|
25
|
+
pyegeria/valid_metadata_omvs.py,sha256=aisdRodIwJSkyArAzfm_sEnBELh69xE8k4Nea-vHu8M,36745
|
26
|
+
pyegeria-0.4.0.data/scripts/Create_Collection_Sample.py,sha256=Peoacgx0RRNwL_ZfMUynRcqttp6fdbSi5LZu38ghpD0,11865
|
27
|
+
pyegeria-0.4.0.data/scripts/Create_Sustainability_Collection_Sample.py,sha256=iLBm1LwRLi42Gayyb-wcWZ5NySQ6sc4kVSmwIAzP2Po,5049
|
28
|
+
pyegeria-0.4.0.data/scripts/get_guid_info.py,sha256=Evs5yt9UYIItWHy1jPpu9QvZjDulBQCXFFpNDBJZP9k,2528
|
29
|
+
pyegeria-0.4.0.data/scripts/get_my_profile.py,sha256=XSUxLgcL4sYSoZshnMrHVoRf42ePlmk08v6_24uVQHo,3705
|
30
|
+
pyegeria-0.4.0.data/scripts/get_tech_details.py,sha256=a9XHZ1kz94v3Y1mEioyctLHivwT0Q9DwuhKC3rhk-LI,4301
|
31
|
+
pyegeria-0.4.0.data/scripts/get_tech_type_elements.py,sha256=hNwQuxFdYOKJ-P_Fm0A0nKNY7BxkpaJKaj4vyLChFsQ,4948
|
32
|
+
pyegeria-0.4.0.data/scripts/get_tech_type_template.py,sha256=b1CfFSXem-BaXdcG-QPsjqfKcPNxJgmY-Fb2ZMbmzoI,4944
|
33
|
+
pyegeria-0.4.0.data/scripts/list_asset_types.py,sha256=CxK2IETXIzDlMQbVUcP1WFMvUpFYiyJrfXDgGZVGCko,2810
|
34
|
+
pyegeria-0.4.0.data/scripts/list_assets.py,sha256=wVp70YbFfBqV0Dbuc9cJOx3RIPpctbZsFEermEndL54,4664
|
35
|
+
pyegeria-0.4.0.data/scripts/list_projects.py,sha256=zhadpaLbTDNGxMRxnyx_SQZXygWGsLeM64EEosDR4VQ,4990
|
36
|
+
pyegeria-0.4.0.data/scripts/list_registered_services.py,sha256=NzlyItgcsoXgvV8vjaB3cMAR9GlVkbd6KcOiJ5rxUvs,5085
|
37
|
+
pyegeria-0.4.0.data/scripts/list_relationship_types.py,sha256=CiQNRC_iA3iTZWesuYmWHZn5xuzUajbnSUivO0kjdzw,4179
|
38
|
+
pyegeria-0.4.0.data/scripts/list_tech_templates.py,sha256=DYGE8nP0_Eb4HNIEwcMqGgyZeFwnGTEOeTYIXZ7_i58,5088
|
39
|
+
pyegeria-0.4.0.data/scripts/list_tech_types.py,sha256=xZoCrnmBXa-_WXDW3tBG6dt6IxH-aeQfg07pXM2IrsA,3924
|
40
|
+
pyegeria-0.4.0.data/scripts/list_todos.py,sha256=Kb1o6Q1Ls9Q-rIhl3aowuYX37PA-qGaG-P5BSef1M8M,4165
|
41
|
+
pyegeria-0.4.0.data/scripts/list_valid_metadata_values.py,sha256=_PdwsQ3Vh_a_nyAkS6cBu4UBm1AZecCmNnjC5vobHQ8,5282
|
42
|
+
pyegeria-0.4.0.data/scripts/view_asset_graph.py,sha256=g8KCGP_DTlAl_pdKi9Bshn3hRHsJsbC2h2WqGO0bhcY,8908
|
43
|
+
pyegeria-0.4.0.data/scripts/view_coco_status.py,sha256=CR0_vwTBrKN7MSf1_OQ9MNi_RfmEcC-JucKLiRUZdqg,3188
|
44
|
+
pyegeria-0.4.0.data/scripts/view_collection.py,sha256=zLeQc5KQa_1Hw7zb46EoWwBbXzc1nzbnrPpuBqsxE6E,3233
|
45
|
+
pyegeria-0.4.0.data/scripts/view_eng_action_status.py,sha256=UR-iHx4BrFgliZL4iGNwSqOQGCMHKqxFTKENSmc546o,4936
|
46
|
+
pyegeria-0.4.0.data/scripts/view_glossary.py,sha256=cEQOo-lfrulbcmvr8zBv0bVBdBzqcqCZWORUzUW1nE0,4614
|
47
|
+
pyegeria-0.4.0.data/scripts/view_gov_eng_status.py,sha256=iPr_rYkczY2yVLCKlLMBvLugUAVJ6kro81Gr4c9fzCM,3961
|
48
|
+
pyegeria-0.4.0.data/scripts/view_integ_daemon_status.py,sha256=0D3NrWktuT51pmzSYgA_r5AYqHerFHDmQoxkMxlp3Xk,4565
|
49
|
+
pyegeria-0.4.0.data/scripts/view_my_todos.py,sha256=MmG8pJATR2mbt1tmuo7VPHkVNe_QmyRNdQKBEp4sz_A,5672
|
50
|
+
pyegeria-0.4.0.data/scripts/view_open_todos.py,sha256=RW_yCnzVdAOHvIW4nAaCD5sxYPPGZQN9KTa54MN3YCE,3957
|
51
|
+
pyegeria-0.4.0.data/scripts/view_platform_status.py,sha256=_a52cZ0lf7pXDK0zrtwUQSc3F1MGCFzjhhZIm2jkxms,4419
|
52
|
+
pyegeria-0.4.0.data/scripts/view_server_list.py,sha256=tyx1I7olr6e5kJF22ou9rqsztrRDdrPCq5uVa3hhPBU,3088
|
53
|
+
pyegeria-0.4.0.data/scripts/view_server_status.py,sha256=YFLRz6qx8WoNRbRGhHyVvokaxXjnNSDeG-cTxo22jO0,2836
|
54
|
+
pyegeria-0.4.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
55
|
+
pyegeria-0.4.0.dist-info/METADATA,sha256=qkRNxI10KedME-3ra6sN5kLxigIFfKLuIvLVvIVyvTg,2456
|
56
|
+
pyegeria-0.4.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
57
|
+
pyegeria-0.4.0.dist-info/top_level.txt,sha256=tHowU8jow7WJGmbr4QdIk7gJWdslRgbWBiF2lMeduLQ,9
|
58
|
+
pyegeria-0.4.0.dist-info/RECORD,,
|