pyegeria 0.7.45.1__tar.gz → 0.8.1__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.45.1 → pyegeria-0.8.1}/PKG-INFO +1 -1
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/list_cert_types.py +61 -43
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/list_projects.py +1 -1
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/my/my_profile_actions.py +51 -32
- pyegeria-0.8.1/examples/widgets/ops/engine_actions.py +83 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/integration_daemon_actions.py +51 -32
- pyegeria-0.8.1/examples/widgets/tech/get_element_info.py +144 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/get_guid_info.py +50 -27
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/list_asset_types.py +33 -23
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/list_elements.py +44 -34
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/list_elements_x.py +69 -49
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/list_registered_services.py +44 -24
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/list_related_specification.py +70 -45
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/list_relationship_types.py +50 -31
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/list_valid_metadata_values.py +57 -28
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/x_list_related_elements.py +54 -34
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/Xloaded_resources_omvs.py +43 -41
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/__init__.py +6 -2
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/_client.py +142 -102
- pyegeria-0.8.1/pyegeria/_deprecated_gov_engine.py +451 -0
- pyegeria-0.8.1/pyegeria/action_author_omvs.py +205 -0
- pyegeria-0.8.1/pyegeria/asset_catalog_omvs.py +739 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/automated_curation_omvs.py +2 -2
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/classification_manager_omvs.py +3 -9
- pyegeria-0.8.1/pyegeria/collection_manager_omvs.py +2805 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/core_omag_server_config.py +310 -192
- pyegeria-0.8.1/pyegeria/egeria_cat_client.py +88 -0
- pyegeria-0.8.1/pyegeria/egeria_config_client.py +37 -0
- pyegeria-0.8.1/pyegeria/egeria_my_client.py +47 -0
- pyegeria-0.8.1/pyegeria/egeria_ops_client.py +67 -0
- pyegeria-0.8.1/pyegeria/egeria_tech_client.py +77 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/feedback_manager_omvs.py +633 -631
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/full_omag_server_config.py +330 -158
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/glossary_browser_omvs.py +927 -474
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/glossary_manager_omvs.py +1033 -543
- pyegeria-0.8.1/pyegeria/my_profile_omvs.py +1113 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/platform_services.py +228 -176
- pyegeria-0.8.1/pyegeria/project_manager_omvs.py +1938 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/registered_info.py +76 -74
- pyegeria-0.8.1/pyegeria/runtime_manager_omvs.py +1046 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/server_operations.py +123 -85
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/valid_metadata_omvs.py +268 -168
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyproject.toml +1 -1
- pyegeria-0.7.45.1/examples/widgets/ops/engine_actions.py +0 -71
- pyegeria-0.7.45.1/examples/widgets/tech/get_element_info.py +0 -119
- pyegeria-0.7.45.1/pyegeria/_deprecated_gov_engine.py +0 -400
- pyegeria-0.7.45.1/pyegeria/action_author_omvs.py +0 -186
- pyegeria-0.7.45.1/pyegeria/asset_catalog_omvs.py +0 -667
- pyegeria-0.7.45.1/pyegeria/collection_manager_omvs.py +0 -2367
- pyegeria-0.7.45.1/pyegeria/my_profile_omvs.py +0 -973
- pyegeria-0.7.45.1/pyegeria/project_manager_omvs.py +0 -1683
- pyegeria-0.7.45.1/pyegeria/runtime_manager_omvs.py +0 -967
- pyegeria-0.7.45.1/pyegeria/tech_guids_31-08-2024 14:33.py +0 -79
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/LICENSE +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/README.md +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/doc_samples/Create_Collection_Sample.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/README.md +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/__init__.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/get_asset_graph.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/get_collection.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/get_project_dependencies.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/get_project_structure.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/get_tech_type_elements.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/get_tech_type_template.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/list_archives.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/list_assets.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/list_glossary.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/list_relationships.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/list_tech_types.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/list_todos.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cat/list_user_ids.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cli/__init__.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cli/egeria.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cli/egeria_cat.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cli/egeria_my.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cli/egeria_ops.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cli/egeria_tech.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/cli/ops_config.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/my/README.md +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/my/__init__.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/my/list_my_profile.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/my/list_my_roles.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/my/monitor_my_todos.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/my/monitor_open_todos.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/my/todo_actions.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/README.md +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/__init__.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/list_catalog_targets.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/load_archive.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/monitor_asset_events.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/monitor_coco_status.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/monitor_engine_activity.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/monitor_engine_activity_c.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/monitor_gov_eng_status.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/monitor_integ_daemon_status.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/monitor_platform_status.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/monitor_server_list.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/monitor_server_status.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/refresh_integration_daemon.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/ops/restart_integration_daemon.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/README.md +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/__init__.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/get_tech_details.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/examples/widgets/tech/list_tech_templates.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/_exceptions.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/_globals.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/_validators.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/create_tech_guid_lists.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/mermaid_utilities.py +0 -0
- {pyegeria-0.7.45.1 → pyegeria-0.8.1}/pyegeria/utils.py +0 -0
@@ -26,35 +26,49 @@ from pyegeria import (
|
|
26
26
|
UserNotAuthorizedException,
|
27
27
|
print_exception_response,
|
28
28
|
AssetCatalog,
|
29
|
-
ClassificationManager
|
29
|
+
ClassificationManager,
|
30
30
|
)
|
31
|
+
|
31
32
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
32
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
33
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
34
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
35
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
33
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
34
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
35
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
36
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
37
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
38
|
+
)
|
39
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
40
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
41
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
42
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
43
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
44
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
45
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
43
46
|
|
44
47
|
|
45
48
|
disable_ssl_warnings = True
|
46
49
|
|
47
50
|
|
48
|
-
def display_certifications(
|
49
|
-
|
51
|
+
def display_certifications(
|
52
|
+
search_string: str,
|
53
|
+
server: str,
|
54
|
+
url: str,
|
55
|
+
username: str,
|
56
|
+
user_password: str,
|
57
|
+
time_out: int = 60,
|
58
|
+
jupyter: bool = EGERIA_JUPYTER,
|
59
|
+
width: int = EGERIA_WIDTH,
|
60
|
+
):
|
50
61
|
console = Console(width=width, force_terminal=not jupyter, soft_wrap=True)
|
51
|
-
if (search_string is None) or ((len(search_string) < 3)) and (search_string !=
|
52
|
-
raise ValueError(
|
53
|
-
|
62
|
+
if (search_string is None) or ((len(search_string) < 3)) and (search_string != "*"):
|
63
|
+
raise ValueError(
|
64
|
+
"Invalid Search String - must be greater than four characters long"
|
65
|
+
)
|
66
|
+
g_client = ClassificationManager(
|
67
|
+
server, url, user_id=username, user_pwd=user_password
|
68
|
+
)
|
54
69
|
token = g_client.create_egeria_bearer_token(username, user_password)
|
55
70
|
|
56
|
-
|
57
|
-
def generate_table(search_string:str = None) -> Table:
|
71
|
+
def generate_table(search_string: str = None) -> Table:
|
58
72
|
"""Make a new table."""
|
59
73
|
table = Table(
|
60
74
|
title=f"Certifications Types @ {time.asctime()}",
|
@@ -66,10 +80,10 @@ def display_certifications(search_string: str, server: str, url: str, username:
|
|
66
80
|
show_lines=True,
|
67
81
|
box=box.ROUNDED,
|
68
82
|
caption=f"View Server '{server}' @ Platform - {url}",
|
69
|
-
expand=True
|
83
|
+
expand=True,
|
70
84
|
)
|
71
85
|
table.add_column("Title", max_width=15)
|
72
|
-
table.add_column(
|
86
|
+
table.add_column("summary")
|
73
87
|
table.add_column("domainID")
|
74
88
|
table.add_column("Unique Name")
|
75
89
|
table.add_column("Scope")
|
@@ -78,34 +92,33 @@ def display_certifications(search_string: str, server: str, url: str, username:
|
|
78
92
|
table.add_column("Details")
|
79
93
|
table.add_column("Related Elements")
|
80
94
|
|
81
|
-
|
82
95
|
certs = g_client.get_elements(search_string, page_size=100, time_out=time_out)
|
83
96
|
if type(certs) is str:
|
84
97
|
return table
|
85
98
|
|
86
99
|
for element in certs:
|
87
|
-
properties = element[
|
88
|
-
summary = properties.get(
|
89
|
-
domain = properties.get("domainIdentifier",
|
90
|
-
unique_name = properties.get(
|
91
|
-
scope = properties.get(
|
92
|
-
description = properties.get(
|
93
|
-
details = properties.get(
|
94
|
-
title = properties.get(
|
95
|
-
cert_guid = element[
|
100
|
+
properties = element["properties"]
|
101
|
+
summary = properties.get("summary", "---")
|
102
|
+
domain = properties.get("domainIdentifier", "---")
|
103
|
+
unique_name = properties.get("qualifiedName", "---")
|
104
|
+
scope = properties.get("scope", "---")
|
105
|
+
description = properties.get("description", "---")
|
106
|
+
details = properties.get("details", "---")
|
107
|
+
title = properties.get("title", "---")
|
108
|
+
cert_guid = element["elementHeader"]["guid"]
|
96
109
|
|
97
110
|
related = g_client.get_all_related_elements(cert_guid)
|
98
111
|
if (len(related) > 0) and (type(related) is list):
|
99
|
-
rel_md =
|
112
|
+
rel_md = ""
|
100
113
|
for rel in related:
|
101
|
-
rel_type = rel[
|
102
|
-
rel_element_props = rel[
|
114
|
+
rel_type = rel["relationshipHeader"]["type"]["typeName"]
|
115
|
+
rel_element_props = rel["relatedElement"]["properties"]
|
103
116
|
rel_el_md = f"* Rel Type: {rel_type}\n"
|
104
117
|
for key in rel_element_props.keys():
|
105
118
|
rel_el_md += f"* {key}: {rel_element_props[key]}\n"
|
106
119
|
rel_md += f"----\n{rel_el_md}\n"
|
107
120
|
else:
|
108
|
-
rel_md =
|
121
|
+
rel_md = "---"
|
109
122
|
|
110
123
|
# match_tab = Table(expand=True)
|
111
124
|
# match_tab.add_column("Type Name")
|
@@ -122,9 +135,8 @@ def display_certifications(search_string: str, server: str, url: str, username:
|
|
122
135
|
# match_details_out = Markdown(match_details_md)
|
123
136
|
# match_tab.add_row(match_type_name, matching_guid, match_details_out)
|
124
137
|
|
125
|
-
|
126
138
|
table.add_row(
|
127
|
-
title, summary, domain, unique_name,scope,description,details, rel_md
|
139
|
+
title, summary, domain, unique_name, scope, description, details, rel_md
|
128
140
|
)
|
129
141
|
|
130
142
|
g_client.close_session()
|
@@ -140,13 +152,18 @@ def display_certifications(search_string: str, server: str, url: str, username:
|
|
140
152
|
with console.pager(styles=True):
|
141
153
|
console.print(generate_table(search_string), soft_wrap=True)
|
142
154
|
|
143
|
-
|
144
|
-
|
155
|
+
except (
|
156
|
+
InvalidParameterException,
|
157
|
+
PropertyServerException,
|
158
|
+
UserNotAuthorizedException,
|
159
|
+
) as e:
|
145
160
|
console.print_exception()
|
146
161
|
sys.exit(1)
|
147
162
|
|
148
163
|
except ValueError as e:
|
149
|
-
console.print(
|
164
|
+
console.print(
|
165
|
+
f"\n\n====> Invalid Search String - must be greater than four characters long"
|
166
|
+
)
|
150
167
|
sys.exit(1)
|
151
168
|
|
152
169
|
|
@@ -167,10 +184,11 @@ def main():
|
|
167
184
|
time_out = args.time_out if args.time_out is not None else 60
|
168
185
|
try:
|
169
186
|
# search_string = Prompt.ask("Enter an asset search string:", default="*")
|
170
|
-
search_string =
|
187
|
+
search_string = "CertificationType"
|
171
188
|
display_certifications(search_string, server, url, userid, user_pass, time_out)
|
172
|
-
except
|
189
|
+
except KeyboardInterrupt:
|
173
190
|
pass
|
174
191
|
|
192
|
+
|
175
193
|
if __name__ == "__main__":
|
176
|
-
main()
|
194
|
+
main()
|
@@ -59,7 +59,7 @@ def display_project_list(
|
|
59
59
|
):
|
60
60
|
p_client = ProjectManager(server, url, user_id=username)
|
61
61
|
token = p_client.create_egeria_bearer_token(username, user_pass)
|
62
|
-
c_client = ClassificationManager(server, url, token)
|
62
|
+
c_client = ClassificationManager(server, url, token=token)
|
63
63
|
|
64
64
|
def generate_table(project_name: str) -> Table:
|
65
65
|
"""Make a new table."""
|
@@ -22,79 +22,97 @@ from pyegeria._exceptions import (
|
|
22
22
|
)
|
23
23
|
|
24
24
|
|
25
|
-
@click.command(
|
26
|
-
@click.argument(
|
27
|
-
@click.argument(
|
28
|
-
@click.argument(
|
25
|
+
@click.command("add-todo")
|
26
|
+
@click.argument("integration-connector")
|
27
|
+
@click.argument("metadata-element-guid")
|
28
|
+
@click.argument("catalog-target-name")
|
29
29
|
@click.pass_context
|
30
|
-
def add_catalog_target(
|
30
|
+
def add_catalog_target(
|
31
|
+
ctx,
|
32
|
+
integration_connector: str,
|
33
|
+
metadata_element_guid: str,
|
34
|
+
catalog_target_name: str,
|
35
|
+
) -> str:
|
31
36
|
"""Add catalog targets to the specified integration connector"""
|
32
37
|
try:
|
33
38
|
if integration_connector not in INTEGRATION_GUIDS.keys():
|
34
|
-
click.echo(
|
39
|
+
click.echo("Integration connector is not known")
|
35
40
|
|
36
41
|
c = ctx.obj
|
37
|
-
a_client = AutomatedCuration(
|
42
|
+
a_client = AutomatedCuration(
|
43
|
+
c.view_server, c.view_server_url, c.userid, c.password
|
44
|
+
)
|
38
45
|
token = a_client.create_egeria_bearer_token()
|
39
46
|
|
40
|
-
guid = a_client.add_catalog_target(
|
41
|
-
|
42
|
-
|
43
|
-
|
47
|
+
guid = a_client.add_catalog_target(
|
48
|
+
INTEGRATION_GUIDS[integration_connector],
|
49
|
+
metadata_element_guid,
|
50
|
+
catalog_target_name,
|
51
|
+
)
|
44
52
|
|
53
|
+
click.echo(
|
54
|
+
f"Added catalog target to {integration_connector} with a return guid of {guid}"
|
55
|
+
)
|
45
56
|
|
46
57
|
except (InvalidParameterException, PropertyServerException) as e:
|
47
58
|
print_exception_response(e)
|
48
59
|
|
49
60
|
|
50
|
-
|
51
|
-
@click.
|
52
|
-
@click.argument('relationship-guid')
|
61
|
+
@click.command("remove-target")
|
62
|
+
@click.argument("relationship-guid")
|
53
63
|
@click.pass_context
|
54
64
|
def remove_catalog_target(ctx, relationship_guid: str):
|
55
65
|
"""Remove the catalog target specified by the relationship guidr"""
|
56
66
|
try:
|
57
67
|
c = ctx.obj
|
58
|
-
a_client = AutomatedCuration(
|
68
|
+
a_client = AutomatedCuration(
|
69
|
+
c.view_server, c.view_server_url, c.userid, c.password
|
70
|
+
)
|
59
71
|
token = a_client.create_egeria_bearer_token()
|
60
72
|
|
61
73
|
a_client.remove_catalog_target(relationship_guid)
|
62
74
|
|
63
|
-
click.echo(
|
64
|
-
|
75
|
+
click.echo(
|
76
|
+
f"Removed catalog target with relationship guid of {relationship_guid}"
|
77
|
+
)
|
65
78
|
|
66
79
|
except (InvalidParameterException, PropertyServerException) as e:
|
67
80
|
print_exception_response(e)
|
68
81
|
|
69
82
|
|
70
|
-
@click.command(
|
71
|
-
@click.argument(
|
72
|
-
@click.argument(
|
83
|
+
@click.command("update-target")
|
84
|
+
@click.argument("relationship-guid")
|
85
|
+
@click.argument("catalog-target-name")
|
73
86
|
@click.pass_context
|
74
|
-
def update_catalog_target(ctx, relationship_guid: str, catalog_target_name:str):
|
75
|
-
"""Update the catalog target specified by the relationship guid
|
87
|
+
def update_catalog_target(ctx, relationship_guid: str, catalog_target_name: str):
|
88
|
+
"""Update the catalog target specified by the relationship guid"""
|
76
89
|
try:
|
77
90
|
c = ctx.obj
|
78
|
-
a_client = AutomatedCuration(
|
91
|
+
a_client = AutomatedCuration(
|
92
|
+
c.view_server, c.view_server_url, c.userid, c.password
|
93
|
+
)
|
79
94
|
token = a_client.create_egeria_bearer_token()
|
80
95
|
|
81
96
|
guid = a_client.update_catalog_target(relationship_guid, catalog_target_name)
|
82
97
|
|
83
|
-
click.echo(
|
84
|
-
|
85
|
-
|
98
|
+
click.echo(
|
99
|
+
f"Update catalog target with relationship guid of {relationship_guid} to a catalog target name of "
|
100
|
+
f"{catalog_target_name} with a return guid of {guid}"
|
101
|
+
)
|
86
102
|
|
87
103
|
except (InvalidParameterException, PropertyServerException) as e:
|
88
104
|
print_exception_response(e)
|
89
105
|
|
90
106
|
|
91
|
-
@click.command(
|
107
|
+
@click.command("stop")
|
92
108
|
@click.pass_context
|
93
109
|
def stop_server(ctx):
|
94
110
|
"""Stop an integration daemon"""
|
95
111
|
try:
|
96
112
|
c = ctx.obj
|
97
|
-
p_client = Platform(
|
113
|
+
p_client = Platform(
|
114
|
+
c.integration_daemon, c.integration_daemon_url, c.userid, c.password
|
115
|
+
)
|
98
116
|
|
99
117
|
p_client.shutdown_server()
|
100
118
|
|
@@ -103,13 +121,15 @@ def stop_server(ctx):
|
|
103
121
|
print_exception_response(e)
|
104
122
|
|
105
123
|
|
106
|
-
@click.command(
|
124
|
+
@click.command("start")
|
107
125
|
@click.pass_context
|
108
126
|
def start_server(ctx):
|
109
|
-
"""Start or restart an integration daemon from its known configuration
|
127
|
+
"""Start or restart an integration daemon from its known configuration"""
|
110
128
|
try:
|
111
129
|
c = ctx.obj
|
112
|
-
p_client = Platform(
|
130
|
+
p_client = Platform(
|
131
|
+
c.integration_daemon, c.integration_daemon_url, c.userid, c.password
|
132
|
+
)
|
113
133
|
|
114
134
|
p_client.activate_server_stored_config()
|
115
135
|
|
@@ -117,4 +137,3 @@ def start_server(ctx):
|
|
117
137
|
|
118
138
|
except (InvalidParameterException, PropertyServerException) as e:
|
119
139
|
print_exception_response(e)
|
120
|
-
|
@@ -0,0 +1,83 @@
|
|
1
|
+
"""
|
2
|
+
SPDX-License-Identifier: Apache-2.0
|
3
|
+
Copyright Contributors to the ODPi Egeria project.
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
Execute engine actions.
|
8
|
+
|
9
|
+
"""
|
10
|
+
import os
|
11
|
+
|
12
|
+
import click
|
13
|
+
|
14
|
+
# from ops_config import Config, pass_config
|
15
|
+
from pyegeria import Platform
|
16
|
+
from pyegeria._exceptions import (
|
17
|
+
InvalidParameterException,
|
18
|
+
PropertyServerException,
|
19
|
+
print_exception_response,
|
20
|
+
)
|
21
|
+
|
22
|
+
GERIA_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_INTEGRATION_DAEMON_URL = os.environ.get(
|
31
|
+
"EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
|
32
|
+
)
|
33
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
34
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
35
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
36
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
37
|
+
|
38
|
+
|
39
|
+
@click.command("stop")
|
40
|
+
@click.option(
|
41
|
+
"--server", default=EGERIA_VIEW_SERVER, help="Egeria metadata store to load"
|
42
|
+
)
|
43
|
+
@click.option(
|
44
|
+
"--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
45
|
+
)
|
46
|
+
@click.option("--userid", default=EGERIA_ADMIN_USER, help="Egeria admin user")
|
47
|
+
@click.option("--password", default=EGERIA_ADMIN_PASSWORD, help="Egeria admin password")
|
48
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
49
|
+
def stop_daemon(file, server, url, userid, password, timeout):
|
50
|
+
"""Stop an engine-host daemon"""
|
51
|
+
p_client = Platform(server, url, userid, password)
|
52
|
+
try:
|
53
|
+
p_client.shutdown_server()
|
54
|
+
|
55
|
+
click.echo(f"Stopped server {server}")
|
56
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
57
|
+
print_exception_response(e)
|
58
|
+
finally:
|
59
|
+
p_client.close_session()
|
60
|
+
|
61
|
+
|
62
|
+
@click.command("start")
|
63
|
+
@click.option(
|
64
|
+
"--server", default=EGERIA_VIEW_SERVER, help="Egeria metadata store to load"
|
65
|
+
)
|
66
|
+
@click.option(
|
67
|
+
"--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
68
|
+
)
|
69
|
+
@click.option("--userid", default=EGERIA_ADMIN_USER, help="Egeria admin user")
|
70
|
+
@click.option("--password", default=EGERIA_ADMIN_PASSWORD, help="Egeria admin password")
|
71
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
72
|
+
def start_daemon(file, server, url, userid, password, timeout):
|
73
|
+
"""Start or restart an engine-host from its known configuration"""
|
74
|
+
p_client = Platform(server, url, userid, password)
|
75
|
+
try:
|
76
|
+
p_client.activate_server_stored_config()
|
77
|
+
|
78
|
+
click.echo(f"Started server {server}")
|
79
|
+
|
80
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
81
|
+
print_exception_response(e)
|
82
|
+
finally:
|
83
|
+
p_client.close_session()
|
@@ -22,79 +22,97 @@ from pyegeria._exceptions import (
|
|
22
22
|
)
|
23
23
|
|
24
24
|
|
25
|
-
@click.command(
|
26
|
-
@click.argument(
|
27
|
-
@click.argument(
|
28
|
-
@click.argument(
|
25
|
+
@click.command("add-target")
|
26
|
+
@click.argument("integration-connector")
|
27
|
+
@click.argument("metadata-element-guid")
|
28
|
+
@click.argument("catalog-target-name")
|
29
29
|
@click.pass_context
|
30
|
-
def add_catalog_target(
|
30
|
+
def add_catalog_target(
|
31
|
+
ctx,
|
32
|
+
integration_connector: str,
|
33
|
+
metadata_element_guid: str,
|
34
|
+
catalog_target_name: str,
|
35
|
+
) -> str:
|
31
36
|
"""Add catalog targets to the specified integration connector"""
|
32
37
|
try:
|
33
38
|
if integration_connector not in INTEGRATION_GUIDS.keys():
|
34
|
-
click.echo(
|
39
|
+
click.echo("Integration connector is not known")
|
35
40
|
|
36
41
|
c = ctx.obj
|
37
|
-
a_client = AutomatedCuration(
|
42
|
+
a_client = AutomatedCuration(
|
43
|
+
c.view_server, c.view_server_url, c.userid, c.password
|
44
|
+
)
|
38
45
|
token = a_client.create_egeria_bearer_token()
|
39
46
|
|
40
|
-
guid = a_client.add_catalog_target(
|
41
|
-
|
42
|
-
|
43
|
-
|
47
|
+
guid = a_client.add_catalog_target(
|
48
|
+
INTEGRATION_GUIDS[integration_connector],
|
49
|
+
metadata_element_guid,
|
50
|
+
catalog_target_name,
|
51
|
+
)
|
44
52
|
|
53
|
+
click.echo(
|
54
|
+
f"Added catalog target to {integration_connector} with a return guid of {guid}"
|
55
|
+
)
|
45
56
|
|
46
57
|
except (InvalidParameterException, PropertyServerException) as e:
|
47
58
|
print_exception_response(e)
|
48
59
|
|
49
60
|
|
50
|
-
|
51
|
-
@click.
|
52
|
-
@click.argument('relationship-guid')
|
61
|
+
@click.command("remove-target")
|
62
|
+
@click.argument("relationship-guid")
|
53
63
|
@click.pass_context
|
54
64
|
def remove_catalog_target(ctx, relationship_guid: str):
|
55
65
|
"""Remove the catalog target specified by the relationship guidr"""
|
56
66
|
try:
|
57
67
|
c = ctx.obj
|
58
|
-
a_client = AutomatedCuration(
|
68
|
+
a_client = AutomatedCuration(
|
69
|
+
c.view_server, c.view_server_url, c.userid, c.password
|
70
|
+
)
|
59
71
|
token = a_client.create_egeria_bearer_token()
|
60
72
|
|
61
73
|
a_client.remove_catalog_target(relationship_guid)
|
62
74
|
|
63
|
-
click.echo(
|
64
|
-
|
75
|
+
click.echo(
|
76
|
+
f"Removed catalog target with relationship guid of {relationship_guid}"
|
77
|
+
)
|
65
78
|
|
66
79
|
except (InvalidParameterException, PropertyServerException) as e:
|
67
80
|
print_exception_response(e)
|
68
81
|
|
69
82
|
|
70
|
-
@click.command(
|
71
|
-
@click.argument(
|
72
|
-
@click.argument(
|
83
|
+
@click.command("update-target")
|
84
|
+
@click.argument("relationship-guid")
|
85
|
+
@click.argument("catalog-target-name")
|
73
86
|
@click.pass_context
|
74
|
-
def update_catalog_target(ctx, relationship_guid: str, catalog_target_name:str):
|
75
|
-
"""Update the catalog target specified by the relationship guid
|
87
|
+
def update_catalog_target(ctx, relationship_guid: str, catalog_target_name: str):
|
88
|
+
"""Update the catalog target specified by the relationship guid"""
|
76
89
|
try:
|
77
90
|
c = ctx.obj
|
78
|
-
a_client = AutomatedCuration(
|
91
|
+
a_client = AutomatedCuration(
|
92
|
+
c.view_server, c.view_server_url, c.userid, c.password
|
93
|
+
)
|
79
94
|
token = a_client.create_egeria_bearer_token()
|
80
95
|
|
81
96
|
guid = a_client.update_catalog_target(relationship_guid, catalog_target_name)
|
82
97
|
|
83
|
-
click.echo(
|
84
|
-
|
85
|
-
|
98
|
+
click.echo(
|
99
|
+
f"Update catalog target with relationship guid of {relationship_guid} to a catalog target name of "
|
100
|
+
f"{catalog_target_name} with a return guid of {guid}"
|
101
|
+
)
|
86
102
|
|
87
103
|
except (InvalidParameterException, PropertyServerException) as e:
|
88
104
|
print_exception_response(e)
|
89
105
|
|
90
106
|
|
91
|
-
@click.command(
|
107
|
+
@click.command("stop")
|
92
108
|
@click.pass_context
|
93
109
|
def stop_server(ctx):
|
94
110
|
"""Stop an integration daemon"""
|
95
111
|
try:
|
96
112
|
c = ctx.obj
|
97
|
-
p_client = Platform(
|
113
|
+
p_client = Platform(
|
114
|
+
c.integration_daemon, c.integration_daemon_url, c.userid, c.password
|
115
|
+
)
|
98
116
|
|
99
117
|
p_client.shutdown_server()
|
100
118
|
|
@@ -103,13 +121,15 @@ def stop_server(ctx):
|
|
103
121
|
print_exception_response(e)
|
104
122
|
|
105
123
|
|
106
|
-
@click.command(
|
124
|
+
@click.command("start")
|
107
125
|
@click.pass_context
|
108
126
|
def start_server(ctx):
|
109
|
-
"""Start or restart an integration daemon from its known configuration
|
127
|
+
"""Start or restart an integration daemon from its known configuration"""
|
110
128
|
try:
|
111
129
|
c = ctx.obj
|
112
|
-
p_client = Platform(
|
130
|
+
p_client = Platform(
|
131
|
+
c.integration_daemon, c.integration_daemon_url, c.userid, c.password
|
132
|
+
)
|
113
133
|
|
114
134
|
p_client.activate_server_stored_config()
|
115
135
|
|
@@ -117,4 +137,3 @@ def start_server(ctx):
|
|
117
137
|
|
118
138
|
except (InvalidParameterException, PropertyServerException) as e:
|
119
139
|
print_exception_response(e)
|
120
|
-
|