pyegeria 0.7.45.1__py3-none-any.whl → 0.8.1__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_cert_types.py +61 -43
- examples/widgets/cat/list_projects.py +1 -1
- examples/widgets/my/my_profile_actions.py +51 -32
- examples/widgets/ops/engine_actions.py +35 -23
- examples/widgets/ops/integration_daemon_actions.py +51 -32
- examples/widgets/tech/get_element_info.py +63 -38
- examples/widgets/tech/get_guid_info.py +50 -27
- examples/widgets/tech/list_asset_types.py +33 -23
- examples/widgets/tech/list_elements.py +44 -34
- examples/widgets/tech/list_elements_x.py +69 -49
- examples/widgets/tech/list_registered_services.py +44 -24
- examples/widgets/tech/list_related_specification.py +70 -45
- examples/widgets/tech/list_relationship_types.py +50 -31
- examples/widgets/tech/list_valid_metadata_values.py +57 -28
- examples/widgets/tech/x_list_related_elements.py +54 -34
- pyegeria/Xloaded_resources_omvs.py +43 -41
- pyegeria/__init__.py +6 -2
- pyegeria/_client.py +142 -102
- pyegeria/_deprecated_gov_engine.py +218 -167
- pyegeria/action_author_omvs.py +107 -88
- pyegeria/asset_catalog_omvs.py +467 -395
- pyegeria/automated_curation_omvs.py +2 -2
- pyegeria/classification_manager_omvs.py +3 -9
- pyegeria/collection_manager_omvs.py +1957 -1519
- pyegeria/core_omag_server_config.py +310 -192
- pyegeria/egeria_cat_client.py +88 -0
- pyegeria/egeria_config_client.py +37 -0
- pyegeria/egeria_my_client.py +47 -0
- pyegeria/egeria_ops_client.py +67 -0
- pyegeria/egeria_tech_client.py +77 -0
- pyegeria/feedback_manager_omvs.py +633 -631
- pyegeria/full_omag_server_config.py +330 -158
- pyegeria/glossary_browser_omvs.py +927 -474
- pyegeria/glossary_manager_omvs.py +1033 -543
- pyegeria/my_profile_omvs.py +714 -574
- pyegeria/platform_services.py +228 -176
- pyegeria/project_manager_omvs.py +1158 -903
- pyegeria/registered_info.py +76 -74
- pyegeria/runtime_manager_omvs.py +749 -670
- pyegeria/server_operations.py +123 -85
- pyegeria/valid_metadata_omvs.py +268 -168
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.1.dist-info}/METADATA +1 -1
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.1.dist-info}/RECORD +46 -42
- pyegeria/tech_guids_31-08-2024 14:33.py +0 -79
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.1.dist-info}/LICENSE +0 -0
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.1.dist-info}/WHEEL +0 -0
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.1.dist-info}/entry_points.txt +0 -0
pyegeria/my_profile_omvs.py
CHANGED
@@ -35,17 +35,21 @@ class MyProfile(Client):
|
|
35
35
|
"""
|
36
36
|
|
37
37
|
def __init__(
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
sync_mode: bool = True
|
38
|
+
self,
|
39
|
+
server_name: str,
|
40
|
+
platform_url: str,
|
41
|
+
token: str = None,
|
42
|
+
user_id: str = None,
|
43
|
+
user_pwd: str = None,
|
45
44
|
):
|
46
|
-
|
47
|
-
|
48
|
-
|
45
|
+
Client.__init__(
|
46
|
+
self,
|
47
|
+
server_name,
|
48
|
+
platform_url,
|
49
|
+
user_id=user_id,
|
50
|
+
user_pwd=user_pwd,
|
51
|
+
token=token,
|
52
|
+
)
|
49
53
|
self.my_profile_command_root: str = f"{platform_url}/servers"
|
50
54
|
|
51
55
|
#
|
@@ -53,7 +57,7 @@ class MyProfile(Client):
|
|
53
57
|
#
|
54
58
|
|
55
59
|
async def _async_get_my_profile(self, server_name: str = None) -> dict | str:
|
56
|
-
"""
|
60
|
+
"""Get the profile of the user associated with the token used.
|
57
61
|
|
58
62
|
Parameters
|
59
63
|
----------
|
@@ -79,44 +83,52 @@ class MyProfile(Client):
|
|
79
83
|
"""
|
80
84
|
if server_name is None:
|
81
85
|
server_name = self.server_name
|
82
|
-
url =
|
86
|
+
url = (
|
87
|
+
f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile"
|
88
|
+
)
|
83
89
|
|
84
90
|
response = await self._async_make_request("GET", url)
|
85
91
|
return response
|
86
92
|
|
87
93
|
def get_my_profile(self, server_name: str = None) -> dict | str:
|
88
|
-
"""
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
94
|
+
"""Get the profile of the user associated with the token used.
|
95
|
+
|
96
|
+
Parameters
|
97
|
+
----------
|
98
|
+
server_name : str, optional
|
99
|
+
The name of the server to configure.
|
100
|
+
If not provided, the server name associated with the instance is used.
|
101
|
+
|
102
|
+
Returns
|
103
|
+
-------
|
104
|
+
List | str
|
105
|
+
|
106
|
+
Profile details as a dict.
|
107
|
+
|
108
|
+
Raises
|
109
|
+
------
|
110
|
+
|
111
|
+
InvalidParameterException
|
112
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
113
|
+
PropertyServerException
|
114
|
+
Raised by the server when an issue arises in processing a valid request
|
115
|
+
NotAuthorizedException
|
116
|
+
The principle specified by the user_id does not have authorization for the requested action
|
117
|
+
"""
|
112
118
|
loop = asyncio.get_event_loop()
|
113
119
|
response = loop.run_until_complete(self._async_get_my_profile(server_name))
|
114
120
|
|
115
121
|
return response.json().get("personalProfile", "No one found")
|
116
122
|
|
117
|
-
async def _async_get_assigned_actions(
|
118
|
-
|
119
|
-
|
123
|
+
async def _async_get_assigned_actions(
|
124
|
+
self,
|
125
|
+
actor_guid: str,
|
126
|
+
status: str = "OPEN",
|
127
|
+
server_name: str = None,
|
128
|
+
start_from: int = 0,
|
129
|
+
page_size: int = 100,
|
130
|
+
) -> list | str:
|
131
|
+
"""Get assigned actions for the actor. Async version.
|
120
132
|
|
121
133
|
Parameters
|
122
134
|
----------
|
@@ -153,16 +165,24 @@ class MyProfile(Client):
|
|
153
165
|
|
154
166
|
body = {"status": status}
|
155
167
|
|
156
|
-
url = (
|
157
|
-
|
168
|
+
url = (
|
169
|
+
f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/actors/{actor_guid}"
|
170
|
+
f"/assigned/to-dos?startFrom={start_from}&pageSize={page_size}&"
|
171
|
+
)
|
158
172
|
|
159
173
|
response = await self._async_make_request("POST", url, body)
|
160
174
|
|
161
175
|
return response.json().get("elements", "No entries found")
|
162
176
|
|
163
|
-
def get_assigned_actions(
|
164
|
-
|
165
|
-
|
177
|
+
def get_assigned_actions(
|
178
|
+
self,
|
179
|
+
actor_guid: str,
|
180
|
+
status: str = "OPEN",
|
181
|
+
server_name: str = None,
|
182
|
+
start_from: int = 0,
|
183
|
+
page_size: int = 100,
|
184
|
+
) -> list | str:
|
185
|
+
"""Get assigned actions for the actor.
|
166
186
|
Parameters
|
167
187
|
----------
|
168
188
|
actor_guid: str
|
@@ -192,44 +212,50 @@ class MyProfile(Client):
|
|
192
212
|
"""
|
193
213
|
loop = asyncio.get_event_loop()
|
194
214
|
response = loop.run_until_complete(
|
195
|
-
self._async_get_assigned_actions(
|
196
|
-
|
215
|
+
self._async_get_assigned_actions(
|
216
|
+
actor_guid, status, server_name, start_from, page_size
|
217
|
+
)
|
197
218
|
)
|
198
219
|
|
199
220
|
return response
|
200
221
|
|
201
|
-
async def _async_get_actions_for_action_target(
|
202
|
-
|
203
|
-
|
204
|
-
|
222
|
+
async def _async_get_actions_for_action_target(
|
223
|
+
self,
|
224
|
+
element_guid: str,
|
225
|
+
status: str = "OPEN",
|
226
|
+
server_name: str = None,
|
227
|
+
start_from: int = 0,
|
228
|
+
page_size: int = 100,
|
229
|
+
) -> list | str:
|
230
|
+
"""Get actions assigned to the action target. Async version.
|
205
231
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
232
|
+
Parameters
|
233
|
+
----------
|
234
|
+
element_guid: str
|
235
|
+
The GUID of the target whose assigned actions are to be retrieved.
|
236
|
+
status: str
|
237
|
+
The status of teh action to filter on. Default value is "OPEN".
|
238
|
+
server_name: str, optional
|
239
|
+
The name of the server. If not provided, the value of self.server_name will be used.
|
240
|
+
start_from: int, optional
|
241
|
+
The index from which to start retrieving the assigned actions. Default is 0.
|
242
|
+
page_size: int, optional
|
243
|
+
The number of assigned actions to retrieve per page. Default is 100.
|
218
244
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
245
|
+
Returns
|
246
|
+
-------
|
247
|
+
list or str
|
248
|
+
A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
|
223
249
|
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
250
|
+
Raises
|
251
|
+
------
|
252
|
+
InvalidParameterException
|
253
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
254
|
+
PropertyServerException
|
255
|
+
Raised by the server when an issue arises in processing a valid request
|
256
|
+
NotAuthorizedException
|
257
|
+
The principle specified by the user_id does not have authorization for the requested action
|
258
|
+
"""
|
233
259
|
if server_name is None:
|
234
260
|
server_name = self.server_name
|
235
261
|
|
@@ -237,82 +263,97 @@ class MyProfile(Client):
|
|
237
263
|
|
238
264
|
body = {"status": status}
|
239
265
|
|
240
|
-
url = (
|
241
|
-
|
266
|
+
url = (
|
267
|
+
f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/elements/{element_guid}"
|
268
|
+
f"/action-targets/to-dos?start-from={start_from}&page-size={page_size}"
|
269
|
+
)
|
242
270
|
|
243
271
|
response = await self._async_make_request("POST", url, body)
|
244
272
|
return response.json() if response is not None else "No Results"
|
245
273
|
|
246
|
-
def get_actions_for_action_target(
|
247
|
-
|
248
|
-
|
274
|
+
def get_actions_for_action_target(
|
275
|
+
self,
|
276
|
+
element_guid: str,
|
277
|
+
status: str = "OPEN",
|
278
|
+
server_name: str = None,
|
279
|
+
start_from: int = 0,
|
280
|
+
page_size: int = 100,
|
281
|
+
) -> list | str:
|
282
|
+
"""Get actions assigned to the action target.
|
249
283
|
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
284
|
+
Parameters
|
285
|
+
----------
|
286
|
+
element_guid: str
|
287
|
+
The GUID of the target whose assigned actions are to be retrieved.
|
288
|
+
status: str
|
289
|
+
The status of teh action to filter on. Default value is "OPEN"
|
290
|
+
server_name: str, optional
|
291
|
+
The name of the server. If not provided, the value of self.server_name will be used.
|
292
|
+
start_from: int, optional
|
293
|
+
The index from which to start retrieving the assigned actions. Default is 0.
|
294
|
+
page_size: int, optional
|
295
|
+
The number of assigned actions to retrieve per page. Default is 100.
|
262
296
|
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
297
|
+
Returns
|
298
|
+
-------
|
299
|
+
list or str
|
300
|
+
A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
|
267
301
|
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
302
|
+
Raises
|
303
|
+
------
|
304
|
+
InvalidParameterException
|
305
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
306
|
+
PropertyServerException
|
307
|
+
Raised by the server when an issue arises in processing a valid request
|
308
|
+
NotAuthorizedException
|
309
|
+
The principle specified by the user_id does not have authorization for the requested action
|
310
|
+
"""
|
277
311
|
loop = asyncio.get_event_loop()
|
278
312
|
response = loop.run_until_complete(
|
279
|
-
self._async_get_actions_for_action_target(
|
280
|
-
|
313
|
+
self._async_get_actions_for_action_target(
|
314
|
+
element_guid, status, server_name, start_from, page_size
|
315
|
+
)
|
281
316
|
)
|
282
317
|
|
283
318
|
return response
|
284
319
|
|
285
|
-
async def _async_get_actions_for_sponsor(
|
286
|
-
|
287
|
-
|
320
|
+
async def _async_get_actions_for_sponsor(
|
321
|
+
self,
|
322
|
+
element_guid: str,
|
323
|
+
status: str = "",
|
324
|
+
server_name: str = None,
|
325
|
+
start_from: int = 0,
|
326
|
+
page_size: int = 100,
|
327
|
+
) -> list | str:
|
328
|
+
"""Get actions assigned to an owner. Async version.
|
288
329
|
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
330
|
+
Parameters
|
331
|
+
----------
|
332
|
+
element_guid: str
|
333
|
+
The GUID of the target whose assigned actions are to be retrieved.
|
334
|
+
status: str
|
335
|
+
The status of the action to filter on. Default value is "OPEN".
|
336
|
+
server_name: str, optional
|
337
|
+
The name of the server. If not provided, the value of self.server_name will be used.
|
338
|
+
start_from: int, optional
|
339
|
+
The index from which to start retrieving the assigned actions. Default is 0.
|
340
|
+
page_size: int, optional
|
341
|
+
The number of assigned actions to retrieve per page. Default is 100.
|
301
342
|
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
343
|
+
Returns
|
344
|
+
-------
|
345
|
+
list or str
|
346
|
+
A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
|
306
347
|
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
348
|
+
Raises
|
349
|
+
------
|
350
|
+
InvalidParameterException
|
351
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
352
|
+
PropertyServerException
|
353
|
+
Raised by the server when an issue arises in processing a valid request
|
354
|
+
NotAuthorizedException
|
355
|
+
The principle specified by the user_id does not have authorization for the requested action
|
356
|
+
"""
|
316
357
|
if server_name is None:
|
317
358
|
server_name = self.server_name
|
318
359
|
|
@@ -320,50 +361,60 @@ class MyProfile(Client):
|
|
320
361
|
|
321
362
|
body = {"status": status}
|
322
363
|
|
323
|
-
url = (
|
324
|
-
|
364
|
+
url = (
|
365
|
+
f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/elements/{element_guid}"
|
366
|
+
f"/sponsored/to-dos?startFrom={start_from}&pageSize={page_size}"
|
367
|
+
)
|
325
368
|
|
326
369
|
response = await self._async_make_request("POST", url, body)
|
327
370
|
return response.json() if response is not None else "No Results"
|
328
371
|
|
329
|
-
def get_actions_for_sponsor(
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
372
|
+
def get_actions_for_sponsor(
|
373
|
+
self,
|
374
|
+
element_guid: str,
|
375
|
+
status: str = "OPEN",
|
376
|
+
server_name: str = None,
|
377
|
+
start_from: int = 0,
|
378
|
+
page_size: int = 100,
|
379
|
+
) -> list | str:
|
380
|
+
"""Get actions assigned to an owner.
|
381
|
+
Parameters
|
382
|
+
----------
|
383
|
+
element_guid: str
|
384
|
+
The GUID of the target whose assigned actions are to be retrieved.
|
385
|
+
status: str
|
386
|
+
The status of teh action to filter on. Default value is "OPEN".
|
387
|
+
server_name: str, optional
|
388
|
+
The name of the server. If not provided, the value of self.server_name will be used.
|
389
|
+
start_from: int, optional
|
390
|
+
The index from which to start retrieving the assigned actions. Default is 0.
|
391
|
+
page_size: int, optional
|
392
|
+
The number of assigned actions to retrieve per page. Default is 100.
|
344
393
|
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
394
|
+
Returns
|
395
|
+
-------
|
396
|
+
list or str
|
397
|
+
A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
|
349
398
|
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
399
|
+
Raises
|
400
|
+
------
|
401
|
+
InvalidParameterException
|
402
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
403
|
+
PropertyServerException
|
404
|
+
Raised by the server when an issue arises in processing a valid request
|
405
|
+
NotAuthorizedException
|
406
|
+
The principle specified by the user_id does not have authorization for the requested action
|
407
|
+
"""
|
359
408
|
loop = asyncio.get_event_loop()
|
360
|
-
response = loop.run_until_complete(
|
361
|
-
|
409
|
+
response = loop.run_until_complete(
|
410
|
+
self._async_get_actions_for_sponsor(
|
411
|
+
element_guid, status, server_name, start_from, page_size
|
412
|
+
)
|
362
413
|
)
|
363
414
|
return response
|
364
415
|
|
365
416
|
async def _async_create_to_do(self, body: dict, server_name: str = None) -> str:
|
366
|
-
"""
|
417
|
+
"""Create a To-Do item. Async version.
|
367
418
|
Parameters
|
368
419
|
----------
|
369
420
|
body : dict
|
@@ -394,7 +445,7 @@ class MyProfile(Client):
|
|
394
445
|
return response.json().get("guid", "No guid returned")
|
395
446
|
|
396
447
|
def create_to_do(self, body: dict, server_name: str = None) -> str:
|
397
|
-
"""
|
448
|
+
"""Create a To-Do item.
|
398
449
|
Parameters
|
399
450
|
----------
|
400
451
|
body : dict
|
@@ -434,37 +485,37 @@ class MyProfile(Client):
|
|
434
485
|
},
|
435
486
|
"assignToActorGUID": erins_guid
|
436
487
|
}
|
437
|
-
|
488
|
+
"""
|
438
489
|
loop = asyncio.get_event_loop()
|
439
|
-
response = loop.run_until_complete(
|
440
|
-
self._async_create_to_do(body, server_name)
|
441
|
-
)
|
490
|
+
response = loop.run_until_complete(self._async_create_to_do(body, server_name))
|
442
491
|
return response
|
443
492
|
|
444
|
-
async def _async_get_to_do(
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
493
|
+
async def _async_get_to_do(
|
494
|
+
self, todo_guid: str, server_name: str = None
|
495
|
+
) -> dict | str:
|
496
|
+
"""Get a To-Do item. Async version.
|
497
|
+
Parameters
|
498
|
+
----------
|
499
|
+
todo_guid: str
|
500
|
+
Identifier of the To-Do item.
|
501
|
+
server_name : str, optional
|
502
|
+
The name of the server where the to-do item will be created. If not provided,
|
503
|
+
the default server name associated with the instance of the class will be used.
|
504
|
+
|
505
|
+
Returns
|
506
|
+
-------
|
507
|
+
None
|
508
|
+
This method does not return any value.
|
509
|
+
|
510
|
+
Raises
|
511
|
+
------
|
512
|
+
InvalidParameterException
|
513
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
514
|
+
PropertyServerException
|
515
|
+
Raised by the server when an issue arises in processing a valid request
|
516
|
+
NotAuthorizedException
|
517
|
+
The principle specified by the user_id does not have authorization for the requested action
|
518
|
+
"""
|
468
519
|
if server_name is None:
|
469
520
|
server_name = self.server_name
|
470
521
|
|
@@ -477,61 +528,68 @@ class MyProfile(Client):
|
|
477
528
|
return json.loads(response.text).get("elements", "No TODO returned")
|
478
529
|
|
479
530
|
def get_to_do(self, todo_guid: str, server_name: str = None) -> dict | str:
|
480
|
-
"""
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
531
|
+
"""Get a To-Do item. Async version.
|
532
|
+
Parameters
|
533
|
+
----------
|
534
|
+
todo_guid: str
|
535
|
+
Identifier of the To-Do item.
|
536
|
+
server_name : str, optional
|
537
|
+
The name of the server where the to-do item will be created. If not provided,
|
538
|
+
the default server name associated with the instance of the class will be used.
|
539
|
+
|
540
|
+
Returns
|
541
|
+
-------
|
542
|
+
None
|
543
|
+
This method does not return any value.
|
544
|
+
|
545
|
+
Raises
|
546
|
+
------
|
547
|
+
InvalidParameterException
|
548
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
549
|
+
PropertyServerException
|
550
|
+
Raised by the server when an issue arises in processing a valid request
|
551
|
+
NotAuthorizedException
|
552
|
+
The principle specified by the user_id does not have authorization for the requested action
|
553
|
+
"""
|
503
554
|
loop = asyncio.get_event_loop()
|
504
|
-
response = loop.run_until_complete(
|
555
|
+
response = loop.run_until_complete(
|
556
|
+
self._async_get_to_do(todo_guid, server_name)
|
557
|
+
)
|
505
558
|
|
506
559
|
return response
|
507
560
|
|
508
|
-
async def _async_update_to_do(
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
561
|
+
async def _async_update_to_do(
|
562
|
+
self,
|
563
|
+
todo_guid: str,
|
564
|
+
body: dict,
|
565
|
+
is_merge_update: bool = True,
|
566
|
+
server_name: str = None,
|
567
|
+
) -> None:
|
568
|
+
"""Update a To-Do item. Async version.
|
569
|
+
Parameters
|
570
|
+
----------
|
571
|
+
todo_guid: str
|
572
|
+
Identifier of the To-Do item.
|
573
|
+
body: str
|
574
|
+
The details to update the to-do item with.
|
575
|
+
server_name : str, optional
|
576
|
+
The name of the server where the to-do item will be created. If not provided,
|
577
|
+
the default server name associated with the instance of the class will be used.
|
520
578
|
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
579
|
+
Returns
|
580
|
+
-------
|
581
|
+
None
|
582
|
+
This method does not return any value.
|
525
583
|
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
584
|
+
Raises
|
585
|
+
------
|
586
|
+
InvalidParameterException
|
587
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
588
|
+
PropertyServerException
|
589
|
+
Raised by the server when an issue arises in processing a valid request
|
590
|
+
NotAuthorizedException
|
591
|
+
The principle specified by the user_id does not have authorization for the requested action
|
592
|
+
"""
|
535
593
|
if server_name is None:
|
536
594
|
server_name = self.server_name
|
537
595
|
|
@@ -539,138 +597,153 @@ class MyProfile(Client):
|
|
539
597
|
|
540
598
|
validate_name(todo_guid)
|
541
599
|
|
542
|
-
url = (
|
543
|
-
|
600
|
+
url = (
|
601
|
+
f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
|
602
|
+
f"{todo_guid}?isMergeUpdate={is_merge_update_t}"
|
603
|
+
)
|
544
604
|
|
545
605
|
await self._async_make_request("POST", url, body)
|
546
606
|
return
|
547
607
|
|
548
|
-
def update_to_do(
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
608
|
+
def update_to_do(
|
609
|
+
self,
|
610
|
+
todo_guid: str,
|
611
|
+
body: dict,
|
612
|
+
is_merge_update: bool = True,
|
613
|
+
server_name: str = None,
|
614
|
+
) -> None:
|
615
|
+
"""Update a To-Do item.
|
616
|
+
Parameters
|
617
|
+
----------
|
618
|
+
todo_guid: str
|
619
|
+
Identifier of the To-Do item.
|
620
|
+
body: str
|
621
|
+
The details to update the to-do item with.
|
622
|
+
is_merge_update: bool [default: True]
|
623
|
+
If true then merges the updated information, otherwise replace the existing information.
|
624
|
+
server_name : str, optional
|
625
|
+
The name of the server where the to-do item will be created. If not provided,
|
626
|
+
the default server name associated with the instance of the class will be used.
|
562
627
|
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
628
|
+
Returns
|
629
|
+
-------
|
630
|
+
None
|
631
|
+
This method does not return any value.
|
567
632
|
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
633
|
+
Raises
|
634
|
+
------
|
635
|
+
InvalidParameterException
|
636
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
637
|
+
PropertyServerException
|
638
|
+
Raised by the server when an issue arises in processing a valid request
|
639
|
+
NotAuthorizedException
|
640
|
+
The principle specified by the user_id does not have authorization for the requested action
|
641
|
+
"""
|
577
642
|
|
578
643
|
loop = asyncio.get_event_loop()
|
579
|
-
loop.run_until_complete(
|
644
|
+
loop.run_until_complete(
|
645
|
+
self._async_update_to_do(todo_guid, body, is_merge_update, server_name)
|
646
|
+
)
|
580
647
|
return
|
581
648
|
|
582
|
-
async def _async_delete_to_do(
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
649
|
+
async def _async_delete_to_do(
|
650
|
+
self, todo_guid: str, server_name: str = None
|
651
|
+
) -> None:
|
652
|
+
"""Delete a To-Do item. Async version.
|
653
|
+
Parameters
|
654
|
+
----------
|
655
|
+
todo_guid: str
|
656
|
+
Identifier of the To-Do item.
|
657
|
+
server_name : str, optional
|
658
|
+
The name of the server where the to-do item will be created. If not provided,
|
659
|
+
the default server name associated with the instance of the class will be used.
|
591
660
|
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
661
|
+
Returns
|
662
|
+
-------
|
663
|
+
None
|
664
|
+
This method does not return any value.
|
596
665
|
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
666
|
+
Raises
|
667
|
+
------
|
668
|
+
InvalidParameterException
|
669
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
670
|
+
PropertyServerException
|
671
|
+
Raised by the server when an issue arises in processing a valid request
|
672
|
+
NotAuthorizedException
|
673
|
+
The principle specified by the user_id does not have authorization for the requested action
|
674
|
+
"""
|
606
675
|
if server_name is None:
|
607
676
|
server_name = self.server_name
|
608
677
|
|
609
678
|
validate_name(todo_guid)
|
610
679
|
|
611
|
-
|
612
680
|
url = f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/{todo_guid}/delete"
|
613
681
|
|
614
682
|
await self._async_make_request("POST", url)
|
615
683
|
return
|
616
684
|
|
617
685
|
def delete_to_do(self, todo_guid: str, server_name: str = None) -> None:
|
618
|
-
"""
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
686
|
+
"""Delete a To-Do item.
|
687
|
+
Parameters
|
688
|
+
----------
|
689
|
+
todo_guid: str
|
690
|
+
Identifier of the To-Do item.
|
691
|
+
server_name : str, optional
|
692
|
+
The name of the server where the to-do item will be created. If not provided,
|
693
|
+
the default server name associated with the instance of the class will be used.
|
626
694
|
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
695
|
+
Returns
|
696
|
+
-------
|
697
|
+
None
|
698
|
+
This method does not return any value.
|
631
699
|
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
700
|
+
Raises
|
701
|
+
------
|
702
|
+
InvalidParameterException
|
703
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
704
|
+
PropertyServerException
|
705
|
+
Raised by the server when an issue arises in processing a valid request
|
706
|
+
NotAuthorizedException
|
707
|
+
The principle specified by the user_id does not have authorization for the requested action
|
708
|
+
"""
|
641
709
|
loop = asyncio.get_event_loop()
|
642
710
|
loop.run_until_complete(self._async_delete_to_do(todo_guid, server_name))
|
643
711
|
return
|
644
712
|
|
645
|
-
async def _async_reassign_to_do(
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
713
|
+
async def _async_reassign_to_do(
|
714
|
+
self,
|
715
|
+
todo_guid: str,
|
716
|
+
actor_guid: str,
|
717
|
+
status: str = "OPEN",
|
718
|
+
server_name: str = None,
|
719
|
+
) -> None:
|
720
|
+
"""Reassign a To-Do item. Async version.
|
721
|
+
Parameters
|
722
|
+
----------
|
723
|
+
todo_guid: str
|
724
|
+
Identifier of the To-Do item.
|
725
|
+
actor_guid: str
|
726
|
+
The actor to receive the reassigned to-do item.
|
727
|
+
status: str [default = "OPEN"]
|
728
|
+
Filter items to match this status.
|
729
|
+
server_name : str, optional
|
730
|
+
The name of the server where the to-do item will be created. If not provided,
|
731
|
+
the default server name associated with the instance of the class will be used.
|
659
732
|
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
733
|
+
Returns
|
734
|
+
-------
|
735
|
+
None
|
736
|
+
This method does not return any value.
|
664
737
|
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
738
|
+
Raises
|
739
|
+
------
|
740
|
+
InvalidParameterException
|
741
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
742
|
+
PropertyServerException
|
743
|
+
Raised by the server when an issue arises in processing a valid request
|
744
|
+
NotAuthorizedException
|
745
|
+
The principle specified by the user_id does not have authorization for the requested action
|
746
|
+
"""
|
674
747
|
if server_name is None:
|
675
748
|
server_name = self.server_name
|
676
749
|
|
@@ -678,77 +751,95 @@ class MyProfile(Client):
|
|
678
751
|
validate_name(actor_guid)
|
679
752
|
body = {"status": status}
|
680
753
|
|
681
|
-
url = (
|
682
|
-
|
754
|
+
url = (
|
755
|
+
f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
|
756
|
+
f"{todo_guid}/reassign/{actor_guid}"
|
757
|
+
)
|
683
758
|
|
684
759
|
await self._async_make_request("POST", url, body)
|
685
760
|
return
|
686
761
|
|
687
|
-
def reassign_to_do(
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
762
|
+
def reassign_to_do(
|
763
|
+
self,
|
764
|
+
todo_guid: str,
|
765
|
+
actor_guid: str,
|
766
|
+
status: str = "OPEN",
|
767
|
+
server_name: str = None,
|
768
|
+
) -> None:
|
769
|
+
"""Reassign a To-Do item.
|
770
|
+
Parameters
|
771
|
+
----------
|
772
|
+
todo_guid: str
|
773
|
+
Identifier of the To-Do item.
|
774
|
+
actor_guid: str
|
775
|
+
The actor to receive the reassigned to-do item.
|
776
|
+
status: str [default = "OPEN"]
|
777
|
+
Filter items to match this status.
|
778
|
+
server_name : str, optional
|
779
|
+
The name of the server where the to-do item will be created. If not provided,
|
780
|
+
the default server name associated with the instance of the class will be used.
|
700
781
|
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
782
|
+
Returns
|
783
|
+
-------
|
784
|
+
None
|
785
|
+
This method does not return any value.
|
705
786
|
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
787
|
+
Raises
|
788
|
+
------
|
789
|
+
InvalidParameterException
|
790
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
791
|
+
PropertyServerException
|
792
|
+
Raised by the server when an issue arises in processing a valid request
|
793
|
+
NotAuthorizedException
|
794
|
+
The principle specified by the user_id does not have authorization for the requested action
|
795
|
+
"""
|
715
796
|
loop = asyncio.get_event_loop()
|
716
|
-
loop.run_until_complete(
|
797
|
+
loop.run_until_complete(
|
798
|
+
self._async_reassign_to_do(todo_guid, actor_guid, status, server_name)
|
799
|
+
)
|
717
800
|
return
|
718
801
|
|
719
|
-
async def _async_find_to_do(
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
802
|
+
async def _async_find_to_do(
|
803
|
+
self,
|
804
|
+
search_string: str = "*",
|
805
|
+
server_name: str = "None",
|
806
|
+
status: str = None,
|
807
|
+
starts_with: bool = False,
|
808
|
+
ends_with: bool = False,
|
809
|
+
ignore_case: bool = True,
|
810
|
+
start_from: int = 0,
|
811
|
+
page_size: int = 100,
|
812
|
+
) -> list | str:
|
813
|
+
"""find To-Do items. Async version.
|
814
|
+
Parameters
|
815
|
+
----------
|
816
|
+
search_string: str
|
817
|
+
String to search against. If '*' then all to-do items will match.
|
818
|
+
server_name : str, optional
|
819
|
+
The name of the server where the to-do item will be created. If not provided,
|
820
|
+
the default server name associated with the instance of the class will be used.
|
821
|
+
status: str
|
822
|
+
Filter items to match this status. Defaults to "OPEN"
|
823
|
+
starts_with : bool, [default=False], optional
|
824
|
+
Starts with the supplied string.
|
825
|
+
ends_with : bool, [default=False], optional
|
826
|
+
Ends with the supplied string
|
827
|
+
ignore_case : bool, [default=False], optional
|
828
|
+
Ignore case when searching
|
829
|
+
Returns
|
830
|
+
-------
|
831
|
+
None
|
832
|
+
List of To-Do items that match the criteria
|
833
|
+
|
834
|
+
Raises
|
835
|
+
------
|
836
|
+
InvalidParameterException
|
837
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
838
|
+
PropertyServerException
|
839
|
+
Raised by the server when an issue arises in processing a valid request
|
840
|
+
NotAuthorizedException
|
841
|
+
The principle specified by the user_id does not have authorization for the requested action
|
842
|
+
"""
|
752
843
|
if server_name is None:
|
753
844
|
server_name = self.server_name
|
754
845
|
|
@@ -756,175 +847,216 @@ class MyProfile(Client):
|
|
756
847
|
ends_with_s = str(ends_with).lower()
|
757
848
|
ignore_case_s = str(ignore_case).lower()
|
758
849
|
|
759
|
-
if search_string ==
|
850
|
+
if search_string == "*":
|
760
851
|
search_string = " "
|
761
852
|
|
762
853
|
body = {
|
763
854
|
"class": "ToDoStatusSearchString",
|
764
855
|
"toDoStatus": status,
|
765
|
-
"searchString": search_string
|
856
|
+
"searchString": search_string,
|
766
857
|
}
|
767
858
|
|
768
859
|
validate_search_string(search_string)
|
769
860
|
|
770
|
-
url = (
|
771
|
-
|
772
|
-
|
861
|
+
url = (
|
862
|
+
f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
|
863
|
+
f"find-by-search-string?startFrom={start_from}&pageSize={page_size}&"
|
864
|
+
f"startsWith={starts_with_s}&endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
|
865
|
+
)
|
773
866
|
|
774
867
|
response = await self._async_make_request("POST", url, body_slimmer(body))
|
775
868
|
# return response.text
|
776
869
|
return response.json().get("elements", "No ToDos found")
|
777
870
|
|
778
|
-
def find_to_do(
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
871
|
+
def find_to_do(
|
872
|
+
self,
|
873
|
+
search_string: str,
|
874
|
+
server_name: str = None,
|
875
|
+
status: str = "OPEN",
|
876
|
+
starts_with: bool = False,
|
877
|
+
ends_with: bool = False,
|
878
|
+
ignore_case: bool = True,
|
879
|
+
start_from: int = 0,
|
880
|
+
page_size: int = 100,
|
881
|
+
) -> list | str:
|
882
|
+
"""find To-Do items.
|
883
|
+
Parameters
|
884
|
+
----------
|
885
|
+
search_string: str
|
886
|
+
String to search against. If '*' then all to-do items will match.
|
887
|
+
server_name : str, optional
|
888
|
+
The name of the server where the to-do item will be created. If not provided,
|
889
|
+
the default server name associated with the instance of the class will be used.
|
890
|
+
status: str
|
891
|
+
Filter items to match this status. Defaults to "OPEN"
|
892
|
+
starts_with : bool, [default=False], optional
|
893
|
+
Starts with the supplied string.
|
894
|
+
ends_with : bool, [default=False], optional
|
895
|
+
Ends with the supplied string
|
896
|
+
ignore_case : bool, [default=False], optional
|
897
|
+
Ignore case when searching
|
898
|
+
start_from: int, [default=0], optional
|
899
|
+
When multiple pages of results are available, the page number to start from.
|
900
|
+
page_size: int, [default=None]
|
901
|
+
The number of items to return in a single page. If not specified, the default will be taken from
|
902
|
+
the class instance.
|
903
|
+
Returns
|
904
|
+
-------
|
905
|
+
None
|
906
|
+
List of To-Do items that match the criteria
|
806
907
|
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
908
|
+
Raises
|
909
|
+
------
|
910
|
+
InvalidParameterException
|
911
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
912
|
+
PropertyServerException
|
913
|
+
Raised by the server when an issue arises in processing a valid request
|
914
|
+
NotAuthorizedException
|
915
|
+
The principle specified by the user_id does not have authorization for the requested action
|
916
|
+
"""
|
816
917
|
loop = asyncio.get_event_loop()
|
817
|
-
response = loop.run_until_complete(
|
818
|
-
|
918
|
+
response = loop.run_until_complete(
|
919
|
+
self._async_find_to_do(
|
920
|
+
search_string,
|
921
|
+
server_name,
|
922
|
+
status,
|
923
|
+
starts_with,
|
924
|
+
ends_with,
|
925
|
+
ignore_case,
|
926
|
+
start_from,
|
927
|
+
page_size,
|
928
|
+
)
|
929
|
+
)
|
819
930
|
return response
|
820
931
|
|
821
|
-
async def _async_get_to_dos_by_type(
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
932
|
+
async def _async_get_to_dos_by_type(
|
933
|
+
self,
|
934
|
+
todo_type: str,
|
935
|
+
server_name: str = None,
|
936
|
+
status: str = "OPEN",
|
937
|
+
start_from: int = 0,
|
938
|
+
page_size: int = 100,
|
939
|
+
) -> list | str:
|
940
|
+
"""Get To-Do items by type. Async version
|
941
|
+
Parameters
|
942
|
+
----------
|
943
|
+
todo_type: str
|
944
|
+
Type of to-do to find
|
945
|
+
server_name : str, optional
|
946
|
+
The name of the server where the to-do item will be created. If not provided,
|
947
|
+
the default server name associated with the instance of the class will be used.
|
948
|
+
status: str
|
949
|
+
Filter items to match this status. Defaults to "OPEN"
|
950
|
+
start_from: int, [default=0], optional
|
951
|
+
When multiple pages of results are available, the page number to start from.
|
952
|
+
page_size: int, [default=None]
|
953
|
+
The number of items to return in a single page. If not specified, the default will be taken from
|
954
|
+
the class instance.
|
955
|
+
Returns
|
956
|
+
-------
|
957
|
+
List of To-Do items that match the criteria
|
841
958
|
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
959
|
+
Raises
|
960
|
+
------
|
961
|
+
InvalidParameterException
|
962
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
963
|
+
PropertyServerException
|
964
|
+
Raised by the server when an issue arises in processing a valid request
|
965
|
+
NotAuthorizedException
|
966
|
+
The principle specified by the user_id does not have authorization for the requested action
|
967
|
+
"""
|
851
968
|
if server_name is None:
|
852
969
|
server_name = self.server_name
|
853
970
|
|
854
971
|
validate_name(todo_type)
|
855
972
|
body = {
|
856
973
|
"status": status,
|
857
|
-
|
858
974
|
}
|
859
975
|
|
860
|
-
url = (
|
861
|
-
|
976
|
+
url = (
|
977
|
+
f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/types/"
|
978
|
+
f"{todo_type}?startFrom={start_from}&pageSize={page_size}"
|
979
|
+
)
|
862
980
|
|
863
981
|
response = await self._async_make_request("POST", url, body)
|
864
982
|
return response.json().get("elements", "No ToDos found")
|
865
983
|
|
866
|
-
def get_to_dos_by_type(
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
984
|
+
def get_to_dos_by_type(
|
985
|
+
self,
|
986
|
+
todo_type: str,
|
987
|
+
server_name: str = None,
|
988
|
+
status: str = "OPEN",
|
989
|
+
start_from: int = 0,
|
990
|
+
page_size: int = 100,
|
991
|
+
) -> list | str:
|
992
|
+
"""Get To-Do items by type.
|
993
|
+
Parameters
|
994
|
+
----------
|
995
|
+
todo_type: str
|
996
|
+
Type of to-do to find
|
997
|
+
server_name : str, optional
|
998
|
+
The name of the server where the to-do item will be created. If not provided,
|
999
|
+
the default server name associated with the instance of the class will be used.
|
1000
|
+
status: str
|
1001
|
+
Filter items to match this status. Defaults to "OPEN"
|
1002
|
+
start_from: int, [default=0], optional
|
1003
|
+
When multiple pages of results are available, the page number to start from.
|
1004
|
+
page_size: int, [default=None]
|
1005
|
+
The number of items to return in a single page. If not specified, the default will be taken from
|
1006
|
+
the class instance.
|
1007
|
+
Returns
|
1008
|
+
-------
|
1009
|
+
List of To-Do items that match the criteria
|
886
1010
|
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
1011
|
+
Raises
|
1012
|
+
------
|
1013
|
+
InvalidParameterException
|
1014
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1015
|
+
PropertyServerException
|
1016
|
+
Raised by the server when an issue arises in processing a valid request
|
1017
|
+
NotAuthorizedException
|
1018
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1019
|
+
"""
|
896
1020
|
loop = asyncio.get_event_loop()
|
897
|
-
response = loop.run_until_complete(
|
898
|
-
|
1021
|
+
response = loop.run_until_complete(
|
1022
|
+
self._async_get_to_dos_by_type(
|
1023
|
+
todo_type, server_name, status, start_from, page_size
|
1024
|
+
)
|
1025
|
+
)
|
899
1026
|
return response
|
900
1027
|
|
901
|
-
async def _async_update_action_target_properties(
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
1028
|
+
async def _async_update_action_target_properties(
|
1029
|
+
self,
|
1030
|
+
action_target_guid: str,
|
1031
|
+
body: dict,
|
1032
|
+
is_merge_update: bool = True,
|
1033
|
+
server_name: str = None,
|
1034
|
+
) -> None:
|
1035
|
+
"""Get To-Do items by type. Async version
|
1036
|
+
Parameters
|
1037
|
+
----------
|
1038
|
+
action_target_guid: str
|
1039
|
+
Identity of the action target to update.
|
1040
|
+
body: dict
|
1041
|
+
Details of the updates to make.
|
1042
|
+
is_merge_update : bool, [default=True], optional
|
1043
|
+
indicates if the update should be a merge or replacement.
|
1044
|
+
server_name : str, optional
|
1045
|
+
The name of the server where the to-do item will be created. If not provided,
|
1046
|
+
the default server name associated with the instance of the class will be used.
|
1047
|
+
Returns
|
1048
|
+
-------
|
1049
|
+
None
|
918
1050
|
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
1051
|
+
Raises
|
1052
|
+
------
|
1053
|
+
InvalidParameterException
|
1054
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1055
|
+
PropertyServerException
|
1056
|
+
Raised by the server when an issue arises in processing a valid request
|
1057
|
+
NotAuthorizedException
|
1058
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1059
|
+
"""
|
928
1060
|
if server_name is None:
|
929
1061
|
server_name = self.server_name
|
930
1062
|
|
@@ -932,42 +1064,50 @@ class MyProfile(Client):
|
|
932
1064
|
|
933
1065
|
validate_name(action_target_guid)
|
934
1066
|
|
935
|
-
url = (
|
936
|
-
|
1067
|
+
url = (
|
1068
|
+
f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
|
1069
|
+
f"action-targets/{action_target_guid}?isMergeUpdate={is_merge_update_t}"
|
1070
|
+
)
|
937
1071
|
|
938
1072
|
await self._async_make_request("POST", url, body)
|
939
1073
|
return
|
940
1074
|
|
941
|
-
def update_action_target_properties(
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
1075
|
+
def update_action_target_properties(
|
1076
|
+
self,
|
1077
|
+
action_target_guid: str,
|
1078
|
+
body: dict,
|
1079
|
+
is_merge_update: bool = True,
|
1080
|
+
server_name: str = None,
|
1081
|
+
) -> None:
|
1082
|
+
"""Get To-Do items by type.
|
1083
|
+
Parameters
|
1084
|
+
----------
|
1085
|
+
action_target_guid: str
|
1086
|
+
Identity of the action target to update.
|
1087
|
+
body: dict
|
1088
|
+
Details of the updates to make.
|
1089
|
+
is_merge_update : bool, [default=True], optional
|
1090
|
+
indicates if the update should be a merge or replacement.
|
1091
|
+
server_name : str, optional
|
1092
|
+
The name of the server where the to-do item will be created. If not provided,
|
1093
|
+
the default server name associated with the instance of the class will be used.
|
1094
|
+
Returns
|
1095
|
+
-------
|
1096
|
+
None
|
958
1097
|
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
1098
|
+
Raises
|
1099
|
+
------
|
1100
|
+
InvalidParameterException
|
1101
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1102
|
+
PropertyServerException
|
1103
|
+
Raised by the server when an issue arises in processing a valid request
|
1104
|
+
NotAuthorizedException
|
1105
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1106
|
+
"""
|
968
1107
|
loop = asyncio.get_event_loop()
|
969
|
-
loop.run_until_complete(
|
970
|
-
|
971
|
-
|
1108
|
+
loop.run_until_complete(
|
1109
|
+
self._async_update_action_target_properties(
|
1110
|
+
action_target_guid, body, is_merge_update, server_name
|
1111
|
+
)
|
1112
|
+
)
|
972
1113
|
return
|
973
|
-
|