pyegeria 0.7.45.1__py3-none-any.whl → 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +5 -1
- 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.0.dist-info}/METADATA +1 -1
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.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.0.dist-info}/LICENSE +0 -0
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/WHEEL +0 -0
- {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/entry_points.txt +0 -0
@@ -11,7 +11,11 @@ from datetime import datetime
|
|
11
11
|
|
12
12
|
# import json
|
13
13
|
from pyegeria._client import Client
|
14
|
-
from pyegeria._validators import (
|
14
|
+
from pyegeria._validators import (
|
15
|
+
validate_name,
|
16
|
+
validate_guid,
|
17
|
+
validate_search_string,
|
18
|
+
)
|
15
19
|
from pyegeria.utils import body_slimmer
|
16
20
|
|
17
21
|
|
@@ -32,19 +36,26 @@ class GlossaryBrowser(Client):
|
|
32
36
|
user_pwd: str
|
33
37
|
The password associated with the user_id. Defaults to None
|
34
38
|
|
35
|
-
|
39
|
+
"""
|
36
40
|
|
37
|
-
def __init__(
|
38
|
-
|
41
|
+
def __init__(
|
42
|
+
self,
|
43
|
+
server_name: str,
|
44
|
+
platform_url: str,
|
45
|
+
token: str = None,
|
46
|
+
user_id: str = None,
|
47
|
+
user_pwd: str = None,
|
48
|
+
sync_mode: bool = True,
|
49
|
+
):
|
39
50
|
self.admin_command_root: str
|
40
|
-
Client.__init__(self, server_name, platform_url, user_id=user_id, token=token
|
51
|
+
Client.__init__(self, server_name, platform_url, user_id=user_id, token=token)
|
41
52
|
|
42
53
|
#
|
43
54
|
# Get Valid Values for Enumerations
|
44
55
|
#
|
45
56
|
|
46
57
|
async def _async_get_glossary_term_statuses(self, server_name: str = None) -> [str]:
|
47
|
-
"""
|
58
|
+
"""Return the list of glossary term status enum values. Async version.
|
48
59
|
|
49
60
|
Parameters
|
50
61
|
----------
|
@@ -60,14 +71,16 @@ class GlossaryBrowser(Client):
|
|
60
71
|
if server_name is None:
|
61
72
|
server_name = self.server_name
|
62
73
|
|
63
|
-
url = (
|
64
|
-
|
74
|
+
url = (
|
75
|
+
f"{self.platform_url}/servers/{server_name}"
|
76
|
+
f"/api/open-metadata/glossary-browser/glossaries/terms/status-list"
|
77
|
+
)
|
65
78
|
|
66
79
|
response = await self._async_make_request("GET", url)
|
67
80
|
return response.json().get("statuses", [])
|
68
81
|
|
69
82
|
def get_glossary_term_statuses(self, server_name: str = None) -> [str]:
|
70
|
-
"""
|
83
|
+
"""Return the list of glossary term status enum values.
|
71
84
|
|
72
85
|
Parameters
|
73
86
|
----------
|
@@ -81,11 +94,15 @@ class GlossaryBrowser(Client):
|
|
81
94
|
|
82
95
|
"""
|
83
96
|
loop = asyncio.get_event_loop()
|
84
|
-
response = loop.run_until_complete(
|
97
|
+
response = loop.run_until_complete(
|
98
|
+
self._async_get_glossary_term_statuses(server_name)
|
99
|
+
)
|
85
100
|
return response
|
86
101
|
|
87
|
-
async def _async_get_glossary_term_rel_statuses(
|
88
|
-
|
102
|
+
async def _async_get_glossary_term_rel_statuses(
|
103
|
+
self, server_name: str = None
|
104
|
+
) -> [str]:
|
105
|
+
"""Return the list of glossary term relationship status enum values. These values are stored in a
|
89
106
|
term-to-term, or term-to-category, relationship and are used to indicate how much the relationship should be
|
90
107
|
trusted. Async version.
|
91
108
|
|
@@ -103,14 +120,16 @@ class GlossaryBrowser(Client):
|
|
103
120
|
if server_name is None:
|
104
121
|
server_name = self.server_name
|
105
122
|
|
106
|
-
url = (
|
107
|
-
|
123
|
+
url = (
|
124
|
+
f"{self.platform_url}/servers/{server_name}"
|
125
|
+
f"/api/open-metadata/glossary-browser/glossaries/terms/relationships/status-list"
|
126
|
+
)
|
108
127
|
|
109
128
|
response = await self._async_make_request("GET", url)
|
110
129
|
return response.json().get("statuses", [])
|
111
130
|
|
112
131
|
def get_glossary_term_rel_statuses(self, server_name: str = None) -> [str]:
|
113
|
-
"""
|
132
|
+
"""Return the list of glossary term relationship status enum values. These values are stored in a
|
114
133
|
term-to-term, or term-to-category, relationship and are used to indicate how much the relationship should be
|
115
134
|
trusted.
|
116
135
|
|
@@ -126,11 +145,15 @@ class GlossaryBrowser(Client):
|
|
126
145
|
|
127
146
|
"""
|
128
147
|
loop = asyncio.get_event_loop()
|
129
|
-
response = loop.run_until_complete(
|
148
|
+
response = loop.run_until_complete(
|
149
|
+
self._async_get_glossary_term_rel_statuses(server_name)
|
150
|
+
)
|
130
151
|
return response
|
131
152
|
|
132
|
-
async def _async_get_glossary_term_activity_types(
|
133
|
-
|
153
|
+
async def _async_get_glossary_term_activity_types(
|
154
|
+
self, server_name: str = None
|
155
|
+
) -> [str]:
|
156
|
+
"""Return the list of glossary term activity type enum values. Async version.
|
134
157
|
|
135
158
|
Parameters
|
136
159
|
----------
|
@@ -146,14 +169,16 @@ class GlossaryBrowser(Client):
|
|
146
169
|
if server_name is None:
|
147
170
|
server_name = self.server_name
|
148
171
|
|
149
|
-
url = (
|
150
|
-
|
172
|
+
url = (
|
173
|
+
f"{self.platform_url}/servers/{server_name}"
|
174
|
+
f"/api/open-metadata/glossary-browser/glossaries/terms/activity-types"
|
175
|
+
)
|
151
176
|
|
152
177
|
response = await self._async_make_request("GET", url)
|
153
178
|
return response.json().get("types", [])
|
154
179
|
|
155
180
|
def get_glossary_term_activity_types(self, server_name: str = None) -> [str]:
|
156
|
-
"""
|
181
|
+
"""Return the list of glossary term activity type enum values.
|
157
182
|
|
158
183
|
Parameters
|
159
184
|
----------
|
@@ -167,18 +192,30 @@ class GlossaryBrowser(Client):
|
|
167
192
|
|
168
193
|
"""
|
169
194
|
loop = asyncio.get_event_loop()
|
170
|
-
response = loop.run_until_complete(
|
195
|
+
response = loop.run_until_complete(
|
196
|
+
self._async_get_glossary_term_statuses(server_name)
|
197
|
+
)
|
171
198
|
return response
|
172
199
|
|
173
200
|
#
|
174
201
|
# Glossaries
|
175
202
|
#
|
176
203
|
|
177
|
-
async def _async_find_glossaries(
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
204
|
+
async def _async_find_glossaries(
|
205
|
+
self,
|
206
|
+
search_string: str,
|
207
|
+
effective_time: str = None,
|
208
|
+
starts_with: bool = False,
|
209
|
+
ends_with: bool = False,
|
210
|
+
ignore_case: bool = False,
|
211
|
+
for_lineage: bool = False,
|
212
|
+
for_duplicate_processing: bool = False,
|
213
|
+
type_name: str = None,
|
214
|
+
server_name: str = None,
|
215
|
+
start_from: int = 0,
|
216
|
+
page_size: int = None,
|
217
|
+
) -> list | str:
|
218
|
+
"""Retrieve the list of glossary metadata elements that contain the search string. Async version.
|
182
219
|
The search string is located in the request body and is interpreted as a plain string.
|
183
220
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
184
221
|
|
@@ -239,86 +276,115 @@ class GlossaryBrowser(Client):
|
|
239
276
|
|
240
277
|
validate_search_string(search_string)
|
241
278
|
|
242
|
-
if search_string ==
|
279
|
+
if search_string == "*":
|
243
280
|
search_string = None
|
244
281
|
|
245
|
-
body = {
|
246
|
-
|
282
|
+
body = {
|
283
|
+
"class": "SearchStringRequestBody",
|
284
|
+
"searchString": search_string,
|
285
|
+
"effectiveTime": effective_time,
|
286
|
+
"typeName": type_name,
|
287
|
+
}
|
247
288
|
body = body_slimmer(body)
|
248
289
|
# print(f"\n\nBody is: \n{body}")
|
249
290
|
|
250
|
-
url = (
|
251
|
-
|
252
|
-
|
253
|
-
|
291
|
+
url = (
|
292
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/"
|
293
|
+
f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
294
|
+
f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}&forLineage={for_lineage_s}&"
|
295
|
+
f"forDuplicateProcessing={for_duplicate_processing_s}"
|
296
|
+
)
|
254
297
|
|
255
298
|
response = await self._async_make_request("POST", url, body)
|
256
299
|
return response.json().get("elementList", "No Glossaries found")
|
257
300
|
|
258
|
-
def find_glossaries(
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
301
|
+
def find_glossaries(
|
302
|
+
self,
|
303
|
+
search_string: str,
|
304
|
+
effective_time: str = None,
|
305
|
+
starts_with: bool = False,
|
306
|
+
ends_with: bool = False,
|
307
|
+
ignore_case: bool = False,
|
308
|
+
for_lineage: bool = False,
|
309
|
+
for_duplicate_processing: bool = False,
|
310
|
+
type_name: str = None,
|
311
|
+
server_name: str = None,
|
312
|
+
start_from: int = 0,
|
313
|
+
page_size: int = None,
|
314
|
+
) -> list | str:
|
315
|
+
"""Retrieve the list of glossary metadata elements that contain the search string.
|
316
|
+
The search string is located in the request body and is interpreted as a plain string.
|
317
|
+
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
318
|
+
|
319
|
+
Parameters
|
320
|
+
----------
|
321
|
+
search_string: str,
|
322
|
+
Search string to use to find matching glossaries. If the search string is '*',
|
323
|
+
then all glossaries returned.
|
324
|
+
|
325
|
+
effective_time: str, [default=None], optional
|
326
|
+
Effective time of the query. If not specified will default to any time. Time format is
|
327
|
+
"YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
328
|
+
server_name : str, optional
|
329
|
+
The name of the server to configure.
|
330
|
+
If not provided, the server name associated with the instance is used.
|
331
|
+
starts_with : bool, [default=False], optional
|
332
|
+
Starts with the supplied string.
|
333
|
+
ends_with : bool, [default=False], optional
|
334
|
+
Ends with the supplied string
|
335
|
+
ignore_case : bool, [default=False], optional
|
336
|
+
Ignore case when searching
|
337
|
+
for_lineage : bool, [default=False], optional
|
338
|
+
Indicates the search is for lineage.
|
339
|
+
for_duplicate_processing : bool, [default=False], optional
|
340
|
+
type_name: str, [default=None], optional
|
341
|
+
An optional parameter indicating the subtype of the glossary to filter by.
|
342
|
+
Values include 'ControlledGlossary', 'EditingGlossary', and 'StagingGlossary'
|
343
|
+
start_from: int, [default=0], optional
|
344
|
+
When multiple pages of results are available, the page number to start from.
|
345
|
+
page_size: int, [default=None]
|
346
|
+
The number of items to return in a single page. If not specified, the default will be taken from
|
347
|
+
the class instance.
|
348
|
+
Returns
|
349
|
+
-------
|
350
|
+
List | str
|
351
|
+
|
352
|
+
A list of glossary definitions active in the server.
|
353
|
+
|
354
|
+
Raises
|
355
|
+
------
|
356
|
+
|
357
|
+
InvalidParameterException
|
358
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
359
|
+
PropertyServerException
|
360
|
+
Raised by the server when an issue arises in processing a valid request
|
361
|
+
NotAuthorizedException
|
362
|
+
The principle specified by the user_id does not have authorization for the requested action
|
363
|
+
|
364
|
+
"""
|
312
365
|
loop = asyncio.get_event_loop()
|
313
366
|
response = loop.run_until_complete(
|
314
|
-
self._async_find_glossaries(
|
315
|
-
|
367
|
+
self._async_find_glossaries(
|
368
|
+
search_string,
|
369
|
+
effective_time,
|
370
|
+
starts_with,
|
371
|
+
ends_with,
|
372
|
+
ignore_case,
|
373
|
+
for_lineage,
|
374
|
+
for_duplicate_processing,
|
375
|
+
type_name,
|
376
|
+
server_name,
|
377
|
+
start_from,
|
378
|
+
page_size,
|
379
|
+
)
|
380
|
+
)
|
316
381
|
|
317
382
|
return response
|
318
383
|
|
319
|
-
async def _async_get_glossary_by_guid(
|
320
|
-
|
321
|
-
|
384
|
+
async def _async_get_glossary_by_guid(
|
385
|
+
self, glossary_guid: str, server_name: str = None, effective_time: str = None
|
386
|
+
) -> dict:
|
387
|
+
"""Retrieves information about a glossary
|
322
388
|
Parameters
|
323
389
|
----------
|
324
390
|
glossary_guid : str
|
@@ -349,16 +415,21 @@ class GlossaryBrowser(Client):
|
|
349
415
|
server_name = self.server_name
|
350
416
|
validate_guid(glossary_guid)
|
351
417
|
|
352
|
-
body = {
|
418
|
+
body = {
|
419
|
+
"class": "EffectiveTimeQueryRequestBody",
|
420
|
+
"effectiveTime": effective_time,
|
421
|
+
}
|
353
422
|
|
354
|
-
url = (
|
355
|
-
|
423
|
+
url = (
|
424
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/"
|
425
|
+
f"{glossary_guid}/retrieve"
|
426
|
+
)
|
356
427
|
print(url)
|
357
428
|
response = await self._async_make_request("POST", url, payload=body)
|
358
429
|
return response.json()
|
359
430
|
|
360
431
|
def get_glossary_by_guid(self, glossary_guid: str, server_name: str = None) -> dict:
|
361
|
-
"""
|
432
|
+
"""Retrieves information about a glossary
|
362
433
|
Parameters
|
363
434
|
----------
|
364
435
|
glossary_guid : str
|
@@ -383,13 +454,20 @@ class GlossaryBrowser(Client):
|
|
383
454
|
-----
|
384
455
|
"""
|
385
456
|
loop = asyncio.get_event_loop()
|
386
|
-
response = loop.run_until_complete(
|
457
|
+
response = loop.run_until_complete(
|
458
|
+
self._async_get_glossary_by_guid(glossary_guid, server_name)
|
459
|
+
)
|
387
460
|
return response
|
388
461
|
|
389
|
-
async def _async_get_glossaries_by_name(
|
390
|
-
|
391
|
-
|
392
|
-
|
462
|
+
async def _async_get_glossaries_by_name(
|
463
|
+
self,
|
464
|
+
glossary_name: str,
|
465
|
+
effective_time: str = None,
|
466
|
+
server_name: str = None,
|
467
|
+
start_from: int = 0,
|
468
|
+
page_size: int = None,
|
469
|
+
) -> dict | str:
|
470
|
+
"""Retrieve the list of glossary metadata elements with an exactly matching qualified or display name.
|
393
471
|
There are no wildcards supported on this request.
|
394
472
|
|
395
473
|
Parameters
|
@@ -436,15 +514,23 @@ class GlossaryBrowser(Client):
|
|
436
514
|
else:
|
437
515
|
body = {"name": glossary_name, "effectiveTime": effective_time}
|
438
516
|
|
439
|
-
url = (
|
440
|
-
|
517
|
+
url = (
|
518
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/"
|
519
|
+
f"by-name?startFrom={start_from}&pageSize={page_size}"
|
520
|
+
)
|
441
521
|
|
442
522
|
response = await self._async_make_request("POST", url, body)
|
443
523
|
return response.json()
|
444
524
|
|
445
|
-
def get_glossaries_by_name(
|
446
|
-
|
447
|
-
|
525
|
+
def get_glossaries_by_name(
|
526
|
+
self,
|
527
|
+
glossary_name: str,
|
528
|
+
effective_time: str = None,
|
529
|
+
server_name: str = None,
|
530
|
+
start_from: int = 0,
|
531
|
+
page_size: int = None,
|
532
|
+
) -> dict | str:
|
533
|
+
"""Retrieve the list of glossary metadata elements with an exactly matching qualified or display name.
|
448
534
|
There are no wildcards supported on this request.
|
449
535
|
|
450
536
|
Parameters
|
@@ -480,16 +566,23 @@ class GlossaryBrowser(Client):
|
|
480
566
|
"""
|
481
567
|
loop = asyncio.get_event_loop()
|
482
568
|
response = loop.run_until_complete(
|
483
|
-
self._async_get_glossaries_by_name(
|
569
|
+
self._async_get_glossaries_by_name(
|
570
|
+
glossary_name, effective_time, server_name, start_from, page_size
|
571
|
+
)
|
572
|
+
)
|
484
573
|
return response
|
485
574
|
|
486
575
|
#
|
487
576
|
# Glossary Categories
|
488
577
|
#
|
489
578
|
|
490
|
-
async def _async_get_glossary_for_category(
|
491
|
-
|
492
|
-
|
579
|
+
async def _async_get_glossary_for_category(
|
580
|
+
self,
|
581
|
+
glossary_category_guid: str,
|
582
|
+
effective_time: str = None,
|
583
|
+
server_name: str = None,
|
584
|
+
) -> dict | str:
|
585
|
+
"""Retrieve the glossary metadata element for the requested category. The optional request body allows you to
|
493
586
|
specify that the glossary element should only be returned if it was effective at a particular time.
|
494
587
|
|
495
588
|
Parameters
|
@@ -523,17 +616,26 @@ class GlossaryBrowser(Client):
|
|
523
616
|
if server_name is None:
|
524
617
|
server_name = self.server_name
|
525
618
|
|
526
|
-
body = {
|
619
|
+
body = {
|
620
|
+
"class": "EffectiveTimeQueryRequestBody",
|
621
|
+
"effectiveTime": effective_time,
|
622
|
+
}
|
527
623
|
|
528
|
-
url = (
|
529
|
-
|
624
|
+
url = (
|
625
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/"
|
626
|
+
f"for-category/{glossary_category_guid}/retrieve"
|
627
|
+
)
|
530
628
|
|
531
629
|
response = await self._async_make_request("POST", url, body)
|
532
630
|
return response.json()
|
533
631
|
|
534
|
-
def get_glossary_for_category(
|
535
|
-
|
536
|
-
|
632
|
+
def get_glossary_for_category(
|
633
|
+
self,
|
634
|
+
glossary_category_guid: str,
|
635
|
+
effective_time: str = None,
|
636
|
+
server_name: str = None,
|
637
|
+
) -> dict | str:
|
638
|
+
"""Retrieve the glossary metadata element for the requested category. The optional request body allows you to
|
537
639
|
specify that the glossary element should only be returned if it was effective at a particular time.
|
538
640
|
|
539
641
|
Parameters
|
@@ -566,14 +668,24 @@ class GlossaryBrowser(Client):
|
|
566
668
|
"""
|
567
669
|
loop = asyncio.get_event_loop()
|
568
670
|
response = loop.run_until_complete(
|
569
|
-
self._async_get_glossary_for_category(
|
671
|
+
self._async_get_glossary_for_category(
|
672
|
+
glossary_category_guid, effective_time, server_name
|
673
|
+
)
|
674
|
+
)
|
570
675
|
return response
|
571
676
|
|
572
|
-
async def _async_find_glossary_categories(
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
677
|
+
async def _async_find_glossary_categories(
|
678
|
+
self,
|
679
|
+
search_string: str,
|
680
|
+
effective_time: str = None,
|
681
|
+
starts_with: bool = False,
|
682
|
+
ends_with: bool = False,
|
683
|
+
ignore_case: bool = False,
|
684
|
+
server_name: str = None,
|
685
|
+
start_from: int = 0,
|
686
|
+
page_size: int = None,
|
687
|
+
) -> list | str:
|
688
|
+
"""Retrieve the list of glossary category metadata elements that contain the search string.
|
577
689
|
The search string is located in the request body and is interpreted as a plain string.
|
578
690
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
579
691
|
Async version.
|
@@ -627,76 +739,104 @@ class GlossaryBrowser(Client):
|
|
627
739
|
|
628
740
|
validate_search_string(search_string)
|
629
741
|
|
630
|
-
if search_string ==
|
742
|
+
if search_string == "*":
|
631
743
|
search_string = None
|
632
744
|
|
633
|
-
body = {
|
745
|
+
body = {
|
746
|
+
"class": "SearchStringRequestBody",
|
747
|
+
"searchString": search_string,
|
748
|
+
"effectiveTime": effective_time,
|
749
|
+
}
|
634
750
|
body = body_slimmer(body)
|
635
751
|
|
636
|
-
url = (
|
637
|
-
|
638
|
-
|
752
|
+
url = (
|
753
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/"
|
754
|
+
f"categories/by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
755
|
+
f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
|
756
|
+
)
|
639
757
|
|
640
758
|
response = await self._async_make_request("POST", url, body)
|
641
759
|
return response.json().get("elementList", "No Categories found")
|
642
760
|
|
643
|
-
def find_glossary_categories(
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
761
|
+
def find_glossary_categories(
|
762
|
+
self,
|
763
|
+
search_string: str,
|
764
|
+
effective_time: str = None,
|
765
|
+
starts_with: bool = False,
|
766
|
+
ends_with: bool = False,
|
767
|
+
ignore_case: bool = False,
|
768
|
+
server_name: str = None,
|
769
|
+
start_from: int = 0,
|
770
|
+
page_size: int = None,
|
771
|
+
) -> list | str:
|
772
|
+
"""Retrieve the list of glossary category metadata elements that contain the search string.
|
773
|
+
The search string is located in the request body and is interpreted as a plain string.
|
774
|
+
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
649
775
|
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
776
|
+
Parameters
|
777
|
+
----------
|
778
|
+
search_string: str,
|
779
|
+
Search string to use to find matching glossaries. If the search string is '*' then all
|
780
|
+
glossaries returned.
|
781
|
+
|
782
|
+
effective_time: str, [default=None], optional
|
783
|
+
Effective time of the query. If not specified will default to any time. Time format is
|
784
|
+
"YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
785
|
+
server_name : str, optional
|
786
|
+
The name of the server to configure.
|
787
|
+
If not provided, the server name associated with the instance is used.
|
788
|
+
starts_with : bool, [default=False], optional
|
789
|
+
Starts with the supplied string.
|
790
|
+
ends_with : bool, [default=False], optional
|
791
|
+
Ends with the supplied string
|
792
|
+
ignore_case : bool, [default=False], optional
|
793
|
+
Ignore case when searching
|
794
|
+
start_from: int, [default=0], optional
|
795
|
+
When multiple pages of results are available, the page number to start from.
|
796
|
+
page_size: int, [default=None]
|
797
|
+
The number of items to return in a single page. If not specified, the default will be taken from
|
798
|
+
the class instance.
|
799
|
+
Returns
|
800
|
+
-------
|
801
|
+
List | str
|
802
|
+
|
803
|
+
A list of glossary definitions active in the server.
|
804
|
+
|
805
|
+
Raises
|
806
|
+
------
|
807
|
+
|
808
|
+
InvalidParameterException
|
809
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
810
|
+
PropertyServerException
|
811
|
+
Raised by the server when an issue arises in processing a valid request
|
812
|
+
NotAuthorizedException
|
813
|
+
The principle specified by the user_id does not have authorization for the requested action
|
814
|
+
|
815
|
+
"""
|
690
816
|
loop = asyncio.get_event_loop()
|
691
817
|
response = loop.run_until_complete(
|
692
|
-
self._async_find_glossary_categories(
|
693
|
-
|
818
|
+
self._async_find_glossary_categories(
|
819
|
+
search_string,
|
820
|
+
effective_time,
|
821
|
+
starts_with,
|
822
|
+
ends_with,
|
823
|
+
ignore_case,
|
824
|
+
server_name,
|
825
|
+
start_from,
|
826
|
+
page_size,
|
827
|
+
)
|
828
|
+
)
|
694
829
|
|
695
830
|
return response
|
696
831
|
|
697
|
-
async def _async_get_categories_for_glossary(
|
698
|
-
|
699
|
-
|
832
|
+
async def _async_get_categories_for_glossary(
|
833
|
+
self,
|
834
|
+
glossary_guid: str,
|
835
|
+
server_name: str = None,
|
836
|
+
start_from: int = 0,
|
837
|
+
page_size: int = None,
|
838
|
+
) -> list | str:
|
839
|
+
"""Return the list of categories associated with a glossary.
|
700
840
|
Async version.
|
701
841
|
|
702
842
|
Parameters
|
@@ -733,15 +873,22 @@ class GlossaryBrowser(Client):
|
|
733
873
|
if page_size is None:
|
734
874
|
page_size = self.page_size
|
735
875
|
|
736
|
-
url = (
|
737
|
-
|
876
|
+
url = (
|
877
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/"
|
878
|
+
f"{glossary_guid}/categories/retrieve?startFrom={start_from}&pageSize={page_size}"
|
879
|
+
)
|
738
880
|
|
739
881
|
response = await self._async_make_request("POST", url)
|
740
882
|
return response.json().get("elementList", "No Categories found")
|
741
883
|
|
742
|
-
def get_categories_for_glossary(
|
743
|
-
|
744
|
-
|
884
|
+
def get_categories_for_glossary(
|
885
|
+
self,
|
886
|
+
glossary_guid: str,
|
887
|
+
server_name: str = None,
|
888
|
+
start_from: int = 0,
|
889
|
+
page_size: int = None,
|
890
|
+
) -> list | str:
|
891
|
+
"""Return the list of categories associated with a glossary.
|
745
892
|
|
746
893
|
Parameters
|
747
894
|
----------
|
@@ -774,12 +921,20 @@ class GlossaryBrowser(Client):
|
|
774
921
|
"""
|
775
922
|
loop = asyncio.get_event_loop()
|
776
923
|
response = loop.run_until_complete(
|
777
|
-
self._async_get_categories_for_glossary(
|
924
|
+
self._async_get_categories_for_glossary(
|
925
|
+
glossary_guid, server_name, start_from, page_size
|
926
|
+
)
|
927
|
+
)
|
778
928
|
return response
|
779
929
|
|
780
|
-
async def _async_get_categories_for_term(
|
781
|
-
|
782
|
-
|
930
|
+
async def _async_get_categories_for_term(
|
931
|
+
self,
|
932
|
+
glossary_term_guid: str,
|
933
|
+
server_name: str = None,
|
934
|
+
start_from: int = 0,
|
935
|
+
page_size: int = None,
|
936
|
+
) -> list | str:
|
937
|
+
"""Return the list of categories associated with a glossary term.
|
783
938
|
Async version.
|
784
939
|
|
785
940
|
Parameters
|
@@ -816,15 +971,22 @@ class GlossaryBrowser(Client):
|
|
816
971
|
if page_size is None:
|
817
972
|
page_size = self.page_size
|
818
973
|
|
819
|
-
url = (
|
820
|
-
|
974
|
+
url = (
|
975
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/terms/"
|
976
|
+
f"{glossary_term_guid}/categories/retrieve?startFrom={start_from}&pageSize={page_size}"
|
977
|
+
)
|
821
978
|
|
822
979
|
response = await self._async_make_request("POST", url)
|
823
980
|
return response.json().get("elementList", "No Categories found")
|
824
981
|
|
825
|
-
def get_categories_for_term(
|
826
|
-
|
827
|
-
|
982
|
+
def get_categories_for_term(
|
983
|
+
self,
|
984
|
+
glossary_term_guid: str,
|
985
|
+
server_name: str = None,
|
986
|
+
start_from: int = 0,
|
987
|
+
page_size: int = None,
|
988
|
+
) -> list | str:
|
989
|
+
"""Return the list of categories associated with a glossary term.
|
828
990
|
|
829
991
|
Parameters
|
830
992
|
----------
|
@@ -857,13 +1019,22 @@ class GlossaryBrowser(Client):
|
|
857
1019
|
"""
|
858
1020
|
loop = asyncio.get_event_loop()
|
859
1021
|
response = loop.run_until_complete(
|
860
|
-
self._async_get_categories_for_term(
|
1022
|
+
self._async_get_categories_for_term(
|
1023
|
+
glossary_term_guid, server_name, start_from, page_size
|
1024
|
+
)
|
1025
|
+
)
|
861
1026
|
return response
|
862
1027
|
|
863
|
-
async def _async_get_categories_by_name(
|
864
|
-
|
865
|
-
|
866
|
-
|
1028
|
+
async def _async_get_categories_by_name(
|
1029
|
+
self,
|
1030
|
+
name: str,
|
1031
|
+
glossary_guid: str = None,
|
1032
|
+
status: [str] = ["ACTIVE"],
|
1033
|
+
server_name: str = None,
|
1034
|
+
start_from: int = 0,
|
1035
|
+
page_size: int = None,
|
1036
|
+
) -> list | str:
|
1037
|
+
"""Retrieve the list of glossary category metadata elements that either have the requested qualified name or
|
867
1038
|
display name. The name to search for is located in the request body and is interpreted as a plain string.
|
868
1039
|
The request body also supports the specification of a glossaryGUID to restrict the search to within a single
|
869
1040
|
glossary.
|
@@ -909,20 +1080,33 @@ class GlossaryBrowser(Client):
|
|
909
1080
|
page_size = self.page_size
|
910
1081
|
validate_name(name)
|
911
1082
|
|
912
|
-
url = (
|
913
|
-
|
1083
|
+
url = (
|
1084
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/categories/"
|
1085
|
+
f"by-name?startFrom={start_from}&pageSize={page_size}"
|
1086
|
+
)
|
914
1087
|
|
915
|
-
body = {
|
916
|
-
|
1088
|
+
body = {
|
1089
|
+
"class": "GlossaryNameRequestBody",
|
1090
|
+
"name": name,
|
1091
|
+
"glossaryGUID": glossary_guid,
|
1092
|
+
"limitResultsByStatus": status,
|
1093
|
+
}
|
917
1094
|
|
918
1095
|
response = await self._async_make_request("POST", url, body)
|
919
1096
|
return response.json().get("elementList", "No Categories found")
|
920
1097
|
|
921
|
-
def get_categories_by_name(
|
922
|
-
|
923
|
-
|
1098
|
+
def get_categories_by_name(
|
1099
|
+
self,
|
1100
|
+
name: str,
|
1101
|
+
glossary_guid: str = None,
|
1102
|
+
status: [str] = ["ACTIVE"],
|
1103
|
+
server_name: str = None,
|
1104
|
+
start_from: int = 0,
|
1105
|
+
page_size: int = None,
|
1106
|
+
) -> list | str:
|
1107
|
+
"""Retrieve the list of glossary category metadata elements that either have the requested qualified name or
|
924
1108
|
display name. The name to search for is located in the request body and is interpreted as a plain string.
|
925
|
-
The request body also supports the specification of a glossaryGUID to restrict the search to within a
|
1109
|
+
The request body also supports the specification of a glossaryGUID to restrict the search to within a
|
926
1110
|
single glossary.
|
927
1111
|
|
928
1112
|
Parameters
|
@@ -960,12 +1144,19 @@ class GlossaryBrowser(Client):
|
|
960
1144
|
"""
|
961
1145
|
loop = asyncio.get_event_loop()
|
962
1146
|
response = loop.run_until_complete(
|
963
|
-
self._async_get_categories_by_name(
|
1147
|
+
self._async_get_categories_by_name(
|
1148
|
+
name, glossary_guid, status, server_name, start_from, page_size
|
1149
|
+
)
|
1150
|
+
)
|
964
1151
|
return response
|
965
1152
|
|
966
|
-
async def _async_get_categories_by_guid(
|
967
|
-
|
968
|
-
|
1153
|
+
async def _async_get_categories_by_guid(
|
1154
|
+
self,
|
1155
|
+
glossary_category_guid: str,
|
1156
|
+
effective_time: str = None,
|
1157
|
+
server_name: str = None,
|
1158
|
+
) -> list | str:
|
1159
|
+
"""Retrieve the requested glossary category metadata element. The optional request body contain an effective
|
969
1160
|
time for the query..
|
970
1161
|
|
971
1162
|
Async version.
|
@@ -1001,17 +1192,26 @@ class GlossaryBrowser(Client):
|
|
1001
1192
|
if server_name is None:
|
1002
1193
|
server_name = self.server_name
|
1003
1194
|
|
1004
|
-
url = (
|
1005
|
-
|
1195
|
+
url = (
|
1196
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/categories/"
|
1197
|
+
f"{glossary_category_guid}/retrieve"
|
1198
|
+
)
|
1006
1199
|
|
1007
|
-
body = {
|
1200
|
+
body = {
|
1201
|
+
"class": "EffectiveTimeQueryRequestBody",
|
1202
|
+
"effectiveTime": effective_time,
|
1203
|
+
}
|
1008
1204
|
|
1009
1205
|
response = await self._async_make_request("POST", url, body)
|
1010
1206
|
return response.json().get("element", "No Category found")
|
1011
1207
|
|
1012
|
-
def get_categories_by_guid(
|
1013
|
-
|
1014
|
-
|
1208
|
+
def get_categories_by_guid(
|
1209
|
+
self,
|
1210
|
+
glossary_category_guid: str,
|
1211
|
+
effective_time: str = None,
|
1212
|
+
server_name: str = None,
|
1213
|
+
) -> list | str:
|
1214
|
+
"""Retrieve the requested glossary category metadata element. The optional request body contain an effective
|
1015
1215
|
time for the query..
|
1016
1216
|
|
1017
1217
|
Parameters
|
@@ -1044,12 +1244,19 @@ class GlossaryBrowser(Client):
|
|
1044
1244
|
"""
|
1045
1245
|
loop = asyncio.get_event_loop()
|
1046
1246
|
response = loop.run_until_complete(
|
1047
|
-
self._async_get_categories_by_guid(
|
1247
|
+
self._async_get_categories_by_guid(
|
1248
|
+
glossary_category_guid, effective_time, server_name
|
1249
|
+
)
|
1250
|
+
)
|
1048
1251
|
return response
|
1049
1252
|
|
1050
|
-
async def _async_get_category_parent(
|
1051
|
-
|
1052
|
-
|
1253
|
+
async def _async_get_category_parent(
|
1254
|
+
self,
|
1255
|
+
glossary_category_guid: str,
|
1256
|
+
effective_time: str = None,
|
1257
|
+
server_name: str = None,
|
1258
|
+
) -> list | str:
|
1259
|
+
"""Glossary categories can be organized in a hierarchy. Retrieve the parent glossary category metadata
|
1053
1260
|
element for the glossary category with the supplied unique identifier. If the requested category
|
1054
1261
|
does not have a parent category, null is returned. The optional request body contain an effective time
|
1055
1262
|
for the query.
|
@@ -1087,17 +1294,26 @@ class GlossaryBrowser(Client):
|
|
1087
1294
|
if server_name is None:
|
1088
1295
|
server_name = self.server_name
|
1089
1296
|
|
1090
|
-
url = (
|
1091
|
-
|
1297
|
+
url = (
|
1298
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/categories/"
|
1299
|
+
f"{glossary_category_guid}/parent/retrieve"
|
1300
|
+
)
|
1092
1301
|
|
1093
|
-
body = {
|
1302
|
+
body = {
|
1303
|
+
"class": "EffectiveTimeQueryRequestBody",
|
1304
|
+
"effectiveTime": effective_time,
|
1305
|
+
}
|
1094
1306
|
|
1095
1307
|
response = await self._async_make_request("POST", url, body)
|
1096
1308
|
return response.json().get("element", "No Parent Category found")
|
1097
1309
|
|
1098
|
-
def get_category_parent(
|
1099
|
-
|
1100
|
-
|
1310
|
+
def get_category_parent(
|
1311
|
+
self,
|
1312
|
+
glossary_category_guid: str,
|
1313
|
+
effective_time: str = None,
|
1314
|
+
server_name: str = None,
|
1315
|
+
) -> list | str:
|
1316
|
+
"""Glossary categories can be organized in a hierarchy. Retrieve the parent glossary category metadata
|
1101
1317
|
element for the glossary category with the supplied unique identifier. If the requested category
|
1102
1318
|
does not have a parent category, null is returned. The optional request body contain an effective time
|
1103
1319
|
for the query.
|
@@ -1132,17 +1348,25 @@ class GlossaryBrowser(Client):
|
|
1132
1348
|
"""
|
1133
1349
|
loop = asyncio.get_event_loop()
|
1134
1350
|
response = loop.run_until_complete(
|
1135
|
-
self._async_get_category_parent(
|
1351
|
+
self._async_get_category_parent(
|
1352
|
+
glossary_category_guid, effective_time, server_name
|
1353
|
+
)
|
1354
|
+
)
|
1136
1355
|
return response
|
1137
1356
|
|
1138
1357
|
#
|
1139
1358
|
# Terms
|
1140
1359
|
#
|
1141
1360
|
|
1142
|
-
async def _async_get_terms_for_category(
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1361
|
+
async def _async_get_terms_for_category(
|
1362
|
+
self,
|
1363
|
+
glossary_category_guid: str,
|
1364
|
+
server_name: str = None,
|
1365
|
+
effective_time: str = None,
|
1366
|
+
start_from: int = 0,
|
1367
|
+
page_size: int = None,
|
1368
|
+
) -> list | str:
|
1369
|
+
"""Retrieve ALL the glossary terms in a category.
|
1146
1370
|
The request body also supports the specification of an effective time for the query.
|
1147
1371
|
|
1148
1372
|
Async Version.
|
@@ -1185,8 +1409,10 @@ class GlossaryBrowser(Client):
|
|
1185
1409
|
if page_size is None:
|
1186
1410
|
page_size = self.page_size
|
1187
1411
|
|
1188
|
-
url = (
|
1189
|
-
|
1412
|
+
url = (
|
1413
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/terms/"
|
1414
|
+
f"{glossary_category_guid}/terms/retrieve?startFrom={start_from}&pageSize={page_size}"
|
1415
|
+
)
|
1190
1416
|
|
1191
1417
|
if effective_time is not None:
|
1192
1418
|
body = {"effectiveTime": effective_time}
|
@@ -1196,10 +1422,15 @@ class GlossaryBrowser(Client):
|
|
1196
1422
|
|
1197
1423
|
return response.json().get("elementList", "No terms found")
|
1198
1424
|
|
1199
|
-
def get_terms_for_category(
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1425
|
+
def get_terms_for_category(
|
1426
|
+
self,
|
1427
|
+
glossary_category_guid: str,
|
1428
|
+
server_name: str = None,
|
1429
|
+
effective_time: str = None,
|
1430
|
+
start_from: int = 0,
|
1431
|
+
page_size: int = None,
|
1432
|
+
) -> list | str:
|
1433
|
+
"""Retrieve ALL the glossary terms in a category.
|
1203
1434
|
The request body also supports the specification of an effective time for the query.
|
1204
1435
|
|
1205
1436
|
Async Version.
|
@@ -1236,15 +1467,26 @@ class GlossaryBrowser(Client):
|
|
1236
1467
|
"""
|
1237
1468
|
loop = asyncio.get_event_loop()
|
1238
1469
|
response = loop.run_until_complete(
|
1239
|
-
self._async_get_terms_for_category(
|
1240
|
-
|
1470
|
+
self._async_get_terms_for_category(
|
1471
|
+
glossary_category_guid,
|
1472
|
+
server_name,
|
1473
|
+
effective_time,
|
1474
|
+
start_from,
|
1475
|
+
page_size,
|
1476
|
+
)
|
1477
|
+
)
|
1241
1478
|
|
1242
1479
|
return response
|
1243
1480
|
|
1244
|
-
async def _async_get_terms_for_glossary(
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1481
|
+
async def _async_get_terms_for_glossary(
|
1482
|
+
self,
|
1483
|
+
glossary_guid: str,
|
1484
|
+
server_name: str = None,
|
1485
|
+
effective_time: str = None,
|
1486
|
+
start_from: int = 0,
|
1487
|
+
page_size: int = None,
|
1488
|
+
) -> list | str:
|
1489
|
+
"""Retrieve the list of glossary terms associated with a glossary.
|
1248
1490
|
The request body also supports the specification of an effective time for the query.
|
1249
1491
|
Parameters
|
1250
1492
|
----------
|
@@ -1284,8 +1526,10 @@ class GlossaryBrowser(Client):
|
|
1284
1526
|
if page_size is None:
|
1285
1527
|
page_size = self.page_size
|
1286
1528
|
|
1287
|
-
url = (
|
1288
|
-
|
1529
|
+
url = (
|
1530
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/"
|
1531
|
+
f"{glossary_guid}/terms/retrieve?startFrom={start_from}&pageSize={page_size}"
|
1532
|
+
)
|
1289
1533
|
|
1290
1534
|
if effective_time is not None:
|
1291
1535
|
body = {"effectiveTime": effective_time}
|
@@ -1295,9 +1539,15 @@ class GlossaryBrowser(Client):
|
|
1295
1539
|
|
1296
1540
|
return response.json().get("elementList", "No terms found")
|
1297
1541
|
|
1298
|
-
def get_terms_for_glossary(
|
1299
|
-
|
1300
|
-
|
1542
|
+
def get_terms_for_glossary(
|
1543
|
+
self,
|
1544
|
+
glossary_guid: str,
|
1545
|
+
server_name: str = None,
|
1546
|
+
effective_time: str = None,
|
1547
|
+
start_from: int = 0,
|
1548
|
+
page_size: int = None,
|
1549
|
+
) -> list | str:
|
1550
|
+
"""Retrieve the list of glossary terms associated with a glossary.
|
1301
1551
|
The request body also supports the specification of an effective time for the query.
|
1302
1552
|
Parameters
|
1303
1553
|
----------
|
@@ -1331,15 +1581,22 @@ class GlossaryBrowser(Client):
|
|
1331
1581
|
"""
|
1332
1582
|
loop = asyncio.get_event_loop()
|
1333
1583
|
response = loop.run_until_complete(
|
1334
|
-
self._async_get_terms_for_glossary(
|
1584
|
+
self._async_get_terms_for_glossary(
|
1585
|
+
glossary_guid, server_name, effective_time, start_from, page_size
|
1586
|
+
)
|
1587
|
+
)
|
1335
1588
|
|
1336
1589
|
return response
|
1337
1590
|
|
1338
|
-
async def _async_get_term_relationships(
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1591
|
+
async def _async_get_term_relationships(
|
1592
|
+
self,
|
1593
|
+
term_guid: str,
|
1594
|
+
server_name: str = None,
|
1595
|
+
effective_time: str = None,
|
1596
|
+
start_from: int = 0,
|
1597
|
+
page_size: int = None,
|
1598
|
+
) -> list | str:
|
1599
|
+
"""This call retrieves details of the glossary terms linked to this glossary term.
|
1343
1600
|
Notice the original org 1 glossary term is linked via the "SourcedFrom" relationship..
|
1344
1601
|
Parameters
|
1345
1602
|
----------
|
@@ -1379,8 +1636,10 @@ class GlossaryBrowser(Client):
|
|
1379
1636
|
if page_size is None:
|
1380
1637
|
page_size = self.page_size
|
1381
1638
|
|
1382
|
-
url = (
|
1383
|
-
|
1639
|
+
url = (
|
1640
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/terms/"
|
1641
|
+
f"{term_guid}/related-terms?startFrom={start_from}&pageSize={page_size}"
|
1642
|
+
)
|
1384
1643
|
|
1385
1644
|
if effective_time is not None:
|
1386
1645
|
body = {"effectiveTime": effective_time}
|
@@ -1390,10 +1649,15 @@ class GlossaryBrowser(Client):
|
|
1390
1649
|
|
1391
1650
|
return response.json().get("elementList", "No terms found")
|
1392
1651
|
|
1393
|
-
def get_term_relationships(
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1652
|
+
def get_term_relationships(
|
1653
|
+
self,
|
1654
|
+
term_guid: str,
|
1655
|
+
server_name: str = None,
|
1656
|
+
effective_time: str = None,
|
1657
|
+
start_from: int = 0,
|
1658
|
+
page_size: int = None,
|
1659
|
+
) -> list | str:
|
1660
|
+
"""This call retrieves details of the glossary terms linked to this glossary term.
|
1397
1661
|
Notice the original org 1 glossary term is linked via the "SourcedFrom" relationship..
|
1398
1662
|
Parameters
|
1399
1663
|
----------
|
@@ -1427,13 +1691,17 @@ class GlossaryBrowser(Client):
|
|
1427
1691
|
"""
|
1428
1692
|
loop = asyncio.get_event_loop()
|
1429
1693
|
response = loop.run_until_complete(
|
1430
|
-
self._async_get_term_relationships(
|
1694
|
+
self._async_get_term_relationships(
|
1695
|
+
term_guid, server_name, effective_time, start_from, page_size
|
1696
|
+
)
|
1697
|
+
)
|
1431
1698
|
|
1432
1699
|
return response
|
1433
1700
|
|
1434
|
-
async def _async_get_glossary_for_term(
|
1435
|
-
|
1436
|
-
|
1701
|
+
async def _async_get_glossary_for_term(
|
1702
|
+
self, term_guid: str, server_name: str = None, effective_time: str = None
|
1703
|
+
) -> dict | str:
|
1704
|
+
"""Retrieve the glossary metadata element for the requested term. The optional request body allows you to
|
1437
1705
|
specify that the glossary element should only be returned if it was effective at a particular time.
|
1438
1706
|
|
1439
1707
|
Async Version.
|
@@ -1467,16 +1735,22 @@ class GlossaryBrowser(Client):
|
|
1467
1735
|
server_name = self.server_name
|
1468
1736
|
validate_guid(term_guid)
|
1469
1737
|
|
1470
|
-
body = {
|
1471
|
-
|
1472
|
-
|
1738
|
+
body = {
|
1739
|
+
"class": "EffectiveTimeQueryRequestBody",
|
1740
|
+
"effectiveTime": effective_time,
|
1741
|
+
}
|
1742
|
+
url = (
|
1743
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/"
|
1744
|
+
f"for-term/{term_guid}/retrieve"
|
1745
|
+
)
|
1473
1746
|
|
1474
1747
|
response = await self._async_make_request("POST", url, body)
|
1475
1748
|
return response.json().get("element", "No glossary found")
|
1476
1749
|
|
1477
|
-
def get_glossary_for_term(
|
1478
|
-
|
1479
|
-
|
1750
|
+
def get_glossary_for_term(
|
1751
|
+
self, term_guid: str, server_name: str = None, effective_time: str = None
|
1752
|
+
) -> dict | str:
|
1753
|
+
"""Retrieve the glossary metadata element for the requested term. The optional request body allows you to
|
1480
1754
|
specify that the glossary element should only be returned if it was effective at a particular time.
|
1481
1755
|
|
1482
1756
|
Async Version.
|
@@ -1507,14 +1781,24 @@ class GlossaryBrowser(Client):
|
|
1507
1781
|
-----
|
1508
1782
|
"""
|
1509
1783
|
loop = asyncio.get_event_loop()
|
1510
|
-
response = loop.run_until_complete(
|
1784
|
+
response = loop.run_until_complete(
|
1785
|
+
self._async_get_glossary_for_term(term_guid, server_name, effective_time)
|
1786
|
+
)
|
1511
1787
|
return response
|
1512
1788
|
|
1513
|
-
async def _async_get_terms_by_name(
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1789
|
+
async def _async_get_terms_by_name(
|
1790
|
+
self,
|
1791
|
+
term: str,
|
1792
|
+
glossary_guid: str = None,
|
1793
|
+
status_filter: list = [],
|
1794
|
+
server_name: str = None,
|
1795
|
+
effective_time: str = None,
|
1796
|
+
for_lineage: bool = False,
|
1797
|
+
for_duplicate_processing: bool = False,
|
1798
|
+
start_from: int = 0,
|
1799
|
+
page_size: int = None,
|
1800
|
+
) -> list:
|
1801
|
+
"""Retrieve glossary terms by display name or qualified name. Async Version.
|
1518
1802
|
|
1519
1803
|
Parameters
|
1520
1804
|
----------
|
@@ -1562,69 +1846,97 @@ class GlossaryBrowser(Client):
|
|
1562
1846
|
for_lineage_s = str(for_lineage).lower()
|
1563
1847
|
for_duplicate_processing_s = str(for_duplicate_processing).lower()
|
1564
1848
|
|
1565
|
-
body = {
|
1566
|
-
|
1849
|
+
body = {
|
1850
|
+
"class": "GlossaryNameRequestBody",
|
1851
|
+
"glossaryGUID": glossary_guid,
|
1852
|
+
"name": term,
|
1853
|
+
"effectiveTime": effective_time,
|
1854
|
+
"limitResultsByStatus": status_filter,
|
1855
|
+
}
|
1567
1856
|
# body = body_slimmer(body)
|
1568
1857
|
|
1569
|
-
url = (
|
1570
|
-
|
1571
|
-
|
1858
|
+
url = (
|
1859
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/"
|
1860
|
+
f"terms/by-name?startFrom={start_from}&pageSize={page_size}&"
|
1861
|
+
f"&forLineage={for_lineage_s}&forDuplicateProcessing={for_duplicate_processing_s}"
|
1862
|
+
)
|
1572
1863
|
|
1573
1864
|
# print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
|
1574
1865
|
|
1575
1866
|
response = await self._async_make_request("POST", url, body)
|
1576
1867
|
return response.json().get("elementList", "No terms found")
|
1577
1868
|
|
1578
|
-
def get_terms_by_name(
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1869
|
+
def get_terms_by_name(
|
1870
|
+
self,
|
1871
|
+
term: str,
|
1872
|
+
glossary_guid: str = None,
|
1873
|
+
status_filter: list = [],
|
1874
|
+
server_name: str = None,
|
1875
|
+
effective_time: str = None,
|
1876
|
+
for_lineage: bool = False,
|
1877
|
+
for_duplicate_processing: bool = False,
|
1878
|
+
start_from: int = 0,
|
1879
|
+
page_size: int = None,
|
1880
|
+
) -> list:
|
1881
|
+
"""Retrieve glossary terms by display name or qualified name.
|
1882
|
+
|
1883
|
+
Parameters
|
1884
|
+
----------
|
1885
|
+
term : str
|
1886
|
+
The term to search for in the glossaries.
|
1887
|
+
glossary_guid : str, optional
|
1888
|
+
The GUID of the glossary to search in. If not provided, the search will be performed in all glossaries.
|
1889
|
+
status_filter : list, optional
|
1890
|
+
A list of status values to filter the search results. Default is an empty list, which means no filtering.
|
1891
|
+
server_name : str, optional
|
1892
|
+
The name of the server where the glossaries reside. If not provided, it will use the default server name.
|
1893
|
+
effective_time : datetime, optional
|
1894
|
+
If specified, the term information will be retrieved if it is active at the `effective_time`.
|
1895
|
+
Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
1896
|
+
for_lineage : bool, optional
|
1897
|
+
Flag to indicate whether the search should include lineage information. Default is False.
|
1898
|
+
for_duplicate_processing : bool, optional
|
1899
|
+
Flag to indicate whether the search should include duplicate processing information. Default is False.
|
1900
|
+
start_from : int, optional
|
1901
|
+
The index of the first term to retrieve. Default is 0.
|
1902
|
+
page_size : int, optional
|
1903
|
+
The number of terms to retrieve per page. If not provided, it will use the default page size.
|
1904
|
+
|
1905
|
+
Returns
|
1906
|
+
-------
|
1907
|
+
list
|
1908
|
+
A list of terms matching the search criteria. If no terms are found,
|
1909
|
+
it returns the string "No terms found".
|
1910
|
+
|
1911
|
+
Raises
|
1912
|
+
------
|
1913
|
+
InvalidParameterException
|
1914
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
|
1915
|
+
PropertyServerException
|
1916
|
+
Raised by the server when an issue arises in processing a valid request.
|
1917
|
+
NotAuthorizedException
|
1918
|
+
The principle specified by the user_id does not have authorization for the requested action.
|
1919
|
+
"""
|
1620
1920
|
loop = asyncio.get_event_loop()
|
1621
1921
|
response = loop.run_until_complete(
|
1622
|
-
self._async_get_terms_by_name(
|
1623
|
-
|
1922
|
+
self._async_get_terms_by_name(
|
1923
|
+
term,
|
1924
|
+
glossary_guid,
|
1925
|
+
status_filter,
|
1926
|
+
server_name,
|
1927
|
+
effective_time,
|
1928
|
+
for_lineage,
|
1929
|
+
for_duplicate_processing,
|
1930
|
+
start_from,
|
1931
|
+
page_size,
|
1932
|
+
)
|
1933
|
+
)
|
1624
1934
|
return response
|
1625
1935
|
|
1626
|
-
async def _async_get_terms_by_guid(
|
1627
|
-
|
1936
|
+
async def _async_get_terms_by_guid(
|
1937
|
+
self, term_guid: str, server_name: str = None
|
1938
|
+
) -> dict | str:
|
1939
|
+
"""Retrieve a term using its unique id. Async version.
|
1628
1940
|
Parameters
|
1629
1941
|
----------
|
1630
1942
|
term_guid : str
|
@@ -1652,14 +1964,16 @@ class GlossaryBrowser(Client):
|
|
1652
1964
|
|
1653
1965
|
validate_guid(term_guid)
|
1654
1966
|
|
1655
|
-
url = (
|
1656
|
-
|
1967
|
+
url = (
|
1968
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/terms/"
|
1969
|
+
f"{term_guid}/retrieve"
|
1970
|
+
)
|
1657
1971
|
|
1658
1972
|
response = await self._async_make_request("POST", url)
|
1659
1973
|
return response.json().get("element", "No term found")
|
1660
1974
|
|
1661
1975
|
def get_terms_by_guid(self, term_guid: str, server_name: str = None) -> dict | str:
|
1662
|
-
"""
|
1976
|
+
"""Retrieve a term using its unique id. Async version.
|
1663
1977
|
Parameters
|
1664
1978
|
----------
|
1665
1979
|
term_guid : str
|
@@ -1684,13 +1998,20 @@ class GlossaryBrowser(Client):
|
|
1684
1998
|
"""
|
1685
1999
|
|
1686
2000
|
loop = asyncio.get_event_loop()
|
1687
|
-
response = loop.run_until_complete(
|
2001
|
+
response = loop.run_until_complete(
|
2002
|
+
self._async_get_terms_by_guid(term_guid, server_name)
|
2003
|
+
)
|
1688
2004
|
|
1689
2005
|
return response
|
1690
2006
|
|
1691
|
-
async def _async_get_terms_versions(
|
1692
|
-
|
1693
|
-
|
2007
|
+
async def _async_get_terms_versions(
|
2008
|
+
self,
|
2009
|
+
term_guid: str,
|
2010
|
+
server_name: str = None,
|
2011
|
+
start_from: int = 0,
|
2012
|
+
page_size=None,
|
2013
|
+
) -> dict | str:
|
2014
|
+
"""Retrieve the versions of a glossary term. Async version.
|
1694
2015
|
Parameters
|
1695
2016
|
----------
|
1696
2017
|
term_guid : str
|
@@ -1724,15 +2045,22 @@ class GlossaryBrowser(Client):
|
|
1724
2045
|
|
1725
2046
|
validate_guid(term_guid)
|
1726
2047
|
|
1727
|
-
url = (
|
1728
|
-
|
2048
|
+
url = (
|
2049
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/terms/"
|
2050
|
+
f"{term_guid}/history?startFrom={start_from}&pageSize={page_size}"
|
2051
|
+
)
|
1729
2052
|
|
1730
2053
|
response = await self._async_make_request("POST", url)
|
1731
2054
|
return response.json().get("element", "No term found")
|
1732
2055
|
|
1733
|
-
def get_terms_versions(
|
1734
|
-
|
1735
|
-
|
2056
|
+
def get_terms_versions(
|
2057
|
+
self,
|
2058
|
+
term_guid: str,
|
2059
|
+
server_name: str = None,
|
2060
|
+
start_from: int = 0,
|
2061
|
+
page_size=None,
|
2062
|
+
) -> dict | str:
|
2063
|
+
"""Retrieve the versions of a glossary term.
|
1736
2064
|
Parameters
|
1737
2065
|
----------
|
1738
2066
|
term_guid : str
|
@@ -1761,13 +2089,21 @@ class GlossaryBrowser(Client):
|
|
1761
2089
|
|
1762
2090
|
loop = asyncio.get_event_loop()
|
1763
2091
|
response = loop.run_until_complete(
|
1764
|
-
self._async_get_terms_versions(
|
2092
|
+
self._async_get_terms_versions(
|
2093
|
+
term_guid, server_name, start_from, page_size
|
2094
|
+
)
|
2095
|
+
)
|
1765
2096
|
|
1766
2097
|
return response
|
1767
2098
|
|
1768
|
-
async def _async_get_term_revision_logs(
|
1769
|
-
|
1770
|
-
|
2099
|
+
async def _async_get_term_revision_logs(
|
2100
|
+
self,
|
2101
|
+
term_guid: str,
|
2102
|
+
server_name: str = None,
|
2103
|
+
start_from: int = 0,
|
2104
|
+
page_size=None,
|
2105
|
+
) -> dict | str:
|
2106
|
+
"""Retrieve the revision log history for a term. Async version.
|
1771
2107
|
Parameters
|
1772
2108
|
----------
|
1773
2109
|
term_guid : str
|
@@ -1801,15 +2137,22 @@ class GlossaryBrowser(Client):
|
|
1801
2137
|
|
1802
2138
|
validate_guid(term_guid)
|
1803
2139
|
|
1804
|
-
url = (
|
1805
|
-
|
2140
|
+
url = (
|
2141
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/elements/"
|
2142
|
+
f"{term_guid}/notes/retrieve?startFrom={start_from}&pageSize={page_size}"
|
2143
|
+
)
|
1806
2144
|
|
1807
2145
|
response = await self._async_make_request("POST", url)
|
1808
2146
|
return response.json().get("elementList", "No log found")
|
1809
2147
|
|
1810
|
-
def get_term_revision_logs(
|
1811
|
-
|
1812
|
-
|
2148
|
+
def get_term_revision_logs(
|
2149
|
+
self,
|
2150
|
+
term_guid: str,
|
2151
|
+
server_name: str = None,
|
2152
|
+
start_from: int = 0,
|
2153
|
+
page_size=None,
|
2154
|
+
) -> dict | str:
|
2155
|
+
"""Retrieve the revision log history for a term.
|
1813
2156
|
Parameters
|
1814
2157
|
----------
|
1815
2158
|
term_guid : str
|
@@ -1838,13 +2181,21 @@ class GlossaryBrowser(Client):
|
|
1838
2181
|
|
1839
2182
|
loop = asyncio.get_event_loop()
|
1840
2183
|
response = loop.run_until_complete(
|
1841
|
-
self._async_get_term_revision_logs(
|
2184
|
+
self._async_get_term_revision_logs(
|
2185
|
+
term_guid, server_name, start_from, page_size
|
2186
|
+
)
|
2187
|
+
)
|
1842
2188
|
|
1843
2189
|
return response
|
1844
2190
|
|
1845
|
-
async def _async_get_term_revision_history(
|
1846
|
-
|
1847
|
-
|
2191
|
+
async def _async_get_term_revision_history(
|
2192
|
+
self,
|
2193
|
+
term_revision_log_guid: str,
|
2194
|
+
server_name: str = None,
|
2195
|
+
start_from: int = 0,
|
2196
|
+
page_size=None,
|
2197
|
+
) -> dict | str:
|
2198
|
+
"""Retrieve the revision history for a glossary term. Async version.
|
1848
2199
|
|
1849
2200
|
Parameters
|
1850
2201
|
----------
|
@@ -1884,15 +2235,22 @@ class GlossaryBrowser(Client):
|
|
1884
2235
|
|
1885
2236
|
validate_guid(term_revision_log_guid)
|
1886
2237
|
|
1887
|
-
url = (
|
1888
|
-
|
2238
|
+
url = (
|
2239
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/note-logs/"
|
2240
|
+
f"{term_revision_log_guid}/notes/retrieve?startFrom={start_from}&pageSize={page_size}"
|
2241
|
+
)
|
1889
2242
|
|
1890
2243
|
response = await self._async_make_request("POST", url)
|
1891
2244
|
return response.json().get("elementList", "No logs found")
|
1892
2245
|
|
1893
|
-
def get_term_revision_history(
|
1894
|
-
|
1895
|
-
|
2246
|
+
def get_term_revision_history(
|
2247
|
+
self,
|
2248
|
+
term_revision_log_guid: str,
|
2249
|
+
server_name: str = None,
|
2250
|
+
start_from: int = 0,
|
2251
|
+
page_size=None,
|
2252
|
+
) -> dict | str:
|
2253
|
+
"""Retrieve the revision history for a glossary term.
|
1896
2254
|
|
1897
2255
|
Parameters
|
1898
2256
|
----------
|
@@ -1927,17 +2285,29 @@ class GlossaryBrowser(Client):
|
|
1927
2285
|
|
1928
2286
|
loop = asyncio.get_event_loop()
|
1929
2287
|
response = loop.run_until_complete(
|
1930
|
-
self._async_get_term_revision_history(
|
2288
|
+
self._async_get_term_revision_history(
|
2289
|
+
term_revision_log_guid, server_name, start_from, page_size
|
2290
|
+
)
|
2291
|
+
)
|
1931
2292
|
|
1932
2293
|
return response
|
1933
2294
|
|
1934
|
-
async def _async_find_glossary_terms(
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
2295
|
+
async def _async_find_glossary_terms(
|
2296
|
+
self,
|
2297
|
+
search_string: str,
|
2298
|
+
glossary_guid: str = None,
|
2299
|
+
status_filter: list = [],
|
2300
|
+
effective_time: str = None,
|
2301
|
+
starts_with: bool = False,
|
2302
|
+
ends_with: bool = False,
|
2303
|
+
ignore_case: bool = False,
|
2304
|
+
for_lineage: bool = False,
|
2305
|
+
for_duplicate_processing: bool = False,
|
2306
|
+
server_name: str = None,
|
2307
|
+
start_from: int = 0,
|
2308
|
+
page_size: int = None,
|
2309
|
+
) -> list | str:
|
2310
|
+
"""Retrieve the list of glossary term metadata elements that contain the search string.
|
1941
2311
|
|
1942
2312
|
Parameters
|
1943
2313
|
----------
|
@@ -1988,7 +2358,7 @@ class GlossaryBrowser(Client):
|
|
1988
2358
|
-----
|
1989
2359
|
The search string is located in the request body and is interpreted as a plain string.
|
1990
2360
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
1991
|
-
The request body also supports the specification of a glossaryGUID to restrict the search to within a single
|
2361
|
+
The request body also supports the specification of a glossaryGUID to restrict the search to within a single
|
1992
2362
|
glossary.
|
1993
2363
|
"""
|
1994
2364
|
if server_name is None:
|
@@ -2002,100 +2372,137 @@ class GlossaryBrowser(Client):
|
|
2002
2372
|
ignore_case_s = str(ignore_case).lower()
|
2003
2373
|
for_lineage_s = str(for_lineage).lower()
|
2004
2374
|
for_duplicate_processing_s = str(for_duplicate_processing).lower()
|
2005
|
-
if search_string ==
|
2375
|
+
if search_string == "*":
|
2006
2376
|
search_string = None
|
2007
2377
|
|
2008
2378
|
# validate_search_string(search_string)
|
2009
2379
|
|
2010
|
-
body = {
|
2011
|
-
|
2380
|
+
body = {
|
2381
|
+
"class": "GlossarySearchStringRequestBody",
|
2382
|
+
"glossaryGUID": glossary_guid,
|
2383
|
+
"searchString": search_string,
|
2384
|
+
"effectiveTime": effective_time,
|
2385
|
+
"limitResultsByStatus": status_filter,
|
2386
|
+
}
|
2012
2387
|
# body = body_slimmer(body)
|
2013
2388
|
|
2014
|
-
url = (
|
2015
|
-
|
2016
|
-
|
2017
|
-
|
2389
|
+
url = (
|
2390
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/"
|
2391
|
+
f"terms/by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
2392
|
+
f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}&forLineage={for_lineage_s}&"
|
2393
|
+
f"forDuplicateProcessing={for_duplicate_processing_s}"
|
2394
|
+
)
|
2018
2395
|
|
2019
2396
|
# print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
|
2020
2397
|
|
2021
2398
|
response = await self._async_make_request("POST", url, body)
|
2022
|
-
return response.json().get(
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
2029
|
-
|
2030
|
-
|
2031
|
-
|
2032
|
-
|
2033
|
-
|
2034
|
-
|
2035
|
-
|
2036
|
-
|
2037
|
-
|
2038
|
-
|
2039
|
-
|
2040
|
-
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
2052
|
-
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2056
|
-
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2065
|
-
|
2066
|
-
|
2067
|
-
|
2068
|
-
|
2069
|
-
|
2070
|
-
|
2071
|
-
|
2072
|
-
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2399
|
+
return response.json().get(
|
2400
|
+
"elementList", "No terms found"
|
2401
|
+
) # return response.text
|
2402
|
+
|
2403
|
+
def find_glossary_terms(
|
2404
|
+
self,
|
2405
|
+
search_string: str,
|
2406
|
+
glossary_guid: str = None,
|
2407
|
+
status_filter: list = [],
|
2408
|
+
effective_time: str = None,
|
2409
|
+
starts_with: bool = False,
|
2410
|
+
ends_with: bool = False,
|
2411
|
+
ignore_case: bool = False,
|
2412
|
+
for_lineage: bool = False,
|
2413
|
+
for_duplicate_processing: bool = False,
|
2414
|
+
server_name: str = None,
|
2415
|
+
start_from: int = 0,
|
2416
|
+
page_size: int = None,
|
2417
|
+
) -> list | str:
|
2418
|
+
"""Retrieve the list of glossary term metadata elements that contain the search string.
|
2419
|
+
|
2420
|
+
Parameters
|
2421
|
+
----------
|
2422
|
+
search_string: str
|
2423
|
+
Search string to use to find matching glossaries. If the search string is '*' then all glossaries
|
2424
|
+
returned.
|
2425
|
+
glossary_guid str
|
2426
|
+
Identifier of the glossary to search within. If None, then all glossaries are searched.
|
2427
|
+
status_filter: list, default = [], optional
|
2428
|
+
Filters the results by the included Term statuses (such as 'ACTIVE', 'DRAFT'). If not specified,
|
2429
|
+
the results will not be filtered.
|
2430
|
+
effective_time: str, [default=None], optional
|
2431
|
+
If specified, the term information will be retrieved if it is active at the `effective_time`.
|
2432
|
+
Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
2433
|
+
server_name : str, optional
|
2434
|
+
The name of the server to configure.
|
2435
|
+
If not provided, the server name associated with the instance is used.
|
2436
|
+
starts_with : bool, [default=False], optional
|
2437
|
+
Starts with the supplied string.
|
2438
|
+
ends_with : bool, [default=False], optional
|
2439
|
+
Ends with the supplied string
|
2440
|
+
ignore_case : bool, [default=False], optional
|
2441
|
+
Ignore case when searching
|
2442
|
+
for_lineage : bool, [default=False], optional
|
2443
|
+
|
2444
|
+
for_duplicate_processing : bool, [default=False], optional
|
2445
|
+
|
2446
|
+
start_from: str, [default=0], optional
|
2447
|
+
Page of results to start from
|
2448
|
+
page_size : int, optional
|
2449
|
+
Number of elements to return per page - if None, then default for class will be used.
|
2450
|
+
|
2451
|
+
Returns
|
2452
|
+
-------
|
2453
|
+
List | str
|
2454
|
+
|
2455
|
+
A list of term definitions
|
2456
|
+
|
2457
|
+
Raises
|
2458
|
+
------
|
2459
|
+
InvalidParameterException
|
2460
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
2461
|
+
PropertyServerException
|
2462
|
+
Raised by the server when an issue arises in processing a valid request
|
2463
|
+
NotAuthorizedException
|
2464
|
+
The principle specified by the user_id does not have authorization for the requested action
|
2465
|
+
|
2466
|
+
Notes
|
2467
|
+
-----
|
2468
|
+
The search string is located in the request body and is interpreted as a plain string.
|
2469
|
+
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
2470
|
+
The request body also supports the specification of a glossaryGUID to restrict the search to within a
|
2471
|
+
single glossary.
|
2472
|
+
"""
|
2084
2473
|
|
2085
2474
|
loop = asyncio.get_event_loop()
|
2086
2475
|
response = loop.run_until_complete(
|
2087
|
-
self._async_find_glossary_terms(
|
2088
|
-
|
2089
|
-
|
2476
|
+
self._async_find_glossary_terms(
|
2477
|
+
search_string,
|
2478
|
+
glossary_guid,
|
2479
|
+
status_filter,
|
2480
|
+
effective_time,
|
2481
|
+
starts_with,
|
2482
|
+
ends_with,
|
2483
|
+
ignore_case,
|
2484
|
+
for_lineage,
|
2485
|
+
for_duplicate_processing,
|
2486
|
+
server_name,
|
2487
|
+
start_from,
|
2488
|
+
page_size,
|
2489
|
+
)
|
2490
|
+
)
|
2090
2491
|
|
2091
2492
|
return response
|
2092
2493
|
|
2093
2494
|
#
|
2094
2495
|
# Feedback
|
2095
2496
|
#
|
2096
|
-
async def _async_get_comment(
|
2097
|
-
|
2098
|
-
|
2497
|
+
async def _async_get_comment(
|
2498
|
+
self,
|
2499
|
+
commemt_guid: str,
|
2500
|
+
effective_time: str,
|
2501
|
+
server_name: str = None,
|
2502
|
+
for_lineage: bool = False,
|
2503
|
+
for_duplicate_processing: bool = False,
|
2504
|
+
) -> dict | list:
|
2505
|
+
"""Retrieve the comment specified by the comment GUID"""
|
2099
2506
|
if server_name is None:
|
2100
2507
|
server_name = self.server_name
|
2101
2508
|
|
@@ -2109,19 +2516,28 @@ class GlossaryBrowser(Client):
|
|
2109
2516
|
|
2110
2517
|
body = {"effective_time": effective_time}
|
2111
2518
|
|
2112
|
-
url = (
|
2113
|
-
|
2114
|
-
|
2519
|
+
url = (
|
2520
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/comments/"
|
2521
|
+
f"{commemt_guid}?forLineage={for_lineage_s}&"
|
2522
|
+
f"forDuplicateProcessing={for_duplicate_processing_s}"
|
2523
|
+
)
|
2115
2524
|
|
2116
2525
|
# print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
|
2117
2526
|
|
2118
2527
|
response = await self._async_make_request("POST", url, body)
|
2119
2528
|
return response.json()
|
2120
2529
|
|
2121
|
-
async def _async_add_comment_reply(
|
2122
|
-
|
2123
|
-
|
2124
|
-
|
2530
|
+
async def _async_add_comment_reply(
|
2531
|
+
self,
|
2532
|
+
comment_guid: str,
|
2533
|
+
is_public: bool,
|
2534
|
+
comment_type: str,
|
2535
|
+
comment_text: str,
|
2536
|
+
server_name: str = None,
|
2537
|
+
for_lineage: bool = False,
|
2538
|
+
for_duplicate_processing: bool = False,
|
2539
|
+
) -> str:
|
2540
|
+
"""Reply to a comment"""
|
2125
2541
|
|
2126
2542
|
if server_name is None:
|
2127
2543
|
server_name = self.server_name
|
@@ -2133,22 +2549,36 @@ class GlossaryBrowser(Client):
|
|
2133
2549
|
for_lineage_s = str(for_lineage).lower()
|
2134
2550
|
for_duplicate_processing_s = str(for_duplicate_processing).lower()
|
2135
2551
|
|
2136
|
-
body = {
|
2137
|
-
|
2552
|
+
body = {
|
2553
|
+
"class": "CommentRequestBody",
|
2554
|
+
"commentType": comment_type,
|
2555
|
+
"commentText": comment_text,
|
2556
|
+
"isPublic": is_public,
|
2557
|
+
}
|
2138
2558
|
|
2139
|
-
url = (
|
2140
|
-
|
2141
|
-
|
2559
|
+
url = (
|
2560
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/comments/"
|
2561
|
+
f"{comment_guid}/replies?isPublic={is_public_s}&forLineage={for_lineage_s}&"
|
2562
|
+
f"forDuplicateProcessing={for_duplicate_processing_s}"
|
2563
|
+
)
|
2142
2564
|
|
2143
2565
|
# print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
|
2144
2566
|
|
2145
2567
|
response = await self._async_make_request("POST", url, body)
|
2146
2568
|
return response
|
2147
2569
|
|
2148
|
-
async def _async_update_comment(
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2570
|
+
async def _async_update_comment(
|
2571
|
+
self,
|
2572
|
+
comment_guid: str,
|
2573
|
+
is_public: bool,
|
2574
|
+
comment_type: str,
|
2575
|
+
comment_text: str,
|
2576
|
+
server_name: str = None,
|
2577
|
+
is_merge_update: bool = False,
|
2578
|
+
for_lineage: bool = False,
|
2579
|
+
for_duplicate_processing: bool = False,
|
2580
|
+
) -> str:
|
2581
|
+
"""Update the specified comment"""
|
2152
2582
|
if server_name is None:
|
2153
2583
|
server_name = self.server_name
|
2154
2584
|
|
@@ -2159,23 +2589,39 @@ class GlossaryBrowser(Client):
|
|
2159
2589
|
for_lineage_s = str(for_lineage).lower()
|
2160
2590
|
for_duplicate_processing_s = str(for_duplicate_processing).lower()
|
2161
2591
|
|
2162
|
-
body = {
|
2163
|
-
|
2592
|
+
body = {
|
2593
|
+
"class": "CommentRequestBody",
|
2594
|
+
"commentType": comment_type,
|
2595
|
+
"commentText": comment_text,
|
2596
|
+
"isPublic": is_public,
|
2597
|
+
}
|
2164
2598
|
|
2165
|
-
url = (
|
2166
|
-
|
2167
|
-
|
2599
|
+
url = (
|
2600
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/comments/"
|
2601
|
+
f"{comment_guid}/replies?isPublic={is_public_s}&forLineage={for_lineage_s}&"
|
2602
|
+
f"forDuplicateProcessing={for_duplicate_processing_s}"
|
2603
|
+
)
|
2168
2604
|
|
2169
2605
|
# print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
|
2170
2606
|
|
2171
2607
|
response = await self._async_make_request("POST", url, body)
|
2172
2608
|
return response
|
2173
2609
|
|
2174
|
-
async def _async_find_comment(
|
2175
|
-
|
2176
|
-
|
2177
|
-
|
2178
|
-
|
2610
|
+
async def _async_find_comment(
|
2611
|
+
self,
|
2612
|
+
search_string: str,
|
2613
|
+
glossary_guid: str = None,
|
2614
|
+
status_filter: list = [],
|
2615
|
+
effective_time: str = None,
|
2616
|
+
starts_with: bool = False,
|
2617
|
+
ends_with: bool = False,
|
2618
|
+
ignore_case: bool = False,
|
2619
|
+
for_lineage: bool = False,
|
2620
|
+
for_duplicate_processing: bool = False,
|
2621
|
+
server_name: str = None,
|
2622
|
+
start_from: int = 0,
|
2623
|
+
page_size: int = None,
|
2624
|
+
):
|
2179
2625
|
"""Find comments by search string"""
|
2180
2626
|
if server_name is None:
|
2181
2627
|
server_name = self.server_name
|
@@ -2188,19 +2634,26 @@ class GlossaryBrowser(Client):
|
|
2188
2634
|
ignore_case_s = str(ignore_case).lower()
|
2189
2635
|
for_lineage_s = str(for_lineage).lower()
|
2190
2636
|
for_duplicate_processing_s = str(for_duplicate_processing).lower()
|
2191
|
-
if search_string ==
|
2637
|
+
if search_string == "*":
|
2192
2638
|
search_string = None
|
2193
2639
|
|
2194
2640
|
# validate_search_string(search_string)
|
2195
2641
|
|
2196
|
-
body = {
|
2197
|
-
|
2642
|
+
body = {
|
2643
|
+
"class": "GlossarySearchStringRequestBody",
|
2644
|
+
"glossaryGUID": glossary_guid,
|
2645
|
+
"searchString": search_string,
|
2646
|
+
"effectiveTime": effective_time,
|
2647
|
+
"limitResultsByStatus": status_filter,
|
2648
|
+
}
|
2198
2649
|
# body = body_slimmer(body)
|
2199
2650
|
|
2200
|
-
url = (
|
2201
|
-
|
2202
|
-
|
2203
|
-
|
2651
|
+
url = (
|
2652
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/"
|
2653
|
+
f"terms/by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
2654
|
+
f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}&forLineage={for_lineage_s}&"
|
2655
|
+
f"forDuplicateProcessing={for_duplicate_processing_s}"
|
2656
|
+
)
|
2204
2657
|
|
2205
2658
|
# print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
|
2206
2659
|
|