pyegeria 0.7.31__py3-none-any.whl → 0.7.34__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.
@@ -11,12 +11,16 @@ from datetime import datetime
11
11
  from httpx import Response
12
12
 
13
13
  from pyegeria import Client, max_paging_size, body_slimmer, TEMPLATE_GUIDS
14
- from pyegeria._exceptions import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException)
14
+ from pyegeria._exceptions import (
15
+ InvalidParameterException,
16
+ PropertyServerException,
17
+ UserNotAuthorizedException,
18
+ )
15
19
  from ._validators import validate_name, validate_guid, validate_search_string
16
20
 
17
21
 
18
22
  class AutomatedCuration(Client):
19
- """ Set up and maintain automation services in Egeria.
23
+ """Set up and maintain automation services in Egeria.
20
24
 
21
25
  Attributes:
22
26
  server_name : str
@@ -32,56 +36,64 @@ class AutomatedCuration(Client):
32
36
 
33
37
  """
34
38
 
35
- def __init__(self, server_name: str, platform_url: str, user_id: str, user_pwd: str = None,
36
- verify_flag: bool = False, ):
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
+ ):
37
47
  Client.__init__(self, server_name, platform_url, user_id, user_pwd, verify_flag)
38
48
  self.cur_command_root = f"{platform_url}/servers/"
39
49
 
40
- async def _async_create_element_from_template(self, body: dict, server: str = None) -> str:
41
- """ Create a new metadata element from a template. Async version.
42
- Parameters
43
- ----------
44
- body : str
45
- The json body used to instantiate the template.
46
- server : str, optional
47
- The name of the view server to use. If not provided, the default server name will be used.
48
-
49
- Returns
50
- -------
51
- Response
52
- The guid of the resulting element
53
-
54
- Raises
55
- ------
56
- InvalidParameterException
57
- PropertyServerException
58
- UserNotAuthorizedException
59
-
60
- Notes
61
- -----
62
- See also: https://egeria-project.org/features/templated-cataloguing/overview/
63
- The full description of the body is shown below:
64
- {
65
- "typeName" : "",
66
- "initialStatus" : "",
67
- "initialClassifications" : "",
68
- "anchorGUID" : "",
69
- "isOwnAnchor" : "",
70
- "effectiveFrom" : "",
71
- "effectiveTo" : "",
72
- "templateGUID" : "",
73
- "templateProperties" : {},
74
- "placeholderPropertyValues" : {
75
- "placeholderPropertyName1" : "placeholderPropertyValue1",
76
- "placeholderPropertyName2" : "placeholderPropertyValue2"
77
- },
78
- "parentGUID" : "",
79
- "parentRelationshipTypeName" : "",
80
- "parentRelationshipProperties" : "",
81
- "parentAtEnd1" : "",
82
- "effectiveTime" : ""
83
- }
84
- """
50
+ async def _async_create_element_from_template(
51
+ self, body: dict, server: str = None
52
+ ) -> str:
53
+ """Create a new metadata element from a template. Async version.
54
+ Parameters
55
+ ----------
56
+ body : str
57
+ The json body used to instantiate the template.
58
+ server : str, optional
59
+ The name of the view server to use. If not provided, the default server name will be used.
60
+
61
+ Returns
62
+ -------
63
+ Response
64
+ The guid of the resulting element
65
+
66
+ Raises
67
+ ------
68
+ InvalidParameterException
69
+ PropertyServerException
70
+ UserNotAuthorizedException
71
+
72
+ Notes
73
+ -----
74
+ See also: https://egeria-project.org/features/templated-cataloguing/overview/
75
+ The full description of the body is shown below:
76
+ {
77
+ "typeName" : "",
78
+ "initialStatus" : "",
79
+ "initialClassifications" : "",
80
+ "anchorGUID" : "",
81
+ "isOwnAnchor" : "",
82
+ "effectiveFrom" : "",
83
+ "effectiveTo" : "",
84
+ "templateGUID" : "",
85
+ "templateProperties" : {},
86
+ "placeholderPropertyValues" : {
87
+ "placeholderPropertyName1" : "placeholderPropertyValue1",
88
+ "placeholderPropertyName2" : "placeholderPropertyValue2"
89
+ },
90
+ "parentGUID" : "",
91
+ "parentRelationshipTypeName" : "",
92
+ "parentRelationshipProperties" : "",
93
+ "parentAtEnd1" : "",
94
+ "effectiveTime" : ""
95
+ }
96
+ """
85
97
 
86
98
  server = self.server_name if server is None else server
87
99
 
@@ -90,279 +102,355 @@ class AutomatedCuration(Client):
90
102
  return response.json().get("guid", "GUID failed to be returned")
91
103
 
92
104
  def create_element_from_template(self, body: dict, server: str = None) -> str:
93
- """ Create a new metadata element from a template. Async version.
94
- Parameters
95
- ----------
96
- body : str
97
- The json body used to instantiate the template.
98
- server : str, optional
99
- The name of the view server to use. If not provided, the default server name will be used.
100
-
101
- Returns
102
- -------
103
- Response
104
- The guid of the resulting element
105
-
106
- Raises
107
- ------
108
- InvalidParameterException
109
- PropertyServerException
110
- UserNotAuthorizedException
111
-
112
- Notes
113
- -----
114
- See also: https://egeria-project.org/features/templated-cataloguing/overview/
115
- The full description of the body is shown below:
116
- {
117
- "typeName" : "",
118
- "initialStatus" : "",
119
- "initialClassifications" : "",
120
- "anchorGUID" : "",
121
- "isOwnAnchor" : "",
122
- "effectiveFrom" : "",
123
- "effectiveTo" : "",
124
- "templateGUID" : "",
125
- "templateProperties" : {},
126
- "placeholderPropertyValues" : {
127
- "placeholderPropertyName1" : "placeholderPropertyValue1",
128
- "placeholderPropertyName2" : "placeholderPropertyValue2"
129
- },
130
- "parentGUID" : "",
131
- "parentRelationshipTypeName" : "",
132
- "parentRelationshipProperties" : "",
133
- "parentAtEnd1" : "",
134
- "effectiveTime" : ""
135
- }
105
+ """Create a new metadata element from a template. Async version.
106
+ Parameters
107
+ ----------
108
+ body : str
109
+ The json body used to instantiate the template.
110
+ server : str, optional
111
+ The name of the view server to use. If not provided, the default server name will be used.
112
+
113
+ Returns
114
+ -------
115
+ Response
116
+ The guid of the resulting element
117
+
118
+ Raises
119
+ ------
120
+ InvalidParameterException
121
+ PropertyServerException
122
+ UserNotAuthorizedException
123
+
124
+ Notes
125
+ -----
126
+ See also: https://egeria-project.org/features/templated-cataloguing/overview/
127
+ The full description of the body is shown below:
128
+ {
129
+ "typeName" : "",
130
+ "initialStatus" : "",
131
+ "initialClassifications" : "",
132
+ "anchorGUID" : "",
133
+ "isOwnAnchor" : "",
134
+ "effectiveFrom" : "",
135
+ "effectiveTo" : "",
136
+ "templateGUID" : "",
137
+ "templateProperties" : {},
138
+ "placeholderPropertyValues" : {
139
+ "placeholderPropertyName1" : "placeholderPropertyValue1",
140
+ "placeholderPropertyName2" : "placeholderPropertyValue2"
141
+ },
142
+ "parentGUID" : "",
143
+ "parentRelationshipTypeName" : "",
144
+ "parentRelationshipProperties" : "",
145
+ "parentAtEnd1" : "",
146
+ "effectiveTime" : ""
147
+ }
136
148
  """
137
149
  loop = asyncio.get_event_loop()
138
- response = loop.run_until_complete(self._async_create_element_from_template(body, server))
150
+ response = loop.run_until_complete(
151
+ self._async_create_element_from_template(body, server)
152
+ )
139
153
  return response
140
154
 
141
- async def _async_create_kafka_server_element_from_template(self, kafka_server: str, host_name: str, port: str,
142
- description: str = None, server: str = None) -> str:
143
- """ Create a Kafka server element from a template. Async version.
155
+ async def _async_create_kafka_server_element_from_template(
156
+ self,
157
+ kafka_server: str,
158
+ host_name: str,
159
+ port: str,
160
+ description: str = None,
161
+ server: str = None,
162
+ ) -> str:
163
+ """Create a Kafka server element from a template. Async version.
144
164
 
145
- Parameters
146
- ----------
147
- kafka_server : str
148
- The name of the Kafka server.
165
+ Parameters
166
+ ----------
167
+ kafka_server : str
168
+ The name of the Kafka server.
149
169
 
150
- host_name : str
151
- The host name of the Kafka server.
170
+ host_name : str
171
+ The host name of the Kafka server.
152
172
 
153
- port : str
154
- The port number of the Kafka server.
173
+ port : str
174
+ The port number of the Kafka server.
155
175
 
156
- description: str, opt
157
- A description of the Kafka server.
176
+ description: str, opt
177
+ A description of the Kafka server.
158
178
 
159
- server : str, optional
160
- The name of the view server to use. Default uses the client instance.
179
+ server : str, optional
180
+ The name of the view server to use. Default uses the client instance.
161
181
 
162
- Returns
163
- -------
164
- str
165
- The GUID of the Kafka server element.
182
+ Returns
183
+ -------
184
+ str
185
+ The GUID of the Kafka server element.
166
186
  """
167
187
 
168
- body = {"templateGUID": TEMPLATE_GUIDS['Apache Kafka Server'], "isOwnAnchor": 'true',
169
- "placeholderPropertyValues": {"serverName": kafka_server, "hostIdentifier": host_name,
170
- "portNumber": port, "description": description}}
188
+ body = {
189
+ "templateGUID": TEMPLATE_GUIDS["Apache Kafka Server"],
190
+ "isOwnAnchor": "true",
191
+ "placeholderPropertyValues": {
192
+ "serverName": kafka_server,
193
+ "hostIdentifier": host_name,
194
+ "portNumber": port,
195
+ "description": description,
196
+ },
197
+ }
171
198
  body_s = body_slimmer(body)
172
199
  response = await self._async_create_element_from_template(body_s, server)
173
200
  return str(response)
174
201
 
175
- def create_kafka_server_element_from_template(self, kafka_server: str, host_name: str, port: str,
176
- description: str = None, server: str = None) -> str:
177
- """ Create a Kafka server element from a template.
202
+ def create_kafka_server_element_from_template(
203
+ self,
204
+ kafka_server: str,
205
+ host_name: str,
206
+ port: str,
207
+ description: str = None,
208
+ server: str = None,
209
+ ) -> str:
210
+ """Create a Kafka server element from a template.
178
211
 
179
- Parameters
180
- ----------
181
- kafka_server : str
182
- The name of the Kafka server.
212
+ Parameters
213
+ ----------
214
+ kafka_server : str
215
+ The name of the Kafka server.
183
216
 
184
- host_name : str
185
- The host name of the Kafka server.
217
+ host_name : str
218
+ The host name of the Kafka server.
186
219
 
187
- port : str
188
- The port number of the Kafka server.
220
+ port : str
221
+ The port number of the Kafka server.
189
222
 
190
- description: str, opt
191
- A description of the Kafka server.
223
+ description: str, opt
224
+ A description of the Kafka server.
192
225
 
193
- server : str, optional
194
- The name of the view server to use. Default uses the client instance.
226
+ server : str, optional
227
+ The name of the view server to use. Default uses the client instance.
195
228
 
196
- Returns
197
- -------
198
- str
199
- The GUID of the Kafka server element.
200
- """
229
+ Returns
230
+ -------
231
+ str
232
+ The GUID of the Kafka server element.
233
+ """
201
234
  loop = asyncio.get_event_loop()
202
235
  response = loop.run_until_complete(
203
- self._async_create_kafka_server_element_from_template(kafka_server, host_name, port, description, server))
236
+ self._async_create_kafka_server_element_from_template(
237
+ kafka_server, host_name, port, description, server
238
+ )
239
+ )
204
240
  return response
205
241
 
206
- async def _async_create_postgres_server_element_from_template(self, postgres_server: str, host_name: str, port: str,
207
- db_user: str, db_pwd: str, description: str = None,
208
- server: str = None) -> str:
209
- """ Create a Postgres server element from a template. Async version.
242
+ async def _async_create_postgres_server_element_from_template(
243
+ self,
244
+ postgres_server: str,
245
+ host_name: str,
246
+ port: str,
247
+ db_user: str,
248
+ db_pwd: str,
249
+ description: str = None,
250
+ server: str = None,
251
+ ) -> str:
252
+ """Create a Postgres server element from a template. Async version.
210
253
 
211
- Parameters
212
- ----------
213
- postgres_server : str
214
- The name of the Postgres server.
254
+ Parameters
255
+ ----------
256
+ postgres_server : str
257
+ The name of the Postgres server.
215
258
 
216
- host_name : str
217
- The host name of the Postgres server.
259
+ host_name : str
260
+ The host name of the Postgres server.
218
261
 
219
- port : str
220
- The port number of the Postgres server.
262
+ port : str
263
+ The port number of the Postgres server.
221
264
 
222
- db_user: str
223
- User name to connect to the database
265
+ db_user: str
266
+ User name to connect to the database
224
267
 
225
- db_pwd: str
226
- User password to connect to the database
268
+ db_pwd: str
269
+ User password to connect to the database
227
270
 
228
- description: str, opt
229
- A description of the element.
271
+ description: str, opt
272
+ A description of the element.
230
273
 
231
- server : str, optional
232
- The name of the view server to use. Default uses the client instance.
274
+ server : str, optional
275
+ The name of the view server to use. Default uses the client instance.
233
276
 
234
- Returns
235
- -------
236
- str
237
- The GUID of the Postgres server element.
277
+ Returns
278
+ -------
279
+ str
280
+ The GUID of the Postgres server element.
238
281
  """
239
- body = {"templateGUID": TEMPLATE_GUIDS['PostgreSQL Server'], "isOwnAnchor": 'true',
240
- "placeholderPropertyValues": {"serverName": postgres_server, "hostIdentifier": host_name,
241
- "portNumber": port, "databaseUserId": db_user, "description": description,
242
- "databasePassword": db_pwd}}
282
+ body = {
283
+ "templateGUID": TEMPLATE_GUIDS["PostgreSQL Server"],
284
+ "isOwnAnchor": "true",
285
+ "placeholderPropertyValues": {
286
+ "serverName": postgres_server,
287
+ "hostIdentifier": host_name,
288
+ "portNumber": port,
289
+ "databaseUserId": db_user,
290
+ "description": description,
291
+ "databasePassword": db_pwd,
292
+ },
293
+ }
243
294
  body_s = body_slimmer(body)
244
295
  response = await self._async_create_element_from_template(body_s, server)
245
296
  return str(response)
246
297
 
247
- def create_postgres_server_element_from_template(self, postgres_server: str, host_name: str, port: str,
248
- db_user: str, db_pwd: str, description: str = None,
249
- server: str = None) -> str:
250
- """ Create a Postgres server element from a template.
298
+ def create_postgres_server_element_from_template(
299
+ self,
300
+ postgres_server: str,
301
+ host_name: str,
302
+ port: str,
303
+ db_user: str,
304
+ db_pwd: str,
305
+ description: str = None,
306
+ server: str = None,
307
+ ) -> str:
308
+ """Create a Postgres server element from a template.
251
309
 
252
- Parameters
253
- ----------
254
- postgres_server : str
255
- The name of the Postgres server.
310
+ Parameters
311
+ ----------
312
+ postgres_server : str
313
+ The name of the Postgres server.
256
314
 
257
- host_name : str
258
- The host name of the Postgres server.
315
+ host_name : str
316
+ The host name of the Postgres server.
259
317
 
260
- port : str
261
- The port number of the Postgres server.
318
+ port : str
319
+ The port number of the Postgres server.
262
320
 
263
- server : str, optional
264
- The name of the view server to use. Default uses the client instance.
321
+ server : str, optional
322
+ The name of the view server to use. Default uses the client instance.
265
323
 
266
- description: str, opt
267
- A description of the elementr.
324
+ description: str, opt
325
+ A description of the elementr.
268
326
 
269
- db_user: str
270
- User name to connect to the database
327
+ db_user: str
328
+ User name to connect to the database
271
329
 
272
- db_pwd: str
273
- User password to connect to the database
330
+ db_pwd: str
331
+ User password to connect to the database
274
332
 
275
- Returns
276
- -------
277
- str
278
- The GUID of the Postgres server element.
279
- """
333
+ Returns
334
+ -------
335
+ str
336
+ The GUID of the Postgres server element.
337
+ """
280
338
  loop = asyncio.get_event_loop()
281
339
  response = loop.run_until_complete(
282
- self._async_create_postgres_server_element_from_template(postgres_server, host_name, port, db_user, db_pwd,
283
- description, server))
340
+ self._async_create_postgres_server_element_from_template(
341
+ postgres_server, host_name, port, db_user, db_pwd, description, server
342
+ )
343
+ )
284
344
  return response
285
345
 
286
- async def _async_create_folder_element_from_template(self, path_name: str, folder_name: str, file_system: str,
287
- description: str = None, version: str = None,
288
- server: str = None) -> str:
289
- """ Create a File folder element from a template.
290
- Async version.
346
+ async def _async_create_folder_element_from_template(
347
+ self,
348
+ path_name: str,
349
+ folder_name: str,
350
+ file_system: str,
351
+ description: str = None,
352
+ version: str = None,
353
+ server: str = None,
354
+ ) -> str:
355
+ """Create a File folder element from a template.
356
+ Async version.
291
357
 
292
- Parameters
293
- ----------
294
- path_name : str
295
- The path including the folder..
358
+ Parameters
359
+ ----------
360
+ path_name : str
361
+ The path including the folder..
296
362
 
297
- folder_name : str
298
- The name of the folder to create.
363
+ folder_name : str
364
+ The name of the folder to create.
299
365
 
300
- file_system : str
301
- The unique name for the file system that the folder belongs to. It may be a machine name or URL to a
302
- remote file store.
366
+ file_system : str
367
+ The unique name for the file system that the folder belongs to. It may be a machine name or URL to a
368
+ remote file store.
303
369
 
304
- description: str, opt
305
- A description of the element.
370
+ description: str, opt
371
+ A description of the element.
306
372
 
307
- version: str, opt
308
- version of the element - typically of the form x.y.z
373
+ version: str, opt
374
+ version of the element - typically of the form x.y.z
309
375
 
310
- server : str, optional
311
- The name of the view server to use. Default uses the client instance.
376
+ server : str, optional
377
+ The name of the view server to use. Default uses the client instance.
312
378
 
313
- Returns
314
- -------
315
- str
316
- The GUID of the Postgres server element.
379
+ Returns
380
+ -------
381
+ str
382
+ The GUID of the Postgres server element.
317
383
  """
318
- body = {"templateGUID": TEMPLATE_GUIDS['FileFolder'], "isOwnAnchor": 'true',
319
- "placeholderPropertyValues": {"directoryPathName": path_name, "directoryName": folder_name,
320
- "versionIdentifier": version, "fileSystemName": file_system,
321
- "description": description, }}
384
+ body = {
385
+ "templateGUID": TEMPLATE_GUIDS["FileFolder"],
386
+ "isOwnAnchor": "true",
387
+ "placeholderPropertyValues": {
388
+ "directoryPathName": path_name,
389
+ "directoryName": folder_name,
390
+ "versionIdentifier": version,
391
+ "fileSystemName": file_system,
392
+ "description": description,
393
+ },
394
+ }
322
395
  body_s = body_slimmer(body)
323
396
  response = await self._async_create_element_from_template(body_s, server)
324
397
  return str(response)
325
398
 
326
- def create_folder_element_from_template(self, path_name: str, folder_name: str, file_system: str,
327
- description: str = None, version: str = None, server: str = None) -> str:
328
- """ Create a File folder element from a template.
399
+ def create_folder_element_from_template(
400
+ self,
401
+ path_name: str,
402
+ folder_name: str,
403
+ file_system: str,
404
+ description: str = None,
405
+ version: str = None,
406
+ server: str = None,
407
+ ) -> str:
408
+ """Create a File folder element from a template.
329
409
 
330
- Parameters
331
- ----------
332
- path_name : str
333
- The path including the folder..
410
+ Parameters
411
+ ----------
412
+ path_name : str
413
+ The path including the folder..
334
414
 
335
- folder_name : str
336
- The name of the folder to create.
415
+ folder_name : str
416
+ The name of the folder to create.
337
417
 
338
- file_system : str
339
- The unique name for the file system that the folder belongs to. It may be a machine name or URL to a
340
- remote file store.
418
+ file_system : str
419
+ The unique name for the file system that the folder belongs to. It may be a machine name or URL to a
420
+ remote file store.
341
421
 
342
- description: str, opt
343
- A description of the element.
422
+ description: str, opt
423
+ A description of the element.
344
424
 
345
- version: str, opt
346
- version of the element - typically of the form x.y.z
425
+ version: str, opt
426
+ version of the element - typically of the form x.y.z
347
427
 
348
- server : str, optional
349
- The name of the view server to use. Default uses the client instance.
428
+ server : str, optional
429
+ The name of the view server to use. Default uses the client instance.
350
430
 
351
- Returns
352
- -------
353
- str
354
- The GUID of the Postgres server element.
431
+ Returns
432
+ -------
433
+ str
434
+ The GUID of the Postgres server element.
355
435
  """
356
436
  loop = asyncio.get_event_loop()
357
437
  response = loop.run_until_complete(
358
- self._async_create_folder_element_from_template(path_name, folder_name, file_system, description, version,
359
- server))
438
+ self._async_create_folder_element_from_template(
439
+ path_name, folder_name, file_system, description, version, server
440
+ )
441
+ )
360
442
  return response
361
443
 
362
- async def _async_create_uc_server_element_from_template(self, server_name: str, host_url: str, port: str,
363
- description: str = None, version: str = None,
364
- server: str = None) -> str:
365
- """ Create a Unity Catalog Server element from a template. Async version.
444
+ async def _async_create_uc_server_element_from_template(
445
+ self,
446
+ server_name: str,
447
+ host_url: str,
448
+ port: str,
449
+ description: str = None,
450
+ version: str = None,
451
+ server: str = None,
452
+ ) -> str:
453
+ """Create a Unity Catalog Server element from a template. Async version.
366
454
 
367
455
  Parameters
368
456
  ----------
@@ -389,17 +477,31 @@ class AutomatedCuration(Client):
389
477
  str
390
478
  The GUID of the File Folder element.
391
479
  """
392
- body = {"templateGUID": TEMPLATE_GUIDS['Unity Catalog Server'], "isOwnAnchor": 'true',
393
- "placeholderPropertyValues": {"serverName": server_name, "hostURL": host_url,
394
- "versionIdentifier": version, "portNumber": port,
395
- "description": description, }}
480
+ body = {
481
+ "templateGUID": TEMPLATE_GUIDS["Unity Catalog Server"],
482
+ "isOwnAnchor": "true",
483
+ "placeholderPropertyValues": {
484
+ "serverName": server_name,
485
+ "hostURL": host_url,
486
+ "versionIdentifier": version,
487
+ "portNumber": port,
488
+ "description": description,
489
+ },
490
+ }
396
491
  body_s = body_slimmer(body)
397
492
  response = await self._async_create_element_from_template(body_s, server)
398
493
  return str(response)
399
494
 
400
- def create_uc_server_element_from_template(self, server_name: str, host_url: str, port: str,
401
- description: str = None, version: str = None, server: str = None) -> str:
402
- """ Create a Unity Catalog Server element from a template. Async version.
495
+ def create_uc_server_element_from_template(
496
+ self,
497
+ server_name: str,
498
+ host_url: str,
499
+ port: str,
500
+ description: str = None,
501
+ version: str = None,
502
+ server: str = None,
503
+ ) -> str:
504
+ """Create a Unity Catalog Server element from a template. Async version.
403
505
 
404
506
  Parameters
405
507
  ----------
@@ -428,14 +530,21 @@ class AutomatedCuration(Client):
428
530
  """
429
531
  loop = asyncio.get_event_loop()
430
532
  response = loop.run_until_complete(
431
- self._async_create_uc_server_element_from_template(server_name, host_url, port, description, version,
432
- server))
533
+ self._async_create_uc_server_element_from_template(
534
+ server_name, host_url, port, description, version, server
535
+ )
536
+ )
433
537
  return response
434
538
 
435
- async def _async_create_uc_catalog_element_from_template(self, uc_catalog: str, network_address: str,
436
- description: str = None, version: str = None,
437
- server: str = None) -> str:
438
- """ Create a Unity Catalog Catalog element from a template. Async version.
539
+ async def _async_create_uc_catalog_element_from_template(
540
+ self,
541
+ uc_catalog: str,
542
+ network_address: str,
543
+ description: str = None,
544
+ version: str = None,
545
+ server: str = None,
546
+ ) -> str:
547
+ """Create a Unity Catalog Catalog element from a template. Async version.
439
548
 
440
549
  Parameters
441
550
  ----------
@@ -459,16 +568,29 @@ class AutomatedCuration(Client):
459
568
  str
460
569
  The GUID of the File Folder element.
461
570
  """
462
- body = {"templateGUID": TEMPLATE_GUIDS['Unity Catalog Catalog'], "isOwnAnchor": 'true',
463
- "placeholderPropertyValues": {"ucCatalogName": uc_catalog, "serverNetworkAddress": network_address,
464
- "versionIdentifier": version, "description": description, }}
571
+ body = {
572
+ "templateGUID": TEMPLATE_GUIDS["Unity Catalog Catalog"],
573
+ "isOwnAnchor": "true",
574
+ "placeholderPropertyValues": {
575
+ "ucCatalogName": uc_catalog,
576
+ "serverNetworkAddress": network_address,
577
+ "versionIdentifier": version,
578
+ "description": description,
579
+ },
580
+ }
465
581
  body_s = body_slimmer(body)
466
582
  response = await self._async_create_element_from_template(body_s, server)
467
583
  return str(response)
468
584
 
469
- def create_uc_catalog_element_from_template(self, uc_catalog: str, network_address: str, description: str = None,
470
- version: str = None, server: str = None) -> str:
471
- """ Create a Unity Catalog Catalog element from a template.
585
+ def create_uc_catalog_element_from_template(
586
+ self,
587
+ uc_catalog: str,
588
+ network_address: str,
589
+ description: str = None,
590
+ version: str = None,
591
+ server: str = None,
592
+ ) -> str:
593
+ """Create a Unity Catalog Catalog element from a template.
472
594
 
473
595
  Parameters
474
596
  ----------
@@ -494,14 +616,22 @@ class AutomatedCuration(Client):
494
616
  """
495
617
  loop = asyncio.get_event_loop()
496
618
  response = loop.run_until_complete(
497
- self._async_create_uc_catalog_element_from_template(uc_catalog, network_address, description, version,
498
- server))
619
+ self._async_create_uc_catalog_element_from_template(
620
+ uc_catalog, network_address, description, version, server
621
+ )
622
+ )
499
623
  return response
500
624
 
501
- async def _async_create_uc_schema_element_from_template(self, uc_catalog: str, uc_schema: str, network_address: str,
502
- description: str = None, version: str = None,
503
- server: str = None) -> str:
504
- """ Create a Unity Catalog schema element from a template. Async version.
625
+ async def _async_create_uc_schema_element_from_template(
626
+ self,
627
+ uc_catalog: str,
628
+ uc_schema: str,
629
+ network_address: str,
630
+ description: str = None,
631
+ version: str = None,
632
+ server: str = None,
633
+ ) -> str:
634
+ """Create a Unity Catalog schema element from a template. Async version.
505
635
 
506
636
  Parameters
507
637
  ----------
@@ -528,17 +658,31 @@ class AutomatedCuration(Client):
528
658
  str
529
659
  The GUID of the File Folder element.
530
660
  """
531
- body = {"templateGUID": TEMPLATE_GUIDS['Unity Catalog Schema'], "isOwnAnchor": 'true',
532
- "placeholderPropertyValues": {"ucCatalogName": uc_catalog, "ucSchemaName": uc_schema,
533
- "serverNetworkAddress": network_address, "versionIdentifier": version,
534
- "description": description, }}
661
+ body = {
662
+ "templateGUID": TEMPLATE_GUIDS["Unity Catalog Schema"],
663
+ "isOwnAnchor": "true",
664
+ "placeholderPropertyValues": {
665
+ "ucCatalogName": uc_catalog,
666
+ "ucSchemaName": uc_schema,
667
+ "serverNetworkAddress": network_address,
668
+ "versionIdentifier": version,
669
+ "description": description,
670
+ },
671
+ }
535
672
  body_s = body_slimmer(body)
536
673
  response = await self._async_create_element_from_template(body_s, server)
537
674
  return str(response)
538
675
 
539
- def create_uc_schema_element_from_template(self, uc_catalog: str, uc_schema: str, network_address: str,
540
- description: str = None, version: str = None, server: str = None) -> str:
541
- """ Create a Unity Catalog schema element from a template. Async version.
676
+ def create_uc_schema_element_from_template(
677
+ self,
678
+ uc_catalog: str,
679
+ uc_schema: str,
680
+ network_address: str,
681
+ description: str = None,
682
+ version: str = None,
683
+ server: str = None,
684
+ ) -> str:
685
+ """Create a Unity Catalog schema element from a template. Async version.
542
686
 
543
687
  Parameters
544
688
  ----------
@@ -567,16 +711,26 @@ class AutomatedCuration(Client):
567
711
  """
568
712
  loop = asyncio.get_event_loop()
569
713
  response = loop.run_until_complete(
570
- self._async_create_uc_schema_element_from_template(uc_catalog, uc_schema, network_address, description,
571
- version, server))
714
+ self._async_create_uc_schema_element_from_template(
715
+ uc_catalog, uc_schema, network_address, description, version, server
716
+ )
717
+ )
572
718
  return response
573
719
 
574
- async def _async_create_uc_table_element_from_template(self, uc_catalog: str, uc_schema: str, uc_table: str,
575
- uc_table_type: str, uc_storage_loc: str,
576
- uc_data_source_format: str, network_address: str,
577
- description: str = None, version: str = None,
578
- server: str = None) -> str:
579
- """ Create a Unity Catalog table element from a template. Async version.
720
+ async def _async_create_uc_table_element_from_template(
721
+ self,
722
+ uc_catalog: str,
723
+ uc_schema: str,
724
+ uc_table: str,
725
+ uc_table_type: str,
726
+ uc_storage_loc: str,
727
+ uc_data_source_format: str,
728
+ network_address: str,
729
+ description: str = None,
730
+ version: str = None,
731
+ server: str = None,
732
+ ) -> str:
733
+ """Create a Unity Catalog table element from a template. Async version.
580
734
 
581
735
  Parameters
582
736
  ----------
@@ -612,21 +766,39 @@ class AutomatedCuration(Client):
612
766
  str
613
767
  The GUID of the File Folder element.
614
768
  """
615
- body = {"templateGUID": TEMPLATE_GUIDS['Unity Catalog Table'], "isOwnAnchor": 'true',
616
- "placeholderPropertyValues": {"ucCatalogName": uc_catalog, "ucSchemaName": uc_schema,
617
- "ucTableName": uc_table, "ucTableType": uc_table_type,
618
- "ucStorageLocation": uc_storage_loc,
619
- "ucDataSourceFormat": uc_data_source_format,
620
- "serverNetworkAddress": network_address,
621
- "versionIdentifier": version, "description": description, }}
769
+ body = {
770
+ "templateGUID": TEMPLATE_GUIDS["Unity Catalog Table"],
771
+ "isOwnAnchor": "true",
772
+ "placeholderPropertyValues": {
773
+ "ucCatalogName": uc_catalog,
774
+ "ucSchemaName": uc_schema,
775
+ "ucTableName": uc_table,
776
+ "ucTableType": uc_table_type,
777
+ "ucStorageLocation": uc_storage_loc,
778
+ "ucDataSourceFormat": uc_data_source_format,
779
+ "serverNetworkAddress": network_address,
780
+ "versionIdentifier": version,
781
+ "description": description,
782
+ },
783
+ }
622
784
  body_s = body_slimmer(body)
623
785
  response = await self._async_create_element_from_template(body_s, server)
624
786
  return str(response)
625
787
 
626
- def create_uc_table_element_from_template(self, uc_catalog: str, uc_schema: str, uc_table: str, uc_table_type: str,
627
- uc_storage_loc: str, uc_data_source_format: str, network_address: str,
628
- description: str = None, version: str = None, server: str = None) -> str:
629
- """ Create a Unity Catalog table element from a template.
788
+ def create_uc_table_element_from_template(
789
+ self,
790
+ uc_catalog: str,
791
+ uc_schema: str,
792
+ uc_table: str,
793
+ uc_table_type: str,
794
+ uc_storage_loc: str,
795
+ uc_data_source_format: str,
796
+ network_address: str,
797
+ description: str = None,
798
+ version: str = None,
799
+ server: str = None,
800
+ ) -> str:
801
+ """Create a Unity Catalog table element from a template.
630
802
 
631
803
  Parameters
632
804
  ----------
@@ -664,15 +836,32 @@ class AutomatedCuration(Client):
664
836
  """
665
837
  loop = asyncio.get_event_loop()
666
838
  response = loop.run_until_complete(
667
- self._async_create_uc_table_element_from_template(uc_catalog, uc_schema, uc_table, uc_table_type,
668
- uc_storage_loc, uc_data_source_format, network_address,
669
- description, version, server))
839
+ self._async_create_uc_table_element_from_template(
840
+ uc_catalog,
841
+ uc_schema,
842
+ uc_table,
843
+ uc_table_type,
844
+ uc_storage_loc,
845
+ uc_data_source_format,
846
+ network_address,
847
+ description,
848
+ version,
849
+ server,
850
+ )
851
+ )
670
852
  return response
671
853
 
672
- async def _async_create_uc_function_element_from_template(self, uc_catalog: str, uc_schema: str, uc_function: str,
673
- network_address: str, description: str = None,
674
- version: str = None, server: str = None) -> str:
675
- """ Create a Unity Catalog function element from a template. Async version.
854
+ async def _async_create_uc_function_element_from_template(
855
+ self,
856
+ uc_catalog: str,
857
+ uc_schema: str,
858
+ uc_function: str,
859
+ network_address: str,
860
+ description: str = None,
861
+ version: str = None,
862
+ server: str = None,
863
+ ) -> str:
864
+ """Create a Unity Catalog function element from a template. Async version.
676
865
 
677
866
  Parameters
678
867
  ----------
@@ -702,18 +891,33 @@ class AutomatedCuration(Client):
702
891
  str
703
892
  The GUID of the File Folder element.
704
893
  """
705
- body = {"templateGUID": TEMPLATE_GUIDS['Unity Catalog Function'], "isOwnAnchor": 'true',
706
- "placeholderPropertyValues": {"ucCatalogName": uc_catalog, "ucSchemaName": uc_schema,
707
- "ucFunctionName": uc_function, "serverNetworkAddress": network_address,
708
- "versionIdentifier": version, "description": description, }}
894
+ body = {
895
+ "templateGUID": TEMPLATE_GUIDS["Unity Catalog Function"],
896
+ "isOwnAnchor": "true",
897
+ "placeholderPropertyValues": {
898
+ "ucCatalogName": uc_catalog,
899
+ "ucSchemaName": uc_schema,
900
+ "ucFunctionName": uc_function,
901
+ "serverNetworkAddress": network_address,
902
+ "versionIdentifier": version,
903
+ "description": description,
904
+ },
905
+ }
709
906
  body_s = body_slimmer(body)
710
907
  response = await self._async_create_element_from_template(body_s, server)
711
908
  return str(response)
712
909
 
713
- def create_uc_function_element_from_template(self, uc_catalog: str, uc_schema: str, uc_function: str,
714
- network_address: str, description: str = None, version: str = None,
715
- server: str = None) -> str:
716
- """ Create a Unity Catalog function element from a template.
910
+ def create_uc_function_element_from_template(
911
+ self,
912
+ uc_catalog: str,
913
+ uc_schema: str,
914
+ uc_function: str,
915
+ network_address: str,
916
+ description: str = None,
917
+ version: str = None,
918
+ server: str = None,
919
+ ) -> str:
920
+ """Create a Unity Catalog function element from a template.
717
921
 
718
922
  Parameters
719
923
  ----------
@@ -745,15 +949,31 @@ class AutomatedCuration(Client):
745
949
  """
746
950
  loop = asyncio.get_event_loop()
747
951
  response = loop.run_until_complete(
748
- self._async_create_uc_function_element_from_template(uc_catalog, uc_schema, uc_function, network_address,
749
- description, version, server))
952
+ self._async_create_uc_function_element_from_template(
953
+ uc_catalog,
954
+ uc_schema,
955
+ uc_function,
956
+ network_address,
957
+ description,
958
+ version,
959
+ server,
960
+ )
961
+ )
750
962
  return response
751
963
 
752
- async def _async_create_uc_volume_element_from_template(self, uc_catalog: str, uc_schema: str, uc_volume: str,
753
- uc_vol_type: str, uc_storage_loc: str, network_address: str,
754
- description: str = None, version: str = None,
755
- server: str = None) -> str:
756
- """ Create a Unity Catalog volume element from a template. Async version.
964
+ async def _async_create_uc_volume_element_from_template(
965
+ self,
966
+ uc_catalog: str,
967
+ uc_schema: str,
968
+ uc_volume: str,
969
+ uc_vol_type: str,
970
+ uc_storage_loc: str,
971
+ network_address: str,
972
+ description: str = None,
973
+ version: str = None,
974
+ server: str = None,
975
+ ) -> str:
976
+ """Create a Unity Catalog volume element from a template. Async version.
757
977
 
758
978
  Parameters
759
979
  ----------
@@ -788,20 +1008,37 @@ class AutomatedCuration(Client):
788
1008
  str
789
1009
  The GUID of the File Folder element.
790
1010
  """
791
- body = {"templateGUID": TEMPLATE_GUIDS['Unity Catalog Volume'], "isOwnAnchor": 'true',
792
- "placeholderPropertyValues": {"ucCatalogName": uc_catalog, "ucSchemaName": uc_schema,
793
- "ucVolumeName": uc_volume, "ucVolumeType": uc_vol_type,
794
- "ucStorageLocation": uc_storage_loc,
795
- "serverNetworkAddress": network_address, "versionIdentifier": version,
796
- "description": description, }}
1011
+ body = {
1012
+ "templateGUID": TEMPLATE_GUIDS["Unity Catalog Volume"],
1013
+ "isOwnAnchor": "true",
1014
+ "placeholderPropertyValues": {
1015
+ "ucCatalogName": uc_catalog,
1016
+ "ucSchemaName": uc_schema,
1017
+ "ucVolumeName": uc_volume,
1018
+ "ucVolumeType": uc_vol_type,
1019
+ "ucStorageLocation": uc_storage_loc,
1020
+ "serverNetworkAddress": network_address,
1021
+ "versionIdentifier": version,
1022
+ "description": description,
1023
+ },
1024
+ }
797
1025
  body_s = body_slimmer(body)
798
1026
  response = await self._async_create_element_from_template(body_s, server)
799
1027
  return str(response)
800
1028
 
801
- def create_uc_volume_element_from_template(self, uc_catalog: str, uc_schema: str, uc_volume: str, uc_vol_type: str,
802
- uc_storage_loc: str, network_address: str, description: str = None,
803
- version: str = None, server: str = None) -> str:
804
- """ Create a Unity Catalog volume element from a template. Async version.
1029
+ def create_uc_volume_element_from_template(
1030
+ self,
1031
+ uc_catalog: str,
1032
+ uc_schema: str,
1033
+ uc_volume: str,
1034
+ uc_vol_type: str,
1035
+ uc_storage_loc: str,
1036
+ network_address: str,
1037
+ description: str = None,
1038
+ version: str = None,
1039
+ server: str = None,
1040
+ ) -> str:
1041
+ """Create a Unity Catalog volume element from a template. Async version.
805
1042
 
806
1043
  Parameters
807
1044
  ----------
@@ -838,17 +1075,27 @@ class AutomatedCuration(Client):
838
1075
  """
839
1076
  loop = asyncio.get_event_loop()
840
1077
  response = loop.run_until_complete(
841
- self._async_create_uc_volume_element_from_template(uc_catalog, uc_schema, uc_volume, uc_vol_type,
842
- uc_storage_loc, network_address, description, version,
843
- server))
1078
+ self._async_create_uc_volume_element_from_template(
1079
+ uc_catalog,
1080
+ uc_schema,
1081
+ uc_volume,
1082
+ uc_vol_type,
1083
+ uc_storage_loc,
1084
+ network_address,
1085
+ description,
1086
+ version,
1087
+ server,
1088
+ )
1089
+ )
844
1090
  return response
845
1091
 
846
1092
  #
847
1093
  # Engine Actions
848
1094
  #
849
- async def _async_get_engine_actions(self, server: str = None, start_from: int = 0,
850
- page_size: int = max_paging_size) -> list:
851
- """ Retrieve the engine actions that are known to the server. Async version.
1095
+ async def _async_get_engine_actions(
1096
+ self, server: str = None, start_from: int = 0, page_size: int = max_paging_size
1097
+ ) -> list:
1098
+ """Retrieve the engine actions that are known to the server. Async version.
852
1099
  Parameters
853
1100
  ----------
854
1101
  server : str, optional
@@ -875,44 +1122,52 @@ class AutomatedCuration(Client):
875
1122
  """
876
1123
  server = self.server_name if server is None else server
877
1124
 
878
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions?"
879
- f"startFrom={start_from}&pageSize={page_size}")
1125
+ url = (
1126
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions?"
1127
+ f"startFrom={start_from}&pageSize={page_size}"
1128
+ )
880
1129
 
881
1130
  response = await self._async_make_request("GET", url)
882
1131
  return response.json().get("elements", "No elements")
883
1132
 
884
- def get_engine_actions(self, server: str = None, start_from: int = 0, page_size: int = max_paging_size) -> list:
885
- """ Retrieve the engine actions that are known to the server.
886
- Parameters
887
- ----------
888
- server : str, optional
889
- The name of the server. If not provided, it uses the default server name.
890
- start_from : int, optional
891
- The starting index of the actions to retrieve. Default is 0.
892
- page_size : int, optional
893
- The maximum number of actions to retrieve per page. Default is the global maximum paging size.
894
-
895
- Returns
896
- -------
897
- [dict]
898
- A list of engine action descriptions as JSON.
1133
+ def get_engine_actions(
1134
+ self, server: str = None, start_from: int = 0, page_size: int = max_paging_size
1135
+ ) -> list:
1136
+ """Retrieve the engine actions that are known to the server.
1137
+ Parameters
1138
+ ----------
1139
+ server : str, optional
1140
+ The name of the server. If not provided, it uses the default server name.
1141
+ start_from : int, optional
1142
+ The starting index of the actions to retrieve. Default is 0.
1143
+ page_size : int, optional
1144
+ The maximum number of actions to retrieve per page. Default is the global maximum paging size.
899
1145
 
900
- Raises
901
- ------
902
- InvalidParameterException
903
- PropertyServerException
904
- UserNotAuthorizedException
1146
+ Returns
1147
+ -------
1148
+ [dict]
1149
+ A list of engine action descriptions as JSON.
1150
+
1151
+ Raises
1152
+ ------
1153
+ InvalidParameterException
1154
+ PropertyServerException
1155
+ UserNotAuthorizedException
905
1156
 
906
- Notes
907
- -----
908
- For more information see: https://egeria-project.org/concepts/engine-action
1157
+ Notes
1158
+ -----
1159
+ For more information see: https://egeria-project.org/concepts/engine-action
909
1160
  """
910
1161
  loop = asyncio.get_event_loop()
911
- response = loop.run_until_complete(self._async_get_engine_actions(server, start_from, page_size))
1162
+ response = loop.run_until_complete(
1163
+ self._async_get_engine_actions(server, start_from, page_size)
1164
+ )
912
1165
  return response
913
1166
 
914
- async def _async_get_engine_action(self, engine_action_guid: str, server: str = None) -> dict:
915
- """ Request the status and properties of an executing engine action request. Async version.
1167
+ async def _async_get_engine_action(
1168
+ self, engine_action_guid: str, server: str = None
1169
+ ) -> dict:
1170
+ """Request the status and properties of an executing engine action request. Async version.
916
1171
  Parameters
917
1172
  ----------
918
1173
  engine_action_guid : str
@@ -938,140 +1193,155 @@ class AutomatedCuration(Client):
938
1193
  """
939
1194
  server = self.server_name if server is None else server
940
1195
 
941
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions/"
942
- f"{engine_action_guid}")
1196
+ url = (
1197
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions/"
1198
+ f"{engine_action_guid}"
1199
+ )
943
1200
 
944
1201
  response = await self._async_make_request("GET", url)
945
1202
  return response.json().get("element", "No element found")
946
1203
 
947
1204
  def get_engine_action(self, engine_action_guid: str, server: str = None) -> dict:
948
- """ Request the status and properties of an executing engine action request.
949
- Parameters
950
- ----------
951
- engine_action_guid : str
952
- The GUID of the engine action to retrieve.
1205
+ """Request the status and properties of an executing engine action request.
1206
+ Parameters
1207
+ ----------
1208
+ engine_action_guid : str
1209
+ The GUID of the engine action to retrieve.
953
1210
 
954
- server : str, optional
955
- The name of the server. If not provided, the default server name will be used.
1211
+ server : str, optional
1212
+ The name of the server. If not provided, the default server name will be used.
956
1213
 
957
- Returns
958
- -------
959
- dict
960
- The JSON representation of the engine action.
1214
+ Returns
1215
+ -------
1216
+ dict
1217
+ The JSON representation of the engine action.
961
1218
 
962
- Raises
963
- ------
964
- InvalidParameterException
965
- PropertyServerException
966
- UserNotAuthorizedException
1219
+ Raises
1220
+ ------
1221
+ InvalidParameterException
1222
+ PropertyServerException
1223
+ UserNotAuthorizedException
967
1224
 
968
- Notes
969
- -----
970
- For more information see: https://egeria-project.org/concepts/engine-action
1225
+ Notes
1226
+ -----
1227
+ For more information see: https://egeria-project.org/concepts/engine-action
971
1228
  """
972
1229
  loop = asyncio.get_event_loop()
973
- response = loop.run_until_complete(self._async_get_engine_action(engine_action_guid, server))
1230
+ response = loop.run_until_complete(
1231
+ self._async_get_engine_action(engine_action_guid, server)
1232
+ )
974
1233
  return response
975
1234
 
976
- async def _async_cancel_engine_action(self, engine_action_guid: str, server: str = None) -> None:
977
- """ Request that an engine action request is cancelled and any running governance service is stopped. Async Ver.
978
- Parameters
979
- ----------
980
- engine_action_guid : str
981
- The GUID of the engine action to retrieve.
1235
+ async def _async_cancel_engine_action(
1236
+ self, engine_action_guid: str, server: str = None
1237
+ ) -> None:
1238
+ """Request that an engine action request is cancelled and any running governance service is stopped. Async Ver.
1239
+ Parameters
1240
+ ----------
1241
+ engine_action_guid : str
1242
+ The GUID of the engine action to retrieve.
982
1243
 
983
- server : str, optional
984
- The name of the server. If not provided, the default server name will be used.
1244
+ server : str, optional
1245
+ The name of the server. If not provided, the default server name will be used.
985
1246
 
986
- Returns
987
- -------
988
- dict
989
- The JSON representation of the engine action.
1247
+ Returns
1248
+ -------
1249
+ dict
1250
+ The JSON representation of the engine action.
990
1251
 
991
- Raises
992
- ------
993
- InvalidParameterException
994
- PropertyServerException
995
- UserNotAuthorizedException
1252
+ Raises
1253
+ ------
1254
+ InvalidParameterException
1255
+ PropertyServerException
1256
+ UserNotAuthorizedException
996
1257
 
997
- Notes
998
- -----
999
- For more information see: https://egeria-project.org/concepts/engine-action
1258
+ Notes
1259
+ -----
1260
+ For more information see: https://egeria-project.org/concepts/engine-action
1000
1261
  """
1001
1262
  server = self.server_name if server is None else server
1002
1263
  validate_guid(engine_action_guid)
1003
1264
 
1004
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions/"
1005
- f"{engine_action_guid}/cancel")
1265
+ url = (
1266
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions/"
1267
+ f"{engine_action_guid}/cancel"
1268
+ )
1006
1269
 
1007
1270
  await self._async_make_request("POST", url)
1008
1271
 
1009
1272
  def cancel_engine_action(self, engine_action_guid: str, server: str = None) -> None:
1010
- """ Request that an engine action request is cancelled and any running governance service is stopped.
1011
- Parameters
1012
- ----------
1013
- engine_action_guid : str
1014
- The GUID of the engine action to retrieve.
1273
+ """Request that an engine action request is cancelled and any running governance service is stopped.
1274
+ Parameters
1275
+ ----------
1276
+ engine_action_guid : str
1277
+ The GUID of the engine action to retrieve.
1015
1278
 
1016
- server : str, optional
1017
- The name of the server. If not provided, the default server name will be used.
1279
+ server : str, optional
1280
+ The name of the server. If not provided, the default server name will be used.
1018
1281
 
1019
- Returns
1020
- -------
1021
- dict
1022
- The JSON representation of the engine action.
1282
+ Returns
1283
+ -------
1284
+ dict
1285
+ The JSON representation of the engine action.
1023
1286
 
1024
- Raises
1025
- ------
1026
- InvalidParameterException
1027
- PropertyServerException
1028
- UserNotAuthorizedException
1287
+ Raises
1288
+ ------
1289
+ InvalidParameterException
1290
+ PropertyServerException
1291
+ UserNotAuthorizedException
1029
1292
 
1030
- Notes
1031
- -----
1032
- For more information see: https://egeria-project.org/concepts/engine-action
1293
+ Notes
1294
+ -----
1295
+ For more information see: https://egeria-project.org/concepts/engine-action
1033
1296
  """
1034
1297
  loop = asyncio.get_event_loop()
1035
- loop.run_until_complete(self._async_cancel_engine_action(engine_action_guid, server))
1298
+ loop.run_until_complete(
1299
+ self._async_cancel_engine_action(engine_action_guid, server)
1300
+ )
1036
1301
  return
1037
1302
 
1038
- async def _async_get_active_engine_actions(self, server: str = None, start_from: int = 0,
1039
- page_size: int = max_paging_size) -> list | str:
1040
- """ Retrieve the engine actions that are still in process. Async Version.
1303
+ async def _async_get_active_engine_actions(
1304
+ self, server: str = None, start_from: int = 0, page_size: int = max_paging_size
1305
+ ) -> list | str:
1306
+ """Retrieve the engine actions that are still in process. Async Version.
1041
1307
 
1042
- Parameters:
1043
- ----------
1044
- server : str, optional
1045
- The name of the server. If not provided, it uses the default server name.
1046
- start_from : int, optional
1047
- The starting index of the actions to retrieve. Default is 0.
1048
- page_size : int, optional
1049
- The maximum number of actions to retrieve per page. Default is the global maximum paging size.
1308
+ Parameters:
1309
+ ----------
1310
+ server : str, optional
1311
+ The name of the server. If not provided, it uses the default server name.
1312
+ start_from : int, optional
1313
+ The starting index of the actions to retrieve. Default is 0.
1314
+ page_size : int, optional
1315
+ The maximum number of actions to retrieve per page. Default is the global maximum paging size.
1050
1316
 
1051
- Returns:
1052
- -------
1053
- List[dict]: A list of JSON representations of governance action processes matching the provided name.
1317
+ Returns:
1318
+ -------
1319
+ List[dict]: A list of JSON representations of governance action processes matching the provided name.
1054
1320
 
1055
- Raises:
1056
- ------
1057
- InvalidParameterException: If the API response indicates an error (non-200 status code),
1058
- this exception is raised with details from the response content.
1321
+ Raises:
1322
+ ------
1323
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
1324
+ this exception is raised with details from the response content.
1059
1325
 
1060
- Notes
1061
- -----
1062
- For more information see: https://egeria-project.org/concepts/engine-action
1326
+ Notes
1327
+ -----
1328
+ For more information see: https://egeria-project.org/concepts/engine-action
1063
1329
 
1064
1330
  """
1065
1331
  server = self.server_name if server is None else server
1066
1332
 
1067
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions/active?"
1068
- f"startFrom={start_from}&pageSize={page_size}")
1333
+ url = (
1334
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions/active?"
1335
+ f"startFrom={start_from}&pageSize={page_size}"
1336
+ )
1069
1337
 
1070
1338
  response = await self._async_make_request("GET", url)
1071
1339
  return response.json().get("elements", "no actions")
1072
1340
 
1073
- def get_active_engine_actions(self, server: str = None, start_from: int = 0, page_size: int = 0) -> list | str:
1074
- """ Retrieve the engine actions that are still in process.
1341
+ def get_active_engine_actions(
1342
+ self, server: str = None, start_from: int = 0, page_size: int = 0
1343
+ ) -> list | str:
1344
+ """Retrieve the engine actions that are still in process.
1075
1345
 
1076
1346
  Parameters:
1077
1347
  ----------
@@ -1096,12 +1366,19 @@ class AutomatedCuration(Client):
1096
1366
 
1097
1367
  """
1098
1368
  loop = asyncio.get_event_loop()
1099
- response = loop.run_until_complete(self._async_get_active_engine_actions(server, start_from, page_size))
1369
+ response = loop.run_until_complete(
1370
+ self._async_get_active_engine_actions(server, start_from, page_size)
1371
+ )
1100
1372
  return response
1101
1373
 
1102
- async def _async_get_engine_actions_by_name(self, name: str, server: str = None, start_from: int = 0,
1103
- page_size: int = max_paging_size) -> list | str:
1104
- """ Retrieve the list of engine action metadata elements with a matching qualified or display name.
1374
+ async def _async_get_engine_actions_by_name(
1375
+ self,
1376
+ name: str,
1377
+ server: str = None,
1378
+ start_from: int = 0,
1379
+ page_size: int = max_paging_size,
1380
+ ) -> list | str:
1381
+ """Retrieve the list of engine action metadata elements with a matching qualified or display name.
1105
1382
  There are no wildcards supported on this request. Async Version.
1106
1383
  Parameters
1107
1384
  ----------
@@ -1135,15 +1412,22 @@ class AutomatedCuration(Client):
1135
1412
  server = self.server_name if server is None else server
1136
1413
  validate_name(name)
1137
1414
 
1138
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions/by-name?"
1139
- f"startFrom={start_from}&pageSize={page_size}")
1415
+ url = (
1416
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions/by-name?"
1417
+ f"startFrom={start_from}&pageSize={page_size}"
1418
+ )
1140
1419
  body = {"filter": name}
1141
1420
  response = await self._async_make_request("POST", url, body)
1142
1421
  return response.json().get("elements", "no actions")
1143
1422
 
1144
- def get_engine_actions_by_name(self, name: str, server: str = None, start_from: int = 0,
1145
- page_size: int = max_paging_size) -> list | str:
1146
- """ Retrieve the list of engine action metadata elements with a matching qualified or display name.
1423
+ def get_engine_actions_by_name(
1424
+ self,
1425
+ name: str,
1426
+ server: str = None,
1427
+ start_from: int = 0,
1428
+ page_size: int = max_paging_size,
1429
+ ) -> list | str:
1430
+ """Retrieve the list of engine action metadata elements with a matching qualified or display name.
1147
1431
  There are no wildcards supported on this request.
1148
1432
 
1149
1433
  Parameters
@@ -1176,13 +1460,22 @@ class AutomatedCuration(Client):
1176
1460
 
1177
1461
  """
1178
1462
  loop = asyncio.get_event_loop()
1179
- response = loop.run_until_complete(self._async_get_engine_actions_by_name(name, server, start_from, page_size))
1463
+ response = loop.run_until_complete(
1464
+ self._async_get_engine_actions_by_name(name, server, start_from, page_size)
1465
+ )
1180
1466
  return response
1181
1467
 
1182
- async def _async_find_engine_actions(self, search_string: str, server: str = None, starts_with: bool = False,
1183
- ends_with: bool = False, ignore_case: bool = False, start_from: int = 0,
1184
- page_size: int = max_paging_size) -> list | str:
1185
- """ Retrieve the list of engine action metadata elements that contain the search string. Async Version.
1468
+ async def _async_find_engine_actions(
1469
+ self,
1470
+ search_string: str,
1471
+ server: str = None,
1472
+ starts_with: bool = False,
1473
+ ends_with: bool = False,
1474
+ ignore_case: bool = False,
1475
+ start_from: int = 0,
1476
+ page_size: int = max_paging_size,
1477
+ ) -> list | str:
1478
+ """Retrieve the list of engine action metadata elements that contain the search string. Async Version.
1186
1479
  Parameters
1187
1480
  ----------
1188
1481
  search_string : str
@@ -1230,17 +1523,26 @@ class AutomatedCuration(Client):
1230
1523
  ends_with_s = str(ends_with).lower()
1231
1524
  ignore_case_s = str(ignore_case).lower()
1232
1525
 
1233
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions/"
1234
- f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
1235
- f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}")
1526
+ url = (
1527
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/engine-actions/"
1528
+ f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
1529
+ f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
1530
+ )
1236
1531
  body = {"class": "SearchStringRequestBody", "name": search_string}
1237
1532
  response = await self._async_make_request("POST", url, body)
1238
1533
  return response.json().get("elements", "no actions")
1239
1534
 
1240
- def find_engine_actions(self, search_string: str = "*", server: str = None, starts_with: bool = False,
1241
- ends_with: bool = False, ignore_case: bool = False, start_from: int = 0,
1242
- page_size: int = max_paging_size) -> list | str:
1243
- """ Retrieve the list of engine action metadata elements that contain the search string.
1535
+ def find_engine_actions(
1536
+ self,
1537
+ search_string: str = "*",
1538
+ server: str = None,
1539
+ starts_with: bool = False,
1540
+ ends_with: bool = False,
1541
+ ignore_case: bool = False,
1542
+ start_from: int = 0,
1543
+ page_size: int = max_paging_size,
1544
+ ) -> list | str:
1545
+ """Retrieve the list of engine action metadata elements that contain the search string.
1244
1546
  Parameters
1245
1547
  ----------
1246
1548
  search_string : str
@@ -1283,75 +1585,93 @@ class AutomatedCuration(Client):
1283
1585
 
1284
1586
  loop = asyncio.get_event_loop()
1285
1587
  response = loop.run_until_complete(
1286
- self._async_find_engine_actions(search_string, server, starts_with, ends_with, ignore_case, start_from,
1287
- page_size))
1588
+ self._async_find_engine_actions(
1589
+ search_string,
1590
+ server,
1591
+ starts_with,
1592
+ ends_with,
1593
+ ignore_case,
1594
+ start_from,
1595
+ page_size,
1596
+ )
1597
+ )
1288
1598
  return response
1289
1599
 
1290
1600
  #
1291
1601
  # Governance action processes
1292
1602
  #
1293
1603
 
1294
- async def _async_get_governance_action_process_by_guid(self, process_guid: str, server: str = None) -> dict | str:
1295
- """ Retrieve the governance action process metadata element with the supplied unique identifier. Async Version.
1604
+ async def _async_get_governance_action_process_by_guid(
1605
+ self, process_guid: str, server: str = None
1606
+ ) -> dict | str:
1607
+ """Retrieve the governance action process metadata element with the supplied unique identifier. Async Version.
1296
1608
 
1297
- Parameters:
1298
- ----------
1299
- process_guid: str
1300
- The GUID (Globally Unique Identifier) of the governance action process.
1301
- server: str, optional
1302
- The name of the server. If None, will use the default server specified in the instance will be used.
1609
+ Parameters:
1610
+ ----------
1611
+ process_guid: str
1612
+ The GUID (Globally Unique Identifier) of the governance action process.
1613
+ server: str, optional
1614
+ The name of the server. If None, will use the default server specified in the instance will be used.
1303
1615
 
1304
- Returns:
1305
- -------
1306
- dict: The JSON representation of the governance action process element.
1616
+ Returns:
1617
+ -------
1618
+ dict: The JSON representation of the governance action process element.
1307
1619
 
1308
- Raises:
1309
- ------
1310
- InvalidParameterException: If the API response indicates an error (non-200 status code),
1311
- this exception is raised with details from the response content.
1312
- PropertyServerException: If the API response indicates a server side error.
1313
- UserNotAuthorizedException:
1314
- """
1620
+ Raises:
1621
+ ------
1622
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
1623
+ this exception is raised with details from the response content.
1624
+ PropertyServerException: If the API response indicates a server side error.
1625
+ UserNotAuthorizedException:
1626
+ """
1315
1627
 
1316
1628
  server = self.server_name if server is None else server
1317
1629
  validate_guid(process_guid)
1318
1630
 
1319
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/"
1320
- f"governance-action-processes/{process_guid}")
1631
+ url = (
1632
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/"
1633
+ f"governance-action-processes/{process_guid}"
1634
+ )
1321
1635
 
1322
1636
  response = await self._async_make_request("GET", url)
1323
1637
  return response.json().get("element", "no actions")
1324
1638
 
1325
- def get_governance_action_process_by_guid(self, process_guid: str, server: str = None) -> dict | str:
1326
- """ Retrieve the governance action process metadata element with the supplied unique identifier.
1327
-
1328
- Parameters:
1329
- ----------
1330
- process_guid: str
1331
- The GUID (Globally Unique Identifier) of the governance action process.
1332
- server: str, optional
1333
- The name of the server. If None, will use the default server specified in the instance will be used.
1334
- Returns:
1335
- -------
1336
- dict: The JSON representation of the governance action process element.
1337
-
1338
- Raises:
1339
- ------
1340
- InvalidParameterException: If the API response indicates an error (non-200 status code),
1341
- this exception is raised with details from the response content.
1342
- PropertyServerException: If the API response indicates a server side error.
1343
- UserNotAuthorizedException:
1344
- """
1345
- loop = asyncio.get_event_loop()
1346
- response = loop.run_until_complete(self._async_get_governance_action_process_by_guid(process_guid, server))
1347
- return response
1639
+ def get_governance_action_process_by_guid(
1640
+ self, process_guid: str, server: str = None
1641
+ ) -> dict | str:
1642
+ """Retrieve the governance action process metadata element with the supplied unique identifier.
1348
1643
 
1349
- async def _async_get_gov_action_process_graph(self, process_guid: str, server: str = None) -> dict | str:
1350
- """ Retrieve the governance action process metadata element with the supplied unique
1351
- identifier along with the flow definition describing its implementation. Async Version.
1352
- Parameters
1644
+ Parameters:
1353
1645
  ----------
1354
- process_guid : str
1646
+ process_guid: str
1647
+ The GUID (Globally Unique Identifier) of the governance action process.
1648
+ server: str, optional
1649
+ The name of the server. If None, will use the default server specified in the instance will be used.
1650
+ Returns:
1651
+ -------
1652
+ dict: The JSON representation of the governance action process element.
1653
+
1654
+ Raises:
1655
+ ------
1656
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
1657
+ this exception is raised with details from the response content.
1658
+ PropertyServerException: If the API response indicates a server side error.
1659
+ UserNotAuthorizedException:
1660
+ """
1661
+ loop = asyncio.get_event_loop()
1662
+ response = loop.run_until_complete(
1663
+ self._async_get_governance_action_process_by_guid(process_guid, server)
1664
+ )
1665
+ return response
1666
+
1667
+ async def _async_get_gov_action_process_graph(
1668
+ self, process_guid: str, server: str = None
1669
+ ) -> dict | str:
1670
+ """Retrieve the governance action process metadata element with the supplied unique
1671
+ identifier along with the flow definition describing its implementation. Async Version.
1672
+ Parameters
1673
+ ----------
1674
+ process_guid : str
1355
1675
  The process GUID to retrieve the graph for.
1356
1676
  server : str, optional
1357
1677
  The name of the server to retrieve the graph from. If not provided, the default server name will be used.
@@ -1372,115 +1692,143 @@ class AutomatedCuration(Client):
1372
1692
  server = self.server_name if server is None else server
1373
1693
  validate_guid(process_guid)
1374
1694
 
1375
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/"
1376
- f"governance-action-processes/{process_guid}/graph")
1695
+ url = (
1696
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/"
1697
+ f"governance-action-processes/{process_guid}/graph"
1698
+ )
1377
1699
 
1378
1700
  response = await self._async_make_request("POST", url)
1379
1701
  return response.json().get("element", "no actions")
1380
1702
 
1381
- def get_gov_action_process_graph(self, process_guid: str, server: str = None) -> dict | str:
1382
- """ Retrieve the governance action process metadata element with the supplied unique
1383
- identifier along with the flow definition describing its implementation.
1384
- Parameters
1385
- ----------
1386
- process_guid : str
1387
- The process GUID to retrieve the graph for.
1388
- server : str, optional
1389
- The name of the server to retrieve the graph from. If not provided, the default server name will be used.
1390
-
1391
- Returns
1392
- -------
1393
- dict or str
1394
- A dictionary representing the graph of the governance action process, or the string "no actions"
1395
- if no actions are found.
1396
- Raises:
1397
- ------
1398
- InvalidParameterException: If the API response indicates an error (non-200 status code),
1399
- this exception is raised with details from the response content.
1400
- PropertyServerException: If the API response indicates a server side error.
1401
- UserNotAuthorizedException:
1402
-
1403
- """
1703
+ def get_gov_action_process_graph(
1704
+ self, process_guid: str, server: str = None
1705
+ ) -> dict | str:
1706
+ """Retrieve the governance action process metadata element with the supplied unique
1707
+ identifier along with the flow definition describing its implementation.
1708
+ Parameters
1709
+ ----------
1710
+ process_guid : str
1711
+ The process GUID to retrieve the graph for.
1712
+ server : str, optional
1713
+ The name of the server to retrieve the graph from. If not provided, the default server name will be used.
1714
+
1715
+ Returns
1716
+ -------
1717
+ dict or str
1718
+ A dictionary representing the graph of the governance action process, or the string "no actions"
1719
+ if no actions are found.
1720
+ Raises:
1721
+ ------
1722
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
1723
+ this exception is raised with details from the response content.
1724
+ PropertyServerException: If the API response indicates a server side error.
1725
+ UserNotAuthorizedException:
1726
+
1727
+ """
1404
1728
  loop = asyncio.get_event_loop()
1405
- response = loop.run_until_complete(self._async_get_gov_action_process_graph(process_guid, server))
1729
+ response = loop.run_until_complete(
1730
+ self._async_get_gov_action_process_graph(process_guid, server)
1731
+ )
1406
1732
  return response
1407
1733
 
1408
- async def _async_get_gov_action_processes_by_name(self, name: str, server: str = None, start_from: int = None,
1409
- page_size: int = max_paging_size) -> list | str:
1410
- """ Retrieve the list of governance action process metadata elements with a matching qualified or display name.
1411
- There are no wildcards supported on this request. Async Version.
1412
-
1413
- Parameters
1414
- ----------
1415
- name : str
1416
- The name of the engine action to retrieve.
1417
- server : str, optional
1418
- The name of the server to retrieve the engine action from. If not provided, the default server specified
1419
- in the instance will be used.
1420
- start_from : int, optional
1421
- The index to start retrieving engine actions from. If not provided, the default value will be used.
1422
- page_size : int, optional
1423
- The maximum number of engine actions to retrieve in a single request. If not provided, the default
1424
- global maximum paging size will be used.
1425
-
1426
- Returns
1427
- -------
1428
- list of dict | str
1429
- A list of dictionaries representing the retrieved engine actions,
1430
- or "no actions" if no engine actions were found with the given name.
1431
- Raises:
1432
- ------
1433
- InvalidParameterException
1434
- PropertyServerException
1435
- UserNotAuthorizedException
1436
- """
1734
+ async def _async_get_gov_action_processes_by_name(
1735
+ self,
1736
+ name: str,
1737
+ server: str = None,
1738
+ start_from: int = None,
1739
+ page_size: int = max_paging_size,
1740
+ ) -> list | str:
1741
+ """Retrieve the list of governance action process metadata elements with a matching qualified or display name.
1742
+ There are no wildcards supported on this request. Async Version.
1743
+
1744
+ Parameters
1745
+ ----------
1746
+ name : str
1747
+ The name of the engine action to retrieve.
1748
+ server : str, optional
1749
+ The name of the server to retrieve the engine action from. If not provided, the default server specified
1750
+ in the instance will be used.
1751
+ start_from : int, optional
1752
+ The index to start retrieving engine actions from. If not provided, the default value will be used.
1753
+ page_size : int, optional
1754
+ The maximum number of engine actions to retrieve in a single request. If not provided, the default
1755
+ global maximum paging size will be used.
1756
+
1757
+ Returns
1758
+ -------
1759
+ list of dict | str
1760
+ A list of dictionaries representing the retrieved engine actions,
1761
+ or "no actions" if no engine actions were found with the given name.
1762
+ Raises:
1763
+ ------
1764
+ InvalidParameterException
1765
+ PropertyServerException
1766
+ UserNotAuthorizedException
1767
+ """
1437
1768
  server = self.server_name if server is None else server
1438
1769
  validate_name(name)
1439
1770
 
1440
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-processes/"
1441
- f"by-name?startFrom={start_from}&pageSize={page_size}")
1771
+ url = (
1772
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-processes/"
1773
+ f"by-name?startFrom={start_from}&pageSize={page_size}"
1774
+ )
1442
1775
  body = {"filter": name}
1443
1776
  response = await self._async_make_request("POST", url, body)
1444
1777
  return response.json().get("elements", "no actions")
1445
1778
 
1446
- def get_gov_action_processes_by_name(self, name: str, server: str = None, start_from: int = 0,
1447
- page_size: int = max_paging_size) -> list | str:
1448
- """ Retrieve the list of governance action process metadata elements with a matching qualified or display name.
1449
- There are no wildcards supported on this request.
1450
-
1451
- Parameters
1452
- ----------
1453
- name : str
1454
- The name of the engine action to retrieve.
1455
- server : str, optional
1456
- The name of the server to retrieve the engine action from. If not provided, the default server specified
1457
- in the instance will be used.
1458
- start_from : int, optional
1459
- The index to start retrieving engine actions from. If not provided, the default value will be used.
1460
- page_size : int, optional
1461
- The maximum number of engine actions to retrieve in a single request. If not provided, the default global
1462
- maximum paging size will be used.
1463
-
1464
- Returns
1465
- -------
1466
- list of dict | str
1467
- A list of dictionaries representing the retrieved engine actions,
1468
- or "no actions" if no engine actions were found with the given name.
1469
- Raises:
1470
- ------
1471
- InvalidParameterException
1472
- PropertyServerException
1473
- UserNotAuthorizedException
1474
- """
1779
+ def get_gov_action_processes_by_name(
1780
+ self,
1781
+ name: str,
1782
+ server: str = None,
1783
+ start_from: int = 0,
1784
+ page_size: int = max_paging_size,
1785
+ ) -> list | str:
1786
+ """Retrieve the list of governance action process metadata elements with a matching qualified or display name.
1787
+ There are no wildcards supported on this request.
1788
+
1789
+ Parameters
1790
+ ----------
1791
+ name : str
1792
+ The name of the engine action to retrieve.
1793
+ server : str, optional
1794
+ The name of the server to retrieve the engine action from. If not provided, the default server specified
1795
+ in the instance will be used.
1796
+ start_from : int, optional
1797
+ The index to start retrieving engine actions from. If not provided, the default value will be used.
1798
+ page_size : int, optional
1799
+ The maximum number of engine actions to retrieve in a single request. If not provided, the default global
1800
+ maximum paging size will be used.
1801
+
1802
+ Returns
1803
+ -------
1804
+ list of dict | str
1805
+ A list of dictionaries representing the retrieved engine actions,
1806
+ or "no actions" if no engine actions were found with the given name.
1807
+ Raises:
1808
+ ------
1809
+ InvalidParameterException
1810
+ PropertyServerException
1811
+ UserNotAuthorizedException
1812
+ """
1475
1813
  loop = asyncio.get_event_loop()
1476
1814
  response = loop.run_until_complete(
1477
- self._async_get_gov_action_processes_by_name(name, server, start_from, page_size))
1815
+ self._async_get_gov_action_processes_by_name(
1816
+ name, server, start_from, page_size
1817
+ )
1818
+ )
1478
1819
  return response
1479
1820
 
1480
- async def _async_find_gov_action_processes(self, search_string: str, server: str = None, starts_with: bool = False,
1481
- ends_with: bool = False, ignore_case: bool = False, start_from: int = 0,
1482
- page_size: int = max_paging_size) -> list | str:
1483
- """ Retrieve the list of governance action process metadata elements that contain the search string. Async ver.
1821
+ async def _async_find_gov_action_processes(
1822
+ self,
1823
+ search_string: str,
1824
+ server: str = None,
1825
+ starts_with: bool = False,
1826
+ ends_with: bool = False,
1827
+ ignore_case: bool = False,
1828
+ start_from: int = 0,
1829
+ page_size: int = max_paging_size,
1830
+ ) -> list | str:
1831
+ """Retrieve the list of governance action process metadata elements that contain the search string. Async ver.
1484
1832
 
1485
1833
  Parameters
1486
1834
  ----------
@@ -1525,9 +1873,11 @@ class AutomatedCuration(Client):
1525
1873
  ends_with_s = str(ends_with).lower()
1526
1874
  ignore_case_s = str(ignore_case).lower()
1527
1875
 
1528
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-processes/"
1529
- f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
1530
- f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}")
1876
+ url = (
1877
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-processes/"
1878
+ f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
1879
+ f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
1880
+ )
1531
1881
 
1532
1882
  if search_string:
1533
1883
  body = {"filter": search_string}
@@ -1537,10 +1887,17 @@ class AutomatedCuration(Client):
1537
1887
 
1538
1888
  return response.json().get("elements", "no actions")
1539
1889
 
1540
- def find_gov_action_processes(self, search_string: str = "*", server: str = None, starts_with: bool = False,
1541
- ends_with: bool = False, ignore_case: bool = False, start_from: int = 0,
1542
- page_size: int = max_paging_size) -> list | str:
1543
- """ Retrieve the list of governance action process metadata elements that contain the search string.
1890
+ def find_gov_action_processes(
1891
+ self,
1892
+ search_string: str = "*",
1893
+ server: str = None,
1894
+ starts_with: bool = False,
1895
+ ends_with: bool = False,
1896
+ ignore_case: bool = False,
1897
+ start_from: int = 0,
1898
+ page_size: int = max_paging_size,
1899
+ ) -> list | str:
1900
+ """Retrieve the list of governance action process metadata elements that contain the search string.
1544
1901
 
1545
1902
  Parameters
1546
1903
  ----------
@@ -1580,15 +1937,30 @@ class AutomatedCuration(Client):
1580
1937
 
1581
1938
  loop = asyncio.get_event_loop()
1582
1939
  response = loop.run_until_complete(
1583
- self._async_find_gov_action_processes(search_string, server, starts_with, ends_with, ignore_case,
1584
- start_from, page_size))
1940
+ self._async_find_gov_action_processes(
1941
+ search_string,
1942
+ server,
1943
+ starts_with,
1944
+ ends_with,
1945
+ ignore_case,
1946
+ start_from,
1947
+ page_size,
1948
+ )
1949
+ )
1585
1950
  return response
1586
1951
 
1587
- async def _async_initiate_gov_action_process(self, action_type_qualified_name: str, request_source_guids: [str],
1588
- action_targets: list, start_time: datetime, request_parameters: dict,
1589
- orig_service_name: str, orig_engine_name: str,
1590
- server: str = None) -> str:
1591
- """ Using the named governance action process as a template, initiate a chain of engine actions. Async version.
1952
+ async def _async_initiate_gov_action_process(
1953
+ self,
1954
+ action_type_qualified_name: str,
1955
+ request_source_guids: [str],
1956
+ action_targets: list,
1957
+ start_time: datetime,
1958
+ request_parameters: dict,
1959
+ orig_service_name: str,
1960
+ orig_engine_name: str,
1961
+ server: str = None,
1962
+ ) -> str:
1963
+ """Using the named governance action process as a template, initiate a chain of engine actions. Async version.
1592
1964
 
1593
1965
  Parameters
1594
1966
  ----------
@@ -1618,20 +1990,37 @@ class AutomatedCuration(Client):
1618
1990
  UserNotAuthorizedException
1619
1991
 
1620
1992
  """
1621
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-processes/"
1622
- f"initiate")
1623
- body = {"class": "GovernanceActionProcessRequestBody", "processQualifiedName": action_type_qualified_name,
1624
- "requestSourceGUIDs": request_source_guids, "actionTargets": action_targets,
1625
- "startTime": int(start_time.timestamp() * 1000), "requestParameters": request_parameters,
1626
- "originatorServiceName": orig_service_name, "originatorEngineName": orig_engine_name}
1993
+ server = self.server_name if server is None else server
1994
+ url = (
1995
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-processes/"
1996
+ f"initiate"
1997
+ )
1998
+ body = {
1999
+ "class": "GovernanceActionProcessRequestBody",
2000
+ "processQualifiedName": action_type_qualified_name,
2001
+ "requestSourceGUIDs": request_source_guids,
2002
+ "actionTargets": action_targets,
2003
+ "startTime": int(start_time.timestamp() * 1000),
2004
+ "requestParameters": request_parameters,
2005
+ "originatorServiceName": orig_service_name,
2006
+ "originatorEngineName": orig_engine_name,
2007
+ }
1627
2008
  new_body = body_slimmer(body)
1628
2009
  response = await self._async_make_request("POST", url, new_body)
1629
2010
  return response.json().get("guid", "Action not initiated")
1630
2011
 
1631
- def initiate_gov_action_process(self, action_type_qualified_name: str, request_source_guids: [str],
1632
- action_targets: [str], start_time: datetime, request_parameters: dict,
1633
- orig_service_name: str, orig_engine_name: str, server: str = None) -> str:
1634
- """ Using the named governance action process as a template, initiate a chain of engine actions.
2012
+ def initiate_gov_action_process(
2013
+ self,
2014
+ action_type_qualified_name: str,
2015
+ request_source_guids: [str],
2016
+ action_targets: [str],
2017
+ start_time: datetime,
2018
+ request_parameters: dict,
2019
+ orig_service_name: str,
2020
+ orig_engine_name: str,
2021
+ server: str = None,
2022
+ ) -> str:
2023
+ """Using the named governance action process as a template, initiate a chain of engine actions.
1635
2024
 
1636
2025
  Parameters
1637
2026
  ----------
@@ -1665,13 +2054,23 @@ class AutomatedCuration(Client):
1665
2054
  """
1666
2055
  loop = asyncio.get_event_loop()
1667
2056
  response = loop.run_until_complete(
1668
- self._async_initiate_gov_action_process(action_type_qualified_name, request_source_guids, action_targets,
1669
- start_time, request_parameters, orig_service_name, orig_engine_name,
1670
- server))
2057
+ self._async_initiate_gov_action_process(
2058
+ action_type_qualified_name,
2059
+ request_source_guids,
2060
+ action_targets,
2061
+ start_time,
2062
+ request_parameters,
2063
+ orig_service_name,
2064
+ orig_engine_name,
2065
+ server,
2066
+ )
2067
+ )
1671
2068
  return response
1672
2069
 
1673
- async def _async_get_gov_action_types_by_guid(self, gov_action_type_guid: str, server: str = None) -> dict | str:
1674
- """ Retrieve the governance action type metadata element with the supplied unique identifier. Async version.
2070
+ async def _async_get_gov_action_types_by_guid(
2071
+ self, gov_action_type_guid: str, server: str = None
2072
+ ) -> dict | str:
2073
+ """Retrieve the governance action type metadata element with the supplied unique identifier. Async version.
1675
2074
 
1676
2075
  Parameters:
1677
2076
  ----------
@@ -1693,14 +2092,18 @@ class AutomatedCuration(Client):
1693
2092
  server = self.server_name if server is None else server
1694
2093
  validate_guid(gov_action_type_guid)
1695
2094
 
1696
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/"
1697
- f"governance-action-types/{gov_action_type_guid}")
2095
+ url = (
2096
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/"
2097
+ f"governance-action-types/{gov_action_type_guid}"
2098
+ )
1698
2099
 
1699
2100
  response = await self._async_make_request("GET", url)
1700
2101
  return response.json().get("element", "no actions")
1701
2102
 
1702
- def get_gov_action_types_by_guid(self, gov_action_type_guid: str, server: str = None) -> dict | str:
1703
- """ Retrieve the governance action type metadata element with the supplied unique identifier.
2103
+ def get_gov_action_types_by_guid(
2104
+ self, gov_action_type_guid: str, server: str = None
2105
+ ) -> dict | str:
2106
+ """Retrieve the governance action type metadata element with the supplied unique identifier.
1704
2107
 
1705
2108
  Parameters:
1706
2109
  ----------
@@ -1720,54 +2123,28 @@ class AutomatedCuration(Client):
1720
2123
  UserNotAuthorizedException:
1721
2124
  """
1722
2125
  loop = asyncio.get_event_loop()
1723
- response = loop.run_until_complete(self._async_get_gov_action_types_by_guid(gov_action_type_guid, server))
2126
+ response = loop.run_until_complete(
2127
+ self._async_get_gov_action_types_by_guid(gov_action_type_guid, server)
2128
+ )
1724
2129
  return response
1725
2130
 
1726
- async def _async_get_gov_action_types_by_name(self, action_type_name, server: str = None, start_from: int = 0,
1727
- page_size: int = max_paging_size) -> list | str:
1728
- """ Retrieve the list of governance action type metadata elements with a matching qualified or display name.
1729
- There are no wildcards supported on this request. Async version.
1730
-
1731
- Parameters:
1732
- ----------
1733
- action_type_name: str
1734
- The name of the governance action type to retrieve.
1735
- server: str, optional
1736
- The name of the server. If None, will use the default server specified in the instance
1737
- will be used.
1738
- Returns:
1739
- -------
1740
- dict: The JSON representation of the governance action type element.
1741
-
1742
- Raises:
1743
- ------
1744
- InvalidParameterException: If the API response indicates an error (non-200 status code),
1745
- this exception is raised with details from the response content.
1746
- PropertyServerException: If the API response indicates a server side error.
1747
- UserNotAuthorizedException:
1748
- """
1749
- server = self.server_name if server is None else server
1750
- validate_name(action_type_name)
1751
-
1752
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/"
1753
- f"governance-action-types/by-name?startFrom={start_from}&pageSize={page_size}")
1754
-
1755
- body = {"filter": action_type_name}
1756
-
1757
- response = await self._async_make_request("POST", url, body)
1758
- return response.json().get("elements", "no actions")
1759
-
1760
- def get_gov_action_types_by_name(self, action_type_name, server: str = None, start_from: int = 0,
1761
- page_size: int = max_paging_size) -> list | str:
1762
- """ Retrieve the list of governance action type metadata elements with a matching qualified or display name.
1763
- There are no wildcards supported on this request. Async version.
2131
+ async def _async_get_gov_action_types_by_name(
2132
+ self,
2133
+ action_type_name,
2134
+ server: str = None,
2135
+ start_from: int = 0,
2136
+ page_size: int = max_paging_size,
2137
+ ) -> list | str:
2138
+ """Retrieve the list of governance action type metadata elements with a matching qualified or display name.
2139
+ There are no wildcards supported on this request. Async version.
1764
2140
 
1765
2141
  Parameters:
1766
2142
  ----------
1767
2143
  action_type_name: str
1768
2144
  The name of the governance action type to retrieve.
1769
2145
  server: str, optional
1770
- The name of the server. If None, will use the default server specified in the instance will be used.
2146
+ The name of the server. If None, will use the default server specified in the instance
2147
+ will be used.
1771
2148
  Returns:
1772
2149
  -------
1773
2150
  dict: The JSON representation of the governance action type element.
@@ -1779,51 +2156,101 @@ class AutomatedCuration(Client):
1779
2156
  PropertyServerException: If the API response indicates a server side error.
1780
2157
  UserNotAuthorizedException:
1781
2158
  """
2159
+ server = self.server_name if server is None else server
2160
+ validate_name(action_type_name)
2161
+
2162
+ url = (
2163
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/"
2164
+ f"governance-action-types/by-name?startFrom={start_from}&pageSize={page_size}"
2165
+ )
2166
+
2167
+ body = {"filter": action_type_name}
2168
+
2169
+ response = await self._async_make_request("POST", url, body)
2170
+ return response.json().get("elements", "no actions")
2171
+
2172
+ def get_gov_action_types_by_name(
2173
+ self,
2174
+ action_type_name,
2175
+ server: str = None,
2176
+ start_from: int = 0,
2177
+ page_size: int = max_paging_size,
2178
+ ) -> list | str:
2179
+ """Retrieve the list of governance action type metadata elements with a matching qualified or display name.
2180
+ There are no wildcards supported on this request. Async version.
2181
+
2182
+ Parameters:
2183
+ ----------
2184
+ action_type_name: str
2185
+ The name of the governance action type to retrieve.
2186
+ server: str, optional
2187
+ The name of the server. If None, will use the default server specified in the instance will be used.
2188
+ Returns:
2189
+ -------
2190
+ dict: The JSON representation of the governance action type element.
2191
+
2192
+ Raises:
2193
+ ------
2194
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
2195
+ this exception is raised with details from the response content.
2196
+ PropertyServerException: If the API response indicates a server side error.
2197
+ UserNotAuthorizedException:
2198
+ """
1782
2199
  loop = asyncio.get_event_loop()
1783
2200
  response = loop.run_until_complete(
1784
- self._async_get_gov_action_types_by_name(action_type_name, server, start_from, page_size))
2201
+ self._async_get_gov_action_types_by_name(
2202
+ action_type_name, server, start_from, page_size
2203
+ )
2204
+ )
1785
2205
  return response
1786
2206
 
1787
- async def _async_find_gov_action_types(self, search_string: str = "*", server: str = None,
1788
- starts_with: bool = False, ends_with: bool = False, ignore_case: bool = True,
1789
- start_from: int = 0, page_size: int = max_paging_size) -> list | str:
1790
- """ Retrieve the list of governance action type metadata elements that contain the search string.
1791
- Async Version.
2207
+ async def _async_find_gov_action_types(
2208
+ self,
2209
+ search_string: str = "*",
2210
+ server: str = None,
2211
+ starts_with: bool = False,
2212
+ ends_with: bool = False,
2213
+ ignore_case: bool = True,
2214
+ start_from: int = 0,
2215
+ page_size: int = max_paging_size,
2216
+ ) -> list | str:
2217
+ """Retrieve the list of governance action type metadata elements that contain the search string.
2218
+ Async Version.
1792
2219
 
1793
- Parameters
1794
- ----------
1795
- search_string : str
1796
- The string used for searching engine actions by name.
2220
+ Parameters
2221
+ ----------
2222
+ search_string : str
2223
+ The string used for searching engine actions by name.
1797
2224
 
1798
- server : str, optional
1799
- The name of the server. If None, will use the default server specified in the instance will be used.
2225
+ server : str, optional
2226
+ The name of the server. If None, will use the default server specified in the instance will be used.
1800
2227
 
1801
- starts_with : bool, optional
1802
- Whether to search engine actions that start with the given search string. Default is False.
2228
+ starts_with : bool, optional
2229
+ Whether to search engine actions that start with the given search string. Default is False.
1803
2230
 
1804
- ends_with : bool, optional
1805
- Whether to search engine actions that end with the given search string. Default is False.
2231
+ ends_with : bool, optional
2232
+ Whether to search engine actions that end with the given search string. Default is False.
1806
2233
 
1807
- ignore_case : bool, optional
1808
- Whether to ignore case while searching engine actions. Default is False.
2234
+ ignore_case : bool, optional
2235
+ Whether to ignore case while searching engine actions. Default is False.
1809
2236
 
1810
- start_from : int, optional
1811
- The index from which to start fetching the engine actions. Default is 0.
2237
+ start_from : int, optional
2238
+ The index from which to start fetching the engine actions. Default is 0.
1812
2239
 
1813
- page_size : int, optional
1814
- The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
2240
+ page_size : int, optional
2241
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
1815
2242
 
1816
- Returns
1817
- -------
1818
- List[dict] or str
1819
- A list of dictionaries representing the governance action types found based on the search query.
1820
- If no actions are found, returns the string "no action types".
2243
+ Returns
2244
+ -------
2245
+ List[dict] or str
2246
+ A list of dictionaries representing the governance action types found based on the search query.
2247
+ If no actions are found, returns the string "no action types".
1821
2248
 
1822
- Raises
1823
- ------
1824
- InvalidParameterException
1825
- PropertyServerException
1826
- UserNotAuthorizedException
2249
+ Raises
2250
+ ------
2251
+ InvalidParameterException
2252
+ PropertyServerException
2253
+ UserNotAuthorizedException
1827
2254
 
1828
2255
  """
1829
2256
 
@@ -1835,65 +2262,89 @@ class AutomatedCuration(Client):
1835
2262
  ends_with_s = str(ends_with).lower()
1836
2263
  ignore_case_s = str(ignore_case).lower()
1837
2264
 
1838
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
1839
- f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
1840
- f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}")
2265
+ url = (
2266
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2267
+ f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
2268
+ f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
2269
+ )
1841
2270
  body = {"filter": search_string}
1842
2271
  response = await self._async_make_request("POST", url, body)
1843
2272
  return response.json().get("elements", "no action types")
1844
2273
 
1845
- def find_gov_action_types(self, search_string: str = "*", server: str = None, starts_with: bool = False,
1846
- ends_with: bool = False, ignore_case: bool = False, start_from: int = 0,
1847
- page_size: int = max_paging_size) -> list | str:
1848
- """ Retrieve the list of governance action type metadata elements that contain the search string.
2274
+ def find_gov_action_types(
2275
+ self,
2276
+ search_string: str = "*",
2277
+ server: str = None,
2278
+ starts_with: bool = False,
2279
+ ends_with: bool = False,
2280
+ ignore_case: bool = False,
2281
+ start_from: int = 0,
2282
+ page_size: int = max_paging_size,
2283
+ ) -> list | str:
2284
+ """Retrieve the list of governance action type metadata elements that contain the search string.
1849
2285
 
1850
- Parameters
1851
- ----------
1852
- search_string : str
1853
- The string used for searching engine actions by name.
2286
+ Parameters
2287
+ ----------
2288
+ search_string : str
2289
+ The string used for searching engine actions by name.
1854
2290
 
1855
- server : str, optional
1856
- The name of the server. If None, will use the default server specified in the instance will be used.
2291
+ server : str, optional
2292
+ The name of the server. If None, will use the default server specified in the instance will be used.
1857
2293
 
1858
- starts_with : bool, optional
1859
- Whether to search engine actions that start with the given search string. Default is False.
2294
+ starts_with : bool, optional
2295
+ Whether to search engine actions that start with the given search string. Default is False.
1860
2296
 
1861
- ends_with : bool, optional
1862
- Whether to search engine actions that end with the given search string. Default is False.
2297
+ ends_with : bool, optional
2298
+ Whether to search engine actions that end with the given search string. Default is False.
1863
2299
 
1864
- ignore_case : bool, optional
1865
- Whether to ignore case while searching engine actions. Default is False.
2300
+ ignore_case : bool, optional
2301
+ Whether to ignore case while searching engine actions. Default is False.
1866
2302
 
1867
- start_from : int, optional
1868
- The index from which to start fetching the engine actions. Default is 0.
2303
+ start_from : int, optional
2304
+ The index from which to start fetching the engine actions. Default is 0.
1869
2305
 
1870
- page_size : int, optional
1871
- The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
2306
+ page_size : int, optional
2307
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
1872
2308
 
1873
- Returns
1874
- -------
1875
- List[dict] or str
1876
- A list of dictionaries representing the governance action types found based on the search query.
1877
- If no actions are found, returns the string "no action types".
2309
+ Returns
2310
+ -------
2311
+ List[dict] or str
2312
+ A list of dictionaries representing the governance action types found based on the search query.
2313
+ If no actions are found, returns the string "no action types".
1878
2314
 
1879
- Raises
1880
- ------
1881
- InvalidParameterException
1882
- PropertyServerException
1883
- UserNotAuthorizedException
2315
+ Raises
2316
+ ------
2317
+ InvalidParameterException
2318
+ PropertyServerException
2319
+ UserNotAuthorizedException
1884
2320
 
1885
2321
  """
1886
2322
  loop = asyncio.get_event_loop()
1887
2323
  response = loop.run_until_complete(
1888
- self._async_find_gov_action_types(search_string, server, starts_with, ends_with, ignore_case, start_from,
1889
- page_size))
2324
+ self._async_find_gov_action_types(
2325
+ search_string,
2326
+ server,
2327
+ starts_with,
2328
+ ends_with,
2329
+ ignore_case,
2330
+ start_from,
2331
+ page_size,
2332
+ )
2333
+ )
1890
2334
  return response
1891
2335
 
1892
- async def _async_initiate_gov_action_type(self, action_type_qualified_name: str, request_source_guids: [str],
1893
- action_targets: list, start_time: datetime = None,
1894
- request_parameters: dict = None, orig_service_name: str = None,
1895
- orig_engine_name: str = None, server: str = None) -> str:
1896
- """ Using the named governance action type as a template, initiate an engine action. Async version.
2336
+ async def _async_initiate_gov_action_type(
2337
+ self,
2338
+ action_type_qualified_name: str,
2339
+ request_source_guids: [str],
2340
+ action_targets: list,
2341
+ start_time: datetime = None,
2342
+ request_parameters: dict = None,
2343
+ orig_service_name: str = None,
2344
+ orig_engine_name: str = None,
2345
+ server: str = None,
2346
+ ) -> str:
2347
+ """Using the named governance action type as a template, initiate an engine action. Async version.
1897
2348
 
1898
2349
  Parameters
1899
2350
  ----------
@@ -1926,23 +2377,37 @@ class AutomatedCuration(Client):
1926
2377
 
1927
2378
  """
1928
2379
  server = self.server_name if server is None else server
1929
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
1930
- f"initiate")
2380
+ url = (
2381
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2382
+ f"initiate"
2383
+ )
1931
2384
  start = int(start_time.timestamp() * 1000) if start_time else None
1932
- body = {"class": "InitiateGovernanceActionTypeRequestBody",
1933
- "governanceActionTypeQualifiedName": action_type_qualified_name,
1934
- "requestSourceGUIDs": request_source_guids, "actionTargets": action_targets, "startDate": start,
1935
- "requestParameters": request_parameters, "originatorServiceName": orig_service_name,
1936
- "originatorEngineName": orig_engine_name}
2385
+ body = {
2386
+ "class": "InitiateGovernanceActionTypeRequestBody",
2387
+ "governanceActionTypeQualifiedName": action_type_qualified_name,
2388
+ "requestSourceGUIDs": request_source_guids,
2389
+ "actionTargets": action_targets,
2390
+ "startDate": start,
2391
+ "requestParameters": request_parameters,
2392
+ "originatorServiceName": orig_service_name,
2393
+ "originatorEngineName": orig_engine_name,
2394
+ }
1937
2395
  new_body = body_slimmer(body)
1938
2396
  response = await self._async_make_request("POST", url, new_body)
1939
2397
  return response.json().get("guid", "Action not initiated")
1940
2398
 
1941
- def initiate_gov_action_type(self, action_type_qualified_name: str, request_source_guids: [str],
1942
- action_targets: list, start_time: datetime = None, request_parameters: dict = None,
1943
- orig_service_name: str = None, orig_engine_name: str = None,
1944
- server: str = None) -> str:
1945
- """ Using the named governance action type as a template, initiate an engine action.
2399
+ def initiate_gov_action_type(
2400
+ self,
2401
+ action_type_qualified_name: str,
2402
+ request_source_guids: [str],
2403
+ action_targets: list,
2404
+ start_time: datetime = None,
2405
+ request_parameters: dict = None,
2406
+ orig_service_name: str = None,
2407
+ orig_engine_name: str = None,
2408
+ server: str = None,
2409
+ ) -> str:
2410
+ """Using the named governance action type as a template, initiate an engine action.
1946
2411
 
1947
2412
  Parameters
1948
2413
  ----------
@@ -1975,57 +2440,98 @@ class AutomatedCuration(Client):
1975
2440
  """
1976
2441
  loop = asyncio.get_event_loop()
1977
2442
  response = loop.run_until_complete(
1978
- self._async_initiate_gov_action_type(action_type_qualified_name, request_source_guids, action_targets,
1979
- start_time, request_parameters, orig_service_name, orig_engine_name,
1980
- server))
2443
+ self._async_initiate_gov_action_type(
2444
+ action_type_qualified_name,
2445
+ request_source_guids,
2446
+ action_targets,
2447
+ start_time,
2448
+ request_parameters,
2449
+ orig_service_name,
2450
+ orig_engine_name,
2451
+ server,
2452
+ )
2453
+ )
1981
2454
  return response
1982
2455
 
1983
2456
  #
1984
2457
  # Initiate surveys
1985
2458
  #
1986
2459
 
1987
- async def _async_initiate_postgres_database_survey(self, postgres_database_guid: str, server: str = None) -> str:
1988
- """ Initiate a postgres database survey"""
2460
+ async def _async_initiate_postgres_database_survey(
2461
+ self, postgres_database_guid: str, server: str = None
2462
+ ) -> str:
2463
+ """Initiate a postgres database survey"""
1989
2464
  server = self.server_name if server is None else server
1990
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
1991
- f"initiate")
1992
-
1993
- body = {"class": "InitiateGovernanceActionTypeRequestBody",
1994
- "governanceActionTypeQualifiedName": "AssetSurvey-postgres-database", "actionTargets": [
1995
- {"class": "NewActionTarget", "actionTargetName": "serverToSurvey",
1996
- "actionTargetGUID": postgres_database_guid}]}
2465
+ url = (
2466
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2467
+ f"initiate"
2468
+ )
2469
+
2470
+ body = {
2471
+ "class": "InitiateGovernanceActionTypeRequestBody",
2472
+ "governanceActionTypeQualifiedName": "AssetSurvey-postgres-database",
2473
+ "actionTargets": [
2474
+ {
2475
+ "class": "NewActionTarget",
2476
+ "actionTargetName": "serverToSurvey",
2477
+ "actionTargetGUID": postgres_database_guid,
2478
+ }
2479
+ ],
2480
+ }
1997
2481
  response = await self._async_make_request("POST", url, body)
1998
2482
  return response.json().get("guid", "Action not initiated")
1999
2483
 
2000
- def initiate_postgres_database_survey(self, postgres_database_guid: str, server: str = None) -> str:
2001
- """ Initiate a postgres database survey"""
2484
+ def initiate_postgres_database_survey(
2485
+ self, postgres_database_guid: str, server: str = None
2486
+ ) -> str:
2487
+ """Initiate a postgres database survey"""
2002
2488
  loop = asyncio.get_event_loop()
2003
- response = loop.run_until_complete(self._async_initiate_postgres_server_survey(postgres_database_guid, server))
2489
+ response = loop.run_until_complete(
2490
+ self._async_initiate_postgres_server_survey(postgres_database_guid, server)
2491
+ )
2004
2492
  return response
2005
2493
 
2006
- async def _async_initiate_postgres_server_survey(self, postgres_server_guid: str, server: str = None) -> str:
2007
- """ Initiate a postgres server survey - Async version"""
2494
+ async def _async_initiate_postgres_server_survey(
2495
+ self, postgres_server_guid: str, server: str = None
2496
+ ) -> str:
2497
+ """Initiate a postgres server survey - Async version"""
2008
2498
  server = self.server_name if server is None else server
2009
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2010
- f"initiate")
2011
-
2012
- body = {"class": "InitiateGovernanceActionTypeRequestBody",
2013
- "governanceActionTypeQualifiedName": "AssetSurvey:survey-postgres-server", "actionTargets": [
2014
- {"class": "NewActionTarget", "actionTargetName": "serverToSurvey",
2015
- "actionTargetGUID": postgres_server_guid}]}
2499
+ url = (
2500
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2501
+ f"initiate"
2502
+ )
2503
+
2504
+ body = {
2505
+ "class": "InitiateGovernanceActionTypeRequestBody",
2506
+ "governanceActionTypeQualifiedName": "AssetSurvey:survey-postgres-server",
2507
+ "actionTargets": [
2508
+ {
2509
+ "class": "NewActionTarget",
2510
+ "actionTargetName": "serverToSurvey",
2511
+ "actionTargetGUID": postgres_server_guid,
2512
+ }
2513
+ ],
2514
+ }
2016
2515
  response = await self._async_make_request("POST", url, body)
2017
2516
  return response.json().get("guid", "Action not initiated")
2018
2517
 
2019
- def initiate_postgres_server_survey(self, postgres_server_guid: str, server: str = None) -> str:
2020
- """ Initiate a postgres server survey"""
2518
+ def initiate_postgres_server_survey(
2519
+ self, postgres_server_guid: str, server: str = None
2520
+ ) -> str:
2521
+ """Initiate a postgres server survey"""
2021
2522
  loop = asyncio.get_event_loop()
2022
- response = loop.run_until_complete(self._async_initiate_postgres_server_survey(postgres_server_guid, server))
2523
+ response = loop.run_until_complete(
2524
+ self._async_initiate_postgres_server_survey(postgres_server_guid, server)
2525
+ )
2023
2526
  return response
2024
2527
 
2025
- async def _async_initiate_file_folder_survey(self, file_folder_guid: str,
2026
- survey_name: str = "AssetSurvey:survey-folder",
2027
- server: str = None) -> str:
2028
- """ Initiate a file folder survey - async version
2528
+ async def _async_initiate_file_folder_survey(
2529
+ self,
2530
+ file_folder_guid: str,
2531
+ survey_name: str = "AssetSurvey:survey-folder",
2532
+ server: str = None,
2533
+ ) -> str:
2534
+ """Initiate a file folder survey - async version
2029
2535
 
2030
2536
  Parameters:
2031
2537
  ----------
@@ -2058,18 +2564,32 @@ class AutomatedCuration(Client):
2058
2564
  - AssetSurvey:survey-all-folders-and-files
2059
2565
  """
2060
2566
  server = self.server_name if server is None else server
2061
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2062
- f"initiate")
2063
-
2064
- body = {"class": "InitiateGovernanceActionTypeRequestBody", "governanceActionTypeQualifiedName": survey_name,
2065
- "actionTargets": [{"class": "NewActionTarget", "actionTargetName": "folderToSurvey",
2066
- "actionTargetGUID": file_folder_guid}]}
2567
+ url = (
2568
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2569
+ f"initiate"
2570
+ )
2571
+
2572
+ body = {
2573
+ "class": "InitiateGovernanceActionTypeRequestBody",
2574
+ "governanceActionTypeQualifiedName": survey_name,
2575
+ "actionTargets": [
2576
+ {
2577
+ "class": "NewActionTarget",
2578
+ "actionTargetName": "folderToSurvey",
2579
+ "actionTargetGUID": file_folder_guid,
2580
+ }
2581
+ ],
2582
+ }
2067
2583
  response = await self._async_make_request("POST", url, body)
2068
2584
  return response.json().get("guid", "Action not initiated")
2069
2585
 
2070
- def initiate_file_folder_survey(self, file_folder_guid: str, survey_name: str = "AssetSurvey:survey-folder",
2071
- server: str = None) -> str:
2072
- """ Initiate a file folder survey - async version
2586
+ def initiate_file_folder_survey(
2587
+ self,
2588
+ file_folder_guid: str,
2589
+ survey_name: str = "AssetSurvey:survey-folder",
2590
+ server: str = None,
2591
+ ) -> str:
2592
+ """Initiate a file folder survey - async version
2073
2593
 
2074
2594
  Parameters:
2075
2595
  ----------
@@ -2105,29 +2625,48 @@ class AutomatedCuration(Client):
2105
2625
  """
2106
2626
  loop = asyncio.get_event_loop()
2107
2627
  response = loop.run_until_complete(
2108
- self._async_initiate_file_folder_survey(file_folder_guid, survey_name, server))
2628
+ self._async_initiate_file_folder_survey(
2629
+ file_folder_guid, survey_name, server
2630
+ )
2631
+ )
2109
2632
  return response
2110
2633
 
2111
- async def _async_initiate_file_survey(self, file_guid: str, server: str = None) -> str:
2112
- """ Initiate a file survey - async version"""
2634
+ async def _async_initiate_file_survey(
2635
+ self, file_guid: str, server: str = None
2636
+ ) -> str:
2637
+ """Initiate a file survey - async version"""
2113
2638
  server = self.server_name if server is None else server
2114
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2115
- f"initiate")
2116
-
2117
- body = {"class": "InitiateGovernanceActionTypeRequestBody",
2118
- "governanceActionTypeQualifiedName": "AssetSurvey:survey-data-file", "actionTargets": [
2119
- {"class": "NewActionTarget", "actionTargetName": "fileToSurvey", "actionTargetGUID": file_guid}]}
2639
+ url = (
2640
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2641
+ f"initiate"
2642
+ )
2643
+
2644
+ body = {
2645
+ "class": "InitiateGovernanceActionTypeRequestBody",
2646
+ "governanceActionTypeQualifiedName": "AssetSurvey:survey-data-file",
2647
+ "actionTargets": [
2648
+ {
2649
+ "class": "NewActionTarget",
2650
+ "actionTargetName": "fileToSurvey",
2651
+ "actionTargetGUID": file_guid,
2652
+ }
2653
+ ],
2654
+ }
2120
2655
  response = await self._async_make_request("POST", url, body)
2121
2656
  return response.json().get("guid", "Action not initiated")
2122
2657
 
2123
2658
  def initiate_file_survey(self, file_guid: str, server: str = None) -> str:
2124
- """ Initiate a file survey """
2659
+ """Initiate a file survey"""
2125
2660
  loop = asyncio.get_event_loop()
2126
- response = loop.run_until_complete(self._async_initiate_file_survey(file_guid, server))
2661
+ response = loop.run_until_complete(
2662
+ self._async_initiate_file_survey(file_guid, server)
2663
+ )
2127
2664
  return response
2128
2665
 
2129
- async def _async_initiate_kafka_server_survey(self, kafka_server_guid: str, server: str = None) -> str:
2130
- """ Initiate survey of a kafka server. Async Version.
2666
+ async def _async_initiate_kafka_server_survey(
2667
+ self, kafka_server_guid: str, server: str = None
2668
+ ) -> str:
2669
+ """Initiate survey of a kafka server. Async Version.
2131
2670
  Parameters
2132
2671
  ----------
2133
2672
  kafka_server_guid : str
@@ -2143,38 +2682,53 @@ class AutomatedCuration(Client):
2143
2682
 
2144
2683
  """
2145
2684
  server = self.server_name if server is None else server
2146
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2147
- f"initiate")
2148
-
2149
- body = {"class": "InitiateGovernanceActionTypeRequestBody",
2150
- "governanceActionTypeQualifiedName": "AssetSurvey:survey-kafka-server", "actionTargets": [
2151
- {"class": "NewActionTarget", "actionTargetName": "serverToSurvey",
2152
- "actionTargetGUID": kafka_server_guid}]}
2685
+ url = (
2686
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2687
+ f"initiate"
2688
+ )
2689
+
2690
+ body = {
2691
+ "class": "InitiateGovernanceActionTypeRequestBody",
2692
+ "governanceActionTypeQualifiedName": "AssetSurvey:survey-kafka-server",
2693
+ "actionTargets": [
2694
+ {
2695
+ "class": "NewActionTarget",
2696
+ "actionTargetName": "serverToSurvey",
2697
+ "actionTargetGUID": kafka_server_guid,
2698
+ }
2699
+ ],
2700
+ }
2153
2701
  response = await self._async_make_request("POST", url, body)
2154
2702
  return response.json().get("guid", "Action not initiated")
2155
2703
 
2156
- def initiate_kafka_server_survey(self, kafka_server_guid: str, server: str = None) -> str:
2157
- """ Initiate survey of a kafka server.
2158
- Parameters
2159
- ----------
2160
- kafka_server_guid : str
2161
- The GUID of the Kafka server to be surveyed.
2704
+ def initiate_kafka_server_survey(
2705
+ self, kafka_server_guid: str, server: str = None
2706
+ ) -> str:
2707
+ """Initiate survey of a kafka server.
2708
+ Parameters
2709
+ ----------
2710
+ kafka_server_guid : str
2711
+ The GUID of the Kafka server to be surveyed.
2162
2712
 
2163
- server : str, optional
2164
- The name of the server. If not provided, the default server name is used.
2713
+ server : str, optional
2714
+ The name of the server. If not provided, the default server name is used.
2165
2715
 
2166
- Returns
2167
- -------
2168
- str
2169
- The GUID of the initiated action or "Action not initiated" if the action was not initiated.
2716
+ Returns
2717
+ -------
2718
+ str
2719
+ The GUID of the initiated action or "Action not initiated" if the action was not initiated.
2170
2720
 
2171
- """
2721
+ """
2172
2722
  loop = asyncio.get_event_loop()
2173
- response = loop.run_until_complete(self._async_initiate_kafka_server_survey(kafka_server_guid, server))
2723
+ response = loop.run_until_complete(
2724
+ self._async_initiate_kafka_server_survey(kafka_server_guid, server)
2725
+ )
2174
2726
  return response
2175
2727
 
2176
- async def _async_initiate_uc_server_survey(self, uc_server_guid: str, server: str = None) -> str:
2177
- """ Initiate survey of a Unity Catalog server. Async Version.
2728
+ async def _async_initiate_uc_server_survey(
2729
+ self, uc_server_guid: str, server: str = None
2730
+ ) -> str:
2731
+ """Initiate survey of a Unity Catalog server. Async Version.
2178
2732
  Parameters
2179
2733
  ----------
2180
2734
  uc_server_guid : str
@@ -2190,17 +2744,27 @@ class AutomatedCuration(Client):
2190
2744
 
2191
2745
  """
2192
2746
  server = self.server_name if server is None else server
2193
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2194
- f"initiate")
2195
-
2196
- body = {"class": "InitiateGovernanceActionTypeRequestBody",
2197
- "governanceActionTypeQualifiedName": "AssetSurvey:survey-unity-catalog-server", "actionTargets": [
2198
- {"class": "NewActionTarget", "actionTargetName": "serverToSurvey", "actionTargetGUID": uc_server_guid}]}
2747
+ url = (
2748
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2749
+ f"initiate"
2750
+ )
2751
+
2752
+ body = {
2753
+ "class": "InitiateGovernanceActionTypeRequestBody",
2754
+ "governanceActionTypeQualifiedName": "AssetSurvey:survey-unity-catalog-server",
2755
+ "actionTargets": [
2756
+ {
2757
+ "class": "NewActionTarget",
2758
+ "actionTargetName": "serverToSurvey",
2759
+ "actionTargetGUID": uc_server_guid,
2760
+ }
2761
+ ],
2762
+ }
2199
2763
  response = await self._async_make_request("POST", url, body)
2200
2764
  return response.json().get("guid", "Action not initiated")
2201
2765
 
2202
2766
  def initiate_uc_server_survey(self, uc_server_guid: str, server: str = None) -> str:
2203
- """ Initiate survey of a Unity Catalog server. Async Version.
2767
+ """Initiate survey of a Unity Catalog server. Async Version.
2204
2768
  Parameters
2205
2769
  ----------
2206
2770
  uc_server_guid : str
@@ -2216,11 +2780,15 @@ class AutomatedCuration(Client):
2216
2780
 
2217
2781
  """
2218
2782
  loop = asyncio.get_event_loop()
2219
- response = loop.run_until_complete(self._async_initiate_uc_server_survey(uc_server_guid, server))
2783
+ response = loop.run_until_complete(
2784
+ self._async_initiate_uc_server_survey(uc_server_guid, server)
2785
+ )
2220
2786
  return response
2221
2787
 
2222
- async def _async_initiate_uc_schema_survey(self, uc_schema_guid: str, server: str = None) -> str:
2223
- """ Initiate survey of a Unity Catalog schema. Async Version.
2788
+ async def _async_initiate_uc_schema_survey(
2789
+ self, uc_schema_guid: str, server: str = None
2790
+ ) -> str:
2791
+ """Initiate survey of a Unity Catalog schema. Async Version.
2224
2792
  Parameters
2225
2793
  ----------
2226
2794
  uc_schema_guid : str
@@ -2236,17 +2804,27 @@ class AutomatedCuration(Client):
2236
2804
 
2237
2805
  """
2238
2806
  server = self.server_name if server is None else server
2239
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2240
- f"initiate")
2241
-
2242
- body = {"class": "InitiateGovernanceActionTypeRequestBody",
2243
- "governanceActionTypeQualifiedName": "AssetSurvey:survey-unity-catalog-schema", "actionTargets": [
2244
- {"class": "NewActionTarget", "actionTargetName": "serverToSurvey", "actionTargetGUID": uc_schema_guid}]}
2807
+ url = (
2808
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-action-types/"
2809
+ f"initiate"
2810
+ )
2811
+
2812
+ body = {
2813
+ "class": "InitiateGovernanceActionTypeRequestBody",
2814
+ "governanceActionTypeQualifiedName": "AssetSurvey:survey-unity-catalog-schema",
2815
+ "actionTargets": [
2816
+ {
2817
+ "class": "NewActionTarget",
2818
+ "actionTargetName": "serverToSurvey",
2819
+ "actionTargetGUID": uc_schema_guid,
2820
+ }
2821
+ ],
2822
+ }
2245
2823
  response = await self._async_make_request("POST", url, body)
2246
2824
  return response.json().get("guid", "Action not initiated")
2247
2825
 
2248
2826
  def initiate_uc_schema_survey(self, uc_schema_guid: str, server: str = None) -> str:
2249
- """ Initiate survey of a Unity Catalog schema. Async Version.
2827
+ """Initiate survey of a Unity Catalog schema. Async Version.
2250
2828
  Parameters
2251
2829
  ----------
2252
2830
  uc_schema_guid : str
@@ -2262,7 +2840,9 @@ class AutomatedCuration(Client):
2262
2840
 
2263
2841
  """
2264
2842
  loop = asyncio.get_event_loop()
2265
- response = loop.run_until_complete(self._async_initiate_uc_schema_survey(uc_schema_guid, server))
2843
+ response = loop.run_until_complete(
2844
+ self._async_initiate_uc_schema_survey(uc_schema_guid, server)
2845
+ )
2266
2846
  return response
2267
2847
 
2268
2848
  # async def _async_initiate_uc_function_survey(self, uc_server_guid: str, server: str = None) -> str:
@@ -2407,146 +2987,171 @@ class AutomatedCuration(Client):
2407
2987
  # Initiate general engine action
2408
2988
  #
2409
2989
 
2410
- async def _async_initiate_engine_action(self, qualified_name: str, domain_identifier: int, display_name: str,
2411
- description: str, request_source_guids: str, action_targets: str,
2412
- received_guards: [str], start_time: datetime, request_type: str,
2413
- request_parameters: dict, process_name: str, request_src_name: str = None,
2414
- originator_svc_name: str = None, originator_eng_name: str = None,
2415
- server: str = None) -> str:
2416
- """ Create an engine action in the metadata store that will trigger the governance service associated with
2417
- the supplied request type. The engine action remains to act as a record of the actions taken for auditing.
2418
- Async version.
2419
-
2420
- Parameters
2421
- ----------
2422
- qualified_name (str): The qualified name of the governance action.
2423
- domain_identifier (int): The domain identifier for the governance action.
2424
- display_name (str): The display name of the governance action.
2425
- description (str): The description of the governance action.
2426
- request_source_guids (str): GUIDs of the sources initiating the request.
2427
- action_targets (str): Targets of the governance action.
2428
- received_guards (List[str]): List of guards received for the action.
2429
- start_time (datetime): The start time for the governance action.
2430
- request_type (str): The type of the governance action request.
2431
- request_parameters (dict): Additional parameters for the governance action.
2432
- process_name (str): The name of the associated governance action process.
2433
- request_src_name (str, optional): The name of the request source. Defaults to None.
2434
- originator_svc_name (str, optional): The name of the originator service. Defaults to None.
2435
- originator_eng_name (str, optional): The name of the originator engine. Defaults to None.
2436
-
2437
- Returns
2438
- -------
2439
- str: The GUID (Globally Unique Identifier) of the initiated governance action.
2990
+ async def _async_initiate_engine_action(
2991
+ self,
2992
+ qualified_name: str,
2993
+ domain_identifier: int,
2994
+ display_name: str,
2995
+ description: str,
2996
+ request_source_guids: str,
2997
+ action_targets: str,
2998
+ received_guards: [str],
2999
+ start_time: datetime,
3000
+ request_type: str,
3001
+ request_parameters: dict,
3002
+ process_name: str,
3003
+ request_src_name: str = None,
3004
+ originator_svc_name: str = None,
3005
+ originator_eng_name: str = None,
3006
+ server: str = None,
3007
+ ) -> str:
3008
+ """Create an engine action in the metadata store that will trigger the governance service associated with
3009
+ the supplied request type. The engine action remains to act as a record of the actions taken for auditing.
3010
+ Async version.
2440
3011
 
2441
- Raises
2442
- ------
2443
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2444
- this exception is raised with details from the response content.
3012
+ Parameters
3013
+ ----------
3014
+ qualified_name (str): The qualified name of the governance action.
3015
+ domain_identifier (int): The domain identifier for the governance action.
3016
+ display_name (str): The display name of the governance action.
3017
+ description (str): The description of the governance action.
3018
+ request_source_guids (str): GUIDs of the sources initiating the request.
3019
+ action_targets (str): Targets of the governance action.
3020
+ received_guards (List[str]): List of guards received for the action.
3021
+ start_time (datetime): The start time for the governance action.
3022
+ request_type (str): The type of the governance action request.
3023
+ request_parameters (dict): Additional parameters for the governance action.
3024
+ process_name (str): The name of the associated governance action process.
3025
+ request_src_name (str, optional): The name of the request source. Defaults to None.
3026
+ originator_svc_name (str, optional): The name of the originator service. Defaults to None.
3027
+ originator_eng_name (str, optional): The name of the originator engine. Defaults to None.
3028
+
3029
+ Returns
3030
+ -------
3031
+ str: The GUID (Globally Unique Identifier) of the initiated governance action.
3032
+
3033
+ Raises
3034
+ ------
3035
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3036
+ this exception is raised with details from the response content.
2445
3037
 
2446
- Note
2447
- ----
2448
- The `start_time` parameter should be a `datetime` object representing the start time of the
2449
- governance action.
3038
+ Note
3039
+ ----
3040
+ The `start_time` parameter should be a `datetime` object representing the start time of the
3041
+ governance action.
2450
3042
 
2451
3043
 
2452
3044
  """
2453
3045
  server = self.server_name if server is None else server
2454
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-engines/"
2455
- f"engine-actions/initiate")
2456
- body = {"class": "GovernanceActionRequestBody",
2457
- "qualifiedName": qualified_name + str(int(start_time.timestamp())),
2458
- "domainIdentifier": domain_identifier, "displayName": display_name, "description": description,
2459
- "requestSourceGUIDs": request_source_guids, "actionTargets": action_targets,
2460
- "receivedGuards": received_guards, "startTime": int(start_time.timestamp() * 1000),
2461
- "requestType": request_type, "requestParameters": request_parameters, "processName": process_name,
2462
- "requestSourceName": request_src_name, "originatorServiceName": originator_svc_name,
2463
- "originatorEngineName": originator_eng_name}
3046
+ url = (
3047
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/governance-engines/"
3048
+ f"engine-actions/initiate"
3049
+ )
3050
+ body = {
3051
+ "class": "GovernanceActionRequestBody",
3052
+ "qualifiedName": qualified_name + str(int(start_time.timestamp())),
3053
+ "domainIdentifier": domain_identifier,
3054
+ "displayName": display_name,
3055
+ "description": description,
3056
+ "requestSourceGUIDs": request_source_guids,
3057
+ "actionTargets": action_targets,
3058
+ "receivedGuards": received_guards,
3059
+ "startTime": int(start_time.timestamp() * 1000),
3060
+ "requestType": request_type,
3061
+ "requestParameters": request_parameters,
3062
+ "processName": process_name,
3063
+ "requestSourceName": request_src_name,
3064
+ "originatorServiceName": originator_svc_name,
3065
+ "originatorEngineName": originator_eng_name,
3066
+ }
2464
3067
  new_body = body_slimmer(body)
2465
3068
  response = await self._async_make_request("POST", url, new_body)
2466
3069
  return response.json().get("guid", "Action not initiated")
2467
3070
 
2468
- def initiate_engine_action(self, qualified_name: str, domain_identifier: int, display_name: str, description: str,
2469
- request_source_guids: str, action_targets: str, received_guards: [str],
2470
- start_time: datetime, request_type: str, request_parameters: dict, process_name: str,
2471
- request_src_name: str = None, originator_svc_name: str = None,
2472
- originator_eng_name: str = None, server: str = None) -> str:
2473
- """ Create an engine action in the metadata store that will trigger the governance service associated with
2474
- the supplied request type. The engine action remains to act as a record of the actions taken for auditing.
3071
+ def initiate_engine_action(
3072
+ self,
3073
+ qualified_name: str,
3074
+ domain_identifier: int,
3075
+ display_name: str,
3076
+ description: str,
3077
+ request_source_guids: str,
3078
+ action_targets: str,
3079
+ received_guards: [str],
3080
+ start_time: datetime,
3081
+ request_type: str,
3082
+ request_parameters: dict,
3083
+ process_name: str,
3084
+ request_src_name: str = None,
3085
+ originator_svc_name: str = None,
3086
+ originator_eng_name: str = None,
3087
+ server: str = None,
3088
+ ) -> str:
3089
+ """Create an engine action in the metadata store that will trigger the governance service associated with
3090
+ the supplied request type. The engine action remains to act as a record of the actions taken for auditing.
2475
3091
 
2476
- Parameters
2477
- ----------
2478
- qualified_name (str): The qualified name of the governance action.
2479
- domain_identifier (int): The domain identifier for the governance action.
2480
- display_name (str): The display name of the governance action.
2481
- description (str): The description of the governance action.
2482
- request_source_guids (str): GUIDs of the sources initiating the request.
2483
- action_targets (str): Targets of the governance action.
2484
- received_guards (List[str]): List of guards received for the action.
2485
- start_time (datetime): The start time for the governance action.
2486
- gov_engine_name (str): The name of the governance engine associated with the action.
2487
- request_type (str): The type of the governance action request.
2488
- request_parameters (dict): Additional parameters for the governance action.
2489
- process_name (str): The name of the associated governance action process.
2490
- request_src_name (str, optional): The name of the request source. Defaults to None.
2491
- originator_svc_name (str, optional): The name of the originator service. Defaults to None.
2492
- originator_eng_name (str, optional): The name of the originator engine. Defaults to None.
2493
-
2494
- Returns
2495
- -------
2496
- str: The GUID (Globally Unique Identifier) of the initiated governance action.
3092
+ Parameters
3093
+ ----------
3094
+ qualified_name (str): The qualified name of the governance action.
3095
+ domain_identifier (int): The domain identifier for the governance action.
3096
+ display_name (str): The display name of the governance action.
3097
+ description (str): The description of the governance action.
3098
+ request_source_guids (str): GUIDs of the sources initiating the request.
3099
+ action_targets (str): Targets of the governance action.
3100
+ received_guards (List[str]): List of guards received for the action.
3101
+ start_time (datetime): The start time for the governance action.
3102
+ gov_engine_name (str): The name of the governance engine associated with the action.
3103
+ request_type (str): The type of the governance action request.
3104
+ request_parameters (dict): Additional parameters for the governance action.
3105
+ process_name (str): The name of the associated governance action process.
3106
+ request_src_name (str, optional): The name of the request source. Defaults to None.
3107
+ originator_svc_name (str, optional): The name of the originator service. Defaults to None.
3108
+ originator_eng_name (str, optional): The name of the originator engine. Defaults to None.
2497
3109
 
2498
- Raises
2499
- ------
2500
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2501
- this exception is raised with details from the response content.
3110
+ Returns
3111
+ -------
3112
+ str: The GUID (Globally Unique Identifier) of the initiated governance action.
3113
+
3114
+ Raises
3115
+ ------
3116
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3117
+ this exception is raised with details from the response content.
2502
3118
 
2503
- Note
2504
- ----
2505
- The `start_time` parameter should be a `datetime` object representing the start time of the
2506
- governance action.
3119
+ Note
3120
+ ----
3121
+ The `start_time` parameter should be a `datetime` object representing the start time of the
3122
+ governance action.
2507
3123
  """
2508
3124
  loop = asyncio.get_event_loop()
2509
3125
  response = loop.run_until_complete(
2510
- self._async_initiate_engine_action(qualified_name, domain_identifier, display_name, description,
2511
- request_source_guids, action_targets, received_guards, start_time,
2512
- request_type, request_parameters, process_name, request_src_name,
2513
- originator_svc_name, originator_eng_name, server))
3126
+ self._async_initiate_engine_action(
3127
+ qualified_name,
3128
+ domain_identifier,
3129
+ display_name,
3130
+ description,
3131
+ request_source_guids,
3132
+ action_targets,
3133
+ received_guards,
3134
+ start_time,
3135
+ request_type,
3136
+ request_parameters,
3137
+ process_name,
3138
+ request_src_name,
3139
+ originator_svc_name,
3140
+ originator_eng_name,
3141
+ server,
3142
+ )
3143
+ )
2514
3144
  return response
2515
3145
 
2516
- async def _async_get_catalog_targets(self, integ_connector_guid: str, server: str = None, start_from: int = 0,
2517
- page_size: int = max_paging_size) -> list | str:
2518
- """ Retrieve the details of the metadata elements identified as catalog targets with an integration connector.
2519
- Async version.
2520
-
2521
- Parameters:
2522
- ----------
2523
- integ_connector_guid: str
2524
- The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
2525
- server: str, optional
2526
- The name of the server. If None, will use the default server specified in the instance will be used.
2527
- Returns:
2528
- -------
2529
- [dict]: The list of catalog targets JSON objects.
2530
-
2531
- Raises:
2532
- ------
2533
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2534
- this exception is raised with details from the response content.
2535
- PropertyServerException: If the API response indicates a server side error.
2536
- UserNotAuthorizedException:
2537
- """
2538
- server = self.server_name if server is None else server
2539
- validate_guid(integ_connector_guid)
2540
-
2541
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/integration-connectors/"
2542
- f"{integ_connector_guid}/catalog-targets?startFrom={start_from}&pageSize={page_size}")
2543
-
2544
- response = await self._async_make_request("GET", url)
2545
- return response.json().get("elements", "no targets")
2546
-
2547
- def get_catalog_targets(self, integ_connector_guid: str, server: str = None, start_from: int = 0,
2548
- page_size: int = max_paging_size) -> list | str:
2549
- """ Retrieve the details of the metadata elements identified as catalog targets with an integration connector.
3146
+ async def _async_get_catalog_targets(
3147
+ self,
3148
+ integ_connector_guid: str,
3149
+ server: str = None,
3150
+ start_from: int = 0,
3151
+ page_size: int = max_paging_size,
3152
+ ) -> list | str:
3153
+ """Retrieve the details of the metadata elements identified as catalog targets with an integration connector.
3154
+ Async version.
2550
3155
 
2551
3156
  Parameters:
2552
3157
  ----------
@@ -2565,229 +3170,332 @@ class AutomatedCuration(Client):
2565
3170
  PropertyServerException: If the API response indicates a server side error.
2566
3171
  UserNotAuthorizedException:
2567
3172
  """
3173
+ server = self.server_name if server is None else server
3174
+ validate_guid(integ_connector_guid)
2568
3175
 
2569
- loop = asyncio.get_event_loop()
2570
- response = loop.run_until_complete(
2571
- self._async_get_catalog_targets(integ_connector_guid, server, start_from, page_size))
2572
- return response
2573
-
2574
- async def _async_get_catalog_target(self, relationship_guid: str, server: str = None) -> dict | str:
2575
- """ Retrieve a specific catalog target associated with an integration connector. Further Information:
2576
- https://egeria-project.org/concepts/integration-connector/ . Async version.
2577
-
2578
- Parameters:
2579
- ----------
2580
- relationship_guid: str
2581
- The GUID (Globally Unique Identifier) identifying the catalog targets for an integration connector.
2582
- server: str, optional
2583
- The name of the server. If None, will use the default server specified in the instance will be used.
2584
- Returns:
2585
- -------
2586
- dict: JSON structure of the catalog target.
2587
-
2588
- Raises:
2589
- ------
2590
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2591
- this exception is raised with details from the response content.
2592
- PropertyServerException: If the API response indicates a server side error.
2593
- UserNotAuthorizedException:
2594
- """
2595
- server = self.server_name if server is None else server
2596
- validate_guid(relationship_guid)
2597
-
2598
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-targets/"
2599
- f"{relationship_guid}")
3176
+ url = (
3177
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/integration-connectors/"
3178
+ f"{integ_connector_guid}/catalog-targets?startFrom={start_from}&pageSize={page_size}"
3179
+ )
2600
3180
 
2601
3181
  response = await self._async_make_request("GET", url)
2602
- return response.json().get("element", "no actions")
3182
+ return response.json().get("elements", "no targets")
2603
3183
 
2604
- def get_catalog_target(self, relationship_guid: str, server: str = None) -> dict | str:
2605
- """ Retrieve a specific catalog target associated with an integration connector. Further Information:
2606
- https://egeria-project.org/concepts/integration-connector/ .
3184
+ def get_catalog_targets(
3185
+ self,
3186
+ integ_connector_guid: str,
3187
+ server: str = None,
3188
+ start_from: int = 0,
3189
+ page_size: int = max_paging_size,
3190
+ ) -> list | str:
3191
+ """Retrieve the details of the metadata elements identified as catalog targets with an integration connector.
2607
3192
 
2608
- Parameters:
2609
- ----------
2610
- relationship_guid: str
2611
- The GUID (Globally Unique Identifier) identifying the catalog targets for an integration connector.
2612
- server: str, optional
2613
- The name of the server. If None, will use the default server specified in the instance will be used.
2614
- Returns:
2615
- -------
2616
- dict: JSON structure of the catalog target.
3193
+ Parameters:
3194
+ ----------
3195
+ integ_connector_guid: str
3196
+ The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
3197
+ server: str, optional
3198
+ The name of the server. If None, will use the default server specified in the instance will be used.
3199
+ Returns:
3200
+ -------
3201
+ [dict]: The list of catalog targets JSON objects.
2617
3202
 
2618
- Raises:
2619
- ------
2620
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2621
- this exception is raised with details from the response content.
2622
- PropertyServerException: If the API response indicates a server side error.
2623
- UserNotAuthorizedException:
2624
- """
3203
+ Raises:
3204
+ ------
3205
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3206
+ this exception is raised with details from the response content.
3207
+ PropertyServerException: If the API response indicates a server side error.
3208
+ UserNotAuthorizedException:
3209
+ """
2625
3210
 
2626
3211
  loop = asyncio.get_event_loop()
2627
- response = loop.run_until_complete(self._async_get_catalog_target(relationship_guid, server))
3212
+ response = loop.run_until_complete(
3213
+ self._async_get_catalog_targets(
3214
+ integ_connector_guid, server, start_from, page_size
3215
+ )
3216
+ )
2628
3217
  return response
2629
3218
 
2630
- async def _async_add_catalog_target(self, integ_connector_guid: str, metadata_element_guid: str,
2631
- catalog_target_name: str, connection_name: str = None,
2632
- metadata_src_qual_name: str = None, config_properties: dict = None,
2633
- template_properties: dict = None, permitted_sync: str = "BOTH_DIRECTIONS",
2634
- delete_method: str = "ARCHIVE", server: str = None) -> str:
2635
- """ Add a catalog target to an integration connector and .
2636
- Async version.
3219
+ async def _async_get_catalog_target(
3220
+ self, relationship_guid: str, server: str = None
3221
+ ) -> dict | str:
3222
+ """Retrieve a specific catalog target associated with an integration connector. Further Information:
3223
+ https://egeria-project.org/concepts/integration-connector/ . Async version.
2637
3224
 
2638
- Parameters:
2639
- ----------
2640
- integ_connector_guid: str
2641
- The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
2642
- metadata_element_guid: str
2643
- The specific metadata element target we want to retrieve.
2644
- catalog_target_name : dict
2645
- Name of the catalog target to add.
2646
- connection_name: str, default = None
2647
- Optional name of connection to use for this catalog target when multiple connections defined.
2648
- metadata_src_qual_name: str
2649
- The qualified name of the metadata source for the catalog target
2650
- config_properties: dict
2651
- Configuration properties for the catalog target
2652
- template_properties: dict
2653
- Template properties to pass
2654
- permitted_sync: str, default = BOTH_DIRECTIONS
2655
- Direction the metadata is allowed to flow (BOTH_DIRECTIONS, FROM_THIRD_PARTH, TO_THIRD_PARTY
2656
- delete_method: str, default = ARCHIVE
2657
- Controls the type of delete. Use ARCHIVE for lineage considerations. Alternative is SOFT_DELETE.
3225
+ Parameters:
3226
+ ----------
3227
+ relationship_guid: str
3228
+ The GUID (Globally Unique Identifier) identifying the catalog targets for an integration connector.
2658
3229
  server: str, optional
2659
3230
  The name of the server. If None, will use the default server specified in the instance will be used.
3231
+ Returns:
3232
+ -------
3233
+ dict: JSON structure of the catalog target.
2660
3234
 
2661
- Returns:
2662
- -------
2663
- Relationship GUID for the catalog target,
2664
-
2665
- Raises:
2666
- ------
3235
+ Raises:
3236
+ ------
2667
3237
  InvalidParameterException: If the API response indicates an error (non-200 status code),
2668
3238
  this exception is raised with details from the response content.
2669
3239
  PropertyServerException: If the API response indicates a server side error.
2670
3240
  UserNotAuthorizedException:
2671
- """
3241
+ """
2672
3242
  server = self.server_name if server is None else server
2673
- validate_guid(integ_connector_guid)
2674
- validate_guid(metadata_element_guid)
3243
+ validate_guid(relationship_guid)
2675
3244
 
2676
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/integration-connectors/"
2677
- f"{integ_connector_guid}/catalog-targets/{metadata_element_guid}")
2678
- body = {"catalogTargetName": catalog_target_name, "metadataSourceQualifiedName": metadata_src_qual_name,
2679
- "configProperties": config_properties, "templateProperties": template_properties,
2680
- "connectionName": connection_name, "permittedSynchronization": permitted_sync,
2681
- "deleteMethod": delete_method}
3245
+ url = (
3246
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-targets/"
3247
+ f"{relationship_guid}"
3248
+ )
2682
3249
 
2683
- response = await self._async_make_request("POST", url, body)
2684
- return response.json().get('guid', "No Guid returned")
3250
+ response = await self._async_make_request("GET", url)
3251
+ return response.json().get("element", "no actions")
2685
3252
 
2686
- def add_catalog_target(self, integ_connector_guid: str, metadata_element_guid: str, catalog_target_name: str,
2687
- connection_name: str = None, metadata_src_qual_name: str = None,
2688
- config_properties: dict = None, template_properties: dict = None,
2689
- permitted_sync: str = "BOTH_DIRECTIONS", delete_method: str = "ARCHIVE",
2690
- server: str = None) -> str:
2691
- """ Add a catalog target to an integration connector and .
3253
+ def get_catalog_target(
3254
+ self, relationship_guid: str, server: str = None
3255
+ ) -> dict | str:
3256
+ """Retrieve a specific catalog target associated with an integration connector. Further Information:
3257
+ https://egeria-project.org/concepts/integration-connector/ .
2692
3258
 
2693
- Parameters:
2694
- ----------
2695
- integ_connector_guid: str
2696
- The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
2697
- metadata_element_guid: str
2698
- The specific metadata element target we want to retrieve.
2699
- catalog_target_name : dict
2700
- Name of the catalog target to add.
2701
- connection_name: str, default = None
2702
- Optional name of connection to use for this catalog target when multiple connections defined.
2703
- metadata_src_qual_name: str
2704
- The qualified name of the metadata source for the catalog target
2705
- config_properties: dict
2706
- Configuration properties for the catalog target
2707
- template_properties: dict
2708
- Template properties to pass
2709
- permitted_sync: str, default = BOTH_DIRECTIONS
2710
- Direction the metadata is allowed to flow (BOTH_DIRECTIONS, FROM_THIRD_PARTH, TO_THIRD_PARTY
2711
- delete_method: str, default = ARCHIVE
2712
- Controls the type of delete. Use ARCHIVE for lineage considerations. Alternative is SOFT_DELETE.
3259
+ Parameters:
3260
+ ----------
3261
+ relationship_guid: str
3262
+ The GUID (Globally Unique Identifier) identifying the catalog targets for an integration connector.
2713
3263
  server: str, optional
2714
3264
  The name of the server. If None, will use the default server specified in the instance will be used.
3265
+ Returns:
3266
+ -------
3267
+ dict: JSON structure of the catalog target.
2715
3268
 
2716
- Returns:
2717
- -------
2718
- Relationship GUID for the catalog target,
2719
-
2720
- Raises:
2721
- ------
3269
+ Raises:
3270
+ ------
2722
3271
  InvalidParameterException: If the API response indicates an error (non-200 status code),
2723
3272
  this exception is raised with details from the response content.
2724
3273
  PropertyServerException: If the API response indicates a server side error.
2725
3274
  UserNotAuthorizedException:
2726
- """
3275
+ """
3276
+
2727
3277
  loop = asyncio.get_event_loop()
2728
3278
  response = loop.run_until_complete(
2729
- self._async_add_catalog_target(integ_connector_guid, metadata_element_guid, catalog_target_name,
2730
- connection_name, metadata_src_qual_name, config_properties,
2731
- template_properties, permitted_sync, delete_method, server))
3279
+ self._async_get_catalog_target(relationship_guid, server)
3280
+ )
2732
3281
  return response
2733
3282
 
2734
- async def _async_update_catalog_target(self, relationship_guid: str, catalog_target_name: str,
2735
- connection_name: str = None, metadata_src_qual_name: str = None,
2736
- config_properties: dict = None, template_properties: dict = None,
2737
- permitted_sync: str = "BOTH_DIRECTIONS", delete_method: str = "ARCHIVE",
2738
- server: str = None) -> None:
2739
- """ Update a catalog target to an integration connector.
2740
- Async version.
3283
+ async def _async_add_catalog_target(
3284
+ self,
3285
+ integ_connector_guid: str,
3286
+ metadata_element_guid: str,
3287
+ catalog_target_name: str,
3288
+ connection_name: str = None,
3289
+ metadata_src_qual_name: str = None,
3290
+ config_properties: dict = None,
3291
+ template_properties: dict = None,
3292
+ permitted_sync: str = "BOTH_DIRECTIONS",
3293
+ delete_method: str = "ARCHIVE",
3294
+ server: str = None,
3295
+ ) -> str:
3296
+ """Add a catalog target to an integration connector and .
3297
+ Async version.
2741
3298
 
2742
- Parameters:
2743
- ----------
2744
- relationship_guid: str
2745
- The GUID (Globally Unique Identifier) of the relationship used to retrieve catalog targets.
2746
- catalog_target_name : dict
2747
- Name of the catalog target to add.
2748
- connection_name: str, default = None
2749
- Optional name of connection to use for this catalog target when multiple connections defined.
2750
- metadata_src_qual_name: str
2751
- The qualified name of the metadata source for the catalog target
2752
- config_properties: dict
2753
- Configuration properties for the catalog target
2754
- template_properties: dict
2755
- Template properties to pass
2756
- permitted_sync: str, default = BOTH_DIRECTIONS
2757
- Direction the metadata is allowed to flow (BOTH_DIRECTIONS, FROM_THIRD_PARTH, TO_THIRD_PARTY
2758
- delete_method: str, default = ARCHIVE
2759
- Controls the type of delete. Use ARCHIVE for lineage considerations. Alternative is SOFT_DELETE.
2760
- server: str, optional
2761
- The name of the server. If None, will use the default server specified in the instance will be used.
3299
+ Parameters:
3300
+ ----------
3301
+ integ_connector_guid: str
3302
+ The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
3303
+ metadata_element_guid: str
3304
+ The specific metadata element target we want to retrieve.
3305
+ catalog_target_name : dict
3306
+ Name of the catalog target to add.
3307
+ connection_name: str, default = None
3308
+ Optional name of connection to use for this catalog target when multiple connections defined.
3309
+ metadata_src_qual_name: str
3310
+ The qualified name of the metadata source for the catalog target
3311
+ config_properties: dict
3312
+ Configuration properties for the catalog target
3313
+ template_properties: dict
3314
+ Template properties to pass
3315
+ permitted_sync: str, default = BOTH_DIRECTIONS
3316
+ Direction the metadata is allowed to flow (BOTH_DIRECTIONS, FROM_THIRD_PARTH, TO_THIRD_PARTY
3317
+ delete_method: str, default = ARCHIVE
3318
+ Controls the type of delete. Use ARCHIVE for lineage considerations. Alternative is SOFT_DELETE.
3319
+ server: str, optional
3320
+ The name of the server. If None, will use the default server specified in the instance will be used.
2762
3321
 
2763
- Returns:
2764
- -------
2765
- None
3322
+ Returns:
3323
+ -------
3324
+ Relationship GUID for the catalog target,
2766
3325
 
2767
- Raises:
2768
- ------
2769
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2770
- this exception is raised with details from the response content.
2771
- PropertyServerException: If the API response indicates a server side error.
2772
- UserNotAuthorizedException:
2773
- """
3326
+ Raises:
3327
+ ------
3328
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3329
+ this exception is raised with details from the response content.
3330
+ PropertyServerException: If the API response indicates a server side error.
3331
+ UserNotAuthorizedException:
3332
+ """
3333
+ server = self.server_name if server is None else server
3334
+ validate_guid(integ_connector_guid)
3335
+ validate_guid(metadata_element_guid)
3336
+
3337
+ url = (
3338
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/integration-connectors/"
3339
+ f"{integ_connector_guid}/catalog-targets/{metadata_element_guid}"
3340
+ )
3341
+ body = {
3342
+ "catalogTargetName": catalog_target_name,
3343
+ "metadataSourceQualifiedName": metadata_src_qual_name,
3344
+ "configProperties": config_properties,
3345
+ "templateProperties": template_properties,
3346
+ "connectionName": connection_name,
3347
+ "permittedSynchronization": permitted_sync,
3348
+ "deleteMethod": delete_method,
3349
+ }
3350
+
3351
+ response = await self._async_make_request("POST", url, body)
3352
+ return response.json().get("guid", "No Guid returned")
3353
+
3354
+ def add_catalog_target(
3355
+ self,
3356
+ integ_connector_guid: str,
3357
+ metadata_element_guid: str,
3358
+ catalog_target_name: str,
3359
+ connection_name: str = None,
3360
+ metadata_src_qual_name: str = None,
3361
+ config_properties: dict = None,
3362
+ template_properties: dict = None,
3363
+ permitted_sync: str = "BOTH_DIRECTIONS",
3364
+ delete_method: str = "ARCHIVE",
3365
+ server: str = None,
3366
+ ) -> str:
3367
+ """Add a catalog target to an integration connector and .
3368
+
3369
+ Parameters:
3370
+ ----------
3371
+ integ_connector_guid: str
3372
+ The GUID (Globally Unique Identifier) of the integration connector used to retrieve catalog targets.
3373
+ metadata_element_guid: str
3374
+ The specific metadata element target we want to retrieve.
3375
+ catalog_target_name : dict
3376
+ Name of the catalog target to add.
3377
+ connection_name: str, default = None
3378
+ Optional name of connection to use for this catalog target when multiple connections defined.
3379
+ metadata_src_qual_name: str
3380
+ The qualified name of the metadata source for the catalog target
3381
+ config_properties: dict
3382
+ Configuration properties for the catalog target
3383
+ template_properties: dict
3384
+ Template properties to pass
3385
+ permitted_sync: str, default = BOTH_DIRECTIONS
3386
+ Direction the metadata is allowed to flow (BOTH_DIRECTIONS, FROM_THIRD_PARTH, TO_THIRD_PARTY
3387
+ delete_method: str, default = ARCHIVE
3388
+ Controls the type of delete. Use ARCHIVE for lineage considerations. Alternative is SOFT_DELETE.
3389
+ server: str, optional
3390
+ The name of the server. If None, will use the default server specified in the instance will be used.
3391
+
3392
+ Returns:
3393
+ -------
3394
+ Relationship GUID for the catalog target,
3395
+
3396
+ Raises:
3397
+ ------
3398
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3399
+ this exception is raised with details from the response content.
3400
+ PropertyServerException: If the API response indicates a server side error.
3401
+ UserNotAuthorizedException:
3402
+ """
3403
+ loop = asyncio.get_event_loop()
3404
+ response = loop.run_until_complete(
3405
+ self._async_add_catalog_target(
3406
+ integ_connector_guid,
3407
+ metadata_element_guid,
3408
+ catalog_target_name,
3409
+ connection_name,
3410
+ metadata_src_qual_name,
3411
+ config_properties,
3412
+ template_properties,
3413
+ permitted_sync,
3414
+ delete_method,
3415
+ server,
3416
+ )
3417
+ )
3418
+ return response
3419
+
3420
+ async def _async_update_catalog_target(
3421
+ self,
3422
+ relationship_guid: str,
3423
+ catalog_target_name: str,
3424
+ connection_name: str = None,
3425
+ metadata_src_qual_name: str = None,
3426
+ config_properties: dict = None,
3427
+ template_properties: dict = None,
3428
+ permitted_sync: str = "BOTH_DIRECTIONS",
3429
+ delete_method: str = "ARCHIVE",
3430
+ server: str = None,
3431
+ ) -> None:
3432
+ """Update a catalog target to an integration connector.
3433
+ Async version.
3434
+
3435
+ Parameters:
3436
+ ----------
3437
+ relationship_guid: str
3438
+ The GUID (Globally Unique Identifier) of the relationship used to retrieve catalog targets.
3439
+ catalog_target_name : dict
3440
+ Name of the catalog target to add.
3441
+ connection_name: str, default = None
3442
+ Optional name of connection to use for this catalog target when multiple connections defined.
3443
+ metadata_src_qual_name: str
3444
+ The qualified name of the metadata source for the catalog target
3445
+ config_properties: dict
3446
+ Configuration properties for the catalog target
3447
+ template_properties: dict
3448
+ Template properties to pass
3449
+ permitted_sync: str, default = BOTH_DIRECTIONS
3450
+ Direction the metadata is allowed to flow (BOTH_DIRECTIONS, FROM_THIRD_PARTH, TO_THIRD_PARTY
3451
+ delete_method: str, default = ARCHIVE
3452
+ Controls the type of delete. Use ARCHIVE for lineage considerations. Alternative is SOFT_DELETE.
3453
+ server: str, optional
3454
+ The name of the server. If None, will use the default server specified in the instance will be used.
3455
+
3456
+ Returns:
3457
+ -------
3458
+ None
3459
+
3460
+ Raises:
3461
+ ------
3462
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3463
+ this exception is raised with details from the response content.
3464
+ PropertyServerException: If the API response indicates a server side error.
3465
+ UserNotAuthorizedException:
3466
+ """
2774
3467
  server = self.server_name if server is None else server
2775
3468
  validate_guid(relationship_guid)
2776
3469
 
2777
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-targets/"
2778
- f"{relationship_guid}/update")
2779
- body = {"catalogTargetName": catalog_target_name, "metadataSourceQualifiedName": metadata_src_qual_name,
2780
- "configProperties": config_properties, "templateProperties": template_properties,
2781
- "connectionName": connection_name, "permittedSynchronization": permitted_sync,
2782
- "deleteMethod": delete_method}
3470
+ url = (
3471
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-targets/"
3472
+ f"{relationship_guid}/update"
3473
+ )
3474
+ body = {
3475
+ "catalogTargetName": catalog_target_name,
3476
+ "metadataSourceQualifiedName": metadata_src_qual_name,
3477
+ "configProperties": config_properties,
3478
+ "templateProperties": template_properties,
3479
+ "connectionName": connection_name,
3480
+ "permittedSynchronization": permitted_sync,
3481
+ "deleteMethod": delete_method,
3482
+ }
2783
3483
  await self._async_make_request("POST", url, body)
2784
3484
  return
2785
3485
 
2786
- def update_catalog_target(self, relationship_guid: str, catalog_target_name: str, connection_name: str = None,
2787
- metadata_src_qual_name: str = None, config_properties: dict = None,
2788
- template_properties: dict = None, permitted_sync: str = "BOTH_DIRECTIONS",
2789
- delete_method: str = "ARCHIVE", server: str = None) -> None:
2790
- """ Update a catalog target to an integration connector.
3486
+ def update_catalog_target(
3487
+ self,
3488
+ relationship_guid: str,
3489
+ catalog_target_name: str,
3490
+ connection_name: str = None,
3491
+ metadata_src_qual_name: str = None,
3492
+ config_properties: dict = None,
3493
+ template_properties: dict = None,
3494
+ permitted_sync: str = "BOTH_DIRECTIONS",
3495
+ delete_method: str = "ARCHIVE",
3496
+ server: str = None,
3497
+ ) -> None:
3498
+ """Update a catalog target to an integration connector.
2791
3499
 
2792
3500
  Parameters:
2793
3501
  ----------
@@ -2808,146 +3516,179 @@ class AutomatedCuration(Client):
2808
3516
  delete_method: str, default = ARCHIVE
2809
3517
  Controls the type of delete. Use ARCHIVE for lineage considerations. Alternative is SOFT_DELETE.
2810
3518
  server: str, optional
2811
- """
3519
+ """
2812
3520
 
2813
3521
  loop = asyncio.get_event_loop()
2814
3522
  loop.run_until_complete(
2815
- self._async_update_catalog_target(relationship_guid, catalog_target_name, connection_name,
2816
- metadata_src_qual_name, config_properties, template_properties,
2817
- permitted_sync, delete_method, server))
3523
+ self._async_update_catalog_target(
3524
+ relationship_guid,
3525
+ catalog_target_name,
3526
+ connection_name,
3527
+ metadata_src_qual_name,
3528
+ config_properties,
3529
+ template_properties,
3530
+ permitted_sync,
3531
+ delete_method,
3532
+ server,
3533
+ )
3534
+ )
2818
3535
  return
2819
3536
 
2820
- async def _async_remove_catalog_target(self, relationship_guid: str, server: str = None) -> None:
2821
- """ Remove a catalog target to an integration connector. Async version.
3537
+ async def _async_remove_catalog_target(
3538
+ self, relationship_guid: str, server: str = None
3539
+ ) -> None:
3540
+ """Remove a catalog target to an integration connector. Async version.
2822
3541
 
2823
- Parameters:
2824
- ----------
2825
- relationship_guid: str
2826
- The GUID (Globally Unique Identifier) identifying the catalog target relationship.
2827
- server: str, optional
2828
- The name of the server. If None, will use the default server specified in the instance will be used.
2829
- Returns:
2830
- -------
2831
- None
3542
+ Parameters:
3543
+ ----------
3544
+ relationship_guid: str
3545
+ The GUID (Globally Unique Identifier) identifying the catalog target relationship.
3546
+ server: str, optional
3547
+ The name of the server. If None, will use the default server specified in the instance will be used.
3548
+ Returns:
3549
+ -------
3550
+ None
2832
3551
 
2833
- Raises:
2834
- ------
2835
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2836
- this exception is raised with details from the response content.
2837
- PropertyServerException: If the API response indicates a server side error.
2838
- UserNotAuthorizedException:
2839
- """
3552
+ Raises:
3553
+ ------
3554
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3555
+ this exception is raised with details from the response content.
3556
+ PropertyServerException: If the API response indicates a server side error.
3557
+ UserNotAuthorizedException:
3558
+ """
2840
3559
  server = self.server_name if server is None else server
2841
3560
  validate_guid(relationship_guid)
2842
3561
 
2843
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-targets/"
2844
- f"{relationship_guid}/remove")
3562
+ url = (
3563
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-targets/"
3564
+ f"{relationship_guid}/remove"
3565
+ )
2845
3566
 
2846
3567
  await self._async_make_request("POST", url)
2847
3568
  return
2848
3569
 
2849
3570
  def remove_catalog_target(self, relationship_guid: str, server: str = None) -> None:
2850
- """ Remove a catalog target to an integration connector.
3571
+ """Remove a catalog target to an integration connector.
2851
3572
 
2852
- Parameters:
2853
- ----------
2854
- relationship_guid: str
2855
- The GUID (Globally Unique Identifier) identifying the catalog target relationship.
2856
- server: str, optional
2857
- The name of the server. If None, will use the default server specified in the instance will be used.
2858
- Returns:
2859
- -------
2860
- None
3573
+ Parameters:
3574
+ ----------
3575
+ relationship_guid: str
3576
+ The GUID (Globally Unique Identifier) identifying the catalog target relationship.
3577
+ server: str, optional
3578
+ The name of the server. If None, will use the default server specified in the instance will be used.
3579
+ Returns:
3580
+ -------
3581
+ None
2861
3582
 
2862
- Raises:
2863
- ------
2864
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2865
- this exception is raised with details from the response content.
2866
- PropertyServerException: If the API response indicates a server side error.
2867
- UserNotAuthorizedException:
2868
- """
3583
+ Raises:
3584
+ ------
3585
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3586
+ this exception is raised with details from the response content.
3587
+ PropertyServerException: If the API response indicates a server side error.
3588
+ UserNotAuthorizedException:
3589
+ """
2869
3590
 
2870
3591
  loop = asyncio.get_event_loop()
2871
- loop.run_until_complete(self._async_remove_catalog_target(relationship_guid, server))
3592
+ loop.run_until_complete(
3593
+ self._async_remove_catalog_target(relationship_guid, server)
3594
+ )
2872
3595
  return
2873
3596
 
2874
3597
  #
2875
3598
  # Get information about technologies
2876
3599
  #
2877
3600
 
2878
- async def _async_get_tech_types_for_open_metadata_type(self, type_name: str, tech_name: str, server: str = None,
2879
- start_from: int = 0,
2880
- page_size: int = max_paging_size) -> list | str:
2881
- """ Retrieve the list of deployed implementation type metadata elements linked to a particular
2882
- open metadata type.. Async version.
3601
+ async def _async_get_tech_types_for_open_metadata_type(
3602
+ self,
3603
+ type_name: str,
3604
+ tech_name: str,
3605
+ server: str = None,
3606
+ start_from: int = 0,
3607
+ page_size: int = max_paging_size,
3608
+ ) -> list | str:
3609
+ """Retrieve the list of deployed implementation type metadata elements linked to a particular
3610
+ open metadata type.. Async version.
2883
3611
 
2884
- Parameters:
2885
- ----------
2886
- type_name: str
2887
- The technology type we are looking for.
2888
- tech_name: str
2889
- The technology name we are looking for.
2890
- server: str, optional
2891
- The name of the server. If None, will use the default server specified in the instance will be used.
2892
- Returns:
2893
- -------
2894
- [dict] | str: List of elements describing the technology - or "no tech found" if not found.
3612
+ Parameters:
3613
+ ----------
3614
+ type_name: str
3615
+ The technology type we are looking for.
3616
+ tech_name: str
3617
+ The technology name we are looking for.
3618
+ server: str, optional
3619
+ The name of the server. If None, will use the default server specified in the instance will be used.
3620
+ Returns:
3621
+ -------
3622
+ [dict] | str: List of elements describing the technology - or "no tech found" if not found.
2895
3623
 
2896
- Raises:
2897
- ------
2898
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2899
- this exception is raised with details from the response content.
2900
- PropertyServerException: If the API response indicates a server side error.
2901
- UserNotAuthorizedException:
3624
+ Raises:
3625
+ ------
3626
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3627
+ this exception is raised with details from the response content.
3628
+ PropertyServerException: If the API response indicates a server side error.
3629
+ UserNotAuthorizedException:
2902
3630
 
2903
- Notes
2904
- -----
2905
- More information can be found at: https://egeria-project.org/types
3631
+ Notes
3632
+ -----
3633
+ More information can be found at: https://egeria-project.org/types
2906
3634
  """
2907
3635
  server = self.server_name if server is None else server
2908
3636
  # validate_name(type_name)
2909
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/open-metadata-types/"
2910
- f"{type_name}/technology-types?startFrom={start_from}&pageSize={page_size}")
3637
+ url = (
3638
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/open-metadata-types/"
3639
+ f"{type_name}/technology-types?startFrom={start_from}&pageSize={page_size}"
3640
+ )
2911
3641
  body = {"filter": tech_name}
2912
3642
 
2913
3643
  response = await self._async_make_request("GET", url, body)
2914
3644
  return response.json().get("elements", "no tech found")
2915
3645
 
2916
- def get_tech_types_for_open_metadata_type(self, type_name: str, tech_name: str, server: str = None,
2917
- start_from: int = 0, page_size: int = max_paging_size) -> list | str:
2918
- """ Retrieve the list of deployed implementation type metadata elements linked to a particular
2919
- open metadata type.
3646
+ def get_tech_types_for_open_metadata_type(
3647
+ self,
3648
+ type_name: str,
3649
+ tech_name: str,
3650
+ server: str = None,
3651
+ start_from: int = 0,
3652
+ page_size: int = max_paging_size,
3653
+ ) -> list | str:
3654
+ """Retrieve the list of deployed implementation type metadata elements linked to a particular
3655
+ open metadata type.
2920
3656
 
2921
- Parameters:
2922
- ----------
2923
- type_name: str
2924
- The technology type we are looking for.
2925
- tech_name: str
2926
- The technology name we are looking for.
2927
- server: str, optional
2928
- The name of the server. If None, will use the default server specified in the instance will be used.
2929
- Returns:
2930
- -------
2931
- [dict] | str: List of elements describing the technology - or "no tech found" if not found.
3657
+ Parameters:
3658
+ ----------
3659
+ type_name: str
3660
+ The technology type we are looking for.
3661
+ tech_name: str
3662
+ The technology name we are looking for.
3663
+ server: str, optional
3664
+ The name of the server. If None, will use the default server specified in the instance will be used.
3665
+ Returns:
3666
+ -------
3667
+ [dict] | str: List of elements describing the technology - or "no tech found" if not found.
2932
3668
 
2933
- Raises:
2934
- ------
2935
- InvalidParameterException: If the API response indicates an error (non-200 status code),
2936
- this exception is raised with details from the response content.
2937
- PropertyServerException: If the API response indicates a server side error.
2938
- UserNotAuthorizedException:
3669
+ Raises:
3670
+ ------
3671
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3672
+ this exception is raised with details from the response content.
3673
+ PropertyServerException: If the API response indicates a server side error.
3674
+ UserNotAuthorizedException:
2939
3675
 
2940
- Notes
2941
- -----
2942
- More information can be found at: https://egeria-project.org/types
3676
+ Notes
3677
+ -----
3678
+ More information can be found at: https://egeria-project.org/types
2943
3679
  """
2944
3680
  loop = asyncio.get_event_loop()
2945
3681
  response = loop.run_until_complete(
2946
- self._async_get_tech_types_for_open_metadata_type(type_name, tech_name, server, start_from, page_size))
3682
+ self._async_get_tech_types_for_open_metadata_type(
3683
+ type_name, tech_name, server, start_from, page_size
3684
+ )
3685
+ )
2947
3686
  return response
2948
3687
 
2949
- async def _async_get_technology_type_detail(self, type_name: str, server: str = None) -> list | str:
2950
- """ Retrieve the details of the named technology type. This name should be the name of the technology type
3688
+ async def _async_get_technology_type_detail(
3689
+ self, type_name: str, server: str = None
3690
+ ) -> list | str:
3691
+ """Retrieve the details of the named technology type. This name should be the name of the technology type
2951
3692
  and contain no wild cards. Async version.
2952
3693
  Parameters
2953
3694
  ----------
@@ -2982,78 +3723,89 @@ class AutomatedCuration(Client):
2982
3723
  response = await self._async_make_request("POST", url, body)
2983
3724
  return response.json().get("element", "no type found")
2984
3725
 
2985
- def get_technology_type_detail(self, type_name: str, server: str = None) -> list | str:
2986
- """ Retrieve the details of the named technology type. This name should be the name of the technology type
2987
- and contain no wild cards.
2988
- Parameters
2989
- ----------
2990
- type_name : str
2991
- The name of the technology type to retrieve detailed information for.
2992
- server : str, optional
2993
- The name of the server to fetch the technology type from. If not provided, the default server name will
2994
- be used.
3726
+ def get_technology_type_detail(
3727
+ self, type_name: str, server: str = None
3728
+ ) -> list | str:
3729
+ """Retrieve the details of the named technology type. This name should be the name of the technology type
3730
+ and contain no wild cards.
3731
+ Parameters
3732
+ ----------
3733
+ type_name : str
3734
+ The name of the technology type to retrieve detailed information for.
3735
+ server : str, optional
3736
+ The name of the server to fetch the technology type from. If not provided, the default server name will
3737
+ be used.
2995
3738
 
2996
- Returns
2997
- -------
2998
- list[dict] | str
2999
- A list of dictionaries containing the detailed information for the specified technology type.
3000
- If the technology type is not found, returns the string "no type found".
3001
- Raises
3002
- ------
3003
- InvalidParameterException: If the API response indicates an error (non-200 status code),
3004
- this exception is raised with details from the response content.
3005
- PropertyServerException: If the API response indicates a server side error.
3006
- UserNotAuthorizedException:
3739
+ Returns
3740
+ -------
3741
+ list[dict] | str
3742
+ A list of dictionaries containing the detailed information for the specified technology type.
3743
+ If the technology type is not found, returns the string "no type found".
3744
+ Raises
3745
+ ------
3746
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3747
+ this exception is raised with details from the response content.
3748
+ PropertyServerException: If the API response indicates a server side error.
3749
+ UserNotAuthorizedException:
3007
3750
 
3008
- Notes
3009
- -----
3010
- More information can be found at: https://egeria-project.org/concepts/deployed-implementation-type
3751
+ Notes
3752
+ -----
3753
+ More information can be found at: https://egeria-project.org/concepts/deployed-implementation-type
3011
3754
  """
3012
3755
 
3013
3756
  loop = asyncio.get_event_loop()
3014
- response = loop.run_until_complete(self._async_get_technology_type_detail(type_name, server))
3757
+ response = loop.run_until_complete(
3758
+ self._async_get_technology_type_detail(type_name, server)
3759
+ )
3015
3760
  return response
3016
3761
 
3017
- async def _async_find_technology_types(self, search_string: str = "*", server: str = None, start_from: int = 0,
3018
- page_size: int = max_paging_size, starts_with: bool = False,
3019
- ends_with: bool = False, ignore_case: bool = True) -> list | str:
3020
- """ Retrieve the list of technology types that contain the search string. Async version.
3762
+ async def _async_find_technology_types(
3763
+ self,
3764
+ search_string: str = "*",
3765
+ server: str = None,
3766
+ start_from: int = 0,
3767
+ page_size: int = max_paging_size,
3768
+ starts_with: bool = False,
3769
+ ends_with: bool = False,
3770
+ ignore_case: bool = True,
3771
+ ) -> list | str:
3772
+ """Retrieve the list of technology types that contain the search string. Async version.
3021
3773
 
3022
- Parameters:
3023
- ----------
3024
- type_name: str
3025
- The technology type we are looking for.
3026
- server: str, optional
3027
- The name of the server. If None, will use the default server specified in the instance will be used.
3774
+ Parameters:
3775
+ ----------
3776
+ type_name: str
3777
+ The technology type we are looking for.
3778
+ server: str, optional
3779
+ The name of the server. If None, will use the default server specified in the instance will be used.
3028
3780
 
3029
- starts_with : bool, optional
3030
- Whether to search engine actions that start with the given search string. Default is False.
3781
+ starts_with : bool, optional
3782
+ Whether to search engine actions that start with the given search string. Default is False.
3031
3783
 
3032
- ends_with : bool, optional
3033
- Whether to search engine actions that end with the given search string. Default is False.
3784
+ ends_with : bool, optional
3785
+ Whether to search engine actions that end with the given search string. Default is False.
3034
3786
 
3035
- ignore_case : bool, optional
3036
- Whether to ignore case while searching engine actions. Default is True.
3787
+ ignore_case : bool, optional
3788
+ Whether to ignore case while searching engine actions. Default is True.
3037
3789
 
3038
- start_from : int, optional
3039
- The index from which to start fetching the engine actions. Default is 0.
3790
+ start_from : int, optional
3791
+ The index from which to start fetching the engine actions. Default is 0.
3040
3792
 
3041
- page_size : int, optional
3042
- The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
3043
- Returns:
3044
- -------
3045
- [dict] | str: List of elements describing the technology - or "no tech found" if not found.
3793
+ page_size : int, optional
3794
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
3795
+ Returns:
3796
+ -------
3797
+ [dict] | str: List of elements describing the technology - or "no tech found" if not found.
3046
3798
 
3047
- Raises:
3048
- ------
3049
- InvalidParameterException: If the API response indicates an error (non-200 status code),
3050
- this exception is raised with details from the response content.
3051
- PropertyServerException: If the API response indicates a server side error.
3052
- UserNotAuthorizedException:
3799
+ Raises:
3800
+ ------
3801
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3802
+ this exception is raised with details from the response content.
3803
+ PropertyServerException: If the API response indicates a server side error.
3804
+ UserNotAuthorizedException:
3053
3805
 
3054
- Notes
3055
- -----
3056
- For more information see: https://egeria-project.org/concepts/deployed-implementation-type
3806
+ Notes
3807
+ -----
3808
+ For more information see: https://egeria-project.org/concepts/deployed-implementation-type
3057
3809
  """
3058
3810
  server = self.server_name if server is None else server
3059
3811
 
@@ -3064,110 +3816,140 @@ class AutomatedCuration(Client):
3064
3816
  if search_string == "*":
3065
3817
  search_string = ""
3066
3818
 
3067
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/technology-types/"
3068
- f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
3069
- f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}")
3819
+ url = (
3820
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/technology-types/"
3821
+ f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
3822
+ f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
3823
+ )
3070
3824
  body = {"filter": search_string}
3071
3825
 
3072
3826
  response = await self._async_make_request("POST", url, body)
3073
3827
  return response.json().get("elements", "no tech found")
3074
3828
 
3075
- def find_technology_types(self, search_string: str = "*", server: str = None, start_from: int = 0,
3076
- page_size: int = max_paging_size, starts_with: bool = False, ends_with: bool = False,
3077
- ignore_case: bool = True) -> list | str:
3078
- """ Retrieve the list of technology types that contain the search string. Async version.
3829
+ def find_technology_types(
3830
+ self,
3831
+ search_string: str = "*",
3832
+ server: str = None,
3833
+ start_from: int = 0,
3834
+ page_size: int = max_paging_size,
3835
+ starts_with: bool = False,
3836
+ ends_with: bool = False,
3837
+ ignore_case: bool = True,
3838
+ ) -> list | str:
3839
+ """Retrieve the list of technology types that contain the search string. Async version.
3079
3840
 
3080
- Parameters:
3081
- ----------
3082
- type_name: str
3083
- The technology type we are looking for.
3084
- server: str, optional
3085
- The name of the server. If None, will use the default server specified in the instance will be used.
3086
- Returns:
3087
- -------
3088
- [dict] | str: List of elements describing the technology - or "no tech found" if not found.
3841
+ Parameters:
3842
+ ----------
3843
+ type_name: str
3844
+ The technology type we are looking for.
3845
+ server: str, optional
3846
+ The name of the server. If None, will use the default server specified in the instance will be used.
3847
+ Returns:
3848
+ -------
3849
+ [dict] | str: List of elements describing the technology - or "no tech found" if not found.
3089
3850
 
3090
- Raises:
3091
- ------
3092
- InvalidParameterException: If the API response indicates an error (non-200 status code),
3093
- this exception is raised with details from the response content.
3094
- PropertyServerException: If the API response indicates a server side error.
3095
- UserNotAuthorizedException:
3851
+ Raises:
3852
+ ------
3853
+ InvalidParameterException: If the API response indicates an error (non-200 status code),
3854
+ this exception is raised with details from the response content.
3855
+ PropertyServerException: If the API response indicates a server side error.
3856
+ UserNotAuthorizedException:
3096
3857
 
3097
- Notes
3098
- -----
3099
- For more information see: https://egeria-project.org/concepts/deployed-implementation-type
3858
+ Notes
3859
+ -----
3860
+ For more information see: https://egeria-project.org/concepts/deployed-implementation-type
3100
3861
  """
3101
3862
 
3102
3863
  loop = asyncio.get_event_loop()
3103
3864
  response = loop.run_until_complete(
3104
- self._async_find_technology_types(search_string, server, start_from, page_size, starts_with, ends_with,
3105
- ignore_case))
3865
+ self._async_find_technology_types(
3866
+ search_string,
3867
+ server,
3868
+ start_from,
3869
+ page_size,
3870
+ starts_with,
3871
+ ends_with,
3872
+ ignore_case,
3873
+ )
3874
+ )
3106
3875
  return response
3107
3876
 
3108
- async def _async_get_all_technology_types(self, server: str = None, start_from: int = 0,
3109
- page_size: int = max_paging_size) -> list | str:
3877
+ async def _async_get_all_technology_types(
3878
+ self, server: str = None, start_from: int = 0, page_size: int = max_paging_size
3879
+ ) -> list | str:
3110
3880
  """Get all technology types - async version"""
3111
- return await self._async_find_technology_types("*", server, start_from, page_size)
3881
+ return await self._async_find_technology_types(
3882
+ "*", server, start_from, page_size
3883
+ )
3112
3884
 
3113
- def get_all_technology_types(self, server: str = None, start_from: int = 0,
3114
- page_size: int = max_paging_size) -> list | str:
3885
+ def get_all_technology_types(
3886
+ self, server: str = None, start_from: int = 0, page_size: int = max_paging_size
3887
+ ) -> list | str:
3115
3888
  """Get all technology types"""
3116
3889
  return self.find_technology_types("*", server, start_from, page_size)
3117
3890
 
3118
3891
  def print_engine_action_summary(self, governance_action: dict):
3119
- """ print_governance_action_summary
3892
+ """print_governance_action_summary
3120
3893
 
3121
- Print all the governance actions with their status, in the server.
3894
+ Print all the governance actions with their status, in the server.
3122
3895
 
3123
- Parameters
3124
- ----------
3896
+ Parameters
3897
+ ----------
3125
3898
 
3126
- Returns
3127
- -------
3899
+ Returns
3900
+ -------
3128
3901
 
3129
- Raises
3130
- ------
3131
- InvalidParameterException
3132
- PropertyServerException
3133
- UserNotAuthorizedException
3134
- """
3902
+ Raises
3903
+ ------
3904
+ InvalidParameterException
3905
+ PropertyServerException
3906
+ UserNotAuthorizedException
3907
+ """
3135
3908
  if governance_action:
3136
- name = governance_action.get('displayName')
3909
+ name = governance_action.get("displayName")
3137
3910
  if not name:
3138
- name = governance_action.get('qualifiedName')
3139
- action_status = governance_action.get('action_status')
3140
- if governance_action.get('completion_guards'):
3141
- completion_guards = governance_action.get('completion_guards')
3911
+ name = governance_action.get("qualifiedName")
3912
+ action_status = governance_action.get("action_status")
3913
+ if governance_action.get("completion_guards"):
3914
+ completion_guards = governance_action.get("completion_guards")
3142
3915
  else:
3143
3916
  completion_guards = "\t"
3144
- if governance_action.get('process_name'):
3145
- process_name = governance_action.get('process_name')
3917
+ if governance_action.get("process_name"):
3918
+ process_name = governance_action.get("process_name")
3146
3919
  else:
3147
3920
  process_name = "\t"
3148
- if governance_action.get('completion_message'):
3149
- completion_message = governance_action.get('completion_message')
3921
+ if governance_action.get("completion_message"):
3922
+ completion_message = governance_action.get("completion_message")
3150
3923
  else:
3151
3924
  completion_message = ""
3152
- print(action_status + "\n\t| " + name + "\t| " + process_name + "\t| " + '%s' % ', '.join(
3153
- map(str, completion_guards)) + "\t| " + completion_message)
3925
+ print(
3926
+ action_status
3927
+ + "\n\t| "
3928
+ + name
3929
+ + "\t| "
3930
+ + process_name
3931
+ + "\t| "
3932
+ + "%s" % ", ".join(map(str, completion_guards))
3933
+ + "\t| "
3934
+ + completion_message
3935
+ )
3154
3936
 
3155
3937
  def print_engine_actions(self):
3156
- """ print_governance_actions
3938
+ """print_governance_actions
3157
3939
 
3158
- Print all the governance actions with their status, in the server.
3940
+ Print all the governance actions with their status, in the server.
3159
3941
 
3160
- Parameters
3161
- ----------
3942
+ Parameters
3943
+ ----------
3162
3944
 
3163
- Returns
3164
- -------
3945
+ Returns
3946
+ -------
3165
3947
 
3166
- Raises
3167
- ------
3168
- InvalidParameterException
3169
- PropertyServerException
3170
- UserNotAuthorizedException
3948
+ Raises
3949
+ ------
3950
+ InvalidParameterException
3951
+ PropertyServerException
3952
+ UserNotAuthorizedException
3171
3953
 
3172
3954
  """
3173
3955
  governance_actions = self.get_engine_actions()
@@ -3175,10 +3957,16 @@ class AutomatedCuration(Client):
3175
3957
  for x in range(len(governance_actions)):
3176
3958
  self.print_engine_action_summary(governance_actions[x])
3177
3959
 
3178
- async def _async_get_technology_type_elements(self, filter: str, effective_time: str = None, server: str = None,
3179
- start_from: int = 0, page_size: int = max_paging_size,
3180
- get_templates: bool = False) -> list | str:
3181
- """ Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed
3960
+ async def _async_get_technology_type_elements(
3961
+ self,
3962
+ filter: str,
3963
+ effective_time: str = None,
3964
+ server: str = None,
3965
+ start_from: int = 0,
3966
+ page_size: int = max_paging_size,
3967
+ get_templates: bool = False,
3968
+ ) -> list | str:
3969
+ """Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed
3182
3970
  in the name. Async version.
3183
3971
 
3184
3972
  Parameters:
@@ -3218,17 +4006,25 @@ class AutomatedCuration(Client):
3218
4006
  get_templates_s = str(get_templates).lower()
3219
4007
  validate_name(filter)
3220
4008
 
3221
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/technology-types/elements?"
3222
- f"startFrom={start_from}&pageSize={page_size}&getTemplates={get_templates_s}")
4009
+ url = (
4010
+ f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/technology-types/elements?"
4011
+ f"startFrom={start_from}&pageSize={page_size}&getTemplates={get_templates_s}"
4012
+ )
3223
4013
  body = {"filter": filter, "effective_time": effective_time}
3224
4014
 
3225
4015
  response = await self._async_make_request("POST", url, body)
3226
4016
  return response.json().get("elements", "no tech found")
3227
4017
 
3228
- def get_technology_type_elements(self, filter: str, effective_time: str = None, server: str = None,
3229
- start_from: int = 0, page_size: int = max_paging_size,
3230
- get_templates: bool = False) -> list | str:
3231
- """ Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed
4018
+ def get_technology_type_elements(
4019
+ self,
4020
+ filter: str,
4021
+ effective_time: str = None,
4022
+ server: str = None,
4023
+ start_from: int = 0,
4024
+ page_size: int = max_paging_size,
4025
+ get_templates: bool = False,
4026
+ ) -> list | str:
4027
+ """Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed
3232
4028
  in the name.
3233
4029
 
3234
4030
  Parameters:
@@ -3266,6 +4062,8 @@ class AutomatedCuration(Client):
3266
4062
 
3267
4063
  loop = asyncio.get_event_loop()
3268
4064
  response = loop.run_until_complete(
3269
- self._async_get_technology_type_elements(filter, effective_time, server, start_from, page_size,
3270
- get_templates))
4065
+ self._async_get_technology_type_elements(
4066
+ filter, effective_time, server, start_from, page_size, get_templates
4067
+ )
4068
+ )
3271
4069
  return response