pyegeria 0.7.45.1__py3-none-any.whl → 0.8.0__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.
- examples/widgets/cat/list_cert_types.py +61 -43
- examples/widgets/cat/list_projects.py +1 -1
- examples/widgets/my/my_profile_actions.py +51 -32
- examples/widgets/ops/engine_actions.py +35 -23
- examples/widgets/ops/integration_daemon_actions.py +51 -32
- examples/widgets/tech/get_element_info.py +63 -38
- examples/widgets/tech/get_guid_info.py +50 -27
- examples/widgets/tech/list_asset_types.py +33 -23
- examples/widgets/tech/list_elements.py +44 -34
- examples/widgets/tech/list_elements_x.py +69 -49
- examples/widgets/tech/list_registered_services.py +44 -24
- examples/widgets/tech/list_related_specification.py +70 -45
- examples/widgets/tech/list_relationship_types.py +50 -31
- examples/widgets/tech/list_valid_metadata_values.py +57 -28
- examples/widgets/tech/x_list_related_elements.py +54 -34
- pyegeria/Xloaded_resources_omvs.py +43 -41
- pyegeria/__init__.py +5 -1
- pyegeria/_client.py +142 -102
- pyegeria/_deprecated_gov_engine.py +218 -167
- pyegeria/action_author_omvs.py +107 -88
- pyegeria/asset_catalog_omvs.py +467 -395
- pyegeria/automated_curation_omvs.py +2 -2
- pyegeria/classification_manager_omvs.py +3 -9
- pyegeria/collection_manager_omvs.py +1957 -1519
- pyegeria/core_omag_server_config.py +310 -192
- pyegeria/egeria_cat_client.py +88 -0
- pyegeria/egeria_config_client.py +37 -0
- pyegeria/egeria_my_client.py +47 -0
- pyegeria/egeria_ops_client.py +67 -0
- pyegeria/egeria_tech_client.py +77 -0
- pyegeria/feedback_manager_omvs.py +633 -631
- pyegeria/full_omag_server_config.py +330 -158
- pyegeria/glossary_browser_omvs.py +927 -474
- pyegeria/glossary_manager_omvs.py +1033 -543
- pyegeria/my_profile_omvs.py +714 -574
- pyegeria/platform_services.py +228 -176
- pyegeria/project_manager_omvs.py +1158 -903
- pyegeria/registered_info.py +76 -74
- pyegeria/runtime_manager_omvs.py +749 -670
- pyegeria/server_operations.py +123 -85
- pyegeria/valid_metadata_omvs.py +268 -168
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/METADATA +1 -1
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/RECORD +46 -42
- pyegeria/tech_guids_31-08-2024 14:33.py +0 -79
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/LICENSE +0 -0
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/WHEEL +0 -0
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/entry_points.txt +0 -0
@@ -27,24 +27,34 @@ from pyegeria import (
|
|
27
27
|
print_exception_response,
|
28
28
|
)
|
29
29
|
from pyegeria import ValidMetadataManager
|
30
|
+
|
30
31
|
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
|
-
|
32
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
33
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
34
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
35
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
36
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
37
|
+
)
|
38
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
39
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
40
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
41
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
42
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
43
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
44
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
45
|
+
|
46
|
+
|
47
|
+
def display_metadata_values(
|
48
|
+
property_name: str,
|
49
|
+
type_name: str,
|
50
|
+
server: str,
|
51
|
+
url: str,
|
52
|
+
username: str,
|
53
|
+
user_pass: str,
|
54
|
+
save_output: bool,
|
55
|
+
jupyter: bool = EGERIA_JUPYTER,
|
56
|
+
width: int = EGERIA_WIDTH,
|
46
57
|
):
|
47
|
-
|
48
58
|
m_client = ValidMetadataManager(server, url, user_id=username)
|
49
59
|
token = m_client.create_egeria_bearer_token(username, user_pass)
|
50
60
|
|
@@ -60,7 +70,7 @@ def display_metadata_values(property_name: str, type_name: str, server: str, url
|
|
60
70
|
show_lines=True,
|
61
71
|
box=box.ROUNDED,
|
62
72
|
caption=f"Valid Metadata Values for Server '{server}' @ Platform - {url}",
|
63
|
-
expand=True
|
73
|
+
expand=True,
|
64
74
|
)
|
65
75
|
|
66
76
|
table.add_column("Category")
|
@@ -84,20 +94,28 @@ def display_metadata_values(property_name: str, type_name: str, server: str, url
|
|
84
94
|
status = " "
|
85
95
|
sponsor = " "
|
86
96
|
elif type(valid_values[0]) == str:
|
87
|
-
raise ValueError(
|
97
|
+
raise ValueError(
|
98
|
+
"-->This is not a known metadata property with a valid value"
|
99
|
+
)
|
88
100
|
else:
|
89
101
|
for value in valid_values:
|
90
|
-
category = value.get("category","None")
|
91
|
-
display_name = value.get("displayName","None")
|
102
|
+
category = value.get("category", "None")
|
103
|
+
display_name = value.get("displayName", "None")
|
92
104
|
preferred_value = value.get("preferredValue", "None ")
|
93
105
|
deprecated = str(value.get("isDeprecated", "None "))
|
94
106
|
case_sensitive = str(value.get("isCaseSensitive", "None"))
|
95
107
|
description = value.get("description", "None")
|
96
|
-
additional_properties = value.get(
|
108
|
+
additional_properties = value.get("additionalProperties", "None")
|
97
109
|
if additional_properties is not None:
|
98
110
|
props = json.dumps(additional_properties)
|
99
111
|
table.add_row(
|
100
|
-
category,
|
112
|
+
category,
|
113
|
+
display_name,
|
114
|
+
preferred_value,
|
115
|
+
deprecated,
|
116
|
+
case_sensitive,
|
117
|
+
props,
|
118
|
+
description,
|
101
119
|
)
|
102
120
|
|
103
121
|
m_client.close_session()
|
@@ -114,12 +132,18 @@ def display_metadata_values(property_name: str, type_name: str, server: str, url
|
|
114
132
|
if save_output:
|
115
133
|
console.save_html("valid-metadata-values.html")
|
116
134
|
|
117
|
-
except (
|
135
|
+
except (
|
136
|
+
InvalidParameterException,
|
137
|
+
PropertyServerException,
|
138
|
+
UserNotAuthorizedException,
|
139
|
+
ValueError,
|
140
|
+
) as e:
|
118
141
|
if type(e) is str:
|
119
142
|
print(e)
|
120
143
|
else:
|
121
144
|
print_exception_response(e)
|
122
145
|
|
146
|
+
|
123
147
|
def main():
|
124
148
|
parser = argparse.ArgumentParser()
|
125
149
|
parser.add_argument("--server", help="Name of the server to display status for")
|
@@ -136,12 +160,17 @@ def main():
|
|
136
160
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
137
161
|
save_output = args.save_output if args.save_output is not None else False
|
138
162
|
|
139
|
-
|
140
163
|
try:
|
141
|
-
property_name = Prompt.ask(
|
142
|
-
|
143
|
-
|
144
|
-
|
164
|
+
property_name = Prompt.ask(
|
165
|
+
"Enter the Property to retrieve:", default="projectHealth"
|
166
|
+
)
|
167
|
+
type_name = Prompt.ask(
|
168
|
+
"Enter the Metadata Type to filter on:", default="Project"
|
169
|
+
)
|
170
|
+
display_metadata_values(
|
171
|
+
property_name, type_name, server, url, userid, user_pass, save_output
|
172
|
+
)
|
173
|
+
except KeyboardInterrupt:
|
145
174
|
pass
|
146
175
|
|
147
176
|
|
@@ -23,34 +23,45 @@ from pyegeria import (
|
|
23
23
|
PropertyServerException,
|
24
24
|
UserNotAuthorizedException,
|
25
25
|
print_exception_response,
|
26
|
-
ClassificationManager
|
26
|
+
ClassificationManager,
|
27
27
|
)
|
28
28
|
|
29
29
|
console = Console()
|
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
|
-
|
47
|
-
|
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_related_elements(
|
47
|
+
element_guid: str,
|
48
|
+
relationship: str,
|
49
|
+
om_type: str,
|
50
|
+
server: str,
|
51
|
+
url: str,
|
52
|
+
username: str,
|
53
|
+
password: str,
|
54
|
+
jupyter: bool = EGERIA_JUPYTER,
|
55
|
+
width: int = EGERIA_WIDTH,
|
56
|
+
):
|
48
57
|
c_client = ClassificationManager(server, url, user_id=username, user_pwd=password)
|
49
58
|
token = c_client.create_egeria_bearer_token()
|
50
59
|
rel_el = c_client.get_related_elements(element_guid, relationship, om_type)
|
51
60
|
|
52
61
|
if type(rel_el) is str:
|
53
|
-
print(
|
62
|
+
print(
|
63
|
+
f"\n\nWas not able find related elements for {element_guid} with relationship {relationship}\n\n"
|
64
|
+
)
|
54
65
|
sys.exit(0)
|
55
66
|
|
56
67
|
def generate_table() -> Table:
|
@@ -78,23 +89,23 @@ def display_related_elements(element_guid: str, relationship: str, om_type: str,
|
|
78
89
|
for related_element in rel_el:
|
79
90
|
relationship_props = related_element["relationshipProperties"]
|
80
91
|
|
81
|
-
rel_prop_md =
|
92
|
+
rel_prop_md = ""
|
82
93
|
for key in relationship_props.keys():
|
83
94
|
rel_prop_md += f"{key}: {relationship_props[key]}\n"
|
84
95
|
# rel_prop_out = Markdown(rel_prop_md)
|
85
96
|
|
86
|
-
rel_element = related_element[
|
97
|
+
rel_element = related_element["relatedElement"]
|
87
98
|
el = rel_element["properties"]
|
88
99
|
for prop in el:
|
89
|
-
el_case = el.get("isCaseSensitive",
|
90
|
-
el_pref = el.get("preferredValue",
|
91
|
-
el_desc = el.get("description",
|
92
|
-
el_add = el.get("additionalProperties",
|
93
|
-
|
94
|
-
el_add_md =
|
95
|
-
el_add_f = el_add.replace(
|
96
|
-
s = el_add.strip(
|
97
|
-
pairs = [i.split(
|
100
|
+
el_case = el.get("isCaseSensitive", "---")
|
101
|
+
el_pref = el.get("preferredValue", "---")
|
102
|
+
el_desc = el.get("description", "---")
|
103
|
+
el_add = el.get("additionalProperties", "---")
|
104
|
+
|
105
|
+
el_add_md = ""
|
106
|
+
el_add_f = el_add.replace("\u003d", ":")
|
107
|
+
s = el_add.strip("{}").strip()
|
108
|
+
pairs = [i.split("=") for i in s.split(", ")]
|
98
109
|
# d_add_prop = dict(pairs)
|
99
110
|
# for key in d_add_prop.keys():
|
100
111
|
# el_add_md += f"{key}: {d_add_prop[key]}\n"
|
@@ -110,7 +121,11 @@ def display_related_elements(element_guid: str, relationship: str, om_type: str,
|
|
110
121
|
with console.pager(styles=True):
|
111
122
|
console.print(generate_table())
|
112
123
|
|
113
|
-
except (
|
124
|
+
except (
|
125
|
+
InvalidParameterException,
|
126
|
+
PropertyServerException,
|
127
|
+
UserNotAuthorizedException,
|
128
|
+
) as e:
|
114
129
|
print_exception_response(e)
|
115
130
|
assert e.related_http_code != "200", "Invalid parameters"
|
116
131
|
finally:
|
@@ -134,10 +149,15 @@ def main():
|
|
134
149
|
|
135
150
|
try:
|
136
151
|
element_guid = Prompt.ask("Enter an Element GUID find relationships for")
|
137
|
-
relationship = Prompt.ask(
|
152
|
+
relationship = Prompt.ask(
|
153
|
+
"Enter the relationship to search",
|
154
|
+
default="SpecificationPropertyAssignment",
|
155
|
+
)
|
138
156
|
om_type = Prompt.ask("Enter an optional Open Metadata Type", default=None)
|
139
|
-
display_related_elements(
|
140
|
-
|
157
|
+
display_related_elements(
|
158
|
+
element_guid, relationship, om_type, server, url, userid, password
|
159
|
+
)
|
160
|
+
except KeyboardInterrupt:
|
141
161
|
pass
|
142
162
|
|
143
163
|
|
@@ -12,14 +12,17 @@ companion service is also configured and running.
|
|
12
12
|
"""
|
13
13
|
|
14
14
|
from pyegeria import (
|
15
|
-
Client,
|
16
|
-
|
15
|
+
Client,
|
16
|
+
max_paging_size,
|
17
|
+
InvalidParameterException,
|
18
|
+
PropertyServerException,
|
19
|
+
UserNotAuthorizedException,
|
20
|
+
print_exception_response,
|
17
21
|
)
|
18
22
|
|
19
23
|
|
20
|
-
|
21
24
|
class LoadedResources(Client):
|
22
|
-
"""
|
25
|
+
"""Client to search and retrieve currently loaded information about connectors, templates, governance actions,
|
23
26
|
etc.
|
24
27
|
|
25
28
|
Attributes:
|
@@ -45,48 +48,47 @@ class LoadedResources(Client):
|
|
45
48
|
admin_command_root: str
|
46
49
|
|
47
50
|
def __init__(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
self,
|
52
|
+
server_name: str,
|
53
|
+
platform_url: str,
|
54
|
+
user_id: str,
|
55
|
+
user_pwd: str = None,
|
56
|
+
verify_flag: bool = False,
|
54
57
|
):
|
55
58
|
if server_name is None:
|
56
59
|
server_name = "NA"
|
57
|
-
Client.__init__(self, server_name, platform_url,
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
60
|
+
Client.__init__(self, server_name, platform_url, user_id, user_pwd)
|
61
|
+
|
62
|
+
def get_all_templates(
|
63
|
+
self, server: str = None, start_from: int = 0, page_size: int = max_paging_size
|
64
|
+
) -> list | str:
|
65
|
+
"""Get Loaded templates for the Server.
|
66
|
+
|
67
|
+
Parameters
|
68
|
+
----------
|
69
|
+
|
70
|
+
Returns
|
71
|
+
-------
|
72
|
+
dict | str
|
73
|
+
A dictionary containing a simplified list of key template attributes.
|
74
|
+
|
75
|
+
Raises
|
76
|
+
------
|
77
|
+
InvalidParameterException
|
78
|
+
If the response code is not 200.
|
79
|
+
PropertyServerException:
|
80
|
+
Raised by the server when an issue arises in processing a valid request
|
81
|
+
NotAuthorizedException:
|
82
|
+
The principle specified by the user_id does not have authorization for the requested action
|
83
|
+
|
84
|
+
"""
|
81
85
|
server = self.server_name if server is None else server
|
82
|
-
url = (
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
}
|
86
|
+
url = (
|
87
|
+
f"{self.platform_url}/servers/{server}/open-metadata/framework-services/asset-owner/open-metadata-store/"
|
88
|
+
f"users/{self.user_id}/metadata-elements/by-search-string?startFrom=start_from&pageSize=page_size"
|
89
|
+
)
|
90
|
+
body = {"class": "SearchStringRequestBody", "searchString": ".*Template.*"}
|
88
91
|
response = self.make_request("POST", url, body)
|
89
92
|
return response.json().get("elementList", "No elements")
|
90
93
|
|
91
94
|
# def get_all_assets_in_archives(self, asset_type: str = None, archive_id: str = None, server: str= None, page_start:int = 0, page_size = max_paging_size):
|
92
|
-
|
pyegeria/__init__.py
CHANGED
@@ -63,12 +63,16 @@ from .asset_catalog_omvs import AssetCatalog
|
|
63
63
|
from .Xloaded_resources_omvs import LoadedResources
|
64
64
|
from ._deprecated_gov_engine import GovEng
|
65
65
|
from .runtime_manager_omvs import RuntimeManager
|
66
|
-
from .action_author_omvs import
|
66
|
+
from .action_author_omvs import ActionAuthor
|
67
67
|
from .glossary_manager_omvs import GlossaryManager
|
68
68
|
from .create_tech_guid_lists import build_global_guid_lists
|
69
69
|
from .classification_manager_omvs import ClassificationManager
|
70
70
|
from .feedback_manager_omvs import FeedbackManager
|
71
71
|
from .mermaid_utilities import load_mermaid, render_mermaid, generate_process_graph
|
72
|
+
from .egeria_my_client import EgeriaMy
|
73
|
+
from .egeria_cat_client import EgeriaCat
|
74
|
+
from .egeria_tech_client import EgeriaTech
|
75
|
+
from .egeria_config_client import EgeriaConfig
|
72
76
|
|
73
77
|
|
74
78
|
#
|