pyegeria 1.5.1.1.41__py3-none-any.whl → 1.5.1.1.42__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/tech/table_tech_templates.py +115 -52
- {pyegeria-1.5.1.1.41.dist-info → pyegeria-1.5.1.1.42.dist-info}/METADATA +1 -1
- {pyegeria-1.5.1.1.41.dist-info → pyegeria-1.5.1.1.42.dist-info}/RECORD +6 -6
- {pyegeria-1.5.1.1.41.dist-info → pyegeria-1.5.1.1.42.dist-info}/LICENSE +0 -0
- {pyegeria-1.5.1.1.41.dist-info → pyegeria-1.5.1.1.42.dist-info}/WHEEL +0 -0
- {pyegeria-1.5.1.1.41.dist-info → pyegeria-1.5.1.1.42.dist-info}/entry_points.txt +0 -0
@@ -19,38 +19,61 @@ from pyegeria import (
|
|
19
19
|
PropertyServerException,
|
20
20
|
UserNotAuthorizedException,
|
21
21
|
print_exception_response,
|
22
|
-
RegisteredInfo
|
22
|
+
RegisteredInfo,
|
23
23
|
)
|
24
24
|
from textual.widgets import DataTable
|
25
25
|
|
26
26
|
console = Console()
|
27
27
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
28
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
29
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
30
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
31
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
28
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
29
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
30
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
31
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
32
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
33
|
+
)
|
34
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
35
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
36
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
37
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
38
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
39
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
40
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
41
|
+
|
42
|
+
# def add_row(table: Union[Table,DataTable], name: str, template_name:str, template_guid: str,
|
43
|
+
# placeholder_table: Table) -> Table | DataTable:
|
44
|
+
# if isinstance(table, Table):
|
45
|
+
# table.add_row(name, template_name, template_guid, placeholder_table)
|
46
|
+
# elif isinstance(table, DataTable):
|
47
|
+
# table.add_row(name, template_name, template_guid, placeholder_table)
|
48
|
+
#
|
49
|
+
# return table
|
50
|
+
|
51
|
+
|
52
|
+
def add_row(
|
53
|
+
table: Union[Table, DataTable],
|
54
|
+
name: str,
|
55
|
+
template_name: str,
|
56
|
+
template_guid: str,
|
57
|
+
placeholder_table: Table,
|
58
|
+
) -> Table | DataTable:
|
59
|
+
if placeholder_table:
|
45
60
|
table.add_row(name, template_name, template_guid, placeholder_table)
|
46
|
-
|
61
|
+
else:
|
62
|
+
table.add_row(name, template_name, template_guid)
|
47
63
|
return table
|
48
64
|
|
49
|
-
def display_templates_spec(search_string:str, server: str,
|
50
|
-
url: str, username: str, password: str, jupyter:bool=EGERIA_JUPYTER,
|
51
|
-
width:int = EGERIA_WIDTH, data_table: bool = False
|
52
|
-
)-> Table | DataTable:
|
53
65
|
|
66
|
+
def display_templates_spec(
|
67
|
+
search_string: str,
|
68
|
+
server: str,
|
69
|
+
url: str,
|
70
|
+
username: str,
|
71
|
+
password: str,
|
72
|
+
jupyter: bool = EGERIA_JUPYTER,
|
73
|
+
width: int = EGERIA_WIDTH,
|
74
|
+
data_table: bool = False,
|
75
|
+
placeholders: bool = False,
|
76
|
+
) -> Table | DataTable:
|
54
77
|
a_client = AutomatedCuration(server, url, username)
|
55
78
|
nest_asyncio.apply()
|
56
79
|
token = a_client.create_egeria_bearer_token(username, password)
|
@@ -78,21 +101,21 @@ def display_templates_spec(search_string:str, server: str,
|
|
78
101
|
|
79
102
|
table.add_column("Name", width=20)
|
80
103
|
table.add_column("Template Name", width=20)
|
81
|
-
table.add_column("Template GUID", width
|
82
|
-
|
83
|
-
|
104
|
+
table.add_column("Template GUID", width=38, no_wrap=True)
|
105
|
+
if placeholders:
|
106
|
+
table.add_column("Placeholders")
|
84
107
|
|
85
108
|
if type(tech_list) is list:
|
86
109
|
for item in tech_list:
|
87
|
-
if
|
110
|
+
if "deployedImplementationType" not in item["qualifiedName"]:
|
88
111
|
continue
|
89
|
-
|
90
|
-
placeholder_table
|
91
|
-
placeholder_table.add_column("
|
92
|
-
placeholder_table.add_column("
|
93
|
-
placeholder_table.add_column("
|
94
|
-
placeholder_table.add_column("
|
95
|
-
|
112
|
+
# if placeholders:
|
113
|
+
# placeholder_table = Table(expand=False, show_lines=True)
|
114
|
+
# placeholder_table.add_column("Name", width = 20,no_wrap=True)
|
115
|
+
# placeholder_table.add_column("Type", width = 10)
|
116
|
+
# placeholder_table.add_column("Required", width = 10)
|
117
|
+
# placeholder_table.add_column("Example", width = 20)
|
118
|
+
# placeholder_table.add_column("Description", width = 40)
|
96
119
|
|
97
120
|
name = item.get("name", "none")
|
98
121
|
|
@@ -106,22 +129,51 @@ def display_templates_spec(search_string:str, server: str,
|
|
106
129
|
for template in templates:
|
107
130
|
template_name = template.get("name", None)
|
108
131
|
|
109
|
-
template_name =
|
132
|
+
template_name = (
|
133
|
+
f"{name}_Template"
|
134
|
+
if template_name is None
|
135
|
+
else template_name
|
136
|
+
)
|
110
137
|
|
111
138
|
specification = template["specification"]["placeholderProperty"]
|
112
139
|
template_guid = template["relatedElement"]["guid"]
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
140
|
+
if placeholders:
|
141
|
+
placeholder_table = Table(expand=False, show_lines=True)
|
142
|
+
placeholder_table.add_column("Name", width=20, no_wrap=True)
|
143
|
+
placeholder_table.add_column("Type", width=10)
|
144
|
+
placeholder_table.add_column("Required", width=10)
|
145
|
+
placeholder_table.add_column("Example", width=20)
|
146
|
+
placeholder_table.add_column("Description", width=40)
|
147
|
+
|
148
|
+
for placeholder in specification:
|
149
|
+
placeholder_data_type = placeholder["dataType"]
|
150
|
+
placeholder_description = placeholder["description"]
|
151
|
+
placeholder_name = placeholder[
|
152
|
+
"placeholderPropertyName"
|
153
|
+
]
|
154
|
+
placeholder_required = placeholder["required"]
|
155
|
+
placeholder_example = placeholder.get("example", None)
|
156
|
+
placeholder_table.add_row(
|
157
|
+
placeholder_name,
|
158
|
+
placeholder_data_type,
|
159
|
+
placeholder_required,
|
160
|
+
placeholder_example,
|
161
|
+
placeholder_description,
|
162
|
+
)
|
163
|
+
table = add_row(
|
164
|
+
table,
|
165
|
+
name,
|
166
|
+
template_name,
|
167
|
+
template_guid,
|
168
|
+
placeholder_table,
|
169
|
+
)
|
170
|
+
else:
|
171
|
+
table = add_row(
|
172
|
+
table, name, template_name, template_guid, None
|
173
|
+
)
|
122
174
|
|
123
175
|
# table.add_row(name, template_name, template_guid, placeholder_table)
|
124
|
-
table = add_row(table, name, template_name, template_guid, placeholder_table)
|
176
|
+
# table = add_row(table, name, template_name, template_guid, placeholder_table)
|
125
177
|
|
126
178
|
return table
|
127
179
|
else:
|
@@ -137,7 +189,11 @@ def display_templates_spec(search_string:str, server: str,
|
|
137
189
|
with console.pager(styles=True):
|
138
190
|
console.print(generate_table(data_table))
|
139
191
|
|
140
|
-
except (
|
192
|
+
except (
|
193
|
+
InvalidParameterException,
|
194
|
+
PropertyServerException,
|
195
|
+
UserNotAuthorizedException,
|
196
|
+
) as e:
|
141
197
|
print_exception_response(e)
|
142
198
|
assert e.related_http_code != "200", "Invalid parameters"
|
143
199
|
finally:
|
@@ -160,14 +216,21 @@ def main():
|
|
160
216
|
guid = None
|
161
217
|
|
162
218
|
try:
|
163
|
-
search_string = Prompt.ask(
|
164
|
-
|
165
|
-
|
219
|
+
search_string = Prompt.ask(
|
220
|
+
"Enter the technology you are searching for:", default="*"
|
221
|
+
)
|
222
|
+
display_templates_spec(
|
223
|
+
search_string,
|
224
|
+
server,
|
225
|
+
url,
|
226
|
+
userid,
|
227
|
+
password,
|
228
|
+
data_table=False,
|
229
|
+
placeholders=True,
|
230
|
+
)
|
231
|
+
except KeyboardInterrupt:
|
166
232
|
pass
|
167
233
|
|
168
234
|
|
169
235
|
if __name__ == "__main__":
|
170
236
|
main()
|
171
|
-
|
172
|
-
|
173
|
-
|
@@ -84,7 +84,7 @@ pyegeria/commands/tech/list_related_specification.py,sha256=mWrKenXOskL4cl0DHjH2
|
|
84
84
|
pyegeria/commands/tech/list_relationship_types.py,sha256=BlVzrPznZXqMVLN2-2vYEVRGeYsiJrqXxIJEikobyoo,5875
|
85
85
|
pyegeria/commands/tech/list_tech_templates.py,sha256=FIeYWnJY2bVUrfDQBJX2bpkp5cU7uPak52eJtB4vVu4,14146
|
86
86
|
pyegeria/commands/tech/list_valid_metadata_values.py,sha256=N3D0_BmREPszgde3uvvYdfzq7DJ46uMOv2t1vtncGsw,6333
|
87
|
-
pyegeria/commands/tech/table_tech_templates.py,sha256=
|
87
|
+
pyegeria/commands/tech/table_tech_templates.py,sha256=_aWI4U8CMO0c2JdUxfqW7b2RQADMPUBvTulWk6m50VA,9318
|
88
88
|
pyegeria/commands/tech/x_list_related_elements.py,sha256=qBsf1619cecaMCTzG0MG22fAT32WNH2Z3CXrjo9z-5Y,5853
|
89
89
|
pyegeria/core_omag_server_config.py,sha256=EtHaPKyc9d6pwTgbnQqGwe5lSBMPIfJOlbJEa1zg1JA,94946
|
90
90
|
pyegeria/create_tech_guid_lists.py,sha256=HHkC6HW58EN1BiolrYSRqSE0JhPbTepOFzwtdwBxVaU,4640
|
@@ -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.42.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
112
|
+
pyegeria-1.5.1.1.42.dist-info/METADATA,sha256=F67TiVCEAVeXCtQuUIl1TA7pxBkEdX6Q2lgpQzNcpy0,2998
|
113
|
+
pyegeria-1.5.1.1.42.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
114
|
+
pyegeria-1.5.1.1.42.dist-info/entry_points.txt,sha256=2aD67PkxIfXQqrZfgEwEYdfohKG9zmE5LmuDGURaIDw,5051
|
115
|
+
pyegeria-1.5.1.1.42.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|