pyegeria 0.5.8.12__tar.gz → 0.5.8.15__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.12 → pyegeria-0.5.8.15}/PKG-INFO +1 -1
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/cli/egeria_ops.py +6 -2
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/cli/ops_config.py +3 -1
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/list_catalog_targets.py +20 -15
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_asset_events.py +2 -1
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_engine_activity.py +12 -7
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_gov_eng_status.py +18 -17
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_integ_daemon_status.py +21 -16
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyproject.toml +1 -1
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/LICENSE +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/README.md +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/doc_samples/Create_Collection_Sample.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/catalog_user/README.md +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/catalog_user/__init__.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/catalog_user/get_asset_graph.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/catalog_user/get_collection.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/catalog_user/get_tech_type_elements.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/catalog_user/get_tech_type_template.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/catalog_user/list_assets.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/catalog_user/list_glossary.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/cli/__init__.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/developer/README.md +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/developer/__init__.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/developer/get_guid_info.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/developer/get_tech_details.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/developer/list_asset_types.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/developer/list_registered_services.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/developer/list_relationship_types.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/developer/list_tech_templates.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/developer/list_tech_types.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/developer/list_valid_metadata_values.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/README.md +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/__init__.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/engine_actions.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/integration_daemon_actions.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/load_archive.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_coco_status.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_platform_status.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_server_list.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_server_status.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/refresh_integration_daemon.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/restart_integration_daemon.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/personal_organizer/README.md +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/personal_organizer/__init__.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/personal_organizer/list_my_profile.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/personal_organizer/list_projects.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/personal_organizer/list_todos.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/personal_organizer/monitor_my_todos.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/personal_organizer/monitor_open_todos.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/Xfeedback_manager_omvs.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/Xloaded_resources_omvs.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/__init__.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/_client.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/_deprecated_gov_engine.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/_exceptions.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/_globals.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/_validators.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/action_author_omvs.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/asset_catalog_omvs.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/automated_curation_omvs.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/collection_manager_omvs.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/core_omag_server_config.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/create_tech_guid_lists.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/full_omag_server_config.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/glossary_browser_omvs.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/glossary_manager_omvs.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/my_profile_omvs.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/platform_services.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/project_manager_omvs.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/registered_info.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/runtime_manager_omvs.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/server_operations.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/utils.py +0 -0
- {pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/pyegeria/valid_metadata_omvs.py +0 -0
@@ -67,14 +67,18 @@ from examples.widgets.operational.list_catalog_targets import display_catalog_ta
|
|
67
67
|
@click.option('--timeout', default = 60, help = 'Number of seconds to wait')
|
68
68
|
@click.option('--verbose', is_flag = True, default = False, help = 'Enable verbose mode')
|
69
69
|
@click.option('--paging', is_flag = True, default = False, help = 'Enable paging snapshots vs live updates')
|
70
|
+
@click.option('--jupyter', is_flag = True, default = False, envvar = 'EGERIA_JUPYTER', help = 'Enable for rendering in a Jupyter terminal')
|
71
|
+
@click.option('--width', default=200, envvar='EGERIA_WIDTH', help = 'Screen width, in characters, to use')
|
72
|
+
|
70
73
|
@click.pass_context
|
71
74
|
def cli(ctx, server, url, view_server, view_server_url, integration_daemon, integration_daemon_url,
|
72
|
-
engine_host, engine_host_url, admin_user, admin_user_password, userid, password, timeout, paging,
|
75
|
+
engine_host, engine_host_url, admin_user, admin_user_password, userid, password, timeout, paging,
|
76
|
+
verbose, jupyter, width):
|
73
77
|
"""An Egeria Command Line interface for Operations """
|
74
78
|
ctx.obj = Config(server, url, view_server, view_server_url, integration_daemon,
|
75
79
|
integration_daemon_url, engine_host, engine_host_url,
|
76
80
|
admin_user, admin_user_password,userid, password,
|
77
|
-
timeout, paging, verbose)
|
81
|
+
timeout, paging, verbose, jupyter, width)
|
78
82
|
ctx.max_content_width = 200
|
79
83
|
ctx.ensure_object(Config)
|
80
84
|
if verbose:
|
@@ -8,7 +8,7 @@ class Config(object):
|
|
8
8
|
engine_host: str = 'engine-host', engine_host_url: str = 'https://localhost:9443',
|
9
9
|
admin_user: str = 'garygeeke', admin_user_password: str = 'secret',
|
10
10
|
userid: str = None, password: str = None,
|
11
|
-
timeout: int = 30, paging: bool = False, verbose: bool = False):
|
11
|
+
timeout: int = 30, paging: bool = False, verbose: bool = False, jupyter: bool = False, width:int = 200):
|
12
12
|
self.metadata_store = server
|
13
13
|
self.metadata_store_url = url
|
14
14
|
self.view_server = view_server
|
@@ -24,6 +24,8 @@ class Config(object):
|
|
24
24
|
self.timeout = timeout
|
25
25
|
self.paging = paging
|
26
26
|
self.verbose = verbose
|
27
|
+
self.jupyter = jupyter
|
28
|
+
self.width = width
|
27
29
|
|
28
30
|
|
29
31
|
pass_config = click.make_pass_decorator(Config)
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/list_catalog_targets.py
RENAMED
@@ -8,15 +8,15 @@ Unit tests for the Utils helper functions using the Pytest framework.
|
|
8
8
|
|
9
9
|
List catalog targets
|
10
10
|
"""
|
11
|
-
import os
|
12
11
|
import argparse
|
12
|
+
import os
|
13
13
|
import time
|
14
14
|
|
15
15
|
from rich import box
|
16
16
|
from rich.console import Console
|
17
|
-
from rich.table import Table
|
18
|
-
from rich.prompt import Prompt
|
19
17
|
from rich.markdown import Markdown
|
18
|
+
from rich.prompt import Prompt
|
19
|
+
from rich.table import Table
|
20
20
|
|
21
21
|
from pyegeria import (
|
22
22
|
InvalidParameterException,
|
@@ -37,11 +37,12 @@ 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
42
|
|
41
43
|
|
42
|
-
def display_catalog_targets(connector:str, server: str, url: str, username: str, user_password: str
|
43
|
-
|
44
|
-
|
44
|
+
def display_catalog_targets(connector: str, server: str, url: str, username: str, user_password: str,
|
45
|
+
jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
|
45
46
|
def generate_table() -> Table:
|
46
47
|
"""Make a new table."""
|
47
48
|
table = Table(
|
@@ -65,27 +66,26 @@ def display_catalog_targets(connector:str, server: str, url: str, username: str,
|
|
65
66
|
table.add_column("Operational Instructions", max_width=15)
|
66
67
|
# table.add_column("Delete Method")
|
67
68
|
|
68
|
-
|
69
69
|
if type(cat_targets) is list:
|
70
70
|
for target in cat_targets:
|
71
|
-
target_name = target.get('catalogTargetName','---')
|
71
|
+
target_name = target.get('catalogTargetName', '---')
|
72
72
|
target_source = target.get('metadataSourceQualifiedName', '---')
|
73
|
-
target_rel = target.get('relationshipGUID','---')
|
73
|
+
target_rel = target.get('relationshipGUID', '---')
|
74
74
|
target_sync = target.get('permittedSynchronization')
|
75
|
-
target_delete = target.get('deleteMethod','---')
|
75
|
+
target_delete = target.get('deleteMethod', '---')
|
76
76
|
op_instruct = f"* {target_sync}\n* {target_delete}"
|
77
77
|
op_instruct_out = Markdown(op_instruct)
|
78
78
|
# target_guid = target['catalogTargetElement']['guid']
|
79
79
|
connector_unique = target['catalogTargetElement']['uniqueName']
|
80
80
|
|
81
|
-
config_props = target.get('configurationProperties','---')
|
81
|
+
config_props = target.get('configurationProperties', '---')
|
82
82
|
if type(config_props) is dict:
|
83
83
|
config_props_md = ''
|
84
84
|
for prop in config_props:
|
85
85
|
config_props_md += f"* {prop}: {config_props[prop]}\n"
|
86
86
|
config_props_out = Markdown(config_props_md)
|
87
87
|
|
88
|
-
template_props = target.get('templateProperties','---')
|
88
|
+
template_props = target.get('templateProperties', '---')
|
89
89
|
if type(template_props) is dict:
|
90
90
|
template_props_md = ''
|
91
91
|
for prop in template_props:
|
@@ -106,7 +106,7 @@ def display_catalog_targets(connector:str, server: str, url: str, username: str,
|
|
106
106
|
|
107
107
|
connector_guid = INTEGRATION_GUIDS[connector]
|
108
108
|
cat_targets = a_client.get_catalog_targets(connector_guid)
|
109
|
-
console = Console(force_terminal=
|
109
|
+
console = Console(force_terminal=not jupyter, width=width)
|
110
110
|
with console.pager(styles=True):
|
111
111
|
console.print(generate_table())
|
112
112
|
|
@@ -124,6 +124,8 @@ def main():
|
|
124
124
|
parser.add_argument("--url", help="URL Platform to connect to")
|
125
125
|
parser.add_argument("--userid", help="User Id")
|
126
126
|
parser.add_argument("--password", help="User Password")
|
127
|
+
parser.add_argument("--jupyter", help="Enable for Jupyter terminal compatibility")
|
128
|
+
parser.add_argument("--width", help="Screen width, in characters, to use")
|
127
129
|
|
128
130
|
args = parser.parse_args()
|
129
131
|
|
@@ -131,13 +133,16 @@ def main():
|
|
131
133
|
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
132
134
|
userid = args.userid if args.userid is not None else EGERIA_USER
|
133
135
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
136
|
+
jupyter = args.jupyter if args.jupyter is not None else EGERIA_JUPYTER
|
137
|
+
width = args.width if args.width is not None else EGERIA_WIDTH
|
134
138
|
|
135
139
|
try:
|
136
140
|
connector = Prompt.ask("Enter the Integration Connector to list catalog targets for")
|
137
|
-
display_catalog_targets(connector, server, url, userid, user_pass)
|
141
|
+
display_catalog_targets(connector, server, url, userid, user_pass, jupyter)
|
138
142
|
|
139
143
|
except KeyboardInterrupt:
|
140
144
|
pass
|
141
145
|
|
146
|
+
|
142
147
|
if __name__ == "__main__":
|
143
|
-
main()
|
148
|
+
main()
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_asset_events.py
RENAMED
@@ -27,7 +27,8 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
|
27
27
|
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
28
28
|
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
29
29
|
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
30
|
-
|
30
|
+
EGERIA_JUPYTER = os.environ.get('EGERIA_JUPYTER', False)
|
31
|
+
EGERIA_WIDTH = os.environ.get('EGERIA_WIDTH', 200)
|
31
32
|
|
32
33
|
def main(ep: str = EGERIA_KAFKA_ENDPOINT):
|
33
34
|
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_engine_activity.py
RENAMED
@@ -14,11 +14,11 @@ import json
|
|
14
14
|
import os
|
15
15
|
import sys
|
16
16
|
import time
|
17
|
-
from rich import box
|
18
17
|
|
18
|
+
from rich import box
|
19
|
+
from rich.console import Console
|
19
20
|
from rich.live import Live
|
20
21
|
from rich.table import Table
|
21
|
-
from rich.console import Console
|
22
22
|
|
23
23
|
from pyegeria import AutomatedCuration
|
24
24
|
from pyegeria import (
|
@@ -39,11 +39,14 @@ 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
44
|
|
43
45
|
disable_ssl_warnings = True
|
44
46
|
|
45
47
|
|
46
|
-
def display_engine_activity(server: str, url: str, user: str, user_pass:str, paging: bool
|
48
|
+
def display_engine_activity(server: str, url: str, user: str, user_pass: str, paging: bool,
|
49
|
+
jupyter: bool = EGERIA_JUPYTER, width=EGERIA_WIDTH):
|
47
50
|
g_client = AutomatedCuration(server, url, user, user_pwd=user_pass)
|
48
51
|
|
49
52
|
def generate_table() -> Table:
|
@@ -99,7 +102,7 @@ def display_engine_activity(server: str, url: str, user: str, user_pass:str, pag
|
|
99
102
|
else:
|
100
103
|
action_status = f"[red]{action['actionStatus']}"
|
101
104
|
|
102
|
-
target= action.get("actionTargetElements", "Empty")
|
105
|
+
target = action.get("actionTargetElements", "Empty")
|
103
106
|
if type(target) is list:
|
104
107
|
target_element = json.dumps(target[0]["targetElement"]["elementProperties"]["propertiesAsStrings"])
|
105
108
|
else:
|
@@ -109,7 +112,7 @@ def display_engine_activity(server: str, url: str, user: str, user_pass:str, pag
|
|
109
112
|
completion_message = action.get("completionMessage", " ")
|
110
113
|
|
111
114
|
table.add_row(
|
112
|
-
requested_time, start_time, action_guid,engine_name, request_type,
|
115
|
+
requested_time, start_time, action_guid, engine_name, request_type,
|
113
116
|
action_status, target_element, completion_time, process_name, completion_message
|
114
117
|
)
|
115
118
|
else:
|
@@ -120,7 +123,7 @@ def display_engine_activity(server: str, url: str, user: str, user_pass:str, pag
|
|
120
123
|
|
121
124
|
try:
|
122
125
|
if paging is True:
|
123
|
-
console = Console()
|
126
|
+
console = Console(width=width, force_terminal=not jupyter)
|
124
127
|
with console.pager():
|
125
128
|
console.print(generate_table())
|
126
129
|
else:
|
@@ -153,6 +156,7 @@ def main_live():
|
|
153
156
|
|
154
157
|
display_engine_activity(server=server, url=url, user=userid, user_pass=user_pass, paging=False)
|
155
158
|
|
159
|
+
|
156
160
|
def main_paging():
|
157
161
|
parser = argparse.ArgumentParser()
|
158
162
|
parser.add_argument("--server", help="Name of the server to display status for")
|
@@ -169,8 +173,9 @@ def main_paging():
|
|
169
173
|
|
170
174
|
display_engine_activity(server=server, url=url, user=userid, user_pass=user_pass, paging=True)
|
171
175
|
|
176
|
+
|
172
177
|
if __name__ == "__main__":
|
173
178
|
main_live()
|
174
179
|
|
175
180
|
if __name__ == "__main_paging__":
|
176
|
-
main_paging()
|
181
|
+
main_paging()
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_gov_eng_status.py
RENAMED
@@ -8,11 +8,15 @@ Unit tests for the Utils helper functions using the Pytest framework.
|
|
8
8
|
|
9
9
|
A simple status display for Governance Actions
|
10
10
|
"""
|
11
|
+
import argparse
|
12
|
+
import json
|
11
13
|
import os
|
12
14
|
import time
|
13
|
-
import json
|
14
|
-
import argparse
|
15
15
|
|
16
|
+
from rich import box
|
17
|
+
from rich.console import Console
|
18
|
+
from rich.live import Live
|
19
|
+
from rich.table import Table
|
16
20
|
|
17
21
|
from pyegeria import (
|
18
22
|
InvalidParameterException,
|
@@ -20,13 +24,8 @@ from pyegeria import (
|
|
20
24
|
UserNotAuthorizedException,
|
21
25
|
print_exception_response,
|
22
26
|
)
|
23
|
-
from rich.table import Table
|
24
|
-
from rich.live import Live
|
25
|
-
from rich import box
|
26
|
-
from rich.console import Console
|
27
|
-
|
28
|
-
|
29
27
|
from pyegeria.server_operations import ServerOps
|
28
|
+
|
30
29
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
31
30
|
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
32
31
|
EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
|
@@ -38,12 +37,14 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
|
38
37
|
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
39
38
|
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
40
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)
|
41
42
|
|
42
43
|
disable_ssl_warnings = True
|
43
44
|
|
44
45
|
|
45
|
-
|
46
|
-
|
46
|
+
def display_gov_eng_status(server: str, url: str, username: str, user_pass: str, paging: bool,
|
47
|
+
jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
|
47
48
|
server_name = server
|
48
49
|
s_client = ServerOps(server_name, url, username, user_pass)
|
49
50
|
|
@@ -74,16 +75,17 @@ def display_gov_eng_status(server: str , url: str, username: str, user_pass:str,
|
|
74
75
|
eng_type = engine["governanceEngineTypeName"]
|
75
76
|
|
76
77
|
eng_desc = engine["governanceEngineDescription"]
|
77
|
-
eng_req_type = json.dumps(engine["governanceRequestTypes"], indent
|
78
|
+
eng_req_type = json.dumps(engine["governanceRequestTypes"], indent=2)
|
78
79
|
status = engine["governanceEngineStatus"]
|
79
80
|
if status in ("RUNNING"):
|
80
81
|
eng_status = f"[green]{status}"
|
81
82
|
elif status in ("FAILED"):
|
82
83
|
eng_status = f"[red]{status}"
|
83
|
-
else:
|
84
|
+
else:
|
85
|
+
eng_status = f"[yellow]{status}"
|
84
86
|
|
85
87
|
table.add_row(
|
86
|
-
gov_eng, eng_type, eng_desc, eng_status,eng_req_type
|
88
|
+
gov_eng, eng_type, eng_desc, eng_status, eng_req_type
|
87
89
|
)
|
88
90
|
|
89
91
|
table.caption = f"Server {server_name} running on {url}"
|
@@ -91,7 +93,7 @@ def display_gov_eng_status(server: str , url: str, username: str, user_pass:str,
|
|
91
93
|
|
92
94
|
try:
|
93
95
|
if paging is True:
|
94
|
-
console = Console()
|
96
|
+
console = Console(width=width, force_terminal=not jupyter)
|
95
97
|
with console.pager():
|
96
98
|
console.print(generate_table())
|
97
99
|
else:
|
@@ -124,6 +126,7 @@ def main_live():
|
|
124
126
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
125
127
|
display_gov_eng_status(server=server, url=url, username=userid, user_pass=user_pass, paging=False)
|
126
128
|
|
129
|
+
|
127
130
|
def main_paging():
|
128
131
|
parser = argparse.ArgumentParser()
|
129
132
|
parser.add_argument("--server", help="Name of the server to display status for")
|
@@ -139,10 +142,8 @@ def main_paging():
|
|
139
142
|
display_gov_eng_status(server=server, url=url, username=userid, user_pass=user_pass, paging=True)
|
140
143
|
|
141
144
|
|
142
|
-
|
143
145
|
if __name__ == "__main__":
|
144
146
|
main_live()
|
145
147
|
|
146
|
-
|
147
148
|
if __name__ == "__main_paging__":
|
148
|
-
main_paging()
|
149
|
+
main_paging()
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_integ_daemon_status.py
RENAMED
@@ -8,10 +8,9 @@ A simple status display for the Integration Daemon.
|
|
8
8
|
|
9
9
|
|
10
10
|
"""
|
11
|
-
import os
|
12
11
|
import argparse
|
12
|
+
import os
|
13
13
|
import time
|
14
|
-
from datetime import datetime
|
15
14
|
|
16
15
|
from rich import box
|
17
16
|
from rich.console import Console
|
@@ -25,6 +24,7 @@ from pyegeria._exceptions import (
|
|
25
24
|
UserNotAuthorizedException,
|
26
25
|
print_exception_response,
|
27
26
|
)
|
27
|
+
|
28
28
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
29
29
|
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
30
30
|
EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
|
@@ -36,12 +36,16 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
|
36
36
|
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
37
37
|
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
38
38
|
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
39
|
+
EGERIA_JUPYTER = os.environ.get('EGERIA_JUPYTER', False)
|
40
|
+
EGERIA_WIDTH = os.environ.get('EGERIA_WIDTH', 200)
|
39
41
|
|
40
42
|
disable_ssl_warnings = True
|
41
43
|
|
42
44
|
|
43
45
|
def display_integration_daemon_status(integ_server: str, integ_url: str,
|
44
|
-
view_server:str, view_url: str, user: str, user_pass:str, paging: bool
|
46
|
+
view_server: str, view_url: str, user: str, user_pass: str, paging: bool,
|
47
|
+
jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH
|
48
|
+
):
|
45
49
|
s_client = ServerOps(integ_server, integ_url, user)
|
46
50
|
a_client = AutomatedCuration(view_server, view_url, user, user_pass)
|
47
51
|
token = a_client.create_egeria_bearer_token()
|
@@ -50,8 +54,8 @@ def display_integration_daemon_status(integ_server: str, integ_url: str,
|
|
50
54
|
"""Make a new table."""
|
51
55
|
table = Table(
|
52
56
|
title=f"Integration Daemon Status @ {time.asctime()}",
|
53
|
-
style
|
54
|
-
row_styles
|
57
|
+
style="bold white on black",
|
58
|
+
row_styles=["bold white on black"],
|
55
59
|
header_style="white on dark_blue",
|
56
60
|
title_style="bold white on black",
|
57
61
|
caption_style="white on black",
|
@@ -60,20 +64,20 @@ def display_integration_daemon_status(integ_server: str, integ_url: str,
|
|
60
64
|
caption=f"Integration Daemon Status for Server '{integ_server}' @ Platform - {integ_url}",
|
61
65
|
expand=True
|
62
66
|
)
|
63
|
-
table.add_column("Connector Name", min_width
|
67
|
+
table.add_column("Connector Name", min_width=15)
|
64
68
|
table.add_column("Status", max_width=6)
|
65
69
|
|
66
|
-
table.add_column("Last Refresh Time", min_width
|
70
|
+
table.add_column("Last Refresh Time", min_width=12)
|
67
71
|
table.add_column("Min Refresh (mins)", max_width=6)
|
68
72
|
table.add_column("Target Element", min_width=20)
|
69
|
-
table.add_column("Exception Message",min_width=10)
|
73
|
+
table.add_column("Exception Message", min_width=10)
|
70
74
|
|
71
75
|
daemon_status = s_client.get_integration_daemon_status()
|
72
76
|
connector_reports = daemon_status["integrationConnectorReports"]
|
73
77
|
for connector in connector_reports:
|
74
78
|
connector_name = connector.get("connectorName", "---")
|
75
79
|
connector_status = connector.get("connectorStatus", "---")
|
76
|
-
connector_guid = connector.get("connectorGUID","---")
|
80
|
+
connector_guid = connector.get("connectorGUID", "---")
|
77
81
|
last_refresh_time = connector.get("lastRefreshTime", "---")[:-10]
|
78
82
|
refresh_interval = str(connector.get("minMinutesBetweenRefresh", "---"))
|
79
83
|
exception_msg = " "
|
@@ -92,7 +96,7 @@ def display_integration_daemon_status(integ_server: str, integ_url: str,
|
|
92
96
|
t_unique_name = target["catalogTargetElement"]["uniqueName"]
|
93
97
|
t_rel_guid = target["relationshipGUID"]
|
94
98
|
# targets_m += f"* Target Name: __{t_name}__\n* Sync: {t_sync}\n* Unique Name: {t_unique_name}\n\n"
|
95
|
-
tgt_tab.add_row(t_name,t_unique_name, t_rel_guid)
|
99
|
+
tgt_tab.add_row(t_name, t_unique_name, t_rel_guid)
|
96
100
|
# targets_md = Markdown(targets_m)
|
97
101
|
else:
|
98
102
|
targets_md = False
|
@@ -118,7 +122,7 @@ def display_integration_daemon_status(integ_server: str, integ_url: str,
|
|
118
122
|
|
119
123
|
try:
|
120
124
|
if paging is True:
|
121
|
-
console = Console()
|
125
|
+
console = Console(width=width, force_terminal=not jupyter)
|
122
126
|
with console.pager():
|
123
127
|
console.print(generate_table())
|
124
128
|
else:
|
@@ -156,8 +160,9 @@ def main_live():
|
|
156
160
|
userid = args.userid if args.userid is not None else EGERIA_USER
|
157
161
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
158
162
|
display_integration_daemon_status(integ_server=integ_server, integ_url=integ_url,
|
159
|
-
view_server
|
160
|
-
user=userid, user_pass
|
163
|
+
view_server=view_server, view_url=view_url,
|
164
|
+
user=userid, user_pass=user_pass, paging=False)
|
165
|
+
|
161
166
|
|
162
167
|
def main_paging():
|
163
168
|
parser = argparse.ArgumentParser()
|
@@ -176,12 +181,12 @@ def main_paging():
|
|
176
181
|
userid = args.userid if args.userid is not None else EGERIA_USER
|
177
182
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
178
183
|
display_integration_daemon_status(integ_server=integ_server, integ_url=integ_url,
|
179
|
-
view_server
|
180
|
-
user=userid, user_pass
|
184
|
+
view_server=view_server, view_url=view_url,
|
185
|
+
user=userid, user_pass=user_pass, paging=True)
|
181
186
|
|
182
187
|
|
183
188
|
if __name__ == "__main__":
|
184
189
|
main_live()
|
185
190
|
|
186
191
|
if __name__ == "__main_paging__":
|
187
|
-
main_paging()
|
192
|
+
main_paging()
|
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.12 → pyegeria-0.5.8.15}/examples/widgets/catalog_user/get_tech_type_elements.py
RENAMED
File without changes
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/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
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/developer/list_registered_services.py
RENAMED
File without changes
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/developer/list_relationship_types.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/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.12 → pyegeria-0.5.8.15}/examples/widgets/operational/integration_daemon_actions.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_platform_status.py
RENAMED
File without changes
|
File without changes
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/monitor_server_status.py
RENAMED
File without changes
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/refresh_integration_daemon.py
RENAMED
File without changes
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/operational/restart_integration_daemon.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/personal_organizer/list_my_profile.py
RENAMED
File without changes
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/personal_organizer/list_projects.py
RENAMED
File without changes
|
File without changes
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/examples/widgets/personal_organizer/monitor_my_todos.py
RENAMED
File without changes
|
{pyegeria-0.5.8.12 → pyegeria-0.5.8.15}/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
|