pyegeria 0.3.8__py3-none-any.whl → 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. pyegeria/Xfeedback_manager_omvs.py +238 -0
  2. pyegeria/Xloaded_resources_omvs.py +91 -0
  3. pyegeria/__init__.py +15 -12
  4. pyegeria/_client.py +4 -6
  5. pyegeria/{gov_engine.py → _deprecated_gov_engine.py} +2 -59
  6. pyegeria/_exceptions.py +5 -6
  7. pyegeria/_globals.py +3 -1
  8. pyegeria/asset_catalog_omvs.py +672 -0
  9. pyegeria/automated_curation_omvs.py +627 -359
  10. pyegeria/collection_manager_omvs.py +187 -248
  11. pyegeria/core_guids.py +128 -0
  12. pyegeria/core_omag_server_config.py +1 -5
  13. pyegeria/full_omag_server_config.py +53 -83
  14. pyegeria/glossary_browser_omvs.py +2208 -0
  15. pyegeria/glossary_manager_omvs.py +3002 -0
  16. pyegeria/my_profile_omvs.py +2 -7
  17. pyegeria/platform_services.py +0 -3
  18. pyegeria/project_manager_omvs.py +9 -15
  19. pyegeria/registered_info.py +12 -52
  20. pyegeria/runtime_manager_omvs.py +967 -0
  21. pyegeria/server_operations.py +1 -5
  22. pyegeria/valid_metadata_omvs.py +204 -43
  23. pyegeria-0.4.0.data/scripts/Create_Collection_Sample.py +292 -0
  24. pyegeria-0.4.0.data/scripts/Create_Sustainability_Collection_Sample.py +115 -0
  25. pyegeria-0.4.0.data/scripts/get_guid_info.py +86 -0
  26. pyegeria-0.3.8.data/scripts/view_my_profile.py → pyegeria-0.4.0.data/scripts/get_my_profile.py +8 -34
  27. {pyegeria-0.3.8.data → pyegeria-0.4.0.data}/scripts/get_tech_details.py +1 -37
  28. pyegeria-0.4.0.data/scripts/get_tech_type_elements.py +137 -0
  29. pyegeria-0.4.0.data/scripts/get_tech_type_template.py +137 -0
  30. {pyegeria-0.3.8.data → pyegeria-0.4.0.data}/scripts/list_asset_types.py +3 -25
  31. pyegeria-0.4.0.data/scripts/list_assets.py +138 -0
  32. pyegeria-0.3.8.data/scripts/project_list_viewer.py → pyegeria-0.4.0.data/scripts/list_projects.py +13 -27
  33. pyegeria-0.4.0.data/scripts/list_registered_services.py +135 -0
  34. pyegeria-0.3.8.data/scripts/get_relationship_types.py → pyegeria-0.4.0.data/scripts/list_relationship_types.py +25 -43
  35. pyegeria-0.4.0.data/scripts/list_tech_templates.py +134 -0
  36. pyegeria-0.3.8.data/scripts/find_todos.py → pyegeria-0.4.0.data/scripts/list_todos.py +11 -39
  37. pyegeria-0.4.0.data/scripts/list_valid_metadata_values.py +144 -0
  38. pyegeria-0.4.0.data/scripts/view_asset_graph.py +236 -0
  39. pyegeria-0.3.8.data/scripts/multi-server_status.py → pyegeria-0.4.0.data/scripts/view_coco_status.py +17 -39
  40. pyegeria-0.3.8.data/scripts/collection_viewer.py → pyegeria-0.4.0.data/scripts/view_collection.py +12 -31
  41. pyegeria-0.3.8.data/scripts/engine_action_status.py → pyegeria-0.4.0.data/scripts/view_eng_action_status.py +17 -31
  42. pyegeria-0.3.8.data/scripts/glossary_view.py → pyegeria-0.4.0.data/scripts/view_glossary.py +2 -2
  43. pyegeria-0.3.8.data/scripts/gov_engine_status.py → pyegeria-0.4.0.data/scripts/view_gov_eng_status.py +0 -1
  44. pyegeria-0.3.8.data/scripts/integration_daemon_status.py → pyegeria-0.4.0.data/scripts/view_integ_daemon_status.py +30 -42
  45. pyegeria-0.3.8.data/scripts/my_todos.py → pyegeria-0.4.0.data/scripts/view_my_todos.py +1 -1
  46. pyegeria-0.3.8.data/scripts/open_todos.py → pyegeria-0.4.0.data/scripts/view_open_todos.py +3 -24
  47. pyegeria-0.4.0.data/scripts/view_platform_status.py +123 -0
  48. pyegeria-0.3.8.data/scripts/server_status.py → pyegeria-0.4.0.data/scripts/view_server_status.py +1 -20
  49. {pyegeria-0.3.8.dist-info → pyegeria-0.4.0.dist-info}/METADATA +5 -4
  50. pyegeria-0.4.0.dist-info/RECORD +58 -0
  51. {pyegeria-0.3.8.dist-info → pyegeria-0.4.0.dist-info}/WHEEL +1 -1
  52. pyegeria/glossary_omvs.py +0 -789
  53. pyegeria/loaded_resources_omvs.py +0 -159
  54. pyegeria-0.3.8.dist-info/RECORD +0 -42
  55. /pyegeria/{governance_author.py → action_author_omvs.py} +0 -0
  56. /pyegeria-0.3.8.data/scripts/get_tech_types.py → /pyegeria-0.4.0.data/scripts/list_tech_types.py +0 -0
  57. /pyegeria-0.3.8.data/scripts/server_status_widget.py → /pyegeria-0.4.0.data/scripts/view_server_list.py +0 -0
  58. {pyegeria-0.3.8.dist-info → pyegeria-0.4.0.dist-info}/LICENSE +0 -0
  59. {pyegeria-0.3.8.dist-info → pyegeria-0.4.0.dist-info}/top_level.txt +0 -0
@@ -2,7 +2,7 @@
2
2
  SPDX-License-Identifier: Apache-2.0
3
3
  Copyright Contributors to the ODPi Egeria project.
4
4
 
5
- Automated Curation View Service Methods - this file is in active development...
5
+ Automated Curation View Service Methods
6
6
 
7
7
  """
8
8
  import asyncio
@@ -11,10 +11,12 @@ from datetime import datetime
11
11
  from httpx import Response
12
12
 
13
13
  from pyegeria import Client, max_paging_size, body_slimmer
14
- from pyegeria._exceptions import (
15
- InvalidParameterException,
16
- )
14
+ from pyegeria._exceptions import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException)
17
15
  from ._validators import validate_name, validate_guid, validate_search_string
16
+ from .core_guids import (FileFolder_template_GUID,
17
+ PostgreSQL_Server_template_GUID,
18
+ Apache_Kafka_Server_template_GUID,
19
+ )
18
20
 
19
21
 
20
22
  class AutomatedCuration(Client):
@@ -30,24 +32,15 @@ class AutomatedCuration(Client):
30
32
  when the user doesn't pass the user_id on a method call.
31
33
  user_pwd: str
32
34
  The password associated with the user_id. Defaults to None
33
- verify_flag: bool
34
- Flag to indicate if SSL Certificates should be verified in the HTTP requests.
35
- Defaults to False.
35
+
36
36
 
37
37
  """
38
38
 
39
- def __init__(
40
- self,
41
- server_name: str,
42
- platform_url: str,
43
- user_id: str,
44
- user_pwd: str = None,
45
- verify_flag: bool = False,
46
- ):
39
+ def __init__(self, server_name: str, platform_url: str, user_id: str, user_pwd: str = None,
40
+ verify_flag: bool = False, ):
47
41
  Client.__init__(self, server_name, platform_url, user_id, user_pwd, verify_flag)
48
42
  self.cur_command_root = f"{platform_url}/servers/"
49
43
 
50
-
51
44
  async def _async_create_element_from_template(self, body: dict, server: str = None) -> str:
52
45
  """ Create a new metadata element from a template. Async version.
53
46
  Parameters
@@ -146,13 +139,11 @@ class AutomatedCuration(Client):
146
139
  }
147
140
  """
148
141
  loop = asyncio.get_event_loop()
149
- response = loop.run_until_complete(
150
- self._async_create_element_from_template(body, server)
151
- )
142
+ response = loop.run_until_complete(self._async_create_element_from_template(body, server))
152
143
  return response
153
144
 
154
145
  async def _async_create_kafka_server_element_from_template(self, kafka_server: str, host_name: str, port: str,
155
- server: str = None) -> str:
146
+ description: str = None, server: str = None) -> str:
156
147
  """ Create a Kafka server element from a template. Async version.
157
148
 
158
149
  Parameters
@@ -166,6 +157,9 @@ class AutomatedCuration(Client):
166
157
  port : str
167
158
  The port number of the Kafka server.
168
159
 
160
+ description: str, opt
161
+ A description of the Kafka server.
162
+
169
163
  server : str, optional
170
164
  The name of the view server to use. Default uses the client instance.
171
165
 
@@ -175,20 +169,15 @@ class AutomatedCuration(Client):
175
169
  The GUID of the Kafka server element.
176
170
  """
177
171
 
178
- body = {
179
- "templateGUID": "5e1ff810-5418-43f7-b7c4-e6e062f9aff7",
180
- "isOwnAnchor": 'true',
181
- "placeholderPropertyValues": {
182
- "serverName": kafka_server,
183
- "hostIdentifier": host_name,
184
- "portNumber": port
185
- }
186
- }
187
- response = await self._async_create_element_from_template(body, server)
188
- return response
172
+ body = {"templateGUID": Apache_Kafka_Server_template_GUID, "isOwnAnchor": 'true',
173
+ "placeholderPropertyValues": {"serverName": kafka_server, "hostIdentifier": host_name,
174
+ "portNumber": port, "description": description}}
175
+ body_s = body_slimmer(body)
176
+ response = await self._async_create_element_from_template(body_s, server)
177
+ return str(response)
189
178
 
190
179
  def create_kafka_server_element_from_template(self, kafka_server: str, host_name: str, port: str,
191
- server: str = None) -> str:
180
+ description: str = None, server: str = None) -> str:
192
181
  """ Create a Kafka server element from a template.
193
182
 
194
183
  Parameters
@@ -202,6 +191,9 @@ class AutomatedCuration(Client):
202
191
  port : str
203
192
  The port number of the Kafka server.
204
193
 
194
+ description: str, opt
195
+ A description of the Kafka server.
196
+
205
197
  server : str, optional
206
198
  The name of the view server to use. Default uses the client instance.
207
199
 
@@ -212,12 +204,13 @@ class AutomatedCuration(Client):
212
204
  """
213
205
  loop = asyncio.get_event_loop()
214
206
  response = loop.run_until_complete(
215
- self._async_create_kafka_server_element_from_template(kafka_server, host_name, port, server)
216
- )
207
+ self._async_create_kafka_server_element_from_template(kafka_server, host_name, port,
208
+ description, server))
217
209
  return response
218
210
 
219
211
  async def _async_create_postgres_server_element_from_template(self, postgres_server: str, host_name: str, port: str,
220
- db_user: str, db_pwd: str, server: str = None) -> str:
212
+ db_user: str, db_pwd: str, description: str = None,
213
+ server: str = None) -> str:
221
214
  """ Create a Postgres server element from a template. Async version.
222
215
 
223
216
  Parameters
@@ -237,30 +230,28 @@ class AutomatedCuration(Client):
237
230
  db_pwd: str
238
231
  User password to connect to the database
239
232
 
233
+ description: str, opt
234
+ A description of the Kafka server.
235
+
240
236
  server : str, optional
241
237
  The name of the view server to use. Default uses the client instance.
242
238
 
243
239
  Returns
244
240
  -------
245
241
  str
246
- The GUID of the Kafka server element.
242
+ The GUID of the Postgres server element.
247
243
  """
248
- body = {
249
- "templateGUID": "542134e6-b9ce-4dce-8aef-22e8daf34fdb",
250
- "isOwnAnchor": 'true',
251
- "placeholderPropertyValues": {
252
- "serverName": postgres_server,
253
- "hostIdentifier": host_name,
254
- "portNumber": port,
255
- "databaseUserId": db_user,
256
- "databasePassword": db_pwd
257
- }
258
- }
259
- response = await self._async_create_element_from_template(body, server)
260
- return response
244
+ body = {"templateGUID": PostgreSQL_Server_template_GUID, "isOwnAnchor": 'true',
245
+ "placeholderPropertyValues": {"serverName": postgres_server, "hostIdentifier": host_name,
246
+ "portNumber": port, "databaseUserId": db_user, "description": description,
247
+ "databasePassword": db_pwd}}
248
+ body_s = body_slimmer(body)
249
+ response = await self._async_create_element_from_template(body_s, server)
250
+ return str(response)
261
251
 
262
252
  def create_postgres_server_element_from_template(self, postgres_server: str, host_name: str, port: str,
263
- db_user: str, db_pwd: str, server: str = None) -> str:
253
+ db_user: str, db_pwd: str, description: str = None,
254
+ server: str = None) -> str:
264
255
  """ Create a Postgres server element from a template.
265
256
 
266
257
  Parameters
@@ -277,6 +268,9 @@ class AutomatedCuration(Client):
277
268
  server : str, optional
278
269
  The name of the view server to use. Default uses the client instance.
279
270
 
271
+ description: str, opt
272
+ A description of the Kafka server.
273
+
280
274
  db_user: str
281
275
  User name to connect to the database
282
276
 
@@ -290,9 +284,89 @@ class AutomatedCuration(Client):
290
284
  """
291
285
  loop = asyncio.get_event_loop()
292
286
  response = loop.run_until_complete(
293
- self._async_create_postgres_server_element_from_template(postgres_server, host_name,
294
- port, db_user, db_pwd, server)
295
- )
287
+ self._async_create_postgres_server_element_from_template(postgres_server, host_name, port, db_user, db_pwd,
288
+ description, server))
289
+ return response
290
+
291
+ async def _async_create_folder_element_from_template(self, path_name: str, folder_name: str, file_system: str,
292
+ description: str = None, version: str = None,
293
+ server: str = None) -> str:
294
+ """ Create a File folder element from a template. Async version.
295
+
296
+ Parameters
297
+ ----------
298
+ path_name : str
299
+ The name of the fill path including the folder..
300
+
301
+ folder_name : str
302
+ The name of the folder to create.
303
+
304
+ file_system : str
305
+ The unique name for the file system that the folder belongs to. It may be a machine name or URL to a remote
306
+ file store.
307
+
308
+ description: str, opt
309
+ A description of the Kafka server.
310
+
311
+ version: str, opt
312
+ version of the file folder - typically of the form x.y.z
313
+
314
+ server : str, optional
315
+ The name of the view server to use. Default uses the client instance.
316
+
317
+ Returns
318
+ -------
319
+ str
320
+ The GUID of the File Folder element.
321
+ """
322
+ body = {"templateGUID": FileFolder_template_GUID,
323
+ "isOwnAnchor": 'true',
324
+ "placeholderPropertyValues": {
325
+ "directoryPathName": path_name,
326
+ "directoryName": folder_name,
327
+ "versionIdentifier": version,
328
+ "fileSystemName": file_system,
329
+ "description": description,
330
+ }
331
+ }
332
+ body_s = body_slimmer(body)
333
+ response = await self._async_create_element_from_template(body_s, server)
334
+ return str(response)
335
+
336
+ def create_folder_element_from_template(self, path_name: str, folder_name: str, file_system: str,
337
+ description: str = None, version: str = None, server: str = None) -> str:
338
+ """ Create a File folder element from a template.
339
+
340
+ Parameters
341
+ ----------
342
+ path_name : str
343
+ The name of the fill path including the folder..
344
+
345
+ folder_name : str
346
+ The name of the folder to create.
347
+
348
+ file_system : str
349
+ The unique name for the file system that the folder belongs to. It may be a machine name or URL to a
350
+ remote file store.
351
+
352
+ description: str, opt
353
+ A description of the Kafka server.
354
+
355
+ version: str, opt
356
+ version of the file folder - typically of the form x.y.z
357
+
358
+ server : str, optional
359
+ The name of the view server to use. Default uses the client instance.
360
+
361
+ Returns
362
+ -------
363
+ str
364
+ The GUID of the Postgres server element.
365
+ """
366
+ loop = asyncio.get_event_loop()
367
+ response = loop.run_until_complete(
368
+ self._async_create_folder_element_from_template(path_name, folder_name, file_system,
369
+ description, version, server))
296
370
  return response
297
371
 
298
372
  #
@@ -360,9 +434,7 @@ class AutomatedCuration(Client):
360
434
  For more information see: https://egeria-project.org/concepts/engine-action
361
435
  """
362
436
  loop = asyncio.get_event_loop()
363
- response = loop.run_until_complete(
364
- self._async_get_engine_actions(server, start_from, page_size)
365
- )
437
+ response = loop.run_until_complete(self._async_get_engine_actions(server, start_from, page_size))
366
438
  return response
367
439
 
368
440
  async def _async_get_engine_action(self, engine_action_guid: str, server: str = None) -> dict:
@@ -424,9 +496,7 @@ class AutomatedCuration(Client):
424
496
  For more information see: https://egeria-project.org/concepts/engine-action
425
497
  """
426
498
  loop = asyncio.get_event_loop()
427
- response = loop.run_until_complete(
428
- self._async_get_engine_action(engine_action_guid, server)
429
- )
499
+ response = loop.run_until_complete(self._async_get_engine_action(engine_action_guid, server))
430
500
  return response
431
501
 
432
502
  async def _async_cancel_engine_action(self, engine_action_guid: str, server: str = None) -> None:
@@ -488,8 +558,7 @@ class AutomatedCuration(Client):
488
558
  For more information see: https://egeria-project.org/concepts/engine-action
489
559
  """
490
560
  loop = asyncio.get_event_loop()
491
- loop.run_until_complete(
492
- self._async_cancel_engine_action(engine_action_guid, server))
561
+ loop.run_until_complete(self._async_cancel_engine_action(engine_action_guid, server))
493
562
  return
494
563
 
495
564
  async def _async_get_active_engine_actions(self, server: str = None, start_from: int = 0,
@@ -553,9 +622,7 @@ class AutomatedCuration(Client):
553
622
 
554
623
  """
555
624
  loop = asyncio.get_event_loop()
556
- response = loop.run_until_complete(
557
- self._async_get_active_engine_actions(server, start_from, page_size)
558
- )
625
+ response = loop.run_until_complete(self._async_get_active_engine_actions(server, start_from, page_size))
559
626
  return response
560
627
 
561
628
  async def _async_get_engine_actions_by_name(self, name: str, server: str = None, start_from: int = 0,
@@ -596,9 +663,7 @@ class AutomatedCuration(Client):
596
663
 
597
664
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions/by-name?"
598
665
  f"startFrom={start_from}&pageSize={page_size}")
599
- body = {
600
- "filter": name
601
- }
666
+ body = {"filter": name}
602
667
  response = await self._async_make_request("POST", url, body)
603
668
  return response.json().get("elements", "no actions")
604
669
 
@@ -637,9 +702,7 @@ class AutomatedCuration(Client):
637
702
 
638
703
  """
639
704
  loop = asyncio.get_event_loop()
640
- response = loop.run_until_complete(
641
- self._async_get_engine_actions_by_name(name, server, start_from, page_size)
642
- )
705
+ response = loop.run_until_complete(self._async_get_engine_actions_by_name(name, server, start_from, page_size))
643
706
  return response
644
707
 
645
708
  async def _async_find_engine_actions(self, search_string: str, server: str = None, starts_with: bool = False,
@@ -695,12 +758,8 @@ class AutomatedCuration(Client):
695
758
 
696
759
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions/"
697
760
  f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
698
- f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
699
- )
700
- body = {
701
- "class": "SearchStringRequestBody",
702
- "name": search_string
703
- }
761
+ f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}")
762
+ body = {"class": "SearchStringRequestBody", "name": search_string}
704
763
  response = await self._async_make_request("POST", url, body)
705
764
  return response.json().get("elements", "no actions")
706
765
 
@@ -750,10 +809,8 @@ class AutomatedCuration(Client):
750
809
 
751
810
  loop = asyncio.get_event_loop()
752
811
  response = loop.run_until_complete(
753
- self._async_find_engine_actions(search_string, server, starts_with,
754
- ends_with, ignore_case, start_from,
755
- page_size)
756
- )
812
+ self._async_find_engine_actions(search_string, server, starts_with, ends_with, ignore_case, start_from,
813
+ page_size))
757
814
  return response
758
815
 
759
816
  #
@@ -812,9 +869,7 @@ class AutomatedCuration(Client):
812
869
  UserNotAuthorizedException:
813
870
  """
814
871
  loop = asyncio.get_event_loop()
815
- response = loop.run_until_complete(
816
- self._async_get_governance_action_process_by_guid(process_guid, server)
817
- )
872
+ response = loop.run_until_complete(self._async_get_governance_action_process_by_guid(process_guid, server))
818
873
  return response
819
874
 
820
875
  async def _async_get_gov_action_process_graph(self, process_guid: str, server: str = None) -> dict | str:
@@ -846,7 +901,7 @@ class AutomatedCuration(Client):
846
901
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/"
847
902
  f"governance-action-processes/{process_guid}/graph")
848
903
 
849
- response = await self._async_make_request("GET", url)
904
+ response = await self._async_make_request("POST", url)
850
905
  return response.json().get("element", "no actions")
851
906
 
852
907
  def get_gov_action_process_graph(self, process_guid: str, server: str = None) -> dict | str:
@@ -873,9 +928,7 @@ class AutomatedCuration(Client):
873
928
 
874
929
  """
875
930
  loop = asyncio.get_event_loop()
876
- response = loop.run_until_complete(
877
- self._async_gov_action_process_graph(process_guid, server)
878
- )
931
+ response = loop.run_until_complete(self._async_get_gov_action_process_graph(process_guid, server))
879
932
  return response
880
933
 
881
934
  async def _async_get_gov_action_processes_by_name(self, name: str, server: str = None, start_from: int = None,
@@ -912,10 +965,7 @@ class AutomatedCuration(Client):
912
965
 
913
966
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-processes/"
914
967
  f"by-name?startFrom={start_from}&pageSize={page_size}")
915
- body = {
916
- "class": "NameRequestBody",
917
- "name": name
918
- }
968
+ body = {"class": "NameRequestBody", "name": name}
919
969
  response = await self._async_make_request("POST", url, body)
920
970
  return response.json().get("elements", "no actions")
921
971
 
@@ -950,8 +1000,7 @@ class AutomatedCuration(Client):
950
1000
  """
951
1001
  loop = asyncio.get_event_loop()
952
1002
  response = loop.run_until_complete(
953
- self._async_get_gov_action_processes_by_name(name, server, start_from, page_size)
954
- )
1003
+ self._async_get_gov_action_processes_by_name(name, server, start_from, page_size))
955
1004
  return response
956
1005
 
957
1006
  async def _async_find_gov_action_processes(self, search_string: str, server: str = None, starts_with: bool = False,
@@ -1002,15 +1051,16 @@ class AutomatedCuration(Client):
1002
1051
  ends_with_s = str(ends_with).lower()
1003
1052
  ignore_case_s = str(ignore_case).lower()
1004
1053
 
1005
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-process/"
1054
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-processes/"
1006
1055
  f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
1007
- f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
1008
- )
1009
- body = {
1010
- "class": "SearchStringRequestBody",
1011
- "name": search_string
1012
- }
1013
- response = await self._async_make_request("POST", url, body)
1056
+ f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}")
1057
+
1058
+ if search_string:
1059
+ body = {"filter": search_string}
1060
+ response = await self._async_make_request("POST", url, body)
1061
+ else:
1062
+ response = await self._async_make_request("POST", url)
1063
+
1014
1064
  return response.json().get("elements", "no actions")
1015
1065
 
1016
1066
  def find_gov_action_processes(self, search_string: str = "*", server: str = None, starts_with: bool = False,
@@ -1057,8 +1107,7 @@ class AutomatedCuration(Client):
1057
1107
  loop = asyncio.get_event_loop()
1058
1108
  response = loop.run_until_complete(
1059
1109
  self._async_find_gov_action_processes(search_string, server, starts_with, ends_with, ignore_case,
1060
- start_from, page_size)
1061
- )
1110
+ start_from, page_size))
1062
1111
  return response
1063
1112
 
1064
1113
  async def _async_initiate_gov_action_process(self, action_type_qualified_name: str, request_source_guids: [str],
@@ -1097,23 +1146,17 @@ class AutomatedCuration(Client):
1097
1146
  """
1098
1147
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-processes/"
1099
1148
  f"initiate")
1100
- body = {
1101
- "class": "GovernanceActionProcessRequestBody",
1102
- "processQualifiedName": action_type_qualified_name,
1103
- "requestSourceGUIDs": request_source_guids,
1104
- "actionTargets": action_targets,
1105
- "startTime": int(start_time.timestamp() * 1000),
1106
- "requestParameters": request_parameters,
1107
- "originatorServiceName": orig_service_name,
1108
- "originatorEngineName": orig_engine_name
1109
- }
1149
+ body = {"class": "GovernanceActionProcessRequestBody", "processQualifiedName": action_type_qualified_name,
1150
+ "requestSourceGUIDs": request_source_guids, "actionTargets": action_targets,
1151
+ "startTime": int(start_time.timestamp() * 1000), "requestParameters": request_parameters,
1152
+ "originatorServiceName": orig_service_name, "originatorEngineName": orig_engine_name}
1110
1153
  new_body = body_slimmer(body)
1111
1154
  response = await self._async_make_request("POST", url, new_body)
1112
1155
  return response.json().get("guid", "Action not initiated")
1113
1156
 
1114
1157
  def initiate_gov_action_process(self, action_type_qualified_name: str, request_source_guids: [str],
1115
- action_targets: [str], start_time: datetime, request_parameters: dict,
1116
- orig_service_name: str, orig_engine_name: str, server: str = None) -> str:
1158
+ action_targets: [str], start_time: datetime, request_parameters: dict,
1159
+ orig_service_name: str, orig_engine_name: str, server: str = None) -> str:
1117
1160
  """ Using the named governance action process as a template, initiate a chain of engine actions.
1118
1161
 
1119
1162
  Parameters
@@ -1148,10 +1191,9 @@ class AutomatedCuration(Client):
1148
1191
  """
1149
1192
  loop = asyncio.get_event_loop()
1150
1193
  response = loop.run_until_complete(
1151
- self._async_initiate_gov_action_process(action_type_qualified_name, request_source_guids,
1152
- action_targets, start_time, request_parameters,
1153
- orig_service_name, orig_engine_name, server)
1154
- )
1194
+ self._async_initiate_gov_action_process(action_type_qualified_name, request_source_guids, action_targets,
1195
+ start_time, request_parameters, orig_service_name, orig_engine_name,
1196
+ server))
1155
1197
  return response
1156
1198
 
1157
1199
  async def _async_get_gov_action_types_by_guid(self, gov_action_type_guid: str, server: str = None) -> dict | str:
@@ -1204,13 +1246,11 @@ class AutomatedCuration(Client):
1204
1246
  UserNotAuthorizedException:
1205
1247
  """
1206
1248
  loop = asyncio.get_event_loop()
1207
- response = loop.run_until_complete(
1208
- self._async_get_gov_action_type_by_guid(gov_action_type_guid, server)
1209
- )
1249
+ response = loop.run_until_complete(self._async_get_gov_action_types_by_guid(gov_action_type_guid, server))
1210
1250
  return response
1211
1251
 
1212
- async def _async_get_gov_action_types_by_name(self, action_type_name, server: str = None,
1213
- start_from: int = 0, page_size: int = max_paging_size) -> list | str:
1252
+ async def _async_get_gov_action_types_by_name(self, action_type_name, server: str = None, start_from: int = 0,
1253
+ page_size: int = max_paging_size) -> list | str:
1214
1254
  """ Retrieve the list of governance action type metadata elements with a matching qualified or display name.
1215
1255
  There are no wildcards supported on this request. Async version.
1216
1256
 
@@ -1238,16 +1278,13 @@ class AutomatedCuration(Client):
1238
1278
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/"
1239
1279
  f"governance-action-types/by-name?startFrom={start_from}&pageSize={page_size}")
1240
1280
 
1241
- body = {
1242
- "class": "NameRequestBody",
1243
- "name": action_type_name
1244
- }
1281
+ body = {"class": "NameRequestBody", "name": action_type_name}
1245
1282
 
1246
1283
  response = await self._async_make_request("POST", url, body)
1247
1284
  return response.json().get("elements", "no actions")
1248
1285
 
1249
- def get_gov_action_types_by_name(self, action_type_name, server: str = None,
1250
- start_from: int = 0, page_size: int = max_paging_size) -> list | str:
1286
+ def get_gov_action_types_by_name(self, action_type_name, server: str = None, start_from: int = 0,
1287
+ page_size: int = max_paging_size) -> list | str:
1251
1288
  """ Retrieve the list of governance action type metadata elements with a matching qualified or display name.
1252
1289
  There are no wildcards supported on this request. Async version.
1253
1290
 
@@ -1270,15 +1307,12 @@ class AutomatedCuration(Client):
1270
1307
  """
1271
1308
  loop = asyncio.get_event_loop()
1272
1309
  response = loop.run_until_complete(
1273
- self._async_get_gov_action_types_by_name(action_type_name, server,
1274
- start_from, page_size)
1275
- )
1310
+ self._async_get_gov_action_types_by_name(action_type_name, server, start_from, page_size))
1276
1311
  return response
1277
1312
 
1278
1313
  async def _async_find_gov_action_types(self, search_string: str = "*", server: str = None,
1279
- starts_with: bool = False,
1280
- ends_with: bool = False, ignore_case: bool = True, start_from: int = 0,
1281
- page_size: int = max_paging_size) -> list | str:
1314
+ starts_with: bool = False, ends_with: bool = False, ignore_case: bool = True,
1315
+ start_from: int = 0, page_size: int = max_paging_size) -> list | str:
1282
1316
  """ Retrieve the list of governance action type metadata elements that contain the search string.
1283
1317
  Async Version.
1284
1318
 
@@ -1329,12 +1363,8 @@ class AutomatedCuration(Client):
1329
1363
 
1330
1364
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
1331
1365
  f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
1332
- f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
1333
- )
1334
- body = {
1335
- "class": "SearchStringRequestBody",
1336
- "name": search_string
1337
- }
1366
+ f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}")
1367
+ body = {"class": "SearchStringRequestBody", "name": search_string}
1338
1368
  response = await self._async_make_request("POST", url, body)
1339
1369
  return response.json().get("elements", "no action types")
1340
1370
 
@@ -1381,16 +1411,14 @@ class AutomatedCuration(Client):
1381
1411
  """
1382
1412
  loop = asyncio.get_event_loop()
1383
1413
  response = loop.run_until_complete(
1384
- self._async_find_gov_action_types(search_string, server, starts_with, ends_with,
1385
- ignore_case, start_from, page_size)
1386
- )
1414
+ self._async_find_gov_action_types(search_string, server, starts_with, ends_with, ignore_case, start_from,
1415
+ page_size))
1387
1416
  return response
1388
1417
 
1389
1418
  async def _async_initiate_gov_action_type(self, action_type_qualified_name: str, request_source_guids: [str],
1390
1419
  action_targets: list, start_time: datetime = None,
1391
- request_parameters: dict = None,
1392
- orig_service_name: str = None, orig_engine_name: str = None,
1393
- server: str = None) -> str:
1420
+ request_parameters: dict = None, orig_service_name: str = None,
1421
+ orig_engine_name: str = None, server: str = None) -> str:
1394
1422
  """ Using the named governance action type as a template, initiate an engine action. Async version.
1395
1423
 
1396
1424
  Parameters
@@ -1426,16 +1454,12 @@ class AutomatedCuration(Client):
1426
1454
  server = self.server_name if server is None else server
1427
1455
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
1428
1456
  f"initiate")
1429
- body = {
1430
- "class": "InitiateGovernanceActionTypeRequestBody",
1431
- "governanceActionTypeQualifiedName": action_type_qualified_name,
1432
- "requestSourceGUIDs": request_source_guids,
1433
- "actionTargets": action_targets,
1434
- "startDate": int(start_time.timestamp() * 1000),
1435
- "requestParameters": request_parameters,
1436
- "originatorServiceName": orig_service_name,
1437
- "originatorEngineName": orig_engine_name
1438
- }
1457
+ body = {"class": "InitiateGovernanceActionTypeRequestBody",
1458
+ "governanceActionTypeQualifiedName": action_type_qualified_name,
1459
+ "requestSourceGUIDs": request_source_guids,
1460
+ "actionTargets": action_targets, "startDate": int(start_time.timestamp() * 1000),
1461
+ "requestParameters": request_parameters, "originatorServiceName": orig_service_name,
1462
+ "originatorEngineName": orig_engine_name}
1439
1463
  new_body = body_slimmer(body)
1440
1464
  response = await self._async_make_request("POST", url, new_body)
1441
1465
  return response.json().get("guid", "Action not initiated")
@@ -1476,152 +1500,207 @@ class AutomatedCuration(Client):
1476
1500
  """
1477
1501
  loop = asyncio.get_event_loop()
1478
1502
  response = loop.run_until_complete(
1479
- self._async_initiate_gov_action_type(action_type_qualified_name, request_source_guids,
1480
- action_targets, start_time, request_parameters,
1481
- orig_service_name, orig_engine_name, server)
1482
- )
1503
+ self._async_initiate_gov_action_type(action_type_qualified_name, request_source_guids, action_targets,
1504
+ start_time, request_parameters, orig_service_name, orig_engine_name,
1505
+ server))
1483
1506
  return response
1484
1507
 
1485
1508
  async def _async_initiate_postgres_database_survey(self, postgres_database_guid: str, server: str = None) -> str:
1509
+ """ Initiate a postgres database survey"""
1486
1510
  server = self.server_name if server is None else server
1487
1511
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
1488
1512
  f"initiate")
1489
1513
 
1490
- body = {
1491
- "class": "InitiateGovernanceActionTypeRequestBody",
1492
- "governanceActionTypeQualifiedName": "Egeria:GovernanceActionType:2adeb8f1-0f59-4970-b6f2-6cc25d4d2402survey-postgres-database",
1493
- "actionTargets": [{
1494
- "class": "NewActionTarget",
1495
- "actionTargetName": "serverToSurvey",
1496
- "actionTargetGUID": postgres_database_guid
1497
- }]
1498
- }
1514
+ body = {"class": "InitiateGovernanceActionTypeRequestBody",
1515
+ "governanceActionTypeQualifiedName":
1516
+ "Egeria:GovernanceActionType:2adeb8f1-0f59-4970-b6f2-6cc25d4d2402survey-postgres-database",
1517
+ "actionTargets": [{"class": "NewActionTarget", "actionTargetName": "serverToSurvey",
1518
+ "actionTargetGUID": postgres_database_guid}]}
1499
1519
  response = await self._async_make_request("POST", url, body)
1500
1520
  return response.json().get("guid", "Action not initiated")
1501
1521
 
1502
1522
  def initiate_postgres_database_survey(self, postgres_database_guid: str, server: str = None) -> str:
1523
+ """ Initiate a postgres database survey"""
1503
1524
  loop = asyncio.get_event_loop()
1504
- response = loop.run_until_complete(
1505
- self._async_initiate_postgres_server_survey(postgres_database_guid, server)
1506
- )
1525
+ response = loop.run_until_complete(self._async_initiate_postgres_server_survey(postgres_database_guid, server))
1507
1526
  return response
1508
1527
 
1509
1528
  async def _async_initiate_postgres_server_survey(self, postgres_server_guid: str, server: str = None) -> str:
1529
+ """ Initiate a postgres server survey - Async version"""
1510
1530
  server = self.server_name if server is None else server
1511
1531
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
1512
1532
  f"initiate")
1513
1533
 
1514
- body = {
1515
- "class": "InitiateGovernanceActionTypeRequestBody",
1516
- "governanceActionTypeQualifiedName": "Egeria:GovernanceActionType:2adeb8f1-0f59-4970-b6f2-6cc25d4d2402survey-postgres-server",
1517
- "actionTargets": [{
1518
- "class": "NewActionTarget",
1519
- "actionTargetName": "serverToSurvey",
1520
- "actionTargetGUID": postgres_server_guid
1521
- }]
1522
- }
1534
+ body = {"class": "InitiateGovernanceActionTypeRequestBody",
1535
+ "governanceActionTypeQualifiedName": "Egeria:GovernanceActionType:AssetSurvey:survey-postgres-server",
1536
+ "actionTargets": [{"class": "NewActionTarget", "actionTargetName": "serverToSurvey",
1537
+ "actionTargetGUID": postgres_server_guid}]}
1523
1538
  response = await self._async_make_request("POST", url, body)
1524
1539
  return response.json().get("guid", "Action not initiated")
1525
- # Create/Retrieve the Postgres Server Element
1526
-
1527
- # Run the survey using the information and return the engine action to monitor
1528
1540
 
1529
1541
  def initiate_postgres_server_survey(self, postgres_server_guid: str, server: str = None) -> str:
1542
+ """ Initiate a postgres server survey"""
1530
1543
  loop = asyncio.get_event_loop()
1531
- response = loop.run_until_complete(
1532
- self._async_initiate_postgres_server_survey(postgres_server_guid, server)
1533
- )
1544
+ response = loop.run_until_complete(self._async_initiate_postgres_server_survey(postgres_server_guid, server))
1534
1545
  return response
1535
1546
 
1536
-
1537
-
1538
1547
  async def _async_initiate_file_folder_survey(self, file_folder_guid: str,
1548
+ survey_name: str =
1549
+ "Egeria:GovernanceActionType:AssetSurvey:survey-folder",
1539
1550
  server: str = None) -> str:
1551
+ """ Initiate a file folder survey - async version
1552
+
1553
+ Parameters:
1554
+ ----------
1555
+ file_folder_guid: str
1556
+ The GUID of the File Folder that we wish to survey.
1557
+ survey_name: str, optional
1558
+ The unique name of the survey routine to execute. Default surveys all folders.
1559
+ server: str, optional
1560
+ The name of the server. If None, will use the default server specified in the instance will be used.
1561
+ Returns:
1562
+ -------
1563
+ str:
1564
+ The guid of the survey being run.
1565
+
1566
+ Raises:
1567
+ ------
1568
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
1569
+ this exception is raised with details from the response content.
1570
+ PropertyServerException: If the API response indicates a server side error.
1571
+ UserNotAuthorizedException:
1572
+
1573
+ Notes:
1574
+ There are multiple kinds of file folder surveys available, each with their own purpose. They are described
1575
+ in the Core Content Brain.
1576
+
1577
+ File Folder Survey Names currently include::
1578
+ - Egeria:GovernanceActionType:AssetSurvey:survey-folders
1579
+ - Egeria:GovernanceActionType:AssetSurvey:survey-folder-and-files
1580
+ - Egeria:GovernanceActionType:AssetSurvey:survey-all-folders
1581
+ - Egeria:GovernanceActionType:AssetSurvey:survey-all-folders-and-files
1582
+ """
1540
1583
  server = self.server_name if server is None else server
1541
1584
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
1542
1585
  f"initiate")
1543
1586
 
1544
- body = {
1545
- "class": "InitiateGovernanceActionTypeRequestBody",
1546
- "governanceActionTypeQualifiedName":
1547
- "Egeria:GovernanceActionType:2adeb8f1-0f59-4970-b6f2-6cc25d4d2402survey-folder",
1548
- "actionTargets": [{
1549
- "class": "NewActionTarget",
1550
- "actionTargetName": "folderToSurvey",
1551
- "actionTargetGUID": file_folder_guid
1552
- }]
1553
- }
1587
+ body = {"class": "InitiateGovernanceActionTypeRequestBody", "governanceActionTypeQualifiedName": survey_name,
1588
+ "actionTargets": [{"class": "NewActionTarget", "actionTargetName": "folderToSurvey",
1589
+ "actionTargetGUID": file_folder_guid}]}
1554
1590
  response = await self._async_make_request("POST", url, body)
1555
1591
  return response.json().get("guid", "Action not initiated")
1556
1592
 
1557
- def initiate_file_folder_survey(self, file_folder_guid:str, server: str = None) -> str:
1593
+ def initiate_file_folder_survey(self, file_folder_guid: str,
1594
+ survey_name: str = "Egeria:GovernanceActionType:AssetSurvey:survey-folder",
1595
+ server: str = None) -> str:
1596
+ """ Initiate a file folder survey - async version
1597
+
1598
+ Parameters:
1599
+ ----------
1600
+ file_folder_guid: str
1601
+ The GUID of the File Folder that we wish to survey.
1602
+ survey_name: str, optional
1603
+ The unique name of the survey routine to execute. Default surveys all folders.
1604
+ server: str, optional
1605
+ The name of the server. If None, will use the default server specified in the instance will be used.
1606
+ Returns:
1607
+ -------
1608
+ str:
1609
+ The guid of the survey being run.
1610
+
1611
+ Raises:
1612
+ ------
1613
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
1614
+ this exception is raised with details from the response content.
1615
+ PropertyServerException: If the API response indicates a server side error.
1616
+ UserNotAuthorizedException:
1617
+
1618
+ Notes:
1619
+ There are multiple kinds of file folder surveys available, each with their own purpose. They are described
1620
+ in the Core Content Brain.
1621
+
1622
+ File Folder Survey Names currently include::
1623
+ - Egeria:GovernanceActionType:AssetSurvey:survey-folders
1624
+ - Egeria:GovernanceActionType:AssetSurvey:survey-folder-and-files
1625
+ - Egeria:GovernanceActionType:AssetSurvey:survey-all-folders
1626
+ - Egeria:GovernanceActionType:AssetSurvey:survey-all-folders-and-files
1627
+
1628
+
1629
+ """
1558
1630
  loop = asyncio.get_event_loop()
1559
1631
  response = loop.run_until_complete(
1560
- self._async_initiate_file_folder_survey(file_folder_guid, server)
1561
- )
1632
+ self._async_initiate_file_folder_survey(file_folder_guid, survey_name, server))
1562
1633
  return response
1563
1634
 
1564
- async def _async_initiate_file_survey(self, file_guid: str,
1565
- server: str = None) -> str:
1635
+ async def _async_initiate_file_survey(self, file_guid: str, server: str = None) -> str:
1636
+ """ Initiate a file survey - async version"""
1566
1637
  server = self.server_name if server is None else server
1567
1638
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
1568
1639
  f"initiate")
1569
1640
 
1570
- body = {
1571
- "class": "InitiateGovernanceActionTypeRequestBody",
1572
- "governanceActionTypeQualifiedName":
1573
- "Egeria:GovernanceActionType:2adeb8f1-0f59-4970-b6f2-6cc25d4d2402survey-folder",
1574
- "actionTargets": [{
1575
- "class": "NewActionTarget",
1576
- "actionTargetName": "fileToSurvey",
1577
- "actionTargetGUID": file_guid
1578
- }]
1579
- }
1641
+ body = {"class": "InitiateGovernanceActionTypeRequestBody",
1642
+ "governanceActionTypeQualifiedName": "Egeria:GovernanceActionType:AssetSurvey:survey-data-file",
1643
+ "actionTargets": [
1644
+ {"class": "NewActionTarget", "actionTargetName": "fileToSurvey", "actionTargetGUID": file_guid}]}
1580
1645
  response = await self._async_make_request("POST", url, body)
1581
1646
  return response.json().get("guid", "Action not initiated")
1582
1647
 
1583
- def initiate_file_survey(self, file_guid:str, server: str = None) -> str:
1648
+ def initiate_file_survey(self, file_guid: str, server: str = None) -> str:
1649
+ """ Initiate a file survey """
1584
1650
  loop = asyncio.get_event_loop()
1585
- response = loop.run_until_complete(
1586
- self._async_initiate_file_survey(file_guid, server)
1587
- )
1651
+ response = loop.run_until_complete(self._async_initiate_file_survey(file_guid, server))
1588
1652
  return response
1589
1653
 
1590
1654
  async def _async_initiate_kafka_server_survey(self, kafka_server_guid: str, server: str = None) -> str:
1655
+ """ Initiate survey of a kafka server. Async Version.
1656
+ Parameters
1657
+ ----------
1658
+ kafka_server_guid : str
1659
+ The GUID of the Kafka server to be surveyed.
1660
+
1661
+ server : str, optional
1662
+ The name of the server. If not provided, the default server name is used.
1663
+
1664
+ Returns
1665
+ -------
1666
+ str
1667
+ The GUID of the initiated action or "Action not initiated" if the action was not initiated.
1668
+
1669
+ """
1591
1670
  server = self.server_name if server is None else server
1592
1671
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
1593
1672
  f"initiate")
1594
1673
 
1595
- body = {
1596
- "class": "InitiateGovernanceActionTypeRequestBody",
1597
- "governanceActionTypeQualifiedName":
1598
- "Egeria:GovernanceActionType:2adeb8f1-0f59-4970-b6f2-6cc25d4d2402survey-kafka-server",
1599
- "actionTargets": [{
1600
- "class": "NewActionTarget",
1601
- "actionTargetName": "serverToSurvey",
1602
- "actionTargetGUID": kafka_server_guid
1603
- }]
1604
- }
1674
+ body = {"class": "InitiateGovernanceActionTypeRequestBody",
1675
+ "governanceActionTypeQualifiedName": "Egeria:GovernanceActionType:AssetSurvey:survey-kafka-server",
1676
+ "actionTargets": [{"class": "NewActionTarget", "actionTargetName": "serverToSurvey",
1677
+ "actionTargetGUID": kafka_server_guid}]}
1605
1678
  response = await self._async_make_request("POST", url, body)
1606
1679
  return response.json().get("guid", "Action not initiated")
1607
1680
 
1608
1681
  def initiate_kafka_server_survey(self, kafka_server_guid: str, server: str = None) -> str:
1682
+ """ Initiate survey of a kafka server.
1683
+ Parameters
1684
+ ----------
1685
+ kafka_server_guid : str
1686
+ The GUID of the Kafka server to be surveyed.
1687
+
1688
+ server : str, optional
1689
+ The name of the server. If not provided, the default server name is used.
1690
+
1691
+ Returns
1692
+ -------
1693
+ str
1694
+ The GUID of the initiated action or "Action not initiated" if the action was not initiated.
1695
+
1696
+ """
1609
1697
  loop = asyncio.get_event_loop()
1610
- response = loop.run_until_complete(
1611
- self._async_initiate_file_folder_survey(kafka_server_guid, server)
1612
- )
1698
+ response = loop.run_until_complete(self._async_initiate_file_folder_survey(kafka_server_guid, server))
1613
1699
  return response
1614
1700
 
1615
- async def run_gov_action_postgres_server_survey(self, postgres_server: str, host_name: str, port: str, ):
1616
- pass
1617
- # New combo process to do
1618
- # run a process the creates the postgres server catalog entry, runs the server survey
1619
- # creates a survey report
1620
- # adds a to-do list element when done
1621
-
1622
1701
  async def _async_initiate_engine_action(self, qualified_name: str, domain_identifier: int, display_name: str,
1623
1702
  description: str, request_source_guids: str, action_targets: str,
1624
- received_guards: [str], start_time: datetime, gov_engine_name: str,
1703
+ received_guards: [str], start_time: datetime,
1625
1704
  request_type: str, request_parameters: dict, process_name: str,
1626
1705
  request_src_name: str = None, originator_svc_name: str = None,
1627
1706
  originator_eng_name: str = None, server: str = None) -> str:
@@ -1639,7 +1718,6 @@ class AutomatedCuration(Client):
1639
1718
  action_targets (str): Targets of the governance action.
1640
1719
  received_guards (List[str]): List of guards received for the action.
1641
1720
  start_time (datetime): The start time for the governance action.
1642
- gov_engine_name (str): The name of the governance engine associated with the action.
1643
1721
  request_type (str): The type of the governance action request.
1644
1722
  request_parameters (dict): Additional parameters for the governance action.
1645
1723
  process_name (str): The name of the associated governance action process.
@@ -1658,39 +1736,31 @@ class AutomatedCuration(Client):
1658
1736
 
1659
1737
  Note
1660
1738
  ----
1661
- The `start_time` parameter should be a `datetime` object representing the start time of the governance action.
1739
+ The `start_time` parameter should be a `datetime` object representing the start time of the
1740
+ governance action.
1662
1741
 
1663
1742
 
1664
1743
  """
1665
1744
  server = self.server_name if server is None else server
1666
1745
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-engines/"
1667
1746
  f"engine-actions/initiate")
1668
- body = {
1669
- "class": "GovernanceActionRequestBody",
1670
- "qualifiedName": qualified_name + str(int(start_time.timestamp())),
1671
- "domainIdentifier": domain_identifier,
1672
- "displayName": display_name,
1673
- "description": description,
1674
- "requestSourceGUIDs": request_source_guids,
1675
- "actionTargets": action_targets,
1676
- "receivedGuards": received_guards,
1677
- "startTime": int(start_time.timestamp() * 1000),
1678
- "requestType": request_type,
1679
- "requestParameters": request_parameters,
1680
- "processName": process_name,
1681
- "requestSourceName": request_src_name,
1682
- "originatorServiceName": originator_svc_name,
1683
- "originatorEngineName": originator_eng_name
1684
- }
1747
+ body = {"class": "GovernanceActionRequestBody",
1748
+ "qualifiedName": qualified_name + str(int(start_time.timestamp())),
1749
+ "domainIdentifier": domain_identifier,
1750
+ "displayName": display_name, "description": description, "requestSourceGUIDs": request_source_guids,
1751
+ "actionTargets": action_targets, "receivedGuards": received_guards,
1752
+ "startTime": int(start_time.timestamp() * 1000), "requestType": request_type,
1753
+ "requestParameters": request_parameters, "processName": process_name,
1754
+ "requestSourceName": request_src_name,
1755
+ "originatorServiceName": originator_svc_name, "originatorEngineName": originator_eng_name}
1685
1756
  new_body = body_slimmer(body)
1686
1757
  response = await self._async_make_request("POST", url, new_body)
1687
1758
  return response.json().get("guid", "Action not initiated")
1688
1759
 
1689
- def initiate_engine_action(self, qualified_name: str, domain_identifier: int, display_name: str,
1690
- description: str, request_source_guids: str, action_targets: str,
1691
- received_guards: [str], start_time: datetime, gov_engine_name: str,
1692
- request_type: str, request_parameters: dict, process_name: str,
1693
- request_src_name: str = None, originator_svc_name: str = None,
1760
+ def initiate_engine_action(self, qualified_name: str, domain_identifier: int, display_name: str, description: str,
1761
+ request_source_guids: str, action_targets: str, received_guards: [str],
1762
+ start_time: datetime, request_type: str, request_parameters: dict,
1763
+ process_name: str, request_src_name: str = None, originator_svc_name: str = None,
1694
1764
  originator_eng_name: str = None, server: str = None) -> str:
1695
1765
  """ Create an engine action in the metadata store that will trigger the governance service associated with
1696
1766
  the supplied request type. The engine action remains to act as a record of the actions taken for auditing.
@@ -1724,21 +1794,19 @@ class AutomatedCuration(Client):
1724
1794
 
1725
1795
  Note
1726
1796
  ----
1727
- The `start_time` parameter should be a `datetime` object representing the start time of the governance action.
1797
+ The `start_time` parameter should be a `datetime` object representing the start time of the
1798
+ governance action.
1728
1799
  """
1729
1800
  loop = asyncio.get_event_loop()
1730
1801
  response = loop.run_until_complete(
1731
- self._async_initiate_engine_action(qualified_name, domain_identifier, display_name,
1732
- description, request_source_guids, action_targets,
1733
- received_guards, start_time, gov_engine_name,
1802
+ self._async_initiate_engine_action(qualified_name, domain_identifier, display_name, description,
1803
+ request_source_guids, action_targets, received_guards, start_time,
1734
1804
  request_type, request_parameters, process_name,
1735
- request_src_name, originator_svc_name,
1736
- originator_eng_name, server)
1737
- )
1805
+ request_src_name, originator_svc_name, originator_eng_name, server))
1738
1806
  return response
1739
1807
 
1740
- async def _async_get_catalog_targets(self, integ_connector_guid: str, server: str = None,
1741
- start_from: int = 0, page_size: int = max_paging_size) -> list | str:
1808
+ async def _async_get_catalog_targets(self, integ_connector_guid: str, server: str = None, start_from: int = 0,
1809
+ page_size: int = max_paging_size) -> list | str:
1742
1810
  """ Retrieve the details of the metadata elements identified as catalog targets with an integration connector.
1743
1811
  Async version.
1744
1812
 
@@ -1766,10 +1834,10 @@ class AutomatedCuration(Client):
1766
1834
  f"{integ_connector_guid}/catalog-targets?startFrom={start_from}&pageSize={page_size}")
1767
1835
 
1768
1836
  response = await self._async_make_request("GET", url)
1769
- return response.json().get("elements", "no actions")
1837
+ return response.json().get("elements", "no targets")
1770
1838
 
1771
- def get_catalog_targets(self, integ_connector_guid: str, server: str = None,
1772
- start_from: int = 0, page_size: int = max_paging_size) -> list | str:
1839
+ def get_catalog_targets(self, integ_connector_guid: str, server: str = None, start_from: int = 0,
1840
+ page_size: int = max_paging_size) -> list | str:
1773
1841
  """ Retrieve the details of the metadata elements identified as catalog targets with an integration connector.
1774
1842
 
1775
1843
  Parameters:
@@ -1792,22 +1860,17 @@ class AutomatedCuration(Client):
1792
1860
 
1793
1861
  loop = asyncio.get_event_loop()
1794
1862
  response = loop.run_until_complete(
1795
- self._async_get_catalog_targets(integ_connector_guid, server,
1796
- start_from, page_size)
1797
- )
1863
+ self._async_get_catalog_targets(integ_connector_guid, server, start_from, page_size))
1798
1864
  return response
1799
1865
 
1800
- async def _async_get_catalog_target(self, integ_connector_guid: str, metadata_element_guid: str,
1801
- server: str = None) -> dict | str:
1802
- """ Retrieve a specific catalog target associated with an integration connector.
1803
- Async version.
1866
+ async def _async_get_catalog_target(self, relationship_guid: str, server: str = None) -> dict | str:
1867
+ """ Retrieve a specific catalog target associated with an integration connector. Further Information:
1868
+ https://egeria-project.org/concepts/integration-connector/ . Async version.
1804
1869
 
1805
1870
  Parameters:
1806
1871
  ----------
1807
- integ_connector_guid: str
1808
- The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
1809
- metadata_element_guid: str
1810
- The specific metadata element target we want to retrieve.
1872
+ relationship_guid: str
1873
+ The GUID (Globally Unique Identifier) identifying the catalog targets for an integration connector.
1811
1874
  server: str, optional
1812
1875
  The name of the server. If None, will use the default server specified in the instance will be used.
1813
1876
  Returns:
@@ -1822,25 +1885,23 @@ class AutomatedCuration(Client):
1822
1885
  UserNotAuthorizedException:
1823
1886
  """
1824
1887
  server = self.server_name if server is None else server
1825
- validate_guid(integ_connector_guid)
1826
- validate_guid(metadata_element_guid)
1888
+ validate_guid(relationship_guid)
1827
1889
 
1828
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/integration-connectors/"
1829
- f"{integ_connector_guid}/catalog-targets/{metadata_element_guid}")
1890
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-targets/"
1891
+ f"{relationship_guid}")
1830
1892
 
1831
1893
  response = await self._async_make_request("GET", url)
1832
1894
  return response.json().get("element", "no actions")
1833
1895
 
1834
- def get_catalog_target(self, integ_connector_guid: str, metadata_element_guid: str,
1896
+ def get_catalog_target(self, relationship_guid: str,
1835
1897
  server: str = None) -> dict | str:
1836
- """ Retrieve a specific catalog target associated with an integration connector.
1898
+ """ Retrieve a specific catalog target associated with an integration connector. Further Information:
1899
+ https://egeria-project.org/concepts/integration-connector/ .
1837
1900
 
1838
1901
  Parameters:
1839
1902
  ----------
1840
- integ_connector_guid: str
1841
- The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
1842
- metadata_element_guid: str
1843
- The specific metadata element target we want to retrieve.
1903
+ relationship_guid: str
1904
+ The GUID (Globally Unique Identifier) identifying the catalog targets for an integration connector.
1844
1905
  server: str, optional
1845
1906
  The name of the server. If None, will use the default server specified in the instance will be used.
1846
1907
  Returns:
@@ -1857,15 +1918,13 @@ class AutomatedCuration(Client):
1857
1918
 
1858
1919
  loop = asyncio.get_event_loop()
1859
1920
  response = loop.run_until_complete(
1860
- self._async_get_catalog_target(integ_connector_guid, metadata_element_guid,
1861
- server)
1862
- )
1921
+ self._async_get_catalog_target(relationship_guid, server))
1863
1922
  return response
1864
1923
 
1865
1924
  async def _async_add_catalog_target(self, integ_connector_guid: str, metadata_element_guid: str,
1866
- catalog_target_name: str, metadata_src_qual_name: str = None, config_properties: dict = None
1867
- , server: str = None) -> None:
1868
- """ Add a catalog target to an integration connector.
1925
+ catalog_target_name: str, metadata_src_qual_name: str = None,
1926
+ config_properties: dict = None, server: str = None) -> str:
1927
+ """ Add a catalog target to an integration connector and .
1869
1928
  Async version.
1870
1929
 
1871
1930
  Parameters:
@@ -1884,7 +1943,7 @@ class AutomatedCuration(Client):
1884
1943
  The name of the server. If None, will use the default server specified in the instance will be used.
1885
1944
  Returns:
1886
1945
  -------
1887
- None
1946
+ Relationship GUID for the catalog target,
1888
1947
 
1889
1948
  Raises:
1890
1949
  ------
@@ -1899,16 +1958,14 @@ class AutomatedCuration(Client):
1899
1958
 
1900
1959
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/integration-connectors/"
1901
1960
  f"{integ_connector_guid}/catalog-targets/{metadata_element_guid}")
1902
- body = {
1903
- "catalogTargetName": catalog_target_name,
1904
- "metadataSourceQualifiedName": metadata_src_qual_name,
1905
- "configProperties": config_properties
1906
- }
1907
- await self._async_make_request("POST", url, body)
1908
- return
1961
+ body = {"catalogTargetName": catalog_target_name, "metadataSourceQualifiedName": metadata_src_qual_name,
1962
+ "configProperties": config_properties}
1963
+ response = await self._async_make_request("POST", url, body)
1964
+ return response.json().get('guid', "No Guid returned")
1909
1965
 
1910
1966
  def add_catalog_target(self, integ_connector_guid: str, metadata_element_guid: str, catalog_target_name: str,
1911
- metadata_src_qual_name: str = None, config_properties: dict = None, server: str = None) -> None:
1967
+ metadata_src_qual_name: str = None, config_properties: dict = None,
1968
+ server: str = None) -> str:
1912
1969
  """ Add a catalog target to an integration connector.
1913
1970
 
1914
1971
  Parameters:
@@ -1937,23 +1994,92 @@ class AutomatedCuration(Client):
1937
1994
  UserNotAuthorizedException:
1938
1995
  """
1939
1996
  loop = asyncio.get_event_loop()
1997
+ response = loop.run_until_complete(
1998
+ self._async_add_catalog_target(integ_connector_guid, metadata_element_guid, catalog_target_name,
1999
+ metadata_src_qual_name, config_properties, server))
2000
+ return response
2001
+
2002
+ async def _async_update_catalog_target(self, relationship_guid: str,
2003
+ catalog_target_name: str, metadata_src_qual_name: str = None,
2004
+ config_properties: dict = None, server: str = None) -> None:
2005
+ """ Update a catalog target to an integration connector.
2006
+ Async version.
2007
+
2008
+ Parameters:
2009
+ ----------
2010
+ relationship_guid: str
2011
+ The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
2012
+
2013
+ catalog_target_name : dict
2014
+ Name of the catalog target to add.
2015
+ metadata_src_qual_name: str
2016
+ The qualified name of the metadata source for the catalog target
2017
+ config_properties: dict
2018
+ Configuration properties for the catalog target
2019
+ server: str, optional
2020
+ The name of the server. If None, will use the default server specified in the instance will be used.
2021
+ Returns:
2022
+ -------
2023
+ None
2024
+
2025
+ Raises:
2026
+ ------
2027
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
2028
+ this exception is raised with details from the response content.
2029
+ PropertyServerException: If the API response indicates a server side error.
2030
+ UserNotAuthorizedException:
2031
+ """
2032
+ server = self.server_name if server is None else server
2033
+ validate_guid(relationship_guid)
2034
+
2035
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-targets/"
2036
+ f"{relationship_guid}/update")
2037
+ body = {"catalogTargetName": catalog_target_name, "metadataSourceQualifiedName": metadata_src_qual_name,
2038
+ "configProperties": config_properties}
2039
+ response = await self._async_make_request("POST", url, body)
2040
+ return
2041
+
2042
+ def update_catalog_target(self, relationship_guid: str, catalog_target_name: str,
2043
+ metadata_src_qual_name: str = None, config_properties: dict = None,
2044
+ server: str = None) -> None:
2045
+ """ Add a catalog target to an integration connector.
2046
+
2047
+ Parameters:
2048
+ ----------
2049
+ relationship_guid: str
2050
+ The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
2051
+ catalog_target_name : dict
2052
+ Name of the catalog target to add.
2053
+ metadata_src_qual_name: str
2054
+ The qualified name of the metadata source for the catalog target
2055
+ config_properties: dict
2056
+ Configuration properties for the catalog target
2057
+ server: str, optional
2058
+ The name of the server. If None, will use the default server specified in the instance will be used.
2059
+ Returns:
2060
+ -------
2061
+ None
2062
+
2063
+ Raises:
2064
+ ------
2065
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
2066
+ this exception is raised with details from the response content.
2067
+ PropertyServerException: If the API response indicates a server side error.
2068
+ UserNotAuthorizedException:
2069
+ """
2070
+ loop = asyncio.get_event_loop()
1940
2071
  loop.run_until_complete(
1941
- self._async_add_catalog_target(integ_connector_guid, metadata_element_guid,
1942
- metadata_src_qual_name, metadata_src_qual_name,
1943
- config_properties, server)
1944
- )
2072
+ self._async_update_catalog_target(relationship_guid, catalog_target_name,
2073
+ metadata_src_qual_name, config_properties, server))
1945
2074
  return
1946
2075
 
1947
- async def _async_remove_catalog_target(self, integ_connector_guid: str, metadata_element_guid: str,
1948
- server: str = None) -> None:
2076
+ async def _async_remove_catalog_target(self, relationship_guid: str, server: str = None) -> None:
1949
2077
  """ Remove a catalog target to an integration connector. Async version.
1950
2078
 
1951
2079
  Parameters:
1952
2080
  ----------
1953
- integ_connector_guid: str
1954
- The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
1955
- metadata_element_guid: str
1956
- The specific metadata element target we want to retrieve.
2081
+ relationship_guid: str
2082
+ The GUID (Globally Unique Identifier) identifying the catalog target relationship.
1957
2083
  server: str, optional
1958
2084
  The name of the server. If None, will use the default server specified in the instance will be used.
1959
2085
  Returns:
@@ -1968,25 +2094,21 @@ class AutomatedCuration(Client):
1968
2094
  UserNotAuthorizedException:
1969
2095
  """
1970
2096
  server = self.server_name if server is None else server
1971
- validate_guid(integ_connector_guid)
1972
- validate_guid(metadata_element_guid)
2097
+ validate_guid(relationship_guid)
1973
2098
 
1974
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/integration-connectors/"
1975
- f"{integ_connector_guid}/catalog-targets/{metadata_element_guid}/remove")
2099
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-targets/"
2100
+ f"{relationship_guid}/remove")
1976
2101
 
1977
2102
  await self._async_make_request("POST", url)
1978
2103
  return
1979
2104
 
1980
- def remove_catalog_target(self, integ_connector_guid: str, metadata_element_guid: str,
1981
- server: str = None) -> None:
2105
+ def remove_catalog_target(self, relationship_guid: str, server: str = None) -> None:
1982
2106
  """ Remove a catalog target to an integration connector.
1983
2107
 
1984
2108
  Parameters:
1985
2109
  ----------
1986
- integ_connector_guid: str
1987
- The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
1988
- metadata_element_guid: str
1989
- The specific metadata element target we want to retrieve.
2110
+ relationship_guid: str
2111
+ The GUID (Globally Unique Identifier) identifying the catalog target relationship.
1990
2112
  server: str, optional
1991
2113
  The name of the server. If None, will use the default server specified in the instance will be used.
1992
2114
  Returns:
@@ -2002,10 +2124,7 @@ class AutomatedCuration(Client):
2002
2124
  """
2003
2125
 
2004
2126
  loop = asyncio.get_event_loop()
2005
- loop.run_until_complete(
2006
- self._async_remove_catalog_target(integ_connector_guid, metadata_element_guid,
2007
- server)
2008
- )
2127
+ loop.run_until_complete(self._async_remove_catalog_target(relationship_guid, server))
2009
2128
  return
2010
2129
 
2011
2130
  #
@@ -2045,9 +2164,7 @@ class AutomatedCuration(Client):
2045
2164
  # validate_name(type_name)
2046
2165
  url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/open-metadata-types/"
2047
2166
  f"{type_name}/technology-types?startFrom={start_from}&pageSize={page_size}")
2048
- body = {
2049
- "filter": tech_name
2050
- }
2167
+ body = {"filter": tech_name}
2051
2168
 
2052
2169
  response = await self._async_make_request("GET", url, body)
2053
2170
  return response.json().get("elements", "no tech found")
@@ -2082,9 +2199,7 @@ class AutomatedCuration(Client):
2082
2199
  """
2083
2200
  loop = asyncio.get_event_loop()
2084
2201
  response = loop.run_until_complete(
2085
- self._async_get_tech_types_for_open_metadata_type(type_name, tech_name, server,
2086
- start_from, page_size)
2087
- )
2202
+ self._async_get_tech_types_for_open_metadata_type(type_name, tech_name, server, start_from, page_size))
2088
2203
  return response
2089
2204
 
2090
2205
  async def _async_get_technology_type_detail(self, type_name: str, server: str = None) -> list | str:
@@ -2095,7 +2210,8 @@ class AutomatedCuration(Client):
2095
2210
  type_name : str
2096
2211
  The name of the technology type to retrieve detailed information for.
2097
2212
  server : str, optional
2098
- The name of the server to fetch the technology type from. If not provided, the default server name will be used.
2213
+ The name of the server to fetch the technology type from. If not provided, the default server name will
2214
+ be used.
2099
2215
 
2100
2216
  Returns
2101
2217
  -------
@@ -2114,7 +2230,7 @@ class AutomatedCuration(Client):
2114
2230
  More information can be found at: https://egeria-project.org/concepts/deployed-implementation-type
2115
2231
  """
2116
2232
  server = self.server_name if server is None else server
2117
- validate_name(type_name)
2233
+ # validate_name(type_name)
2118
2234
  url = f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/technology-types/by-name"
2119
2235
 
2120
2236
  body = {"filter": type_name}
@@ -2130,7 +2246,8 @@ class AutomatedCuration(Client):
2130
2246
  type_name : str
2131
2247
  The name of the technology type to retrieve detailed information for.
2132
2248
  server : str, optional
2133
- The name of the server to fetch the technology type from. If not provided, the default server name will be used.
2249
+ The name of the server to fetch the technology type from. If not provided, the default server name will
2250
+ be used.
2134
2251
 
2135
2252
  Returns
2136
2253
  -------
@@ -2150,9 +2267,7 @@ class AutomatedCuration(Client):
2150
2267
  """
2151
2268
 
2152
2269
  loop = asyncio.get_event_loop()
2153
- response = loop.run_until_complete(
2154
- self._async_get_technology_type_detail(type_name, server)
2155
- )
2270
+ response = loop.run_until_complete(self._async_get_technology_type_detail(type_name, server))
2156
2271
  return response
2157
2272
 
2158
2273
  async def _async_find_technology_types(self, search_string: str = "*", server: str = None, start_from: int = 0,
@@ -2214,8 +2329,8 @@ class AutomatedCuration(Client):
2214
2329
  return response.json().get("elements", "no tech found")
2215
2330
 
2216
2331
  def find_technology_types(self, search_string: str = "*", server: str = None, start_from: int = 0,
2217
- page_size: int = max_paging_size, starts_with: bool = False,
2218
- ends_with: bool = False, ignore_case: bool = True) -> list | str:
2332
+ page_size: int = max_paging_size, starts_with: bool = False, ends_with: bool = False,
2333
+ ignore_case: bool = True) -> list | str:
2219
2334
  """ Retrieve the list of technology types that contain the search string. Async version.
2220
2335
 
2221
2336
  Parameters:
@@ -2242,22 +2357,175 @@ class AutomatedCuration(Client):
2242
2357
 
2243
2358
  loop = asyncio.get_event_loop()
2244
2359
  response = loop.run_until_complete(
2245
- self._async_find_technology_types(search_string, server, start_from,
2246
- page_size, starts_with, ends_with, ignore_case)
2247
- )
2360
+ self._async_find_technology_types(search_string, server, start_from, page_size, starts_with, ends_with,
2361
+ ignore_case))
2248
2362
  return response
2249
2363
 
2250
2364
  async def _async_get_all_technology_types(self, server: str = None, start_from: int = 0,
2251
2365
  page_size: int = max_paging_size) -> list | str:
2366
+ """Get all technology types - async version"""
2252
2367
  return await self._async_find_technology_types("*", server, start_from, page_size)
2253
2368
 
2254
2369
  def get_all_technology_types(self, server: str = None, start_from: int = 0,
2255
2370
  page_size: int = max_paging_size) -> list | str:
2371
+ """Get all technology types"""
2256
2372
  return self.find_technology_types("*", server, start_from, page_size)
2257
2373
 
2374
+ def print_engine_action_summary(self, governance_action: dict):
2375
+ """ print_governance_action_summary
2376
+
2377
+ Print all the governance actions with their status, in the server.
2378
+
2379
+ Parameters
2380
+ ----------
2381
+
2382
+ Returns
2383
+ -------
2384
+
2385
+ Raises
2386
+ ------
2387
+ InvalidParameterException
2388
+ PropertyServerException
2389
+ UserNotAuthorizedException
2390
+ """
2391
+ if governance_action:
2392
+ name = governance_action.get('displayName')
2393
+ if not name:
2394
+ name = governance_action.get('qualifiedName')
2395
+ action_status = governance_action.get('action_status')
2396
+ if governance_action.get('completion_guards'):
2397
+ completion_guards = governance_action.get('completion_guards')
2398
+ else:
2399
+ completion_guards = "\t"
2400
+ if governance_action.get('process_name'):
2401
+ process_name = governance_action.get('process_name')
2402
+ else:
2403
+ process_name = "\t"
2404
+ if governance_action.get('completion_message'):
2405
+ completion_message = governance_action.get('completion_message')
2406
+ else:
2407
+ completion_message = ""
2408
+ print(action_status + "\n\t| " + name + "\t| " + process_name + "\t| " + '%s' % ', '.join(
2409
+ map(str, completion_guards)) + "\t| " + completion_message)
2410
+
2411
+ def print_engine_actions(self):
2412
+ """ print_governance_actions
2413
+
2414
+ Print all the governance actions with their status, in the server.
2415
+
2416
+ Parameters
2417
+ ----------
2418
+
2419
+ Returns
2420
+ -------
2421
+
2422
+ Raises
2423
+ ------
2424
+ InvalidParameterException
2425
+ PropertyServerException
2426
+ UserNotAuthorizedException
2427
+
2428
+ """
2429
+ governance_actions = self.get_engine_actions()
2430
+ if governance_actions is not None:
2431
+ for x in range(len(governance_actions)):
2432
+ self.print_engine_action_summary(governance_actions[x])
2433
+
2434
+ async def _async_get_technology_type_elements(self, filter: str, effective_time: str = None, server: str = None,
2435
+ start_from: int = 0, page_size: int = max_paging_size,
2436
+ get_templates: bool = False) -> list | str:
2437
+ """ Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed
2438
+ in the name. Async version.
2439
+
2440
+ Parameters:
2441
+ ----------
2442
+ filter: str
2443
+ The name of the deployed technology implementation type to retrieve elements for.
2444
+ server: str, optional
2445
+ The name of the server. If None, will use the default server specified in the instance will be used.
2446
+
2447
+ effective_time: datetime, [default=None], optional
2448
+ Effective time of the query. If not specified will default to any effective time. Time format is
2449
+ "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
2450
+
2451
+ start_from : int, optional
2452
+ The index from which to start fetching the engine actions. Default is 0.
2453
+
2454
+ page_size : int, optional
2455
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
2456
+
2457
+ Returns:
2458
+ -------
2459
+ [dict] | str: List of elements describing the technology - or "no tech found" if not found.
2460
+
2461
+ Raises:
2462
+ ------
2463
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
2464
+ this exception is raised with details from the response content.
2465
+ PropertyServerException: If the API response indicates a server side error.
2466
+ UserNotAuthorizedException:
2467
+
2468
+ Notes
2469
+ -----
2470
+ For more information see: https://egeria-project.org/concepts/deployed-implementation-type
2471
+ """
2472
+ server = self.server_name if server is None else server
2473
+
2474
+ get_templates_s = str(get_templates).lower()
2475
+ validate_name(filter)
2476
+
2477
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/technology-types/elements?"
2478
+ f"startFrom={start_from}&pageSize={page_size}&getTemplates={get_templates_s}"
2479
+ )
2480
+ body = {"filter": filter,
2481
+ "effective_time": effective_time
2482
+ }
2483
+
2484
+ response = await self._async_make_request("POST", url, body)
2485
+ return response.json().get("elements", "no tech found")
2486
+
2487
+ def get_technology_type_elements(self, filter: str, effective_time: str = None, server: str = None,
2488
+ start_from: int = 0, page_size: int = max_paging_size,
2489
+ get_templates: bool = False) -> list | str:
2490
+ """ Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed
2491
+ in the name.
2492
+
2493
+ Parameters:
2494
+ ----------
2495
+ filter: str
2496
+ The name of the deployed technology implementation type to retrieve elements for.
2497
+ server: str, optional
2498
+ The name of the server. If None, will use the default server specified in the instance will be used.
2499
+
2500
+ effective_time: datetime, [default=None], optional
2501
+ Effective time of the query. If not specified will default to any effective time. Time format is
2502
+ "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
2503
+
2504
+ start_from : int, optional
2505
+ The index from which to start fetching the engine actions. Default is 0.
2506
+
2507
+ page_size : int, optional
2508
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
2509
+
2510
+ Returns:
2511
+ -------
2512
+ [dict] | str: List of elements describing the technology - or "no tech found" if not found.
2513
+
2514
+ Raises:
2515
+ ------
2516
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
2517
+ this exception is raised with details from the response content.
2518
+ PropertyServerException: If the API response indicates a server side error.
2519
+ UserNotAuthorizedException:
2258
2520
 
2259
- if __name__ == "__main__":
2260
- p = AutomatedCuration("meow", "https://127.0.0.1:9443", "garygeeke", verify_flag=False)
2261
- response = p.get_active_engine_actions()
2262
- out = response.json()
2263
- print(out)
2521
+ Notes
2522
+ -----
2523
+ For more information see: https://egeria-project.org/concepts/deployed-implementation-type
2524
+ """
2525
+
2526
+ loop = asyncio.get_event_loop()
2527
+ response = loop.run_until_complete(
2528
+ self._async_get_technology_type_elements(filter, effective_time, server,
2529
+ start_from, page_size, get_templates
2530
+ ))
2531
+ return response