pyegeria 1.5.1.1.60__py3-none-any.whl → 5.2__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/__init__.py +2 -0
- pyegeria/_client.py +7 -2
- pyegeria/asset_catalog_omvs.py +34 -0
- pyegeria/classification_manager_omvs.py +2 -3
- pyegeria/collection_manager_omvs.py +92 -45
- pyegeria/commands/README.md +2 -1
- pyegeria/commands/cat/__init__.py +1 -5
- pyegeria/commands/cat/exp_list_glossaries.py +156 -0
- pyegeria/commands/cat/get_collection.py +23 -14
- pyegeria/commands/cat/get_tech_type_elements.py +1 -1
- pyegeria/commands/cat/glossary_actions.py +28 -8
- pyegeria/commands/cat/list_assets.py +8 -17
- pyegeria/commands/cat/list_cert_types.py +1 -1
- pyegeria/commands/cat/list_collections.py +162 -0
- pyegeria/commands/cat/list_deployed_catalogs.py +6 -3
- pyegeria/commands/cat/list_deployed_database_schemas.py +8 -13
- pyegeria/commands/cat/list_deployed_databases.py +3 -3
- pyegeria/commands/cat/list_tech_type_elements.py +190 -0
- pyegeria/commands/cat/list_tech_types.py +36 -24
- pyegeria/commands/cat/list_terms.py +7 -2
- pyegeria/commands/cli/egeria.py +120 -129
- pyegeria/commands/cli/egeria_cat.py +63 -52
- pyegeria/commands/cli/egeria_login_tui.py +313 -0
- pyegeria/commands/cli/egeria_my.py +25 -33
- pyegeria/commands/cli/egeria_ops.py +38 -40
- pyegeria/commands/cli/egeria_tech.py +55 -41
- pyegeria/commands/cli/ops_config.py +3 -1
- pyegeria/commands/cli/txt_custom_v2.tcss +19 -0
- pyegeria/commands/doc/README.md +145 -0
- pyegeria/commands/doc/Visual Command Reference/README.md +511 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/assets/asset-graph 2024-11-20 at 15.56.42.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/assets/assets-in-domain 2024-11-20 at 15.49.55@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/assets/elements-of-type 2024-11-20 at 16.01.35.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/assets/tech-type-elements 2024-11-20 at 16.05.05.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs-2024-11-20 at 16.17.43@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-11-25 at 20.14.50@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-12-17 at 15.48.38@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-11-25 at 20.21.25@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-12-17 at 15.52.16@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed_databases 2024-12-16 at 16.40.31@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-glossaries 2024-11-25 at 20.30.02.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-terms 2024-11-25 at 20.32.11.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/asset-types 2024-11-25 at 20.34.19@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/certification-types 2024-11-25 at 20.37.07.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/collection-graph 2024-12-12 at 11.33.18@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-collections 2024-12-10 at 14.25.51@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-todos 2024-12-12 at 11.46.30@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-user-ids 2024-12-12 at 11.51.09@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/info/tech-types 2024-12-12 at 11.37.20@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_dependencies 2024-12-14 at 16.24.39@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_structure 2024-12-14 at 16.21.35@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/projects/projects 2024-12-14 at 16.18.10@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/hey_egeria tui 2024-12-16 at 16.58.22@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/my/show/my_profile 2024-12-14 at 16.29.27@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/my/show/my_roles 2024-12-14 at 16.32.10@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/my/show/my_todos 2024-12-15 at 16.24.13@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/my/show/open_todos 2024-12-14 at 16.36.12@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/engines/list_engine_activity compressed 2024-12-15 at 16.48.48@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity 2024-12-15 at 16.32.55@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity compressed 2024-12-15 at 16.38.29@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_status 2024-12-15 at 16.51.26.jpeg +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_daemon_status 2024-12-15 at 16.57.12@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_targets 2024-12-15 at 17.02.19@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/platforms/monitor_platform_status 2024-12-15 at 19.53.18@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status 2024-12-15 at 19.59.39@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status full 2024-12-15 at 20.01.57@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_startup_servers 2024-12-15 at 19.56.07@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_anchored_elements 2024-12-15 at 21.25.41@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_elements_of_om_type 2024-12-16 at 14.39.59@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/info_for_guid 2024-12-16 at 11.35.29@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type 2024-12-16 at 14.24.18@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type extended 2024-12-16 at 14.28.46@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_of_om_type_by_classification 2024-12-16 at 14.35.26@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/related_elements 2024-12-16 at 14.55.01@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/elements/show_related_specifications 2024-12-16 at 15.04.55@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/asset_types 2024-12-16 at 15.10.16@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/detailed_governance_action_processes 2024-12-16 at 15.16.26@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/governance_action_processes 2024-12-16 at 15.13.01@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/registered_services 2024-12-16 at 16.44.54@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-16 at 16.20.34@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-19 at 10.51.54@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/valid_metadata_values 2024-12-16 at 15.31.56@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_tech_type_template_specs 2024-12-16 at 16.03.22@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_technology_types 2024-12-16 at 15.39.20@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_details 2024-12-16 at 15.37.21@2x.png +0 -0
- pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_templates 2024-12-16 at 16.11.48@2x.png +0 -0
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/{hey_egeria: overview.md → README.md } +9 -1
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/CleanShot 2024-11-18 at 21.32.03@2x.png +0 -0
- pyegeria/commands/my/monitor_my_todos.py +17 -5
- pyegeria/commands/my/monitor_open_todos.py +1 -1
- pyegeria/commands/my/todo_actions.py +7 -14
- pyegeria/commands/ops/monitor_asset_events.py +27 -22
- pyegeria/commands/ops/monitor_engine_activity_c.py +1 -1
- pyegeria/commands/ops/monitor_gov_eng_status.py +31 -4
- pyegeria/commands/ops/monitor_integ_daemon_status.py +17 -14
- pyegeria/commands/ops/monitor_platform_status.py +15 -3
- pyegeria/commands/ops/monitor_server_status.py +1 -1
- pyegeria/commands/ops/orig_monitor_server_status.py +36 -21
- pyegeria/commands/ops/refresh_integration_daemon.py +1 -1
- pyegeria/commands/ops/restart_integration_daemon.py +1 -1
- pyegeria/commands/ops/x_engine_actions.py +2 -59
- pyegeria/commands/tech/get_tech_details.py +79 -42
- pyegeria/commands/tech/get_tech_type_template.py +69 -53
- pyegeria/commands/tech/{list_element_graph.py → list_anchored_elements.py} +20 -17
- pyegeria/commands/tech/list_elements_x.py +7 -4
- pyegeria/commands/tech/list_registered_services.py +1 -1
- pyegeria/commands/tech/list_relationship_types.py +19 -21
- pyegeria/commands/tech/list_relationships.py +7 -3
- pyegeria/commands/tech/table_tech_templates.py +3 -1
- pyegeria/core_omag_server_config.py +36 -0
- pyegeria/create_tech_guid_lists.py +2 -2
- pyegeria/egeria_client.py +2 -0
- pyegeria/egeria_tech_client.py +5 -0
- pyegeria/glossary_manager_omvs.py +101 -7
- pyegeria/metadata_explorer_omvs.py +2371 -0
- pyegeria/server_operations.py +4 -4
- pyegeria/template_manager_omvs.py +1 -3
- pyegeria/valid_metadata_omvs.py +1 -1
- {pyegeria-1.5.1.1.60.dist-info → pyegeria-5.2.dist-info}/METADATA +7 -9
- pyegeria-5.2.dist-info/RECORD +232 -0
- {pyegeria-1.5.1.1.60.dist-info → pyegeria-5.2.dist-info}/entry_points.txt +4 -1
- pyegeria/commands/doc/command-overview.md +0 -99
- pyegeria-1.5.1.1.60.dist-info/RECORD +0 -167
- {pyegeria-1.5.1.1.60.dist-info → pyegeria-5.2.dist-info}/LICENSE +0 -0
- {pyegeria-1.5.1.1.60.dist-info → pyegeria-5.2.dist-info}/WHEEL +0 -0
@@ -14,6 +14,7 @@ import time
|
|
14
14
|
from rich import box
|
15
15
|
from rich import print
|
16
16
|
from rich.console import Console
|
17
|
+
from rich.markdown import Markdown
|
17
18
|
from rich.prompt import Prompt
|
18
19
|
from rich.table import Table
|
19
20
|
|
@@ -69,16 +70,11 @@ def display_relationship_types(
|
|
69
70
|
expand=True,
|
70
71
|
)
|
71
72
|
|
72
|
-
table.add_column("Status")
|
73
73
|
table.add_column("Name")
|
74
|
-
|
75
|
-
|
74
|
+
table.add_column("Status")
|
76
75
|
table.add_column("Description")
|
77
|
-
table.add_column("Attrib Name")
|
78
|
-
table.add_column("Attrib Status")
|
79
|
-
table.add_column("Attrib Type")
|
80
|
-
table.add_column("Attrib Description")
|
81
76
|
table.add_column("Description Wiki", no_wrap=True)
|
77
|
+
table.add_column("Attributes", min_width=50)
|
82
78
|
|
83
79
|
types_list = p_client.get_valid_relationship_types(type_name)
|
84
80
|
|
@@ -99,27 +95,27 @@ def display_relationship_types(
|
|
99
95
|
description = types["description"]
|
100
96
|
description_wiki = types.get("descriptionWiki", " ")
|
101
97
|
attribute_defs = types.get("attributeDefinitions")
|
98
|
+
|
99
|
+
att_table = Table(show_lines=True)
|
100
|
+
att_table.add_column("Name")
|
101
|
+
att_table.add_column("Description")
|
102
|
+
att_table.add_column("Status")
|
103
|
+
att_table.add_column("Type")
|
104
|
+
|
102
105
|
if attribute_defs:
|
106
|
+
att_md = True
|
103
107
|
for attr in attribute_defs:
|
104
108
|
attr_name = attr["attributeName"]
|
105
109
|
attr_desc = attr["attributeDescription"]
|
106
110
|
attr_status = attr["attributeStatus"]
|
107
111
|
attr_type = attr["attributeType"]["name"]
|
108
|
-
|
109
|
-
|
110
|
-
name,
|
111
|
-
description,
|
112
|
-
attr_name,
|
113
|
-
attr_status,
|
114
|
-
attr_type,
|
115
|
-
attr_desc,
|
116
|
-
description_wiki,
|
117
|
-
)
|
112
|
+
att_table.add_row(attr_name, attr_desc, attr_status, attr_type)
|
113
|
+
|
118
114
|
else:
|
119
|
-
|
120
|
-
|
121
|
-
)
|
115
|
+
att_md = False
|
116
|
+
att_out = att_table if att_md else " "
|
122
117
|
|
118
|
+
table.add_row(name, status, description, description_wiki, att_out)
|
123
119
|
p_client.close_session()
|
124
120
|
return table
|
125
121
|
|
@@ -157,7 +153,9 @@ def main():
|
|
157
153
|
userid = args.userid if args.userid is not None else EGERIA_USER
|
158
154
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
159
155
|
save_output = args.save_output if args.save_output is not None else False
|
160
|
-
type_name = Prompt.ask(
|
156
|
+
type_name = Prompt.ask(
|
157
|
+
"Enter the OM Type Name to retrieve relationships for:", default="AssetOwner"
|
158
|
+
)
|
161
159
|
|
162
160
|
display_relationship_types(type_name, server, url, userid, user_pass, save_output)
|
163
161
|
|
@@ -16,6 +16,7 @@ import time
|
|
16
16
|
from rich import box
|
17
17
|
from rich.console import Console
|
18
18
|
from rich.markdown import Markdown
|
19
|
+
from rich.prompt import Prompt
|
19
20
|
from rich.table import Table
|
20
21
|
|
21
22
|
from pyegeria import (
|
@@ -23,6 +24,7 @@ from pyegeria import (
|
|
23
24
|
PropertyServerException,
|
24
25
|
UserNotAuthorizedException,
|
25
26
|
ClassificationManager,
|
27
|
+
max_paging_size,
|
26
28
|
)
|
27
29
|
|
28
30
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
@@ -87,7 +89,7 @@ def list_relationships(
|
|
87
89
|
table.add_column("Properties", min_width=40)
|
88
90
|
|
89
91
|
rel_list = g_client.get_relationships(
|
90
|
-
search_string, page_size=
|
92
|
+
search_string, page_size=max_paging_size, time_out=time_out
|
91
93
|
)
|
92
94
|
if type(rel_list) is str:
|
93
95
|
return table
|
@@ -164,8 +166,10 @@ def main():
|
|
164
166
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
165
167
|
time_out = args.time_out if args.time_out is not None else 60
|
166
168
|
try:
|
167
|
-
|
168
|
-
|
169
|
+
search_string = Prompt.ask(
|
170
|
+
"Enter an asset search string:", default="Certification"
|
171
|
+
)
|
172
|
+
|
169
173
|
list_relationships(search_string, server, url, userid, user_pass, time_out)
|
170
174
|
except KeyboardInterrupt:
|
171
175
|
pass
|
@@ -181,6 +181,7 @@ def display_templates_spec(
|
|
181
181
|
sys.exit(1)
|
182
182
|
|
183
183
|
try:
|
184
|
+
start_time = time.perf_counter()
|
184
185
|
if data_table:
|
185
186
|
return generate_table(data_table)
|
186
187
|
else:
|
@@ -188,7 +189,8 @@ def display_templates_spec(
|
|
188
189
|
|
189
190
|
with console.pager(styles=True):
|
190
191
|
console.print(generate_table(data_table))
|
191
|
-
|
192
|
+
duration = time.perf_counter() - start_time
|
193
|
+
print(f"\n\n\t Search string {search_string}\tDuration was {duration:.2f}\n")
|
192
194
|
except (
|
193
195
|
InvalidParameterException,
|
194
196
|
PropertyServerException,
|
@@ -818,6 +818,42 @@ class CoreServerConfig(Client):
|
|
818
818
|
)
|
819
819
|
self.make_request("POST", url, severities)
|
820
820
|
|
821
|
+
def add_postgres_log_destinations(
|
822
|
+
self, config_body: dict, server_name: str = None
|
823
|
+
) -> None:
|
824
|
+
"""Adds a postgres log destination to a server.
|
825
|
+
|
826
|
+
Parameters
|
827
|
+
----------
|
828
|
+
config_body : str
|
829
|
+
Configuration of the postgres database for the audit log destination.
|
830
|
+
server_name : str
|
831
|
+
Name of the server to update.
|
832
|
+
|
833
|
+
Returns
|
834
|
+
-------
|
835
|
+
Void
|
836
|
+
|
837
|
+
Raises
|
838
|
+
------
|
839
|
+
|
840
|
+
InvalidParameterException:
|
841
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
842
|
+
PropertyServerException:
|
843
|
+
Raised by the server when an issue arises in processing a valid request
|
844
|
+
NotAuthorizedException:
|
845
|
+
The principle specified by the user_id does not have authorization for the requested action
|
846
|
+
ConfigurationErrorException:
|
847
|
+
Raised when configuration parameters passed on earlier calls turn out to be
|
848
|
+
invalid or make the new call invalid.
|
849
|
+
|
850
|
+
"""
|
851
|
+
if server_name is None:
|
852
|
+
server_name = self.server_name
|
853
|
+
|
854
|
+
url = f"{self.core_command_root}/servers/{server_name}/audit-log-destinations/postgres"
|
855
|
+
self.make_request("POST", url, config_body)
|
856
|
+
|
821
857
|
def add_slf4j_log_destination(
|
822
858
|
self, severities: [str] = None, server_name: str = None
|
823
859
|
) -> None:
|
@@ -82,10 +82,10 @@ def build_global_guid_lists(
|
|
82
82
|
)
|
83
83
|
#
|
84
84
|
# Ok - now lets harvest integration connectors using get_integration_daemon_status from ServerOps
|
85
|
-
# Assume that integration daemon called
|
85
|
+
# Assume that integration daemon called integration_daemon
|
86
86
|
#
|
87
87
|
s_client = ServerOps(
|
88
|
-
"
|
88
|
+
"integration_daemon", url, user_id=user_id, user_pwd=user_pwd
|
89
89
|
)
|
90
90
|
integ_status = s_client.get_integration_daemon_status()
|
91
91
|
|
pyegeria/egeria_client.py
CHANGED
@@ -28,6 +28,7 @@ from pyegeria import (
|
|
28
28
|
ValidMetadataManager,
|
29
29
|
FullServerConfig,
|
30
30
|
EgeriaConfig,
|
31
|
+
MetadataExplorer,
|
31
32
|
)
|
32
33
|
|
33
34
|
|
@@ -48,6 +49,7 @@ class Egeria(
|
|
48
49
|
RegisteredInfo,
|
49
50
|
# TemplateManager,
|
50
51
|
ValidMetadataManager,
|
52
|
+
MetadataExplorer,
|
51
53
|
):
|
52
54
|
"""
|
53
55
|
Client to issue Runtime status requests.
|
pyegeria/egeria_tech_client.py
CHANGED
@@ -23,6 +23,7 @@ from pyegeria import (
|
|
23
23
|
RuntimeManager,
|
24
24
|
TEMPLATE_GUIDS,
|
25
25
|
INTEGRATION_GUIDS,
|
26
|
+
MetadataExplorer,
|
26
27
|
)
|
27
28
|
|
28
29
|
|
@@ -34,6 +35,7 @@ class EgeriaTech(
|
|
34
35
|
RegisteredInfo,
|
35
36
|
RuntimeManager,
|
36
37
|
ValidMetadataManager,
|
38
|
+
MetadataExplorer,
|
37
39
|
):
|
38
40
|
"""
|
39
41
|
Client for technical Egeria users.
|
@@ -82,6 +84,9 @@ class EgeriaTech(
|
|
82
84
|
ValidMetadataManager.__init__(
|
83
85
|
self, view_server, platform_url, user_id, user_pwd, token
|
84
86
|
)
|
87
|
+
MetadataExplorer.__init__(
|
88
|
+
self, view_server, platform_url, user_id, user_pwd, token
|
89
|
+
)
|
85
90
|
|
86
91
|
|
87
92
|
if __name__ == "__main__":
|
@@ -1535,6 +1535,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
1535
1535
|
self,
|
1536
1536
|
glossary_name: str,
|
1537
1537
|
filename: str,
|
1538
|
+
file_path: str = os.environ.get("EGERIA_GLOSSARY_PATH", None),
|
1538
1539
|
upsert: bool = True,
|
1539
1540
|
verbose: bool = True,
|
1540
1541
|
) -> List[dict] | None:
|
@@ -1544,6 +1545,9 @@ class GlossaryManager(GlossaryBrowser):
|
|
1544
1545
|
----------
|
1545
1546
|
glossary_name : str
|
1546
1547
|
Name of the glossary to import terms into.
|
1548
|
+
file_path: str, default is EGERIA_GLOSSARY_PATH if specified or None
|
1549
|
+
If EGERIA_GLOSSARY_PATH environment variable is set, then it will be used in forming the
|
1550
|
+
prepended to the filename parameter to form the full path to the file.
|
1547
1551
|
filename: str
|
1548
1552
|
Path to the file to import terms from. File is assumed to be in CSV format. The path
|
1549
1553
|
is relative to where the python method is being called from.
|
@@ -1609,8 +1613,18 @@ class GlossaryManager(GlossaryBrowser):
|
|
1609
1613
|
"Version Identifier",
|
1610
1614
|
"Status",
|
1611
1615
|
}
|
1616
|
+
|
1617
|
+
if file_path:
|
1618
|
+
full_file_path = os.path.join(file_path, filename)
|
1619
|
+
else:
|
1620
|
+
full_file_path = filename
|
1621
|
+
|
1622
|
+
if not os.path.isfile(full_file_path):
|
1623
|
+
raise FileNotFoundError(
|
1624
|
+
f"Did not find file with path {file_path} and name {filename}"
|
1625
|
+
)
|
1612
1626
|
# process file
|
1613
|
-
with open(
|
1627
|
+
with open(full_file_path, mode="r") as file:
|
1614
1628
|
# Create a CSV reader object
|
1615
1629
|
csv_reader = csv.DictReader(file)
|
1616
1630
|
headers = csv_reader.fieldnames
|
@@ -1618,7 +1632,6 @@ class GlossaryManager(GlossaryBrowser):
|
|
1618
1632
|
# check that the column headers are known
|
1619
1633
|
if all(header in term_properties for header in headers) is False:
|
1620
1634
|
raise InvalidParameterException("Invalid headers in CSV File")
|
1621
|
-
sys.exit(1)
|
1622
1635
|
|
1623
1636
|
# process each row and validate values
|
1624
1637
|
for row in csv_reader:
|
@@ -1759,7 +1772,10 @@ class GlossaryManager(GlossaryBrowser):
|
|
1759
1772
|
return
|
1760
1773
|
|
1761
1774
|
async def _async_export_glossary_to_csv(
|
1762
|
-
self,
|
1775
|
+
self,
|
1776
|
+
glossary_guid: str,
|
1777
|
+
target_file: str,
|
1778
|
+
file_path: str = os.environ.get("EGERIA_GLOSSARY_PATH", None),
|
1763
1779
|
) -> int:
|
1764
1780
|
"""Export all the terms in a glossary to a CSV file. Async version
|
1765
1781
|
|
@@ -1769,6 +1785,9 @@ class GlossaryManager(GlossaryBrowser):
|
|
1769
1785
|
Identity of the glossary to export.
|
1770
1786
|
target_file: str
|
1771
1787
|
Complete file name with path and extension to export to.
|
1788
|
+
file_path: str, default is EGERIA_GLOSSARY_PATH if specified or None
|
1789
|
+
If EGERIA_GLOSSARY_PATH environment variable is set, then it will be used in forming the
|
1790
|
+
prepended to the filename parameter to form the full path to the file.
|
1772
1791
|
|
1773
1792
|
Returns:
|
1774
1793
|
int: Number of rows exported.
|
@@ -1787,8 +1806,12 @@ class GlossaryManager(GlossaryBrowser):
|
|
1787
1806
|
"Version Identifier",
|
1788
1807
|
"Status",
|
1789
1808
|
]
|
1809
|
+
if file_path:
|
1810
|
+
full_file_path = os.path.join(file_path, target_file)
|
1811
|
+
else:
|
1812
|
+
full_file_path = target_file
|
1790
1813
|
|
1791
|
-
with open(
|
1814
|
+
with open(full_file_path, mode="w") as file:
|
1792
1815
|
csv_writer = csv.DictWriter(file, fieldnames=header)
|
1793
1816
|
csv_writer.writeheader()
|
1794
1817
|
count = 0
|
@@ -1822,7 +1845,12 @@ class GlossaryManager(GlossaryBrowser):
|
|
1822
1845
|
count += 1
|
1823
1846
|
return count
|
1824
1847
|
|
1825
|
-
def export_glossary_to_csv(
|
1848
|
+
def export_glossary_to_csv(
|
1849
|
+
self,
|
1850
|
+
glossary_guid: str,
|
1851
|
+
target_file: str,
|
1852
|
+
file_path: str = os.environ.get("EGERIA_GLOSSARY_PATH", None),
|
1853
|
+
) -> int:
|
1826
1854
|
"""Export all the terms in a glossary to a CSV file.
|
1827
1855
|
|
1828
1856
|
Parameters:
|
@@ -1831,6 +1859,9 @@ class GlossaryManager(GlossaryBrowser):
|
|
1831
1859
|
Identity of the glossary to export.
|
1832
1860
|
target_file: str
|
1833
1861
|
Complete file name with path and extension to export to.
|
1862
|
+
file_path: str, default is EGERIA_GLOSSARY_PATH if specified or None
|
1863
|
+
If EGERIA_GLOSSARY_PATH environment variable is set, then it will be used in forming the
|
1864
|
+
prepended to the filename parameter to form the full path to the file.
|
1834
1865
|
|
1835
1866
|
Returns:
|
1836
1867
|
int: Number of rows exported.
|
@@ -1838,7 +1869,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
1838
1869
|
|
1839
1870
|
loop = asyncio.get_event_loop()
|
1840
1871
|
response = loop.run_until_complete(
|
1841
|
-
self._async_export_glossary_to_csv(glossary_guid, target_file)
|
1872
|
+
self._async_export_glossary_to_csv(glossary_guid, target_file, file_path)
|
1842
1873
|
)
|
1843
1874
|
|
1844
1875
|
return response
|
@@ -2470,7 +2501,70 @@ class GlossaryManager(GlossaryBrowser):
|
|
2470
2501
|
)
|
2471
2502
|
)
|
2472
2503
|
|
2473
|
-
|
2504
|
+
async def _async_undo_term_update(self, glossary_term_guid: str) -> None:
|
2505
|
+
"""Undo an update to a glossary term
|
2506
|
+
|
2507
|
+
Async Version.
|
2508
|
+
|
2509
|
+
Parameters
|
2510
|
+
----------
|
2511
|
+
glossary_term_guid: str
|
2512
|
+
Unique identifier for the source glossary term.
|
2513
|
+
|
2514
|
+
Returns
|
2515
|
+
-------
|
2516
|
+
None
|
2517
|
+
|
2518
|
+
Raises
|
2519
|
+
------
|
2520
|
+
InvalidParameterException
|
2521
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
|
2522
|
+
PropertyServerException
|
2523
|
+
Raised by the server when an issue arises in processing a valid request.
|
2524
|
+
NotAuthorizedException
|
2525
|
+
The principle specified by the user_id does not have authorization for the requested action.
|
2526
|
+
Notes
|
2527
|
+
-----
|
2528
|
+
This creates a new version with the state of the term before the last update.
|
2529
|
+
|
2530
|
+
"""
|
2531
|
+
|
2532
|
+
validate_guid(glossary_term_guid)
|
2533
|
+
|
2534
|
+
url = (
|
2535
|
+
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/terms/"
|
2536
|
+
f"{glossary_term_guid}/undo"
|
2537
|
+
)
|
2538
|
+
|
2539
|
+
await self._async_make_request("POST", url)
|
2540
|
+
|
2541
|
+
def undo_term_update(self, glossary_term_guid: str) -> None:
|
2542
|
+
"""Undo an update to a glossary term
|
2543
|
+
|
2544
|
+
Parameters
|
2545
|
+
----------
|
2546
|
+
glossary_term_guid: str
|
2547
|
+
Unique identifier for the source glossary term.
|
2548
|
+
|
2549
|
+
Returns
|
2550
|
+
-------
|
2551
|
+
None
|
2552
|
+
|
2553
|
+
Raises
|
2554
|
+
------
|
2555
|
+
InvalidParameterException
|
2556
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
|
2557
|
+
PropertyServerException
|
2558
|
+
Raised by the server when an issue arises in processing a valid request.
|
2559
|
+
NotAuthorizedException
|
2560
|
+
The principle specified by the user_id does not have authorization for the requested action.
|
2561
|
+
Notes
|
2562
|
+
-----
|
2563
|
+
This creates a new version with the state of the term before the last update.
|
2564
|
+
|
2565
|
+
"""
|
2566
|
+
loop = asyncio.get_event_loop()
|
2567
|
+
loop.run_until_complete(self._async_undo_term_update(glossary_term_guid))
|
2474
2568
|
|
2475
2569
|
async def _async_get_terms_for_category(
|
2476
2570
|
self,
|