pyegeria 0.7.29__tar.gz → 0.7.31__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.7.29 → pyegeria-0.7.31}/PKG-INFO +1 -1
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/list_relationships.py +70 -43
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cli/egeria.py +28 -10
- pyegeria-0.7.31/examples/widgets/cli/egeria_ops.py +443 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/monitor_engine_activity.py +3 -1
- pyegeria-0.7.31/examples/widgets/ops/monitor_engine_activity_c.py +237 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/monitor_integ_daemon_status.py +3 -1
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyproject.toml +1 -1
- pyegeria-0.7.29/examples/widgets/cli/egeria_ops.py +0 -258
- {pyegeria-0.7.29 → pyegeria-0.7.31}/LICENSE +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/README.md +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/doc_samples/Create_Collection_Sample.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/README.md +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/__init__.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/get_asset_graph.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/get_collection.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/get_project_dependencies.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/get_project_structure.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/get_tech_type_elements.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/get_tech_type_template.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/list_assets.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/list_cert_types.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/list_glossary.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/list_projects.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/list_tech_types.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/list_todos.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cat/list_user_ids.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cli/__init__.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cli/egeria_cat.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cli/egeria_my.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cli/egeria_tech.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/cli/ops_config.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/my/README.md +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/my/__init__.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/my/list_my_profile.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/my/list_my_roles.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/my/monitor_my_todos.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/my/monitor_open_todos.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/my/my_profile_actions.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/my/todo_actions.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/README.md +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/__init__.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/engine_actions.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/integration_daemon_actions.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/list_catalog_targets.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/load_archive.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/monitor_asset_events.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/monitor_coco_status.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/monitor_gov_eng_status.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/monitor_platform_status.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/monitor_server_list.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/monitor_server_status.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/refresh_integration_daemon.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/ops/restart_integration_daemon.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/README.md +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/__init__.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/get_element_info.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/get_guid_info.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/get_tech_details.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/list_asset_types.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/list_elements.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/list_elements_x.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/list_registered_services.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/list_related_specification.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/list_relationship_types.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/list_tech_templates.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/list_valid_metadata_values.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/examples/widgets/tech/x_list_related_elements.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/Xloaded_resources_omvs.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/__init__.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/_client.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/_deprecated_gov_engine.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/_exceptions.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/_globals.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/_validators.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/action_author_omvs.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/asset_catalog_omvs.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/automated_curation_omvs.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/classification_manager_omvs.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/collection_manager_omvs.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/core_omag_server_config.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/create_tech_guid_lists.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/feedback_manager_omvs.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/full_omag_server_config.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/glossary_browser_omvs.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/glossary_manager_omvs.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/mermaid_utilities.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/my_profile_omvs.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/platform_services.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/project_manager_omvs.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/registered_info.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/runtime_manager_omvs.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/server_operations.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/utils.py +0 -0
- {pyegeria-0.7.29 → pyegeria-0.7.31}/pyegeria/valid_metadata_omvs.py +0 -0
@@ -22,37 +22,49 @@ from pyegeria import (
|
|
22
22
|
InvalidParameterException,
|
23
23
|
PropertyServerException,
|
24
24
|
UserNotAuthorizedException,
|
25
|
-
ClassificationManager
|
25
|
+
ClassificationManager,
|
26
26
|
)
|
27
27
|
|
28
28
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
29
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
30
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
31
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
32
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
29
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
30
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
31
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
32
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
33
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
34
|
+
)
|
35
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
36
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
37
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
38
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
39
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
40
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
41
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
40
42
|
|
41
43
|
|
42
44
|
disable_ssl_warnings = True
|
43
45
|
|
44
46
|
|
45
|
-
def list_relationships(
|
46
|
-
|
47
|
-
|
47
|
+
def list_relationships(
|
48
|
+
search_string: str,
|
49
|
+
server: str,
|
50
|
+
url: str,
|
51
|
+
username: str,
|
52
|
+
user_password: str,
|
53
|
+
time_out: int = 60,
|
54
|
+
jupyter: bool = EGERIA_JUPYTER,
|
55
|
+
width: int = EGERIA_WIDTH,
|
56
|
+
):
|
48
57
|
console = Console(width=width, force_terminal=not jupyter, soft_wrap=True)
|
49
|
-
if (search_string is None) or ((len(search_string) < 3)) and (search_string !=
|
50
|
-
raise ValueError(
|
51
|
-
|
58
|
+
if (search_string is None) or ((len(search_string) < 3)) and (search_string != "*"):
|
59
|
+
raise ValueError(
|
60
|
+
"Invalid Search String - must be greater than four characters long"
|
61
|
+
)
|
62
|
+
g_client = ClassificationManager(
|
63
|
+
server, url, user_id=username, user_pwd=user_password
|
64
|
+
)
|
52
65
|
token = g_client.create_egeria_bearer_token(username, user_password)
|
53
66
|
|
54
|
-
|
55
|
-
def generate_table(search_string:str = None) -> Table:
|
67
|
+
def generate_table(search_string: str = None) -> Table:
|
56
68
|
"""Make a new table."""
|
57
69
|
table = Table(
|
58
70
|
title=f"Relationship List for {search_string} @ {time.asctime()}",
|
@@ -64,40 +76,49 @@ def list_relationships(search_string: str, server: str, url: str, username: str,
|
|
64
76
|
show_lines=True,
|
65
77
|
box=box.ROUNDED,
|
66
78
|
caption=f"View Server '{server}' @ Platform - {url}",
|
67
|
-
expand=True
|
79
|
+
expand=True,
|
68
80
|
)
|
69
|
-
table.add_column(
|
81
|
+
table.add_column("End 1 Name")
|
70
82
|
table.add_column("End 1 GUID", no_wrap=True)
|
71
|
-
table.add_column(
|
72
|
-
table.add_column(
|
83
|
+
table.add_column("End 1 Type")
|
84
|
+
table.add_column("End 2 Name")
|
73
85
|
table.add_column("End 2 GUID", no_wrap=True)
|
74
86
|
table.add_column("End 2 Type")
|
75
87
|
table.add_column("Properties", min_width=40)
|
76
88
|
|
77
|
-
rel_list = g_client.get_relationships(
|
89
|
+
rel_list = g_client.get_relationships(
|
90
|
+
search_string, page_size=100, time_out=time_out
|
91
|
+
)
|
78
92
|
if type(rel_list) is str:
|
79
93
|
return table
|
80
94
|
|
81
|
-
for rel
|
82
|
-
end1_name = rel[
|
83
|
-
end1_guid = rel[
|
84
|
-
end1_type = rel[
|
85
|
-
end2_name = rel[
|
86
|
-
end2_guid = rel[
|
87
|
-
end2_type = rel[
|
95
|
+
for rel in rel_list:
|
96
|
+
end1_name = rel["end1"].get("uniqueName", "---")
|
97
|
+
end1_guid = rel["end1"]["guid"]
|
98
|
+
end1_type = rel["end1"]["type"]["typeName"]
|
99
|
+
end2_name = rel["end2"].get("uniqueName", "---")
|
100
|
+
end2_guid = rel["end2"]["guid"]
|
101
|
+
end2_type = rel["end2"]["type"]["typeName"]
|
88
102
|
|
89
|
-
rel_md =
|
90
|
-
p_test = rel.get(
|
103
|
+
rel_md = ""
|
104
|
+
p_test = rel.get("properties", "---")
|
91
105
|
if type(p_test) is str:
|
92
|
-
rel_md =
|
106
|
+
rel_md = "---"
|
93
107
|
else:
|
94
|
-
for key in rel[
|
108
|
+
for key in rel["properties"].keys():
|
95
109
|
rel_md += f"* {key}: {rel['properties'][key]}\n"
|
96
110
|
|
97
111
|
rel_out = Markdown(rel_md)
|
98
112
|
|
99
113
|
table.add_row(
|
100
|
-
end1_name,
|
114
|
+
end1_name,
|
115
|
+
end1_guid,
|
116
|
+
end1_type,
|
117
|
+
end2_name,
|
118
|
+
end2_guid,
|
119
|
+
end2_type,
|
120
|
+
rel_out,
|
121
|
+
)
|
101
122
|
|
102
123
|
g_client.close_session()
|
103
124
|
|
@@ -112,13 +133,18 @@ def list_relationships(search_string: str, server: str, url: str, username: str,
|
|
112
133
|
with console.pager(styles=True):
|
113
134
|
console.print(generate_table(search_string), soft_wrap=True)
|
114
135
|
|
115
|
-
|
116
|
-
|
136
|
+
except (
|
137
|
+
InvalidParameterException,
|
138
|
+
PropertyServerException,
|
139
|
+
UserNotAuthorizedException,
|
140
|
+
) as e:
|
117
141
|
console.print_exception()
|
118
142
|
sys.exit(1)
|
119
143
|
|
120
144
|
except ValueError as e:
|
121
|
-
console.print(
|
145
|
+
console.print(
|
146
|
+
f"\n\n====> Invalid Search String - must be greater than four characters long"
|
147
|
+
)
|
122
148
|
sys.exit(1)
|
123
149
|
|
124
150
|
|
@@ -139,10 +165,11 @@ def main():
|
|
139
165
|
time_out = args.time_out if args.time_out is not None else 60
|
140
166
|
try:
|
141
167
|
# search_string = Prompt.ask("Enter an asset search string:", default="*")
|
142
|
-
search_string =
|
168
|
+
search_string = "Certification"
|
143
169
|
list_relationships(search_string, server, url, userid, user_pass, time_out)
|
144
|
-
except
|
170
|
+
except KeyboardInterrupt:
|
145
171
|
pass
|
146
172
|
|
173
|
+
|
147
174
|
if __name__ == "__main__":
|
148
|
-
main()
|
175
|
+
main()
|
@@ -45,6 +45,7 @@ from examples.widgets.ops.integration_daemon_actions import (
|
|
45
45
|
from examples.widgets.ops.list_catalog_targets import display_catalog_targets
|
46
46
|
from examples.widgets.ops.load_archive import load_archive
|
47
47
|
from examples.widgets.ops.monitor_engine_activity import display_engine_activity
|
48
|
+
from examples.widgets.ops.monitor_engine_activity_c import display_engine_activity_c
|
48
49
|
from examples.widgets.ops.monitor_gov_eng_status import display_gov_eng_status
|
49
50
|
from examples.widgets.ops.monitor_integ_daemon_status import (
|
50
51
|
display_integration_daemon_status,
|
@@ -988,19 +989,36 @@ def gov_eng_status(ctx, list):
|
|
988
989
|
@click.option(
|
989
990
|
"--list", is_flag=True, default=False, help="If True, a paged list will be shown"
|
990
991
|
)
|
992
|
+
@click.option(
|
993
|
+
"--compressed",
|
994
|
+
type=bool,
|
995
|
+
default=True,
|
996
|
+
help="Compressed combines some attributes into a single column",
|
997
|
+
)
|
991
998
|
@click.pass_context
|
992
|
-
def eng_activity_status(ctx, list):
|
999
|
+
def eng_activity_status(ctx, list, compressed):
|
993
1000
|
"""Show Governance Activity in engine-host"""
|
994
1001
|
c = ctx.obj
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1002
|
+
if compressed:
|
1003
|
+
display_engine_activity_c(
|
1004
|
+
c.view_server,
|
1005
|
+
c.view_server_url,
|
1006
|
+
c.admin_user,
|
1007
|
+
c.admin_user_password,
|
1008
|
+
list,
|
1009
|
+
c.jupyter,
|
1010
|
+
c.width,
|
1011
|
+
)
|
1012
|
+
else:
|
1013
|
+
display_engine_activity(
|
1014
|
+
c.view_server,
|
1015
|
+
c.view_server_url,
|
1016
|
+
c.admin_user,
|
1017
|
+
c.admin_user_password,
|
1018
|
+
list,
|
1019
|
+
c.jupyter,
|
1020
|
+
c.width,
|
1021
|
+
)
|
1004
1022
|
|
1005
1023
|
|
1006
1024
|
@show.group("integrations")
|
@@ -0,0 +1,443 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
|
7
|
+
A command line interface for Egeria operations.
|
8
|
+
|
9
|
+
This is an emerging capability based on the **click** package. Feedback welcome!
|
10
|
+
|
11
|
+
"""
|
12
|
+
import click
|
13
|
+
from trogon import tui
|
14
|
+
|
15
|
+
# from pyegeria import ServerOps
|
16
|
+
from examples.widgets.cli.ops_config import Config
|
17
|
+
from examples.widgets.ops.engine_actions import (
|
18
|
+
start_daemon as start_engine_host,
|
19
|
+
stop_daemon as stop_engine_host,
|
20
|
+
)
|
21
|
+
from examples.widgets.ops.integration_daemon_actions import (
|
22
|
+
add_catalog_target,
|
23
|
+
remove_catalog_target,
|
24
|
+
update_catalog_target,
|
25
|
+
stop_server,
|
26
|
+
start_server,
|
27
|
+
)
|
28
|
+
from examples.widgets.ops.list_catalog_targets import display_catalog_targets
|
29
|
+
from examples.widgets.ops.load_archive import load_archive
|
30
|
+
from examples.widgets.ops.monitor_engine_activity import display_engine_activity
|
31
|
+
from examples.widgets.ops.monitor_engine_activity_c import display_engine_activity_c
|
32
|
+
from examples.widgets.ops.monitor_gov_eng_status import display_gov_eng_status
|
33
|
+
from examples.widgets.ops.monitor_integ_daemon_status import (
|
34
|
+
display_integration_daemon_status,
|
35
|
+
)
|
36
|
+
from examples.widgets.ops.monitor_platform_status import (
|
37
|
+
display_status as p_display_status,
|
38
|
+
)
|
39
|
+
from examples.widgets.ops.monitor_server_list import display_status as display_list
|
40
|
+
from examples.widgets.ops.monitor_server_status import (
|
41
|
+
display_status as s_display_status,
|
42
|
+
)
|
43
|
+
from examples.widgets.ops.refresh_integration_daemon import refresh_connector
|
44
|
+
from examples.widgets.ops.restart_integration_daemon import restart_connector
|
45
|
+
|
46
|
+
|
47
|
+
# class Config(object):
|
48
|
+
# def __init__(self, server: str = None, url: str = None, userid:str = None, password:str = None,
|
49
|
+
# timeout:int = 30, paging: bool = False):
|
50
|
+
# self.server = server
|
51
|
+
# self.url = url
|
52
|
+
# self.userid = userid
|
53
|
+
# self.password = password
|
54
|
+
# self.timeout = timeout
|
55
|
+
# self.paging = paging
|
56
|
+
#
|
57
|
+
#
|
58
|
+
# pass_config = click.make_pass_decorator(Config)
|
59
|
+
|
60
|
+
|
61
|
+
@tui()
|
62
|
+
# @tui('menu', 'menu', 'A textual command line interface')
|
63
|
+
@click.version_option("0.0.1", prog_name="egeria_ops")
|
64
|
+
@click.group()
|
65
|
+
@click.option(
|
66
|
+
"--server",
|
67
|
+
default="active-metadata-store",
|
68
|
+
envvar="EGERIA_METADATA_STORE",
|
69
|
+
help="Egeria metadata store to work with",
|
70
|
+
)
|
71
|
+
@click.option(
|
72
|
+
"--url",
|
73
|
+
default="https://localhost:9443",
|
74
|
+
envvar="EGERIA_PLATFORM_URL",
|
75
|
+
help="URL of Egeria metadata store platform to connect to",
|
76
|
+
)
|
77
|
+
@click.option(
|
78
|
+
"--integration-daemon",
|
79
|
+
default="integration-daemon",
|
80
|
+
envvar="EGERIA_INTEGRATION_DAEMON",
|
81
|
+
help="Egeria integration daemon to work with",
|
82
|
+
)
|
83
|
+
@click.option(
|
84
|
+
"--integration_daemon_url",
|
85
|
+
default="https://localhost:9443",
|
86
|
+
envvar="EGERIA_INTEGRATION_DAEMON_URL",
|
87
|
+
help="URL of Egeria integration daemon platform to connect to",
|
88
|
+
)
|
89
|
+
@click.option(
|
90
|
+
"--view_server",
|
91
|
+
default="view-server",
|
92
|
+
envvar="EGERIA_VIEW_SERVER",
|
93
|
+
help="Egeria view server to work with",
|
94
|
+
)
|
95
|
+
@click.option(
|
96
|
+
"--view_server_url",
|
97
|
+
default="https://localhost:9443",
|
98
|
+
envvar="EGERIA_VIEW_SERVER_URL",
|
99
|
+
help="URL of Egeria view server platform to connect to",
|
100
|
+
)
|
101
|
+
@click.option(
|
102
|
+
"--engine_host",
|
103
|
+
default="engine-host",
|
104
|
+
envvar="EGERIA_ENGINE_HOST",
|
105
|
+
help="Egeria engine host to work with",
|
106
|
+
)
|
107
|
+
@click.option(
|
108
|
+
"--engine_host_url",
|
109
|
+
default="https://localhost:9443",
|
110
|
+
envvar="EGERIA_ENGINE_HOST_URL",
|
111
|
+
help="URL of Egeria engine host platform to connect to",
|
112
|
+
)
|
113
|
+
@click.option(
|
114
|
+
"--admin_user",
|
115
|
+
default="garygeeke",
|
116
|
+
envvar="EGERIA_ADMIN_USER",
|
117
|
+
help="Egeria admin user",
|
118
|
+
)
|
119
|
+
@click.option(
|
120
|
+
"--admin_user_password",
|
121
|
+
default="secret",
|
122
|
+
envvar="EGERIA_ADMIN_PASSWORD",
|
123
|
+
help="Egeria admin password",
|
124
|
+
)
|
125
|
+
@click.option(
|
126
|
+
"--userid", default="erinoverview", envvar="EGERIA_USER", help="Egeria user"
|
127
|
+
)
|
128
|
+
@click.option(
|
129
|
+
"--password",
|
130
|
+
default="secret",
|
131
|
+
envvar="EGERIA_PASSWORD",
|
132
|
+
help="Egeria user password",
|
133
|
+
)
|
134
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
135
|
+
@click.option("--verbose", is_flag=True, default=False, help="Enable verbose mode")
|
136
|
+
@click.option(
|
137
|
+
"--paging",
|
138
|
+
is_flag=True,
|
139
|
+
default=False,
|
140
|
+
help="Enable paging snapshots vs live updates",
|
141
|
+
)
|
142
|
+
@click.option(
|
143
|
+
"--jupyter",
|
144
|
+
is_flag=True,
|
145
|
+
default=False,
|
146
|
+
envvar="EGERIA_JUPYTER",
|
147
|
+
help="Enable for rendering in a Jupyter terminal",
|
148
|
+
)
|
149
|
+
@click.option(
|
150
|
+
"--width",
|
151
|
+
default=200,
|
152
|
+
envvar="EGERIA_WIDTH",
|
153
|
+
help="Screen width, in characters, to use",
|
154
|
+
)
|
155
|
+
@click.pass_context
|
156
|
+
def cli(
|
157
|
+
ctx,
|
158
|
+
server,
|
159
|
+
url,
|
160
|
+
view_server,
|
161
|
+
view_server_url,
|
162
|
+
integration_daemon,
|
163
|
+
integration_daemon_url,
|
164
|
+
engine_host,
|
165
|
+
engine_host_url,
|
166
|
+
admin_user,
|
167
|
+
admin_user_password,
|
168
|
+
userid,
|
169
|
+
password,
|
170
|
+
timeout,
|
171
|
+
paging,
|
172
|
+
verbose,
|
173
|
+
jupyter,
|
174
|
+
width,
|
175
|
+
):
|
176
|
+
"""An Egeria Command Line interface for Operations"""
|
177
|
+
ctx.obj = Config(
|
178
|
+
server,
|
179
|
+
url,
|
180
|
+
view_server,
|
181
|
+
view_server_url,
|
182
|
+
integration_daemon,
|
183
|
+
integration_daemon_url,
|
184
|
+
engine_host,
|
185
|
+
engine_host_url,
|
186
|
+
admin_user,
|
187
|
+
admin_user_password,
|
188
|
+
userid,
|
189
|
+
password,
|
190
|
+
timeout,
|
191
|
+
paging,
|
192
|
+
verbose,
|
193
|
+
jupyter,
|
194
|
+
width,
|
195
|
+
)
|
196
|
+
ctx.max_content_width = 200
|
197
|
+
ctx.ensure_object(Config)
|
198
|
+
if verbose:
|
199
|
+
click.echo(f"we are in verbose mode - server is {server}")
|
200
|
+
|
201
|
+
|
202
|
+
@cli.group("show")
|
203
|
+
@click.pass_context
|
204
|
+
def show(ctx):
|
205
|
+
"""Display an Egeria Object"""
|
206
|
+
pass
|
207
|
+
|
208
|
+
|
209
|
+
@show.group("platforms")
|
210
|
+
@click.pass_context
|
211
|
+
def show_platform(ctx):
|
212
|
+
"""Group of commands to show information about Egeria platforms"""
|
213
|
+
pass
|
214
|
+
|
215
|
+
|
216
|
+
@show_platform.command("status")
|
217
|
+
@click.pass_context
|
218
|
+
def show_platform_status(ctx):
|
219
|
+
"""Display a live status view of known platforms"""
|
220
|
+
c = ctx.obj
|
221
|
+
p_display_status(
|
222
|
+
c.view_server, c.view_server_url, c.admin_user, c.admin_user_password
|
223
|
+
)
|
224
|
+
|
225
|
+
|
226
|
+
@show.group("servers")
|
227
|
+
@click.pass_context
|
228
|
+
def show_server(ctx):
|
229
|
+
"""Group of commands to show information about Egeria servers"""
|
230
|
+
pass
|
231
|
+
|
232
|
+
|
233
|
+
@show_server.command("status")
|
234
|
+
@click.option(
|
235
|
+
"--full",
|
236
|
+
is_flag=True,
|
237
|
+
default=False,
|
238
|
+
help="If True, full server descriptions will be shown",
|
239
|
+
)
|
240
|
+
@click.pass_context
|
241
|
+
def show_server_status(ctx, full):
|
242
|
+
"""Display a live status view of Egeria servers for the specified Egeria platform"""
|
243
|
+
c = ctx.obj
|
244
|
+
if full:
|
245
|
+
display_list(
|
246
|
+
c.metadata_store,
|
247
|
+
c.metadata_store_url,
|
248
|
+
c.admin_user,
|
249
|
+
c.admin_user_password,
|
250
|
+
c.jupyter,
|
251
|
+
c.width,
|
252
|
+
)
|
253
|
+
else:
|
254
|
+
s_display_status(
|
255
|
+
c.metadata_store,
|
256
|
+
c.metadata_store_url,
|
257
|
+
c.admin_user,
|
258
|
+
c.admin_user_password,
|
259
|
+
c.jupyter,
|
260
|
+
c.width,
|
261
|
+
)
|
262
|
+
|
263
|
+
|
264
|
+
@show.group("engines")
|
265
|
+
@click.pass_context
|
266
|
+
def engine_host(ctx):
|
267
|
+
"""Group of commands to show information about Egeria engines"""
|
268
|
+
pass
|
269
|
+
|
270
|
+
|
271
|
+
@engine_host.command("status")
|
272
|
+
@click.option(
|
273
|
+
"--list", is_flag=True, default=False, help="If True, a paged list will be shown"
|
274
|
+
)
|
275
|
+
@click.pass_context
|
276
|
+
def gov_eng_status(ctx, list):
|
277
|
+
"""Display engine-host status information"""
|
278
|
+
c = ctx.obj
|
279
|
+
display_gov_eng_status(
|
280
|
+
c.engine_host, c.engine_host_url, c.userid, c.password, list, c.jupyter, c.width
|
281
|
+
)
|
282
|
+
|
283
|
+
|
284
|
+
@engine_host.command("activity")
|
285
|
+
@click.option(
|
286
|
+
"--compressed",
|
287
|
+
type=bool,
|
288
|
+
default=True,
|
289
|
+
help="Compressed combines some attributes into a single column",
|
290
|
+
)
|
291
|
+
@click.option(
|
292
|
+
"--list", is_flag=True, default=False, help="If True, a paged list will be shown"
|
293
|
+
)
|
294
|
+
@click.pass_context
|
295
|
+
def eng_activity_status(ctx, list, compressed):
|
296
|
+
"""Show Governance Activity in engine-host"""
|
297
|
+
c = ctx.obj
|
298
|
+
if compressed:
|
299
|
+
display_engine_activity_c(
|
300
|
+
c.view_server,
|
301
|
+
c.view_server_url,
|
302
|
+
c.admin_user,
|
303
|
+
c.admin_user_password,
|
304
|
+
list,
|
305
|
+
c.jupyter,
|
306
|
+
c.width,
|
307
|
+
)
|
308
|
+
else:
|
309
|
+
display_engine_activity(
|
310
|
+
c.view_server,
|
311
|
+
c.view_server_url,
|
312
|
+
c.admin_user,
|
313
|
+
c.admin_user_password,
|
314
|
+
list,
|
315
|
+
c.jupyter,
|
316
|
+
c.width,
|
317
|
+
)
|
318
|
+
|
319
|
+
|
320
|
+
@show.group("integrations")
|
321
|
+
@click.pass_context
|
322
|
+
def integrations(ctx):
|
323
|
+
"""Group of commands to show information about Egeria integrations"""
|
324
|
+
pass
|
325
|
+
|
326
|
+
|
327
|
+
@integrations.command("status")
|
328
|
+
@click.option(
|
329
|
+
"--list", is_flag=True, default=False, help="If True, a paged list will be shown"
|
330
|
+
)
|
331
|
+
@click.pass_context
|
332
|
+
def integrations_status(ctx, list):
|
333
|
+
"""Display integration-daemon status information"""
|
334
|
+
c = ctx.obj
|
335
|
+
display_integration_daemon_status(
|
336
|
+
c.integration_daemon,
|
337
|
+
c.integration_daemon_url,
|
338
|
+
c.view_server,
|
339
|
+
c.view_server_url,
|
340
|
+
c.userid,
|
341
|
+
c.password,
|
342
|
+
list,
|
343
|
+
c.jupyter,
|
344
|
+
c.width,
|
345
|
+
)
|
346
|
+
|
347
|
+
|
348
|
+
@integrations.command("targets")
|
349
|
+
@click.pass_context
|
350
|
+
@click.argument("connector", nargs=1)
|
351
|
+
def integrations_status(ctx, connector):
|
352
|
+
"""Display Catalog Targets for a connector"""
|
353
|
+
c = ctx.obj
|
354
|
+
display_catalog_targets(
|
355
|
+
connector,
|
356
|
+
c.view_server,
|
357
|
+
c.view_server_url,
|
358
|
+
c.userid,
|
359
|
+
c.password,
|
360
|
+
c.jupyter,
|
361
|
+
c.width,
|
362
|
+
)
|
363
|
+
|
364
|
+
|
365
|
+
#
|
366
|
+
# Tell
|
367
|
+
#
|
368
|
+
|
369
|
+
|
370
|
+
@cli.group("tell")
|
371
|
+
@click.pass_context
|
372
|
+
def tell(ctx):
|
373
|
+
"""Perform actions an Egeria Objects"""
|
374
|
+
pass
|
375
|
+
|
376
|
+
|
377
|
+
@tell.group("integration-daemon")
|
378
|
+
@click.pass_context
|
379
|
+
def integration_daemon(ctx):
|
380
|
+
"""Group of commands to an integration-daemon"""
|
381
|
+
pass
|
382
|
+
|
383
|
+
|
384
|
+
@integration_daemon.command("refresh")
|
385
|
+
@click.pass_context
|
386
|
+
@click.option(
|
387
|
+
"--connector",
|
388
|
+
default="all",
|
389
|
+
help="Name of connector to refresh or 'all' to refresh all",
|
390
|
+
)
|
391
|
+
def refresh_connectors(ctx, connector):
|
392
|
+
"""Refresh the specified integration connector or ALL connectors if not specified"""
|
393
|
+
c = ctx.obj
|
394
|
+
refresh_connector(
|
395
|
+
connector, c.integration_daemon, c.integration_daemon_url, c.userid, c.password
|
396
|
+
)
|
397
|
+
|
398
|
+
|
399
|
+
@integration_daemon.command("restart")
|
400
|
+
@click.pass_context
|
401
|
+
@click.option(
|
402
|
+
"--connector",
|
403
|
+
default="all",
|
404
|
+
help="Name of connector to restart or 'all' to restart all",
|
405
|
+
)
|
406
|
+
def restart_connectors(ctx, connector):
|
407
|
+
"""Restart the specified integration connector or ALL connectors if not specified"""
|
408
|
+
c = ctx.obj
|
409
|
+
restart_connector(
|
410
|
+
connector, c.integration_daemon, c.integration_daemon_url, c.userid, c.password
|
411
|
+
)
|
412
|
+
|
413
|
+
|
414
|
+
integration_daemon.add_command(add_catalog_target)
|
415
|
+
integration_daemon.add_command(remove_catalog_target)
|
416
|
+
integration_daemon.add_command(update_catalog_target)
|
417
|
+
integration_daemon.add_command(stop_server)
|
418
|
+
integration_daemon.add_command(start_server)
|
419
|
+
|
420
|
+
|
421
|
+
@tell.group("engine-host")
|
422
|
+
@click.pass_context
|
423
|
+
def engine_host(ctx):
|
424
|
+
"""Group of commands to an engine-host"""
|
425
|
+
pass
|
426
|
+
|
427
|
+
|
428
|
+
engine_host.add_command(start_engine_host)
|
429
|
+
engine_host.add_command(stop_engine_host)
|
430
|
+
|
431
|
+
|
432
|
+
@tell.group("repository")
|
433
|
+
@click.pass_context
|
434
|
+
def repository(ctx):
|
435
|
+
"""Group of commands to a repository"""
|
436
|
+
pass
|
437
|
+
|
438
|
+
|
439
|
+
repository.add_command(load_archive)
|
440
|
+
|
441
|
+
|
442
|
+
if __name__ == "__main__":
|
443
|
+
cli()
|
@@ -89,7 +89,9 @@ def display_engine_activity(
|
|
89
89
|
token = g_client.create_egeria_bearer_token()
|
90
90
|
action_status = g_client.get_engine_actions()
|
91
91
|
sorted_action_status = sorted(
|
92
|
-
action_status,
|
92
|
+
action_status,
|
93
|
+
key=lambda i: i("requestedTime", time.asctime()),
|
94
|
+
reverse=True,
|
93
95
|
)
|
94
96
|
if type(action_status) is str:
|
95
97
|
requested_time = " "
|