pyegeria 0.8.4.25__py3-none-any.whl → 0.8.4.27__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.
- commands/cli/__init__.py +1 -1
- commands/cli/egeria.py +47 -28
- commands/cli/egeria_ops.py +39 -34
- commands/cli/egeria_tech.py +1 -1
- commands/ops/gov_server_actions.py +2 -4
- commands/ops/load_archive.py +40 -29
- commands/ops/monitor_gov_eng_status.py +25 -14
- commands/ops/monitor_integ_daemon_status.py +6 -9
- commands/ops/monitor_platform_status.py +1 -1
- commands/ops/monitor_server_status.py +93 -38
- commands/ops/orig_monitor_server_status.py +109 -0
- pyegeria/__init__.py +0 -1
- pyegeria/runtime_manager_omvs.py +2 -2
- {pyegeria-0.8.4.25.dist-info → pyegeria-0.8.4.27.dist-info}/METADATA +1 -1
- {pyegeria-0.8.4.25.dist-info → pyegeria-0.8.4.27.dist-info}/RECORD +19 -19
- {pyegeria-0.8.4.25.dist-info → pyegeria-0.8.4.27.dist-info}/entry_points.txt +1 -1
- commands/ops/monitor_coco_status.py +0 -103
- /commands/ops/{monitor_server_list.py → orig_monitor_server_list.py} +0 -0
- {pyegeria-0.8.4.25.dist-info → pyegeria-0.8.4.27.dist-info}/LICENSE +0 -0
- {pyegeria-0.8.4.25.dist-info → pyegeria-0.8.4.27.dist-info}/WHEEL +0 -0
commands/cli/__init__.py
CHANGED
commands/cli/egeria.py
CHANGED
@@ -52,7 +52,6 @@ from commands.ops.monitor_integ_daemon_status import (
|
|
52
52
|
from commands.ops.monitor_platform_status import (
|
53
53
|
display_status as p_display_status,
|
54
54
|
)
|
55
|
-
from commands.ops.monitor_server_list import display_status as display_list
|
56
55
|
from commands.ops.monitor_server_status import (
|
57
56
|
display_status as s_display_status,
|
58
57
|
)
|
@@ -839,7 +838,7 @@ def show_projects(ctx, search_string):
|
|
839
838
|
"--status",
|
840
839
|
type=click.Choice(
|
841
840
|
["OPEN", "IN_PROGRESS", "WAITING", "COMPLETE", "ABANDONED", "None"],
|
842
|
-
case_sensitive=
|
841
|
+
case_sensitive=False,
|
843
842
|
),
|
844
843
|
help="Enter an optional status filter, default='OPEN'",
|
845
844
|
required=False,
|
@@ -877,7 +876,13 @@ def list_archives(ctx):
|
|
877
876
|
"""Display a tree graph of information about an asset"""
|
878
877
|
c = ctx.obj
|
879
878
|
display_archive_list(
|
880
|
-
c.view_server,
|
879
|
+
c.view_server,
|
880
|
+
c.view_server_url,
|
881
|
+
c.userid,
|
882
|
+
c.password,
|
883
|
+
False,
|
884
|
+
c.jupyter,
|
885
|
+
c.width,
|
881
886
|
)
|
882
887
|
|
883
888
|
|
@@ -964,30 +969,21 @@ def show_server(ctx):
|
|
964
969
|
"--full",
|
965
970
|
is_flag=True,
|
966
971
|
default=False,
|
967
|
-
help="If
|
972
|
+
help="If set, full server descriptions will be shown",
|
968
973
|
)
|
969
974
|
@click.pass_context
|
970
975
|
def show_server_status(ctx, full):
|
971
976
|
"""Display a live status view of Egeria servers for the specified Egeria platform"""
|
972
977
|
c = ctx.obj
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
else:
|
983
|
-
s_display_status(
|
984
|
-
c.metadata_store,
|
985
|
-
c.metadata_store_url,
|
986
|
-
c.admin_user,
|
987
|
-
c.admin_user_password,
|
988
|
-
c.jupyter,
|
989
|
-
c.width,
|
990
|
-
)
|
978
|
+
s_display_status(
|
979
|
+
full,
|
980
|
+
c.view_server,
|
981
|
+
c.view_server_url,
|
982
|
+
c.userid,
|
983
|
+
c.password,
|
984
|
+
c.jupyter,
|
985
|
+
c.width,
|
986
|
+
)
|
991
987
|
|
992
988
|
|
993
989
|
@show.group("engines")
|
@@ -1001,12 +997,24 @@ def engine_host(ctx):
|
|
1001
997
|
@click.option(
|
1002
998
|
"--list", is_flag=True, default=False, help="If True, a paged list will be shown"
|
1003
999
|
)
|
1000
|
+
@click.option(
|
1001
|
+
"--engine-host",
|
1002
|
+
default="engine-host",
|
1003
|
+
help="Name of the Engine Host to get status for",
|
1004
|
+
)
|
1004
1005
|
@click.pass_context
|
1005
|
-
def gov_eng_status(ctx, list):
|
1006
|
+
def gov_eng_status(ctx, engine_host, list):
|
1006
1007
|
"""Display engine-host status information"""
|
1007
1008
|
c = ctx.obj
|
1008
1009
|
display_gov_eng_status(
|
1009
|
-
|
1010
|
+
engine_host,
|
1011
|
+
c.view_server,
|
1012
|
+
c.view_server_url,
|
1013
|
+
c.userid,
|
1014
|
+
c.password,
|
1015
|
+
list,
|
1016
|
+
c.jupyter,
|
1017
|
+
c.width,
|
1010
1018
|
)
|
1011
1019
|
|
1012
1020
|
|
@@ -1122,11 +1130,16 @@ def integration_daemon(ctx):
|
|
1122
1130
|
default="all",
|
1123
1131
|
help="Name of connector to refresh or 'all' to refresh all",
|
1124
1132
|
)
|
1125
|
-
|
1133
|
+
@click.option(
|
1134
|
+
"--server",
|
1135
|
+
default="integration-daemon",
|
1136
|
+
help="Name of the integration server to refresh",
|
1137
|
+
)
|
1138
|
+
def refresh_connectors(ctx, server, connector):
|
1126
1139
|
"""Refresh the specified integration connector or ALL connectors if not specified"""
|
1127
1140
|
c = ctx.obj
|
1128
1141
|
refresh_connector(
|
1129
|
-
connector, c.
|
1142
|
+
connector, server, c.view_server_url, c.view_server, c.userid, c.password
|
1130
1143
|
)
|
1131
1144
|
|
1132
1145
|
|
@@ -1137,11 +1150,16 @@ def refresh_connectors(ctx, connector):
|
|
1137
1150
|
default="all",
|
1138
1151
|
help="Name of connector to restart or 'all' to restart all",
|
1139
1152
|
)
|
1140
|
-
|
1153
|
+
@click.option(
|
1154
|
+
"--server",
|
1155
|
+
default="integration-daemon",
|
1156
|
+
help="Name of the integration server to refresh",
|
1157
|
+
)
|
1158
|
+
def restart_connectors(ctx, server, connector):
|
1141
1159
|
"""Restart the specified integration connector or ALL connectors if not specified"""
|
1142
1160
|
c = ctx.obj
|
1143
1161
|
restart_connector(
|
1144
|
-
connector, c.
|
1162
|
+
connector, server, c.view_server_url, c.view_server, c.userid, c.password
|
1145
1163
|
)
|
1146
1164
|
|
1147
1165
|
|
@@ -1161,6 +1179,7 @@ def engine_host(ctx):
|
|
1161
1179
|
|
1162
1180
|
engine_host.add_command(start_server)
|
1163
1181
|
engine_host.add_command(stop_server)
|
1182
|
+
engine_host.add_command(refresh_gov_eng_config)
|
1164
1183
|
|
1165
1184
|
|
1166
1185
|
@tell.group("repository")
|
commands/cli/egeria_ops.py
CHANGED
@@ -34,7 +34,6 @@ from commands.ops.monitor_integ_daemon_status import (
|
|
34
34
|
from commands.ops.monitor_platform_status import (
|
35
35
|
display_status as p_display_status,
|
36
36
|
)
|
37
|
-
from commands.ops.monitor_server_list import display_status as display_list
|
38
37
|
from commands.ops.monitor_server_status import (
|
39
38
|
display_status as s_display_status,
|
40
39
|
)
|
@@ -120,9 +119,7 @@ from commands.ops.restart_integration_daemon import restart_connector
|
|
120
119
|
envvar="EGERIA_ADMIN_PASSWORD",
|
121
120
|
help="Egeria admin password",
|
122
121
|
)
|
123
|
-
@click.option(
|
124
|
-
"--userid", default="erinoverview", envvar="EGERIA_USER", help="Egeria user"
|
125
|
-
)
|
122
|
+
@click.option("--userid", default="garygeeke", envvar="EGERIA_USER", help="Egeria user")
|
126
123
|
@click.option(
|
127
124
|
"--password",
|
128
125
|
default="secret",
|
@@ -233,30 +230,21 @@ def show_server(ctx):
|
|
233
230
|
"--full",
|
234
231
|
is_flag=True,
|
235
232
|
default=False,
|
236
|
-
help="If
|
233
|
+
help="If set, full server descriptions will be shown",
|
237
234
|
)
|
238
235
|
@click.pass_context
|
239
236
|
def show_server_status(ctx, full):
|
240
237
|
"""Display a live status view of Egeria servers for the specified Egeria platform"""
|
241
238
|
c = ctx.obj
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
else:
|
252
|
-
s_display_status(
|
253
|
-
c.metadata_store,
|
254
|
-
c.metadata_store_url,
|
255
|
-
c.admin_user,
|
256
|
-
c.admin_user_password,
|
257
|
-
c.jupyter,
|
258
|
-
c.width,
|
259
|
-
)
|
239
|
+
s_display_status(
|
240
|
+
full,
|
241
|
+
c.view_server,
|
242
|
+
c.view_server_url,
|
243
|
+
c.userid,
|
244
|
+
c.password,
|
245
|
+
c.jupyter,
|
246
|
+
c.width,
|
247
|
+
)
|
260
248
|
|
261
249
|
|
262
250
|
@show.group("engines")
|
@@ -267,15 +255,27 @@ def engine_host(ctx):
|
|
267
255
|
|
268
256
|
|
269
257
|
@engine_host.command("status")
|
258
|
+
@click.option(
|
259
|
+
"--engine-host",
|
260
|
+
default="engine-host",
|
261
|
+
help="Name of the Engine Host to get status for",
|
262
|
+
)
|
270
263
|
@click.option(
|
271
264
|
"--list", is_flag=True, default=False, help="If True, a paged list will be shown"
|
272
265
|
)
|
273
266
|
@click.pass_context
|
274
|
-
def gov_eng_status(ctx, list):
|
267
|
+
def gov_eng_status(ctx, engine_host, list):
|
275
268
|
"""Display engine-host status information"""
|
276
269
|
c = ctx.obj
|
277
270
|
display_gov_eng_status(
|
278
|
-
c.engine_host,
|
271
|
+
c.engine_host,
|
272
|
+
c.view_server,
|
273
|
+
c.view_server_url,
|
274
|
+
c.userid,
|
275
|
+
c.password,
|
276
|
+
list,
|
277
|
+
c.jupyter,
|
278
|
+
c.width,
|
279
279
|
)
|
280
280
|
|
281
281
|
|
@@ -386,9 +386,6 @@ def servers(ctx):
|
|
386
386
|
|
387
387
|
servers.add_command(start_server)
|
388
388
|
servers.add_command(stop_server)
|
389
|
-
servers.add_command(refresh_gov_eng_config)
|
390
|
-
|
391
|
-
CONTEXT_SETTINGS = dict(default_map={"runserver": {"port": 5000}})
|
392
389
|
|
393
390
|
|
394
391
|
@tell.group("integration-daemon")
|
@@ -405,11 +402,16 @@ def integration_daemon(ctx):
|
|
405
402
|
default="all",
|
406
403
|
help="Name of connector to refresh or 'all' to refresh all",
|
407
404
|
)
|
408
|
-
|
405
|
+
@click.option(
|
406
|
+
"--server",
|
407
|
+
default="integration-daemon",
|
408
|
+
help="Name of the integration server to refresh",
|
409
|
+
)
|
410
|
+
def refresh_connectors(ctx, server, connector):
|
409
411
|
"""Refresh the specified integration connector or ALL connectors if not specified"""
|
410
412
|
c = ctx.obj
|
411
413
|
refresh_connector(
|
412
|
-
connector, c.
|
414
|
+
connector, server, c.view_server_url, c.view_server, c.userid, c.password
|
413
415
|
)
|
414
416
|
|
415
417
|
|
@@ -420,19 +422,22 @@ def refresh_connectors(ctx, connector):
|
|
420
422
|
default="all",
|
421
423
|
help="Name of connector to restart or 'all' to restart all",
|
422
424
|
)
|
423
|
-
|
425
|
+
@click.option(
|
426
|
+
"--server",
|
427
|
+
default="integration-daemon",
|
428
|
+
help="Name of the integration server to refresh",
|
429
|
+
)
|
430
|
+
def restart_connectors(ctx, server, connector):
|
424
431
|
"""Restart the specified integration connector or ALL connectors if not specified"""
|
425
432
|
c = ctx.obj
|
426
433
|
restart_connector(
|
427
|
-
connector, c.
|
434
|
+
connector, server, c.view_server_url, c.view_server, c.userid, c.password
|
428
435
|
)
|
429
436
|
|
430
437
|
|
431
438
|
integration_daemon.add_command(add_catalog_target)
|
432
439
|
integration_daemon.add_command(remove_catalog_target)
|
433
440
|
integration_daemon.add_command(update_catalog_target)
|
434
|
-
integration_daemon.add_command(start_server)
|
435
|
-
integration_daemon.add_command(stop_server)
|
436
441
|
|
437
442
|
|
438
443
|
@tell.group("engine-host")
|
commands/cli/egeria_tech.py
CHANGED
@@ -112,7 +112,7 @@ from commands.tech.list_related_specification import (
|
|
112
112
|
help="Egeria admin password",
|
113
113
|
)
|
114
114
|
@click.option(
|
115
|
-
"--userid", default="
|
115
|
+
"--userid", default="peterprofile", envvar="EGERIA_USER", help="Egeria user"
|
116
116
|
)
|
117
117
|
@click.option(
|
118
118
|
"--password",
|
@@ -125,13 +125,11 @@ def refresh_gov_eng_config(ctx):
|
|
125
125
|
|
126
126
|
@click.command("start")
|
127
127
|
@click.pass_context
|
128
|
-
@click.option("--server", default=
|
128
|
+
@click.option("--server", default="simple-metadata-store", help="OMAG Server to start")
|
129
129
|
def start_server(ctx, server):
|
130
130
|
"""Start or restart an engine-host from its known configuration"""
|
131
131
|
c = ctx.obj
|
132
|
-
|
133
|
-
click.echo(c.parent.info_name)
|
134
|
-
server = "simple-metadata-store"
|
132
|
+
|
135
133
|
p_client = EgeriaTech(c.view_server, c.view_server_url, c.userid, c.password)
|
136
134
|
token = p_client.create_egeria_bearer_token()
|
137
135
|
try:
|
commands/ops/load_archive.py
CHANGED
@@ -13,50 +13,61 @@ import argparse
|
|
13
13
|
import time
|
14
14
|
import click
|
15
15
|
from trogon import tui
|
16
|
-
from pyegeria import
|
16
|
+
from pyegeria import AutomatedCuration, EgeriaTech
|
17
17
|
from pyegeria._exceptions import (
|
18
18
|
InvalidParameterException,
|
19
19
|
PropertyServerException,
|
20
20
|
UserNotAuthorizedException,
|
21
21
|
print_exception_response,
|
22
22
|
)
|
23
|
+
|
23
24
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
24
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
25
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
26
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
27
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
default='content-packs/CocoComboArchive.omarchive',
|
39
|
-
help='Full path on the Metadata Server to the archive file to load')
|
40
|
-
@click.option('--server', default = EGERIA_METADATA_STORE, help='Egeria metadata store to load')
|
41
|
-
@click.option('--url', default = EGERIA_PLATFORM_URL, help='URL of Egeria platform to connect to')
|
42
|
-
@click.option('--userid', default = EGERIA_ADMIN_USER, help='Egeria admin user')
|
43
|
-
@click.option('--password', default = EGERIA_ADMIN_PASSWORD, help='Egeria admin password')
|
44
|
-
@click.option('--timeout', default = 60, help = 'Number of seconds to wait')
|
45
|
-
def load_archive(file, server, url, userid, password, timeout):
|
46
|
-
"""Load an Open Metadata Archive"""
|
25
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
26
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
27
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
28
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
29
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
30
|
+
)
|
31
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
32
|
+
EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
|
33
|
+
"EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
|
34
|
+
)
|
35
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
36
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
37
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
38
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
47
39
|
|
48
|
-
try:
|
49
40
|
|
50
|
-
|
41
|
+
@click.command("load-archive")
|
42
|
+
@click.option(
|
43
|
+
"--file",
|
44
|
+
prompt="Path on the Metadata Server of the archive file to load",
|
45
|
+
default="content-packs/CocoComboArchive.omarchive",
|
46
|
+
help="Full path on the Metadata Server to the archive file to load",
|
47
|
+
)
|
48
|
+
@click.option(
|
49
|
+
"--server", default=EGERIA_METADATA_STORE, help="Egeria metadata store to load"
|
50
|
+
)
|
51
|
+
@click.option(
|
52
|
+
"--url", default=EGERIA_PLATFORM_URL, help="URL of Egeria platform to connect to"
|
53
|
+
)
|
54
|
+
@click.option("--userid", default=EGERIA_ADMIN_USER, help="Egeria admin user")
|
55
|
+
@click.option("--password", default=EGERIA_ADMIN_PASSWORD, help="Egeria admin password")
|
56
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
57
|
+
def load_archive(file, server, view_server, url, userid, password, timeout):
|
58
|
+
"""Load an Open Metadata Archive"""
|
51
59
|
|
52
|
-
|
60
|
+
try:
|
61
|
+
s_client = EgeriaTech(view_server, url, userid, password)
|
62
|
+
token = s_client.create_egeria_bearer_token()
|
63
|
+
server_guid = s_client.get_guid_for_name(server)
|
64
|
+
s_client.add_archive_file(file, server_guid, timeout=timeout)
|
53
65
|
|
54
66
|
click.echo(f"Loaded archive: {file}")
|
55
67
|
|
56
|
-
|
57
68
|
except (InvalidParameterException, PropertyServerException) as e:
|
58
69
|
print_exception_response(e)
|
59
70
|
|
60
71
|
|
61
72
|
if __name__ == "__main__":
|
62
|
-
load_archive()
|
73
|
+
load_archive()
|
@@ -9,7 +9,6 @@ Unit tests for the Utils helper functions using the Pytest framework.
|
|
9
9
|
A simple status display for Governance Actions
|
10
10
|
"""
|
11
11
|
import argparse
|
12
|
-
import json
|
13
12
|
import os
|
14
13
|
import time
|
15
14
|
|
@@ -23,7 +22,7 @@ from pyegeria import (
|
|
23
22
|
InvalidParameterException,
|
24
23
|
PropertyServerException,
|
25
24
|
UserNotAuthorizedException,
|
26
|
-
|
25
|
+
EgeriaTech,
|
27
26
|
)
|
28
27
|
from pyegeria.server_operations import ServerOps
|
29
28
|
|
@@ -53,7 +52,8 @@ disable_ssl_warnings = True
|
|
53
52
|
|
54
53
|
|
55
54
|
def display_gov_eng_status(
|
56
|
-
|
55
|
+
engine_host: str,
|
56
|
+
view_server: str,
|
57
57
|
url: str,
|
58
58
|
username: str,
|
59
59
|
user_pass: str,
|
@@ -62,8 +62,9 @@ def display_gov_eng_status(
|
|
62
62
|
width: int = EGERIA_WIDTH,
|
63
63
|
):
|
64
64
|
console = Console(width=EGERIA_WIDTH)
|
65
|
-
|
66
|
-
s_client =
|
65
|
+
|
66
|
+
s_client = EgeriaTech(view_server, url, username, user_pass)
|
67
|
+
token = s_client.create_egeria_bearer_token()
|
67
68
|
|
68
69
|
def generate_table() -> Table:
|
69
70
|
"""Make a new table."""
|
@@ -76,7 +77,7 @@ def display_gov_eng_status(
|
|
76
77
|
caption_style="white on black",
|
77
78
|
show_lines=True,
|
78
79
|
box=box.ROUNDED,
|
79
|
-
caption=f"Server: '{
|
80
|
+
caption=f"Server: '{engine_host}' running on {url}",
|
80
81
|
expand=True,
|
81
82
|
)
|
82
83
|
# table.footer: f"Server {view_server} on Platform {good_platform1_url}"
|
@@ -86,9 +87,11 @@ def display_gov_eng_status(
|
|
86
87
|
table.add_column("Engine Status")
|
87
88
|
table.add_column("Request Types")
|
88
89
|
|
89
|
-
|
90
|
+
eng_host_guid = s_client.get_guid_for_name(engine_host)
|
91
|
+
gov_eng_status = s_client.get_server_report(eng_host_guid)
|
92
|
+
eng_summaries = gov_eng_status["governanceEngineSummaries"]
|
90
93
|
sorted_gov_eng_status = sorted(
|
91
|
-
|
94
|
+
eng_summaries, key=lambda k: k.get("governanceEngineName", " ")
|
92
95
|
)
|
93
96
|
for engine in sorted_gov_eng_status:
|
94
97
|
gov_eng = engine["governanceEngineName"]
|
@@ -113,7 +116,7 @@ def display_gov_eng_status(
|
|
113
116
|
|
114
117
|
table.add_row(gov_eng, eng_type, eng_desc, eng_status, eng_req_type_out)
|
115
118
|
|
116
|
-
table.caption = f"Server {
|
119
|
+
table.caption = f"Server {engine_host} running on {url}"
|
117
120
|
return table
|
118
121
|
|
119
122
|
try:
|
@@ -165,19 +168,27 @@ def main_live():
|
|
165
168
|
|
166
169
|
def main_paging():
|
167
170
|
parser = argparse.ArgumentParser()
|
168
|
-
parser.add_argument(
|
169
|
-
|
171
|
+
parser.add_argument(
|
172
|
+
"--engine_host", help="Name of the engine host to display status for"
|
173
|
+
)
|
174
|
+
parser.add_argument("--view_server", help="Name of the view server to use")
|
175
|
+
parser.add_argument("--url", help="URL of Platform to connect to")
|
170
176
|
parser.add_argument("--userid", help="User Id")
|
171
177
|
parser.add_argument("--password", help="User Password")
|
172
178
|
args = parser.parse_args()
|
173
179
|
|
174
|
-
|
175
|
-
|
180
|
+
engine_host = (
|
181
|
+
args.engine_host if args.engine_host is not None else EGERIA_ENGINE_HOST
|
182
|
+
)
|
183
|
+
view_server = (
|
184
|
+
args.view_server if args.view_server is not None else EGERIA_VIEW_SERVER
|
185
|
+
)
|
186
|
+
url = args.url if args.url is not None else EGERIA_VIEW_SERVER_URL
|
176
187
|
userid = args.userid if args.userid is not None else EGERIA_USER
|
177
188
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
178
189
|
|
179
190
|
display_gov_eng_status(
|
180
|
-
|
191
|
+
engine_host, view_server, url, userid, user_pass, paging=True
|
181
192
|
)
|
182
193
|
|
183
194
|
|
@@ -17,7 +17,7 @@ from rich.console import Console
|
|
17
17
|
from rich.live import Live
|
18
18
|
from rich.table import Table
|
19
19
|
|
20
|
-
from pyegeria import
|
20
|
+
from pyegeria import EgeriaTech, AutomatedCuration
|
21
21
|
from pyegeria._exceptions import (
|
22
22
|
InvalidParameterException,
|
23
23
|
PropertyServerException,
|
@@ -36,8 +36,6 @@ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-da
|
|
36
36
|
EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
|
37
37
|
"EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
|
38
38
|
)
|
39
|
-
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
40
|
-
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
41
39
|
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
42
40
|
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
43
41
|
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
@@ -58,9 +56,9 @@ def display_integration_daemon_status(
|
|
58
56
|
width: int = EGERIA_WIDTH,
|
59
57
|
sort: bool = True,
|
60
58
|
):
|
61
|
-
s_client =
|
62
|
-
|
63
|
-
|
59
|
+
s_client = EgeriaTech(view_server, view_url, user, user_pass)
|
60
|
+
token = s_client.create_egeria_bearer_token()
|
61
|
+
server_guid = s_client.get_guid_for_name(integ_server)
|
64
62
|
|
65
63
|
def generate_table() -> Table:
|
66
64
|
"""Make a new table."""
|
@@ -84,7 +82,7 @@ def display_integration_daemon_status(
|
|
84
82
|
table.add_column("Target Element", min_width=20)
|
85
83
|
table.add_column("Exception Message", min_width=10)
|
86
84
|
|
87
|
-
daemon_status = s_client.
|
85
|
+
daemon_status = s_client.get_server_report(server_guid)
|
88
86
|
|
89
87
|
reports = daemon_status["integrationConnectorReports"]
|
90
88
|
if sort is True:
|
@@ -102,7 +100,7 @@ def display_integration_daemon_status(
|
|
102
100
|
refresh_interval = str(connector.get("minMinutesBetweenRefresh", "---"))
|
103
101
|
exception_msg = " "
|
104
102
|
if connector_guid != "---":
|
105
|
-
targets =
|
103
|
+
targets = s_client.get_catalog_targets(connector_guid)
|
106
104
|
tgt_tab = Table()
|
107
105
|
tgt_tab.add_column("Target")
|
108
106
|
tgt_tab.add_column("UniqueName")
|
@@ -172,7 +170,6 @@ def display_integration_daemon_status(
|
|
172
170
|
|
173
171
|
finally:
|
174
172
|
s_client.close_session()
|
175
|
-
a_client.close_session()
|
176
173
|
|
177
174
|
|
178
175
|
def main_live():
|
@@ -3,13 +3,19 @@
|
|
3
3
|
SPDX-License-Identifier: Apache-2.0
|
4
4
|
Copyright Contributors to the ODPi Egeria project.
|
5
5
|
|
6
|
-
|
6
|
+
Display the server status of all registered servers across all platforms.
|
7
|
+
|
8
|
+
Note: This implementation is using the platform-report. A more complex platform environment may require
|
9
|
+
reimplementing from a server only perspective using get_servers_by_dep_impl_type() to find the guids and
|
10
|
+
then get_server_by_guid() to get the status. Less efficient but may be more robust for some environments.
|
11
|
+
|
7
12
|
|
8
13
|
|
9
14
|
A simple server status display
|
10
15
|
"""
|
11
16
|
import argparse
|
12
17
|
import os
|
18
|
+
import sys
|
13
19
|
import time
|
14
20
|
|
15
21
|
from rich.live import Live
|
@@ -20,27 +26,39 @@ from pyegeria import (
|
|
20
26
|
PropertyServerException,
|
21
27
|
UserNotAuthorizedException,
|
22
28
|
print_exception_response,
|
23
|
-
|
29
|
+
RuntimeManager,
|
24
30
|
)
|
25
31
|
|
26
32
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
27
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
28
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
29
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
30
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
33
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
34
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
35
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
36
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
37
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
38
|
+
)
|
39
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
40
|
+
EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
|
41
|
+
"EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
|
42
|
+
)
|
43
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
44
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
45
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
46
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
47
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
48
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
49
|
+
|
50
|
+
|
51
|
+
def display_status(
|
52
|
+
extended: bool,
|
53
|
+
view_server: str,
|
54
|
+
url: str,
|
55
|
+
username: str,
|
56
|
+
user_pass: str,
|
57
|
+
jupyter: bool = EGERIA_JUPYTER,
|
58
|
+
width: int = EGERIA_WIDTH,
|
59
|
+
):
|
60
|
+
p_client = RuntimeManager(view_server, url, username, user_pass)
|
61
|
+
token = p_client.create_egeria_bearer_token()
|
44
62
|
|
45
63
|
def generate_table() -> Table:
|
46
64
|
"""Make a new table."""
|
@@ -51,27 +69,58 @@ def display_status(server: str, url: str, username: str, user_pass: str, jupyter
|
|
51
69
|
header_style="white on dark_blue",
|
52
70
|
title_style="bold white on black",
|
53
71
|
caption_style="white on black",
|
54
|
-
caption=f"Server Status
|
72
|
+
caption=f"Server Status from Platform - '{url}'",
|
55
73
|
# show_lines=True,
|
56
74
|
)
|
57
75
|
|
58
76
|
table.add_column("Known Server")
|
59
77
|
table.add_column("Status")
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
78
|
+
if extended:
|
79
|
+
table.add_column("Description")
|
80
|
+
table.add_column("Server Type")
|
81
|
+
table.add_column("Last Started")
|
82
|
+
|
83
|
+
platform_list = p_client.get_platforms_by_type()
|
84
|
+
if type(platform_list) is str:
|
85
|
+
print("No OMAG Server Platforms found?")
|
86
|
+
sys.exit(1)
|
87
|
+
|
88
|
+
for platform in platform_list:
|
89
|
+
platform_name = platform["properties"].get("displayName", "---")
|
90
|
+
platform_guid = platform["elementHeader"]["guid"]
|
91
|
+
platform_desc = platform["properties"].get("resourceDescription", "---")
|
92
|
+
p_server_list = ""
|
93
|
+
|
94
|
+
platform_report = p_client.get_platform_report(platform_guid)
|
95
|
+
servers = platform_report.get("omagservers", None)
|
96
|
+
for p_server in servers:
|
97
|
+
server_name = p_server.get("serverName", "--- ")
|
98
|
+
server_type = p_server.get("serverType", "--- ")
|
99
|
+
server_desc = p_server.get("description", "--- ")
|
100
|
+
last_start_time = p_server.get("lastStartTime", "--- ")
|
101
|
+
|
102
|
+
server_status = p_server.get("serverActiveStatus", "UNKNOWN")
|
103
|
+
if server_status in ("RUNNING", "STARTING"):
|
104
|
+
status = "Active"
|
105
|
+
elif server_status in ("INACTIVE", "STOPPING"):
|
106
|
+
status = "Inactive"
|
107
|
+
else:
|
108
|
+
status = "UNKNOWN"
|
109
|
+
|
110
|
+
if extended:
|
111
|
+
table.add_row(
|
112
|
+
server_name,
|
113
|
+
"[red]Inactive" if status == "Inactive" else "[green]Active",
|
114
|
+
server_desc,
|
115
|
+
server_type,
|
116
|
+
last_start_time,
|
117
|
+
)
|
118
|
+
else:
|
119
|
+
table.add_row(
|
120
|
+
server_name,
|
121
|
+
"[red]Inactive" "" if status == "Inactive" else "[green]Active",
|
122
|
+
# server_status,
|
123
|
+
)
|
75
124
|
# p_client.close_session()
|
76
125
|
return table
|
77
126
|
|
@@ -81,7 +130,11 @@ def display_status(server: str, url: str, username: str, user_pass: str, jupyter
|
|
81
130
|
time.sleep(2)
|
82
131
|
live.update(generate_table())
|
83
132
|
|
84
|
-
except (
|
133
|
+
except (
|
134
|
+
InvalidParameterException,
|
135
|
+
PropertyServerException,
|
136
|
+
UserNotAuthorizedException,
|
137
|
+
) as e:
|
85
138
|
print_exception_response(e)
|
86
139
|
except KeyboardInterrupt:
|
87
140
|
pass
|
@@ -91,18 +144,20 @@ def display_status(server: str, url: str, username: str, user_pass: str, jupyter
|
|
91
144
|
|
92
145
|
def main():
|
93
146
|
parser = argparse.ArgumentParser()
|
147
|
+
parser.add_argument("--extended", help="Extended Information?")
|
94
148
|
parser.add_argument("--server", help="Name of the server to display status for")
|
95
149
|
parser.add_argument("--url", help="URL Platform to connect to")
|
96
150
|
parser.add_argument("--userid", help="User Id")
|
97
151
|
parser.add_argument("--password", help="User Password")
|
98
152
|
args = parser.parse_args()
|
99
153
|
|
100
|
-
|
154
|
+
extended = args.extended if args.extended is not None else False
|
155
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
101
156
|
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
102
157
|
userid = args.userid if args.userid is not None else EGERIA_ADMIN_USER
|
103
158
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
104
159
|
|
105
|
-
display_status(server, url, userid, user_pass)
|
160
|
+
display_status(extended, server, url, userid, user_pass)
|
106
161
|
|
107
162
|
|
108
163
|
if __name__ == "__main__":
|
@@ -0,0 +1,109 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
Unit tests for the Utils helper functions using the Pytest framework.
|
7
|
+
|
8
|
+
|
9
|
+
A simple server status display
|
10
|
+
"""
|
11
|
+
import argparse
|
12
|
+
import os
|
13
|
+
import time
|
14
|
+
|
15
|
+
from rich.live import Live
|
16
|
+
from rich.table import Table
|
17
|
+
|
18
|
+
from pyegeria import (
|
19
|
+
InvalidParameterException,
|
20
|
+
PropertyServerException,
|
21
|
+
UserNotAuthorizedException,
|
22
|
+
print_exception_response,
|
23
|
+
ServerOps
|
24
|
+
)
|
25
|
+
|
26
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
27
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
28
|
+
EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
|
29
|
+
EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
|
30
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
|
31
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
|
32
|
+
EGERIA_INTEGRATION_DAEMON_URL = os.environ.get('EGERIA_INTEGRATION_DAEMON_URL', 'https://localhost:9443')
|
33
|
+
EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
34
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
35
|
+
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
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'))
|
39
|
+
|
40
|
+
|
41
|
+
def display_status(server: str, url: str, username: str, user_pass: str, jupyter: bool = EGERIA_JUPYTER,
|
42
|
+
width: int = EGERIA_WIDTH):
|
43
|
+
p_client = ServerOps(server, url, username, user_pass)
|
44
|
+
|
45
|
+
def generate_table() -> Table:
|
46
|
+
"""Make a new table."""
|
47
|
+
table = Table(
|
48
|
+
title=f"Server Status for Platform - {time.asctime()}",
|
49
|
+
style="bold white on black",
|
50
|
+
row_styles=["bold white on black"],
|
51
|
+
header_style="white on dark_blue",
|
52
|
+
title_style="bold white on black",
|
53
|
+
caption_style="white on black",
|
54
|
+
caption=f"Server Status for Platform - '{url}'",
|
55
|
+
# show_lines=True,
|
56
|
+
)
|
57
|
+
|
58
|
+
table.add_column("Known Server")
|
59
|
+
table.add_column("Status")
|
60
|
+
|
61
|
+
known_server_list = p_client.get_known_servers()
|
62
|
+
active_server_list = p_client.get_active_server_list()
|
63
|
+
if len(known_server_list) == 0:
|
64
|
+
return table
|
65
|
+
|
66
|
+
for server in known_server_list:
|
67
|
+
if server in active_server_list:
|
68
|
+
status = "Active"
|
69
|
+
else:
|
70
|
+
status = "Inactive"
|
71
|
+
|
72
|
+
table.add_row(server,
|
73
|
+
"[red]Inactive" if status == "Inactive" else "[green]Active",
|
74
|
+
)
|
75
|
+
# p_client.close_session()
|
76
|
+
return table
|
77
|
+
|
78
|
+
try:
|
79
|
+
with Live(generate_table(), refresh_per_second=4, screen=True) as live:
|
80
|
+
while True:
|
81
|
+
time.sleep(2)
|
82
|
+
live.update(generate_table())
|
83
|
+
|
84
|
+
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
|
85
|
+
print_exception_response(e)
|
86
|
+
except KeyboardInterrupt:
|
87
|
+
pass
|
88
|
+
finally:
|
89
|
+
p_client.close_session()
|
90
|
+
|
91
|
+
|
92
|
+
def main():
|
93
|
+
parser = argparse.ArgumentParser()
|
94
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
95
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
96
|
+
parser.add_argument("--userid", help="User Id")
|
97
|
+
parser.add_argument("--password", help="User Password")
|
98
|
+
args = parser.parse_args()
|
99
|
+
|
100
|
+
server = args.server if args.server is not None else EGERIA_METADATA_STORE
|
101
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
102
|
+
userid = args.userid if args.userid is not None else EGERIA_ADMIN_USER
|
103
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
104
|
+
|
105
|
+
display_status(server, url, userid, user_pass)
|
106
|
+
|
107
|
+
|
108
|
+
if __name__ == "__main__":
|
109
|
+
main()
|
pyegeria/__init__.py
CHANGED
@@ -34,7 +34,6 @@ from ._exceptions import (
|
|
34
34
|
print_exception_response,
|
35
35
|
)
|
36
36
|
|
37
|
-
# from .utils import print_response, body_slimmer, wrap_text
|
38
37
|
from .utils import print_response, body_slimmer
|
39
38
|
from ._client import Client
|
40
39
|
from .automated_curation_omvs import AutomatedCuration
|
pyegeria/runtime_manager_omvs.py
CHANGED
@@ -1763,7 +1763,7 @@ class RuntimeManager(Client):
|
|
1763
1763
|
|
1764
1764
|
response = await self._async_make_request("POST", url, body)
|
1765
1765
|
|
1766
|
-
return response.json().get("elements", "No
|
1766
|
+
return response.json().get("elements", "No servers found")
|
1767
1767
|
|
1768
1768
|
def get_servers_by_dep_impl_type(
|
1769
1769
|
self,
|
@@ -1926,7 +1926,7 @@ class RuntimeManager(Client):
|
|
1926
1926
|
|
1927
1927
|
response = await self._async_make_request("GET", url)
|
1928
1928
|
|
1929
|
-
return response.json().get("
|
1929
|
+
return response.json().get("element", "No server found")
|
1930
1930
|
|
1931
1931
|
def get_server_report(self, server_guid: str = None) -> str | list:
|
1932
1932
|
"""Returns details about the running server.
|
@@ -15,12 +15,12 @@ commands/cat/list_relationships.py,sha256=U9f78cOi4HyaacqNaFSMq_7rRxVcEczvwPv468
|
|
15
15
|
commands/cat/list_tech_types.py,sha256=20T4v6L5qeebSsaL1nGkFMDAIsy2W3A3SMm1RcgFoh0,4609
|
16
16
|
commands/cat/list_todos.py,sha256=iPxHRyW3X5tiREio4TUOwRPvNPjU0gxm3pVnUI79ir4,6542
|
17
17
|
commands/cat/list_user_ids.py,sha256=7JinL7rknPbGusIb8ikXKEaV1vvbuvx_WWtbmlfS_DY,5093
|
18
|
-
commands/cli/__init__.py,sha256=
|
19
|
-
commands/cli/egeria.py,sha256=
|
18
|
+
commands/cli/__init__.py,sha256=hpTVSMP2gnPRhcAZPdeUEsQ-eaDySlXlk239dNWYmng,292
|
19
|
+
commands/cli/egeria.py,sha256=IdGSpIzlLDdektZIjQRIRPgF5F3GKutF6tY9cVBGjEY,28506
|
20
20
|
commands/cli/egeria_cat.py,sha256=LWspOYRcdJIIx2n9wvhBhkNnACGDIpFTWfsoVTGeiV0,12957
|
21
21
|
commands/cli/egeria_my.py,sha256=9zIpUDLeA_R-0rgCSQfEZTtVmkxPcEAsYcCTn1wQFrE,6181
|
22
|
-
commands/cli/egeria_ops.py,sha256=
|
23
|
-
commands/cli/egeria_tech.py,sha256=
|
22
|
+
commands/cli/egeria_ops.py,sha256=XJ5WUj8PIH_DiJkL878Vsq82bSNZBmgElUfuuu5QV_4,11130
|
23
|
+
commands/cli/egeria_tech.py,sha256=AbRx_wDP4935zAECOgCY0rL8v8AySWxNvkG9Z_mm-SY,11161
|
24
24
|
commands/cli/ops_config.py,sha256=m4AfPjf-fR4EBTx8Dc2mcgrfWwAxb30YGeV-v79bg4U,1450
|
25
25
|
commands/my/README.md,sha256=ZheFhj_VoPMhcWjW3pGchHB0vH_A9PklSmrSkzKdrcQ,844
|
26
26
|
commands/my/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -33,18 +33,18 @@ commands/my/todo_actions.py,sha256=uihltirrAPtwYNygnNBAVWgfS0W7acoETz1_h3XW_4o,8
|
|
33
33
|
commands/ops/README.md,sha256=PJsSDcvMv6E6og6y-cwvxFX5lhCII0UCwgKiM1T17MQ,1595
|
34
34
|
commands/ops/__init__.py,sha256=SCfzF3-aMx8EpqLWmH7JQf13gTmMAtHRbg69oseLvi8,480
|
35
35
|
commands/ops/engine_actions.py,sha256=00s_wkzs0zlZ6PyZ0J5J9lHhw4Viyzbeox7b1K1lmyc,4609
|
36
|
-
commands/ops/gov_server_actions.py,sha256=
|
36
|
+
commands/ops/gov_server_actions.py,sha256=xF0QWSP7JtxpcA-L8DfbVjtgHgqBocgBN5qIE5Rmm9A,5631
|
37
37
|
commands/ops/list_catalog_targets.py,sha256=0FIZqZu7DSh7tnrme6EOhNiVvK8wyvN1iTZKEDuwTmw,6620
|
38
|
-
commands/ops/load_archive.py,sha256=
|
38
|
+
commands/ops/load_archive.py,sha256=tpkYQerkXd3ZvazJfD5ADAk-3EGeMEvcgn9EPjdMGn0,2588
|
39
39
|
commands/ops/monitor_asset_events.py,sha256=cjdlVqE0XYnoRW3aorNbsVkjByDXefPBnllaZLelGls,3838
|
40
|
-
commands/ops/monitor_coco_status.py,sha256=ERz3OJ0TXImNKHGD4gJvgT3pl2gS23ewAdUuYVLUhEE,3299
|
41
40
|
commands/ops/monitor_engine_activity.py,sha256=m18OSnRoo5ut0WKKOWNoFGXJW_npjp6hzHK3RUQG8T0,8479
|
42
41
|
commands/ops/monitor_engine_activity_c.py,sha256=rSEUD3elhsiYdUhQRn613OM_R4VecFb0uq39MhYhltQ,9371
|
43
|
-
commands/ops/monitor_gov_eng_status.py,sha256=
|
44
|
-
commands/ops/monitor_integ_daemon_status.py,sha256=
|
45
|
-
commands/ops/monitor_platform_status.py,sha256=
|
46
|
-
commands/ops/
|
47
|
-
commands/ops/
|
42
|
+
commands/ops/monitor_gov_eng_status.py,sha256=0Hc7Nbfvl-Qulrhm65GTcYSQ10xkIBtr1ZtjCMYKsEk,7031
|
43
|
+
commands/ops/monitor_integ_daemon_status.py,sha256=5JR8u-GUeinf6lQGYkn_BN_InF7N2mGFOf5yTrjU3eo,9058
|
44
|
+
commands/ops/monitor_platform_status.py,sha256=xmngiuQK9X6X4-stGSITzfMSAdqpswVk-DY7kh8M0P0,6401
|
45
|
+
commands/ops/monitor_server_status.py,sha256=eeZY4o_HwrH-csrhHPi95LLGu00j6AYl48A7fDYTG34,6061
|
46
|
+
commands/ops/orig_monitor_server_list.py,sha256=Uhtn8lv7QVXJBi9DSR3Nelmz8TB0vOsat10nFS6Nu20,4637
|
47
|
+
commands/ops/orig_monitor_server_status.py,sha256=A-8hMDfbscdcq-b1OD4wKn0tphumX8WIK-Hz8uPoFkc,3974
|
48
48
|
commands/ops/refresh_integration_daemon.py,sha256=9dZX-AHJ7yILohj005TRIC9tC349RRwwxRmqVLD2ZTE,2991
|
49
49
|
commands/ops/restart_integration_daemon.py,sha256=PN48zVDywjNJznmpVWEcBXBD3xhWDw1dMyKLIs9nWzU,2992
|
50
50
|
commands/tech/README.md,sha256=nxDnfr3BCiGgW5G1VxWxiwUWJXIe5wreNuUeRyIt_hY,1343
|
@@ -61,7 +61,7 @@ commands/tech/list_relationship_types.py,sha256=BlVzrPznZXqMVLN2-2vYEVRGeYsiJrqX
|
|
61
61
|
commands/tech/list_tech_templates.py,sha256=RiyA8a4fIL9BGeGf37Bkk471mK5ECkDJMN9QVNReC1M,6192
|
62
62
|
commands/tech/list_valid_metadata_values.py,sha256=N3D0_BmREPszgde3uvvYdfzq7DJ46uMOv2t1vtncGsw,6333
|
63
63
|
commands/tech/x_list_related_elements.py,sha256=qBsf1619cecaMCTzG0MG22fAT32WNH2Z3CXrjo9z-5Y,5853
|
64
|
-
pyegeria/__init__.py,sha256=
|
64
|
+
pyegeria/__init__.py,sha256=2cq6Nqpq50ZPaFGUA_7tmF-vxlmtpojiBMQCN9I5-9g,9397
|
65
65
|
pyegeria/_client.py,sha256=pzndEJKN0tcnT7gQFa0r3pzXm9pK4zJKANZOXO79aOs,25949
|
66
66
|
pyegeria/_deprecated_gov_engine.py,sha256=dWNcwVsE5__dF2u4QiIyQrssozzzOjBbLld8MdpmVCQ,17264
|
67
67
|
pyegeria/_exceptions.py,sha256=NJ7vAhmvusK1ENvY2MMrBB6A6TgpYjzS9QJxFH56b8c,18470
|
@@ -87,13 +87,13 @@ pyegeria/my_profile_omvs.py,sha256=eDnDK8LQIg7yrmiG8x20xMw-Yu6xuL0yXRm0vSc4T8k,4
|
|
87
87
|
pyegeria/platform_services.py,sha256=hlbbG1iGuMj7JhLkz60V9xaG4m0pheYvs0bhbjF64rE,41624
|
88
88
|
pyegeria/project_manager_omvs.py,sha256=OCdJKECI0sTZWgXcQ5TcupK5JPxHJG78-kHXyflDu1k,74521
|
89
89
|
pyegeria/registered_info.py,sha256=3PbmqKusFX5m9KYVwbT69PIN1oSL4PhZDbbU_an7dvE,6356
|
90
|
-
pyegeria/runtime_manager_omvs.py,sha256=
|
90
|
+
pyegeria/runtime_manager_omvs.py,sha256=WmTmQQA8zMbW5KNGikqbSH0blbiTF4ejoCeQaBMWkxI,61919
|
91
91
|
pyegeria/server_operations.py,sha256=ciH890hYT85YQ6OpByn4w7s3a7TtvWZpIG5rkRqbcI0,16766
|
92
92
|
pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
|
93
93
|
pyegeria/valid_metadata_omvs.py,sha256=6Hc4g9BOS8w1ILfTG3_A1tfIX3HLtpgZZvcC-z9GePU,36185
|
94
94
|
pyegeria/x_action_author_omvs.py,sha256=za472slZ5tN9Pkd-ukyHS5Sn6MlKkJyIlbLlU3bL_Go,6451
|
95
|
-
pyegeria-0.8.4.
|
96
|
-
pyegeria-0.8.4.
|
97
|
-
pyegeria-0.8.4.
|
98
|
-
pyegeria-0.8.4.
|
99
|
-
pyegeria-0.8.4.
|
95
|
+
pyegeria-0.8.4.27.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
96
|
+
pyegeria-0.8.4.27.dist-info/METADATA,sha256=T4Zz2fGbTfb-77dNelgy639d-HzrA-0tBArt5HEcJqM,2820
|
97
|
+
pyegeria-0.8.4.27.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
98
|
+
pyegeria-0.8.4.27.dist-info/entry_points.txt,sha256=R8sNzclWZN542SufuVlx9HDia23PlSVnJioUkzCWg4I,3349
|
99
|
+
pyegeria-0.8.4.27.dist-info/RECORD,,
|
@@ -50,7 +50,7 @@ monitor_integ_daemon_status=commands.ops.monitor_integ_daemon_status:main_live
|
|
50
50
|
monitor_my_todos=commands.my.monitor_my_todos:main
|
51
51
|
monitor_open_todos=commands.my.monitor_open_todos:main
|
52
52
|
monitor_platform_status=commands.ops.monitor_platform_status:main
|
53
|
-
monitor_server_list=commands.ops.
|
53
|
+
monitor_server_list=commands.ops.orig_monitor_server_list:main
|
54
54
|
monitor_server_status=commands.ops.monitor_server_status:main
|
55
55
|
reassign_todo=commands.my.todo_actions:reassign_todo
|
56
56
|
refresh_integration_daemon=commands.ops.refresh_integration_daemon:main
|
@@ -1,103 +0,0 @@
|
|
1
|
-
#!/usr/bin/python3
|
2
|
-
"""
|
3
|
-
SPDX-License-Identifier: Apache-2.0
|
4
|
-
Copyright Contributors to the ODPi Egeria project.
|
5
|
-
|
6
|
-
Unit tests for the Utils helper functions using the Pytest framework.
|
7
|
-
|
8
|
-
|
9
|
-
A simple server status display for the Coco Pharmaceuticals Configuration
|
10
|
-
"""
|
11
|
-
|
12
|
-
import argparse
|
13
|
-
import time
|
14
|
-
|
15
|
-
from rich import box
|
16
|
-
from rich import print
|
17
|
-
from rich.layout import Layout
|
18
|
-
from rich.live import Live
|
19
|
-
from rich.panel import Panel
|
20
|
-
from rich.table import Table
|
21
|
-
|
22
|
-
from pyegeria._exceptions import (
|
23
|
-
InvalidParameterException,
|
24
|
-
PropertyServerException,
|
25
|
-
UserNotAuthorizedException,
|
26
|
-
print_exception_response,
|
27
|
-
)
|
28
|
-
from pyegeria.server_operations import ServerOps
|
29
|
-
|
30
|
-
disable_ssl_warnings = True
|
31
|
-
|
32
|
-
|
33
|
-
def display_status(server: str, url: str, username: str):
|
34
|
-
layout = Layout()
|
35
|
-
|
36
|
-
p_client1 = ServerOps("Core Catalog", "https://localhost:9443", username)
|
37
|
-
p_client2 = ServerOps('Datalake Catalog', "https://localhost:9444", username)
|
38
|
-
p_client3 = ServerOps('DevCatalog', "https://localhost:9445", username)
|
39
|
-
|
40
|
-
def generate_table(p_client) -> Table:
|
41
|
-
"""Make a new table."""
|
42
|
-
table = Table(
|
43
|
-
title=f"Server Status for {p_client.server_name}- {time.asctime()}",
|
44
|
-
# style = "black on grey66",
|
45
|
-
header_style="white on dark_blue",
|
46
|
-
caption=f"Server Status for Platform - '{p_client.platform_url}'",
|
47
|
-
# show_lines=True,
|
48
|
-
)
|
49
|
-
|
50
|
-
table.add_column("Known Server")
|
51
|
-
table.add_column("Status")
|
52
|
-
known_server_list = p_client.get_known_servers()
|
53
|
-
active_server_list = p_client.get_active_server_list()
|
54
|
-
if type(known_server_list) is str:
|
55
|
-
return table
|
56
|
-
|
57
|
-
for server in known_server_list:
|
58
|
-
if server in active_server_list:
|
59
|
-
status = "Active"
|
60
|
-
else:
|
61
|
-
status = "Inactive"
|
62
|
-
|
63
|
-
table.add_row(server,
|
64
|
-
"[red]Inactive" if status == "Inactive" else "[green]Active",
|
65
|
-
)
|
66
|
-
return table
|
67
|
-
|
68
|
-
try:
|
69
|
-
layout.split_row(
|
70
|
-
Layout(Panel(generate_table(p_client1), box.ROUNDED)),
|
71
|
-
Layout(Panel(generate_table(p_client2), box.ROUNDED)),
|
72
|
-
Layout(Panel(generate_table(p_client3), box.ROUNDED))
|
73
|
-
)
|
74
|
-
with Live(layout, refresh_per_second=4, screen=True) as live:
|
75
|
-
while True:
|
76
|
-
time.sleep(2)
|
77
|
-
live.update(layout)
|
78
|
-
|
79
|
-
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
|
80
|
-
print_exception_response(e)
|
81
|
-
except KeyboardInterrupt:
|
82
|
-
pass
|
83
|
-
|
84
|
-
finally:
|
85
|
-
p_client1.close_session()
|
86
|
-
p_client2.close_session()
|
87
|
-
p_client3.close_session()
|
88
|
-
|
89
|
-
def main():
|
90
|
-
parser = argparse.ArgumentParser()
|
91
|
-
parser.add_argument("--server", help="Name of the server to display status for")
|
92
|
-
parser.add_argument("--url", help="URL Platform to connect to")
|
93
|
-
parser.add_argument("--userid", help="User Id")
|
94
|
-
args = parser.parse_args()
|
95
|
-
|
96
|
-
server = args.server if args.server is not None else "active-metadata-store"
|
97
|
-
url = args.url if args.url is not None else "https://localhost:9443"
|
98
|
-
userid = args.userid if args.userid is not None else 'garygeeke'
|
99
|
-
|
100
|
-
display_status(server, url, userid)
|
101
|
-
|
102
|
-
if __name__ == "__main__":
|
103
|
-
main()
|
File without changes
|
File without changes
|
File without changes
|