pyegeria 1.5.1.1.40__py3-none-any.whl → 1.5.1.1.41__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.
- pyegeria/commands/__init__.py +1 -0
- pyegeria/commands/ops/list_catalog_targets.py +88 -42
- {pyegeria-1.5.1.1.40.dist-info → pyegeria-1.5.1.1.41.dist-info}/METADATA +1 -1
- {pyegeria-1.5.1.1.40.dist-info → pyegeria-1.5.1.1.41.dist-info}/RECORD +7 -7
- {pyegeria-1.5.1.1.40.dist-info → pyegeria-1.5.1.1.41.dist-info}/LICENSE +0 -0
- {pyegeria-1.5.1.1.40.dist-info → pyegeria-1.5.1.1.41.dist-info}/WHEEL +0 -0
- {pyegeria-1.5.1.1.40.dist-info → pyegeria-1.5.1.1.41.dist-info}/entry_points.txt +0 -0
pyegeria/commands/__init__.py
CHANGED
@@ -13,6 +13,7 @@ from .ops.table_integ_daemon_status import (
|
|
13
13
|
display_integration_daemon_status as table_integ_daemon_status,
|
14
14
|
)
|
15
15
|
from .ops.monitor_engine_activity_c import display_engine_activity_c
|
16
|
+
from .ops.list_catalog_targets import display_catalog_targets
|
16
17
|
|
17
18
|
from .cat.list_glossaries import display_glossaries
|
18
19
|
from .cat.list_terms import display_glossary_terms
|
@@ -24,27 +24,58 @@ from pyegeria import (
|
|
24
24
|
UserNotAuthorizedException,
|
25
25
|
print_exception_response,
|
26
26
|
AutomatedCuration,
|
27
|
-
INTEGRATION_GUIDS
|
27
|
+
INTEGRATION_GUIDS,
|
28
28
|
)
|
29
29
|
|
30
30
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
31
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
32
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
33
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
34
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
31
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
32
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
33
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
34
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
35
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
36
|
+
)
|
37
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
38
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
39
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
40
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
41
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
42
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
43
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
44
|
+
|
45
|
+
|
46
|
+
def display_catalog_targets(
|
47
|
+
connector: str,
|
48
|
+
view_server: str = EGERIA_VIEW_SERVER,
|
49
|
+
view_url: str = EGERIA_VIEW_SERVER_URL,
|
50
|
+
user: str = EGERIA_USER,
|
51
|
+
user_pass: str = EGERIA_USER_PASSWORD,
|
52
|
+
paging: bool = True,
|
53
|
+
jupyter: bool = EGERIA_JUPYTER,
|
54
|
+
width: int = EGERIA_WIDTH,
|
55
|
+
):
|
56
|
+
"""Display catalog targets for the specified connector as a table.
|
57
|
+
|
58
|
+
Parameters
|
59
|
+
----------
|
60
|
+
connector : str
|
61
|
+
The connector to retrieve catalog targets for.
|
62
|
+
view_server : str
|
63
|
+
The Egeria view server name.
|
64
|
+
view_url : str
|
65
|
+
The URL for the Egeria view server.
|
66
|
+
user : str
|
67
|
+
The user name for authenticating with the Egeria server.
|
68
|
+
user_pass : str
|
69
|
+
The user password for authenticating with the Egeria server.
|
70
|
+
paging : bool, default is True
|
71
|
+
Whether to enable paging mode when displaying the table.
|
72
|
+
jupyter : bool
|
73
|
+
Indicates if the environment is a Jupyter notebook.
|
74
|
+
width : int
|
75
|
+
The width of the console for table printing.
|
76
|
+
"""
|
47
77
|
console = Console(force_terminal=not jupyter, width=width, soft_wrap=True)
|
78
|
+
|
48
79
|
def generate_table() -> Table:
|
49
80
|
"""Make a new table."""
|
50
81
|
table = Table(
|
@@ -55,60 +86,67 @@ def display_catalog_targets(connector: str, server: str, url: str, username: str
|
|
55
86
|
title_style="bold white on black",
|
56
87
|
show_lines=True,
|
57
88
|
box=box.ROUNDED,
|
58
|
-
caption=f"Catalog Targets for '{
|
59
|
-
expand=True
|
89
|
+
caption=f"Catalog Targets for '{view_server}' @ Platform - {view_url}",
|
90
|
+
expand=True,
|
60
91
|
)
|
61
92
|
table.add_column("Name of Target")
|
62
93
|
table.add_column("Catalog Target")
|
63
94
|
|
64
95
|
# table.add_column("Relationship GUID", no_wrap=True)
|
65
|
-
table.add_column(
|
66
|
-
table.add_column(
|
96
|
+
table.add_column("Configuration Properties")
|
97
|
+
table.add_column("Template Properties")
|
67
98
|
table.add_column("Operational Instructions", max_width=20)
|
68
99
|
# table.add_column("Delete Method")
|
69
100
|
|
70
101
|
if type(cat_targets) is list:
|
71
102
|
for target in cat_targets:
|
72
|
-
target_name = target.get(
|
73
|
-
target_source = target.get(
|
74
|
-
target_rel = target.get(
|
75
|
-
target_sync = target.get(
|
76
|
-
target_delete = target.get(
|
103
|
+
target_name = target.get("catalogTargetName", "---")
|
104
|
+
target_source = target.get("metadataSourceQualifiedName", "---")
|
105
|
+
target_rel = target.get("relationshipGUID", "---")
|
106
|
+
target_sync = target.get("permittedSynchronization")
|
107
|
+
target_delete = target.get("deleteMethod", "---")
|
77
108
|
op_instruct = f"* {target_sync}\n* {target_delete}"
|
78
109
|
op_instruct_out = Markdown(op_instruct)
|
79
110
|
# target_guid = target['catalogTargetElement']['guid']
|
80
|
-
connector_unique = target[
|
111
|
+
connector_unique = target["catalogTargetElement"]["uniqueName"]
|
81
112
|
|
82
|
-
cat_target_out = Markdown(
|
83
|
-
|
113
|
+
cat_target_out = Markdown(
|
114
|
+
f"* Target Name: {target_name}\n* Target Source: {target_source}\n"
|
115
|
+
f"* Relationship Guid: {target_rel}"
|
116
|
+
)
|
84
117
|
|
85
|
-
config_props = target.get(
|
118
|
+
config_props = target.get("configurationProperties", "---")
|
86
119
|
if type(config_props) is dict:
|
87
|
-
config_props_md =
|
120
|
+
config_props_md = ""
|
88
121
|
for prop in config_props:
|
89
122
|
config_props_md += f"* {prop}: {config_props[prop]}\n"
|
90
123
|
config_props_out = Markdown(config_props_md)
|
91
124
|
else:
|
92
|
-
config_props_out =
|
125
|
+
config_props_out = "---"
|
93
126
|
|
94
|
-
template_props = target.get(
|
127
|
+
template_props = target.get("templateProperties", "---")
|
95
128
|
if type(template_props) is dict:
|
96
|
-
template_props_md =
|
129
|
+
template_props_md = ""
|
97
130
|
for prop in template_props:
|
98
131
|
template_props_md += f"* {prop}: {template_props[prop]}\n"
|
99
132
|
template_props_out = Markdown(template_props_md)
|
100
133
|
else:
|
101
|
-
template_props_out =
|
134
|
+
template_props_out = "---"
|
102
135
|
|
103
136
|
table.add_row(
|
104
|
-
connector_unique,
|
105
|
-
|
137
|
+
connector_unique,
|
138
|
+
cat_target_out,
|
139
|
+
config_props_out,
|
140
|
+
template_props_out,
|
141
|
+
op_instruct_out,
|
142
|
+
)
|
106
143
|
|
107
144
|
return table
|
108
145
|
|
109
146
|
try:
|
110
|
-
a_client = AutomatedCuration(
|
111
|
-
token = a_client.create_egeria_bearer_token(
|
147
|
+
a_client = AutomatedCuration(view_server, view_url, user)
|
148
|
+
token = a_client.create_egeria_bearer_token(user, user_pass)
|
149
|
+
connector = connector.strip()
|
112
150
|
if connector not in INTEGRATION_GUIDS.keys():
|
113
151
|
raise Exception
|
114
152
|
|
@@ -118,7 +156,11 @@ def display_catalog_targets(connector: str, server: str, url: str, username: str
|
|
118
156
|
with console.pager(styles=True):
|
119
157
|
console.print(generate_table(), soft_wrap=True)
|
120
158
|
|
121
|
-
except (
|
159
|
+
except (
|
160
|
+
InvalidParameterException,
|
161
|
+
PropertyServerException,
|
162
|
+
UserNotAuthorizedException,
|
163
|
+
) as e:
|
122
164
|
print_exception_response(e)
|
123
165
|
except Exception as e:
|
124
166
|
print(f"\n\n===> Perhaps integration connector {connector} is not known?\n\n")
|
@@ -146,8 +188,12 @@ def main():
|
|
146
188
|
width = args.width if args.width is not None else EGERIA_WIDTH
|
147
189
|
|
148
190
|
try:
|
149
|
-
connector = Prompt.ask(
|
150
|
-
|
191
|
+
connector = Prompt.ask(
|
192
|
+
"Enter the Integration Connector to list catalog targets for"
|
193
|
+
).strip()
|
194
|
+
display_catalog_targets(
|
195
|
+
connector, server, url, userid, user_pass, jupyter, width=width
|
196
|
+
)
|
151
197
|
|
152
198
|
except KeyboardInterrupt:
|
153
199
|
pass
|
@@ -10,7 +10,7 @@ pyegeria/automated_curation_omvs.py,sha256=BwNuF7XQJAV-POvzaWwFh0TS5yRnHZZPhlayv
|
|
10
10
|
pyegeria/classification_manager_omvs.py,sha256=3yInuRy7Cf43oSFZ8BuzcIgtGSm5BfvlKYqtWKRMlPU,186678
|
11
11
|
pyegeria/collection_manager_omvs.py,sha256=kye2kjthNnmwxMZhHQKV0xoHbxcNPWjNzRAYOItj_gY,99201
|
12
12
|
pyegeria/commands/README.md,sha256=zNfWZppDxoKqTJeRtcewzku9z1m6_hKacCyQUQw1iq4,1974
|
13
|
-
pyegeria/commands/__init__.py,sha256=
|
13
|
+
pyegeria/commands/__init__.py,sha256=IBYAvBbuGneZ06YSFjZsU-Zxx-b-Qo4ZV_Vd4zz4AI0,844
|
14
14
|
pyegeria/commands/cat/README.md,sha256=-aaAnIT2fcfU63vajgB-RzQk4l4yFdhkyVfSaTPiqRY,967
|
15
15
|
pyegeria/commands/cat/__init__.py,sha256=3LHTWeyxLdFGDhWVTBzgJ6Y_9b2pM5CO2-kbsUASv4M,300
|
16
16
|
pyegeria/commands/cat/get_asset_graph.py,sha256=4AO4KlCgb7vbMihJK7W_GAnrd4J9sKwc4kXxa2ZrRW4,12447
|
@@ -51,7 +51,7 @@ pyegeria/commands/my/todo_actions.py,sha256=iazoRhsQ9aecCwJk6r4lWRP-mPD2t-YGU_Gm
|
|
51
51
|
pyegeria/commands/ops/README.md,sha256=PJsSDcvMv6E6og6y-cwvxFX5lhCII0UCwgKiM1T17MQ,1595
|
52
52
|
pyegeria/commands/ops/__init__.py,sha256=GyDGBYodxuJ-7k87z2farDs9vhR__RNrYeAe94HWGPM,764
|
53
53
|
pyegeria/commands/ops/gov_server_actions.py,sha256=zdawX-yfPFakc3Xf5V6j7e-csMbRLzJ-tdt_FkIhG34,5689
|
54
|
-
pyegeria/commands/ops/list_catalog_targets.py,sha256=
|
54
|
+
pyegeria/commands/ops/list_catalog_targets.py,sha256=9DgHbPmUInWPjdEp98aQjfcZbDjs40ml0NQt9PG94y0,7688
|
55
55
|
pyegeria/commands/ops/load_archive.py,sha256=ZsJmQ-2cywsiO5RYHQXFF72wrlBK18jvAkyQ8N-nSp4,2744
|
56
56
|
pyegeria/commands/ops/monitor_asset_events.py,sha256=cjdlVqE0XYnoRW3aorNbsVkjByDXefPBnllaZLelGls,3838
|
57
57
|
pyegeria/commands/ops/monitor_engine_activity.py,sha256=8RX-3znYx-4oWsI8nGFwODkWZ5Fc4qPttam_twymcjs,9856
|
@@ -108,8 +108,8 @@ pyegeria/template_manager_omvs.py,sha256=heqbKeum5hPCHap4r1RUZU8YB3QaQlxVNbq4GZi
|
|
108
108
|
pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
|
109
109
|
pyegeria/valid_metadata_omvs.py,sha256=tfCGXed5LLt59YA8uZNNtd9UJ-lRZfPU_uZxK31Yux0,65069
|
110
110
|
pyegeria/x_action_author_omvs.py,sha256=xu1IQ0YbhIKi17C5a7Aq9u1Az2czwahNPpX9czmyVxE,6454
|
111
|
-
pyegeria-1.5.1.1.
|
112
|
-
pyegeria-1.5.1.1.
|
113
|
-
pyegeria-1.5.1.1.
|
114
|
-
pyegeria-1.5.1.1.
|
115
|
-
pyegeria-1.5.1.1.
|
111
|
+
pyegeria-1.5.1.1.41.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
112
|
+
pyegeria-1.5.1.1.41.dist-info/METADATA,sha256=2lAWE0yxT09ZUzU9l43_gmnpXWeAFkohHyPdLGPjkY8,2998
|
113
|
+
pyegeria-1.5.1.1.41.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
114
|
+
pyegeria-1.5.1.1.41.dist-info/entry_points.txt,sha256=2aD67PkxIfXQqrZfgEwEYdfohKG9zmE5LmuDGURaIDw,5051
|
115
|
+
pyegeria-1.5.1.1.41.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|