pyegeria 0.7.30__py3-none-any.whl → 0.7.33__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- examples/widgets/cat/list_relationships.py +70 -43
- examples/widgets/ops/monitor_engine_activity.py +6 -5
- examples/widgets/ops/monitor_engine_activity_c.py +6 -5
- examples/widgets/ops/monitor_platform_status.py +51 -28
- examples/widgets/ops/monitor_server_list.py +61 -30
- pyegeria/__init__.py +22 -2
- pyegeria/automated_curation_omvs.py +2197 -1399
- {pyegeria-0.7.30.dist-info → pyegeria-0.7.33.dist-info}/METADATA +1 -1
- {pyegeria-0.7.30.dist-info → pyegeria-0.7.33.dist-info}/RECORD +12 -12
- {pyegeria-0.7.30.dist-info → pyegeria-0.7.33.dist-info}/entry_points.txt +2 -0
- {pyegeria-0.7.30.dist-info → pyegeria-0.7.33.dist-info}/LICENSE +0 -0
- {pyegeria-0.7.30.dist-info → pyegeria-0.7.33.dist-info}/WHEEL +0 -0
@@ -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 (
|
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
|
-
"""
|
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__(
|
36
|
-
|
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(
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
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
|
-
"""
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
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(
|
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(
|
142
|
-
|
143
|
-
|
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
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
165
|
+
Parameters
|
166
|
+
----------
|
167
|
+
kafka_server : str
|
168
|
+
The name of the Kafka server.
|
149
169
|
|
150
|
-
|
151
|
-
|
170
|
+
host_name : str
|
171
|
+
The host name of the Kafka server.
|
152
172
|
|
153
|
-
|
154
|
-
|
173
|
+
port : str
|
174
|
+
The port number of the Kafka server.
|
155
175
|
|
156
|
-
|
157
|
-
|
176
|
+
description: str, opt
|
177
|
+
A description of the Kafka server.
|
158
178
|
|
159
|
-
|
160
|
-
|
179
|
+
server : str, optional
|
180
|
+
The name of the view server to use. Default uses the client instance.
|
161
181
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
182
|
+
Returns
|
183
|
+
-------
|
184
|
+
str
|
185
|
+
The GUID of the Kafka server element.
|
166
186
|
"""
|
167
187
|
|
168
|
-
body = {
|
169
|
-
|
170
|
-
|
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(
|
176
|
-
|
177
|
-
|
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
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
212
|
+
Parameters
|
213
|
+
----------
|
214
|
+
kafka_server : str
|
215
|
+
The name of the Kafka server.
|
183
216
|
|
184
|
-
|
185
|
-
|
217
|
+
host_name : str
|
218
|
+
The host name of the Kafka server.
|
186
219
|
|
187
|
-
|
188
|
-
|
220
|
+
port : str
|
221
|
+
The port number of the Kafka server.
|
189
222
|
|
190
|
-
|
191
|
-
|
223
|
+
description: str, opt
|
224
|
+
A description of the Kafka server.
|
192
225
|
|
193
|
-
|
194
|
-
|
226
|
+
server : str, optional
|
227
|
+
The name of the view server to use. Default uses the client instance.
|
195
228
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
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(
|
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(
|
207
|
-
|
208
|
-
|
209
|
-
|
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
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
254
|
+
Parameters
|
255
|
+
----------
|
256
|
+
postgres_server : str
|
257
|
+
The name of the Postgres server.
|
215
258
|
|
216
|
-
|
217
|
-
|
259
|
+
host_name : str
|
260
|
+
The host name of the Postgres server.
|
218
261
|
|
219
|
-
|
220
|
-
|
262
|
+
port : str
|
263
|
+
The port number of the Postgres server.
|
221
264
|
|
222
|
-
|
223
|
-
|
265
|
+
db_user: str
|
266
|
+
User name to connect to the database
|
224
267
|
|
225
|
-
|
226
|
-
|
268
|
+
db_pwd: str
|
269
|
+
User password to connect to the database
|
227
270
|
|
228
|
-
|
229
|
-
|
271
|
+
description: str, opt
|
272
|
+
A description of the element.
|
230
273
|
|
231
|
-
|
232
|
-
|
274
|
+
server : str, optional
|
275
|
+
The name of the view server to use. Default uses the client instance.
|
233
276
|
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
277
|
+
Returns
|
278
|
+
-------
|
279
|
+
str
|
280
|
+
The GUID of the Postgres server element.
|
238
281
|
"""
|
239
|
-
body = {
|
240
|
-
|
241
|
-
|
242
|
-
|
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(
|
248
|
-
|
249
|
-
|
250
|
-
|
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
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
310
|
+
Parameters
|
311
|
+
----------
|
312
|
+
postgres_server : str
|
313
|
+
The name of the Postgres server.
|
256
314
|
|
257
|
-
|
258
|
-
|
315
|
+
host_name : str
|
316
|
+
The host name of the Postgres server.
|
259
317
|
|
260
|
-
|
261
|
-
|
318
|
+
port : str
|
319
|
+
The port number of the Postgres server.
|
262
320
|
|
263
|
-
|
264
|
-
|
321
|
+
server : str, optional
|
322
|
+
The name of the view server to use. Default uses the client instance.
|
265
323
|
|
266
|
-
|
267
|
-
|
324
|
+
description: str, opt
|
325
|
+
A description of the elementr.
|
268
326
|
|
269
|
-
|
270
|
-
|
327
|
+
db_user: str
|
328
|
+
User name to connect to the database
|
271
329
|
|
272
|
-
|
273
|
-
|
330
|
+
db_pwd: str
|
331
|
+
User password to connect to the database
|
274
332
|
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
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(
|
283
|
-
|
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(
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
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
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
358
|
+
Parameters
|
359
|
+
----------
|
360
|
+
path_name : str
|
361
|
+
The path including the folder..
|
296
362
|
|
297
|
-
|
298
|
-
|
363
|
+
folder_name : str
|
364
|
+
The name of the folder to create.
|
299
365
|
|
300
|
-
|
301
|
-
|
302
|
-
|
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
|
-
|
305
|
-
|
370
|
+
description: str, opt
|
371
|
+
A description of the element.
|
306
372
|
|
307
|
-
|
308
|
-
|
373
|
+
version: str, opt
|
374
|
+
version of the element - typically of the form x.y.z
|
309
375
|
|
310
|
-
|
311
|
-
|
376
|
+
server : str, optional
|
377
|
+
The name of the view server to use. Default uses the client instance.
|
312
378
|
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
379
|
+
Returns
|
380
|
+
-------
|
381
|
+
str
|
382
|
+
The GUID of the Postgres server element.
|
317
383
|
"""
|
318
|
-
body = {
|
319
|
-
|
320
|
-
|
321
|
-
|
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(
|
327
|
-
|
328
|
-
|
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
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
410
|
+
Parameters
|
411
|
+
----------
|
412
|
+
path_name : str
|
413
|
+
The path including the folder..
|
334
414
|
|
335
|
-
|
336
|
-
|
415
|
+
folder_name : str
|
416
|
+
The name of the folder to create.
|
337
417
|
|
338
|
-
|
339
|
-
|
340
|
-
|
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
|
-
|
343
|
-
|
422
|
+
description: str, opt
|
423
|
+
A description of the element.
|
344
424
|
|
345
|
-
|
346
|
-
|
425
|
+
version: str, opt
|
426
|
+
version of the element - typically of the form x.y.z
|
347
427
|
|
348
|
-
|
349
|
-
|
428
|
+
server : str, optional
|
429
|
+
The name of the view server to use. Default uses the client instance.
|
350
430
|
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
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(
|
359
|
-
|
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(
|
363
|
-
|
364
|
-
|
365
|
-
|
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 = {
|
393
|
-
|
394
|
-
|
395
|
-
|
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(
|
401
|
-
|
402
|
-
|
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(
|
432
|
-
|
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(
|
436
|
-
|
437
|
-
|
438
|
-
|
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 = {
|
463
|
-
|
464
|
-
|
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(
|
470
|
-
|
471
|
-
|
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(
|
498
|
-
|
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(
|
502
|
-
|
503
|
-
|
504
|
-
|
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 = {
|
532
|
-
|
533
|
-
|
534
|
-
|
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(
|
540
|
-
|
541
|
-
|
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(
|
571
|
-
|
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(
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
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 = {
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
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(
|
627
|
-
|
628
|
-
|
629
|
-
|
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(
|
668
|
-
|
669
|
-
|
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(
|
673
|
-
|
674
|
-
|
675
|
-
|
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 = {
|
706
|
-
|
707
|
-
|
708
|
-
|
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(
|
714
|
-
|
715
|
-
|
716
|
-
|
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(
|
749
|
-
|
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(
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
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 = {
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
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(
|
802
|
-
|
803
|
-
|
804
|
-
|
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(
|
842
|
-
|
843
|
-
|
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(
|
850
|
-
|
851
|
-
|
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 = (
|
879
|
-
|
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(
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
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
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
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
|
-
|
907
|
-
|
908
|
-
|
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(
|
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(
|
915
|
-
|
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 = (
|
942
|
-
|
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
|
-
"""
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
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
|
-
|
955
|
-
|
1211
|
+
server : str, optional
|
1212
|
+
The name of the server. If not provided, the default server name will be used.
|
956
1213
|
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
1214
|
+
Returns
|
1215
|
+
-------
|
1216
|
+
dict
|
1217
|
+
The JSON representation of the engine action.
|
961
1218
|
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
1219
|
+
Raises
|
1220
|
+
------
|
1221
|
+
InvalidParameterException
|
1222
|
+
PropertyServerException
|
1223
|
+
UserNotAuthorizedException
|
967
1224
|
|
968
|
-
|
969
|
-
|
970
|
-
|
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(
|
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(
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
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
|
-
|
984
|
-
|
1244
|
+
server : str, optional
|
1245
|
+
The name of the server. If not provided, the default server name will be used.
|
985
1246
|
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
1247
|
+
Returns
|
1248
|
+
-------
|
1249
|
+
dict
|
1250
|
+
The JSON representation of the engine action.
|
990
1251
|
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
1252
|
+
Raises
|
1253
|
+
------
|
1254
|
+
InvalidParameterException
|
1255
|
+
PropertyServerException
|
1256
|
+
UserNotAuthorizedException
|
996
1257
|
|
997
|
-
|
998
|
-
|
999
|
-
|
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 = (
|
1005
|
-
|
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
|
-
"""
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
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
|
-
|
1017
|
-
|
1279
|
+
server : str, optional
|
1280
|
+
The name of the server. If not provided, the default server name will be used.
|
1018
1281
|
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1282
|
+
Returns
|
1283
|
+
-------
|
1284
|
+
dict
|
1285
|
+
The JSON representation of the engine action.
|
1023
1286
|
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1287
|
+
Raises
|
1288
|
+
------
|
1289
|
+
InvalidParameterException
|
1290
|
+
PropertyServerException
|
1291
|
+
UserNotAuthorizedException
|
1029
1292
|
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
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(
|
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(
|
1039
|
-
|
1040
|
-
|
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
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
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
|
-
|
1052
|
-
|
1053
|
-
|
1317
|
+
Returns:
|
1318
|
+
-------
|
1319
|
+
List[dict]: A list of JSON representations of governance action processes matching the provided name.
|
1054
1320
|
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
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
|
-
|
1061
|
-
|
1062
|
-
|
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 = (
|
1068
|
-
|
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(
|
1074
|
-
|
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(
|
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(
|
1103
|
-
|
1104
|
-
|
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 = (
|
1139
|
-
|
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(
|
1145
|
-
|
1146
|
-
|
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(
|
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(
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
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 = (
|
1234
|
-
|
1235
|
-
|
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(
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
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(
|
1287
|
-
|
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(
|
1295
|
-
|
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
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
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
|
-
|
1305
|
-
|
1306
|
-
|
1616
|
+
Returns:
|
1617
|
+
-------
|
1618
|
+
dict: The JSON representation of the governance action process element.
|
1307
1619
|
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
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 = (
|
1320
|
-
|
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(
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
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
|
-
|
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
|
-
|
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 = (
|
1376
|
-
|
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(
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
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(
|
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(
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
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 = (
|
1441
|
-
|
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(
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
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(
|
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(
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
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 = (
|
1529
|
-
|
1530
|
-
|
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(
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
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(
|
1584
|
-
|
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(
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
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
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
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(
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
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(
|
1669
|
-
|
1670
|
-
|
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(
|
1674
|
-
|
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 = (
|
1697
|
-
|
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(
|
1703
|
-
|
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(
|
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(
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
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
|
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(
|
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(
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
|
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
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
2220
|
+
Parameters
|
2221
|
+
----------
|
2222
|
+
search_string : str
|
2223
|
+
The string used for searching engine actions by name.
|
1797
2224
|
|
1798
|
-
|
1799
|
-
|
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
|
-
|
1802
|
-
|
2228
|
+
starts_with : bool, optional
|
2229
|
+
Whether to search engine actions that start with the given search string. Default is False.
|
1803
2230
|
|
1804
|
-
|
1805
|
-
|
2231
|
+
ends_with : bool, optional
|
2232
|
+
Whether to search engine actions that end with the given search string. Default is False.
|
1806
2233
|
|
1807
|
-
|
1808
|
-
|
2234
|
+
ignore_case : bool, optional
|
2235
|
+
Whether to ignore case while searching engine actions. Default is False.
|
1809
2236
|
|
1810
|
-
|
1811
|
-
|
2237
|
+
start_from : int, optional
|
2238
|
+
The index from which to start fetching the engine actions. Default is 0.
|
1812
2239
|
|
1813
|
-
|
1814
|
-
|
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
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
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
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
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 = (
|
1839
|
-
|
1840
|
-
|
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(
|
1846
|
-
|
1847
|
-
|
1848
|
-
|
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
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
2286
|
+
Parameters
|
2287
|
+
----------
|
2288
|
+
search_string : str
|
2289
|
+
The string used for searching engine actions by name.
|
1854
2290
|
|
1855
|
-
|
1856
|
-
|
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
|
-
|
1859
|
-
|
2294
|
+
starts_with : bool, optional
|
2295
|
+
Whether to search engine actions that start with the given search string. Default is False.
|
1860
2296
|
|
1861
|
-
|
1862
|
-
|
2297
|
+
ends_with : bool, optional
|
2298
|
+
Whether to search engine actions that end with the given search string. Default is False.
|
1863
2299
|
|
1864
|
-
|
1865
|
-
|
2300
|
+
ignore_case : bool, optional
|
2301
|
+
Whether to ignore case while searching engine actions. Default is False.
|
1866
2302
|
|
1867
|
-
|
1868
|
-
|
2303
|
+
start_from : int, optional
|
2304
|
+
The index from which to start fetching the engine actions. Default is 0.
|
1869
2305
|
|
1870
|
-
|
1871
|
-
|
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
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
|
1877
|
-
|
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
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
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(
|
1889
|
-
|
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(
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
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 = (
|
1930
|
-
|
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 = {
|
1933
|
-
|
1934
|
-
|
1935
|
-
|
1936
|
-
|
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(
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
|
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(
|
1979
|
-
|
1980
|
-
|
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(
|
1988
|
-
|
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 = (
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
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(
|
2001
|
-
|
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(
|
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(
|
2007
|
-
|
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 = (
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
|
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(
|
2020
|
-
|
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(
|
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(
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
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 = (
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2065
|
-
|
2066
|
-
|
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(
|
2071
|
-
|
2072
|
-
|
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(
|
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(
|
2112
|
-
|
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 = (
|
2115
|
-
|
2116
|
-
|
2117
|
-
|
2118
|
-
|
2119
|
-
|
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
|
-
"""
|
2659
|
+
"""Initiate a file survey"""
|
2125
2660
|
loop = asyncio.get_event_loop()
|
2126
|
-
response = loop.run_until_complete(
|
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(
|
2130
|
-
|
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 = (
|
2147
|
-
|
2148
|
-
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2152
|
-
|
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(
|
2157
|
-
|
2158
|
-
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
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
|
-
|
2164
|
-
|
2713
|
+
server : str, optional
|
2714
|
+
The name of the server. If not provided, the default server name is used.
|
2165
2715
|
|
2166
|
-
|
2167
|
-
|
2168
|
-
|
2169
|
-
|
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(
|
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(
|
2177
|
-
|
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 = (
|
2194
|
-
|
2195
|
-
|
2196
|
-
|
2197
|
-
|
2198
|
-
|
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
|
-
"""
|
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(
|
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(
|
2223
|
-
|
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 = (
|
2240
|
-
|
2241
|
-
|
2242
|
-
|
2243
|
-
|
2244
|
-
|
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
|
-
"""
|
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(
|
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(
|
2411
|
-
|
2412
|
-
|
2413
|
-
|
2414
|
-
|
2415
|
-
|
2416
|
-
|
2417
|
-
|
2418
|
-
|
2419
|
-
|
2420
|
-
|
2421
|
-
|
2422
|
-
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2426
|
-
|
2427
|
-
|
2428
|
-
|
2429
|
-
|
2430
|
-
|
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
|
-
|
2442
|
-
|
2443
|
-
|
2444
|
-
|
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
|
-
|
2447
|
-
|
2448
|
-
|
2449
|
-
|
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 = (
|
2455
|
-
|
2456
|
-
|
2457
|
-
|
2458
|
-
|
2459
|
-
|
2460
|
-
|
2461
|
-
|
2462
|
-
|
2463
|
-
|
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(
|
2469
|
-
|
2470
|
-
|
2471
|
-
|
2472
|
-
|
2473
|
-
|
2474
|
-
|
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
|
-
|
2477
|
-
|
2478
|
-
|
2479
|
-
|
2480
|
-
|
2481
|
-
|
2482
|
-
|
2483
|
-
|
2484
|
-
|
2485
|
-
|
2486
|
-
|
2487
|
-
|
2488
|
-
|
2489
|
-
|
2490
|
-
|
2491
|
-
|
2492
|
-
|
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
|
-
|
2499
|
-
|
2500
|
-
|
2501
|
-
|
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
|
-
|
2504
|
-
|
2505
|
-
|
2506
|
-
|
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(
|
2511
|
-
|
2512
|
-
|
2513
|
-
|
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(
|
2517
|
-
|
2518
|
-
|
2519
|
-
|
2520
|
-
|
2521
|
-
|
2522
|
-
|
2523
|
-
|
2524
|
-
|
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
|
-
|
2570
|
-
|
2571
|
-
|
2572
|
-
|
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("
|
3182
|
+
return response.json().get("elements", "no targets")
|
2603
3183
|
|
2604
|
-
def
|
2605
|
-
|
2606
|
-
|
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
|
-
|
2609
|
-
|
2610
|
-
|
2611
|
-
|
2612
|
-
|
2613
|
-
|
2614
|
-
|
2615
|
-
|
2616
|
-
|
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
|
-
|
2619
|
-
|
2620
|
-
|
2621
|
-
|
2622
|
-
|
2623
|
-
|
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(
|
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
|
2631
|
-
|
2632
|
-
|
2633
|
-
|
2634
|
-
|
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
|
-
|
2639
|
-
|
2640
|
-
|
2641
|
-
The GUID (Globally Unique Identifier)
|
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
|
-
|
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(
|
2674
|
-
validate_guid(metadata_element_guid)
|
3243
|
+
validate_guid(relationship_guid)
|
2675
3244
|
|
2676
|
-
url = (
|
2677
|
-
|
2678
|
-
|
2679
|
-
|
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("
|
2684
|
-
return response.json().get(
|
3250
|
+
response = await self._async_make_request("GET", url)
|
3251
|
+
return response.json().get("element", "no actions")
|
2685
3252
|
|
2686
|
-
def
|
2687
|
-
|
2688
|
-
|
2689
|
-
|
2690
|
-
|
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
|
-
|
2694
|
-
|
2695
|
-
|
2696
|
-
The GUID (Globally Unique Identifier)
|
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
|
-
|
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.
|
2730
|
-
|
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
|
2735
|
-
|
2736
|
-
|
2737
|
-
|
2738
|
-
|
2739
|
-
|
2740
|
-
|
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
|
-
|
2743
|
-
|
2744
|
-
|
2745
|
-
|
2746
|
-
|
2747
|
-
|
2748
|
-
|
2749
|
-
|
2750
|
-
|
2751
|
-
|
2752
|
-
|
2753
|
-
|
2754
|
-
|
2755
|
-
|
2756
|
-
|
2757
|
-
|
2758
|
-
|
2759
|
-
|
2760
|
-
|
2761
|
-
|
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
|
-
|
2764
|
-
|
2765
|
-
|
3322
|
+
Returns:
|
3323
|
+
-------
|
3324
|
+
Relationship GUID for the catalog target,
|
2766
3325
|
|
2767
|
-
|
2768
|
-
|
2769
|
-
|
2770
|
-
|
2771
|
-
|
2772
|
-
|
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 = (
|
2778
|
-
|
2779
|
-
|
2780
|
-
|
2781
|
-
|
2782
|
-
|
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(
|
2787
|
-
|
2788
|
-
|
2789
|
-
|
2790
|
-
|
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(
|
2816
|
-
|
2817
|
-
|
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(
|
2821
|
-
|
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
|
-
|
2824
|
-
|
2825
|
-
|
2826
|
-
|
2827
|
-
|
2828
|
-
|
2829
|
-
|
2830
|
-
|
2831
|
-
|
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
|
-
|
2834
|
-
|
2835
|
-
|
2836
|
-
|
2837
|
-
|
2838
|
-
|
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 = (
|
2844
|
-
|
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
|
-
"""
|
3571
|
+
"""Remove a catalog target to an integration connector.
|
2851
3572
|
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2855
|
-
|
2856
|
-
|
2857
|
-
|
2858
|
-
|
2859
|
-
|
2860
|
-
|
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
|
-
|
2863
|
-
|
2864
|
-
|
2865
|
-
|
2866
|
-
|
2867
|
-
|
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(
|
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(
|
2879
|
-
|
2880
|
-
|
2881
|
-
|
2882
|
-
|
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
|
-
|
2885
|
-
|
2886
|
-
|
2887
|
-
|
2888
|
-
|
2889
|
-
|
2890
|
-
|
2891
|
-
|
2892
|
-
|
2893
|
-
|
2894
|
-
|
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
|
-
|
2897
|
-
|
2898
|
-
|
2899
|
-
|
2900
|
-
|
2901
|
-
|
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
|
-
|
2904
|
-
|
2905
|
-
|
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 = (
|
2910
|
-
|
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(
|
2917
|
-
|
2918
|
-
|
2919
|
-
|
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
|
-
|
2922
|
-
|
2923
|
-
|
2924
|
-
|
2925
|
-
|
2926
|
-
|
2927
|
-
|
2928
|
-
|
2929
|
-
|
2930
|
-
|
2931
|
-
|
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
|
-
|
2934
|
-
|
2935
|
-
|
2936
|
-
|
2937
|
-
|
2938
|
-
|
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
|
-
|
2941
|
-
|
2942
|
-
|
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(
|
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(
|
2950
|
-
|
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(
|
2986
|
-
|
2987
|
-
|
2988
|
-
|
2989
|
-
|
2990
|
-
|
2991
|
-
|
2992
|
-
|
2993
|
-
|
2994
|
-
|
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
|
-
|
2997
|
-
|
2998
|
-
|
2999
|
-
|
3000
|
-
|
3001
|
-
|
3002
|
-
|
3003
|
-
|
3004
|
-
|
3005
|
-
|
3006
|
-
|
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
|
-
|
3009
|
-
|
3010
|
-
|
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(
|
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(
|
3018
|
-
|
3019
|
-
|
3020
|
-
|
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
|
-
|
3023
|
-
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
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
|
-
|
3030
|
-
|
3781
|
+
starts_with : bool, optional
|
3782
|
+
Whether to search engine actions that start with the given search string. Default is False.
|
3031
3783
|
|
3032
|
-
|
3033
|
-
|
3784
|
+
ends_with : bool, optional
|
3785
|
+
Whether to search engine actions that end with the given search string. Default is False.
|
3034
3786
|
|
3035
|
-
|
3036
|
-
|
3787
|
+
ignore_case : bool, optional
|
3788
|
+
Whether to ignore case while searching engine actions. Default is True.
|
3037
3789
|
|
3038
|
-
|
3039
|
-
|
3790
|
+
start_from : int, optional
|
3791
|
+
The index from which to start fetching the engine actions. Default is 0.
|
3040
3792
|
|
3041
|
-
|
3042
|
-
|
3043
|
-
|
3044
|
-
|
3045
|
-
|
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
|
-
|
3048
|
-
|
3049
|
-
|
3050
|
-
|
3051
|
-
|
3052
|
-
|
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
|
-
|
3055
|
-
|
3056
|
-
|
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 = (
|
3068
|
-
|
3069
|
-
|
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(
|
3076
|
-
|
3077
|
-
|
3078
|
-
|
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
|
-
|
3081
|
-
|
3082
|
-
|
3083
|
-
|
3084
|
-
|
3085
|
-
|
3086
|
-
|
3087
|
-
|
3088
|
-
|
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
|
-
|
3091
|
-
|
3092
|
-
|
3093
|
-
|
3094
|
-
|
3095
|
-
|
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
|
-
|
3098
|
-
|
3099
|
-
|
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(
|
3105
|
-
|
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(
|
3109
|
-
|
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(
|
3881
|
+
return await self._async_find_technology_types(
|
3882
|
+
"*", server, start_from, page_size
|
3883
|
+
)
|
3112
3884
|
|
3113
|
-
def get_all_technology_types(
|
3114
|
-
|
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
|
-
"""
|
3892
|
+
"""print_governance_action_summary
|
3120
3893
|
|
3121
|
-
|
3894
|
+
Print all the governance actions with their status, in the server.
|
3122
3895
|
|
3123
|
-
|
3124
|
-
|
3896
|
+
Parameters
|
3897
|
+
----------
|
3125
3898
|
|
3126
|
-
|
3127
|
-
|
3899
|
+
Returns
|
3900
|
+
-------
|
3128
3901
|
|
3129
|
-
|
3130
|
-
|
3131
|
-
|
3132
|
-
|
3133
|
-
|
3134
|
-
|
3902
|
+
Raises
|
3903
|
+
------
|
3904
|
+
InvalidParameterException
|
3905
|
+
PropertyServerException
|
3906
|
+
UserNotAuthorizedException
|
3907
|
+
"""
|
3135
3908
|
if governance_action:
|
3136
|
-
name = governance_action.get(
|
3909
|
+
name = governance_action.get("displayName")
|
3137
3910
|
if not name:
|
3138
|
-
name = governance_action.get(
|
3139
|
-
action_status = governance_action.get(
|
3140
|
-
if governance_action.get(
|
3141
|
-
completion_guards = governance_action.get(
|
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(
|
3145
|
-
process_name = governance_action.get(
|
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(
|
3149
|
-
completion_message = governance_action.get(
|
3921
|
+
if governance_action.get("completion_message"):
|
3922
|
+
completion_message = governance_action.get("completion_message")
|
3150
3923
|
else:
|
3151
3924
|
completion_message = ""
|
3152
|
-
print(
|
3153
|
-
|
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
|
-
"""
|
3938
|
+
"""print_governance_actions
|
3157
3939
|
|
3158
|
-
|
3940
|
+
Print all the governance actions with their status, in the server.
|
3159
3941
|
|
3160
|
-
|
3161
|
-
|
3942
|
+
Parameters
|
3943
|
+
----------
|
3162
3944
|
|
3163
|
-
|
3164
|
-
|
3945
|
+
Returns
|
3946
|
+
-------
|
3165
3947
|
|
3166
|
-
|
3167
|
-
|
3168
|
-
|
3169
|
-
|
3170
|
-
|
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(
|
3179
|
-
|
3180
|
-
|
3181
|
-
|
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 = (
|
3222
|
-
|
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(
|
3229
|
-
|
3230
|
-
|
3231
|
-
|
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(
|
3270
|
-
|
4065
|
+
self._async_get_technology_type_elements(
|
4066
|
+
filter, effective_time, server, start_from, page_size, get_templates
|
4067
|
+
)
|
4068
|
+
)
|
3271
4069
|
return response
|