pyegeria 1.5.1.0.15__py3-none-any.whl → 1.5.1.0.17__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.
- commands/cat/list_deployed_database_schemas.py +1 -13
- commands/cli/egeria.py +1 -1
- commands/cli/egeria_cat.py +1 -1
- {pyegeria-1.5.1.0.15.dist-info → pyegeria-1.5.1.0.17.dist-info}/METADATA +1 -1
- {pyegeria-1.5.1.0.15.dist-info → pyegeria-1.5.1.0.17.dist-info}/RECORD +8 -9
- commands/cat/old_list_deployed_database_schemas.py +0 -224
- {pyegeria-1.5.1.0.15.dist-info → pyegeria-1.5.1.0.17.dist-info}/LICENSE +0 -0
- {pyegeria-1.5.1.0.15.dist-info → pyegeria-1.5.1.0.17.dist-info}/WHEEL +0 -0
- {pyegeria-1.5.1.0.15.dist-info → pyegeria-1.5.1.0.17.dist-info}/entry_points.txt +0 -0
@@ -114,15 +114,6 @@ def list_deployed_database_schemas(
|
|
114
114
|
continue
|
115
115
|
|
116
116
|
el_name = element["properties"].get("name", "---")
|
117
|
-
# el_type = header["type"]["typeName"]
|
118
|
-
# el_home = header["origin"]["homeMetadataCollectionName"]
|
119
|
-
# el_create_time = header["versions"]["createTime"][:-10]
|
120
|
-
# el_created_by = header["versions"]["createdBy"]
|
121
|
-
# el_created_md = (
|
122
|
-
# f"* **Created By**: {el_created_by}\n"
|
123
|
-
# f"* **Created Time**: {el_create_time}"
|
124
|
-
# )
|
125
|
-
# el_created_out = Markdown(el_created_md)
|
126
117
|
|
127
118
|
el_guid = header["guid"]
|
128
119
|
|
@@ -148,9 +139,6 @@ def list_deployed_database_schemas(
|
|
148
139
|
|
149
140
|
# get the schema properties
|
150
141
|
el_props_md = make_prop_md(element["properties"])
|
151
|
-
# el_props_md = ""
|
152
|
-
# for prop in element["properties"].keys():
|
153
|
-
# el_props_md += f"* **{prop}**: {element['properties'][prop]}\n"
|
154
142
|
|
155
143
|
# Now get property facets related to us
|
156
144
|
el_facets = c_client.get_related_elements(
|
@@ -189,7 +177,7 @@ def list_deployed_database_schemas(
|
|
189
177
|
# spacer = "---\n"
|
190
178
|
# elif count > len_els:
|
191
179
|
# spacer = ""
|
192
|
-
rel_el_md = f"{rel_el_md}\n* **{rel_type}**:\n\t{rel_guid}\n{props_md}{spacer}"
|
180
|
+
# rel_el_md = f"{rel_el_md}\n* **{rel_type}**:\n\t{rel_guid}\n{props_md}{spacer}"
|
193
181
|
if count == len_els:
|
194
182
|
rel_el_md = rel_el_md[:-4]
|
195
183
|
rel_el_out = Markdown(rel_el_md)
|
commands/cli/egeria.py
CHANGED
@@ -32,7 +32,7 @@ from commands.my.list_my_profile import display_my_profile
|
|
32
32
|
from commands.my.list_my_roles import display_my_roles
|
33
33
|
from commands.my.monitor_my_todos import display_my_todos
|
34
34
|
from commands.my.monitor_open_todos import display_todos
|
35
|
-
from commands.cat.
|
35
|
+
from commands.cat.list_deployed_database_schemas import (
|
36
36
|
list_deployed_database_schemas,
|
37
37
|
)
|
38
38
|
from commands.cat.list_deployed_catalogs import list_deployed_catalogs
|
commands/cli/egeria_cat.py
CHANGED
@@ -23,7 +23,7 @@ from commands.cat.list_archives import display_archive_list
|
|
23
23
|
from commands.cat.list_assets import display_assets
|
24
24
|
from commands.cat.list_cert_types import display_certifications
|
25
25
|
from commands.cat.list_deployed_catalogs import list_deployed_catalogs
|
26
|
-
from commands.cat.
|
26
|
+
from commands.cat.list_deployed_database_schemas import (
|
27
27
|
list_deployed_database_schemas,
|
28
28
|
)
|
29
29
|
from commands.cat.list_deployed_databases import list_deployed_databases
|
@@ -11,7 +11,7 @@ commands/cat/list_archives.py,sha256=FEZ2XYnQIWo2PztWqnj6unn0pbblPU0-bMbTyI3csv4
|
|
11
11
|
commands/cat/list_assets.py,sha256=bNwSaBDz661hfnc2Rn4j4HPHAugKvz0XwN9L1m4FVQk,6529
|
12
12
|
commands/cat/list_cert_types.py,sha256=mbCls_EqC5JKG5rvS4o69k7KgZ6aNXlcqoJ3DtHsTFA,7127
|
13
13
|
commands/cat/list_deployed_catalogs.py,sha256=eG8K-d7BijD34el_yVx9yfnLJdfwTUiJVxd-gcGwo7k,7157
|
14
|
-
commands/cat/list_deployed_database_schemas.py,sha256=
|
14
|
+
commands/cat/list_deployed_database_schemas.py,sha256=HNAR8qXU7FWUxPJw6yBxmlsJ_eVXqsD_DrswKmY1iv0,8824
|
15
15
|
commands/cat/list_deployed_databases.py,sha256=HE8nG-mIlxa9iSUEH-n71o-G2a4ss1Zzalq7YJQIix0,6668
|
16
16
|
commands/cat/list_glossary.py,sha256=tUtQQoTGTlDLU-yFbfO3zjiJC9QyEJfg8NxnGCo2mnI,5811
|
17
17
|
commands/cat/list_projects.py,sha256=Jzs-DtIpPhCH-gY4PYT6mnRBWnEf4m18TFfcw8UymNU,8011
|
@@ -19,10 +19,9 @@ commands/cat/list_relationships.py,sha256=U9f78cOi4HyaacqNaFSMq_7rRxVcEczvwPv468
|
|
19
19
|
commands/cat/list_tech_types.py,sha256=20T4v6L5qeebSsaL1nGkFMDAIsy2W3A3SMm1RcgFoh0,4609
|
20
20
|
commands/cat/list_todos.py,sha256=iPxHRyW3X5tiREio4TUOwRPvNPjU0gxm3pVnUI79ir4,6542
|
21
21
|
commands/cat/list_user_ids.py,sha256=7JinL7rknPbGusIb8ikXKEaV1vvbuvx_WWtbmlfS_DY,5093
|
22
|
-
commands/cat/old_list_deployed_database_schemas.py,sha256=R3TtZ77pVbjLYNg08CIBaHqe-p6jr1TI1uuZryVCJ68,8232
|
23
22
|
commands/cli/__init__.py,sha256=hpTVSMP2gnPRhcAZPdeUEsQ-eaDySlXlk239dNWYmng,292
|
24
|
-
commands/cli/egeria.py,sha256=
|
25
|
-
commands/cli/egeria_cat.py,sha256=
|
23
|
+
commands/cli/egeria.py,sha256=5ktUIbf5PIuHUQbcx_-HpI3Xolx38euvLT25AQhBWvE,31265
|
24
|
+
commands/cli/egeria_cat.py,sha256=NwPCRTIjwQtna5vvjInT6L0krwp2c6k-Fm-oxN6qrnw,14800
|
26
25
|
commands/cli/egeria_my.py,sha256=9zIpUDLeA_R-0rgCSQfEZTtVmkxPcEAsYcCTn1wQFrE,6181
|
27
26
|
commands/cli/egeria_ops.py,sha256=fxDXYWXRhexx06PdSLCp2FhgUtS13NdDpyg7ea775fc,11531
|
28
27
|
commands/cli/egeria_tech.py,sha256=eTDHTHDVEYmr6gUPGfido_Uf7Fec0Nuyxlkhg4KAMAw,13160
|
@@ -102,8 +101,8 @@ pyegeria/server_operations.py,sha256=ciH890hYT85YQ6OpByn4w7s3a7TtvWZpIG5rkRqbcI0
|
|
102
101
|
pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
|
103
102
|
pyegeria/valid_metadata_omvs.py,sha256=tfCGXed5LLt59YA8uZNNtd9UJ-lRZfPU_uZxK31Yux0,65069
|
104
103
|
pyegeria/x_action_author_omvs.py,sha256=xu1IQ0YbhIKi17C5a7Aq9u1Az2czwahNPpX9czmyVxE,6454
|
105
|
-
pyegeria-1.5.1.0.
|
106
|
-
pyegeria-1.5.1.0.
|
107
|
-
pyegeria-1.5.1.0.
|
108
|
-
pyegeria-1.5.1.0.
|
109
|
-
pyegeria-1.5.1.0.
|
104
|
+
pyegeria-1.5.1.0.17.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
105
|
+
pyegeria-1.5.1.0.17.dist-info/METADATA,sha256=6WZLgNqYHODH9WPBw7Mu0qSlxvjvckzePfF6NoSDtbU,2998
|
106
|
+
pyegeria-1.5.1.0.17.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
107
|
+
pyegeria-1.5.1.0.17.dist-info/entry_points.txt,sha256=Pc5kHnxv-vbRpwVMxSSWl66vmf7EZjgzf7nZzz1ow3M,4002
|
108
|
+
pyegeria-1.5.1.0.17.dist-info/RECORD,,
|
@@ -1,224 +0,0 @@
|
|
1
|
-
"""This creates a templates guid file from the core metadata archive"""
|
2
|
-
from rich.markdown import Markdown
|
3
|
-
from rich.prompt import Prompt
|
4
|
-
import os
|
5
|
-
import argparse
|
6
|
-
import time
|
7
|
-
import sys
|
8
|
-
from rich import box
|
9
|
-
from rich.console import Console
|
10
|
-
from rich.table import Table
|
11
|
-
|
12
|
-
from pyegeria import (
|
13
|
-
InvalidParameterException,
|
14
|
-
PropertyServerException,
|
15
|
-
UserNotAuthorizedException,
|
16
|
-
print_exception_response,
|
17
|
-
EgeriaTech,
|
18
|
-
)
|
19
|
-
|
20
|
-
|
21
|
-
console = Console()
|
22
|
-
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
23
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
24
|
-
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
25
|
-
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
26
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
27
|
-
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
28
|
-
)
|
29
|
-
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
30
|
-
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
31
|
-
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
32
|
-
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
33
|
-
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
34
|
-
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
35
|
-
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
36
|
-
|
37
|
-
|
38
|
-
def check_if_template(header: dict) -> bool:
|
39
|
-
"""Check if the the template classification is set"""
|
40
|
-
classifications = header.get("classifications", None)
|
41
|
-
if classifications is None:
|
42
|
-
return False
|
43
|
-
for c in classifications:
|
44
|
-
if c["type"]["typeName"] == "Template":
|
45
|
-
return True
|
46
|
-
return False
|
47
|
-
|
48
|
-
|
49
|
-
def list_deployed_database_schemas(
|
50
|
-
db_name: str,
|
51
|
-
server: str,
|
52
|
-
url: str,
|
53
|
-
username: str,
|
54
|
-
password: str,
|
55
|
-
jupyter: bool = EGERIA_JUPYTER,
|
56
|
-
width: int = EGERIA_WIDTH,
|
57
|
-
):
|
58
|
-
c_client = EgeriaTech(server, url, user_id=username, user_pwd=password)
|
59
|
-
token = c_client.create_egeria_bearer_token()
|
60
|
-
|
61
|
-
def generate_table() -> Table:
|
62
|
-
"""Make a new table."""
|
63
|
-
table = Table(
|
64
|
-
caption=f"Databases found: {url} - {server} @ {time.asctime()}",
|
65
|
-
style="bold bright_white on black",
|
66
|
-
row_styles=["bold bright_white on black"],
|
67
|
-
header_style="white on dark_blue",
|
68
|
-
title_style="bold bright_white on black",
|
69
|
-
caption_style="white on black",
|
70
|
-
show_lines=True,
|
71
|
-
box=box.ROUNDED,
|
72
|
-
# title=f"Elements for Open Metadata Type: '{om_type}' ",
|
73
|
-
expand=True,
|
74
|
-
# width=500
|
75
|
-
)
|
76
|
-
|
77
|
-
table.add_column("Schema in Catalog")
|
78
|
-
table.add_column("Schema Properties")
|
79
|
-
|
80
|
-
# table.add_column("Home Store")
|
81
|
-
# table.add_column("GUID", width=38, no_wrap=True)
|
82
|
-
# table.add_column("Properties")
|
83
|
-
table.add_column("Cataloged Resource")
|
84
|
-
|
85
|
-
om_type = "DeployedDatabaseSchema"
|
86
|
-
|
87
|
-
# get the guid for the database or catalog
|
88
|
-
|
89
|
-
if db_name in (None, "*"):
|
90
|
-
dbs = c_client.get_elements(om_type)
|
91
|
-
else:
|
92
|
-
db_guid = c_client.get_guid_for_name(db_name)
|
93
|
-
dbs = c_client.get_elements_by_classification_with_property_value(
|
94
|
-
"Anchors", db_guid, ["anchorGUID"], om_type
|
95
|
-
)
|
96
|
-
|
97
|
-
if type(dbs) is not list:
|
98
|
-
print("No instances found")
|
99
|
-
sys.exit(1)
|
100
|
-
|
101
|
-
for element in dbs:
|
102
|
-
header = element["elementHeader"]
|
103
|
-
|
104
|
-
if check_if_template(header):
|
105
|
-
continue
|
106
|
-
|
107
|
-
el_name = element["properties"].get("name", "---")
|
108
|
-
el_type = header["type"]["typeName"]
|
109
|
-
el_home = header["origin"]["homeMetadataCollectionName"]
|
110
|
-
el_create_time = header["versions"]["createTime"][:-10]
|
111
|
-
el_created_by = header["versions"]["createdBy"]
|
112
|
-
el_created_md = (
|
113
|
-
f"* **Created By**: {el_created_by}\n"
|
114
|
-
f"* **Created Time**: {el_create_time}"
|
115
|
-
)
|
116
|
-
el_created_out = Markdown(el_created_md)
|
117
|
-
|
118
|
-
el_guid = header["guid"]
|
119
|
-
|
120
|
-
el_classification = header["classifications"]
|
121
|
-
for c in el_classification:
|
122
|
-
if c["type"]["typeName"] == "Anchors":
|
123
|
-
el_anchor_guid = c["classificationProperties"]["anchorGUID"]
|
124
|
-
el_anchor_type_name = c["classificationProperties"][
|
125
|
-
"anchorTypeName"
|
126
|
-
]
|
127
|
-
if el_anchor_type_name == "Catalog":
|
128
|
-
el_cat = c_client.get_element_by_guid(el_anchor_guid)
|
129
|
-
el_cat_name = el_cat["properties"].get("name", None)
|
130
|
-
if el_cat_name is None:
|
131
|
-
el_cat_name = el_cat["properties"].get(
|
132
|
-
"qualifiedName", "---"
|
133
|
-
)
|
134
|
-
el_cat_guid = el_cat["elementHeader"]["guid"]
|
135
|
-
el_schema_id = (
|
136
|
-
f"{el_name}\n{el_guid}\n\n\t\tin\n\n{el_cat_name}\n{el_cat_guid}"
|
137
|
-
)
|
138
|
-
el_props_md = ""
|
139
|
-
for prop in element["properties"].keys():
|
140
|
-
el_props_md += f"* **{prop}**: {element['properties'][prop]}\n"
|
141
|
-
el_props_out = Markdown(el_props_md)
|
142
|
-
|
143
|
-
rel_elements = c_client.get_elements_by_property_value(
|
144
|
-
el_guid, ["anchorGUID"]
|
145
|
-
)
|
146
|
-
schema_md = ""
|
147
|
-
count = 0
|
148
|
-
rel_el_out = ""
|
149
|
-
if type(rel_elements) is list:
|
150
|
-
len_els = len(rel_elements)
|
151
|
-
rel_el_md = ""
|
152
|
-
spacer = "---\n"
|
153
|
-
for rel_element in rel_elements:
|
154
|
-
count += 1
|
155
|
-
rel_type = rel_element["elementHeader"]["type"]["typeName"]
|
156
|
-
rel_guid = rel_element["elementHeader"]["guid"]
|
157
|
-
rel_props = rel_element["properties"]
|
158
|
-
props_md = ""
|
159
|
-
for key in rel_props.keys():
|
160
|
-
props_md += f"\t* **{key}**: {rel_props[key]}\n"
|
161
|
-
rel_el_md = f"{rel_el_md}\n* **{rel_type}**:\n\t{rel_guid}\n{props_md}{spacer}"
|
162
|
-
# if count > 1 and count < len_els:
|
163
|
-
# spacer = "---\n"
|
164
|
-
# elif count > len_els:
|
165
|
-
# spacer = ""
|
166
|
-
rel_el_md = f"{rel_el_md}\n* **{rel_type}**:\n\t{rel_guid}\n{props_md}{spacer}"
|
167
|
-
if count == len_els:
|
168
|
-
rel_el_md = rel_el_md[:-4]
|
169
|
-
rel_el_out = Markdown(rel_el_md)
|
170
|
-
|
171
|
-
table.add_row(
|
172
|
-
el_schema_id,
|
173
|
-
# el_type,
|
174
|
-
# el_created_out,
|
175
|
-
# el_home,
|
176
|
-
# el_guid,
|
177
|
-
el_props_out,
|
178
|
-
rel_el_out,
|
179
|
-
)
|
180
|
-
|
181
|
-
return table
|
182
|
-
|
183
|
-
try:
|
184
|
-
console = Console(width=width, force_terminal=not jupyter)
|
185
|
-
|
186
|
-
with console.pager(styles=True):
|
187
|
-
console.print(generate_table())
|
188
|
-
|
189
|
-
except (
|
190
|
-
InvalidParameterException,
|
191
|
-
PropertyServerException,
|
192
|
-
UserNotAuthorizedException,
|
193
|
-
) as e:
|
194
|
-
print_exception_response(e)
|
195
|
-
print("\n\nPerhaps the type name isn't known")
|
196
|
-
finally:
|
197
|
-
c_client.close_session()
|
198
|
-
|
199
|
-
|
200
|
-
def main():
|
201
|
-
parser = argparse.ArgumentParser()
|
202
|
-
parser.add_argument("--server", help="Name of the server to display status for")
|
203
|
-
parser.add_argument("--url", help="URL Platform to connect to")
|
204
|
-
parser.add_argument("--userid", help="User Id")
|
205
|
-
parser.add_argument("--password", help="Password")
|
206
|
-
|
207
|
-
args = parser.parse_args()
|
208
|
-
|
209
|
-
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
210
|
-
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
211
|
-
userid = args.userid if args.userid is not None else EGERIA_USER
|
212
|
-
password = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
213
|
-
|
214
|
-
try:
|
215
|
-
db_name = Prompt.ask(
|
216
|
-
"Enter the name of a database/catalog to retrieve schemas for", default="*"
|
217
|
-
)
|
218
|
-
list_deployed_database_schemas(db_name, server, url, userid, password)
|
219
|
-
except KeyboardInterrupt:
|
220
|
-
pass
|
221
|
-
|
222
|
-
|
223
|
-
if __name__ == "__main__":
|
224
|
-
main()
|
File without changes
|
File without changes
|
File without changes
|