pyegeria 5.4.7.3__py3-none-any.whl → 5.4.7.5__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.
Files changed (45) hide show
  1. commands/cat/dr_egeria_md.py +1 -1
  2. commands/cat/list_format_set.py +6 -1
  3. commands/ops/__init__.py +0 -2
  4. commands/ops/list_catalog_targets.py +17 -15
  5. commands/ops/load_archive.py +3 -3
  6. commands/ops/monitor_engine_activity.py +1 -1
  7. commands/ops/monitor_engine_activity_c.py +1 -1
  8. commands/tech/__init__.py +0 -2
  9. commands/tech/list_gov_action_processes.py +4 -8
  10. md_processing/dr_egeria.py +1 -1
  11. md_processing/md_commands/ext_ref_commands.py +1 -2
  12. md_processing/md_commands/glossary_commands.py +1 -2
  13. md_processing/md_commands/project_commands.py +1 -2
  14. pyegeria/__init__.py +4 -96
  15. pyegeria/_client_new.py +658 -64
  16. pyegeria/_globals.py +95 -1
  17. pyegeria/_output_formats.py +1 -1
  18. pyegeria/asset_catalog_omvs.py +1 -1
  19. pyegeria/automated_curation.py +788 -857
  20. pyegeria/classification_manager.py +7212 -0
  21. pyegeria/classification_manager_omvs.py +1989 -1853
  22. pyegeria/collection_manager.py +14 -2
  23. pyegeria/data_designer.py +1 -2
  24. pyegeria/egeria_tech_client.py +3 -0
  25. pyegeria/external_references.py +1 -1
  26. pyegeria/format_set_executor.py +8 -9
  27. pyegeria/full_omag_server_config.py +1 -1
  28. pyegeria/mcp_adapter.py +1 -1
  29. pyegeria/mcp_server.py +36 -21
  30. pyegeria/md_processing_utils.py +3 -3
  31. pyegeria/md_processing_utils_orig.py +3 -3
  32. pyegeria/mermaid_utilities.py +0 -152
  33. pyegeria/models.py +5 -0
  34. pyegeria/output_formatter.py +1 -1
  35. pyegeria/project_manager.py +8 -0
  36. pyegeria/reference_data.py +4 -0
  37. pyegeria/runtime_manager_omvs.py +1 -1
  38. pyegeria/solution_architect.py +1 -1
  39. {pyegeria-5.4.7.3.dist-info → pyegeria-5.4.7.5.dist-info}/METADATA +1 -1
  40. {pyegeria-5.4.7.3.dist-info → pyegeria-5.4.7.5.dist-info}/RECORD +44 -44
  41. pyegeria/md_processing_helpers.py +0 -58
  42. {pyegeria-5.4.7.3.dist-info → pyegeria-5.4.7.5.dist-info}/WHEEL +0 -0
  43. {pyegeria-5.4.7.3.dist-info → pyegeria-5.4.7.5.dist-info}/entry_points.txt +0 -0
  44. {pyegeria-5.4.7.3.dist-info → pyegeria-5.4.7.5.dist-info}/licenses/LICENSE +0 -0
  45. {pyegeria-5.4.7.3.dist-info → pyegeria-5.4.7.5.dist-info}/top_level.txt +0 -0
@@ -10,16 +10,25 @@ import asyncio
10
10
  import datetime
11
11
 
12
12
  from httpx import Response
13
-
13
+ from loguru import logger
14
+ from pydantic import HttpUrl
15
+ from pyegeria._globals import NO_ELEMENTS_FOUND
14
16
  from pyegeria._client_new import Client2
15
- from pyegeria._exceptions import (
16
- InvalidParameterException,
17
- PropertyServerException,
18
- UserNotAuthorizedException,
19
- )
20
- from pyegeria.models import GetRequestBody, FilterRequestBody
17
+ from pyegeria._validators import validate_guid, validate_name, validate_search_string
18
+ # from pyegeria._exceptions import (
19
+ # InvalidParameterException,
20
+ # PropertyServerException,
21
+ # UserNotAuthorizedException,
22
+ # )
23
+ from pyegeria.models import GetRequestBody, FilterRequestBody, SearchStringRequestBody
21
24
  from pyegeria.utils import body_slimmer
22
- from ._validators import validate_guid, validate_name, validate_search_string
25
+ from pyegeria._output_formats import select_output_format_set, get_output_format_type_match
26
+ from pyegeria.output_formatter import (
27
+ generate_output,
28
+ _extract_referenceable_properties,
29
+ populate_columns_from_properties,
30
+ get_required_relationships,
31
+ )
23
32
 
24
33
 
25
34
  class AutomatedCuration(Client2):
@@ -54,6 +63,350 @@ class AutomatedCuration(Client2):
54
63
  Client2.__init__(self, view_server, platform_url, user_id, user_pwd, token=token)
55
64
  self.curation_command_root = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/automated-curation"
56
65
 
66
+ # Default entity label used by the output formatter for Technology Types
67
+ self.TECH_TYPE_ENTITY_LABEL = "TechType"
68
+ self.GOV_ACTION_TYPE_LABEL = "GovActionType"
69
+ self.CATALOG_TARGET_LABEL = "CatalogTarget"
70
+ self.ENGINE_ACTION_LABEL = "EngineAction"
71
+ self.GOV_ACTION_PROCESS_LABEL = "GovActionProcess"
72
+
73
+ def _extract_tech_type_properties(self, element: dict, columns_struct: dict) -> dict:
74
+ """
75
+ Extract properties from a technology type element and populate the provided columns_struct.
76
+ Tolerant to missing fields.
77
+ """
78
+ # Populate direct properties first
79
+ col_data = populate_columns_from_properties(element, columns_struct)
80
+ columns_list = col_data.get("formats", {}).get("columns", [])
81
+
82
+ # Referenceable header extraction (GUID, qualifiedName, displayName, etc.)
83
+ header_props = _extract_referenceable_properties(element)
84
+ for column in columns_list:
85
+ key = column.get("key")
86
+ if key in header_props:
87
+ column["value"] = header_props.get(key)
88
+ elif isinstance(key, str) and key.lower() == "guid":
89
+ column["value"] = header_props.get("GUID")
90
+
91
+ # Try common category/type fields
92
+ category = (
93
+ element.get("properties", {}).get("category")
94
+ or element.get("elementProperties", {}).get("category")
95
+ or element.get("elementType", {}).get("typeName")
96
+ or ""
97
+ )
98
+ for column in columns_list:
99
+ if column.get("key") in ("category", "type_name"):
100
+ column["value"] = category
101
+
102
+ # Classification names if present
103
+ class_names = []
104
+ for c in (element.get("elementHeader", {}).get("classifications") or []):
105
+ name = c.get("classificationName")
106
+ if name:
107
+ class_names.append(name)
108
+ if class_names:
109
+ for column in columns_list:
110
+ if column.get("key") == "classifications":
111
+ column["value"] = ", ".join(class_names)
112
+ break
113
+
114
+ # Relationship-driven fields (generic handling)
115
+ col_data = get_required_relationships(element, col_data)
116
+
117
+ # Mermaid graph support if present
118
+ mermaid_val = element.get("mermaidGraph", "") or ""
119
+ for column in columns_list:
120
+ if column.get("key") == "mermaid":
121
+ column["value"] = mermaid_val
122
+ break
123
+
124
+ return col_data
125
+
126
+ def _generate_tech_type_output(
127
+ self,
128
+ elements: dict | list[dict],
129
+ filter: str | None,
130
+ element_type_name: str | None,
131
+ output_format: str = "DICT",
132
+ output_format_set: dict | str | None = None,
133
+ ) -> str | list[dict]:
134
+ """Generate output for technology types in the specified format."""
135
+ entity_type = element_type_name or self.TECH_TYPE_ENTITY_LABEL
136
+
137
+ # Resolve output format set
138
+ get_additional_props_func = None
139
+ if output_format_set:
140
+ if isinstance(output_format_set, str):
141
+ output_formats = select_output_format_set(output_format_set, output_format)
142
+ else:
143
+ output_formats = get_output_format_type_match(output_format_set, output_format)
144
+ elif element_type_name:
145
+ output_formats = select_output_format_set(element_type_name, output_format)
146
+ else:
147
+ output_formats = select_output_format_set(entity_type, output_format)
148
+
149
+ if output_formats is None:
150
+ output_formats = select_output_format_set("Default", output_format)
151
+
152
+ # Optional hook for extra server calls to enrich rows
153
+ get_additional_props_name = (
154
+ output_formats.get("get_additional_props", {}).get("function") if output_formats else None
155
+ )
156
+ if isinstance(get_additional_props_name, str):
157
+ parts = get_additional_props_name.split(".")
158
+ method_name = parts[-1] if parts else None
159
+ if method_name and hasattr(self, method_name):
160
+ get_additional_props_func = getattr(self, method_name)
161
+
162
+ return generate_output(
163
+ elements,
164
+ filter,
165
+ entity_type,
166
+ output_format,
167
+ self._extract_tech_type_properties,
168
+ get_additional_props_func,
169
+ output_formats,
170
+ )
171
+
172
+ def _extract_gov_action_type_properties(self, element: dict, columns_struct: dict) -> dict:
173
+ col_data = populate_columns_from_properties(element, columns_struct)
174
+ columns_list = col_data.get("formats", {}).get("columns", [])
175
+ header_props = _extract_referenceable_properties(element)
176
+ for column in columns_list:
177
+ key = column.get("key")
178
+ if key in header_props:
179
+ column["value"] = header_props.get(key)
180
+ elif isinstance(key, str) and key.lower() == "guid":
181
+ column["value"] = header_props.get("GUID")
182
+ col_data = get_required_relationships(element, col_data)
183
+ mermaid_val = element.get("mermaidGraph", "") or ""
184
+ for column in columns_list:
185
+ if column.get("key") == "mermaid":
186
+ column["value"] = mermaid_val
187
+ break
188
+ return col_data
189
+
190
+ def _generate_gov_action_type_output(self, elements: dict | list[dict], filter: str | None,
191
+ element_type_name: str | None, output_format: str = "DICT",
192
+ output_format_set: dict | str | None = None) -> str | list[dict]:
193
+ entity_type = element_type_name or self.GOV_ACTION_TYPE_LABEL
194
+ get_additional_props_func = None
195
+ if output_format_set:
196
+ if isinstance(output_format_set, str):
197
+ output_formats = select_output_format_set(output_format_set, output_format)
198
+ else:
199
+ output_formats = get_output_format_type_match(output_format_set, output_format)
200
+ elif element_type_name:
201
+ output_formats = select_output_format_set(element_type_name, output_format)
202
+ else:
203
+ output_formats = select_output_format_set(entity_type, output_format)
204
+ if output_formats is None:
205
+ output_formats = select_output_format_set("Default", output_format)
206
+ get_additional_props_name = (
207
+ output_formats.get("get_additional_props", {}).get("function") if output_formats else None
208
+ )
209
+ if isinstance(get_additional_props_name, str):
210
+ method_name = get_additional_props_name.split(".")[-1]
211
+ if hasattr(self, method_name):
212
+ get_additional_props_func = getattr(self, method_name)
213
+ return generate_output(
214
+ elements,
215
+ filter,
216
+ entity_type,
217
+ output_format,
218
+ self._extract_gov_action_type_properties,
219
+ get_additional_props_func,
220
+ output_formats,
221
+ )
222
+
223
+ def _extract_catalog_target_properties(self, element: dict, columns_struct: dict) -> dict:
224
+ col_data = populate_columns_from_properties(element, columns_struct)
225
+ columns_list = col_data.get("formats", {}).get("columns", [])
226
+ header_props = _extract_referenceable_properties(element)
227
+ for column in columns_list:
228
+ key = column.get("key")
229
+ if key in header_props:
230
+ column["value"] = header_props.get(key)
231
+ elif isinstance(key, str) and key.lower() == "guid":
232
+ column["value"] = header_props.get("GUID")
233
+ col_data = get_required_relationships(element, col_data)
234
+ mermaid_val = element.get("mermaidGraph", "") or ""
235
+ for column in columns_list:
236
+ if column.get("key") == "mermaid":
237
+ column["value"] = mermaid_val
238
+ break
239
+ return col_data
240
+
241
+ def _generate_catalog_target_output(self, elements: dict | list[dict], filter: str | None,
242
+ element_type_name: str | None, output_format: str = "DICT",
243
+ output_format_set: dict | str | None = None) -> str | list[dict]:
244
+ entity_type = element_type_name or self.CATALOG_TARGET_LABEL
245
+ get_additional_props_func = None
246
+ if output_format_set:
247
+ if isinstance(output_format_set, str):
248
+ output_formats = select_output_format_set(output_format_set, output_format)
249
+ else:
250
+ output_formats = get_output_format_type_match(output_format_set, output_format)
251
+ elif element_type_name:
252
+ output_formats = select_output_format_set(element_type_name, output_format)
253
+ else:
254
+ output_formats = select_output_format_set(entity_type, output_format)
255
+ if output_formats is None:
256
+ output_formats = select_output_format_set("Default", output_format)
257
+ return generate_output(
258
+ elements,
259
+ filter,
260
+ entity_type,
261
+ output_format,
262
+ self._extract_catalog_target_properties,
263
+ None,
264
+ output_formats,
265
+ )
266
+
267
+ def _extract_engine_action_properties(self, element: dict, columns_struct: dict) -> dict:
268
+ col_data = populate_columns_from_properties(element, columns_struct)
269
+ columns_list = col_data.get("formats", {}).get("columns", [])
270
+ header_props = _extract_referenceable_properties(element)
271
+ for col in columns_list:
272
+ key = col.get("key")
273
+ if key in header_props:
274
+ col["value"] = header_props.get(key)
275
+ elif isinstance(key, str) and key.lower() == "guid":
276
+ col["value"] = header_props.get("GUID")
277
+ # EngineAction specifics: status, process_name, received_guards, completion_guards, request_type
278
+ status = (
279
+ element.get("properties", {}).get("status")
280
+ or element.get("elementProperties", {}).get("status")
281
+ or element.get("status")
282
+ )
283
+ process_name = (
284
+ element.get("properties", {}).get("processName")
285
+ or element.get("elementProperties", {}).get("processName")
286
+ or element.get("processName")
287
+ )
288
+ req_type = (
289
+ element.get("properties", {}).get("requestType")
290
+ or element.get("elementProperties", {}).get("requestType")
291
+ or element.get("requestType")
292
+ )
293
+ rec_guards = element.get("receivedGuards") or element.get("received_guards") or []
294
+ comp_guards = element.get("completionGuards") or element.get("completion_guards") or []
295
+ # assign to columns if present
296
+ for col in columns_list:
297
+ key = col.get("key")
298
+ if key == "status":
299
+ col["value"] = status
300
+ elif key in ("process_name", "processName"):
301
+ col["value"] = process_name
302
+ elif key in ("request_type", "requestType"):
303
+ col["value"] = req_type
304
+ elif key in ("received_guards", "receivedGuards"):
305
+ col["value"] = ", ".join(map(str, rec_guards)) if isinstance(rec_guards, list) else rec_guards
306
+ elif key in ("completion_guards", "completionGuards"):
307
+ col["value"] = ", ".join(map(str, comp_guards)) if isinstance(comp_guards, list) else comp_guards
308
+ col_data = get_required_relationships(element, col_data)
309
+ mermaid_val = element.get("mermaidGraph", "") or ""
310
+ for col in columns_list:
311
+ if col.get("key") == "mermaid":
312
+ col["value"] = mermaid_val
313
+ break
314
+ return col_data
315
+
316
+ def _generate_engine_action_output(self, elements: dict | list[dict], filter: str | None,
317
+ element_type_name: str | None, output_format: str = "DICT",
318
+ output_format_set: dict | str | None = None) -> str | list[dict]:
319
+ entity_type = element_type_name or self.ENGINE_ACTION_LABEL
320
+ get_additional_props_func = None
321
+ if output_format_set:
322
+ if isinstance(output_format_set, str):
323
+ output_formats = select_output_format_set(output_format_set, output_format)
324
+ else:
325
+ output_formats = get_output_format_type_match(output_format_set, output_format)
326
+ elif element_type_name:
327
+ output_formats = select_output_format_set(element_type_name, output_format)
328
+ else:
329
+ output_formats = select_output_format_set(entity_type, output_format)
330
+ if output_formats is None:
331
+ output_formats = select_output_format_set("Default", output_format)
332
+ get_additional_props_name = (
333
+ output_formats.get("get_additional_props", {}).get("function") if output_formats else None
334
+ )
335
+ if isinstance(get_additional_props_name, str):
336
+ method_name = get_additional_props_name.split(".")[-1]
337
+ if hasattr(self, method_name):
338
+ get_additional_props_func = getattr(self, method_name)
339
+ return generate_output(
340
+ elements,
341
+ filter,
342
+ entity_type,
343
+ output_format,
344
+ self._extract_engine_action_properties,
345
+ get_additional_props_func,
346
+ output_formats,
347
+ )
348
+
349
+ def _extract_gov_action_process_properties(self, element: dict, columns_struct: dict) -> dict:
350
+ col_data = populate_columns_from_properties(element, columns_struct)
351
+ columns_list = col_data.get("formats", {}).get("columns", [])
352
+ header_props = _extract_referenceable_properties(element)
353
+ for col in columns_list:
354
+ key = col.get("key")
355
+ if key in header_props:
356
+ col["value"] = header_props.get(key)
357
+ elif isinstance(key, str) and key.lower() == "guid":
358
+ col["value"] = header_props.get("GUID")
359
+ # GAP specifics: processStatus, elementTypeName, stepCount
360
+ proc_status = (
361
+ element.get("properties", {}).get("processStatus")
362
+ or element.get("elementProperties", {}).get("processStatus")
363
+ or element.get("processStatus")
364
+ )
365
+ step_count = (
366
+ element.get("properties", {}).get("stepCount")
367
+ or element.get("elementProperties", {}).get("stepCount")
368
+ or element.get("stepCount")
369
+ )
370
+ for col in columns_list:
371
+ key = col.get("key")
372
+ if key in ("process_status", "processStatus"):
373
+ col["value"] = proc_status
374
+ elif key == "stepCount":
375
+ col["value"] = step_count
376
+ col_data = get_required_relationships(element, col_data)
377
+ mermaid_val = element.get("mermaidGraph", "") or ""
378
+ for col in columns_list:
379
+ if col.get("key") == "mermaid":
380
+ col["value"] = mermaid_val
381
+ break
382
+ return col_data
383
+
384
+ def _generate_gov_action_process_output(self, elements: dict | list[dict], filter: str | None,
385
+ element_type_name: str | None, output_format: str = "DICT",
386
+ output_format_set: dict | str | None = None) -> str | list[dict]:
387
+ entity_type = element_type_name or self.GOV_ACTION_PROCESS_LABEL
388
+ get_additional_props_func = None
389
+ if output_format_set:
390
+ if isinstance(output_format_set, str):
391
+ output_formats = select_output_format_set(output_format_set, output_format)
392
+ else:
393
+ output_formats = get_output_format_type_match(output_format_set, output_format)
394
+ elif element_type_name:
395
+ output_formats = select_output_format_set(element_type_name, output_format)
396
+ else:
397
+ output_formats = select_output_format_set(entity_type, output_format)
398
+ if output_formats is None:
399
+ output_formats = select_output_format_set("Default", output_format)
400
+ return generate_output(
401
+ elements,
402
+ filter,
403
+ entity_type,
404
+ output_format,
405
+ self._extract_gov_action_process_properties,
406
+ None,
407
+ output_formats,
408
+ )
409
+
57
410
  async def _async_create_elem_from_template(self, body: dict) -> str:
58
411
  """Create a new metadata element from a template. Async version.
59
412
  Parameters
@@ -68,10 +421,7 @@ class AutomatedCuration(Client2):
68
421
 
69
422
  Raises
70
423
  ------
71
- InvalidParameterException
72
- PropertyServerException
73
- UserNotAuthorizedException
74
-
424
+ PyegeriaException
75
425
  Notes
76
426
  -----
77
427
  See also: https://egeria-project.org/features/templated-cataloguing/overview/
@@ -151,7 +501,6 @@ class AutomatedCuration(Client2):
151
501
  )
152
502
  return response
153
503
 
154
-
155
504
  async def _async_create_kafka_server_element_from_template(
156
505
  self,
157
506
  kafka_server: str,
@@ -382,7 +731,7 @@ class AutomatedCuration(Client2):
382
731
  "class": "TemplateRequestBody",
383
732
  "templateGUID": template_guid,
384
733
  "isOwnAnchor": True,
385
- "allowRetrieve" : True,
734
+ "allowRetrieve": True,
386
735
  "placeholderPropertyValues": {
387
736
  "fileName": file_name,
388
737
  "fileType": file_type,
@@ -1389,8 +1738,9 @@ class AutomatedCuration(Client2):
1389
1738
  # Engine Actions
1390
1739
  #
1391
1740
  async def _async_get_engine_actions(
1392
- self, start_from: int = 0, page_size: int = 0, body: dict | GetRequestBody = None
1393
- ) -> list:
1741
+ self, start_from: int = 0, page_size: int = 0, body: dict | GetRequestBody = None,
1742
+ output_format: str = "JSON", output_format_set: str | dict = "EngineAction"
1743
+ ) -> list | str:
1394
1744
  """Retrieve the engine actions that are known to the server. Async version.
1395
1745
  Parameters
1396
1746
  ----------
@@ -1409,7 +1759,7 @@ class AutomatedCuration(Client2):
1409
1759
 
1410
1760
  Raises
1411
1761
  ------
1412
- PyegeriaException
1762
+ PyegeriaException
1413
1763
  ValidationError
1414
1764
 
1415
1765
  Notes
@@ -1431,11 +1781,15 @@ class AutomatedCuration(Client2):
1431
1781
  # return await self._async_get_guid_request(url, "EngineAction", _generate_default_output,
1432
1782
  # output_format="JSON", output_format_set="Referenceable", body=body )
1433
1783
  response = await self._async_make_request("GET", url)
1434
- return response.json().get("element", "No element found")
1784
+ elements = response.json().get("elements", "No element found")
1785
+ # Apply formatter if not raw JSON requested
1786
+ return self._generate_engine_action_output(elements, None, self.ENGINE_ACTION_LABEL,
1787
+ output_format=output_format, output_format_set=output_format_set)
1435
1788
 
1436
1789
  def get_engine_actions(
1437
- self, start_from: int = 0, page_size: int = 0, body: dict | GetRequestBody = None
1438
- ) -> list:
1790
+ self, start_from: int = 0, page_size: int = 0, body: dict | GetRequestBody = None,
1791
+ output_format: str = "JSON", output_format_set: str | dict = "EngineAction"
1792
+ ) -> list | str:
1439
1793
  """Retrieve the engine actions that are known to the server.
1440
1794
  Parameters
1441
1795
  ----------
@@ -1453,7 +1807,7 @@ class AutomatedCuration(Client2):
1453
1807
 
1454
1808
  Raises
1455
1809
  ------
1456
- PyegeriaException
1810
+ PyegeriaException
1457
1811
  ValidationError
1458
1812
 
1459
1813
  Notes
@@ -1470,7 +1824,8 @@ class AutomatedCuration(Client2):
1470
1824
  """
1471
1825
  loop = asyncio.get_event_loop()
1472
1826
  response = loop.run_until_complete(
1473
- self._async_get_engine_actions(start_from, page_size, body)
1827
+ self._async_get_engine_actions(start_from, page_size, body,
1828
+ output_format=output_format, output_format_set=output_format_set)
1474
1829
  )
1475
1830
  return response
1476
1831
 
@@ -1490,7 +1845,7 @@ class AutomatedCuration(Client2):
1490
1845
 
1491
1846
  Raises
1492
1847
  ------
1493
- PyegeriaException
1848
+ PyegeriaException
1494
1849
  ValidationError
1495
1850
 
1496
1851
 
@@ -1520,10 +1875,7 @@ class AutomatedCuration(Client2):
1520
1875
 
1521
1876
  Raises
1522
1877
  ------
1523
- InvalidParameterException
1524
- PropertyServerException
1525
- UserNotAuthorizedException
1526
-
1878
+ PyegeriaException
1527
1879
  Notes
1528
1880
  -----
1529
1881
  For more information see: https://egeria-project.org/concepts/engine-action
@@ -1550,10 +1902,7 @@ class AutomatedCuration(Client2):
1550
1902
 
1551
1903
  Raises
1552
1904
  ------
1553
- InvalidParameterException
1554
- PropertyServerException
1555
- UserNotAuthorizedException
1556
-
1905
+ PyegeriaException
1557
1906
  Notes
1558
1907
  -----
1559
1908
  For more information see: https://egeria-project.org/concepts/engine-action
@@ -1584,10 +1933,7 @@ class AutomatedCuration(Client2):
1584
1933
 
1585
1934
  Raises
1586
1935
  ------
1587
- InvalidParameterException
1588
- PropertyServerException
1589
- UserNotAuthorizedException
1590
-
1936
+ PyegeriaException
1591
1937
  Notes
1592
1938
  -----
1593
1939
  For more information see: https://egeria-project.org/concepts/engine-action
@@ -1597,7 +1943,8 @@ class AutomatedCuration(Client2):
1597
1943
  return
1598
1944
 
1599
1945
  async def _async_get_active_engine_actions(
1600
- self, start_from: int = 0, page_size: int = 0
1946
+ self, start_from: int = 0, page_size: int = 0,
1947
+ output_format: str = "JSON", output_format_set: str | dict = "EngineAction"
1601
1948
  ) -> list | str:
1602
1949
  """Retrieve the engine actions that are still in process. Async Version.
1603
1950
 
@@ -1629,10 +1976,13 @@ class AutomatedCuration(Client2):
1629
1976
  )
1630
1977
 
1631
1978
  response = await self._async_make_request("GET", url)
1632
- return response.json().get("elements", "no actions")
1979
+ elements = response.json().get("elements", "no actions")
1980
+ return self._generate_engine_action_output(elements, None, self.ENGINE_ACTION_LABEL,
1981
+ output_format=output_format, output_format_set=output_format_set)
1633
1982
 
1634
1983
  def get_active_engine_actions(
1635
- self, start_from: int = 0, page_size: int = 0
1984
+ self, start_from: int = 0, page_size: int = 0,
1985
+ output_format: str = "JSON", output_format_set: str | dict = "EngineAction"
1636
1986
  ) -> list | str:
1637
1987
  """Retrieve the engine actions that are still in process.
1638
1988
 
@@ -1659,7 +2009,8 @@ class AutomatedCuration(Client2):
1659
2009
  """
1660
2010
  loop = asyncio.get_event_loop()
1661
2011
  response = loop.run_until_complete(
1662
- self._async_get_active_engine_actions(start_from, page_size)
2012
+ self._async_get_active_engine_actions(start_from, page_size,
2013
+ output_format=output_format, output_format_set=output_format_set)
1663
2014
  )
1664
2015
  return response
1665
2016
 
@@ -1689,10 +2040,7 @@ class AutomatedCuration(Client2):
1689
2040
  found with the given name.
1690
2041
  Raises:
1691
2042
  ------
1692
- InvalidParameterException
1693
- PropertyServerException
1694
- UserNotAuthorizedException
1695
-
2043
+ PyegeriaException
1696
2044
  Notes
1697
2045
  -----
1698
2046
  For more information see: https://egeria-project.org/concepts/engine-action
@@ -1735,10 +2083,7 @@ class AutomatedCuration(Client2):
1735
2083
  found with the given name.
1736
2084
  Raises:
1737
2085
  ------
1738
- InvalidParameterException
1739
- PropertyServerException
1740
- UserNotAuthorizedException
1741
-
2086
+ PyegeriaException
1742
2087
  Notes
1743
2088
  -----
1744
2089
  For more information see: https://egeria-project.org/concepts/engine-action
@@ -1758,6 +2103,8 @@ class AutomatedCuration(Client2):
1758
2103
  ignore_case: bool = False,
1759
2104
  start_from: int = 0,
1760
2105
  page_size: int = 0,
2106
+ output_format: str = "JSON",
2107
+ output_format_set: str | dict = "EngineAction",
1761
2108
  ) -> list | str:
1762
2109
  """Retrieve the list of engine action metadata elements that contain the search string. Async Version.
1763
2110
  Parameters
@@ -1790,10 +2137,7 @@ class AutomatedCuration(Client2):
1790
2137
 
1791
2138
  Raises:
1792
2139
  ------
1793
- InvalidParameterException
1794
- PropertyServerException
1795
- UserNotAuthorizedException
1796
-
2140
+ PyegeriaException
1797
2141
  Notes
1798
2142
  -----
1799
2143
  For more information see: https://egeria-project.org/concepts/engine-action
@@ -1802,17 +2146,24 @@ class AutomatedCuration(Client2):
1802
2146
  validate_search_string(search_string)
1803
2147
  if search_string == "*":
1804
2148
  search_string = None
1805
- starts_with_s = str(starts_with).lower()
1806
- ends_with_s = str(ends_with).lower()
1807
- ignore_case_s = str(ignore_case).lower()
1808
2149
 
1809
- url = (
1810
- f"{self.curation_command_root}/engine-actions/"
1811
- f"by-search-string"
2150
+ url = str(HttpUrl(f"{self.curation_command_root}/assets/by-search-string"))
2151
+ return await self._async_find_request(
2152
+ url,
2153
+ _type=self.ENGINE_ACTION_LABEL,
2154
+ search_string=search_string,
2155
+ _gen_output=self._generate_engine_action_output,
2156
+ classification_names=None,
2157
+ metadata_element_types=["EngineAction"],
2158
+ starts_with=starts_with,
2159
+ ends_with=ends_with,
2160
+ ignore_case=ignore_case,
2161
+ start_from=start_from,
2162
+ page_size=page_size,
2163
+ output_format=output_format,
2164
+ output_format_set=output_format_set,
2165
+ body=None,
1812
2166
  )
1813
- body = {"class": "SearchStringRequestBody", "name": search_string}
1814
- response = await self._async_make_request("POST", url, body)
1815
- return response.json().get("elements", "no actions")
1816
2167
 
1817
2168
  def find_engine_actions(
1818
2169
  self,
@@ -1822,6 +2173,8 @@ class AutomatedCuration(Client2):
1822
2173
  ignore_case: bool = False,
1823
2174
  start_from: int = 0,
1824
2175
  page_size: int = 0,
2176
+ output_format: str = "JSON",
2177
+ output_format_set: str | dict = "EngineAction",
1825
2178
  ) -> list | str:
1826
2179
  """Retrieve the list of engine action metadata elements that contain the search string.
1827
2180
  Parameters
@@ -1854,10 +2207,7 @@ class AutomatedCuration(Client2):
1854
2207
 
1855
2208
  Raises:
1856
2209
  ------
1857
- InvalidParameterException
1858
- PropertyServerException
1859
- UserNotAuthorizedException
1860
-
2210
+ PyegeriaException
1861
2211
  Notes
1862
2212
  -----
1863
2213
  For more information see: https://egeria-project.org/concepts/engine-action
@@ -1872,6 +2222,8 @@ class AutomatedCuration(Client2):
1872
2222
  ignore_case,
1873
2223
  start_from,
1874
2224
  page_size,
2225
+ output_format=output_format,
2226
+ output_format_set=output_format_set,
1875
2227
  )
1876
2228
  )
1877
2229
  return response
@@ -1880,805 +2232,224 @@ class AutomatedCuration(Client2):
1880
2232
  # Governance action processes
1881
2233
  #
1882
2234
 
1883
- async def _async_get_governance_action_process_by_guid(
1884
- self, process_guid: str
1885
- ) -> dict | str:
1886
- """Retrieve the governance action process metadata element with the supplied unique identifier. Async Version.
1887
2235
 
1888
- Parameters:
1889
- ----------
1890
- process_guid: str
1891
- The GUID (Globally Unique Identifier) of the governance action process.
2236
+ async def _async_initiate_gov_action_process(
2237
+ self,
2238
+ action_type_qualified_name: str,
2239
+ request_source_guids: [str] = None,
2240
+ action_targets: list = None,
2241
+ start_time: datetime = None,
2242
+ request_parameters: dict = None,
2243
+ orig_service_name: str = None,
2244
+ orig_engine_name: str = None,
2245
+ ) -> str:
2246
+ """Using the named governance action process as a template, initiate a chain of engine actions. Async version.
1892
2247
 
2248
+ Parameters
2249
+ ----------
2250
+ action_type_qualified_name: str
2251
+ - unique name for the governance process
2252
+ request_source_guids: [str], optional
2253
+ - request source elements for the resulting governance action service
2254
+ action_targets: [str], optional
2255
+ -list of action target names to GUIDs for the resulting governance action service
2256
+ start_time: datetime, optional
2257
+ - time to start the process
2258
+ request_parameters: [str], optional
2259
+ - parameters passed into the process
2260
+ orig_service_name: str, optional
2261
+ - unique name of the requesting governance service (if initiated by a governance engine)
2262
+ orig_engine_name: str, optional
2263
+ - optional unique name of the governance engine (if initiated by a governance engine).
1893
2264
 
1894
- Returns:
2265
+ Returns
1895
2266
  -------
1896
- dict: The JSON representation of the governance action process element.
2267
+ Unique id (guid) of the newly started governance engine process
1897
2268
 
1898
- Raises:
2269
+ Raises
1899
2270
  ------
1900
- InvalidParameterException: If the API response indicates an error (non-200 status code),
1901
- this exception is raised with details from the response content.
1902
- PropertyServerException: If the API response indicates a server side error.
1903
- UserNotAuthorizedException:
2271
+ PyegeriaException
1904
2272
  """
1905
2273
 
1906
- validate_guid(process_guid)
1907
-
1908
- url = (
1909
- f"{self.curation_command_root}/"
1910
- f"governance-action-processes/{process_guid}"
2274
+ start_time: datetime = (
2275
+ datetime.datetime.now() if start_time is None else start_time
1911
2276
  )
1912
2277
 
1913
- response = await self._async_make_request("GET", url)
1914
- return response.json().get("element", "no actions")
2278
+ url = f"{self.curation_command_root}/governance-action-processes/initiate"
2279
+ body = {
2280
+ "class": "GovernanceActionProcessRequestBody",
2281
+ "processQualifiedName": action_type_qualified_name,
2282
+ "requestSourceGUIDs": request_source_guids,
2283
+ "actionTargets": action_targets,
2284
+ "startTime": int(start_time.timestamp() * 1000),
2285
+ "requestParameters": request_parameters,
2286
+ "originatorServiceName": orig_service_name,
2287
+ "originatorEngineName": orig_engine_name,
2288
+ }
2289
+ new_body = body_slimmer(body)
2290
+ response = await self._async_make_request("POST", url, new_body)
2291
+ return response.json().get("guid", "Action not initiated")
1915
2292
 
1916
- def get_governance_action_process_by_guid(self, process_guid: str) -> dict | str:
1917
- """Retrieve the governance action process metadata element with the supplied unique identifier.
2293
+ def initiate_gov_action_process(
2294
+ self,
2295
+ action_type_qualified_name: str,
2296
+ request_source_guids: [str] = None,
2297
+ action_targets: [str] = None,
2298
+ start_time: datetime = None,
2299
+ request_parameters: dict = None,
2300
+ orig_service_name: str = None,
2301
+ orig_engine_name: str = None,
2302
+ ) -> str:
2303
+ """Using the named governance action process as a template, initiate a chain of engine actions.
1918
2304
 
1919
- Parameters:
2305
+ Parameters
1920
2306
  ----------
1921
- process_guid: str
1922
- The GUID (Globally Unique Identifier) of the governance action process.
2307
+ action_type_qualified_name: str
2308
+ - unique name for the governance process
2309
+ request_source_guids: [str], optional
2310
+ - request source elements for the resulting governance action service
2311
+ action_targets: [str], optional
2312
+ -list of action target names to GUIDs for the resulting governance action service
2313
+ start_time: datetime, optional
2314
+ - time to start the process
2315
+ request_parameters: [str], optional
2316
+ - parameters passed into the process
2317
+ orig_service_name: str, optional
2318
+ - unique name of the requesting governance service (if initiated by a governance engine)
2319
+ orig_engine_name: str, optional
2320
+ - optional unique name of the governance engine (if initiated by a governance engine).
1923
2321
 
1924
- Returns:
2322
+ Returns
1925
2323
  -------
1926
- dict: The JSON representation of the governance action process element.
2324
+ Unique id (guid) of the newly started governance engine process
1927
2325
 
1928
- Raises:
2326
+ Raises
1929
2327
  ------
1930
- InvalidParameterException: If the API response indicates an error (non-200 status code),
1931
- this exception is raised with details from the response content.
1932
- PropertyServerException: If the API response indicates a server side error.
1933
- UserNotAuthorizedException:
2328
+ PyegeriaException
1934
2329
  """
1935
2330
  loop = asyncio.get_event_loop()
1936
2331
  response = loop.run_until_complete(
1937
- self._async_get_governance_action_process_by_guid(process_guid)
2332
+ self._async_initiate_gov_action_process(
2333
+ action_type_qualified_name,
2334
+ request_source_guids,
2335
+ action_targets,
2336
+ start_time,
2337
+ request_parameters,
2338
+ orig_service_name,
2339
+ orig_engine_name,
2340
+ )
1938
2341
  )
1939
2342
  return response
1940
2343
 
1941
- async def _async_get_gov_action_process_graph(
1942
- self, process_guid: str
1943
- ) -> dict | str:
1944
- """Retrieve the governance action process metadata element with the supplied unique
1945
- identifier along with the flow definition describing its implementation. Async Version.
2344
+
2345
+
2346
+ async def _async_initiate_gov_action_type(
2347
+ self,
2348
+ action_type_qualified_name: str,
2349
+ request_source_guids: [str],
2350
+ action_targets: list,
2351
+ start_time: datetime = None,
2352
+ request_parameters: dict = None,
2353
+ orig_service_name: str = None,
2354
+ orig_engine_name: str = None,
2355
+ ) -> str:
2356
+ """Using the named governance action type as a template, initiate an engine action. Async version.
2357
+
1946
2358
  Parameters
1947
2359
  ----------
1948
- process_guid : str
1949
- The process GUID to retrieve the graph for.
2360
+ action_type_qualified_name: str
2361
+ - unique name for the governance process
2362
+ request_source_guids: [str]
2363
+ - request source elements for the resulting governance action service
2364
+ action_targets: [str]
2365
+ -list of action target names to GUIDs for the resulting governance action service
2366
+ start_time: datetime, default = None
2367
+ - time to start the process, no earlier than start time. None means now.
2368
+ request_parameters: [str]
2369
+ - parameters passed into the process
2370
+ orig_service_name: str
2371
+ - unique name of the requesting governance service (if initiated by a governance engine)
2372
+ orig_engine_name: str
2373
+ - optional unique name of the governance engine (if initiated by a governance engine).
1950
2374
 
1951
2375
  Returns
1952
2376
  -------
1953
- dict or str
1954
- A dictionary representing the graph of the governance action process, or the string "no actions"
1955
- if no actions are found.
1956
- Raises:
1957
- ------
1958
- InvalidParameterException: If the API response indicates an error (non-200 status code),
1959
- this exception is raised with details from the response content.
1960
- PropertyServerException: If the API response indicates a server side error.
1961
- UserNotAuthorizedException:
2377
+ Unique id (guid) of the newly started governance engine process
1962
2378
 
2379
+ Raises
2380
+ ------
2381
+ PyegeriaException
1963
2382
  """
1964
2383
 
1965
- validate_guid(process_guid)
1966
-
1967
- url = (
1968
- f"{self.curation_command_root}/"
1969
- f"governance-action-processes/{process_guid}/graph"
1970
- )
2384
+ url = f"{self.curation_command_root}/governance-action-types/initiate"
2385
+ start = int(start_time.timestamp() * 1000) if start_time else None
2386
+ body = {
2387
+ "class": "InitiateGovernanceActionTypeRequestBody",
2388
+ "governanceActionTypeQualifiedName": action_type_qualified_name,
2389
+ "requestSourceGUIDs": request_source_guids,
2390
+ "actionTargets": action_targets,
2391
+ "startDate": start,
2392
+ "requestParameters": request_parameters,
2393
+ "originatorServiceName": orig_service_name,
2394
+ "originatorEngineName": orig_engine_name,
2395
+ }
2396
+ new_body = body_slimmer(body)
2397
+ response = await self._async_make_request("POST", url, new_body)
2398
+ return response.json().get("guid", "Action not initiated")
1971
2399
 
1972
- response = await self._async_make_request("POST", url)
1973
- return response.json().get("element", "no actions")
2400
+ def initiate_gov_action_type(
2401
+ self,
2402
+ action_type_qualified_name: str,
2403
+ request_source_guids: [str],
2404
+ action_targets: list,
2405
+ start_time: datetime = None,
2406
+ request_parameters: dict = None,
2407
+ orig_service_name: str = None,
2408
+ orig_engine_name: str = None,
2409
+ ) -> str:
2410
+ """Using the named governance action type as a template, initiate an engine action.
1974
2411
 
1975
- def get_gov_action_process_graph(self, process_guid: str) -> dict | str:
1976
- """Retrieve the governance action process metadata element with the supplied unique
1977
- identifier along with the flow definition describing its implementation.
1978
2412
  Parameters
1979
2413
  ----------
1980
- process_guid : str
1981
- The process GUID to retrieve the graph for.
2414
+ action_type_qualified_name: str
2415
+ - unique name for the governance process
2416
+ request_source_guids: [str]
2417
+ - request source elements for the resulting governance action service
2418
+ action_targets: [str]
2419
+ -list of action target names to GUIDs for the resulting governance action service
2420
+ start_time: datetime, default = None
2421
+ - time to start the process, no earlier than start time. None means now.
2422
+ request_parameters: [str]
2423
+ - parameters passed into the process
2424
+ orig_service_name: str
2425
+ - unique name of the requesting governance service (if initiated by a governance engine)
2426
+ orig_engine_name: str
2427
+ - optional unique name of the governance engine (if initiated by a governance engine).
1982
2428
 
1983
2429
  Returns
1984
2430
  -------
1985
- dict or str
1986
- A dictionary representing the graph of the governance action process, or the string "no actions"
1987
- if no actions are found.
1988
- Raises:
1989
- ------
1990
- InvalidParameterException: If the API response indicates an error (non-200 status code),
1991
- this exception is raised with details from the response content.
1992
- PropertyServerException: If the API response indicates a server side error.
1993
- UserNotAuthorizedException:
2431
+ Unique id (guid) of the newly started governance engine process
1994
2432
 
1995
- """
2433
+ Raises
2434
+ ------
2435
+ PyegeriaException """
1996
2436
  loop = asyncio.get_event_loop()
1997
2437
  response = loop.run_until_complete(
1998
- self._async_get_gov_action_process_graph(process_guid)
2438
+ self._async_initiate_gov_action_type(
2439
+ action_type_qualified_name,
2440
+ request_source_guids,
2441
+ action_targets,
2442
+ start_time,
2443
+ request_parameters,
2444
+ orig_service_name,
2445
+ orig_engine_name,
2446
+ )
1999
2447
  )
2000
2448
  return response
2001
2449
 
2002
- async def _async_get_gov_action_processes_by_name(
2003
- self,
2004
- name: str,
2005
- start_from: int = None,
2006
- page_size: int = 0,
2007
- ) -> list | str:
2008
- """Retrieve the list of governance action process metadata elements with a matching qualified or display name.
2009
- There are no wildcards supported on this request. Async Version.
2010
-
2011
- Parameters
2012
- ----------
2013
- name : str
2014
- The name of the engine action to retrieve.
2015
-
2016
- start_from : int, optional
2017
- The index to start retrieving engine actions from. If not provided, the default value will be used.
2018
- page_size : int, optional
2019
- The maximum number of engine actions to retrieve in a single request. If not provided, the default
2020
- global maximum paging size will be used.
2021
-
2022
- Returns
2023
- -------
2024
- list of dict | str
2025
- A list of dictionaries representing the retrieved engine actions,
2026
- or "no actions" if no engine actions were found with the given name.
2027
- Raises:
2028
- ------
2029
- InvalidParameterException
2030
- PropertyServerException
2031
- UserNotAuthorizedException
2032
- """
2033
-
2034
- validate_name(name)
2035
-
2036
- url = (
2037
- f"{self.curation_command_root}/governance-action-processes/"
2038
- f"by-name"
2039
- )
2040
- body = {"filter": name}
2041
- response = await self._async_make_request("POST", url, body)
2042
- return response.json().get("elements", "no actions")
2043
-
2044
- def get_gov_action_processes_by_name(
2045
- self,
2046
- name: str,
2047
- start_from: int = 0,
2048
- page_size: int = 0,
2049
- ) -> list | str:
2050
- """Retrieve the list of governance action process metadata elements with a matching qualified or display name.
2051
- There are no wildcards supported on this request.
2052
-
2053
- Parameters
2054
- ----------
2055
- name : str
2056
- The name of the engine action to retrieve.
2057
-
2058
- start_from : int, optional
2059
- The index to start retrieving engine actions from. If not provided, the default value will be used.
2060
- page_size : int, optional
2061
- The maximum number of engine actions to retrieve in a single request. If not provided, the default global
2062
- maximum paging size will be used.
2063
-
2064
- Returns
2065
- -------
2066
- list of dict | str
2067
- A list of dictionaries representing the retrieved engine actions,
2068
- or "no actions" if no engine actions were found with the given name.
2069
- Raises:
2070
- ------
2071
- InvalidParameterException
2072
- PropertyServerException
2073
- UserNotAuthorizedException
2074
- """
2075
- loop = asyncio.get_event_loop()
2076
- response = loop.run_until_complete(
2077
- self._async_get_gov_action_processes_by_name(name, start_from, page_size)
2078
- )
2079
- return response
2080
-
2081
- async def _async_find_gov_action_processes(
2082
- self,
2083
- search_string: str,
2084
- starts_with: bool = False,
2085
- ends_with: bool = False,
2086
- ignore_case: bool = False,
2087
- start_from: int = 0,
2088
- page_size: int = 0,
2089
- ) -> list | str:
2090
- """Retrieve the list of governance action process metadata elements that contain the search string. Async ver.
2091
-
2092
- Parameters
2093
- ----------
2094
- search_string : str
2095
- The string used for searching engine actions by name.
2096
-
2097
-
2098
-
2099
- starts_with : bool, optional
2100
- Whether to search engine actions that start with the given search string. Default is False.
2101
-
2102
- ends_with : bool, optional
2103
- Whether to search engine actions that end with the given search string. Default is False.
2104
-
2105
- ignore_case : bool, optional
2106
- Whether to ignore case while searching engine actions. Default is False.
2107
-
2108
- start_from : int, optional
2109
- The index from which to start fetching the engine actions. Default is 0.
2110
-
2111
- page_size : int, optional
2112
- The maximum number of engine actions to fetch in a single request. Default is `0`.
2113
-
2114
- Returns
2115
- -------
2116
- List[dict] or str
2117
- A list of dictionaries representing the governance action processes found based on the search query.
2118
- If no actions are found, returns the string "no actions".
2119
-
2120
- Raises:
2121
- ------
2122
- InvalidParameterException
2123
- PropertyServerException
2124
- UserNotAuthorizedException
2125
- """
2126
-
2127
- validate_search_string(search_string)
2128
- if search_string == "*":
2129
- search_string = None
2130
- starts_with_s = str(starts_with).lower()
2131
- ends_with_s = str(ends_with).lower()
2132
- ignore_case_s = str(ignore_case).lower()
2133
-
2134
- url = (
2135
- f"{self.curation_command_root}/governance-action-processes/"
2136
- f"by-search-string"
2137
- )
2138
-
2139
- if search_string:
2140
- body = {"filter": search_string}
2141
- response = await self._async_make_request("POST", url, body)
2142
- else:
2143
- response = await self._async_make_request("POST", url)
2144
-
2145
- return response.json().get("elements", "no actions")
2146
-
2147
- def find_gov_action_processes(
2148
- self,
2149
- search_string: str = "*",
2150
- starts_with: bool = False,
2151
- ends_with: bool = False,
2152
- ignore_case: bool = False,
2153
- start_from: int = 0,
2154
- page_size: int = 0,
2155
- ) -> list | str:
2156
- """Retrieve the list of governance action process metadata elements that contain the search string.
2157
-
2158
- Parameters
2159
- ----------
2160
- search_string : str
2161
- The string used for searching engine actions by name.
2162
-
2163
-
2164
-
2165
- starts_with : bool, optional
2166
- Whether to search engine actions that start with the given search string. Default is False.
2167
-
2168
- ends_with : bool, optional
2169
- Whether to search engine actions that end with the given search string. Default is False.
2170
-
2171
- ignore_case : bool, optional
2172
- Whether to ignore case while searching engine actions. Default is False.
2173
-
2174
- start_from : int, optional
2175
- The index from which to start fetching the engine actions. Default is 0.
2176
-
2177
- page_size : int, optional
2178
- The maximum number of engine actions to fetch in a single request. Default is `0`.
2179
-
2180
- Returns
2181
- -------
2182
- List[dict] or str
2183
- A list of dictionaries representing the governance action processes found based on the search query.
2184
- If no actions are found, returns the string "no actions".
2185
-
2186
- Raises:
2187
- ------
2188
- InvalidParameterException
2189
- PropertyServerException
2190
- UserNotAuthorizedException
2191
- """
2192
-
2193
- loop = asyncio.get_event_loop()
2194
- response = loop.run_until_complete(
2195
- self._async_find_gov_action_processes(
2196
- search_string,
2197
- starts_with,
2198
- ends_with,
2199
- ignore_case,
2200
- start_from,
2201
- page_size,
2202
- )
2203
- )
2204
- return response
2205
-
2206
- async def _async_initiate_gov_action_process(
2207
- self,
2208
- action_type_qualified_name: str,
2209
- request_source_guids: [str] = None,
2210
- action_targets: list = None,
2211
- start_time: datetime = None,
2212
- request_parameters: dict = None,
2213
- orig_service_name: str = None,
2214
- orig_engine_name: str = None,
2215
- ) -> str:
2216
- """Using the named governance action process as a template, initiate a chain of engine actions. Async version.
2217
-
2218
- Parameters
2219
- ----------
2220
- action_type_qualified_name: str
2221
- - unique name for the governance process
2222
- request_source_guids: [str], optional
2223
- - request source elements for the resulting governance action service
2224
- action_targets: [str], optional
2225
- -list of action target names to GUIDs for the resulting governance action service
2226
- start_time: datetime, optional
2227
- - time to start the process
2228
- request_parameters: [str], optional
2229
- - parameters passed into the process
2230
- orig_service_name: str, optional
2231
- - unique name of the requesting governance service (if initiated by a governance engine)
2232
- orig_engine_name: str, optional
2233
- - optional unique name of the governance engine (if initiated by a governance engine).
2234
-
2235
- Returns
2236
- -------
2237
- Unique id (guid) of the newly started governance engine process
2238
-
2239
- Raises
2240
- ------
2241
- InvalidParameterException
2242
- PropertyServerException
2243
- UserNotAuthorizedException
2244
-
2245
- """
2246
-
2247
- start_time: datetime = (
2248
- datetime.datetime.now() if start_time is None else start_time
2249
- )
2250
-
2251
- url = f"{self.curation_command_root}/governance-action-processes/initiate"
2252
- body = {
2253
- "class": "GovernanceActionProcessRequestBody",
2254
- "processQualifiedName": action_type_qualified_name,
2255
- "requestSourceGUIDs": request_source_guids,
2256
- "actionTargets": action_targets,
2257
- "startTime": int(start_time.timestamp() * 1000),
2258
- "requestParameters": request_parameters,
2259
- "originatorServiceName": orig_service_name,
2260
- "originatorEngineName": orig_engine_name,
2261
- }
2262
- new_body = body_slimmer(body)
2263
- response = await self._async_make_request("POST", url, new_body)
2264
- return response.json().get("guid", "Action not initiated")
2265
-
2266
- def initiate_gov_action_process(
2267
- self,
2268
- action_type_qualified_name: str,
2269
- request_source_guids: [str] = None,
2270
- action_targets: [str] = None,
2271
- start_time: datetime = None,
2272
- request_parameters: dict = None,
2273
- orig_service_name: str = None,
2274
- orig_engine_name: str = None,
2275
- ) -> str:
2276
- """Using the named governance action process as a template, initiate a chain of engine actions.
2277
-
2278
- Parameters
2279
- ----------
2280
- action_type_qualified_name: str
2281
- - unique name for the governance process
2282
- request_source_guids: [str], optional
2283
- - request source elements for the resulting governance action service
2284
- action_targets: [str], optional
2285
- -list of action target names to GUIDs for the resulting governance action service
2286
- start_time: datetime, optional
2287
- - time to start the process
2288
- request_parameters: [str], optional
2289
- - parameters passed into the process
2290
- orig_service_name: str, optional
2291
- - unique name of the requesting governance service (if initiated by a governance engine)
2292
- orig_engine_name: str, optional
2293
- - optional unique name of the governance engine (if initiated by a governance engine).
2294
-
2295
- Returns
2296
- -------
2297
- Unique id (guid) of the newly started governance engine process
2298
-
2299
- Raises
2300
- ------
2301
- InvalidParameterException
2302
- PropertyServerException
2303
- UserNotAuthorizedException
2304
-
2305
- """
2306
- loop = asyncio.get_event_loop()
2307
- response = loop.run_until_complete(
2308
- self._async_initiate_gov_action_process(
2309
- action_type_qualified_name,
2310
- request_source_guids,
2311
- action_targets,
2312
- start_time,
2313
- request_parameters,
2314
- orig_service_name,
2315
- orig_engine_name,
2316
- )
2317
- )
2318
- return response
2319
-
2320
- async def _async_get_gov_action_types_by_guid(
2321
- self, gov_action_type_guid: str
2322
- ) -> dict | str:
2323
- """Retrieve the governance action type metadata element with the supplied unique identifier. Async version.
2324
-
2325
- Parameters:
2326
- ----------
2327
- gov_action_type_guid: str
2328
- The GUID (Globally Unique Identifier) of the governance action type to retrieve.
2329
-
2330
- Returns:
2331
- -------
2332
- dict: The JSON representation of the governance action type element.
2333
-
2334
- Raises:
2335
- ------
2336
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2337
- this exception is raised with details from the response content.
2338
- PropertyServerException: If the API response indicates a server side error.
2339
- UserNotAuthorizedException:
2340
- """
2341
-
2342
- validate_guid(gov_action_type_guid)
2343
-
2344
- url = (
2345
- f"{self.curation_command_root}/"
2346
- f"governance-action-types/{gov_action_type_guid}"
2347
- )
2348
-
2349
- response = await self._async_make_request("GET", url)
2350
- return response.json().get("element", "no actions")
2351
-
2352
- def get_gov_action_types_by_guid(self, gov_action_type_guid: str) -> dict | str:
2353
- """Retrieve the governance action type metadata element with the supplied unique identifier.
2354
-
2355
- Parameters:
2356
- ----------
2357
- gov_action_type_guid: str
2358
- The GUID (Globally Unique Identifier) of the governance action type to retrieve.
2359
-
2360
- Returns:
2361
- -------
2362
- dict: The JSON representation of the governance action type element.
2363
-
2364
- Raises:
2365
- ------
2366
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2367
- this exception is raised with details from the response content.
2368
- PropertyServerException: If the API response indicates a server side error.
2369
- UserNotAuthorizedException:
2370
- """
2371
- loop = asyncio.get_event_loop()
2372
- response = loop.run_until_complete(
2373
- self._async_get_gov_action_types_by_guid(gov_action_type_guid)
2374
- )
2375
- return response
2376
-
2377
- async def _async_get_gov_action_types_by_name(
2378
- self,
2379
- action_type_name,
2380
- start_from: int = 0,
2381
- page_size: int = 0,
2382
- ) -> list | str:
2383
- """Retrieve the list of governance action type metadata elements with a matching qualified or display name.
2384
- There are no wildcards supported on this request. Async version.
2385
-
2386
- Parameters:
2387
- ----------
2388
- action_type_name: str
2389
- The name of the governance action type to retrieve.
2390
-
2391
- Returns:
2392
- -------
2393
- dict: The JSON representation of the governance action type element.
2394
-
2395
- Raises:
2396
- ------
2397
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2398
- this exception is raised with details from the response content.
2399
- PropertyServerException: If the API response indicates a server side error.
2400
- UserNotAuthorizedException:
2401
- """
2402
-
2403
- validate_name(action_type_name)
2404
-
2405
- url = (
2406
- f"{self.curation_command_root}/"
2407
- f"governance-action-types/by-name"
2408
- )
2409
-
2410
- body = {"filter": action_type_name}
2411
-
2412
- response = await self._async_make_request("POST", url, body)
2413
- return response.json().get("elements", "no actions")
2414
-
2415
- def get_gov_action_types_by_name(
2416
- self,
2417
- action_type_name,
2418
- start_from: int = 0,
2419
- page_size: int = 0,
2420
- ) -> list | str:
2421
- """Retrieve the list of governance action type metadata elements with a matching qualified or display name.
2422
- There are no wildcards supported on this request. Async version.
2423
-
2424
- Parameters:
2425
- ----------
2426
- action_type_name: str
2427
- The name of the governance action type to retrieve.
2428
-
2429
- Returns:
2430
- -------
2431
- dict: The JSON representation of the governance action type element.
2432
-
2433
- Raises:
2434
- ------
2435
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2436
- this exception is raised with details from the response content.
2437
- PropertyServerException: If the API response indicates a server side error.
2438
- UserNotAuthorizedException:
2439
- """
2440
- loop = asyncio.get_event_loop()
2441
- response = loop.run_until_complete(
2442
- self._async_get_gov_action_types_by_name(
2443
- action_type_name, start_from, page_size
2444
- )
2445
- )
2446
- return response
2447
-
2448
- async def _async_find_gov_action_types(
2449
- self,
2450
- search_string: str = "*",
2451
- starts_with: bool = False,
2452
- ends_with: bool = False,
2453
- ignore_case: bool = True,
2454
- start_from: int = 0,
2455
- page_size: int = 0,
2456
- ) -> list | str:
2457
- """Retrieve the list of governance action type metadata elements that contain the search string.
2458
- Async Version.
2459
-
2460
- Parameters
2461
- ----------
2462
- search_string : str
2463
- The string used for searching engine actions by name.
2464
-
2465
-
2466
-
2467
- starts_with : bool, optional
2468
- Whether to search engine actions that start with the given search string. Default is False.
2469
-
2470
- ends_with : bool, optional
2471
- Whether to search engine actions that end with the given search string. Default is False.
2472
-
2473
- ignore_case : bool, optional
2474
- Whether to ignore case while searching engine actions. Default is False.
2475
-
2476
- start_from : int, optional
2477
- The index from which to start fetching the engine actions. Default is 0.
2478
-
2479
- page_size : int, optional
2480
- The maximum number of engine actions to fetch in a single request. Default is `0`.
2481
-
2482
- Returns
2483
- -------
2484
- List[dict] or str
2485
- A list of dictionaries representing the governance action types found based on the search query.
2486
- If no actions are found, returns the string "no action types".
2487
-
2488
- Raises
2489
- ------
2490
- InvalidParameterException
2491
- PropertyServerException
2492
- UserNotAuthorizedException
2493
-
2494
- """
2495
-
2496
- validate_search_string(search_string)
2497
- if search_string == "*":
2498
- search_string = None
2499
- starts_with_s = str(starts_with).lower()
2500
- ends_with_s = str(ends_with).lower()
2501
- ignore_case_s = str(ignore_case).lower()
2502
-
2503
- url = (
2504
- f"{self.curation_command_root}/governance-action-types/"
2505
- f"by-search-string"
2506
- )
2507
- body = {"filter": search_string}
2508
- response = await self._async_make_request("POST", url, body)
2509
- return response.json().get("elements", "no action types")
2510
-
2511
- def find_gov_action_types(
2512
- self,
2513
- search_string: str = "*",
2514
- starts_with: bool = False,
2515
- ends_with: bool = False,
2516
- ignore_case: bool = False,
2517
- start_from: int = 0,
2518
- page_size: int = 0,
2519
- ) -> list | str:
2520
- """Retrieve the list of governance action type metadata elements that contain the search string.
2521
-
2522
- Parameters
2523
- ----------
2524
- search_string : str
2525
- The string used for searching engine actions by name.
2526
-
2527
-
2528
- starts_with : bool, optional
2529
- Whether to search engine actions that start with the given search string. Default is False.
2530
-
2531
- ends_with : bool, optional
2532
- Whether to search engine actions that end with the given search string. Default is False.
2533
-
2534
- ignore_case : bool, optional
2535
- Whether to ignore case while searching engine actions. Default is False.
2536
-
2537
- start_from : int, optional
2538
- The index from which to start fetching the engine actions. Default is 0.
2539
-
2540
- page_size : int, optional
2541
- The maximum number of engine actions to fetch in a single request. Default is `0`.
2542
-
2543
- Returns
2544
- -------
2545
- List[dict] or str
2546
- A list of dictionaries representing the governance action types found based on the search query.
2547
- If no actions are found, returns the string "no action types".
2548
-
2549
- Raises
2550
- ------
2551
- InvalidParameterException
2552
- PropertyServerException
2553
- UserNotAuthorizedException
2554
-
2555
- """
2556
- loop = asyncio.get_event_loop()
2557
- response = loop.run_until_complete(
2558
- self._async_find_gov_action_types(
2559
- search_string,
2560
- starts_with,
2561
- ends_with,
2562
- ignore_case,
2563
- start_from,
2564
- page_size,
2565
- )
2566
- )
2567
- return response
2568
-
2569
- async def _async_initiate_gov_action_type(
2570
- self,
2571
- action_type_qualified_name: str,
2572
- request_source_guids: [str],
2573
- action_targets: list,
2574
- start_time: datetime = None,
2575
- request_parameters: dict = None,
2576
- orig_service_name: str = None,
2577
- orig_engine_name: str = None,
2578
- ) -> str:
2579
- """Using the named governance action type as a template, initiate an engine action. Async version.
2580
-
2581
- Parameters
2582
- ----------
2583
- action_type_qualified_name: str
2584
- - unique name for the governance process
2585
- request_source_guids: [str]
2586
- - request source elements for the resulting governance action service
2587
- action_targets: [str]
2588
- -list of action target names to GUIDs for the resulting governance action service
2589
- start_time: datetime, default = None
2590
- - time to start the process, no earlier than start time. None means now.
2591
- request_parameters: [str]
2592
- - parameters passed into the process
2593
- orig_service_name: str
2594
- - unique name of the requesting governance service (if initiated by a governance engine)
2595
- orig_engine_name: str
2596
- - optional unique name of the governance engine (if initiated by a governance engine).
2597
-
2598
- Returns
2599
- -------
2600
- Unique id (guid) of the newly started governance engine process
2601
-
2602
- Raises
2603
- ------
2604
- InvalidParameterException
2605
- PropertyServerException
2606
- UserNotAuthorizedException
2607
-
2608
- """
2609
-
2610
- url = f"{self.curation_command_root}/governance-action-types/initiate"
2611
- start = int(start_time.timestamp() * 1000) if start_time else None
2612
- body = {
2613
- "class": "InitiateGovernanceActionTypeRequestBody",
2614
- "governanceActionTypeQualifiedName": action_type_qualified_name,
2615
- "requestSourceGUIDs": request_source_guids,
2616
- "actionTargets": action_targets,
2617
- "startDate": start,
2618
- "requestParameters": request_parameters,
2619
- "originatorServiceName": orig_service_name,
2620
- "originatorEngineName": orig_engine_name,
2621
- }
2622
- new_body = body_slimmer(body)
2623
- response = await self._async_make_request("POST", url, new_body)
2624
- return response.json().get("guid", "Action not initiated")
2625
-
2626
- def initiate_gov_action_type(
2627
- self,
2628
- action_type_qualified_name: str,
2629
- request_source_guids: [str],
2630
- action_targets: list,
2631
- start_time: datetime = None,
2632
- request_parameters: dict = None,
2633
- orig_service_name: str = None,
2634
- orig_engine_name: str = None,
2635
- ) -> str:
2636
- """Using the named governance action type as a template, initiate an engine action.
2637
-
2638
- Parameters
2639
- ----------
2640
- action_type_qualified_name: str
2641
- - unique name for the governance process
2642
- request_source_guids: [str]
2643
- - request source elements for the resulting governance action service
2644
- action_targets: [str]
2645
- -list of action target names to GUIDs for the resulting governance action service
2646
- start_time: datetime, default = None
2647
- - time to start the process, no earlier than start time. None means now.
2648
- request_parameters: [str]
2649
- - parameters passed into the process
2650
- orig_service_name: str
2651
- - unique name of the requesting governance service (if initiated by a governance engine)
2652
- orig_engine_name: str
2653
- - optional unique name of the governance engine (if initiated by a governance engine).
2654
-
2655
- Returns
2656
- -------
2657
- Unique id (guid) of the newly started governance engine process
2658
-
2659
- Raises
2660
- ------
2661
- InvalidParameterException
2662
- PropertyServerException
2663
- UserNotAuthorizedException
2664
- """
2665
- loop = asyncio.get_event_loop()
2666
- response = loop.run_until_complete(
2667
- self._async_initiate_gov_action_type(
2668
- action_type_qualified_name,
2669
- request_source_guids,
2670
- action_targets,
2671
- start_time,
2672
- request_parameters,
2673
- orig_service_name,
2674
- orig_engine_name,
2675
- )
2676
- )
2677
- return response
2678
-
2679
- #
2680
- # Initiate surveys
2681
- #
2450
+ #
2451
+ # Initiate surveys
2452
+ #
2682
2453
 
2683
2454
  async def _async_initiate_survey(self, survey_name: str, resource_guid: str) -> str:
2684
2455
  """Initiate a survey of the survey_name on the target resource. Async Version.
@@ -3155,6 +2926,8 @@ class AutomatedCuration(Client2):
3155
2926
  integ_connector_guid: str,
3156
2927
  start_from: int = 0,
3157
2928
  page_size: int = 0,
2929
+ output_format: str = "JSON",
2930
+ output_format_set: str | dict = "CatalogTarget",
3158
2931
  ) -> list | str:
3159
2932
  """Retrieve the details of the metadata elements identified as catalog targets with an integration connector.
3160
2933
  Async version.
@@ -3183,13 +2956,20 @@ class AutomatedCuration(Client2):
3183
2956
  )
3184
2957
 
3185
2958
  response = await self._async_make_request("GET", url)
3186
- return response.json().get("elements", "no targets")
2959
+ elements = response.json().get("elements", "no targets")
2960
+ if isinstance(elements, str):
2961
+ return elements
2962
+ return self._generate_catalog_target_output(elements, None, self.CATALOG_TARGET_LABEL,
2963
+ output_format=output_format,
2964
+ output_format_set=output_format_set)
3187
2965
 
3188
2966
  def get_catalog_targets(
3189
2967
  self,
3190
2968
  integ_connector_guid: str,
3191
2969
  start_from: int = 0,
3192
2970
  page_size: int = 0,
2971
+ output_format: str = "JSON",
2972
+ output_format_set: str | dict = "CatalogTarget",
3193
2973
  ) -> list | str:
3194
2974
  """Retrieve the details of the metadata elements identified as catalog targets with an integration connector.
3195
2975
 
@@ -3211,11 +2991,16 @@ class AutomatedCuration(Client2):
3211
2991
 
3212
2992
  loop = asyncio.get_event_loop()
3213
2993
  response = loop.run_until_complete(
3214
- self._async_get_catalog_targets(integ_connector_guid, start_from, page_size)
2994
+ self._async_get_catalog_targets(integ_connector_guid, start_from, page_size,
2995
+ output_format=output_format,
2996
+ output_format_set=output_format_set)
3215
2997
  )
3216
2998
  return response
3217
2999
 
3218
- async def _async_get_catalog_target(self, relationship_guid: str) -> dict | str:
3000
+ async def _async_get_catalog_target(self, relationship_guid: str,
3001
+ output_format: str = "JSON",
3002
+ output_format_set: str | dict = "CatalogTarget",
3003
+ body: dict | GetRequestBody = None) -> dict | str:
3219
3004
  """Retrieve a specific catalog target associated with an integration connector. Further Information:
3220
3005
  https://egeria-project.org/concepts/integration-connector/ . Async version.
3221
3006
 
@@ -3238,12 +3023,21 @@ class AutomatedCuration(Client2):
3238
3023
 
3239
3024
  validate_guid(relationship_guid)
3240
3025
 
3241
- url = f"{self.curation_command_root}/catalog-targets/{relationship_guid}"
3242
-
3243
- response = await self._async_make_request("GET", url)
3244
- return response.json().get("element", "no actions")
3026
+ url = str(HttpUrl(f"{self.curation_command_root}/catalog-targets/{relationship_guid}"))
3027
+ response = await self._async_get_guid_request(
3028
+ url,
3029
+ _type=self.CATALOG_TARGET_LABEL,
3030
+ _gen_output=self._generate_catalog_target_output,
3031
+ output_format=output_format,
3032
+ output_format_set=output_format_set,
3033
+ body=body,
3034
+ )
3035
+ return response
3245
3036
 
3246
- def get_catalog_target(self, relationship_guid: str) -> dict | str:
3037
+ def get_catalog_target(self, relationship_guid: str,
3038
+ output_format: str = "JSON",
3039
+ output_format_set: str | dict = "CatalogTarget",
3040
+ body: dict | GetRequestBody = None) -> dict | str:
3247
3041
  """Retrieve a specific catalog target associated with an integration connector. Further Information:
3248
3042
  https://egeria-project.org/concepts/integration-connector/ .
3249
3043
 
@@ -3266,7 +3060,10 @@ class AutomatedCuration(Client2):
3266
3060
 
3267
3061
  loop = asyncio.get_event_loop()
3268
3062
  response = loop.run_until_complete(
3269
- self._async_get_catalog_target(relationship_guid)
3063
+ self._async_get_catalog_target(relationship_guid,
3064
+ output_format=output_format,
3065
+ output_format_set=output_format_set,
3066
+ body=body)
3270
3067
  )
3271
3068
  return response
3272
3069
 
@@ -3651,7 +3448,9 @@ class AutomatedCuration(Client2):
3651
3448
  return response
3652
3449
 
3653
3450
  async def _async_get_technology_type_detail(self, type_name: str, template_only: bool = False,
3654
- body: dict | FilterRequestBody = None) -> list | str:
3451
+ body: dict | FilterRequestBody = None,
3452
+ output_format: str = "JSON",
3453
+ output_format_set: str | dict = "TechType") -> list | str:
3655
3454
  """Retrieve the details of the named technology type. This name should be the name of the technology type
3656
3455
  and contain no wild cards. Async version.
3657
3456
  Parameters
@@ -3672,7 +3471,7 @@ class AutomatedCuration(Client2):
3672
3471
  If the technology type is not found, returns the string "no type found".
3673
3472
  Raises
3674
3473
  ------
3675
- PyegeriaException
3474
+ PyegeriaException
3676
3475
  ValidationError
3677
3476
 
3678
3477
  Notes
@@ -3696,20 +3495,32 @@ class AutomatedCuration(Client2):
3696
3495
  """
3697
3496
 
3698
3497
  # validate_name(type_name)
3699
- url = f"{self.curation_command_root}/technology-types/by-name"
3498
+ url = str(HttpUrl(f"{self.curation_command_root}/technology-types/by-name"))
3700
3499
  if body is None:
3701
3500
  classified_elements = ["Template"] if template_only else []
3702
3501
  body = {
3703
3502
  "class": "FilterRequestBody",
3704
3503
  "filter": type_name,
3705
- "includeOnlyClassifiedElements": classified_elements
3504
+ "includeOnlyClassifiedElements": classified_elements,
3706
3505
  }
3707
-
3708
- response = await self._async_make_request("POST", url, body)
3709
- return response.json().get("element", "no type found")
3506
+ response = await self._async_get_name_request(
3507
+ url,
3508
+ _type=self.TECH_TYPE_ENTITY_LABEL,
3509
+ _gen_output=self._generate_tech_type_output,
3510
+ filter_string=type_name,
3511
+ classification_names=classified_elements if template_only else None,
3512
+ start_from=0,
3513
+ page_size=0,
3514
+ output_format=output_format,
3515
+ output_format_set=output_format_set,
3516
+ body=body,
3517
+ )
3518
+ return response
3710
3519
 
3711
3520
  def get_technology_type_detail(self, type_name: str, template_only: bool = False,
3712
- body: dict | FilterRequestBody = None) -> list | str:
3521
+ body: dict | FilterRequestBody = None,
3522
+ output_format: str = "JSON",
3523
+ output_format_set: str | dict = "TechType") -> list | str:
3713
3524
  """Retrieve the details of the named technology type. This name should be the name of the technology type
3714
3525
  and contain no wild cards.
3715
3526
  Parameters
@@ -3730,7 +3541,7 @@ class AutomatedCuration(Client2):
3730
3541
  If the technology type is not found, returns the string "no type found".
3731
3542
  Raises
3732
3543
  ------
3733
- PyegeriaException
3544
+ PyegeriaException
3734
3545
  ValidationError
3735
3546
 
3736
3547
  Notes
@@ -3755,7 +3566,9 @@ class AutomatedCuration(Client2):
3755
3566
 
3756
3567
  loop = asyncio.get_event_loop()
3757
3568
  response = loop.run_until_complete(
3758
- self._async_get_technology_type_detail(type_name, template_only=template_only, body=body)
3569
+ self._async_get_technology_type_detail(type_name, template_only=template_only, body=body,
3570
+ output_format=output_format,
3571
+ output_format_set=output_format_set)
3759
3572
  )
3760
3573
  return response
3761
3574
 
@@ -3774,7 +3587,7 @@ class AutomatedCuration(Client2):
3774
3587
  )
3775
3588
  return response
3776
3589
 
3777
- async def _async_find_technology_types(
3590
+ async def async_find_technology_types(
3778
3591
  self,
3779
3592
  search_string: str = "*",
3780
3593
  start_from: int = 0,
@@ -3782,6 +3595,8 @@ class AutomatedCuration(Client2):
3782
3595
  starts_with: bool = False,
3783
3596
  ends_with: bool = False,
3784
3597
  ignore_case: bool = True,
3598
+ output_format: str = "JSON",
3599
+ output_format_set: str | dict = "TechType"
3785
3600
  ) -> list | str:
3786
3601
  """Retrieve the list of technology types that contain the search string. Async version.
3787
3602
 
@@ -3819,10 +3634,6 @@ class AutomatedCuration(Client2):
3819
3634
  For more information see: https://egeria-project.org/concepts/deployed-implementation-type
3820
3635
  """
3821
3636
 
3822
- starts_with_s = str(starts_with).lower()
3823
- ends_with_s = str(ends_with).lower()
3824
- ignore_case_s = str(ignore_case).lower()
3825
- validate_name(search_string)
3826
3637
  if search_string == "*":
3827
3638
  search_string = None
3828
3639
 
@@ -3844,7 +3655,17 @@ class AutomatedCuration(Client2):
3844
3655
  }
3845
3656
 
3846
3657
  response = await self._async_make_request("POST", url, body)
3847
- return response.json().get("elements", "no tech found")
3658
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
3659
+ if type(elements) is str:
3660
+ logger.info(NO_ELEMENTS_FOUND)
3661
+ return NO_ELEMENTS_FOUND
3662
+
3663
+ if output_format.upper() != 'JSON': # return a simplified markdown representation
3664
+ # logger.info(f"Found elements, output format: {output_format} and output_format_set: {output_format_set}")
3665
+ return self._generate_tech_type_output(elements, search_string, "TechType",
3666
+ output_format, output_format_set)
3667
+ return elements
3668
+
3848
3669
 
3849
3670
  def find_technology_types(
3850
3671
  self,
@@ -3854,6 +3675,122 @@ class AutomatedCuration(Client2):
3854
3675
  starts_with: bool = False,
3855
3676
  ends_with: bool = False,
3856
3677
  ignore_case: bool = True,
3678
+ output_format: str = "JSON",
3679
+ output_format_set: str | dict = "TechType",
3680
+ ) -> list | str:
3681
+ """Retrieve the list of technology types that contain the search string. Async version.
3682
+
3683
+ Parameters:
3684
+ ----------
3685
+ type_name: str
3686
+ The technology type we are looking for.
3687
+
3688
+ Returns:
3689
+ -------
3690
+ [dict] | str: List of elements describing the technology - or "no tech found" if not found.
3691
+
3692
+ Raises:
3693
+ ------
3694
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3695
+ this exception is raised with details from the response content.
3696
+ PropertyServerException: If the API response indicates a server side error.
3697
+ UserNotAuthorizedException:
3698
+
3699
+ Notes
3700
+ -----
3701
+ For more information see: https://egeria-project.org/concepts/deployed-implementation-type
3702
+ """
3703
+
3704
+ loop = asyncio.get_event_loop()
3705
+ response = loop.run_until_complete(
3706
+ self.async_find_technology_types(
3707
+ search_string,
3708
+ start_from,
3709
+ page_size,
3710
+ starts_with,
3711
+ ends_with,
3712
+ ignore_case,
3713
+ output_format,
3714
+ output_format_set
3715
+ )
3716
+ )
3717
+ return response
3718
+
3719
+ async def async_find_technology_types_body(
3720
+ self,
3721
+ search_string: str = "*",
3722
+ start_from: int = 0,
3723
+ page_size: int = 0,
3724
+ starts_with: bool = False,
3725
+ ends_with: bool = False,
3726
+ ignore_case: bool = True,
3727
+ output_format: str = "JSON",
3728
+ output_format_set: str | dict = "TechType",
3729
+ body: dict | SearchStringRequestBody = None
3730
+ ) -> list | str:
3731
+ """Retrieve the list of technology types that contain the search string. Async version.
3732
+
3733
+ Parameters:
3734
+ ----------
3735
+ type_name: str
3736
+ The technology type we are looking for.
3737
+ starts_with : bool, optional
3738
+ Whether to search engine actions that start with the given search string. Default is False.
3739
+
3740
+ ends_with : bool, optional
3741
+ Whether to search engine actions that end with the given search string. Default is False.
3742
+
3743
+ ignore_case : bool, optional
3744
+ Whether to ignore case while searching engine actions. Default is True.
3745
+
3746
+ start_from : int, optional
3747
+ The index from which to start fetching the engine actions. Default is 0.
3748
+
3749
+ page_size : int, optional
3750
+ The maximum number of engine actions to fetch in a single request. Default is `0`.
3751
+ body: dict | SearchStringRequestBody, optional
3752
+ Full request body, if provided, overrides other parameters.
3753
+
3754
+ Returns:
3755
+ -------
3756
+ [dict] | str: List of elements describing the technology - or "no tech found" if not found.
3757
+
3758
+ Raises:
3759
+ ------
3760
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3761
+ this exception is raised with details from the response content.
3762
+ PropertyServerException: If the API response indicates a server side error.
3763
+ UserNotAuthorizedException:
3764
+
3765
+ Notes
3766
+ -----
3767
+ For more information see: https://egeria-project.org/concepts/deployed-implementation-type
3768
+ """
3769
+
3770
+ if search_string == "*":
3771
+ search_string = None
3772
+
3773
+ url = str(HttpUrl(f"{self.curation_command_root}/technology-types/by-search-string"))
3774
+ response = await self._async_find_request(url, _type="TechType", search_string=search_string,
3775
+ _gen_output=self._generate_tech_type_output,
3776
+ classification_names=None,
3777
+ metadata_element_types='ValidMetadataValue',
3778
+ starts_with=starts_with, ends_with=ends_with, ignore_case=ignore_case,
3779
+ start_from=start_from, page_size=page_size,
3780
+ output_format=output_format, output_format_set=output_format_set,
3781
+ body=body)
3782
+
3783
+ return response
3784
+
3785
+
3786
+ def find_technology_types_body(
3787
+ self,
3788
+ search_string: str = "*",
3789
+ start_from: int = 0,
3790
+ page_size: int = 0,
3791
+ starts_with: bool = False,
3792
+ ends_with: bool = False,
3793
+ ignore_case: bool = True,
3857
3794
  ) -> list | str:
3858
3795
  """Retrieve the list of technology types that contain the search string. Async version.
3859
3796
 
@@ -3880,7 +3817,7 @@ class AutomatedCuration(Client2):
3880
3817
 
3881
3818
  loop = asyncio.get_event_loop()
3882
3819
  response = loop.run_until_complete(
3883
- self._async_find_technology_types(
3820
+ self.async_find_technology_types_body(
3884
3821
  search_string,
3885
3822
  start_from,
3886
3823
  page_size,
@@ -3892,16 +3829,16 @@ class AutomatedCuration(Client2):
3892
3829
  return response
3893
3830
 
3894
3831
  async def _async_get_all_technology_types(
3895
- self, start_from: int = 0, page_size: int = 0
3832
+ self, start_from: int = 0, page_size: int = 0, output_format: str = "JSON", output_format_set: str = "TechType"
3896
3833
  ) -> list | str:
3897
3834
  """Get all technology types - async version"""
3898
- return await self._async_find_technology_types("*", start_from, page_size)
3835
+ return await self._async_find_technology_types("*", start_from, page_size, output_format, output_format_set)
3899
3836
 
3900
3837
  def get_all_technology_types(
3901
- self, start_from: int = 0, page_size: int = 0
3838
+ self, start_from: int = 0, page_size: int = 0, output_format: str = "JSON", output_format_set: str = "TechType"
3902
3839
  ) -> list | str:
3903
3840
  """Get all technology types"""
3904
- return self.find_technology_types("*", start_from, page_size)
3841
+ return self.find_technology_types("*", start_from, page_size, output_format, output_format_set)
3905
3842
 
3906
3843
  def print_engine_action_summary(self, governance_action: dict):
3907
3844
  """print_governance_action_summary
@@ -3916,10 +3853,7 @@ class AutomatedCuration(Client2):
3916
3853
 
3917
3854
  Raises
3918
3855
  ------
3919
- InvalidParameterException
3920
- PropertyServerException
3921
- UserNotAuthorizedException
3922
- """
3856
+ PyegeriaException """
3923
3857
  if governance_action:
3924
3858
  name = governance_action.get("displayName")
3925
3859
  if not name:
@@ -3962,10 +3896,7 @@ class AutomatedCuration(Client2):
3962
3896
 
3963
3897
  Raises
3964
3898
  ------
3965
- InvalidParameterException
3966
- PropertyServerException
3967
- UserNotAuthorizedException
3968
-
3899
+ PyegeriaException
3969
3900
  """
3970
3901
  governance_actions = self.get_engine_actions()
3971
3902
  if governance_actions is not None: