pyegeria 0.5.8.15__tar.gz → 0.5.8.17__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.5.8.15 → pyegeria-0.5.8.17}/PKG-INFO +1 -1
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/catalog_user/get_asset_graph.py +34 -31
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/cli/egeria_ops.py +69 -55
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/list_catalog_targets.py +2 -2
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_engine_activity.py +2 -2
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_gov_eng_status.py +3 -2
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_platform_status.py +25 -22
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_server_list.py +20 -25
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_server_status.py +11 -9
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyproject.toml +5 -5
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/LICENSE +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/README.md +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/doc_samples/Create_Collection_Sample.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/catalog_user/README.md +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/catalog_user/__init__.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/catalog_user/get_collection.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/catalog_user/get_tech_type_elements.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/catalog_user/get_tech_type_template.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/catalog_user/list_assets.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/catalog_user/list_glossary.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/cli/__init__.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/cli/ops_config.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/README.md +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/__init__.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/get_guid_info.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/get_tech_details.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/list_asset_types.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/list_registered_services.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/list_relationship_types.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/list_tech_templates.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/list_tech_types.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/list_valid_metadata_values.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/README.md +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/__init__.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/engine_actions.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/integration_daemon_actions.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/load_archive.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_asset_events.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_coco_status.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_integ_daemon_status.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/refresh_integration_daemon.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/restart_integration_daemon.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/personal_organizer/README.md +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/personal_organizer/__init__.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/personal_organizer/list_my_profile.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/personal_organizer/list_projects.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/personal_organizer/list_todos.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/personal_organizer/monitor_my_todos.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/personal_organizer/monitor_open_todos.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/Xfeedback_manager_omvs.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/Xloaded_resources_omvs.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/__init__.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/_client.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/_deprecated_gov_engine.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/_exceptions.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/_globals.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/_validators.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/action_author_omvs.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/asset_catalog_omvs.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/automated_curation_omvs.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/collection_manager_omvs.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/core_omag_server_config.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/create_tech_guid_lists.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/full_omag_server_config.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/glossary_browser_omvs.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/glossary_manager_omvs.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/my_profile_omvs.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/platform_services.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/project_manager_omvs.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/registered_info.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/runtime_manager_omvs.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/server_operations.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/utils.py +0 -0
- {pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/pyegeria/valid_metadata_omvs.py +0 -0
@@ -21,6 +21,7 @@ from pyegeria import (
|
|
21
21
|
UserNotAuthorizedException,
|
22
22
|
AssetCatalog
|
23
23
|
)
|
24
|
+
|
24
25
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
25
26
|
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
26
27
|
EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
|
@@ -32,16 +33,18 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
|
32
33
|
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
33
34
|
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
34
35
|
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
36
|
+
EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
|
37
|
+
EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
|
35
38
|
|
36
39
|
disable_ssl_warnings = True
|
37
40
|
|
38
|
-
console = Console(width=
|
39
|
-
|
41
|
+
console = Console(width=EGERIA_WIDTH, force_terminal=(not EGERIA_JUPYTER))
|
40
42
|
|
41
43
|
guid_list = []
|
42
44
|
|
43
|
-
def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, user_pass:str):
|
44
45
|
|
46
|
+
def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str, user_pass: str,
|
47
|
+
jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
|
45
48
|
def build_classifications(classification: dict) -> Markdown:
|
46
49
|
|
47
50
|
class_md = ""
|
@@ -50,7 +53,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
|
|
50
53
|
if c_type == "Anchors":
|
51
54
|
continue
|
52
55
|
class_md += f"\n* Classification: {c_type}\n"
|
53
|
-
class_props = c.get("classificationProperties","---")
|
56
|
+
class_props = c.get("classificationProperties", "---")
|
54
57
|
if type(class_props) is dict:
|
55
58
|
for prop in class_props.keys():
|
56
59
|
class_md += f"\t* {prop}: {class_props[prop]}\n"
|
@@ -72,7 +75,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
|
|
72
75
|
ne_classifications = nested_element["classifications"]
|
73
76
|
ne_class_md = build_classifications(ne_classifications)
|
74
77
|
# ne_class_md = " " if ne_class_md is None else ne_class_md
|
75
|
-
ne_props = nested_element.get("properties","---")
|
78
|
+
ne_props = nested_element.get("properties", "---")
|
76
79
|
ne_prop_md = "\n"
|
77
80
|
if type(ne_props) is dict:
|
78
81
|
for prop in ne_props.keys():
|
@@ -90,7 +93,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
|
|
90
93
|
try:
|
91
94
|
|
92
95
|
a_client = AssetCatalog(server_name, platform_url,
|
93
|
-
|
96
|
+
user_id=user)
|
94
97
|
|
95
98
|
token = a_client.create_egeria_bearer_token(user, user_pass)
|
96
99
|
# asset_info = a_client.find_assets_in_domain(asset_name)
|
@@ -109,7 +112,6 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
|
|
109
112
|
|
110
113
|
# print(f"\n{json.dumps(asset_graph, indent =2)}\n")
|
111
114
|
|
112
|
-
|
113
115
|
asset_name = asset_graph["displayName"]
|
114
116
|
qualified_name = asset_graph["qualifiedName"]
|
115
117
|
resource_name = asset_graph["resourceName"]
|
@@ -118,18 +120,17 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
|
|
118
120
|
style = ""
|
119
121
|
|
120
122
|
asset_type = asset_graph["type"]["typeName"]
|
121
|
-
asset_deployed_imp_type = asset_graph.get("deployedImplementationType","---")
|
123
|
+
asset_deployed_imp_type = asset_graph.get("deployedImplementationType", "---")
|
122
124
|
|
123
125
|
asset_origin = asset_graph["origin"]["homeMetadataCollectionName"]
|
124
126
|
asset_creation = asset_graph["versions"]["createTime"]
|
125
127
|
asset_created_by = asset_graph["versions"]["createdBy"]
|
126
128
|
asset_classifications = asset_graph["classifications"]
|
127
|
-
asset_nested_elements = asset_graph.get("anchoredElements","----")
|
129
|
+
asset_nested_elements = asset_graph.get("anchoredElements", "----")
|
128
130
|
asset_relationships = asset_graph["relationships"]
|
129
131
|
asset_class_md = build_classifications(asset_classifications)
|
130
132
|
|
131
|
-
|
132
|
-
asset_properties = asset_graph.get("extendedProperties",None)
|
133
|
+
asset_properties = asset_graph.get("extendedProperties", None)
|
133
134
|
if asset_properties is not None:
|
134
135
|
prop_md = "\n* Extended Properties:\n"
|
135
136
|
for prop in asset_properties:
|
@@ -137,28 +138,28 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
|
|
137
138
|
else:
|
138
139
|
prop_md = ""
|
139
140
|
core_md = (f"**Type: {asset_type} Created by: {asset_created_by} on {asset_creation}**\n"
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
141
|
+
f"* Deployed Implementation Type: {asset_deployed_imp_type}\n"
|
142
|
+
f"* Qualified Name: {qualified_name}\n "
|
143
|
+
f"* Resource Name: {resource_name}\n"
|
144
|
+
f"* Display Name: {asset_name}\n"
|
145
|
+
f"* Asset Origin: {asset_origin}\n{prop_md}\n"
|
146
|
+
)
|
146
147
|
core_md = Markdown(core_md)
|
147
148
|
|
148
|
-
p1 = Panel.fit(core_md, style
|
149
|
+
p1 = Panel.fit(core_md, style="bold bright_white")
|
149
150
|
l2 = tree.add(p1)
|
150
151
|
if asset_class_md is not None:
|
151
|
-
p2 = Panel.fit(Markdown(asset_class_md), style
|
152
|
+
p2 = Panel.fit(Markdown(asset_class_md), style="bold bright_white", title="Classifications")
|
152
153
|
l2 = tree.add(p2)
|
153
154
|
|
154
155
|
#
|
155
156
|
# Nested Assets
|
156
157
|
#
|
157
158
|
if type(asset_nested_elements) is list:
|
158
|
-
l2 = tree.add("Nested Elements", style
|
159
|
+
l2 = tree.add("Nested Elements", style="bold white")
|
159
160
|
for el in asset_nested_elements:
|
160
161
|
asset_ne_md = build_nested_elements(el)
|
161
|
-
p3 = Panel.fit(asset_ne_md, style
|
162
|
+
p3 = Panel.fit(asset_ne_md, style="bold bright_white", title="Nested Elements")
|
162
163
|
l2.add(p3)
|
163
164
|
|
164
165
|
#
|
@@ -169,7 +170,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
|
|
169
170
|
rel_end1 = relationship["end1"]
|
170
171
|
rel_end1_type = rel_end1["type"]["typeName"]
|
171
172
|
rel_end1_guid = rel_end1["guid"]
|
172
|
-
rel_end1_unique_name = rel_end1.get("uniqueName","---")
|
173
|
+
rel_end1_unique_name = rel_end1.get("uniqueName", "---")
|
173
174
|
|
174
175
|
rel_end2 = relationship["end2"]
|
175
176
|
rel_end2_type = rel_end2["type"]["typeName"]
|
@@ -184,13 +185,12 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
|
|
184
185
|
relationship_type = relationship["type"]["typeName"]
|
185
186
|
relationship_created_by = relationship["versions"]["createdBy"]
|
186
187
|
relationship_creation_time = relationship["versions"]["createTime"]
|
187
|
-
relationship_properties = relationship.get("properties","--- ")
|
188
|
+
relationship_properties = relationship.get("properties", "--- ")
|
188
189
|
relationship_md = (f"Relationship Type {relationship_type}\n"
|
189
190
|
f"* GUID: {relationship_guid}\n* Created by: {relationship_created_by} \n"
|
190
191
|
f"* Creation Time: {relationship_creation_time}\n"
|
191
192
|
f"* Properties: {relationship_properties}\n")
|
192
193
|
|
193
|
-
|
194
194
|
rel_md = (
|
195
195
|
f"* Relationship Type: {relationship_type}\n"
|
196
196
|
f"* Relationship GUID: {relationship_guid}\n"
|
@@ -201,7 +201,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
|
|
201
201
|
f"\t* Type: {rel_end1_type}\n"
|
202
202
|
f"\t* GUID: {rel_end1_guid}\n"
|
203
203
|
f"\t* Unique Name: {rel_end1_unique_name}\n"
|
204
|
-
|
204
|
+
)
|
205
205
|
|
206
206
|
# if rel_end1_class_md is not None:
|
207
207
|
# rel_end1_md = rel_end1_class_md + rel_end1_md
|
@@ -221,7 +221,8 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
|
|
221
221
|
|
222
222
|
relationship_md += rel_end1_md + rel_end2_md
|
223
223
|
|
224
|
-
relationship_panel = Panel.fit(Markdown(relationship_md), style="bold bright_white",
|
224
|
+
relationship_panel = Panel.fit(Markdown(relationship_md), style="bold bright_white",
|
225
|
+
title="Asset Relationships")
|
225
226
|
tree.add(relationship_panel)
|
226
227
|
|
227
228
|
with console.screen():
|
@@ -229,13 +230,14 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
|
|
229
230
|
print(tree)
|
230
231
|
|
231
232
|
except (
|
232
|
-
|
233
|
-
|
234
|
-
|
233
|
+
InvalidParameterException,
|
234
|
+
PropertyServerException,
|
235
|
+
UserNotAuthorizedException
|
235
236
|
) as e:
|
236
237
|
console.print_exception()
|
237
238
|
console.print("\n\n ======> Most likely the GUID you provided is either incorrect or not an asset\n[red bold]")
|
238
239
|
|
240
|
+
|
239
241
|
def main():
|
240
242
|
parser = argparse.ArgumentParser()
|
241
243
|
|
@@ -251,10 +253,11 @@ def main():
|
|
251
253
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
252
254
|
try:
|
253
255
|
asset_guid = Prompt.ask("Enter the Asset GUID to view:", default="")
|
254
|
-
asset_viewer(asset_guid,server, url, userid, user_pass)
|
256
|
+
asset_viewer(asset_guid, server, url, userid, user_pass)
|
255
257
|
except (KeyboardInterrupt) as e:
|
256
258
|
# console.print_exception()
|
257
259
|
pass
|
258
260
|
|
261
|
+
|
259
262
|
if __name__ == "__main__":
|
260
|
-
main()
|
263
|
+
main()
|
@@ -11,20 +11,22 @@ This is an emerging capability based on the **click** package. Feedback welcome!
|
|
11
11
|
"""
|
12
12
|
import click
|
13
13
|
from trogon import tui
|
14
|
+
|
14
15
|
# from pyegeria import ServerOps
|
15
16
|
from examples.widgets.cli.ops_config import Config
|
17
|
+
from examples.widgets.operational.integration_daemon_actions import (add_catalog_target, remove_catalog_target,
|
18
|
+
update_catalog_target, stop_server, start_server)
|
19
|
+
from examples.widgets.operational.list_catalog_targets import display_catalog_targets
|
20
|
+
from examples.widgets.operational.monitor_engine_activity import display_engine_activity
|
16
21
|
from examples.widgets.operational.monitor_gov_eng_status import display_gov_eng_status
|
17
|
-
from examples.widgets.operational.monitor_server_status import display_status as s_display_status
|
18
|
-
from examples.widgets.operational.monitor_server_list import display_status as display_list
|
19
22
|
from examples.widgets.operational.monitor_integ_daemon_status import display_integration_daemon_status
|
20
23
|
from examples.widgets.operational.monitor_platform_status import display_status as p_display_status
|
21
|
-
from examples.widgets.operational.
|
24
|
+
from examples.widgets.operational.monitor_server_list import display_status as display_list
|
25
|
+
from examples.widgets.operational.monitor_server_status import display_status as s_display_status
|
22
26
|
from examples.widgets.operational.refresh_integration_daemon import refresh_connector
|
23
27
|
from examples.widgets.operational.restart_integration_daemon import restart_connector
|
24
|
-
from examples.widgets.operational.integration_daemon_actions import (add_catalog_target,remove_catalog_target,
|
25
|
-
update_catalog_target, stop_server, start_server)
|
26
28
|
|
27
|
-
|
29
|
+
|
28
30
|
# class Config(object):
|
29
31
|
# def __init__(self, server: str = None, url: str = None, userid:str = None, password:str = None,
|
30
32
|
# timeout:int = 30, paging: bool = False):
|
@@ -42,34 +44,34 @@ from examples.widgets.operational.list_catalog_targets import display_catalog_ta
|
|
42
44
|
@tui()
|
43
45
|
@click.version_option("0.0.1", prog_name="egeria_ops")
|
44
46
|
@click.group()
|
45
|
-
@click.option('--server', default
|
47
|
+
@click.option('--server', default='active-metadata-store', envvar='EGERIA_METADATA_STORE',
|
46
48
|
help='Egeria metadata store to work with')
|
47
|
-
@click.option('--url', default
|
49
|
+
@click.option('--url', default='https://localhost:9443', envvar='EGERIA_PLATFORM_URL',
|
48
50
|
help='URL of Egeria metadata store platform to connect to')
|
49
|
-
@click.option('--integration-daemon', default
|
51
|
+
@click.option('--integration-daemon', default='integration-daemon', envvar='EGERIA_INTEGRATION_DAEMON',
|
50
52
|
help='Egeria integration daemon to work with')
|
51
|
-
@click.option('--integration_daemon_url', default
|
53
|
+
@click.option('--integration_daemon_url', default='https://localhost:9443', envvar='EGERIA_INTEGRATION_DAEMON_URL',
|
52
54
|
help='URL of Egeria integration daemon platform to connect to')
|
53
|
-
@click.option('--view_server', default
|
55
|
+
@click.option('--view_server', default='view-server', envvar='EGERIA_VIEW_SERVER',
|
54
56
|
help='Egeria view server to work with')
|
55
|
-
@click.option('--view_server_url', default
|
57
|
+
@click.option('--view_server_url', default='https://localhost:9443', envvar='EGERIA_VIEW_SERVER_URL',
|
56
58
|
help='URL of Egeria view server platform to connect to')
|
57
|
-
@click.option('--engine_host', default
|
59
|
+
@click.option('--engine_host', default='engine-host', envvar='EGERIA_ENGINE_HOST',
|
58
60
|
help='Egeria engine host to work with')
|
59
|
-
@click.option('--engine_host_url', default
|
61
|
+
@click.option('--engine_host_url', default='https://localhost:9443', envvar='EGERIA_ENGINE_HOST_URL',
|
60
62
|
help='URL of Egeria engine host platform to connect to')
|
61
|
-
@click.option('--admin_user', default
|
62
|
-
@click.option('--admin_user_password', default
|
63
|
+
@click.option('--admin_user', default='garygeeke', envvar='EGERIA_ADMIN_USER', help='Egeria admin user')
|
64
|
+
@click.option('--admin_user_password', default='secret', envvar='EGERIA_ADMIN_PASSWORD',
|
63
65
|
help='Egeria admin password')
|
64
|
-
@click.option('--userid', default
|
65
|
-
@click.option('--password', default
|
66
|
+
@click.option('--userid', default='garygeeke', envvar='EGERIA_USER', help='Egeria user')
|
67
|
+
@click.option('--password', default='secret', envvar='EGERIA_PASSWORD',
|
66
68
|
help='Egeria user password')
|
67
|
-
@click.option('--timeout', default
|
68
|
-
@click.option('--verbose', is_flag
|
69
|
-
@click.option('--paging', is_flag
|
70
|
-
@click.option('--jupyter', is_flag
|
71
|
-
|
72
|
-
|
69
|
+
@click.option('--timeout', default=60, help='Number of seconds to wait')
|
70
|
+
@click.option('--verbose', is_flag=True, default=False, help='Enable verbose mode')
|
71
|
+
@click.option('--paging', is_flag=True, default=False, help='Enable paging snapshots vs live updates')
|
72
|
+
@click.option('--jupyter', is_flag=True, default=False, envvar='EGERIA_JUPYTER',
|
73
|
+
help='Enable for rendering in a Jupyter terminal')
|
74
|
+
@click.option('--width', default=200, envvar='EGERIA_WIDTH', help='Screen width, in characters, to use')
|
73
75
|
@click.pass_context
|
74
76
|
def cli(ctx, server, url, view_server, view_server_url, integration_daemon, integration_daemon_url,
|
75
77
|
engine_host, engine_host_url, admin_user, admin_user_password, userid, password, timeout, paging,
|
@@ -77,7 +79,7 @@ def cli(ctx, server, url, view_server, view_server_url, integration_daemon, inte
|
|
77
79
|
"""An Egeria Command Line interface for Operations """
|
78
80
|
ctx.obj = Config(server, url, view_server, view_server_url, integration_daemon,
|
79
81
|
integration_daemon_url, engine_host, engine_host_url,
|
80
|
-
admin_user, admin_user_password,userid, password,
|
82
|
+
admin_user, admin_user_password, userid, password,
|
81
83
|
timeout, paging, verbose, jupyter, width)
|
82
84
|
ctx.max_content_width = 200
|
83
85
|
ctx.ensure_object(Config)
|
@@ -91,19 +93,21 @@ def show(ctx):
|
|
91
93
|
"""Display an Egeria Object"""
|
92
94
|
pass
|
93
95
|
|
96
|
+
|
94
97
|
@show.group('platforms')
|
95
98
|
@click.pass_context
|
96
99
|
def show_platform(ctx):
|
97
100
|
"""Group of commands to show information about Egeria platforms"""
|
98
101
|
pass
|
99
102
|
|
103
|
+
|
100
104
|
@show_platform.command('status')
|
101
105
|
@click.pass_context
|
102
106
|
def show_platform_status(ctx):
|
103
107
|
"""Display a live status view of known platforms"""
|
104
108
|
c = ctx.obj
|
105
|
-
p_display_status(c.view_server,c.view_server_url,
|
106
|
-
|
109
|
+
p_display_status(c.view_server, c.view_server_url,
|
110
|
+
c.admin_user, c.admin_user_password)
|
107
111
|
|
108
112
|
|
109
113
|
@show.group("servers")
|
@@ -112,16 +116,19 @@ def show_server(ctx):
|
|
112
116
|
"""Group of commands to show information about Egeria servers"""
|
113
117
|
pass
|
114
118
|
|
119
|
+
|
115
120
|
@show_server.command('status')
|
116
|
-
@click.option('--full', is_flag=True, default
|
121
|
+
@click.option('--full', is_flag=True, default=False, help='If True, full server descriptions will be shown')
|
117
122
|
@click.pass_context
|
118
123
|
def show_server_status(ctx, full):
|
119
124
|
"""Display a live status view of Egeria servers for the specified Egeria platform"""
|
120
125
|
c = ctx.obj
|
121
126
|
if full:
|
122
|
-
display_list(c.metadata_store, c.metadata_store_url, c.admin_user,c.admin_user_password)
|
127
|
+
display_list(c.metadata_store, c.metadata_store_url, c.admin_user, c.admin_user_password, c.jupyter, c.width)
|
123
128
|
else:
|
124
|
-
s_display_status(c.metadata_store, c.metadata_store_url, c.admin_user,c.admin_user_password
|
129
|
+
s_display_status(c.metadata_store, c.metadata_store_url, c.admin_user, c.admin_user_password, c.jupyter,
|
130
|
+
c.width)
|
131
|
+
|
125
132
|
|
126
133
|
@show.group("engines")
|
127
134
|
@click.pass_context
|
@@ -129,25 +136,27 @@ def engine_host(ctx):
|
|
129
136
|
"""Group of commands to show information about Egeria engines"""
|
130
137
|
pass
|
131
138
|
|
139
|
+
|
132
140
|
@engine_host.command("status")
|
133
|
-
@click.option('--list', is_flag=True, default
|
141
|
+
@click.option('--list', is_flag=True, default=False, help='If True, a paged list will be shown')
|
134
142
|
@click.pass_context
|
135
|
-
def gov_eng_status(ctx,list):
|
143
|
+
def gov_eng_status(ctx, list):
|
136
144
|
"""Display engine-host status information"""
|
137
145
|
c = ctx.obj
|
138
146
|
display_gov_eng_status(c.engine_host, c.engine_host_url,
|
139
|
-
|
140
|
-
|
147
|
+
c.admin_user, c.admin_user_password,
|
148
|
+
list, c.jupyter, c.width)
|
149
|
+
|
141
150
|
|
142
151
|
@engine_host.command('activity')
|
143
|
-
@click.option('--list', is_flag=True, default
|
152
|
+
@click.option('--list', is_flag=True, default=False, help='If True, a paged list will be shown')
|
144
153
|
@click.pass_context
|
145
|
-
def eng_activity_status(ctx,list):
|
154
|
+
def eng_activity_status(ctx, list):
|
146
155
|
"""Show Governance Activity in engine-host"""
|
147
156
|
c = ctx.obj
|
148
157
|
display_engine_activity(c.view_server, c.view_server_url,
|
149
|
-
|
150
|
-
|
158
|
+
c.admin_user, c.admin_user_password,
|
159
|
+
list, c.jupyter, c.width)
|
151
160
|
|
152
161
|
|
153
162
|
@show.group('integrations')
|
@@ -156,24 +165,27 @@ def integrations(ctx):
|
|
156
165
|
"""Group of commands to show information about Egeria integrations"""
|
157
166
|
pass
|
158
167
|
|
168
|
+
|
159
169
|
@integrations.command("status")
|
160
|
-
@click.option('--list', is_flag=True, default
|
170
|
+
@click.option('--list', is_flag=True, default=False, help='If True, a paged list will be shown')
|
161
171
|
@click.pass_context
|
162
|
-
def integrations_status(ctx,list):
|
172
|
+
def integrations_status(ctx, list):
|
163
173
|
"""Display integration-daemon status information"""
|
164
174
|
c = ctx.obj
|
165
175
|
display_integration_daemon_status(c.integration_daemon, c.integration_daemon_url,
|
166
|
-
|
167
|
-
|
176
|
+
c.view_server, c.view_server_url,
|
177
|
+
c.userid, c.password, list, c.jupyter, c.width)
|
178
|
+
|
168
179
|
|
169
180
|
@integrations.command("targets")
|
170
181
|
@click.pass_context
|
171
|
-
@click.argument('connector',nargs=1)
|
172
|
-
def integrations_status(ctx,connector):
|
182
|
+
@click.argument('connector', nargs=1)
|
183
|
+
def integrations_status(ctx, connector):
|
173
184
|
"""Display Catalog Targets for a connector"""
|
174
185
|
c = ctx.obj
|
175
186
|
display_catalog_targets(connector, c.view_server, c.view_server_url,
|
176
|
-
|
187
|
+
c.userid, c.password, c.jupyter, c.width)
|
188
|
+
|
177
189
|
|
178
190
|
#
|
179
191
|
# Tell
|
@@ -185,29 +197,32 @@ def tell(ctx):
|
|
185
197
|
"""Perform actions an Egeria Objects"""
|
186
198
|
pass
|
187
199
|
|
200
|
+
|
188
201
|
@tell.group('integration_daemon')
|
189
202
|
@click.pass_context
|
190
203
|
def integration_daemon(ctx):
|
191
204
|
"""Group of commands to an integration-daemon"""
|
192
205
|
pass
|
193
206
|
|
207
|
+
|
194
208
|
@integration_daemon.command('refresh')
|
195
209
|
@click.pass_context
|
196
|
-
@click.option('--connector', default
|
197
|
-
def refresh_connectors(ctx,connector):
|
210
|
+
@click.option('--connector', default='all', help="Name of connector to refresh or 'all' to refresh all")
|
211
|
+
def refresh_connectors(ctx, connector):
|
198
212
|
"""Refresh the specified integration connector or ALL connectors if not specified"""
|
199
213
|
c = ctx.obj
|
200
|
-
refresh_connector(connector,c.integration_daemon, c.integration_daemon_url,
|
201
|
-
|
214
|
+
refresh_connector(connector, c.integration_daemon, c.integration_daemon_url,
|
215
|
+
c.userid, c.password)
|
216
|
+
|
202
217
|
|
203
218
|
@integration_daemon.command('restart')
|
204
219
|
@click.pass_context
|
205
|
-
@click.option('--connector', default
|
206
|
-
def restart_connectors(ctx,connector):
|
220
|
+
@click.option('--connector', default='all', help="Name of connector to restart or 'all' to restart all")
|
221
|
+
def restart_connectors(ctx, connector):
|
207
222
|
"""Restart the specified integration connector or ALL connectors if not specified"""
|
208
223
|
c = ctx.obj
|
209
|
-
restart_connector(connector,c.integration_daemon, c.integration_daemon_url,
|
210
|
-
|
224
|
+
restart_connector(connector, c.integration_daemon, c.integration_daemon_url,
|
225
|
+
c.userid, c.password)
|
211
226
|
|
212
227
|
|
213
228
|
integration_daemon.add_command(add_catalog_target)
|
@@ -216,6 +231,5 @@ integration_daemon.add_command(update_catalog_target)
|
|
216
231
|
integration_daemon.add_command(stop_server)
|
217
232
|
integration_daemon.add_command(start_server)
|
218
233
|
|
219
|
-
|
220
234
|
if __name__ == '__main__':
|
221
|
-
cli()
|
235
|
+
cli()
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/list_catalog_targets.py
RENAMED
@@ -37,8 +37,8 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
|
37
37
|
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
38
38
|
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
39
39
|
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
40
|
-
EGERIA_JUPYTER = os.environ.get('EGERIA_JUPYTER', False)
|
41
|
-
EGERIA_WIDTH = os.environ.get('EGERIA_WIDTH', 200)
|
40
|
+
EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
|
41
|
+
EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
|
42
42
|
|
43
43
|
|
44
44
|
def display_catalog_targets(connector: str, server: str, url: str, username: str, user_password: str,
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_engine_activity.py
RENAMED
@@ -39,8 +39,8 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
|
39
39
|
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
40
40
|
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
41
41
|
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
42
|
-
EGERIA_JUPYTER = os.environ.get('EGERIA_JUPYTER', False)
|
43
|
-
EGERIA_WIDTH = os.environ.get('EGERIA_WIDTH', 200)
|
42
|
+
EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
|
43
|
+
EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
|
44
44
|
|
45
45
|
disable_ssl_warnings = True
|
46
46
|
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_gov_eng_status.py
RENAMED
@@ -37,8 +37,9 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
|
37
37
|
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
38
38
|
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
39
39
|
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
40
|
-
EGERIA_JUPYTER = os.environ.get('EGERIA_JUPYTER', False)
|
41
|
-
EGERIA_WIDTH = os.environ.get('EGERIA_WIDTH', 200)
|
40
|
+
EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
|
41
|
+
EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
|
42
|
+
|
42
43
|
|
43
44
|
disable_ssl_warnings = True
|
44
45
|
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_platform_status.py
RENAMED
@@ -6,21 +6,21 @@ Copyright Contributors to the ODPi Egeria project.
|
|
6
6
|
Display the status of cataloged platforms and servers.
|
7
7
|
"""
|
8
8
|
|
9
|
-
import time
|
10
9
|
import argparse
|
11
10
|
import os
|
11
|
+
import time
|
12
|
+
|
13
|
+
from rich.console import Console
|
14
|
+
from rich.live import Live
|
15
|
+
from rich.table import Table
|
12
16
|
|
17
|
+
from pyegeria import RuntimeManager
|
13
18
|
from pyegeria._exceptions import (
|
14
19
|
InvalidParameterException,
|
15
20
|
PropertyServerException,
|
16
21
|
UserNotAuthorizedException,
|
17
22
|
print_exception_response,
|
18
23
|
)
|
19
|
-
from rich.table import Table
|
20
|
-
from rich.live import Live
|
21
|
-
from rich.console import Console
|
22
|
-
|
23
|
-
from pyegeria import RuntimeManager
|
24
24
|
|
25
25
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
26
26
|
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
@@ -33,13 +33,18 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
|
33
33
|
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
34
34
|
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
35
35
|
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
36
|
+
EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
|
37
|
+
EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
|
36
38
|
|
37
39
|
disable_ssl_warnings = True
|
38
40
|
console = Console(width=200)
|
39
41
|
|
40
|
-
|
42
|
+
|
43
|
+
def display_status(server: str, url: str, username: str, user_pass: str, jupyter: bool = EGERIA_JUPYTER,
|
44
|
+
width: int = EGERIA_WIDTH):
|
41
45
|
r_client = RuntimeManager(server, url, username)
|
42
46
|
token = r_client.create_egeria_bearer_token(username, user_pass)
|
47
|
+
|
43
48
|
def generate_table() -> Table:
|
44
49
|
"""Make a new table."""
|
45
50
|
table = Table(
|
@@ -63,9 +68,9 @@ def display_status(server: str, url: str, username: str, user_pass:str):
|
|
63
68
|
|
64
69
|
server_types = {
|
65
70
|
"Metadata Access Store": "Store",
|
66
|
-
"View Server"
|
67
|
-
"Engine Host Server"
|
68
|
-
"Integration Daemon"
|
71
|
+
"View Server": "View",
|
72
|
+
"Engine Host Server": "EngineHost",
|
73
|
+
"Integration Daemon": "Integration"
|
69
74
|
}
|
70
75
|
|
71
76
|
platform_list = r_client.get_platforms_by_type()
|
@@ -76,18 +81,18 @@ def display_status(server: str, url: str, username: str, user_pass:str):
|
|
76
81
|
server_list = ""
|
77
82
|
try:
|
78
83
|
platform_report = r_client.get_platform_report(platform_guid)
|
79
|
-
platform_url = platform_report.get('platformURLRoot'," ")
|
80
|
-
platform_origin = platform_report.get("platformOrigin"," ")
|
81
|
-
platform_started = platform_report.get("platformStartTime"," ")
|
84
|
+
platform_url = platform_report.get('platformURLRoot', " ")
|
85
|
+
platform_origin = platform_report.get("platformOrigin", " ")
|
86
|
+
platform_started = platform_report.get("platformStartTime", " ")
|
82
87
|
|
83
|
-
servers = platform_report.get("omagservers",None)
|
88
|
+
servers = platform_report.get("omagservers", None)
|
84
89
|
|
85
90
|
if servers is not None:
|
86
91
|
for server in servers:
|
87
|
-
server_name = server.get("serverName"," ")
|
88
|
-
server_type = server.get("serverType"," ")
|
89
|
-
server_status = server.get("serverActiveStatus","UNKNOWN")
|
90
|
-
if server_status in("RUNNING", "STARTING"):
|
92
|
+
server_name = server.get("serverName", " ")
|
93
|
+
server_type = server.get("serverType", " ")
|
94
|
+
server_status = server.get("serverActiveStatus", "UNKNOWN")
|
95
|
+
if server_status in ("RUNNING", "STARTING"):
|
91
96
|
status_flag = "[bright green]"
|
92
97
|
elif server_status in ("INACTIVE", "STOPPING"):
|
93
98
|
status_flag = "[bright red]"
|
@@ -99,17 +104,15 @@ def display_status(server: str, url: str, username: str, user_pass:str):
|
|
99
104
|
server_list = server_list + serv
|
100
105
|
|
101
106
|
table.add_row(platform_name, platform_url, platform_origin, platform_desc,
|
102
|
-
platform_started, server_list, style
|
107
|
+
platform_started, server_list, style="bold white on black")
|
103
108
|
except (Exception) as e:
|
104
109
|
# console.print_exception(e)
|
105
110
|
platform_url = " "
|
106
111
|
platform_origin = " "
|
107
112
|
platform_started = " "
|
108
113
|
|
109
|
-
|
110
114
|
return table
|
111
115
|
|
112
|
-
|
113
116
|
try:
|
114
117
|
with Live(generate_table(), refresh_per_second=4, screen=True) as live:
|
115
118
|
while True:
|
@@ -142,4 +145,4 @@ def main():
|
|
142
145
|
|
143
146
|
|
144
147
|
if __name__ == "__main__":
|
145
|
-
main()
|
148
|
+
main()
|
@@ -8,21 +8,17 @@ Unit tests for the Utils helper functions using the Pytest framework.
|
|
8
8
|
|
9
9
|
A simple server status display
|
10
10
|
"""
|
11
|
+
import argparse
|
11
12
|
import os
|
12
13
|
import time
|
13
|
-
import argparse
|
14
14
|
|
15
|
-
from pyegeria._exceptions import (
|
16
|
-
InvalidParameterException,
|
17
|
-
PropertyServerException,
|
18
|
-
UserNotAuthorizedException,
|
19
|
-
print_exception_response,
|
20
|
-
)
|
21
|
-
from rich.table import Table
|
22
15
|
from rich.live import Live
|
16
|
+
from rich.table import Table
|
23
17
|
|
24
|
-
from pyegeria.
|
18
|
+
from pyegeria._exceptions import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException,
|
19
|
+
print_exception_response, )
|
25
20
|
from pyegeria.core_omag_server_config import CoreServerConfig
|
21
|
+
from pyegeria.server_operations import ServerOps
|
26
22
|
|
27
23
|
disable_ssl_warnings = True
|
28
24
|
|
@@ -37,24 +33,23 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
|
37
33
|
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
38
34
|
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
39
35
|
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
36
|
+
EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
|
37
|
+
EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
|
40
38
|
|
41
|
-
|
39
|
+
|
40
|
+
def display_status(server: str, url: str, username: str, user_pass: str, jupyter: bool = EGERIA_JUPYTER,
|
41
|
+
width: int = EGERIA_WIDTH):
|
42
42
|
p_client = ServerOps(server, url, username)
|
43
43
|
c_client = CoreServerConfig(server, url, username, user_pass)
|
44
44
|
|
45
45
|
def generate_table() -> Table:
|
46
46
|
"""Make a new table."""
|
47
|
-
table = Table(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
caption_style="white on black",
|
54
|
-
caption=f"Server Status for Platform - '{url}'",
|
55
|
-
show_lines=True,
|
56
|
-
# expand=True
|
57
|
-
)
|
47
|
+
table = Table(title=f"Server Status for Platform - {time.asctime()}", style="bold white on black",
|
48
|
+
row_styles=["bold white on black"], header_style="white on dark_blue",
|
49
|
+
title_style="bold white on black",
|
50
|
+
caption_style="white on black", caption=f"Server Status for Platform - '{url}'", show_lines=True,
|
51
|
+
# expand=True
|
52
|
+
)
|
58
53
|
|
59
54
|
table.add_column("Known Server")
|
60
55
|
table.add_column("Status")
|
@@ -73,9 +68,8 @@ def display_status(server: str, url: str, username: str, user_pass:str):
|
|
73
68
|
server_type = c_client.get_server_type_classification(server)["serverTypeName"]
|
74
69
|
description = c_client.get_basic_server_properties(server).get("localServerDescription", " ")
|
75
70
|
|
76
|
-
table.add_row(server,
|
77
|
-
|
78
|
-
server_type, description)
|
71
|
+
table.add_row(server, "[red]Inactive" if status == "Inactive" else "[green]Active", server_type,
|
72
|
+
description)
|
79
73
|
|
80
74
|
return table
|
81
75
|
|
@@ -110,5 +104,6 @@ def main():
|
|
110
104
|
|
111
105
|
display_status(server, url, userid, user_pass)
|
112
106
|
|
107
|
+
|
113
108
|
if __name__ == "__main__":
|
114
|
-
main()
|
109
|
+
main()
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_server_status.py
RENAMED
@@ -8,9 +8,12 @@ Unit tests for the Utils helper functions using the Pytest framework.
|
|
8
8
|
|
9
9
|
A simple server status display
|
10
10
|
"""
|
11
|
+
import argparse
|
11
12
|
import os
|
12
13
|
import time
|
13
|
-
|
14
|
+
|
15
|
+
from rich.live import Live
|
16
|
+
from rich.table import Table
|
14
17
|
|
15
18
|
from pyegeria import (
|
16
19
|
InvalidParameterException,
|
@@ -19,8 +22,6 @@ from pyegeria import (
|
|
19
22
|
print_exception_response,
|
20
23
|
ServerOps
|
21
24
|
)
|
22
|
-
from rich.table import Table
|
23
|
-
from rich.live import Live
|
24
25
|
|
25
26
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
26
27
|
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
@@ -33,8 +34,12 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
|
33
34
|
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
34
35
|
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
35
36
|
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
37
|
+
EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
|
38
|
+
EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
|
36
39
|
|
37
|
-
|
40
|
+
|
41
|
+
def display_status(server: str, url: str, username: str, user_pass: str, jupyter: bool = EGERIA_JUPYTER,
|
42
|
+
width: int = EGERIA_WIDTH):
|
38
43
|
p_client = ServerOps(server, url, username, user_pass)
|
39
44
|
|
40
45
|
def generate_table() -> Table:
|
@@ -75,10 +80,6 @@ def display_status(server: str, url: str , username: str , user_pass:str):
|
|
75
80
|
while True:
|
76
81
|
time.sleep(2)
|
77
82
|
live.update(generate_table())
|
78
|
-
# services = p_client.get_server_status(server)['serverStatus']['services']
|
79
|
-
# for service in services:
|
80
|
-
# service_name = service['serviceName']
|
81
|
-
# service_status = service['serviceStatus']
|
82
83
|
|
83
84
|
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
|
84
85
|
print_exception_response(e)
|
@@ -103,5 +104,6 @@ def main():
|
|
103
104
|
|
104
105
|
display_status(server, url, userid, user_pass)
|
105
106
|
|
107
|
+
|
106
108
|
if __name__ == "__main__":
|
107
|
-
main()
|
109
|
+
main()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "pyegeria"
|
3
|
-
version = "0.5.8.
|
3
|
+
version = "0.5.8.17"
|
4
4
|
license = 'Apache 2.0'
|
5
5
|
authors = ["Dan Wolfson <dan.wolfson@pdr-associates.com>"]
|
6
6
|
readme = "README.md"
|
@@ -54,13 +54,13 @@ pytest = "^8.2.2"
|
|
54
54
|
get_asset_graph = "examples.widgets.catalog_user.get_asset_graph:main"
|
55
55
|
get_collection = "examples.widgets.catalog_user.get_collection:main"
|
56
56
|
list_glossary = "examples.widgets.catalog_user.list_glossary:main"
|
57
|
+
get_tech_type_elements = "examples.widgets.catalog_user.get_tech_type_elements:main"
|
58
|
+
get_tech_type_template = "examples.widgets.catalog_user.get_tech_type_template:main"
|
57
59
|
|
58
|
-
get_tech_type_elements = "examples.widgets.operational.get_tech_type_elements:main"
|
59
|
-
get_tech_type_template = "examples.widgets.operational.get_tech_type_template:main"
|
60
60
|
monitor_asset_events = "examples.widgets.operational.monitor_asset_events:main"
|
61
61
|
monitor_coco_status = "examples.widgets.operational.monitor_coco_status:main"
|
62
|
-
|
63
|
-
|
62
|
+
monitor_engine_activity = "examples.widgets.operational.monitor_engine_activity:main_live"
|
63
|
+
list_engine_activity = "examples.widgets.operational.monitor_engine_activity:main_paging "
|
64
64
|
monitor_gov_eng_status = "examples.widgets.operational.monitor_gov_eng_status:main_live"
|
65
65
|
list_gov_eng_status = "examples.widgets.operational.monitor_gov_eng_status:main_paging"
|
66
66
|
monitor_integ_daemon_status = "examples.widgets.operational.monitor_integ_daemon_status:main_live"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/catalog_user/get_tech_type_elements.py
RENAMED
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/catalog_user/get_tech_type_template.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/list_registered_services.py
RENAMED
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/list_relationship_types.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/developer/list_valid_metadata_values.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/integration_daemon_actions.py
RENAMED
File without changes
|
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_asset_events.py
RENAMED
File without changes
|
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/monitor_integ_daemon_status.py
RENAMED
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/refresh_integration_daemon.py
RENAMED
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/operational/restart_integration_daemon.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/personal_organizer/list_my_profile.py
RENAMED
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/personal_organizer/list_projects.py
RENAMED
File without changes
|
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/personal_organizer/monitor_my_todos.py
RENAMED
File without changes
|
{pyegeria-0.5.8.15 → pyegeria-0.5.8.17}/examples/widgets/personal_organizer/monitor_open_todos.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|