pyegeria 5.4.7.2__py3-none-any.whl → 5.4.7.4__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/dr_egeria_md.py +1 -1
- commands/cat/list_format_set.py +6 -1
- commands/ops/list_catalog_targets.py +17 -14
- commands/ops/monitor_engine_activity.py +1 -1
- commands/ops/monitor_engine_activity_c.py +1 -1
- commands/tech/list_gov_action_processes.py +4 -8
- md_processing/dr_egeria.py +1 -1
- md_processing/md_commands/ext_ref_commands.py +1 -2
- md_processing/md_commands/glossary_commands.py +1 -2
- md_processing/md_commands/project_commands.py +1 -2
- pyegeria/__init__.py +3 -95
- pyegeria/_client_new.py +422 -13
- pyegeria/_globals.py +95 -1
- pyegeria/_output_formats.py +1 -1
- pyegeria/asset_catalog_omvs.py +1 -1
- pyegeria/automated_curation.py +33 -92
- pyegeria/classification_manager.py +5636 -0
- pyegeria/classification_manager_omvs.py +1989 -1853
- pyegeria/collection_manager.py +16 -4
- pyegeria/data_designer.py +1 -2
- pyegeria/egeria_tech_client.py +3 -0
- pyegeria/external_references.py +2 -2
- pyegeria/format_set_executor.py +8 -9
- pyegeria/full_omag_server_config.py +1 -1
- pyegeria/glossary_manager.py +2 -2
- pyegeria/mcp_adapter.py +1 -1
- pyegeria/mcp_server.py +36 -21
- pyegeria/md_processing_utils.py +3 -3
- pyegeria/md_processing_utils_orig.py +3 -3
- pyegeria/mermaid_utilities.py +0 -152
- pyegeria/models.py +5 -0
- pyegeria/output_formatter.py +1 -1
- pyegeria/runtime_manager_omvs.py +1 -1
- pyegeria/solution_architect.py +1 -1
- {pyegeria-5.4.7.2.dist-info → pyegeria-5.4.7.4.dist-info}/METADATA +1 -1
- {pyegeria-5.4.7.2.dist-info → pyegeria-5.4.7.4.dist-info}/RECORD +40 -40
- pyegeria/md_processing_helpers.py +0 -58
- {pyegeria-5.4.7.2.dist-info → pyegeria-5.4.7.4.dist-info}/WHEEL +0 -0
- {pyegeria-5.4.7.2.dist-info → pyegeria-5.4.7.4.dist-info}/entry_points.txt +0 -0
- {pyegeria-5.4.7.2.dist-info → pyegeria-5.4.7.4.dist-info}/licenses/LICENSE +0 -0
- {pyegeria-5.4.7.2.dist-info → pyegeria-5.4.7.4.dist-info}/top_level.txt +0 -0
pyegeria/collection_manager.py
CHANGED
@@ -93,8 +93,20 @@ class DigitalProductProperties(CollectionProperties):
|
|
93
93
|
next_version_date: datetime | None = None
|
94
94
|
withdrawal_date: datetime | None = None
|
95
95
|
|
96
|
+
class DigitalProductFamilyProperties(CollectionProperties):
|
97
|
+
class_: Annotated[Literal["DigitalProductFamilyProperties"], Field(alias="class")]
|
98
|
+
user_defined_status: str | None = None
|
99
|
+
product_name: str | None = None
|
100
|
+
identifier: str | None = None
|
101
|
+
introduction_date: datetime | None = None
|
102
|
+
maturity: str | None = None
|
103
|
+
service_life: str | None = None
|
104
|
+
next_version_date: datetime | None = None
|
105
|
+
withdrawal_date: datetime | None = None
|
106
|
+
|
107
|
+
|
96
108
|
class Collections(PyegeriaModel):
|
97
|
-
collection: Union[CollectionProperties, DigitalSubscriptionProperties, DigitalProductProperties, AgreementProperties,
|
109
|
+
collection: Union[CollectionProperties, DigitalSubscriptionProperties, DigitalProductProperties, DigitalProductFamilyProperties,AgreementProperties,
|
98
110
|
DataSpecProperties, DataDictionaryProperties] = Field(desciminator="class_")
|
99
111
|
|
100
112
|
|
@@ -129,8 +141,8 @@ class CollectionManager(Client2):
|
|
129
141
|
|
130
142
|
|
131
143
|
Client2.__init__(self, view_server, platform_url, user_id, user_pwd, token)
|
132
|
-
result = self.get_platform_origin()
|
133
|
-
logger.info(f"CollectionManager initialized, platform origin is: {result}")
|
144
|
+
# result = self.get_platform_origin()
|
145
|
+
# logger.info(f"CollectionManager initialized, platform origin is: {result}")
|
134
146
|
self.collection_command_root: str = (
|
135
147
|
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/collections")
|
136
148
|
#
|
@@ -5505,7 +5517,7 @@ class CollectionManager(Client2):
|
|
5505
5517
|
# finally, construct a list of member information
|
5506
5518
|
for member_rel in members:
|
5507
5519
|
member_guid = member_rel["elementHeader"]["guid"]
|
5508
|
-
member = await self.
|
5520
|
+
member = await self.async_get_element_by_guid_(member_guid)
|
5509
5521
|
if isinstance(member, dict):
|
5510
5522
|
member_instance = {
|
5511
5523
|
"name": member["properties"].get('displayName', ''),
|
pyegeria/data_designer.py
CHANGED
@@ -11,8 +11,7 @@ import asyncio
|
|
11
11
|
|
12
12
|
from loguru import logger
|
13
13
|
|
14
|
-
from pyegeria import Client2
|
15
|
-
from pyegeria._client import max_paging_size
|
14
|
+
from pyegeria._client_new import max_paging_size, Client2
|
16
15
|
from pyegeria._output_formats import select_output_format_set, get_output_format_type_match
|
17
16
|
from pyegeria.models import (SearchStringRequestBody, FilterRequestBody, GetRequestBody, NewElementRequestBody,
|
18
17
|
TemplateRequestBody,
|
pyegeria/egeria_tech_client.py
CHANGED
@@ -67,6 +67,8 @@ class EgeriaTech:
|
|
67
67
|
self._gov_officer = GovernanceOfficer(view_server, platform_url, user_id, user_pwd, token)
|
68
68
|
self._collections = CollectionManager(view_server, platform_url, user_id, user_pwd, token)
|
69
69
|
self._external_references = ExternalReferences(view_server, platform_url, user_id, user_pwd, token)
|
70
|
+
self._classification_manager = ClassificationManager(view_server, platform_url, user_id, user_pwd, token)
|
71
|
+
|
70
72
|
|
71
73
|
self._subclients = [
|
72
74
|
self._auto_curate,
|
@@ -82,6 +84,7 @@ class EgeriaTech:
|
|
82
84
|
self._gov_officer,
|
83
85
|
self._collections,
|
84
86
|
self._external_references,
|
87
|
+
self._classification_manager
|
85
88
|
]
|
86
89
|
self.NO_ELEMENTS_FOUND = NO_ELEMENTS_FOUND
|
87
90
|
|
pyegeria/external_references.py
CHANGED
@@ -72,8 +72,8 @@ class ExternalReferences(Client2):
|
|
72
72
|
self.user_pwd = user_pwd
|
73
73
|
|
74
74
|
Client2.__init__(self, view_server, platform_url, user_id, user_pwd, token)
|
75
|
-
result = self.get_platform_origin()
|
76
|
-
logger.info(f"ExternalReferences initialized, platform origin is: {result}")
|
75
|
+
# result = self.get_platform_origin()
|
76
|
+
# logger.info(f"ExternalReferences initialized, platform origin is: {result}")
|
77
77
|
self.command_root: str = (
|
78
78
|
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/external-references")
|
79
79
|
|
pyegeria/format_set_executor.py
CHANGED
@@ -20,13 +20,11 @@ from typing import Any, Dict, Optional
|
|
20
20
|
|
21
21
|
from loguru import logger
|
22
22
|
|
23
|
-
from pyegeria import
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
NO_ELEMENTS_FOUND,
|
29
|
-
)
|
23
|
+
from pyegeria.egeria_tech_client import EgeriaTech
|
24
|
+
from pyegeria.collection_manager import CollectionManager
|
25
|
+
from pyegeria.governance_officer import GovernanceOfficer
|
26
|
+
from pyegeria.glossary_manager import GlossaryManager
|
27
|
+
from pyegeria._globals import NO_ELEMENTS_FOUND
|
30
28
|
from pyegeria.config import settings
|
31
29
|
from pyegeria.external_references import ExternalReferences
|
32
30
|
from pyegeria._exceptions_new import PyegeriaException
|
@@ -93,6 +91,8 @@ async def _async_run_report(
|
|
93
91
|
- {"kind":"unknown","raw": any}
|
94
92
|
"""
|
95
93
|
params = dict(params or {})
|
94
|
+
user_name = egeria_client.user_id
|
95
|
+
user_pwd = egeria_client.user_pwd
|
96
96
|
|
97
97
|
# Resolve the format set and action
|
98
98
|
fmt = select_output_format_set(report_name, output_format)
|
@@ -141,7 +141,6 @@ async def _async_run_report(
|
|
141
141
|
|
142
142
|
|
143
143
|
try:
|
144
|
-
egeria_client.create_egeria_bearer_token()
|
145
144
|
func = getattr(egeria_client, method_name) if method_name and hasattr(egeria_client, method_name) else None
|
146
145
|
# Add logging to validate func
|
147
146
|
msg = f"DEBUG: func={func}, method_name={method_name}, client_class={client_class}"
|
@@ -152,7 +151,7 @@ async def _async_run_report(
|
|
152
151
|
raise TypeError(
|
153
152
|
f"Resolved function '{method_name}' not found in client class '{client_class.__name__}' is not callable."
|
154
153
|
)
|
155
|
-
|
154
|
+
token = await egeria_client._async_create_egeria_bearer_token(user_name, user_pwd)
|
156
155
|
result = await func(**call_params)
|
157
156
|
|
158
157
|
if not result or result == NO_ELEMENTS_FOUND:
|
@@ -9,7 +9,7 @@ Copyright Contributors to the ODPi Egeria project.
|
|
9
9
|
import json
|
10
10
|
from pyegeria.utils import body_slimmer
|
11
11
|
from pyegeria._client import Client
|
12
|
-
from pyegeria import TEMPLATE_GUIDS, max_paging_size
|
12
|
+
from pyegeria._globals import TEMPLATE_GUIDS, INTEGRATION_GUIDS, max_paging_size
|
13
13
|
from pyegeria._exceptions import InvalidParameterException
|
14
14
|
from pyegeria._globals import enable_ssl_check
|
15
15
|
from pyegeria._validators import validate_name, validate_url
|
pyegeria/glossary_manager.py
CHANGED
@@ -95,8 +95,8 @@ class GlossaryManager(CollectionManager):
|
|
95
95
|
|
96
96
|
|
97
97
|
CollectionManager.__init__(self, view_server, platform_url, user_id, user_pwd, token)
|
98
|
-
result = self.get_platform_origin()
|
99
|
-
logger.info(f"GlossaryManager initialized, platform origin is: {result}")
|
98
|
+
# result = self.get_platform_origin()
|
99
|
+
# logger.info(f"GlossaryManager initialized, platform origin is: {result}")
|
100
100
|
self.glossary_command_root = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager"
|
101
101
|
#
|
102
102
|
# Get Valid Values for Enumerations
|
pyegeria/mcp_adapter.py
CHANGED
@@ -97,7 +97,7 @@ def run_report(
|
|
97
97
|
# Lazy import of settings to avoid circulars when optional args are None
|
98
98
|
from pyegeria.config import settings as _settings
|
99
99
|
logger.info(f"Format set: {report}\nparams: {json.dumps(params)}\nview_server: {view_server}\nview_url: {view_url}\nuser: {user}\nuser_pass: {user_pass}")
|
100
|
-
return
|
100
|
+
return exec_format_set(
|
101
101
|
format_set_name=report,
|
102
102
|
output_format="DICT",
|
103
103
|
params=params or {},
|
pyegeria/mcp_server.py
CHANGED
@@ -5,11 +5,18 @@ This module provides a basic MCP server for Egeria.
|
|
5
5
|
"""
|
6
6
|
import re
|
7
7
|
import sys
|
8
|
+
import nest_asyncio
|
9
|
+
|
8
10
|
from typing import Any, Dict, Optional
|
9
11
|
|
12
|
+
from mcp.server.fastmcp.exceptions import ValidationError
|
13
|
+
|
10
14
|
from pyegeria.egeria_tech_client import EgeriaTech
|
15
|
+
from pyegeria._exceptions_new import print_validation_error
|
16
|
+
|
11
17
|
|
12
18
|
GLOBAL_EGERIA_CLIENT: Optional[EgeriaTech] = None
|
19
|
+
nest_asyncio.apply()
|
13
20
|
|
14
21
|
try:
|
15
22
|
# We use Optional[] and List[] types, so we import them.
|
@@ -42,16 +49,22 @@ def main() -> None:
|
|
42
49
|
"""
|
43
50
|
print("DEBUG: Initializing Egeria client...", file=sys.stderr)
|
44
51
|
from pyegeria.config import settings as _settings
|
52
|
+
user_id = _settings.User_Profile.user_name
|
53
|
+
user_pwd = _settings.User_Profile.user_pwd
|
45
54
|
|
46
55
|
GLOBAL_EGERIA_CLIENT = EgeriaTech(
|
47
56
|
_settings.Environment.egeria_view_server,
|
48
57
|
_settings.Environment.egeria_view_server_url,
|
49
|
-
|
50
|
-
|
58
|
+
user_id,
|
59
|
+
user_pwd
|
51
60
|
)
|
61
|
+
print("DEBUG: Egeria Client initialized", file=sys.stderr)
|
52
62
|
GLOBAL_EGERIA_CLIENT.create_egeria_bearer_token("erinoverview","secret")
|
53
63
|
print("DEBUG: Egeria Client connected", file=sys.stderr)
|
54
64
|
|
65
|
+
except ValidationError as e:
|
66
|
+
print_validation_error(e)
|
67
|
+
raise
|
55
68
|
except Exception as e:
|
56
69
|
print(f"DEBUG: Exception occurred: {str(e)}", file=sys.stderr)
|
57
70
|
raise
|
@@ -89,6 +102,9 @@ def main() -> None:
|
|
89
102
|
ignore_case: Optional[bool] = None,
|
90
103
|
output_format: str = "DICT"
|
91
104
|
) -> Dict[str, Any]:
|
105
|
+
import asyncio
|
106
|
+
import nest_asyncio
|
107
|
+
nest_asyncio.apply()
|
92
108
|
|
93
109
|
"""Run a report with the specified parameters."""
|
94
110
|
print("DEBUG: Running report...", file=sys.stderr)
|
@@ -118,12 +134,18 @@ def main() -> None:
|
|
118
134
|
|
119
135
|
egeria_client: EgeriaTech = GLOBAL_EGERIA_CLIENT
|
120
136
|
print("DEBUG: Egeria Client connected", file=sys.stderr)
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
137
|
+
result = await asyncio.wait_for(
|
138
|
+
_async_run_report_tool(
|
139
|
+
report=report_name,
|
140
|
+
egeria_client=egeria_client,
|
141
|
+
params=params),
|
142
|
+
timeout=30 # Adjust timeout as needed
|
126
143
|
)
|
144
|
+
# result = await _async_run_report_tool(
|
145
|
+
# report=report_name,
|
146
|
+
# egeria_client=egeria_client,
|
147
|
+
# params=params
|
148
|
+
# )
|
127
149
|
print("DEBUG: run_report completed successfully", file=sys.stderr)
|
128
150
|
return _ok(result)
|
129
151
|
except Exception as e:
|
@@ -132,7 +154,7 @@ def main() -> None:
|
|
132
154
|
raise
|
133
155
|
|
134
156
|
@srv.tool(name="prompt")
|
135
|
-
def natural_language_prompt(prompt: str) -> Dict[str, Any]:
|
157
|
+
async def natural_language_prompt(prompt: str) -> Dict[str, Any]:
|
136
158
|
"""
|
137
159
|
Handles natural language queries from the user.
|
138
160
|
In a production environment, this would call an LLM API.
|
@@ -142,11 +164,9 @@ def main() -> None:
|
|
142
164
|
# Example of simple logic: If the user asks to list reports, delegate to the tool.
|
143
165
|
if "list" in prompt.lower() and "reports" in prompt.lower():
|
144
166
|
print("DEBUG: Delegating prompt to list_reports tool.", file=sys.stderr)
|
145
|
-
return list_reports() #
|
167
|
+
return list_reports() # This is sync, so no await needed
|
146
168
|
elif "run" in prompt.lower() and "report" in prompt.lower():
|
147
169
|
print("DEBUG: Delegating prompt to run_report tool.", file=sys.stderr)
|
148
|
-
# Simple entity extraction for report name (Requires more robust logic in reality!)
|
149
|
-
# Let's assume the report name is the word immediately following "report"
|
150
170
|
|
151
171
|
match = re.search(r'report\s+([a-zA-Z0-9]+)', prompt, re.IGNORECASE)
|
152
172
|
report_name = match.group(1) if match else None
|
@@ -154,37 +174,32 @@ def main() -> None:
|
|
154
174
|
if report_name:
|
155
175
|
print(f"DEBUG: Extracted report name: {report_name}", file=sys.stderr)
|
156
176
|
|
157
|
-
# Use another simple regex to look for page size
|
158
177
|
page_size_match = re.search(r'page size of\s+(\d+)', prompt, re.IGNORECASE)
|
159
178
|
page_size = int(page_size_match.group(1)) if page_size_match else None
|
160
179
|
|
161
180
|
search_match = re.search(r'search for\s+(.*?)(?:\s+in\s+report|\.|$)', prompt, re.IGNORECASE)
|
162
181
|
|
163
182
|
if search_match:
|
164
|
-
# Extract the content captured by the group (.*?)
|
165
183
|
search_string = search_match.group(1).strip()
|
166
184
|
|
167
|
-
# Check if the search string is meaningful
|
168
185
|
if search_string:
|
169
|
-
# Use a default report for demonstration purposes
|
170
|
-
|
171
186
|
print(
|
172
187
|
f"DEBUG: Delegating prompt to run_report tool. Report: {report_name}, Search: '{search_string}'",
|
173
188
|
file=sys.stderr)
|
174
189
|
|
175
|
-
#
|
176
|
-
return run_report_tool(
|
190
|
+
# AWAIT the async function call
|
191
|
+
return await run_report_tool(
|
177
192
|
report_name=report_name,
|
178
193
|
page_size=page_size,
|
179
194
|
search_string=search_string
|
180
195
|
)
|
181
196
|
|
182
|
-
#
|
183
|
-
return run_report_tool(
|
197
|
+
# AWAIT the async function call
|
198
|
+
return await run_report_tool(
|
184
199
|
report_name=report_name,
|
185
200
|
page_size=page_size
|
186
201
|
)
|
187
|
-
|
202
|
+
|
188
203
|
return {
|
189
204
|
"response": f"Acknowledged natural language query: '{prompt}'. This would be sent to an LLM."
|
190
205
|
}
|
pyegeria/md_processing_utils.py
CHANGED
@@ -15,14 +15,14 @@ from rich import print
|
|
15
15
|
from rich.console import Console
|
16
16
|
from rich.markdown import Markdown
|
17
17
|
|
18
|
-
from pyegeria import body_slimmer
|
18
|
+
from pyegeria.utils import body_slimmer
|
19
19
|
from pyegeria._globals import (NO_GLOSSARIES_FOUND, NO_ELEMENTS_FOUND, NO_PROJECTS_FOUND, NO_CATEGORIES_FOUND, DEBUG_LEVEL)
|
20
20
|
from pyegeria.egeria_tech_client import EgeriaTech
|
21
|
-
from md_processing.md_processing_utils.md_processing_constants import (
|
21
|
+
from md_processing.md_processing_utils.md_processing_constants import (
|
22
22
|
pre_command, EXISTS_REQUIRED, load_commands, get_command_spec, get_attribute, get_attribute_labels, get_alternate_names)
|
23
23
|
|
24
24
|
|
25
|
-
from pyegeria.
|
25
|
+
from pyegeria.project_manager import ProjectManager
|
26
26
|
|
27
27
|
ALWAYS = "ALWAYS"
|
28
28
|
ERROR = "ERROR"
|
@@ -17,11 +17,11 @@ from rich import box, print
|
|
17
17
|
from rich.console import Console
|
18
18
|
from rich.markdown import Markdown
|
19
19
|
|
20
|
-
from pyegeria import body_slimmer
|
20
|
+
from pyegeria.utils import body_slimmer
|
21
21
|
from pyegeria._globals import NO_TERMS_FOUND, NO_GLOSSARIES_FOUND, NO_TERMS_FOUND, NO_ELEMENTS_FOUND, NO_PROJECTS_FOUND, NO_CATEGORIES_FOUND
|
22
22
|
from pyegeria.egeria_tech_client import EgeriaTech
|
23
|
-
from pyegeria.
|
24
|
-
from pyegeria.
|
23
|
+
from pyegeria.project_manager import ProjectManager
|
24
|
+
from pyegeria.glossary_manager import GlossaryManager
|
25
25
|
|
26
26
|
from datetime import datetime
|
27
27
|
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
pyegeria/mermaid_utilities.py
CHANGED
@@ -21,14 +21,6 @@ nest_asyncio.apply()
|
|
21
21
|
from IPython.display import HTML, display
|
22
22
|
from rich.console import Console
|
23
23
|
|
24
|
-
from pyegeria.automated_curation import AutomatedCuration
|
25
|
-
from pyegeria._exceptions import (
|
26
|
-
InvalidParameterException,
|
27
|
-
PropertyServerException,
|
28
|
-
UserNotAuthorizedException,
|
29
|
-
)
|
30
|
-
from pyegeria._globals import NO_ELEMENTS_FOUND
|
31
|
-
|
32
24
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
33
25
|
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
34
26
|
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
@@ -1252,147 +1244,3 @@ def save_mermaid_graph(title, mermaid_str, folder: str = EGERIA_MERMAID_FOLDER):
|
|
1252
1244
|
return mermaid_file
|
1253
1245
|
|
1254
1246
|
|
1255
|
-
def generate_process_graph(
|
1256
|
-
process_guid: str,
|
1257
|
-
view_server: str = EGERIA_VIEW_SERVER,
|
1258
|
-
url: str = EGERIA_VIEW_SERVER_URL,
|
1259
|
-
user_id: str = EGERIA_USER,
|
1260
|
-
user_pass: str = EGERIA_USER_PASSWORD,
|
1261
|
-
) -> str:
|
1262
|
-
"""Generate Mermaid Markdown text reflecting the Egeria process graph identified by the GUID
|
1263
|
-
|
1264
|
-
Parameters
|
1265
|
-
----------
|
1266
|
-
process_guid: str
|
1267
|
-
The identity of the progress to generate a graph of.
|
1268
|
-
|
1269
|
-
Returns
|
1270
|
-
-------
|
1271
|
-
str
|
1272
|
-
|
1273
|
-
A Mermaid markdown string
|
1274
|
-
|
1275
|
-
Raises
|
1276
|
-
------
|
1277
|
-
|
1278
|
-
InvalidParameterException
|
1279
|
-
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1280
|
-
PropertyServerException
|
1281
|
-
Raised by the server when an issue arises in processing a valid request
|
1282
|
-
NotAuthorizedException
|
1283
|
-
The principle specified by the user_id does not have authorization for the requested action
|
1284
|
-
|
1285
|
-
"""
|
1286
|
-
console = Console()
|
1287
|
-
a_client = AutomatedCuration(view_server, url, user_id, user_pass)
|
1288
|
-
token = a_client.create_egeria_bearer_token()
|
1289
|
-
try:
|
1290
|
-
start_time = time.perf_counter()
|
1291
|
-
response = a_client.get_gov_action_process_graph(process_guid)
|
1292
|
-
duration = time.perf_counter() - start_time
|
1293
|
-
|
1294
|
-
if type(response) is dict:
|
1295
|
-
process_steps: [dict]
|
1296
|
-
step_links: [dict] = []
|
1297
|
-
gov_process_qn = response["governanceActionProcess"]["processProperties"][
|
1298
|
-
"qualifiedName"
|
1299
|
-
]
|
1300
|
-
gov_process_dn = response["governanceActionProcess"]["processProperties"][
|
1301
|
-
"displayName"
|
1302
|
-
]
|
1303
|
-
|
1304
|
-
md = f"\n---\ntitle: {gov_process_dn}\n---\nflowchart LR\n"
|
1305
|
-
header = '%%{init: {"flowchart": {"htmlLabels": false}} }%%\n'
|
1306
|
-
md += header
|
1307
|
-
element = response["firstProcessStep"]["element"]
|
1308
|
-
qname = element["processStepProperties"]["qualifiedName"]
|
1309
|
-
dname = element["processStepProperties"]["displayName"]
|
1310
|
-
domain_id = element["processStepProperties"]["domainIdentifier"]
|
1311
|
-
guid = element["elementHeader"]["guid"]
|
1312
|
-
wait = element["processStepProperties"]["waitTime"]
|
1313
|
-
ignore_mult_trig = element["processStepProperties"][
|
1314
|
-
"ignoreMultipleTriggers"
|
1315
|
-
]
|
1316
|
-
link = response["firstProcessStep"]["linkGUID"]
|
1317
|
-
|
1318
|
-
md = f'{md}\nStep1("`**{dname}**\n*nwait_time*: {wait}\n*nmult_trig*: {ignore_mult_trig}`")'
|
1319
|
-
process_steps = {
|
1320
|
-
qname: {
|
1321
|
-
"step": "Step1",
|
1322
|
-
"displayName": dname,
|
1323
|
-
"guid": guid,
|
1324
|
-
"domain": domain_id,
|
1325
|
-
"ignoreMultTrig": ignore_mult_trig,
|
1326
|
-
"waitTime": wait,
|
1327
|
-
"link_guid": link,
|
1328
|
-
}
|
1329
|
-
}
|
1330
|
-
next_steps = response.get("nextProcessSteps", None)
|
1331
|
-
if next_steps is not None:
|
1332
|
-
i = 1
|
1333
|
-
for step in next_steps:
|
1334
|
-
i += 1
|
1335
|
-
qname = step["processStepProperties"]["qualifiedName"]
|
1336
|
-
dname = step["processStepProperties"]["displayName"]
|
1337
|
-
wait = step["processStepProperties"]["waitTime"]
|
1338
|
-
step = f"Step{i}"
|
1339
|
-
md = f'{md}\n{step}("`**{dname}**\n*wait_time*: {wait}\n*mult_trig*: {ignore_mult_trig}`")'
|
1340
|
-
process_steps.update(
|
1341
|
-
{
|
1342
|
-
qname: {
|
1343
|
-
"step": step,
|
1344
|
-
"displayName": dname,
|
1345
|
-
"guid": guid,
|
1346
|
-
"domain": domain_id,
|
1347
|
-
"ignoreMultTrig": ignore_mult_trig,
|
1348
|
-
"waitTime": wait,
|
1349
|
-
}
|
1350
|
-
}
|
1351
|
-
) # process_steps.append({qname: {"step": step,"displayName": dname, "waitTime": wait}})
|
1352
|
-
# print(md)
|
1353
|
-
# Now process the links
|
1354
|
-
process_step_links = response.get("processStepLinks", None)
|
1355
|
-
if process_step_links is not None:
|
1356
|
-
for slink in process_step_links:
|
1357
|
-
prev_step_name = slink["previousProcessStep"]["uniqueName"]
|
1358
|
-
next_step_name = slink["nextProcessStep"]["uniqueName"]
|
1359
|
-
next_step_link_guid = slink["nextProcessStepLinkGUID"]
|
1360
|
-
guard = slink["guard"]
|
1361
|
-
mandatory_guard = slink["mandatoryGuard"]
|
1362
|
-
# print(f"\n\n Links: prev_step: {prev_step_name}\t next_step: {next_step_name}\t next_step_link:
|
1363
|
-
# {next_step_link_guid}\t Guard: {guard}\t mandatory_guard: {mandatory_guard}")
|
1364
|
-
step_links.append(
|
1365
|
-
{
|
1366
|
-
next_step_link_guid: {
|
1367
|
-
"prev_step_name": prev_step_name,
|
1368
|
-
"next_step_name": next_step_name,
|
1369
|
-
"guard": guard,
|
1370
|
-
"mandatory_guard": mandatory_guard,
|
1371
|
-
}
|
1372
|
-
}
|
1373
|
-
)
|
1374
|
-
step_p = process_steps[prev_step_name]["step"]
|
1375
|
-
step_n = process_steps[next_step_name]["step"]
|
1376
|
-
if mandatory_guard:
|
1377
|
-
link = f"Mandatory:{guard}"
|
1378
|
-
else:
|
1379
|
-
link = guard
|
1380
|
-
md = f"{md}\n{step_p}-->|{link}|{step_n}"
|
1381
|
-
i = 1
|
1382
|
-
|
1383
|
-
return md
|
1384
|
-
|
1385
|
-
elif type(response) is str:
|
1386
|
-
console.log("\n\n" + response)
|
1387
|
-
assert True
|
1388
|
-
|
1389
|
-
except (
|
1390
|
-
InvalidParameterException,
|
1391
|
-
PropertyServerException,
|
1392
|
-
UserNotAuthorizedException,
|
1393
|
-
) as e:
|
1394
|
-
console.print_exception(show_locals=True)
|
1395
|
-
assert False, "Invalid request"
|
1396
|
-
|
1397
|
-
finally:
|
1398
|
-
a_client.close_session()
|
pyegeria/models.py
CHANGED
@@ -378,6 +378,11 @@ class ResultsRequestBody(GetRequestBody):
|
|
378
378
|
start_from: int = 0
|
379
379
|
page_size: int = 0
|
380
380
|
|
381
|
+
class LevelIdentifierQueryBody(ResultsRequestBody):
|
382
|
+
class_: Annotated[Literal["LevelIdentifierQueryProperties"], Field(alias="class")]
|
383
|
+
return_specific_level: bool = True
|
384
|
+
level_identifier: int
|
385
|
+
|
381
386
|
class FilterRequestBody(ResultsRequestBody):
|
382
387
|
class_: Annotated[Literal["FilterRequestBody"], Field(alias="class")]
|
383
388
|
filter: str
|
pyegeria/output_formatter.py
CHANGED
@@ -8,7 +8,7 @@ from loguru import logger
|
|
8
8
|
from pyegeria.config import settings
|
9
9
|
|
10
10
|
from pyegeria.mermaid_utilities import construct_mermaid_web
|
11
|
-
from pyegeria._output_formats import select_output_format_set, MD_SEPARATOR
|
11
|
+
from pyegeria._output_formats import select_output_format_set, MD_SEPARATOR, get_output_format_type_match
|
12
12
|
from pyegeria.models import to_camel_case
|
13
13
|
|
14
14
|
"""
|
pyegeria/runtime_manager_omvs.py
CHANGED
@@ -11,7 +11,7 @@ import asyncio
|
|
11
11
|
from requests import Response
|
12
12
|
from pyegeria.utils import body_slimmer
|
13
13
|
from pyegeria._client_new import Client2
|
14
|
-
from pyegeria import TEMPLATE_GUIDS, max_paging_size,default_time_out
|
14
|
+
from pyegeria._globals import TEMPLATE_GUIDS, max_paging_size,default_time_out
|
15
15
|
from pyegeria._exceptions_new import PyegeriaInvalidParameterException
|
16
16
|
from pyegeria._globals import NO_ELEMENTS_FOUND
|
17
17
|
|
pyegeria/solution_architect.py
CHANGED
@@ -19,7 +19,7 @@ from pyegeria.models import NewElementRequestBody, TemplateRequestBody, UpdateEl
|
|
19
19
|
from pyegeria.output_formatter import make_preamble, make_md_attribute, generate_output, extract_mermaid_only, \
|
20
20
|
extract_basic_dict, MD_SEPARATOR, populate_common_columns
|
21
21
|
from pyegeria._output_formats import select_output_format_set, get_output_format_type_match
|
22
|
-
from pyegeria import validate_guid
|
22
|
+
from pyegeria._validators import validate_guid
|
23
23
|
from pyegeria.governance_officer import GovernanceOfficer
|
24
24
|
from pyegeria._client_new import Client2, max_paging_size
|
25
25
|
from pyegeria._globals import NO_ELEMENTS_FOUND, NO_GUID_RETURNED
|