pyegeria 0.3.9__py3-none-any.whl → 0.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyegeria/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/core_omag_server_config.py +1 -1
- 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.1.data/scripts/get_guid_info.py +86 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.1.data}/scripts/get_tech_details.py +1 -37
- pyegeria-0.4.1.data/scripts/get_tech_type_elements.py +137 -0
- pyegeria-0.4.1.data/scripts/get_tech_type_template.py +137 -0
- pyegeria-0.4.1.data/scripts/list_assets.py +138 -0
- pyegeria-0.3.9.data/scripts/project_list_viewer.py → pyegeria-0.4.1.data/scripts/list_projects.py +1 -1
- pyegeria-0.3.9.data/scripts/get_relationship_types.py → pyegeria-0.4.1.data/scripts/list_relationship_types.py +9 -8
- pyegeria-0.4.1.data/scripts/list_tech_templates.py +134 -0
- pyegeria-0.3.9.data/scripts/find_todos.py → pyegeria-0.4.1.data/scripts/list_todos.py +2 -1
- pyegeria-0.4.1.data/scripts/list_valid_metadata_values.py +144 -0
- pyegeria-0.4.1.data/scripts/view_asset_graph.py +245 -0
- pyegeria-0.3.9.data/scripts/coco_status.py → pyegeria-0.4.1.data/scripts/view_coco_status.py +10 -9
- pyegeria-0.3.9.data/scripts/engine_action_status.py → pyegeria-0.4.1.data/scripts/view_eng_action_status.py +8 -3
- pyegeria-0.4.1.data/scripts/view_integ_daemon_status.py +140 -0
- pyegeria-0.4.1.data/scripts/view_platform_status.py +123 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.1.dist-info}/METADATA +5 -2
- pyegeria-0.4.1.dist-info/RECORD +58 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.1.dist-info}/WHEEL +1 -1
- pyegeria-0.3.9.data/scripts/integration_daemon_status.py +0 -130
- 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.1.data}/scripts/Create_Collection_Sample.py +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.1.data}/scripts/Create_Sustainability_Collection_Sample.py +0 -0
- /pyegeria-0.3.9.data/scripts/view_my_profile.py → /pyegeria-0.4.1.data/scripts/get_my_profile.py +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.1.data}/scripts/list_asset_types.py +0 -0
- /pyegeria-0.3.9.data/scripts/get_registered_services.py → /pyegeria-0.4.1.data/scripts/list_registered_services.py +0 -0
- /pyegeria-0.3.9.data/scripts/get_tech_types.py → /pyegeria-0.4.1.data/scripts/list_tech_types.py +0 -0
- /pyegeria-0.3.9.data/scripts/collection_viewer.py → /pyegeria-0.4.1.data/scripts/view_collection.py +0 -0
- /pyegeria-0.3.9.data/scripts/glossary_view.py → /pyegeria-0.4.1.data/scripts/view_glossary.py +0 -0
- /pyegeria-0.3.9.data/scripts/gov_engine_status.py → /pyegeria-0.4.1.data/scripts/view_gov_eng_status.py +0 -0
- /pyegeria-0.3.9.data/scripts/my_todos.py → /pyegeria-0.4.1.data/scripts/view_my_todos.py +0 -0
- /pyegeria-0.3.9.data/scripts/open_todos.py → /pyegeria-0.4.1.data/scripts/view_open_todos.py +0 -0
- /pyegeria-0.3.9.data/scripts/server_status_widget.py → /pyegeria-0.4.1.data/scripts/view_server_list.py +0 -0
- /pyegeria-0.3.9.data/scripts/server_status.py → /pyegeria-0.4.1.data/scripts/view_server_status.py +0 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.1.dist-info}/LICENSE +0 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,245 @@
|
|
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_guid: 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.get("classificationProperties","---")
|
52
|
+
if type(class_props) is list:
|
53
|
+
for prop in class_props.keys():
|
54
|
+
class_md += f"\t* {prop}: {class_props[prop]}\n"
|
55
|
+
if class_md == "":
|
56
|
+
output = None
|
57
|
+
else:
|
58
|
+
output = class_md
|
59
|
+
return output
|
60
|
+
|
61
|
+
def build_nested_elements(nested_element: dict) -> Markdown:
|
62
|
+
ne_md = " "
|
63
|
+
|
64
|
+
ne_created_by = nested_element["versions"]["createdBy"]
|
65
|
+
ne_created_at = nested_element["versions"]["createTime"]
|
66
|
+
ne_guid = nested_element["guid"]
|
67
|
+
guid_list.append(ne_guid)
|
68
|
+
|
69
|
+
ne_type = nested_element["type"]["typeName"]
|
70
|
+
ne_classifications = nested_element["classifications"]
|
71
|
+
ne_class_md = build_classifications(ne_classifications)
|
72
|
+
# ne_class_md = " " if ne_class_md is None else ne_class_md
|
73
|
+
ne_props = nested_element["properties"]
|
74
|
+
|
75
|
+
ne_prop_md = ""
|
76
|
+
for prop in ne_props.keys():
|
77
|
+
ne_prop_md += f"* {prop}: {ne_props[prop]}\n"
|
78
|
+
ne_md = (f"Nested Element of Type: {ne_type} with GUID: {ne_guid} \n "
|
79
|
+
f"* created by {ne_created_by} at time {ne_created_at}\n"
|
80
|
+
f"{ne_prop_md}\n")
|
81
|
+
if ne_class_md is not None:
|
82
|
+
ne_md += f"* {ne_class_md}"
|
83
|
+
|
84
|
+
output = Markdown(ne_md)
|
85
|
+
return output
|
86
|
+
|
87
|
+
try:
|
88
|
+
|
89
|
+
console = Console(width=200)
|
90
|
+
|
91
|
+
a_client = AssetCatalog(view_server, platform,
|
92
|
+
user_id=user)
|
93
|
+
|
94
|
+
token = a_client.create_egeria_bearer_token(user, "secret")
|
95
|
+
# asset_info = a_client.find_assets_in_domain(asset_name)
|
96
|
+
# if type(asset_info) is str:
|
97
|
+
# print("\n No Assets Found - Exiting\n")
|
98
|
+
# sys.exit(1)
|
99
|
+
#
|
100
|
+
# asset_guid = asset_info[0]['guid']
|
101
|
+
|
102
|
+
guid_list.append(asset_guid)
|
103
|
+
|
104
|
+
asset_graph = a_client.get_asset_graph(asset_guid)
|
105
|
+
if type(asset_graph) is not dict:
|
106
|
+
print(f"\n No Asset found for {asset_guid}")
|
107
|
+
sys.exit(1)
|
108
|
+
|
109
|
+
# print(f"\n{json.dumps(asset_graph, indent =2)}\n")
|
110
|
+
|
111
|
+
|
112
|
+
asset_name = asset_graph["displayName"]
|
113
|
+
qualified_name = asset_graph["qualifiedName"]
|
114
|
+
resource_name = asset_graph["resourceName"]
|
115
|
+
|
116
|
+
tree = Tree(f"{asset_name} ({asset_guid})", style="bold bright_white", guide_style="bold bright_blue")
|
117
|
+
style = ""
|
118
|
+
|
119
|
+
asset_type = asset_graph["type"]["typeName"]
|
120
|
+
asset_origin = asset_graph["origin"]["homeMetadataCollectionName"]
|
121
|
+
asset_creation = asset_graph["versions"]["createTime"]
|
122
|
+
asset_created_by = asset_graph["versions"]["createdBy"]
|
123
|
+
asset_classifications = asset_graph["classifications"]
|
124
|
+
asset_nested_elements = asset_graph.get("anchoredElements","----")
|
125
|
+
asset_relationships = asset_graph["relationships"]
|
126
|
+
asset_class_md = build_classifications(asset_classifications)
|
127
|
+
|
128
|
+
|
129
|
+
asset_properties = asset_graph["extendedProperties"]
|
130
|
+
prop_md = "\n* Extended Properties:\n"
|
131
|
+
for prop in asset_properties:
|
132
|
+
prop_md = f"{prop_md}\n\t* {prop}: {asset_properties[prop]}\n"
|
133
|
+
|
134
|
+
core_md = (f"**Type: {asset_type} Created by: {asset_created_by} on {asset_creation}**\n"
|
135
|
+
f"* Qualified Name: {qualified_name}\n "
|
136
|
+
f"* Resource Name: {resource_name}\n"
|
137
|
+
f"* Display Name: {asset_name}\n"
|
138
|
+
f"* Asset Origin: {asset_origin}\n{prop_md}\n"
|
139
|
+
)
|
140
|
+
core_md = Markdown(core_md)
|
141
|
+
p1 = Panel.fit(core_md, style = "bold bright_white")
|
142
|
+
l2 = tree.add(p1)
|
143
|
+
if asset_class_md is not None:
|
144
|
+
p2 = Panel.fit(Markdown(asset_class_md), style = "bold bright_white", title = "Classifications")
|
145
|
+
l2 = tree.add(p2)
|
146
|
+
|
147
|
+
#
|
148
|
+
# Nested Assets
|
149
|
+
#
|
150
|
+
if type(asset_nested_elements) is list:
|
151
|
+
l2 = tree.add("Nested Elements", style = "bold white")
|
152
|
+
for el in asset_nested_elements:
|
153
|
+
asset_ne_md = build_nested_elements(el)
|
154
|
+
p3 = Panel.fit(asset_ne_md, style = "bold bright_white", title="Nested Elements")
|
155
|
+
l2.add(p3)
|
156
|
+
|
157
|
+
#
|
158
|
+
# Now work on the Relationships
|
159
|
+
#
|
160
|
+
for relationship in asset_relationships:
|
161
|
+
# Find the end guids - if one isn't in our list then display
|
162
|
+
rel_end1 = relationship["end1"]
|
163
|
+
rel_end1_type = rel_end1["type"]["typeName"]
|
164
|
+
rel_end1_guid = rel_end1["guid"]
|
165
|
+
rel_end1_unique_name = rel_end1["uniqueName"]
|
166
|
+
|
167
|
+
rel_end2 = relationship["end2"]
|
168
|
+
rel_end2_type = rel_end2["type"]["typeName"]
|
169
|
+
rel_end2_guid = rel_end2["guid"]
|
170
|
+
rel_end2_unique_name = rel_end2["uniqueName"]
|
171
|
+
|
172
|
+
if (rel_end1_guid not in guid_list) or (rel_end2_guid not in guid_list):
|
173
|
+
rel_end1_class_md = build_classifications(rel_end1["classifications"])
|
174
|
+
rel_end2_class_md = build_classifications(rel_end2["classifications"])
|
175
|
+
|
176
|
+
relationship_guid = relationship["guid"]
|
177
|
+
relationship_type = relationship["type"]["typeName"]
|
178
|
+
relationship_created_by = relationship["versions"]["createdBy"]
|
179
|
+
relationship_creation_time = relationship["versions"]["createTime"]
|
180
|
+
relationship_properties = relationship.get("properties","--- ")
|
181
|
+
relationship_md = (f"Relationship Type {relationship_type}\n"
|
182
|
+
f"* GUID: {relationship_guid}\n* Created by: {relationship_created_by} \n"
|
183
|
+
f"* Creation Time: {relationship_creation_time}\n"
|
184
|
+
f"* Properties: {relationship_properties}\n")
|
185
|
+
|
186
|
+
|
187
|
+
rel_md = (
|
188
|
+
f"* Relationship Type: {relationship_type}\n"
|
189
|
+
f"* Relationship GUID: {relationship_guid}\n"
|
190
|
+
f"* Created by: {relationship_created_by} at time {relationship_creation_time}\n"
|
191
|
+
)
|
192
|
+
rel_end1_md = (
|
193
|
+
f"* End1:\n"
|
194
|
+
f"\t* Type: {rel_end1_type}\n"
|
195
|
+
f"\t* GUID: {rel_end1_guid}\n"
|
196
|
+
f"\t* Unique Name: {rel_end1_unique_name}\n"
|
197
|
+
)
|
198
|
+
|
199
|
+
if rel_end1_class_md is not None:
|
200
|
+
rel_end1_md = rel_end1_class_md + rel_end1_md
|
201
|
+
|
202
|
+
rel_end2_md = (
|
203
|
+
f"* End2:\n"
|
204
|
+
f"\t* Type: {rel_end2_type}\n"
|
205
|
+
f"\t* GUID: {rel_end2_guid}\n"
|
206
|
+
f"\t* Unique Name: {rel_end2_unique_name}\n"
|
207
|
+
)
|
208
|
+
|
209
|
+
if rel_end2_class_md is not None:
|
210
|
+
rel_end1_md = rel_end2_class_md + rel_end1_md
|
211
|
+
#
|
212
|
+
# for prop in relationship_properties.keys():
|
213
|
+
# relationship_md += f"* {prop}: {relationship_properties[prop]}\n"
|
214
|
+
|
215
|
+
relationship_md += rel_end1_md + rel_end2_md
|
216
|
+
|
217
|
+
relationship_panel = Panel.fit(Markdown(relationship_md), style="bold bright_white", title = "Asset Relationships")
|
218
|
+
tree.add(relationship_panel)
|
219
|
+
|
220
|
+
|
221
|
+
print("\n\n")
|
222
|
+
print(tree)
|
223
|
+
|
224
|
+
except (
|
225
|
+
InvalidParameterException,
|
226
|
+
PropertyServerException,
|
227
|
+
UserNotAuthorizedException
|
228
|
+
) as e:
|
229
|
+
print_exception_response(e)
|
230
|
+
|
231
|
+
|
232
|
+
if __name__ == "__main__":
|
233
|
+
parser = argparse.ArgumentParser()
|
234
|
+
|
235
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
236
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
237
|
+
parser.add_argument("--userid", help="User Id")
|
238
|
+
args = parser.parse_args()
|
239
|
+
|
240
|
+
server = args.server if args.server is not None else "view-server"
|
241
|
+
url = args.url if args.url is not None else "https://localhost:9443"
|
242
|
+
userid = args.userid if args.userid is not None else 'erinoverview'
|
243
|
+
|
244
|
+
asset_guid = Prompt.ask("Enter the Asset GUID to view:", default="8e35b39e-6ee7-4d60-aff5-4b09406c5e79")
|
245
|
+
asset_viewer(asset_guid,server, url, userid)
|
pyegeria-0.3.9.data/scripts/coco_status.py → pyegeria-0.4.1.data/scripts/view_coco_status.py
RENAMED
@@ -30,11 +30,9 @@ from pyegeria.server_operations import ServerOps
|
|
30
30
|
disable_ssl_warnings = True
|
31
31
|
|
32
32
|
|
33
|
-
def
|
33
|
+
def display_status(server: str, url: str, username: str):
|
34
34
|
layout = Layout()
|
35
|
-
print(layout)
|
36
35
|
|
37
|
-
print(layout)
|
38
36
|
p_client1 = ServerOps("Core Catalog", "https://localhost:9443", username)
|
39
37
|
p_client2 = ServerOps('Datalake Catalog', "https://localhost:9444", username)
|
40
38
|
p_client3 = ServerOps('DevCatalog', "https://localhost:9445", username)
|
@@ -42,19 +40,18 @@ def test_display_status(server: str, url: str, username: str):
|
|
42
40
|
def generate_table(p_client) -> Table:
|
43
41
|
"""Make a new table."""
|
44
42
|
table = Table(
|
45
|
-
title=f"Server Status for
|
43
|
+
title=f"Server Status for {p_client.server_name}- {time.asctime()}",
|
46
44
|
# style = "black on grey66",
|
47
45
|
header_style="white on dark_blue",
|
48
|
-
caption=f"Server Status for Platform - '{
|
46
|
+
caption=f"Server Status for Platform - '{p_client.platform_url}'",
|
49
47
|
# show_lines=True,
|
50
48
|
)
|
51
49
|
|
52
50
|
table.add_column("Known Server")
|
53
51
|
table.add_column("Status")
|
54
|
-
|
55
52
|
known_server_list = p_client.get_known_servers()
|
56
53
|
active_server_list = p_client.get_active_server_list()
|
57
|
-
if
|
54
|
+
if type(known_server_list) is str:
|
58
55
|
return table
|
59
56
|
|
60
57
|
for server in known_server_list:
|
@@ -83,6 +80,10 @@ def test_display_status(server: str, url: str, username: str):
|
|
83
80
|
print_exception_response(e)
|
84
81
|
assert e.related_http_code != "200", "Invalid parameters"
|
85
82
|
|
83
|
+
finally:
|
84
|
+
p_client1.close_session()
|
85
|
+
p_client2.close_session()
|
86
|
+
p_client3.close_session()
|
86
87
|
|
87
88
|
if __name__ == "__main__":
|
88
89
|
parser = argparse.ArgumentParser()
|
@@ -92,7 +93,7 @@ if __name__ == "__main__":
|
|
92
93
|
args = parser.parse_args()
|
93
94
|
|
94
95
|
server = args.server if args.server is not None else "active-metadata-store"
|
95
|
-
url = args.url if args.url is not None else "https://
|
96
|
+
url = args.url if args.url is not None else "https://localhost:9443"
|
96
97
|
userid = args.userid if args.userid is not None else 'garygeeke'
|
97
98
|
|
98
|
-
|
99
|
+
display_status(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)
|
@@ -0,0 +1,140 @@
|
|
1
|
+
#!python
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
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".
|
12
|
+
|
13
|
+
"""
|
14
|
+
|
15
|
+
import argparse
|
16
|
+
import time
|
17
|
+
|
18
|
+
from rich import box
|
19
|
+
from rich.live import Live
|
20
|
+
from rich.markdown import Markdown
|
21
|
+
from rich.table import Table
|
22
|
+
from rich.text import Text
|
23
|
+
|
24
|
+
from pyegeria import ServerOps, AutomatedCuration
|
25
|
+
from pyegeria._exceptions import (
|
26
|
+
InvalidParameterException,
|
27
|
+
PropertyServerException,
|
28
|
+
UserNotAuthorizedException,
|
29
|
+
print_exception_response,
|
30
|
+
)
|
31
|
+
|
32
|
+
disable_ssl_warnings = True
|
33
|
+
|
34
|
+
|
35
|
+
def display_integration_daemon_status(integ_server: str, integ_url: str,
|
36
|
+
view_server:str, view_url: str, user: str):
|
37
|
+
s_client = ServerOps(integ_server, integ_url, user)
|
38
|
+
a_client = AutomatedCuration(view_server, view_url, user, "secret")
|
39
|
+
token = a_client.create_egeria_bearer_token()
|
40
|
+
|
41
|
+
def generate_table() -> Table:
|
42
|
+
"""Make a new table."""
|
43
|
+
table = Table(
|
44
|
+
title=f"Integration Daemon Status @ {time.asctime()}",
|
45
|
+
# style = "black on grey66",
|
46
|
+
header_style="white on dark_blue",
|
47
|
+
show_lines=True,
|
48
|
+
box=box.ROUNDED,
|
49
|
+
caption=f"Integration Daemon Status for Server '{integ_server}' @ Platform - {integ_url}",
|
50
|
+
expand=True
|
51
|
+
)
|
52
|
+
table.add_column("Connector Name")
|
53
|
+
table.add_column("Connector Status")
|
54
|
+
|
55
|
+
table.add_column("Last Refresh Time")
|
56
|
+
table.add_column("Min Refresh (min)")
|
57
|
+
table.add_column("Target Element")
|
58
|
+
table.add_column("Exception Message")
|
59
|
+
|
60
|
+
daemon_status = s_client.get_integration_daemon_status()
|
61
|
+
connector_reports = daemon_status["integrationConnectorReports"]
|
62
|
+
for connector in connector_reports:
|
63
|
+
connector_name = connector.get("connectorName", "---")
|
64
|
+
connector_status = connector.get("connectorStatus", "---")
|
65
|
+
connector_guid = connector.get("connectorGUID","---")
|
66
|
+
last_refresh_time = connector.get("lastRefreshTime", "---")
|
67
|
+
refresh_interval = str(connector.get("minMinutesBetweenRefresh", "---"))
|
68
|
+
exception_msg = " "
|
69
|
+
if connector_guid != '---':
|
70
|
+
targets = a_client.get_catalog_targets(connector_guid)
|
71
|
+
tgt_tab = Table()
|
72
|
+
tgt_tab.add_column("Target")
|
73
|
+
tgt_tab.add_column("UniqueName")
|
74
|
+
tgt_tab.add_column("Relationship GUID", no_wrap=True)
|
75
|
+
|
76
|
+
if type(targets) == list:
|
77
|
+
targets_md = True
|
78
|
+
for target in targets:
|
79
|
+
t_name = target["catalogTargetName"]
|
80
|
+
# t_sync = target["permittedSynchronization"]
|
81
|
+
t_unique_name = target["catalogTargetElement"]["uniqueName"]
|
82
|
+
t_rel_guid = target["relationshipGUID"]
|
83
|
+
# targets_m += f"* Target Name: __{t_name}__\n* Sync: {t_sync}\n* Unique Name: {t_unique_name}\n\n"
|
84
|
+
tgt_tab.add_row(t_name,t_unique_name, t_rel_guid)
|
85
|
+
# targets_md = Markdown(targets_m)
|
86
|
+
else:
|
87
|
+
targets_md = False
|
88
|
+
else:
|
89
|
+
targets_md = False
|
90
|
+
if targets_md is False:
|
91
|
+
targets_out = ""
|
92
|
+
else:
|
93
|
+
targets_out = tgt_tab
|
94
|
+
|
95
|
+
if connector_status in ("RUNNING", "REFRESHING", "WAITING"):
|
96
|
+
connector_status = f"[green]{connector_status}"
|
97
|
+
elif connector_status in ("INITIALIZE FAILED", "CONFIG_FAILED", "FAILED"):
|
98
|
+
connector_status = f"[red]{connector_status}"
|
99
|
+
else:
|
100
|
+
connector_status = f"[yellow]{connector_status}"
|
101
|
+
|
102
|
+
table.add_row(
|
103
|
+
connector_name, connector_status, last_refresh_time, refresh_interval,
|
104
|
+
targets_out, exception_msg
|
105
|
+
)
|
106
|
+
return table
|
107
|
+
|
108
|
+
try:
|
109
|
+
with Live(generate_table(), refresh_per_second=4, screen=True) as live:
|
110
|
+
while True:
|
111
|
+
time.sleep(2)
|
112
|
+
live.update(generate_table())
|
113
|
+
live.console.pager()
|
114
|
+
|
115
|
+
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
|
116
|
+
print_exception_response(e)
|
117
|
+
assert e.related_http_code != "200", "Invalid parameters"
|
118
|
+
|
119
|
+
finally:
|
120
|
+
s_client.close_session()
|
121
|
+
a_client.close_session()
|
122
|
+
|
123
|
+
|
124
|
+
if __name__ == "__main__":
|
125
|
+
parser = argparse.ArgumentParser()
|
126
|
+
parser.add_argument("--integ_server", help="Name of the integration server to display status for")
|
127
|
+
parser.add_argument("--integ_url", help="URL Platform to connect to")
|
128
|
+
parser.add_argument("--view_server", help="Name of the integration server to display status for")
|
129
|
+
parser.add_argument("--view_url", help="URL Platform to connect to")
|
130
|
+
parser.add_argument("--userid", help="User Id")
|
131
|
+
args = parser.parse_args()
|
132
|
+
|
133
|
+
integ_server = args.integ_server if args.integ_server is not None else "integration-daemon"
|
134
|
+
integ_url = args.integ_url if args.integ_url is not None else "https://localhost:9443"
|
135
|
+
view_server = args.view_server if args.view_server is not None else "view-server"
|
136
|
+
view_url = args.view_url if args.view_url is not None else "https://localhost:9443"
|
137
|
+
userid = args.userid if args.userid is not None else 'garygeeke'
|
138
|
+
display_integration_daemon_status(integ_server=integ_server, integ_url=integ_url,
|
139
|
+
view_server = view_server, view_url = view_url,
|
140
|
+
user=userid)
|
@@ -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.1
|
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=16ld7aBTgO3gGhvFs-_yzwqPsatdCAiKYi005_2evZU,93096
|
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.1.data/scripts/Create_Collection_Sample.py,sha256=Peoacgx0RRNwL_ZfMUynRcqttp6fdbSi5LZu38ghpD0,11865
|
27
|
+
pyegeria-0.4.1.data/scripts/Create_Sustainability_Collection_Sample.py,sha256=iLBm1LwRLi42Gayyb-wcWZ5NySQ6sc4kVSmwIAzP2Po,5049
|
28
|
+
pyegeria-0.4.1.data/scripts/get_guid_info.py,sha256=Evs5yt9UYIItWHy1jPpu9QvZjDulBQCXFFpNDBJZP9k,2528
|
29
|
+
pyegeria-0.4.1.data/scripts/get_my_profile.py,sha256=XSUxLgcL4sYSoZshnMrHVoRf42ePlmk08v6_24uVQHo,3705
|
30
|
+
pyegeria-0.4.1.data/scripts/get_tech_details.py,sha256=a9XHZ1kz94v3Y1mEioyctLHivwT0Q9DwuhKC3rhk-LI,4301
|
31
|
+
pyegeria-0.4.1.data/scripts/get_tech_type_elements.py,sha256=hNwQuxFdYOKJ-P_Fm0A0nKNY7BxkpaJKaj4vyLChFsQ,4948
|
32
|
+
pyegeria-0.4.1.data/scripts/get_tech_type_template.py,sha256=b1CfFSXem-BaXdcG-QPsjqfKcPNxJgmY-Fb2ZMbmzoI,4944
|
33
|
+
pyegeria-0.4.1.data/scripts/list_asset_types.py,sha256=CxK2IETXIzDlMQbVUcP1WFMvUpFYiyJrfXDgGZVGCko,2810
|
34
|
+
pyegeria-0.4.1.data/scripts/list_assets.py,sha256=nDM5D-h79pyswc3RDqh4sjWQNvL925z-HNtBvGb8lqA,4663
|
35
|
+
pyegeria-0.4.1.data/scripts/list_projects.py,sha256=zhadpaLbTDNGxMRxnyx_SQZXygWGsLeM64EEosDR4VQ,4990
|
36
|
+
pyegeria-0.4.1.data/scripts/list_registered_services.py,sha256=NzlyItgcsoXgvV8vjaB3cMAR9GlVkbd6KcOiJ5rxUvs,5085
|
37
|
+
pyegeria-0.4.1.data/scripts/list_relationship_types.py,sha256=CiQNRC_iA3iTZWesuYmWHZn5xuzUajbnSUivO0kjdzw,4179
|
38
|
+
pyegeria-0.4.1.data/scripts/list_tech_templates.py,sha256=DYGE8nP0_Eb4HNIEwcMqGgyZeFwnGTEOeTYIXZ7_i58,5088
|
39
|
+
pyegeria-0.4.1.data/scripts/list_tech_types.py,sha256=xZoCrnmBXa-_WXDW3tBG6dt6IxH-aeQfg07pXM2IrsA,3924
|
40
|
+
pyegeria-0.4.1.data/scripts/list_todos.py,sha256=Kb1o6Q1Ls9Q-rIhl3aowuYX37PA-qGaG-P5BSef1M8M,4165
|
41
|
+
pyegeria-0.4.1.data/scripts/list_valid_metadata_values.py,sha256=_PdwsQ3Vh_a_nyAkS6cBu4UBm1AZecCmNnjC5vobHQ8,5282
|
42
|
+
pyegeria-0.4.1.data/scripts/view_asset_graph.py,sha256=TLzn15zI3bw1gdXjbqs2hjmWc_68kHACX_zIhQEipJg,9277
|
43
|
+
pyegeria-0.4.1.data/scripts/view_coco_status.py,sha256=vMY95eDO-dAAMdwrhxtwtqFrnQ2GRr1aR-nmmu3q3v8,3289
|
44
|
+
pyegeria-0.4.1.data/scripts/view_collection.py,sha256=zLeQc5KQa_1Hw7zb46EoWwBbXzc1nzbnrPpuBqsxE6E,3233
|
45
|
+
pyegeria-0.4.1.data/scripts/view_eng_action_status.py,sha256=UR-iHx4BrFgliZL4iGNwSqOQGCMHKqxFTKENSmc546o,4936
|
46
|
+
pyegeria-0.4.1.data/scripts/view_glossary.py,sha256=cEQOo-lfrulbcmvr8zBv0bVBdBzqcqCZWORUzUW1nE0,4614
|
47
|
+
pyegeria-0.4.1.data/scripts/view_gov_eng_status.py,sha256=iPr_rYkczY2yVLCKlLMBvLugUAVJ6kro81Gr4c9fzCM,3961
|
48
|
+
pyegeria-0.4.1.data/scripts/view_integ_daemon_status.py,sha256=FQR4vLWkKiyVUsIaBfzrfnazsmcpKMOYGRjPEvaxrh0,5884
|
49
|
+
pyegeria-0.4.1.data/scripts/view_my_todos.py,sha256=MmG8pJATR2mbt1tmuo7VPHkVNe_QmyRNdQKBEp4sz_A,5672
|
50
|
+
pyegeria-0.4.1.data/scripts/view_open_todos.py,sha256=RW_yCnzVdAOHvIW4nAaCD5sxYPPGZQN9KTa54MN3YCE,3957
|
51
|
+
pyegeria-0.4.1.data/scripts/view_platform_status.py,sha256=_a52cZ0lf7pXDK0zrtwUQSc3F1MGCFzjhhZIm2jkxms,4419
|
52
|
+
pyegeria-0.4.1.data/scripts/view_server_list.py,sha256=tyx1I7olr6e5kJF22ou9rqsztrRDdrPCq5uVa3hhPBU,3088
|
53
|
+
pyegeria-0.4.1.data/scripts/view_server_status.py,sha256=YFLRz6qx8WoNRbRGhHyVvokaxXjnNSDeG-cTxo22jO0,2836
|
54
|
+
pyegeria-0.4.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
55
|
+
pyegeria-0.4.1.dist-info/METADATA,sha256=0gX4ER2W9rzVq4YFIygsIw0ZlYpceicJHkh8UW7MuHA,2456
|
56
|
+
pyegeria-0.4.1.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
|
57
|
+
pyegeria-0.4.1.dist-info/top_level.txt,sha256=tHowU8jow7WJGmbr4QdIk7gJWdslRgbWBiF2lMeduLQ,9
|
58
|
+
pyegeria-0.4.1.dist-info/RECORD,,
|