pyegeria 0.5.8.15__py3-none-any.whl → 0.5.8.16__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.
- examples/widgets/cli/egeria_ops.py +69 -55
- examples/widgets/operational/list_catalog_targets.py +2 -2
- examples/widgets/operational/monitor_engine_activity.py +2 -2
- examples/widgets/operational/monitor_gov_eng_status.py +3 -2
- examples/widgets/operational/monitor_platform_status.py +25 -22
- examples/widgets/operational/monitor_server_list.py +20 -25
- examples/widgets/operational/monitor_server_status.py +11 -9
- {pyegeria-0.5.8.15.dist-info → pyegeria-0.5.8.16.dist-info}/METADATA +1 -1
- {pyegeria-0.5.8.15.dist-info → pyegeria-0.5.8.16.dist-info}/RECORD +12 -12
- {pyegeria-0.5.8.15.dist-info → pyegeria-0.5.8.16.dist-info}/LICENSE +0 -0
- {pyegeria-0.5.8.15.dist-info → pyegeria-0.5.8.16.dist-info}/WHEEL +0 -0
- {pyegeria-0.5.8.15.dist-info → pyegeria-0.5.8.16.dist-info}/entry_points.txt +0 -0
@@ -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.userid, c.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.userid, c.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()
|
@@ -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,
|
@@ -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
|
|
@@ -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
|
|
@@ -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()
|
@@ -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()
|
@@ -9,7 +9,7 @@ examples/widgets/catalog_user/get_tech_type_template.py,sha256=2bGRMIcXqlMFwNGRd
|
|
9
9
|
examples/widgets/catalog_user/list_assets.py,sha256=MRWha0yS3JPQEZNXqAktbEWYiU3kxdcmu4mV7YravQQ,5668
|
10
10
|
examples/widgets/catalog_user/list_glossary.py,sha256=abw3iBFEPHcSpucq2Jqh6UEOILyzx2IfBWS9gPl968k,5176
|
11
11
|
examples/widgets/cli/__init__.py,sha256=ReG7mIcm5c512S_z1UZIpMtE67zlO_zj-1HhHWYS4fI,30
|
12
|
-
examples/widgets/cli/egeria_ops.py,sha256=
|
12
|
+
examples/widgets/cli/egeria_ops.py,sha256=DAXqBV3aK5mKNIMAzFfKBMu5VxM8-5qjTe3DFkPPrxw,9604
|
13
13
|
examples/widgets/cli/ops_config.py,sha256=BPfiU2mZA61aA1p1DHRA5eLWH8qaAwgWNoRmazzAlM4,1398
|
14
14
|
examples/widgets/developer/README.md,sha256=nxDnfr3BCiGgW5G1VxWxiwUWJXIe5wreNuUeRyIt_hY,1343
|
15
15
|
examples/widgets/developer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -25,16 +25,16 @@ examples/widgets/operational/README.md,sha256=PJsSDcvMv6E6og6y-cwvxFX5lhCII0UCwg
|
|
25
25
|
examples/widgets/operational/__init__.py,sha256=SCfzF3-aMx8EpqLWmH7JQf13gTmMAtHRbg69oseLvi8,480
|
26
26
|
examples/widgets/operational/engine_actions.py,sha256=j4OL-Gpo4n8CAqcwdCRI8nnAm0F7NOEpX6Bp6FB-Pmg,3064
|
27
27
|
examples/widgets/operational/integration_daemon_actions.py,sha256=SacZaweJWYIUKgEu2B1y0iQXg0Aj4zeJjX4Jhs93TpM,3942
|
28
|
-
examples/widgets/operational/list_catalog_targets.py,sha256=
|
28
|
+
examples/widgets/operational/list_catalog_targets.py,sha256=Wonf0R8rFmUvG75MtPekRraAbyTQLdkzjQKoNuVntvg,6335
|
29
29
|
examples/widgets/operational/load_archive.py,sha256=j9K4uPpUzvqEyvsUMZoY0-1NVuljAwqcMg8Lhin_p1E,2280
|
30
30
|
examples/widgets/operational/monitor_asset_events.py,sha256=cjdlVqE0XYnoRW3aorNbsVkjByDXefPBnllaZLelGls,3838
|
31
31
|
examples/widgets/operational/monitor_coco_status.py,sha256=ERz3OJ0TXImNKHGD4gJvgT3pl2gS23ewAdUuYVLUhEE,3299
|
32
|
-
examples/widgets/operational/monitor_engine_activity.py,sha256=
|
33
|
-
examples/widgets/operational/monitor_gov_eng_status.py,sha256=
|
32
|
+
examples/widgets/operational/monitor_engine_activity.py,sha256=bA-8JX37AiVpxBAECq7PPP5Ej-IBoyQQqEdzGWmufo0,7179
|
33
|
+
examples/widgets/operational/monitor_gov_eng_status.py,sha256=yJakTA5NSUTXQlO1Cnq803bgocQiHnxiHHdu_g9rn2U,5809
|
34
34
|
examples/widgets/operational/monitor_integ_daemon_status.py,sha256=IeRQ72Eh-PR13-lLxe7QeSqxei3LWiilXRT1lDs6vlc,8751
|
35
|
-
examples/widgets/operational/monitor_platform_status.py,sha256=
|
36
|
-
examples/widgets/operational/monitor_server_list.py,sha256=
|
37
|
-
examples/widgets/operational/monitor_server_status.py,sha256=
|
35
|
+
examples/widgets/operational/monitor_platform_status.py,sha256=pQEWt8Vy-5whF5aVC1IFLYsHLoCNUKtTz1DfOIWOBfw,5948
|
36
|
+
examples/widgets/operational/monitor_server_list.py,sha256=eHSeM5dW7Wyjp2zR_AD6_FalFnZ2dBaZKxtob2kva9I,4483
|
37
|
+
examples/widgets/operational/monitor_server_status.py,sha256=A-8hMDfbscdcq-b1OD4wKn0tphumX8WIK-Hz8uPoFkc,3974
|
38
38
|
examples/widgets/operational/refresh_integration_daemon.py,sha256=QDB3dpAlLY8PhrGhAZG4tWKzx_1R0bOOM048N68RQ4w,2712
|
39
39
|
examples/widgets/operational/restart_integration_daemon.py,sha256=fID7qGFL5RD6rfn9PgXf5kwI4MU0Ho_IGXnDVbKT5nU,2710
|
40
40
|
examples/widgets/personal_organizer/README.md,sha256=ZheFhj_VoPMhcWjW3pGchHB0vH_A9PklSmrSkzKdrcQ,844
|
@@ -69,8 +69,8 @@ pyegeria/runtime_manager_omvs.py,sha256=WekK7Yeyn6Qu9YmbSDo3m57MN0xOsIm9M8kGHfRO
|
|
69
69
|
pyegeria/server_operations.py,sha256=ZX7FlJRrAC7RK4bq4wHWepEsYbbWlqkUZdsJrTplVVU,16534
|
70
70
|
pyegeria/utils.py,sha256=pkVmS3RrbjaS9yz7FtOCwaOfV5FMqz-__Rt5koCnd9c,5374
|
71
71
|
pyegeria/valid_metadata_omvs.py,sha256=aisdRodIwJSkyArAzfm_sEnBELh69xE8k4Nea-vHu8M,36745
|
72
|
-
pyegeria-0.5.8.
|
73
|
-
pyegeria-0.5.8.
|
74
|
-
pyegeria-0.5.8.
|
75
|
-
pyegeria-0.5.8.
|
76
|
-
pyegeria-0.5.8.
|
72
|
+
pyegeria-0.5.8.16.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
73
|
+
pyegeria-0.5.8.16.dist-info/METADATA,sha256=B0L1BnjFI3pE0P6h5ldv6xm_tL8EZeUTGUjOwIZoPaI,2689
|
74
|
+
pyegeria-0.5.8.16.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
75
|
+
pyegeria-0.5.8.16.dist-info/entry_points.txt,sha256=5aexqWL8P1vQZrEK4bQLfelOnFfZtXFmWYS0pLa4NmE,2772
|
76
|
+
pyegeria-0.5.8.16.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|