pyegeria 5.4.7.4__py3-none-any.whl → 5.4.7.6__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.
- commands/ops/__init__.py +0 -2
- commands/ops/list_catalog_targets.py +0 -1
- commands/ops/load_archive.py +3 -3
- commands/ops/monitor_engine_activity.py +1 -1
- commands/tech/__init__.py +0 -2
- md_processing/md_commands/solution_architect_commands.py +1 -1
- pyegeria/__init__.py +3 -3
- pyegeria/_client_new.py +386 -172
- pyegeria/automated_curation.py +686 -837
- pyegeria/classification_manager.py +2413 -837
- pyegeria/external_references.py +1 -1
- pyegeria/full_omag_server_config.py +1 -1
- pyegeria/project_manager.py +8 -0
- pyegeria/reference_data.py +4 -0
- pyegeria/solution_architect.py +6 -4
- {pyegeria-5.4.7.4.dist-info → pyegeria-5.4.7.6.dist-info}/METADATA +1 -1
- {pyegeria-5.4.7.4.dist-info → pyegeria-5.4.7.6.dist-info}/RECORD +21 -21
- {pyegeria-5.4.7.4.dist-info → pyegeria-5.4.7.6.dist-info}/WHEEL +0 -0
- {pyegeria-5.4.7.4.dist-info → pyegeria-5.4.7.6.dist-info}/entry_points.txt +0 -0
- {pyegeria-5.4.7.4.dist-info → pyegeria-5.4.7.6.dist-info}/licenses/LICENSE +0 -0
- {pyegeria-5.4.7.4.dist-info → pyegeria-5.4.7.6.dist-info}/top_level.txt +0 -0
@@ -10,11 +10,19 @@ import asyncio
|
|
10
10
|
from httpx import Response
|
11
11
|
from loguru import logger
|
12
12
|
|
13
|
-
|
13
|
+
from pyegeria import PyegeriaException
|
14
14
|
from pyegeria._client_new import Client2
|
15
15
|
from pyegeria._globals import default_time_out, NO_ELEMENTS_FOUND
|
16
|
-
from pyegeria.models import LevelIdentifierQueryBody, FilterRequestBody
|
17
|
-
from pyegeria.utils import body_slimmer
|
16
|
+
from pyegeria.models import LevelIdentifierQueryBody, FilterRequestBody, GetRequestBody
|
17
|
+
from pyegeria.utils import body_slimmer, dynamic_catch
|
18
|
+
from pyegeria._output_formats import select_output_format_set, get_output_format_type_match
|
19
|
+
from pyegeria.output_formatter import (
|
20
|
+
generate_output,
|
21
|
+
_extract_referenceable_properties,
|
22
|
+
populate_columns_from_properties,
|
23
|
+
get_required_relationships,
|
24
|
+
)
|
25
|
+
|
18
26
|
|
19
27
|
def query_seperator(current_string):
|
20
28
|
if current_string == "":
|
@@ -82,11 +90,85 @@ class ClassificationManager(Client2):
|
|
82
90
|
token=token,
|
83
91
|
)
|
84
92
|
|
93
|
+
# Default entity label for formatter when not specified
|
94
|
+
self.REFERENCEABLE_LABEL = "Referenceable"
|
95
|
+
|
96
|
+
def _extract_referenceable_output_properties(self, element: dict, columns_struct: dict) -> dict:
|
97
|
+
"""Populate requested columns from a generic Referenceable element.
|
98
|
+
Tolerant of missing values; fills from properties, header, relationships, and mermaid graph.
|
99
|
+
"""
|
100
|
+
col_data = populate_columns_from_properties(element, columns_struct)
|
101
|
+
columns_list = col_data.get("formats", {}).get("columns", [])
|
102
|
+
|
103
|
+
# Header-derived fields (GUID, qualifiedName, displayName, etc.)
|
104
|
+
header_props = _extract_referenceable_properties(element)
|
105
|
+
for col in columns_list:
|
106
|
+
key = col.get("key")
|
107
|
+
if key in header_props:
|
108
|
+
col["value"] = header_props.get(key)
|
109
|
+
elif isinstance(key, str) and key.lower() == "guid":
|
110
|
+
col["value"] = header_props.get("GUID")
|
111
|
+
|
112
|
+
# Relationships (generic handler fills requested relationship-driven columns if present in format set)
|
113
|
+
col_data = get_required_relationships(element, col_data)
|
114
|
+
|
115
|
+
# Mermaid graph support if present
|
116
|
+
mermaid_val = element.get("mermaidGraph", "") or ""
|
117
|
+
for col in columns_list:
|
118
|
+
if col.get("key") == "mermaid":
|
119
|
+
col["value"] = mermaid_val
|
120
|
+
break
|
121
|
+
|
122
|
+
return col_data
|
123
|
+
|
124
|
+
def _generate_referenceable_output(self,
|
125
|
+
elements: dict | list[dict],
|
126
|
+
filter: str | None,
|
127
|
+
element_type_name: str | None,
|
128
|
+
output_format: str = "DICT",
|
129
|
+
output_format_set: dict | str | None = None) -> str | list[dict]:
|
130
|
+
"""Resolve format set and generate output for Referenceable-derived elements."""
|
131
|
+
entity_type = element_type_name or self.REFERENCEABLE_LABEL
|
132
|
+
|
133
|
+
# Resolve output format set
|
134
|
+
get_additional_props_func = None
|
135
|
+
if output_format_set:
|
136
|
+
if isinstance(output_format_set, str):
|
137
|
+
output_formats = select_output_format_set(output_format_set, output_format)
|
138
|
+
else:
|
139
|
+
output_formats = get_output_format_type_match(output_format_set, output_format)
|
140
|
+
elif element_type_name:
|
141
|
+
output_formats = select_output_format_set(element_type_name, output_format)
|
142
|
+
else:
|
143
|
+
output_formats = select_output_format_set(entity_type, output_format)
|
144
|
+
|
145
|
+
if output_formats is None:
|
146
|
+
output_formats = select_output_format_set("Default", output_format)
|
147
|
+
|
148
|
+
# Optional hook: allow format set to specify an enrichment method on this class
|
149
|
+
get_additional_props_name = (
|
150
|
+
output_formats.get("get_additional_props", {}).get("function") if output_formats else None
|
151
|
+
)
|
152
|
+
if isinstance(get_additional_props_name, str):
|
153
|
+
method_name = get_additional_props_name.split(".")[-1]
|
154
|
+
if hasattr(self, method_name):
|
155
|
+
get_additional_props_func = getattr(self, method_name)
|
156
|
+
|
157
|
+
return generate_output(
|
158
|
+
elements,
|
159
|
+
filter,
|
160
|
+
entity_type,
|
161
|
+
output_format,
|
162
|
+
self._extract_referenceable_output_properties,
|
163
|
+
get_additional_props_func,
|
164
|
+
output_formats,
|
165
|
+
)
|
166
|
+
|
85
167
|
|
86
168
|
#
|
87
169
|
# Get elements
|
88
170
|
#
|
89
|
-
|
171
|
+
@dynamic_catch
|
90
172
|
async def async_get_classified_elements_by(
|
91
173
|
self,
|
92
174
|
classification_name: str,
|
@@ -147,6 +229,7 @@ class ClassificationManager(Client2):
|
|
147
229
|
)
|
148
230
|
return response
|
149
231
|
|
232
|
+
@dynamic_catch
|
150
233
|
def get_classified_elements_by(
|
151
234
|
self,
|
152
235
|
classification_name: str,
|
@@ -206,6 +289,7 @@ class ClassificationManager(Client2):
|
|
206
289
|
)
|
207
290
|
return response
|
208
291
|
|
292
|
+
@dynamic_catch
|
209
293
|
async def async_get_security_tagged_elements(
|
210
294
|
self,
|
211
295
|
body: dict,
|
@@ -238,22 +322,22 @@ class ClassificationManager(Client2):
|
|
238
322
|
Sample body:
|
239
323
|
|
240
324
|
{
|
241
|
-
"class": "
|
242
|
-
"effectiveTime": "{{$isoTimestamp}}",
|
243
|
-
"asOfTime": "{{$isoTimestamp}}",
|
244
|
-
"forLineage": false,
|
245
|
-
"forDuplicateProcessing": false,
|
246
|
-
"metadataElementTypeName": "GlossaryTerm",
|
247
|
-
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
248
|
-
"sequencingProperty": "???",
|
249
|
-
"sequencingOrder": "LAST_UPDATE_RECENT",
|
250
|
-
"securityLabels": ["???"],
|
251
|
-
"securityProperties": {
|
252
|
-
|
253
|
-
|
254
|
-
"accessGroups": {
|
255
|
-
"groupName": "
|
256
|
-
|
325
|
+
"class" : "SecurityTagQueryProperties",
|
326
|
+
"effectiveTime" : "{{$isoTimestamp}}",
|
327
|
+
"asOfTime" : "{{$isoTimestamp}}",
|
328
|
+
"forLineage" : false,
|
329
|
+
"forDuplicateProcessing" : false,
|
330
|
+
"metadataElementTypeName" : "GlossaryTerm",
|
331
|
+
"limitResultsByStatus" : [ "ACTIVE", "DRAFT"],
|
332
|
+
"sequencingProperty" : "???",
|
333
|
+
"sequencingOrder" : "LAST_UPDATE_RECENT",
|
334
|
+
"securityLabels" : [ "???" ],
|
335
|
+
"securityProperties" : {
|
336
|
+
"propertyName" : "propertyValue"
|
337
|
+
},
|
338
|
+
"accessGroups" : {
|
339
|
+
"groupName" : [ "???" ]
|
340
|
+
}
|
257
341
|
}
|
258
342
|
|
259
343
|
"""
|
@@ -276,6 +360,7 @@ class ClassificationManager(Client2):
|
|
276
360
|
output_format, output_format_set)
|
277
361
|
return elements
|
278
362
|
|
363
|
+
@dynamic_catch
|
279
364
|
def get_security_tagged_elements(
|
280
365
|
self,
|
281
366
|
body: dict,
|
@@ -289,8 +374,6 @@ class ClassificationManager(Client2):
|
|
289
374
|
|
290
375
|
Parameters
|
291
376
|
----------
|
292
|
-
classification_name: str
|
293
|
-
One of impact, confidence, criticality, confidentiality, retention
|
294
377
|
body: dict
|
295
378
|
Details of the query. See LevelIdentifierQueryBody for details.
|
296
379
|
output_format: str, default = "JSON"
|
@@ -311,24 +394,23 @@ class ClassificationManager(Client2):
|
|
311
394
|
Sample body:
|
312
395
|
|
313
396
|
{
|
314
|
-
"class": "
|
315
|
-
"effectiveTime": "{{$isoTimestamp}}",
|
316
|
-
"asOfTime": "{{$isoTimestamp}}",
|
317
|
-
"forLineage": false,
|
318
|
-
"forDuplicateProcessing": false,
|
319
|
-
"metadataElementTypeName": "GlossaryTerm",
|
320
|
-
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
321
|
-
"sequencingProperty": "???",
|
322
|
-
"sequencingOrder": "LAST_UPDATE_RECENT",
|
323
|
-
"securityLabels": ["???"],
|
324
|
-
"securityProperties": {
|
325
|
-
|
326
|
-
|
327
|
-
"accessGroups": {
|
328
|
-
"groupName": "
|
329
|
-
|
397
|
+
"class" : "SecurityTagQueryProperties",
|
398
|
+
"effectiveTime" : "{{$isoTimestamp}}",
|
399
|
+
"asOfTime" : "{{$isoTimestamp}}",
|
400
|
+
"forLineage" : false,
|
401
|
+
"forDuplicateProcessing" : false,
|
402
|
+
"metadataElementTypeName" : "GlossaryTerm",
|
403
|
+
"limitResultsByStatus" : [ "ACTIVE", "DRAFT"],
|
404
|
+
"sequencingProperty" : "???",
|
405
|
+
"sequencingOrder" : "LAST_UPDATE_RECENT",
|
406
|
+
"securityLabels" : [ "???" ],
|
407
|
+
"securityProperties" : {
|
408
|
+
"propertyName" : "propertyValue"
|
409
|
+
},
|
410
|
+
"accessGroups" : {
|
411
|
+
"groupName" : [ "???" ]
|
412
|
+
}
|
330
413
|
}
|
331
|
-
|
332
414
|
"""
|
333
415
|
|
334
416
|
loop = asyncio.get_event_loop()
|
@@ -339,6 +421,7 @@ class ClassificationManager(Client2):
|
|
339
421
|
)
|
340
422
|
return response
|
341
423
|
|
424
|
+
@dynamic_catch
|
342
425
|
async def async_get_owners_elements(
|
343
426
|
self,
|
344
427
|
owner_name: str,
|
@@ -347,7 +430,7 @@ class ClassificationManager(Client2):
|
|
347
430
|
output_format_set: dict | str = None
|
348
431
|
) -> list | str:
|
349
432
|
"""
|
350
|
-
Return information about the elements classified with the
|
433
|
+
Return information about the elements classified with the ownership classification. Async version.
|
351
434
|
|
352
435
|
https://egeria-project.org/types/4/0422-Governed-Data-Classifications/
|
353
436
|
|
@@ -355,7 +438,7 @@ class ClassificationManager(Client2):
|
|
355
438
|
----------
|
356
439
|
owner_name: str
|
357
440
|
Name of owner to retrieve elements for.
|
358
|
-
body: dict |
|
441
|
+
body: dict | FilterRequestBody
|
359
442
|
Details of the query. See LevelIdentifierQueryBody for details.
|
360
443
|
output_format: str, default = "JSON"
|
361
444
|
Type of output to return.
|
@@ -375,7 +458,8 @@ class ClassificationManager(Client2):
|
|
375
458
|
Sample body:
|
376
459
|
|
377
460
|
{
|
378
|
-
"class": "
|
461
|
+
"class": "FilterRequestBody",
|
462
|
+
"filter": "????",
|
379
463
|
"effectiveTime": "{{$isoTimestamp}}",
|
380
464
|
"asOfTime": "{{$isoTimestamp}}",
|
381
465
|
"forLineage": false,
|
@@ -383,8 +467,7 @@ class ClassificationManager(Client2):
|
|
383
467
|
"metadataElementTypeName": "GlossaryTerm",
|
384
468
|
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
385
469
|
"sequencingProperty": "???",
|
386
|
-
"sequencingOrder": "LAST_UPDATE_RECENT"
|
387
|
-
"name" : "owner_name"
|
470
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
388
471
|
}
|
389
472
|
|
390
473
|
"""
|
@@ -392,22 +475,13 @@ class ClassificationManager(Client2):
|
|
392
475
|
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
393
476
|
f"classification-explorer/elements/by-ownership")
|
394
477
|
|
395
|
-
response = await self.
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
if type(elements) is str:
|
401
|
-
logger.info(NO_ELEMENTS_FOUND)
|
402
|
-
return NO_ELEMENTS_FOUND
|
403
|
-
|
404
|
-
if output_format != 'JSON': # return a simplified markdown representation
|
405
|
-
logger.info(f"Found elements, output format: {output_format} and output_format_set: {output_format_set}")
|
406
|
-
return self._generate_referenceable_output(elements, "", "Referenceable",
|
407
|
-
output_format, output_format_set)
|
408
|
-
return elements
|
409
|
-
|
478
|
+
response = await self._async_get_name_request(url, "Referenceable",
|
479
|
+
self._generate_referenceable_output, owner_name,
|
480
|
+
None, 0, 0,
|
481
|
+
output_format, output_format_set, body)
|
482
|
+
return response
|
410
483
|
|
484
|
+
@dynamic_catch
|
411
485
|
def get_owners_elements(
|
412
486
|
self,
|
413
487
|
owner_name: str,
|
@@ -416,7 +490,7 @@ class ClassificationManager(Client2):
|
|
416
490
|
output_format_set: dict | str = None
|
417
491
|
) -> list | str:
|
418
492
|
"""
|
419
|
-
Return information about the elements classified with the
|
493
|
+
Return information about the elements classified with the ownership classification.
|
420
494
|
|
421
495
|
https://egeria-project.org/types/4/0422-Governed-Data-Classifications/
|
422
496
|
|
@@ -424,7 +498,7 @@ class ClassificationManager(Client2):
|
|
424
498
|
----------
|
425
499
|
owner_name: str
|
426
500
|
Name of owner to retrieve elements for.
|
427
|
-
body: dict |
|
501
|
+
body: dict | FilterRequestBody
|
428
502
|
Details of the query. See LevelIdentifierQueryBody for details.
|
429
503
|
output_format: str, default = "JSON"
|
430
504
|
Type of output to return.
|
@@ -444,7 +518,8 @@ class ClassificationManager(Client2):
|
|
444
518
|
Sample body:
|
445
519
|
|
446
520
|
{
|
447
|
-
"class": "
|
521
|
+
"class": "FilterRequestBody",
|
522
|
+
"filter": "????",
|
448
523
|
"effectiveTime": "{{$isoTimestamp}}",
|
449
524
|
"asOfTime": "{{$isoTimestamp}}",
|
450
525
|
"forLineage": false,
|
@@ -452,11 +527,9 @@ class ClassificationManager(Client2):
|
|
452
527
|
"metadataElementTypeName": "GlossaryTerm",
|
453
528
|
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
454
529
|
"sequencingProperty": "???",
|
455
|
-
"sequencingOrder": "LAST_UPDATE_RECENT"
|
456
|
-
"name" : "owner_name"
|
530
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
457
531
|
}
|
458
532
|
|
459
|
-
|
460
533
|
"""
|
461
534
|
|
462
535
|
loop = asyncio.get_event_loop()
|
@@ -467,42 +540,29 @@ class ClassificationManager(Client2):
|
|
467
540
|
)
|
468
541
|
return response
|
469
542
|
|
470
|
-
|
471
|
-
async def
|
543
|
+
@dynamic_catch
|
544
|
+
async def async_get_subject_area_members(
|
472
545
|
self,
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
start_from: int = 0,
|
478
|
-
page_size: int = 0,
|
479
|
-
time_out: int = default_time_out,
|
546
|
+
subject_area: str,
|
547
|
+
body: dict | FilterRequestBody,
|
548
|
+
output_format: str = "JSON",
|
549
|
+
output_format_set: dict | str = None
|
480
550
|
) -> list | str:
|
481
551
|
"""
|
482
|
-
|
483
|
-
be returned.
|
552
|
+
Return information about the elements classified with the subject area classification. Async version.
|
484
553
|
|
485
|
-
https://egeria-project.org/types/
|
554
|
+
https://egeria-project.org/types/4/0422-Governed-Data-Classifications/
|
486
555
|
|
487
556
|
Parameters
|
488
557
|
----------
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
start_from: int, default = 0
|
498
|
-
- index of the list to start from (0 for start).
|
499
|
-
page_size
|
500
|
-
- maximum number of elements to return.
|
501
|
-
|
502
|
-
|
503
|
-
time_out: int, default = default_time_out
|
504
|
-
- http request timeout for this request
|
505
|
-
|
558
|
+
subject_area: str
|
559
|
+
Name of subject area to retrieve elements for.
|
560
|
+
body: dict | FilterRequestBody
|
561
|
+
Details of the query. See LevelIdentifierQueryBody for details.
|
562
|
+
output_format: str, default = "JSON"
|
563
|
+
Type of output to return.
|
564
|
+
output_format_set: dict | str, default = None
|
565
|
+
Output format set to use. If None, the default output format set is used.
|
506
566
|
Returns
|
507
567
|
-------
|
508
568
|
[dict] | str
|
@@ -511,65 +571,59 @@ class ClassificationManager(Client2):
|
|
511
571
|
Raises
|
512
572
|
------
|
513
573
|
PyegeriaException
|
514
|
-
"""
|
515
574
|
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
"
|
522
|
-
"
|
523
|
-
"
|
575
|
+
Notes
|
576
|
+
-----
|
577
|
+
Sample body:
|
578
|
+
|
579
|
+
{
|
580
|
+
"class": "FilterRequestBody",
|
581
|
+
"filter": "????",
|
582
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
583
|
+
"asOfTime": "{{$isoTimestamp}}",
|
584
|
+
"forLineage": false,
|
585
|
+
"forDuplicateProcessing": false,
|
586
|
+
"metadataElementTypeName": "GlossaryTerm",
|
587
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
588
|
+
"sequencingProperty": "???",
|
589
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
524
590
|
}
|
525
591
|
|
526
|
-
url = f"{base_path(self, self.view_server)}/elements/by-type"
|
527
|
-
response: Response = await self._async_make_request(
|
528
|
-
"POST", url, body_slimmer(body), time_out=time_out
|
529
|
-
)
|
530
|
-
elements = response.json().get("elements", NO_ELEMENTS_FOUND)
|
531
|
-
if type(elements) is list:
|
532
|
-
if len(elements) == 0:
|
533
|
-
return NO_ELEMENTS_FOUND
|
534
|
-
return elements
|
535
592
|
|
536
|
-
|
593
|
+
"""
|
594
|
+
|
595
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
596
|
+
f"classification-explorer/elements/by-ownership")
|
597
|
+
|
598
|
+
response = await self._async_get_name_request(url, "Referenceable",
|
599
|
+
self._generate_referenceable_output, subject_area,
|
600
|
+
None, 0, 0,
|
601
|
+
output_format, output_format_set, body)
|
602
|
+
return response
|
603
|
+
|
604
|
+
@dynamic_catch
|
605
|
+
def get_subject_area_members(
|
537
606
|
self,
|
538
|
-
|
539
|
-
|
540
|
-
for_lineage: bool = None,
|
541
|
-
for_duplicate_processing: bool = None,
|
542
|
-
start_from: int = 0,
|
543
|
-
page_size: int = 0,
|
544
|
-
time_out: int = default_time_out,
|
607
|
+
subject_area: str,
|
608
|
+
body: dict | FilterRequestBody,
|
545
609
|
output_format: str = "JSON",
|
546
|
-
output_format_set: dict | str = None
|
610
|
+
output_format_set: dict | str = None
|
547
611
|
) -> list | str:
|
548
612
|
"""
|
549
|
-
|
550
|
-
be returned.
|
613
|
+
Return information about the elements classified with the subject area classification.
|
551
614
|
|
552
|
-
https://egeria-project.org/types/
|
615
|
+
https://egeria-project.org/types/4/0422-Governed-Data-Classifications/
|
553
616
|
|
554
617
|
Parameters
|
555
618
|
----------
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
start_from: int, default = 0
|
565
|
-
- index of the list to start from (0 for start).
|
566
|
-
page_size
|
567
|
-
- maximum number of elements to return.
|
568
|
-
|
569
|
-
|
570
|
-
time_out: int, default = default_time_out
|
571
|
-
- http request timeout for this request
|
572
|
-
|
619
|
+
subject_area: str
|
620
|
+
Name of subject area to retrieve elements for.
|
621
|
+
body: dict | FilterRequestBody
|
622
|
+
Details of the query. See LevelIdentifierQueryBody for details.
|
623
|
+
output_format: str, default = "JSON"
|
624
|
+
Type of output to return.
|
625
|
+
output_format_set: dict | str, default = None
|
626
|
+
Output format set to use. If None, the default output format set is used.
|
573
627
|
Returns
|
574
628
|
-------
|
575
629
|
[dict] | str
|
@@ -578,63 +632,57 @@ class ClassificationManager(Client2):
|
|
578
632
|
Raises
|
579
633
|
------
|
580
634
|
PyegeriaException
|
635
|
+
|
636
|
+
Notes
|
637
|
+
-----
|
638
|
+
Sample body:
|
639
|
+
|
640
|
+
{
|
641
|
+
"class": "FilterRequestBody",
|
642
|
+
"filter": "????",
|
643
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
644
|
+
"asOfTime": "{{$isoTimestamp}}",
|
645
|
+
"forLineage": false,
|
646
|
+
"forDuplicateProcessing": false,
|
647
|
+
"metadataElementTypeName": "GlossaryTerm",
|
648
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
649
|
+
"sequencingProperty": "???",
|
650
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
651
|
+
}
|
652
|
+
|
653
|
+
|
654
|
+
|
581
655
|
"""
|
582
656
|
|
583
657
|
loop = asyncio.get_event_loop()
|
584
658
|
response = loop.run_until_complete(
|
585
|
-
self.
|
586
|
-
|
587
|
-
effective_time,
|
588
|
-
for_lineage,
|
589
|
-
for_duplicate_processing,
|
590
|
-
start_from,
|
591
|
-
page_size,
|
592
|
-
time_out,
|
659
|
+
self.async_get_subject_area_members(
|
660
|
+
subject_area, body, output_format, output_format_set
|
593
661
|
)
|
594
662
|
)
|
595
663
|
return response
|
596
664
|
|
597
|
-
|
665
|
+
@dynamic_catch
|
666
|
+
async def async_get_elements_by_origin(
|
598
667
|
self,
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
effective_time: str = None,
|
603
|
-
for_lineage: bool = None,
|
604
|
-
for_duplicate_processing: bool = None,
|
605
|
-
start_from: int = 0,
|
606
|
-
page_size: int = 0,
|
607
|
-
time_out: int = default_time_out,
|
668
|
+
body: dict ,
|
669
|
+
output_format: str = "JSON",
|
670
|
+
output_format_set: dict | str = None
|
608
671
|
) -> list | str:
|
609
672
|
"""
|
610
|
-
|
611
|
-
An open metadata type name may be supplied to restrict the results. Async version.
|
673
|
+
Return information about the digital resources from a specific origin. Async version.
|
612
674
|
|
613
|
-
https://egeria-project.org/types/
|
675
|
+
https://egeria-project.org/types/4/0440-Organizational-Controls/
|
614
676
|
|
615
677
|
Parameters
|
616
678
|
----------
|
617
|
-
property_value: str
|
618
|
-
- property value to be searched.
|
619
|
-
property_names: [str]
|
620
|
-
- property names to search in.
|
621
|
-
metadata_element_type_name : str, default = None
|
622
|
-
- open metadata type to be used to restrict the search
|
623
|
-
effective_time: str, default = None
|
624
|
-
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
625
|
-
for_lineage: bool, default is set by server
|
626
|
-
- determines if elements classified as Memento should be returned - normally false
|
627
|
-
for_duplicate_processing: bool, default is set by server
|
628
|
-
- Normally false. Set true when the caller is part of a deduplication function
|
629
|
-
start_from: int, default = 0
|
630
|
-
- index of the list to start from (0 for start).
|
631
|
-
page_size
|
632
|
-
- maximum number of elements to return.
|
633
|
-
|
634
|
-
|
635
|
-
time_out: int, default = default_time_out
|
636
|
-
- http request timeout for this request
|
637
679
|
|
680
|
+
body: dict
|
681
|
+
Details of the query.
|
682
|
+
output_format: str, default = "JSON"
|
683
|
+
Type of output to return.
|
684
|
+
output_format_set: dict | str, default = None
|
685
|
+
Output format set to use. If None, the default output format set is used.
|
638
686
|
Returns
|
639
687
|
-------
|
640
688
|
[dict] | str
|
@@ -643,36 +691,1750 @@ class ClassificationManager(Client2):
|
|
643
691
|
Raises
|
644
692
|
------
|
645
693
|
PyegeriaException
|
646
|
-
"""
|
647
694
|
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
"
|
654
|
-
"
|
655
|
-
"
|
656
|
-
"forLineage":
|
657
|
-
"forDuplicateProcessing":
|
695
|
+
Notes
|
696
|
+
-----
|
697
|
+
Sample body:
|
698
|
+
|
699
|
+
{
|
700
|
+
"class" : "FindDigitalResourceOriginProperties",
|
701
|
+
"effectiveTime" : "{{$isoTimestamp}}",
|
702
|
+
"asOfTime" : "{{$isoTimestamp}}",
|
703
|
+
"forLineage" : false,
|
704
|
+
"forDuplicateProcessing" : false,
|
705
|
+
"metadataElementTypeName" : "GlossaryTerm",
|
706
|
+
"limitResultsByStatus" : [ "ACTIVE", "DRAFT"],
|
707
|
+
"sequencingProperty" : "???",
|
708
|
+
"sequencingOrder" : "LAST_UPDATE_RECENT",
|
709
|
+
"organizationGUID" : "????",
|
710
|
+
"businessCapabilityGUID" : "????",
|
711
|
+
"otherOriginValues" : {
|
712
|
+
"propertyName" : "propertyValue"
|
713
|
+
}
|
658
714
|
}
|
659
715
|
|
660
|
-
|
716
|
+
"""
|
717
|
+
|
718
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
719
|
+
f"classification-explorer/elements/by-digital-resource-origin")
|
720
|
+
|
721
|
+
response = await self._async_make_request("POST", url, body_slimmer(body), time_out=default_time_out)
|
722
|
+
elements = response.json().get("elements", None)
|
723
|
+
if elements is None:
|
724
|
+
elements = response.json().get("element", NO_ELEMENTS_FOUND)
|
725
|
+
|
726
|
+
if type(elements) is str:
|
727
|
+
logger.info(NO_ELEMENTS_FOUND)
|
728
|
+
return NO_ELEMENTS_FOUND
|
729
|
+
|
730
|
+
if output_format != 'JSON': # return a simplified markdown representation
|
731
|
+
logger.info(f"Found elements, output format: {output_format} and output_format_set: {output_format_set}")
|
732
|
+
return self._generate_referenceable_output(elements, "", "Referenceable",
|
733
|
+
output_format, output_format_set)
|
734
|
+
return elements
|
735
|
+
|
736
|
+
@dynamic_catch
|
737
|
+
def get_elements_by_origin(
|
738
|
+
self,
|
739
|
+
body: dict ,
|
740
|
+
output_format: str = "JSON",
|
741
|
+
output_format_set: dict | str = None
|
742
|
+
) -> list | str:
|
743
|
+
"""
|
744
|
+
Return information about the digital resources from a specific origin.
|
745
|
+
|
746
|
+
https://egeria-project.org/types/4/0440-Organizational-Controls/
|
747
|
+
|
748
|
+
Parameters
|
749
|
+
----------
|
750
|
+
|
751
|
+
body: dict
|
752
|
+
Details of the query.
|
753
|
+
output_format: str, default = "JSON"
|
754
|
+
Type of output to return.
|
755
|
+
output_format_set: dict | str, default = None
|
756
|
+
Output format set to use. If None, the default output format set is used.
|
757
|
+
Returns
|
758
|
+
-------
|
759
|
+
[dict] | str
|
760
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
761
|
+
|
762
|
+
Raises
|
763
|
+
------
|
764
|
+
PyegeriaException
|
765
|
+
|
766
|
+
Notes
|
767
|
+
-----
|
768
|
+
Sample body:
|
769
|
+
|
770
|
+
{
|
771
|
+
"class" : "FindDigitalResourceOriginProperties",
|
772
|
+
"effectiveTime" : "{{$isoTimestamp}}",
|
773
|
+
"asOfTime" : "{{$isoTimestamp}}",
|
774
|
+
"forLineage" : false,
|
775
|
+
"forDuplicateProcessing" : false,
|
776
|
+
"metadataElementTypeName" : "GlossaryTerm",
|
777
|
+
"limitResultsByStatus" : [ "ACTIVE", "DRAFT"],
|
778
|
+
"sequencingProperty" : "???",
|
779
|
+
"sequencingOrder" : "LAST_UPDATE_RECENT",
|
780
|
+
"organizationGUID" : "????",
|
781
|
+
"businessCapabilityGUID" : "????",
|
782
|
+
"otherOriginValues" : {
|
783
|
+
"propertyName" : "propertyValue"
|
784
|
+
}
|
785
|
+
}
|
786
|
+
|
787
|
+
|
788
|
+
"""
|
789
|
+
|
790
|
+
loop = asyncio.get_event_loop()
|
791
|
+
response = loop.run_until_complete(
|
792
|
+
self.async_get_elements_by_origin(body, output_format, output_format_set
|
793
|
+
)
|
794
|
+
)
|
795
|
+
return response
|
796
|
+
|
797
|
+
@dynamic_catch
|
798
|
+
async def async_get_meanings(
|
799
|
+
self,
|
800
|
+
element_guid: str,
|
801
|
+
body: dict ,
|
802
|
+
output_format: str = "JSON",
|
803
|
+
output_format_set: dict | str = None
|
804
|
+
) -> list | str:
|
805
|
+
"""
|
806
|
+
Retrieve the glossary terms linked via a "SemanticAssignment" relationship to the requested element. Async version.
|
807
|
+
https://egeria-project.org/types/4/0440-Organizational-Controls/
|
808
|
+
|
809
|
+
Parameters
|
810
|
+
__________
|
811
|
+
element_guid: str
|
812
|
+
Element to retrieve information for.
|
813
|
+
body: dict
|
814
|
+
Details of the query.
|
815
|
+
output_format: str, default = "JSON"
|
816
|
+
Type of output to return.
|
817
|
+
output_format_set: dict | str, default = None
|
818
|
+
Output format set to use. If None, the default output format set is used.
|
819
|
+
Returns
|
820
|
+
-------
|
821
|
+
[dict] | str
|
822
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
823
|
+
|
824
|
+
Raises
|
825
|
+
------
|
826
|
+
PyegeriaException
|
827
|
+
|
828
|
+
Notes
|
829
|
+
-----
|
830
|
+
Sample body:
|
831
|
+
|
832
|
+
{
|
833
|
+
"class" : "SemanticAssignmentQueryProperties",
|
834
|
+
"effectiveTime" : "{{$isoTimestamp}}",
|
835
|
+
"asOfTime" : "{{$isoTimestamp}}",
|
836
|
+
"forLineage" : false,
|
837
|
+
"forDuplicateProcessing" : false,
|
838
|
+
"metadataElementTypeName" : "GlossaryTerm",
|
839
|
+
"limitResultsByStatus" : [ "ACTIVE", "DRAFT"],
|
840
|
+
"sequencingProperty" : "???",
|
841
|
+
"sequencingOrder" : "LAST_UPDATE_RECENT",
|
842
|
+
"expression" : "????",
|
843
|
+
"description" : "????",
|
844
|
+
"status" : "VALIDATED",
|
845
|
+
"returnSpecificConfidence" : true,
|
846
|
+
"confidence" : 100,
|
847
|
+
"createdBy" : "???",
|
848
|
+
"steward" : "??",
|
849
|
+
"source" : "???"
|
850
|
+
|
851
|
+
}
|
852
|
+
|
853
|
+
"""
|
854
|
+
|
855
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
856
|
+
f"classification-explorer/glossaries/terms/by-semantic-assignment/{element_guid}")
|
857
|
+
|
858
|
+
response = await self._async_make_request("POST", url, body_slimmer(body), time_out=default_time_out)
|
859
|
+
elements = response.json().get("elements", None)
|
860
|
+
if elements is None:
|
861
|
+
elements = response.json().get("element", NO_ELEMENTS_FOUND)
|
862
|
+
|
863
|
+
if type(elements) is str:
|
864
|
+
logger.info(NO_ELEMENTS_FOUND)
|
865
|
+
return NO_ELEMENTS_FOUND
|
866
|
+
|
867
|
+
if output_format != 'JSON': # return a simplified markdown representation
|
868
|
+
logger.info(f"Found elements, output format: {output_format} and output_format_set: {output_format_set}")
|
869
|
+
return self._generate_referenceable_output(elements, "", "Referenceable",
|
870
|
+
output_format, output_format_set)
|
871
|
+
return elements
|
872
|
+
|
873
|
+
@dynamic_catch
|
874
|
+
def get_meanings(
|
875
|
+
self,
|
876
|
+
element_guid: str,
|
877
|
+
body: dict ,
|
878
|
+
output_format: str = "JSON",
|
879
|
+
output_format_set: dict | str = None
|
880
|
+
) -> list | str:
|
881
|
+
"""
|
882
|
+
Retrieve the glossary terms linked via a "SemanticAssignment" relationship to the requested element.
|
883
|
+
https://egeria-project.org/types/4/0440-Organizational-Controls/
|
884
|
+
|
885
|
+
Parameters
|
886
|
+
__________
|
887
|
+
element_guid: str
|
888
|
+
Element to retrieve information for.
|
889
|
+
body: dict
|
890
|
+
Details of the query.
|
891
|
+
output_format: str, default = "JSON"
|
892
|
+
Type of output to return.
|
893
|
+
output_format_set: dict | str, default = None
|
894
|
+
Output format set to use. If None, the default output format set is used.
|
895
|
+
Returns
|
896
|
+
-------
|
897
|
+
[dict] | str
|
898
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
899
|
+
|
900
|
+
Raises
|
901
|
+
------
|
902
|
+
PyegeriaException
|
903
|
+
|
904
|
+
Notes
|
905
|
+
-----
|
906
|
+
Sample body:
|
907
|
+
|
908
|
+
{
|
909
|
+
"class" : "SemanticAssignmentQueryProperties",
|
910
|
+
"effectiveTime" : "{{$isoTimestamp}}",
|
911
|
+
"asOfTime" : "{{$isoTimestamp}}",
|
912
|
+
"forLineage" : false,
|
913
|
+
"forDuplicateProcessing" : false,
|
914
|
+
"metadataElementTypeName" : "GlossaryTerm",
|
915
|
+
"limitResultsByStatus" : [ "ACTIVE", "DRAFT"],
|
916
|
+
"sequencingProperty" : "???",
|
917
|
+
"sequencingOrder" : "LAST_UPDATE_RECENT",
|
918
|
+
"expression" : "????",
|
919
|
+
"description" : "????",
|
920
|
+
"status" : "VALIDATED",
|
921
|
+
"returnSpecificConfidence" : true,
|
922
|
+
"confidence" : 100,
|
923
|
+
"createdBy" : "???",
|
924
|
+
"steward" : "??",
|
925
|
+
"source" : "???"
|
926
|
+
|
927
|
+
}
|
928
|
+
|
929
|
+
"""
|
930
|
+
|
931
|
+
loop = asyncio.get_event_loop()
|
932
|
+
response = loop.run_until_complete(
|
933
|
+
self.async_get_meanings(element_guid,body, output_format, output_format_set
|
934
|
+
)
|
935
|
+
)
|
936
|
+
return response
|
937
|
+
|
938
|
+
@dynamic_catch
|
939
|
+
async def async_get_semantic_asignees(
|
940
|
+
self,
|
941
|
+
term_guid: str,
|
942
|
+
body: dict ,
|
943
|
+
output_format: str = "JSON",
|
944
|
+
output_format_set: dict | str = None
|
945
|
+
) -> list | str:
|
946
|
+
"""
|
947
|
+
Retrieve the elements linked via a "SemanticAssignment" relationship to the requested glossary term. Async version.
|
948
|
+
https://egeria-project.org/types/4/0440-Organizational-Controls/
|
949
|
+
|
950
|
+
Parameters
|
951
|
+
__________
|
952
|
+
term_guid: str
|
953
|
+
Element to retrieve information for.
|
954
|
+
body: dict
|
955
|
+
Details of the query.
|
956
|
+
output_format: str, default = "JSON"
|
957
|
+
Type of output to return.
|
958
|
+
output_format_set: dict | str, default = None
|
959
|
+
Output format set to use. If None, the default output format set is used.
|
960
|
+
Returns
|
961
|
+
-------
|
962
|
+
[dict] | str
|
963
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
964
|
+
|
965
|
+
Raises
|
966
|
+
------
|
967
|
+
PyegeriaException
|
968
|
+
|
969
|
+
Notes
|
970
|
+
-----
|
971
|
+
Sample body:
|
972
|
+
|
973
|
+
{
|
974
|
+
"class" : "SemanticAssignmentQueryProperties",
|
975
|
+
"effectiveTime" : "{{$isoTimestamp}}",
|
976
|
+
"asOfTime" : "{{$isoTimestamp}}",
|
977
|
+
"forLineage" : false,
|
978
|
+
"forDuplicateProcessing" : false,
|
979
|
+
"metadataElementTypeName" : "GlossaryTerm",
|
980
|
+
"limitResultsByStatus" : [ "ACTIVE", "DRAFT"],
|
981
|
+
"sequencingProperty" : "???",
|
982
|
+
"sequencingOrder" : "LAST_UPDATE_RECENT",
|
983
|
+
"expression" : "????",
|
984
|
+
"description" : "????",
|
985
|
+
"status" : "VALIDATED",
|
986
|
+
"returnSpecificConfidence" : true,
|
987
|
+
"confidence" : 100,
|
988
|
+
"createdBy" : "???",
|
989
|
+
"steward" : "??",
|
990
|
+
"source" : "???"
|
991
|
+
|
992
|
+
}
|
993
|
+
|
994
|
+
"""
|
995
|
+
|
996
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
997
|
+
f"classification-explorer/glossaries/elements/by-semantic-assignment/{term_guid}")
|
998
|
+
|
999
|
+
response = await self._async_make_request("POST", url, body_slimmer(body), time_out=default_time_out)
|
1000
|
+
elements = response.json().get("elements", None)
|
1001
|
+
if elements is None:
|
1002
|
+
elements = response.json().get("element", NO_ELEMENTS_FOUND)
|
1003
|
+
|
1004
|
+
if type(elements) is str:
|
1005
|
+
logger.info(NO_ELEMENTS_FOUND)
|
1006
|
+
return NO_ELEMENTS_FOUND
|
1007
|
+
|
1008
|
+
if output_format != 'JSON': # return a simplified markdown representation
|
1009
|
+
logger.info(f"Found elements, output format: {output_format} and output_format_set: {output_format_set}")
|
1010
|
+
return self._generate_referenceable_output(elements, "", "Referenceable",
|
1011
|
+
output_format, output_format_set)
|
1012
|
+
return elements
|
1013
|
+
|
1014
|
+
@dynamic_catch
|
1015
|
+
def get_semantic_asignees(
|
1016
|
+
self,
|
1017
|
+
term_guid: str,
|
1018
|
+
body: dict ,
|
1019
|
+
output_format: str = "JSON",
|
1020
|
+
output_format_set: dict | str = None
|
1021
|
+
) -> list | str:
|
1022
|
+
"""
|
1023
|
+
Retrieve the elements linked via a "SemanticAssignment" relationship to the requested glossary term.
|
1024
|
+
https://egeria-project.org/types/4/0440-Organizational-Controls/
|
1025
|
+
|
1026
|
+
Parameters
|
1027
|
+
__________
|
1028
|
+
term_guid: str
|
1029
|
+
Element to retrieve information for.
|
1030
|
+
body: dict
|
1031
|
+
Details of the query.
|
1032
|
+
output_format: str, default = "JSON"
|
1033
|
+
Type of output to return.
|
1034
|
+
output_format_set: dict | str, default = None
|
1035
|
+
Output format set to use. If None, the default output format set is used.
|
1036
|
+
Returns
|
1037
|
+
-------
|
1038
|
+
[dict] | str
|
1039
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1040
|
+
|
1041
|
+
Raises
|
1042
|
+
------
|
1043
|
+
PyegeriaException
|
1044
|
+
|
1045
|
+
Notes
|
1046
|
+
-----
|
1047
|
+
Sample body:
|
1048
|
+
|
1049
|
+
{
|
1050
|
+
"class" : "SemanticAssignmentQueryProperties",
|
1051
|
+
"effectiveTime" : "{{$isoTimestamp}}",
|
1052
|
+
"asOfTime" : "{{$isoTimestamp}}",
|
1053
|
+
"forLineage" : false,
|
1054
|
+
"forDuplicateProcessing" : false,
|
1055
|
+
"metadataElementTypeName" : "GlossaryTerm",
|
1056
|
+
"limitResultsByStatus" : [ "ACTIVE", "DRAFT"],
|
1057
|
+
"sequencingProperty" : "???",
|
1058
|
+
"sequencingOrder" : "LAST_UPDATE_RECENT",
|
1059
|
+
"expression" : "????",
|
1060
|
+
"description" : "????",
|
1061
|
+
"status" : "VALIDATED",
|
1062
|
+
"returnSpecificConfidence" : true,
|
1063
|
+
"confidence" : 100,
|
1064
|
+
"createdBy" : "???",
|
1065
|
+
"steward" : "??",
|
1066
|
+
"source" : "???"
|
1067
|
+
|
1068
|
+
}
|
1069
|
+
|
1070
|
+
"""
|
1071
|
+
|
1072
|
+
loop = asyncio.get_event_loop()
|
1073
|
+
response = loop.run_until_complete(
|
1074
|
+
self.async_get_semantic_asignees(term_guid,body, output_format, output_format_set
|
1075
|
+
)
|
1076
|
+
)
|
1077
|
+
return response
|
1078
|
+
|
1079
|
+
@dynamic_catch
|
1080
|
+
async def async_get_governed_elements(
|
1081
|
+
self,
|
1082
|
+
gov_def_guid: str,
|
1083
|
+
body: dict = None,
|
1084
|
+
output_format: str = "JSON",
|
1085
|
+
output_format_set: dict | str = None,
|
1086
|
+
start_from: int = 0,
|
1087
|
+
page_size: int = 0
|
1088
|
+
) -> list | str:
|
1089
|
+
"""
|
1090
|
+
Retrieve the elements linked via a "governed-by" relationship to the requested governance definition. Async version.
|
1091
|
+
https://egeria-project.org/types/4/0440-Organizational-Controls/
|
1092
|
+
|
1093
|
+
Parameters
|
1094
|
+
__________
|
1095
|
+
gov_def_guid: str
|
1096
|
+
Governance definition linked by governed-by relationship.
|
1097
|
+
body: dict
|
1098
|
+
Details of the query.
|
1099
|
+
output_format: str, default = "JSON"
|
1100
|
+
Type of output to return.
|
1101
|
+
output_format_set: dict | str, default = None
|
1102
|
+
Output format set to use. If None, the default output format set is used.
|
1103
|
+
start_from: int, default = 0
|
1104
|
+
When multiple pages of results are available, the element number to start from.
|
1105
|
+
page_size: int, default = 0
|
1106
|
+
The number of elements returned per page.
|
1107
|
+
|
1108
|
+
Returns
|
1109
|
+
-------
|
1110
|
+
[dict] | str
|
1111
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1112
|
+
|
1113
|
+
Raises
|
1114
|
+
------
|
1115
|
+
PyegeriaException
|
1116
|
+
|
1117
|
+
Notes
|
1118
|
+
-----
|
1119
|
+
Sample body:
|
1120
|
+
|
1121
|
+
{
|
1122
|
+
"class": "ResultsRequestBody",
|
1123
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1124
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1125
|
+
"forLineage": false,
|
1126
|
+
"forDuplicateProcessing": false,
|
1127
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1128
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1129
|
+
"sequencingProperty": "???",
|
1130
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1131
|
+
}
|
1132
|
+
|
1133
|
+
"""
|
1134
|
+
|
1135
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
1136
|
+
f"classification-explorer/elements/governed-by/{gov_def_guid}")
|
1137
|
+
|
1138
|
+
response = await self._async_get_results_body_request(url, "Referenceable", self._generate_referenceable_output,
|
1139
|
+
start_from, page_size, output_format,
|
1140
|
+
output_format_set, body)
|
1141
|
+
return response
|
1142
|
+
|
1143
|
+
@dynamic_catch
|
1144
|
+
def get_governed_elements(
|
1145
|
+
self,
|
1146
|
+
gov_def_guid: str,
|
1147
|
+
body: dict = None,
|
1148
|
+
output_format: str = "JSON",
|
1149
|
+
output_format_set: dict | str = None,
|
1150
|
+
start_from: int = 0,
|
1151
|
+
page_size: int = 0
|
1152
|
+
) -> list | str:
|
1153
|
+
"""
|
1154
|
+
Retrieve the elements linked via a "governed-by" relationship to the requested governance definition.
|
1155
|
+
https://egeria-project.org/types/4/0440-Organizational-Controls/
|
1156
|
+
|
1157
|
+
Parameters
|
1158
|
+
__________
|
1159
|
+
gov_def_guid: str
|
1160
|
+
Governance definition linked by governed-by relationship.
|
1161
|
+
body: dict
|
1162
|
+
Details of the query.
|
1163
|
+
output_format: str, default = "JSON"
|
1164
|
+
Type of output to return.
|
1165
|
+
output_format_set: dict | str, default = None
|
1166
|
+
Output format set to use. If None, the default output format set is used.
|
1167
|
+
start_from: int, default = 0
|
1168
|
+
When multiple pages of results are available, the element number to start from.
|
1169
|
+
page_size: int, default = 0
|
1170
|
+
The number of elements returned per page.
|
1171
|
+
|
1172
|
+
Returns
|
1173
|
+
-------
|
1174
|
+
[dict] | str
|
1175
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1176
|
+
|
1177
|
+
Raises
|
1178
|
+
------
|
1179
|
+
PyegeriaException
|
1180
|
+
|
1181
|
+
Notes
|
1182
|
+
-----
|
1183
|
+
Sample body:
|
1184
|
+
|
1185
|
+
{
|
1186
|
+
"class": "ResultsRequestBody",
|
1187
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1188
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1189
|
+
"forLineage": false,
|
1190
|
+
"forDuplicateProcessing": false,
|
1191
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1192
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1193
|
+
"sequencingProperty": "???",
|
1194
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1195
|
+
}
|
1196
|
+
|
1197
|
+
"""
|
1198
|
+
|
1199
|
+
loop = asyncio.get_event_loop()
|
1200
|
+
response = loop.run_until_complete(
|
1201
|
+
self.async_get_governed_elements(gov_def_guid,body, output_format, output_format_set,
|
1202
|
+
start_from, page_size)
|
1203
|
+
)
|
1204
|
+
return response
|
1205
|
+
|
1206
|
+
@dynamic_catch
|
1207
|
+
async def async_get_governed_by_definitions(
|
1208
|
+
self,
|
1209
|
+
element_guid: str,
|
1210
|
+
body: dict = None,
|
1211
|
+
output_format: str = "JSON",
|
1212
|
+
output_format_set: dict | str = None,
|
1213
|
+
start_from: int = 0,
|
1214
|
+
page_size: int = 0
|
1215
|
+
) -> list | str:
|
1216
|
+
"""
|
1217
|
+
Retrieve the governance definitions linked via a "governed-by" relationship to the specified element. Async version.
|
1218
|
+
https://egeria-project.org/types/4/0440-Organizational-Controls/
|
1219
|
+
|
1220
|
+
Parameters
|
1221
|
+
__________
|
1222
|
+
element_guid: str
|
1223
|
+
Element to retrieve information for.
|
1224
|
+
body: dict
|
1225
|
+
Details of the query.
|
1226
|
+
output_format: str, default = "JSON"
|
1227
|
+
Type of output to return.
|
1228
|
+
output_format_set: dict | str, default = None
|
1229
|
+
Output format set to use. If None, the default output format set is used.
|
1230
|
+
start_from: int, default = 0
|
1231
|
+
When multiple pages of results are available, the element number to start from.
|
1232
|
+
page_size: int, default = 0
|
1233
|
+
The number of elements returned per page.
|
1234
|
+
|
1235
|
+
Returns
|
1236
|
+
-------
|
1237
|
+
[dict] | str
|
1238
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1239
|
+
|
1240
|
+
Raises
|
1241
|
+
------
|
1242
|
+
PyegeriaException
|
1243
|
+
|
1244
|
+
Notes
|
1245
|
+
-----
|
1246
|
+
Sample body:
|
1247
|
+
|
1248
|
+
{
|
1249
|
+
"class": "ResultsRequestBody",
|
1250
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1251
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1252
|
+
"forLineage": false,
|
1253
|
+
"forDuplicateProcessing": false,
|
1254
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1255
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1256
|
+
"sequencingProperty": "???",
|
1257
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1258
|
+
}
|
1259
|
+
|
1260
|
+
"""
|
1261
|
+
|
1262
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
1263
|
+
f"classification-explorer/elements/{element_guid}/governed-by")
|
1264
|
+
|
1265
|
+
response = await self._async_get_results_body_request(url, "Referenceable", self._generate_referenceable_output,
|
1266
|
+
start_from, page_size, output_format,
|
1267
|
+
output_format_set, body)
|
1268
|
+
return response
|
1269
|
+
|
1270
|
+
|
1271
|
+
@dynamic_catch
|
1272
|
+
def get_governed_by_definitions(
|
1273
|
+
self,
|
1274
|
+
element_guid: str,
|
1275
|
+
body: dict = None,
|
1276
|
+
output_format: str = "JSON",
|
1277
|
+
output_format_set: dict | str = None,
|
1278
|
+
start_from: int = 0,
|
1279
|
+
page_size: int = 0
|
1280
|
+
) -> list | str:
|
1281
|
+
"""
|
1282
|
+
Retrieve the governance definitions linked via a "governed-by" relationship to the specified element.
|
1283
|
+
https://egeria-project.org/types/4/0440-Organizational-Controls/
|
1284
|
+
|
1285
|
+
Parameters
|
1286
|
+
__________
|
1287
|
+
element_guid: str
|
1288
|
+
element to retrieve governed-by relationship for.
|
1289
|
+
body: dict
|
1290
|
+
Details of the query.
|
1291
|
+
output_format: str, default = "JSON"
|
1292
|
+
Type of output to return.
|
1293
|
+
output_format_set: dict | str, default = None
|
1294
|
+
Output format set to use. If None, the default output format set is used.
|
1295
|
+
start_from: int, default = 0
|
1296
|
+
When multiple pages of results are available, the element number to start from.
|
1297
|
+
page_size: int, default = 0
|
1298
|
+
The number of elements returned per page.
|
1299
|
+
|
1300
|
+
Returns
|
1301
|
+
-------
|
1302
|
+
[dict] | str
|
1303
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1304
|
+
|
1305
|
+
Raises
|
1306
|
+
------
|
1307
|
+
PyegeriaException
|
1308
|
+
|
1309
|
+
Notes
|
1310
|
+
-----
|
1311
|
+
Sample body:
|
1312
|
+
|
1313
|
+
{
|
1314
|
+
"class": "ResultsRequestBody",
|
1315
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1316
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1317
|
+
"forLineage": false,
|
1318
|
+
"forDuplicateProcessing": false,
|
1319
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1320
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1321
|
+
"sequencingProperty": "???",
|
1322
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1323
|
+
}
|
1324
|
+
|
1325
|
+
"""
|
1326
|
+
|
1327
|
+
loop = asyncio.get_event_loop()
|
1328
|
+
response = loop.run_until_complete(
|
1329
|
+
self.async_get_governed_by_definitions(element_guid,body, output_format, output_format_set,
|
1330
|
+
start_from, page_size)
|
1331
|
+
)
|
1332
|
+
return response
|
1333
|
+
|
1334
|
+
|
1335
|
+
@dynamic_catch
|
1336
|
+
async def async_get_source_elements(
|
1337
|
+
self,
|
1338
|
+
element_guid: str,
|
1339
|
+
body: dict = None,
|
1340
|
+
output_format: str = "JSON",
|
1341
|
+
output_format_set: dict | str = None,
|
1342
|
+
start_from: int = 0,
|
1343
|
+
page_size: int = 0
|
1344
|
+
) -> list | str:
|
1345
|
+
"""
|
1346
|
+
Retrieve the elements linked via a SourceFrom relationship to the requested element.
|
1347
|
+
The elements returned were used to create the requested element.
|
1348
|
+
Typically only one element is returned. Async version.
|
1349
|
+
|
1350
|
+
https://egeria-project.org/types/0/0011-Managing-Referenceables/
|
1351
|
+
|
1352
|
+
Parameters
|
1353
|
+
__________
|
1354
|
+
element_guid: str
|
1355
|
+
Element to retrieve information for.
|
1356
|
+
body: dict
|
1357
|
+
Details of the query.
|
1358
|
+
output_format: str, default = "JSON"
|
1359
|
+
Type of output to return.
|
1360
|
+
output_format_set: dict | str, default = None
|
1361
|
+
Output format set to use. If None, the default output format set is used.
|
1362
|
+
start_from: int, default = 0
|
1363
|
+
When multiple pages of results are available, the element number to start from.
|
1364
|
+
page_size: int, default = 0
|
1365
|
+
The number of elements returned per page.
|
1366
|
+
|
1367
|
+
Returns
|
1368
|
+
-------
|
1369
|
+
[dict] | str
|
1370
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1371
|
+
|
1372
|
+
Raises
|
1373
|
+
------
|
1374
|
+
PyegeriaException
|
1375
|
+
|
1376
|
+
Notes
|
1377
|
+
-----
|
1378
|
+
Sample body:
|
1379
|
+
|
1380
|
+
{
|
1381
|
+
"class": "ResultsRequestBody",
|
1382
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1383
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1384
|
+
"forLineage": false,
|
1385
|
+
"forDuplicateProcessing": false,
|
1386
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1387
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1388
|
+
"sequencingProperty": "???",
|
1389
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1390
|
+
}
|
1391
|
+
|
1392
|
+
"""
|
1393
|
+
|
1394
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
1395
|
+
f"classification-explorer/glossaries/elements/{element_guid }/source")
|
1396
|
+
|
1397
|
+
response = await self._async_get_results_body_request(url, "Referenceable", self._generate_referenceable_output,
|
1398
|
+
start_from, page_size, output_format,
|
1399
|
+
output_format_set, body)
|
1400
|
+
return response
|
1401
|
+
|
1402
|
+
@dynamic_catch
|
1403
|
+
def get_source_elements(
|
1404
|
+
self,
|
1405
|
+
element_guid: str,
|
1406
|
+
body: dict = None,
|
1407
|
+
output_format: str = "JSON",
|
1408
|
+
output_format_set: dict | str = None,
|
1409
|
+
start_from: int = 0,
|
1410
|
+
page_size: int = 0
|
1411
|
+
) -> list | str:
|
1412
|
+
"""
|
1413
|
+
Retrieve the elements linked via a SourceFrom relationship to the requested element.
|
1414
|
+
The elements returned were used to create the requested element.
|
1415
|
+
Typically only one element is returned. Async version.
|
1416
|
+
|
1417
|
+
https://egeria-project.org/types/0/0011-Managing-Referenceables/
|
1418
|
+
|
1419
|
+
Parameters
|
1420
|
+
__________
|
1421
|
+
element_guid: str
|
1422
|
+
Element to retrieve information for.
|
1423
|
+
body: dict
|
1424
|
+
Details of the query.
|
1425
|
+
output_format: str, default = "JSON"
|
1426
|
+
Type of output to return.
|
1427
|
+
output_format_set: dict | str, default = None
|
1428
|
+
Output format set to use. If None, the default output format set is used.
|
1429
|
+
start_from: int, default = 0
|
1430
|
+
When multiple pages of results are available, the element number to start from.
|
1431
|
+
page_size: int, default = 0
|
1432
|
+
The number of elements returned per page.
|
1433
|
+
|
1434
|
+
Returns
|
1435
|
+
-------
|
1436
|
+
[dict] | str
|
1437
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1438
|
+
|
1439
|
+
Raises
|
1440
|
+
------
|
1441
|
+
PyegeriaException
|
1442
|
+
|
1443
|
+
Notes
|
1444
|
+
-----
|
1445
|
+
Sample body:
|
1446
|
+
|
1447
|
+
{
|
1448
|
+
"class": "ResultsRequestBody",
|
1449
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1450
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1451
|
+
"forLineage": false,
|
1452
|
+
"forDuplicateProcessing": false,
|
1453
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1454
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1455
|
+
"sequencingProperty": "???",
|
1456
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1457
|
+
}
|
1458
|
+
|
1459
|
+
"""
|
1460
|
+
|
1461
|
+
loop = asyncio.get_event_loop()
|
1462
|
+
response = loop.run_until_complete(
|
1463
|
+
self.async_get_certified_elements(element_guid, body, output_format, output_format_set, start_from,
|
1464
|
+
page_size)
|
1465
|
+
)
|
1466
|
+
return response
|
1467
|
+
|
1468
|
+
@dynamic_catch
|
1469
|
+
async def async_get_elements_sourced_from(
|
1470
|
+
self,
|
1471
|
+
element_guid: str,
|
1472
|
+
body: dict = None,
|
1473
|
+
output_format: str = "JSON",
|
1474
|
+
output_format_set: dict | str = None,
|
1475
|
+
start_from: int = 0,
|
1476
|
+
page_size: int = 0
|
1477
|
+
) -> list | str:
|
1478
|
+
"""
|
1479
|
+
Retrieve the elements linked via the SourcedFrom relationship to the requested element. The elements
|
1480
|
+
returned were created using the requested element as a template. Async version.
|
1481
|
+
|
1482
|
+
https://egeria-project.org/types/0/0011-Managing-Referenceables/
|
1483
|
+
|
1484
|
+
Parameters
|
1485
|
+
__________
|
1486
|
+
element_guid: str
|
1487
|
+
Element to retrieve information for.
|
1488
|
+
body: dict
|
1489
|
+
Details of the query.
|
1490
|
+
output_format: str, default = "JSON"
|
1491
|
+
Type of output to return.
|
1492
|
+
output_format_set: dict | str, default = None
|
1493
|
+
Output format set to use. If None, the default output format set is used.
|
1494
|
+
start_from: int, default = 0
|
1495
|
+
When multiple pages of results are available, the element number to start from.
|
1496
|
+
page_size: int, default = 0
|
1497
|
+
The number of elements returned per page.
|
1498
|
+
|
1499
|
+
Returns
|
1500
|
+
-------
|
1501
|
+
[dict] | str
|
1502
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1503
|
+
|
1504
|
+
Raises
|
1505
|
+
------
|
1506
|
+
PyegeriaException
|
1507
|
+
|
1508
|
+
Notes
|
1509
|
+
-----
|
1510
|
+
Sample body:
|
1511
|
+
|
1512
|
+
{
|
1513
|
+
"class": "ResultsRequestBody",
|
1514
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1515
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1516
|
+
"forLineage": false,
|
1517
|
+
"forDuplicateProcessing": false,
|
1518
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1519
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1520
|
+
"sequencingProperty": "???",
|
1521
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1522
|
+
}
|
1523
|
+
|
1524
|
+
"""
|
1525
|
+
|
1526
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
1527
|
+
f"classification-explorer/glossaries/elements/{element_guid}/sourced-from")
|
1528
|
+
|
1529
|
+
response = await self._async_get_results_body_request(url, "Referenceable", self._generate_referenceable_output,
|
1530
|
+
start_from, page_size, output_format,
|
1531
|
+
output_format_set, body)
|
1532
|
+
return response
|
1533
|
+
|
1534
|
+
@dynamic_catch
|
1535
|
+
def get_elements_sourced_from(
|
1536
|
+
self,
|
1537
|
+
element_guid: str,
|
1538
|
+
body: dict = None,
|
1539
|
+
output_format: str = "JSON",
|
1540
|
+
output_format_set: dict | str = None,
|
1541
|
+
start_from: int = 0,
|
1542
|
+
page_size: int = 0
|
1543
|
+
) -> list | str:
|
1544
|
+
"""
|
1545
|
+
Retrieve the elements linked via the SourcedFrom relationship to the requested element. The elements
|
1546
|
+
returned were created using the requested element as a template.
|
1547
|
+
|
1548
|
+
https://egeria-project.org/types/0/0011-Managing-Referenceables/
|
1549
|
+
|
1550
|
+
Parameters
|
1551
|
+
__________
|
1552
|
+
element_guid: str
|
1553
|
+
Element to retrieve information for.
|
1554
|
+
body: dict
|
1555
|
+
Details of the query.
|
1556
|
+
output_format: str, default = "JSON"
|
1557
|
+
Type of output to return.
|
1558
|
+
output_format_set: dict | str, default = None
|
1559
|
+
Output format set to use. If None, the default output format set is used.
|
1560
|
+
start_from: int, default = 0
|
1561
|
+
When multiple pages of results are available, the element number to start from.
|
1562
|
+
page_size: int, default = 0
|
1563
|
+
The number of elements returned per page.
|
1564
|
+
|
1565
|
+
Returns
|
1566
|
+
-------
|
1567
|
+
[dict] | str
|
1568
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1569
|
+
|
1570
|
+
Raises
|
1571
|
+
------
|
1572
|
+
PyegeriaException
|
1573
|
+
|
1574
|
+
Notes
|
1575
|
+
-----
|
1576
|
+
Sample body:
|
1577
|
+
|
1578
|
+
{
|
1579
|
+
"class": "ResultsRequestBody",
|
1580
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1581
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1582
|
+
"forLineage": false,
|
1583
|
+
"forDuplicateProcessing": false,
|
1584
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1585
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1586
|
+
"sequencingProperty": "???",
|
1587
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1588
|
+
}
|
1589
|
+
|
1590
|
+
"""
|
1591
|
+
|
1592
|
+
loop = asyncio.get_event_loop()
|
1593
|
+
response = loop.run_until_complete(
|
1594
|
+
self.async_get_elements_sourced_from(element_guid, body, output_format, output_format_set,
|
1595
|
+
start_from, page_size)
|
1596
|
+
)
|
1597
|
+
return response
|
1598
|
+
|
1599
|
+
@dynamic_catch
|
1600
|
+
async def async_get_scopes(
|
1601
|
+
self,
|
1602
|
+
element_guid: str,
|
1603
|
+
body: dict = None,
|
1604
|
+
output_format: str = "JSON",
|
1605
|
+
output_format_set: dict | str = None,
|
1606
|
+
start_from: int = 0,
|
1607
|
+
page_size: int = 0
|
1608
|
+
) -> list | str:
|
1609
|
+
"""
|
1610
|
+
Retrieve the scopes linked via the ScopedBy relationship to the requested element. Async version.
|
1611
|
+
Scopes: https://egeria-project.org/types/1/0120-Assignment-Scopes/
|
1612
|
+
|
1613
|
+
Parameters
|
1614
|
+
__________
|
1615
|
+
element_guid: str
|
1616
|
+
Element to retrieve information for.
|
1617
|
+
body: dict
|
1618
|
+
Details of the query.
|
1619
|
+
output_format: str, default = "JSON"
|
1620
|
+
Type of output to return.
|
1621
|
+
output_format_set: dict | str, default = None
|
1622
|
+
Output format set to use. If None, the default output format set is used.
|
1623
|
+
start_from: int, default = 0
|
1624
|
+
When multiple pages of results are available, the element number to start from.
|
1625
|
+
page_size: int, default = 0
|
1626
|
+
The number of elements returned per page.
|
1627
|
+
|
1628
|
+
Returns
|
1629
|
+
-------
|
1630
|
+
[dict] | str
|
1631
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1632
|
+
|
1633
|
+
Raises
|
1634
|
+
------
|
1635
|
+
PyegeriaException
|
1636
|
+
|
1637
|
+
Notes
|
1638
|
+
-----
|
1639
|
+
Sample body:
|
1640
|
+
|
1641
|
+
{
|
1642
|
+
"class": "ResultsRequestBody",
|
1643
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1644
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1645
|
+
"forLineage": false,
|
1646
|
+
"forDuplicateProcessing": false,
|
1647
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1648
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1649
|
+
"sequencingProperty": "???",
|
1650
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1651
|
+
}
|
1652
|
+
|
1653
|
+
"""
|
1654
|
+
|
1655
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
1656
|
+
f"classification-explorer/glossaries/elements/{element_guid}/scoped-by")
|
1657
|
+
|
1658
|
+
response = await self._async_get_results_body_request(url, "Referenceable", self._generate_referenceable_output,
|
1659
|
+
start_from, page_size, output_format,
|
1660
|
+
output_format_set, body)
|
1661
|
+
return response
|
1662
|
+
|
1663
|
+
@dynamic_catch
|
1664
|
+
def get_scopes(
|
1665
|
+
self,
|
1666
|
+
element_guid: str,
|
1667
|
+
body: dict = None,
|
1668
|
+
output_format: str = "JSON",
|
1669
|
+
output_format_set: dict | str = None,
|
1670
|
+
start_from: int = 0,
|
1671
|
+
page_size: int = 0
|
1672
|
+
) -> list | str:
|
1673
|
+
"""
|
1674
|
+
Retrieve the scopes linked via the ScopedBy relationship to the requested element.
|
1675
|
+
Scopes: https://egeria-project.org/types/1/0120-Assignment-Scopes/
|
1676
|
+
|
1677
|
+
Parameters
|
1678
|
+
__________
|
1679
|
+
element_guid: str
|
1680
|
+
Element to retrieve information for.
|
1681
|
+
body: dict
|
1682
|
+
Details of the query.
|
1683
|
+
output_format: str, default = "JSON"
|
1684
|
+
Type of output to return.
|
1685
|
+
output_format_set: dict | str, default = None
|
1686
|
+
Output format set to use. If None, the default output format set is used.
|
1687
|
+
start_from: int, default = 0
|
1688
|
+
When multiple pages of results are available, the element number to start from.
|
1689
|
+
page_size: int, default = 0
|
1690
|
+
The number of elements returned per page.
|
1691
|
+
|
1692
|
+
Returns
|
1693
|
+
-------
|
1694
|
+
[dict] | str
|
1695
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1696
|
+
|
1697
|
+
Raises
|
1698
|
+
------
|
1699
|
+
PyegeriaException
|
1700
|
+
|
1701
|
+
Notes
|
1702
|
+
-----
|
1703
|
+
Sample body:
|
1704
|
+
|
1705
|
+
{
|
1706
|
+
"class": "ResultsRequestBody",
|
1707
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1708
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1709
|
+
"forLineage": false,
|
1710
|
+
"forDuplicateProcessing": false,
|
1711
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1712
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1713
|
+
"sequencingProperty": "???",
|
1714
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1715
|
+
}
|
1716
|
+
|
1717
|
+
"""
|
1718
|
+
|
1719
|
+
loop = asyncio.get_event_loop()
|
1720
|
+
response = loop.run_until_complete(
|
1721
|
+
self.async_get_certified_elements(element_guid, body, output_format, output_format_set, start_from,
|
1722
|
+
page_size)
|
1723
|
+
)
|
1724
|
+
return response
|
1725
|
+
|
1726
|
+
@dynamic_catch
|
1727
|
+
async def async_get_scoped_elements(
|
1728
|
+
self,
|
1729
|
+
scope_guid: str,
|
1730
|
+
body: dict = None,
|
1731
|
+
output_format: str = "JSON",
|
1732
|
+
output_format_set: dict | str = None,
|
1733
|
+
start_from: int = 0,
|
1734
|
+
page_size: int = 0
|
1735
|
+
) -> list | str:
|
1736
|
+
"""
|
1737
|
+
Retrieve the elements linked via the ScopedBy relationship to the scope. Async version.
|
1738
|
+
scopes: https://egeria-project.org/types/1/0120-Assignment-Scopes/
|
1739
|
+
|
1740
|
+
Parameters
|
1741
|
+
__________
|
1742
|
+
scope_guid: str
|
1743
|
+
Scope to retrieve information for.
|
1744
|
+
body: dict
|
1745
|
+
Details of the query.
|
1746
|
+
output_format: str, default = "JSON"
|
1747
|
+
Type of output to return.
|
1748
|
+
output_format_set: dict | str, default = None
|
1749
|
+
Output format set to use. If None, the default output format set is used.
|
1750
|
+
start_from: int, default = 0
|
1751
|
+
When multiple pages of results are available, the element number to start from.
|
1752
|
+
page_size: int, default = 0
|
1753
|
+
The number of elements returned per page.
|
1754
|
+
|
1755
|
+
Returns
|
1756
|
+
-------
|
1757
|
+
[dict] | str
|
1758
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1759
|
+
|
1760
|
+
Raises
|
1761
|
+
------
|
1762
|
+
PyegeriaException
|
1763
|
+
|
1764
|
+
Notes
|
1765
|
+
-----
|
1766
|
+
Sample body:
|
1767
|
+
|
1768
|
+
{
|
1769
|
+
"class": "ResultsRequestBody",
|
1770
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1771
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1772
|
+
"forLineage": false,
|
1773
|
+
"forDuplicateProcessing": false,
|
1774
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1775
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1776
|
+
"sequencingProperty": "???",
|
1777
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1778
|
+
}
|
1779
|
+
|
1780
|
+
"""
|
1781
|
+
|
1782
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
1783
|
+
f"classification-explorer/glossaries/elements/scoped-by/{scope_guid}")
|
1784
|
+
|
1785
|
+
response = await self._async_get_results_body_request(url, "Referenceable", self._generate_referenceable_output,
|
1786
|
+
start_from, page_size, output_format,
|
1787
|
+
output_format_set, body)
|
1788
|
+
return response
|
1789
|
+
|
1790
|
+
@dynamic_catch
|
1791
|
+
def get_scoped_elements(
|
1792
|
+
self,
|
1793
|
+
scope_guid: str,
|
1794
|
+
body: dict = None,
|
1795
|
+
output_format: str = "JSON",
|
1796
|
+
output_format_set: dict | str = None,
|
1797
|
+
start_from: int = 0,
|
1798
|
+
page_size: int = 0
|
1799
|
+
) -> list | str:
|
1800
|
+
"""
|
1801
|
+
Retrieve the elements linked via the ScopedBy relationship to the scope. Async version.
|
1802
|
+
scopes: https://egeria-project.org/types/1/0120-Assignment-Scopes/
|
1803
|
+
|
1804
|
+
Parameters
|
1805
|
+
__________
|
1806
|
+
scope_guid: str
|
1807
|
+
Scope to retrieve information for.
|
1808
|
+
body: dict
|
1809
|
+
Details of the query.
|
1810
|
+
output_format: str, default = "JSON"
|
1811
|
+
Type of output to return.
|
1812
|
+
output_format_set: dict | str, default = None
|
1813
|
+
Output format set to use. If None, the default output format set is used.
|
1814
|
+
start_from: int, default = 0
|
1815
|
+
When multiple pages of results are available, the element number to start from.
|
1816
|
+
page_size: int, default = 0
|
1817
|
+
The number of elements returned per page.
|
1818
|
+
|
1819
|
+
Returns
|
1820
|
+
-------
|
1821
|
+
[dict] | str
|
1822
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1823
|
+
|
1824
|
+
Raises
|
1825
|
+
------
|
1826
|
+
PyegeriaException
|
1827
|
+
|
1828
|
+
Notes
|
1829
|
+
-----
|
1830
|
+
Sample body:
|
1831
|
+
|
1832
|
+
{
|
1833
|
+
"class": "ResultsRequestBody",
|
1834
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1835
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1836
|
+
"forLineage": false,
|
1837
|
+
"forDuplicateProcessing": false,
|
1838
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1839
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1840
|
+
"sequencingProperty": "???",
|
1841
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1842
|
+
}
|
1843
|
+
|
1844
|
+
"""
|
1845
|
+
|
1846
|
+
loop = asyncio.get_event_loop()
|
1847
|
+
response = loop.run_until_complete(
|
1848
|
+
self.async_get_scoped_elements(scope_guid, body, output_format, output_format_set, start_from, page_size)
|
1849
|
+
)
|
1850
|
+
return response
|
1851
|
+
|
1852
|
+
@dynamic_catch
|
1853
|
+
async def async_get_licensed_elements(
|
1854
|
+
self,
|
1855
|
+
license_type_guid: str,
|
1856
|
+
body: dict = None,
|
1857
|
+
output_format: str = "JSON",
|
1858
|
+
output_format_set: dict | str = None,
|
1859
|
+
start_from: int = 0,
|
1860
|
+
page_size: int = 0
|
1861
|
+
) -> list | str:
|
1862
|
+
"""
|
1863
|
+
Retrieve the elements linked via a License relationship to the requested LicenseType. Async version.
|
1864
|
+
https://https://egeria-project.org/types/4/0481-Licenses/
|
1865
|
+
Parameters
|
1866
|
+
__________
|
1867
|
+
license_type_guid: str
|
1868
|
+
License type to retrieve information for.
|
1869
|
+
body: dict
|
1870
|
+
Details of the query.
|
1871
|
+
output_format: str, default = "JSON"
|
1872
|
+
Type of output to return.
|
1873
|
+
output_format_set: dict | str, default = None
|
1874
|
+
Output format set to use. If None, the default output format set is used.
|
1875
|
+
start_from: int, default = 0
|
1876
|
+
When multiple pages of results are available, the element number to start from.
|
1877
|
+
page_size: int, default = 0
|
1878
|
+
The number of elements returned per page.
|
1879
|
+
|
1880
|
+
Returns
|
1881
|
+
-------
|
1882
|
+
[dict] | str
|
1883
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1884
|
+
|
1885
|
+
Raises
|
1886
|
+
------
|
1887
|
+
PyegeriaException
|
1888
|
+
|
1889
|
+
Notes
|
1890
|
+
-----
|
1891
|
+
Sample body:
|
1892
|
+
|
1893
|
+
{
|
1894
|
+
"class": "ResultsRequestBody",
|
1895
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1896
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1897
|
+
"forLineage": false,
|
1898
|
+
"forDuplicateProcessing": false,
|
1899
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1900
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1901
|
+
"sequencingProperty": "???",
|
1902
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1903
|
+
}
|
1904
|
+
|
1905
|
+
"""
|
1906
|
+
|
1907
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
1908
|
+
f"classification-explorer/glossaries/elements/licenses/{license_type_guid}")
|
1909
|
+
|
1910
|
+
response = await self._async_get_results_body_request(url, "Referenceable", self._generate_referenceable_output,
|
1911
|
+
start_from, page_size, output_format,
|
1912
|
+
output_format_set, body)
|
1913
|
+
return response
|
1914
|
+
|
1915
|
+
@dynamic_catch
|
1916
|
+
def get_licensed_elements(
|
1917
|
+
self,
|
1918
|
+
license_type_guid: str,
|
1919
|
+
body: dict = None,
|
1920
|
+
output_format: str = "JSON",
|
1921
|
+
output_format_set: dict | str = None,
|
1922
|
+
start_from: int = 0,
|
1923
|
+
page_size: int = 0
|
1924
|
+
) -> list | str:
|
1925
|
+
"""
|
1926
|
+
Retrieve the elements linked via a License relationship to the requested LicenseType.
|
1927
|
+
https://https://egeria-project.org/types/4/0481-Licenses/
|
1928
|
+
|
1929
|
+
Parameters
|
1930
|
+
__________
|
1931
|
+
license_type_guid: str
|
1932
|
+
License type to retrieve information for.
|
1933
|
+
body: dict
|
1934
|
+
Details of the query.
|
1935
|
+
output_format: str, default = "JSON"
|
1936
|
+
Type of output to return.
|
1937
|
+
output_format_set: dict | str, default = None
|
1938
|
+
Output format set to use. If None, the default output format set is used.
|
1939
|
+
start_from: int, default = 0
|
1940
|
+
When multiple pages of results are available, the element number to start from.
|
1941
|
+
page_size: int, default = 0
|
1942
|
+
The number of elements returned per page.
|
1943
|
+
|
1944
|
+
Returns
|
1945
|
+
-------
|
1946
|
+
[dict] | str
|
1947
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
1948
|
+
|
1949
|
+
Raises
|
1950
|
+
------
|
1951
|
+
PyegeriaException
|
1952
|
+
|
1953
|
+
Notes
|
1954
|
+
-----
|
1955
|
+
Sample body:
|
1956
|
+
|
1957
|
+
{
|
1958
|
+
"class": "ResultsRequestBody",
|
1959
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
1960
|
+
"asOfTime": "{{$isoTimestamp}}",
|
1961
|
+
"forLineage": false,
|
1962
|
+
"forDuplicateProcessing": false,
|
1963
|
+
"metadataElementTypeName": "GlossaryTerm",
|
1964
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
1965
|
+
"sequencingProperty": "???",
|
1966
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
1967
|
+
}
|
1968
|
+
|
1969
|
+
"""
|
1970
|
+
|
1971
|
+
loop = asyncio.get_event_loop()
|
1972
|
+
response = loop.run_until_complete(
|
1973
|
+
self.async_get_licensed_elements(license_type_guid, body, output_format, output_format_set, start_from, page_size)
|
1974
|
+
)
|
1975
|
+
return response
|
1976
|
+
|
1977
|
+
@dynamic_catch
|
1978
|
+
async def async_get_licenses(
|
1979
|
+
self,
|
1980
|
+
element_guid: str,
|
1981
|
+
body: dict = None,
|
1982
|
+
output_format: str = "JSON",
|
1983
|
+
output_format_set: dict | str = None,
|
1984
|
+
start_from: int = 0,
|
1985
|
+
page_size: int = 0
|
1986
|
+
) -> list | str:
|
1987
|
+
"""
|
1988
|
+
Retrieve the license types linked via a License relationship to the requested element. Async version.
|
1989
|
+
https://https://egeria-project.org/types/4/0481-Licenses/
|
1990
|
+
|
1991
|
+
Parameters
|
1992
|
+
__________
|
1993
|
+
element_guid: str
|
1994
|
+
Element to retrieve information for.
|
1995
|
+
body: dict
|
1996
|
+
Details of the query.
|
1997
|
+
output_format: str, default = "JSON"
|
1998
|
+
Type of output to return.
|
1999
|
+
output_format_set: dict | str, default = None
|
2000
|
+
Output format set to use. If None, the default output format set is used.
|
2001
|
+
start_from: int, default = 0
|
2002
|
+
When multiple pages of results are available, the element number to start from.
|
2003
|
+
page_size: int, default = 0
|
2004
|
+
The number of elements returned per page.
|
2005
|
+
|
2006
|
+
Returns
|
2007
|
+
-------
|
2008
|
+
[dict] | str
|
2009
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
2010
|
+
|
2011
|
+
Raises
|
2012
|
+
------
|
2013
|
+
PyegeriaException
|
2014
|
+
|
2015
|
+
Notes
|
2016
|
+
-----
|
2017
|
+
Sample body:
|
2018
|
+
|
2019
|
+
{
|
2020
|
+
"class": "ResultsRequestBody",
|
2021
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
2022
|
+
"asOfTime": "{{$isoTimestamp}}",
|
2023
|
+
"forLineage": false,
|
2024
|
+
"forDuplicateProcessing": false,
|
2025
|
+
"metadataElementTypeName": "GlossaryTerm",
|
2026
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
2027
|
+
"sequencingProperty": "???",
|
2028
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
2029
|
+
}
|
2030
|
+
|
2031
|
+
"""
|
2032
|
+
|
2033
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
2034
|
+
f"classification-explorer/glossaries/elements/{element_guid}/licenses")
|
2035
|
+
|
2036
|
+
response = await self._async_get_results_body_request(url, "Referenceable", self._generate_referenceable_output,
|
2037
|
+
start_from, page_size, output_format,
|
2038
|
+
output_format_set, body)
|
2039
|
+
return response
|
2040
|
+
|
2041
|
+
@dynamic_catch
|
2042
|
+
def get_licenses(
|
2043
|
+
self,
|
2044
|
+
element_guid: str,
|
2045
|
+
body: dict = None,
|
2046
|
+
output_format: str = "JSON",
|
2047
|
+
output_format_set: dict | str = None,
|
2048
|
+
start_from: int = 0,
|
2049
|
+
page_size: int = 0
|
2050
|
+
) -> list | str:
|
2051
|
+
"""
|
2052
|
+
Retrieve the license types linked via a License relationship to the requested element.
|
2053
|
+
https://https://egeria-project.org/types/4/0481-Licenses/
|
2054
|
+
|
2055
|
+
Parameters
|
2056
|
+
__________
|
2057
|
+
element_guid: str
|
2058
|
+
Element to retrieve information for.
|
2059
|
+
body: dict
|
2060
|
+
Details of the query.
|
2061
|
+
output_format: str, default = "JSON"
|
2062
|
+
Type of output to return.
|
2063
|
+
output_format_set: dict | str, default = None
|
2064
|
+
Output format set to use. If None, the default output format set is used.
|
2065
|
+
start_from: int, default = 0
|
2066
|
+
When multiple pages of results are available, the element number to start from.
|
2067
|
+
page_size: int, default = 0
|
2068
|
+
The number of elements returned per page.
|
2069
|
+
|
2070
|
+
Returns
|
2071
|
+
-------
|
2072
|
+
[dict] | str
|
2073
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
2074
|
+
|
2075
|
+
Raises
|
2076
|
+
------
|
2077
|
+
PyegeriaException
|
2078
|
+
|
2079
|
+
Notes
|
2080
|
+
-----
|
2081
|
+
Sample body:
|
2082
|
+
|
2083
|
+
{
|
2084
|
+
"class": "ResultsRequestBody",
|
2085
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
2086
|
+
"asOfTime": "{{$isoTimestamp}}",
|
2087
|
+
"forLineage": false,
|
2088
|
+
"forDuplicateProcessing": false,
|
2089
|
+
"metadataElementTypeName": "GlossaryTerm",
|
2090
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
2091
|
+
"sequencingProperty": "???",
|
2092
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
2093
|
+
}
|
2094
|
+
|
2095
|
+
"""
|
2096
|
+
|
2097
|
+
loop = asyncio.get_event_loop()
|
2098
|
+
response = loop.run_until_complete(
|
2099
|
+
self.async_get_licenses(element_guid, body, output_format, output_format_set,
|
2100
|
+
start_from, page_size)
|
2101
|
+
)
|
2102
|
+
return response
|
2103
|
+
|
2104
|
+
|
2105
|
+
@dynamic_catch
|
2106
|
+
async def async_get_certified_elements(
|
2107
|
+
self,
|
2108
|
+
certification_type_guid: str,
|
2109
|
+
body: dict = None,
|
2110
|
+
output_format: str = "JSON",
|
2111
|
+
output_format_set: dict | str = None,
|
2112
|
+
start_from: int = 0,
|
2113
|
+
page_size: int = 0
|
2114
|
+
) -> list | str:
|
2115
|
+
"""
|
2116
|
+
Retrieve the elements linked via a Certification relationship to the requested CertificationType. Async version.
|
2117
|
+
https://egeria-project.org/types/4/0481-Licenses/
|
2118
|
+
|
2119
|
+
Parameters
|
2120
|
+
__________
|
2121
|
+
certification_type_guid: str
|
2122
|
+
Certification type to retrieve information for.
|
2123
|
+
body: dict
|
2124
|
+
Details of the query.
|
2125
|
+
output_format: str, default = "JSON"
|
2126
|
+
Type of output to return.
|
2127
|
+
output_format_set: dict | str, default = None
|
2128
|
+
Output format set to use. If None, the default output format set is used.
|
2129
|
+
start_from: int, default = 0
|
2130
|
+
When multiple pages of results are available, the element number to start from.
|
2131
|
+
page_size: int, default = 0
|
2132
|
+
The number of elements returned per page.
|
2133
|
+
|
2134
|
+
Returns
|
2135
|
+
-------
|
2136
|
+
[dict] | str
|
2137
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
2138
|
+
|
2139
|
+
Raises
|
2140
|
+
------
|
2141
|
+
PyegeriaException
|
2142
|
+
|
2143
|
+
Notes
|
2144
|
+
-----
|
2145
|
+
Sample body:
|
2146
|
+
|
2147
|
+
{
|
2148
|
+
"class": "ResultsRequestBody",
|
2149
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
2150
|
+
"asOfTime": "{{$isoTimestamp}}",
|
2151
|
+
"forLineage": false,
|
2152
|
+
"forDuplicateProcessing": false,
|
2153
|
+
"metadataElementTypeName": "GlossaryTerm",
|
2154
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
2155
|
+
"sequencingProperty": "???",
|
2156
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
2157
|
+
}
|
2158
|
+
|
2159
|
+
"""
|
2160
|
+
|
2161
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
2162
|
+
f"classification-explorer/glossaries/elements/certificactions/{certification_type_guid}")
|
2163
|
+
|
2164
|
+
response = await self._async_get_results_body_request(url, "Referenceable", self._generate_referenceable_output,
|
2165
|
+
start_from, page_size, output_format,
|
2166
|
+
output_format_set, body)
|
2167
|
+
return response
|
2168
|
+
|
2169
|
+
@dynamic_catch
|
2170
|
+
def get_certified_elements(
|
2171
|
+
self,
|
2172
|
+
certification_type_guid: str,
|
2173
|
+
body: dict = None,
|
2174
|
+
output_format: str = "JSON",
|
2175
|
+
output_format_set: dict | str = None,
|
2176
|
+
start_from: int = 0,
|
2177
|
+
page_size: int = 0
|
2178
|
+
) -> list | str:
|
2179
|
+
"""
|
2180
|
+
Retrieve the elements linked via a Certification relationship to the requested CertificationType. Async version.
|
2181
|
+
https://egeria-project.org/types/4/0481-Licenses/
|
2182
|
+
|
2183
|
+
Parameters
|
2184
|
+
__________
|
2185
|
+
certification_type_guid: str
|
2186
|
+
Certification type to retrieve information for.
|
2187
|
+
body: dict
|
2188
|
+
Details of the query.
|
2189
|
+
output_format: str, default = "JSON"
|
2190
|
+
Type of output to return.
|
2191
|
+
output_format_set: dict | str, default = None
|
2192
|
+
Output format set to use. If None, the default output format set is used.
|
2193
|
+
start_from: int, default = 0
|
2194
|
+
When multiple pages of results are available, the element number to start from.
|
2195
|
+
page_size: int, default = 0
|
2196
|
+
The number of elements returned per page.
|
2197
|
+
|
2198
|
+
Returns
|
2199
|
+
-------
|
2200
|
+
[dict] | str
|
2201
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
2202
|
+
|
2203
|
+
Raises
|
2204
|
+
------
|
2205
|
+
PyegeriaException
|
2206
|
+
|
2207
|
+
Notes
|
2208
|
+
-----
|
2209
|
+
Sample body:
|
2210
|
+
|
2211
|
+
{
|
2212
|
+
"class": "ResultsRequestBody",
|
2213
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
2214
|
+
"asOfTime": "{{$isoTimestamp}}",
|
2215
|
+
"forLineage": false,
|
2216
|
+
"forDuplicateProcessing": false,
|
2217
|
+
"metadataElementTypeName": "GlossaryTerm",
|
2218
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
2219
|
+
"sequencingProperty": "???",
|
2220
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
2221
|
+
}
|
2222
|
+
|
2223
|
+
"""
|
2224
|
+
|
2225
|
+
loop = asyncio.get_event_loop()
|
2226
|
+
response = loop.run_until_complete(
|
2227
|
+
self.async_get_certified_elements(certification_type_guid, body, output_format, output_format_set, start_from,
|
2228
|
+
page_size)
|
2229
|
+
)
|
2230
|
+
return response
|
2231
|
+
|
2232
|
+
|
2233
|
+
|
2234
|
+
@dynamic_catch
|
2235
|
+
async def async_get_certifications(
|
2236
|
+
self,
|
2237
|
+
element_guid: str,
|
2238
|
+
body: dict = None,
|
2239
|
+
output_format: str = "JSON",
|
2240
|
+
output_format_set: dict | str = None,
|
2241
|
+
start_from: int = 0,
|
2242
|
+
page_size: int = 0
|
2243
|
+
) -> list | str:
|
2244
|
+
"""
|
2245
|
+
Retrieve the certification types linked via a Certification relationship to the requested element. Async version.
|
2246
|
+
https://https://egeria-project.org/types/4/0481-Licenses/
|
2247
|
+
|
2248
|
+
Parameters
|
2249
|
+
__________
|
2250
|
+
element_guid: str
|
2251
|
+
Element to retrieve information for.
|
2252
|
+
body: dict
|
2253
|
+
Details of the query.
|
2254
|
+
output_format: str, default = "JSON"
|
2255
|
+
Type of output to return.
|
2256
|
+
output_format_set: dict | str, default = None
|
2257
|
+
Output format set to use. If None, the default output format set is used.
|
2258
|
+
start_from: int, default = 0
|
2259
|
+
When multiple pages of results are available, the element number to start from.
|
2260
|
+
page_size: int, default = 0
|
2261
|
+
The number of elements returned per page.
|
2262
|
+
|
2263
|
+
Returns
|
2264
|
+
-------
|
2265
|
+
[dict] | str
|
2266
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
2267
|
+
|
2268
|
+
Raises
|
2269
|
+
------
|
2270
|
+
PyegeriaException
|
2271
|
+
|
2272
|
+
Notes
|
2273
|
+
-----
|
2274
|
+
Sample body:
|
2275
|
+
|
2276
|
+
{
|
2277
|
+
"class": "ResultsRequestBody",
|
2278
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
2279
|
+
"asOfTime": "{{$isoTimestamp}}",
|
2280
|
+
"forLineage": false,
|
2281
|
+
"forDuplicateProcessing": false,
|
2282
|
+
"metadataElementTypeName": "GlossaryTerm",
|
2283
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
2284
|
+
"sequencingProperty": "???",
|
2285
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
2286
|
+
}
|
2287
|
+
|
2288
|
+
"""
|
2289
|
+
|
2290
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
2291
|
+
f"classification-explorer/elements/{element_guid}/certifications")
|
2292
|
+
|
2293
|
+
response = await self._async_get_results_body_request(url, "Referenceable", self._generate_referenceable_output,
|
2294
|
+
start_from, page_size, output_format,
|
2295
|
+
output_format_set, body)
|
2296
|
+
return response
|
2297
|
+
|
2298
|
+
@dynamic_catch
|
2299
|
+
def get_certifications(
|
2300
|
+
self,
|
2301
|
+
element_guid: str,
|
2302
|
+
body: dict = None,
|
2303
|
+
output_format: str = "JSON",
|
2304
|
+
output_format_set: dict | str = None,
|
2305
|
+
start_from: int = 0,
|
2306
|
+
page_size: int = 0
|
2307
|
+
) -> list | str:
|
2308
|
+
"""
|
2309
|
+
Retrieve the certification types linked via a Certification relationship to the requested element.
|
2310
|
+
https://https://egeria-project.org/types/4/0481-Licenses/
|
2311
|
+
|
2312
|
+
Parameters
|
2313
|
+
__________
|
2314
|
+
element_guid: str
|
2315
|
+
Element to retrieve information for.
|
2316
|
+
body: dict
|
2317
|
+
Details of the query.
|
2318
|
+
output_format: str, default = "JSON"
|
2319
|
+
Type of output to return.
|
2320
|
+
output_format_set: dict | str, default = None
|
2321
|
+
Output format set to use. If None, the default output format set is used.
|
2322
|
+
start_from: int, default = 0
|
2323
|
+
When multiple pages of results are available, the element number to start from.
|
2324
|
+
page_size: int, default = 0
|
2325
|
+
The number of elements returned per page.
|
2326
|
+
|
2327
|
+
Returns
|
2328
|
+
-------
|
2329
|
+
[dict] | str
|
2330
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
2331
|
+
|
2332
|
+
Raises
|
2333
|
+
------
|
2334
|
+
PyegeriaException
|
2335
|
+
|
2336
|
+
Notes
|
2337
|
+
-----
|
2338
|
+
Sample body:
|
2339
|
+
|
2340
|
+
{
|
2341
|
+
"class": "ResultsRequestBody",
|
2342
|
+
"effectiveTime": "{{$isoTimestamp}}",
|
2343
|
+
"asOfTime": "{{$isoTimestamp}}",
|
2344
|
+
"forLineage": false,
|
2345
|
+
"forDuplicateProcessing": false,
|
2346
|
+
"metadataElementTypeName": "GlossaryTerm",
|
2347
|
+
"limitResultsByStatus": [ "ACTIVE", "DRAFT"],
|
2348
|
+
"sequencingProperty": "???",
|
2349
|
+
"sequencingOrder": "LAST_UPDATE_RECENT"
|
2350
|
+
}
|
2351
|
+
|
2352
|
+
"""
|
2353
|
+
|
2354
|
+
loop = asyncio.get_event_loop()
|
2355
|
+
response = loop.run_until_complete(
|
2356
|
+
self.async_get_certifications(element_guid, body, output_format, output_format_set, start_from,
|
2357
|
+
page_size)
|
2358
|
+
)
|
2359
|
+
return response
|
2360
|
+
|
2361
|
+
|
2362
|
+
|
2363
|
+
|
2364
|
+
|
2365
|
+
|
2366
|
+
|
2367
|
+
|
2368
|
+
|
2369
|
+
#
|
2370
|
+
#
|
2371
|
+
#
|
2372
|
+
async def async_get_elements(
|
2373
|
+
self,
|
2374
|
+
metadata_element_type_name: str = None,
|
2375
|
+
effective_time: str = None,
|
2376
|
+
for_lineage: bool = None,
|
2377
|
+
for_duplicate_processing: bool = None,
|
2378
|
+
start_from: int = 0,
|
2379
|
+
page_size: int = 0,
|
2380
|
+
time_out: int = default_time_out,
|
2381
|
+
) -> list | str:
|
2382
|
+
"""
|
2383
|
+
Retrieve elements of the requested type name. If no type name is specified, then any type of element may
|
2384
|
+
be returned.
|
2385
|
+
|
2386
|
+
https://egeria-project.org/types/
|
2387
|
+
|
2388
|
+
Parameters
|
2389
|
+
----------
|
2390
|
+
metadata_element_type_name : str, default = None
|
2391
|
+
- open metadata type to be used to restrict the search
|
2392
|
+
effective_time: str, default = None
|
2393
|
+
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
2394
|
+
for_lineage: bool, default is set by server
|
2395
|
+
- determines if elements classified as Memento should be returned - normally false
|
2396
|
+
for_duplicate_processing: bool, default is set by server
|
2397
|
+
- Normally false. Set true when the caller is part of a deduplication function
|
2398
|
+
start_from: int, default = 0
|
2399
|
+
- index of the list to start from (0 for start).
|
2400
|
+
page_size
|
2401
|
+
- maximum number of elements to return.
|
2402
|
+
|
2403
|
+
|
2404
|
+
time_out: int, default = default_time_out
|
2405
|
+
- http request timeout for this request
|
2406
|
+
|
2407
|
+
Returns
|
2408
|
+
-------
|
2409
|
+
[dict] | str
|
2410
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
2411
|
+
|
2412
|
+
Raises
|
2413
|
+
------
|
2414
|
+
PyegeriaException
|
2415
|
+
"""
|
2416
|
+
|
2417
|
+
body = {
|
2418
|
+
"class": "FindProperties",
|
2419
|
+
"metadataElementTypeName": metadata_element_type_name,
|
2420
|
+
"effectiveTime": effective_time,
|
2421
|
+
"forLineage": for_lineage,
|
2422
|
+
"forDuplicateProcessing": for_duplicate_processing,
|
2423
|
+
"startFrom": start_from,
|
2424
|
+
"pageSize": page_size
|
2425
|
+
}
|
661
2426
|
|
2427
|
+
url = f"{base_path(self, self.view_server)}/elements/by-type"
|
662
2428
|
response: Response = await self._async_make_request(
|
663
2429
|
"POST", url, body_slimmer(body), time_out=time_out
|
664
2430
|
)
|
665
|
-
|
666
2431
|
elements = response.json().get("elements", NO_ELEMENTS_FOUND)
|
667
|
-
if type(elements) is list:
|
668
|
-
|
669
|
-
return NO_ELEMENTS_FOUND
|
2432
|
+
if type(elements) is list and len(elements) == 0:
|
2433
|
+
return NO_ELEMENTS_FOUND
|
670
2434
|
return elements
|
671
2435
|
|
672
|
-
def
|
2436
|
+
def get_elements(
|
673
2437
|
self,
|
674
|
-
property_value: str,
|
675
|
-
property_names: [str],
|
676
2438
|
metadata_element_type_name: str = None,
|
677
2439
|
effective_time: str = None,
|
678
2440
|
for_lineage: bool = None,
|
@@ -684,17 +2446,13 @@ class ClassificationManager(Client2):
|
|
684
2446
|
output_format_set: dict | str = None,
|
685
2447
|
) -> list | str:
|
686
2448
|
"""
|
687
|
-
Retrieve elements
|
688
|
-
|
2449
|
+
Retrieve elements of the requested type name. If no type name is specified, then any type of element may
|
2450
|
+
be returned.
|
689
2451
|
|
690
2452
|
https://egeria-project.org/types/
|
691
2453
|
|
692
2454
|
Parameters
|
693
2455
|
----------
|
694
|
-
property_value: str
|
695
|
-
- property value to be searched.
|
696
|
-
property_names: [str]
|
697
|
-
- property names to search in.
|
698
2456
|
metadata_element_type_name : str, default = None
|
699
2457
|
- open metadata type to be used to restrict the search
|
700
2458
|
effective_time: str, default = None
|
@@ -707,10 +2465,12 @@ class ClassificationManager(Client2):
|
|
707
2465
|
- index of the list to start from (0 for start).
|
708
2466
|
page_size
|
709
2467
|
- maximum number of elements to return.
|
710
|
-
|
711
|
-
|
712
2468
|
time_out: int, default = default_time_out
|
713
2469
|
- http request timeout for this request
|
2470
|
+
output_format: str, default = "JSON"
|
2471
|
+
- Type of output to return.
|
2472
|
+
output_format_set: dict | str, default = None
|
2473
|
+
- Output format set to use. If None, the default output format set is used.
|
714
2474
|
|
715
2475
|
Returns
|
716
2476
|
-------
|
@@ -719,14 +2479,12 @@ class ClassificationManager(Client2):
|
|
719
2479
|
|
720
2480
|
Raises
|
721
2481
|
------
|
722
|
-
PyegeriaException
|
2482
|
+
PyegeriaException
|
723
2483
|
"""
|
724
2484
|
|
725
2485
|
loop = asyncio.get_event_loop()
|
726
2486
|
response = loop.run_until_complete(
|
727
|
-
self.
|
728
|
-
property_value,
|
729
|
-
property_names,
|
2487
|
+
self.async_get_elements(
|
730
2488
|
metadata_element_type_name,
|
731
2489
|
effective_time,
|
732
2490
|
for_lineage,
|
@@ -736,18 +2494,101 @@ class ClassificationManager(Client2):
|
|
736
2494
|
time_out,
|
737
2495
|
)
|
738
2496
|
)
|
2497
|
+
if isinstance(response, list) and output_format != "JSON":
|
2498
|
+
return self._generate_referenceable_output(response, None, self.REFERENCEABLE_LABEL,
|
2499
|
+
output_format=output_format, output_format_set=output_format_set)
|
2500
|
+
return response
|
2501
|
+
|
2502
|
+
async def async_get_elements_by_property_value(
|
2503
|
+
self,
|
2504
|
+
property_value: str,
|
2505
|
+
property_names: list[str] = None,
|
2506
|
+
metadata_element_type_name: str = None,
|
2507
|
+
effective_time: str = None,
|
2508
|
+
for_lineage: bool = None,
|
2509
|
+
for_duplicate_processing: bool = None,
|
2510
|
+
start_from: int = 0,
|
2511
|
+
page_size: int = 0,
|
2512
|
+
time_out: int = default_time_out,
|
2513
|
+
output_format: str = "JSON",
|
2514
|
+
output_format_set: dict | str = None,
|
2515
|
+
) -> list | str:
|
2516
|
+
"""
|
2517
|
+
Retrieve elements by a value found in one of the properties specified. The value must match exactly.
|
2518
|
+
An open metadata type name may be supplied to restrict the results. Async version.
|
2519
|
+
|
2520
|
+
https://egeria-project.org/types/
|
2521
|
+
|
2522
|
+
Parameters
|
2523
|
+
----------
|
2524
|
+
property_value: str
|
2525
|
+
- property value to be searched.
|
2526
|
+
property_names: list[str]
|
2527
|
+
- property names to search in.
|
2528
|
+
metadata_element_type_name : str, default = None
|
2529
|
+
- open metadata type to be used to restrict the search
|
2530
|
+
effective_time: str, default = None
|
2531
|
+
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
2532
|
+
for_lineage: bool, default is set by server
|
2533
|
+
- determines if elements classified as Memento should be returned - normally false
|
2534
|
+
for_duplicate_processing: bool, default is set by server
|
2535
|
+
- Normally false. Set true when the caller is part of a deduplication function
|
2536
|
+
start_from: int, default = 0
|
2537
|
+
- index of the list to start from (0 for start).
|
2538
|
+
page_size
|
2539
|
+
- maximum number of elements to return.
|
2540
|
+
time_out: int, default = default_time_out
|
2541
|
+
- http request timeout for this request
|
2542
|
+
output_format: str, default = "JSON"
|
2543
|
+
- Type of output to return.
|
2544
|
+
output_format_set: dict | str, default = None
|
2545
|
+
- Output format set to use. If None, the default output format set is used.
|
2546
|
+
|
2547
|
+
|
2548
|
+
Returns
|
2549
|
+
-------
|
2550
|
+
[dict] | str
|
2551
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
2552
|
+
|
2553
|
+
Raises
|
2554
|
+
------
|
2555
|
+
PyegeriaException
|
2556
|
+
"""
|
2557
|
+
|
2558
|
+
body = {
|
2559
|
+
"class": "FindPropertyNamesProperties",
|
2560
|
+
"metadataElementTypeName": metadata_element_type_name,
|
2561
|
+
"propertyValue": property_value,
|
2562
|
+
"propertyNames": property_names,
|
2563
|
+
"effectiveTime": effective_time,
|
2564
|
+
"startFrom": start_from,
|
2565
|
+
"pageSize": page_size,
|
2566
|
+
"forLineage": for_lineage,
|
2567
|
+
"forDuplicateProcessing": for_duplicate_processing
|
2568
|
+
}
|
2569
|
+
|
2570
|
+
url = f"{base_path(self, self.view_server)}/elements/by-exact-property-value"
|
2571
|
+
|
2572
|
+
response: Response = await self._async_make_request(
|
2573
|
+
"POST", url, body_slimmer(body), time_out=time_out
|
2574
|
+
)
|
2575
|
+
|
2576
|
+
elements = response.json().get("elements", NO_ELEMENTS_FOUND)
|
2577
|
+
if type(elements) is list and len(elements) == 0:
|
2578
|
+
return NO_ELEMENTS_FOUND
|
2579
|
+
|
739
2580
|
return self._generate_referenceable_output(
|
740
|
-
elements=
|
741
|
-
|
2581
|
+
elements=elements,
|
2582
|
+
filter=property_value,
|
742
2583
|
element_type_name=metadata_element_type_name,
|
743
2584
|
output_format=output_format,
|
744
2585
|
output_format_set=output_format_set,
|
745
2586
|
)
|
746
2587
|
|
747
|
-
|
2588
|
+
def get_elements_by_property_value(
|
748
2589
|
self,
|
749
2590
|
property_value: str,
|
750
|
-
property_names: [str],
|
2591
|
+
property_names: list[str],
|
751
2592
|
metadata_element_type_name: str = None,
|
752
2593
|
effective_time: str = None,
|
753
2594
|
for_lineage: bool = None,
|
@@ -755,11 +2596,12 @@ class ClassificationManager(Client2):
|
|
755
2596
|
start_from: int = 0,
|
756
2597
|
page_size: int = 0,
|
757
2598
|
time_out: int = default_time_out,
|
2599
|
+
output_format: str = "JSON",
|
2600
|
+
output_format_set: dict | str = None,
|
758
2601
|
) -> list | str:
|
759
2602
|
"""
|
760
|
-
Retrieve elements by a value found in one of the properties specified.
|
761
|
-
|
762
|
-
results. Async version.
|
2603
|
+
Retrieve elements by a value found in one of the properties specified. The value must match exactly.
|
2604
|
+
An open metadata type name may be supplied to restrict the results.
|
763
2605
|
|
764
2606
|
https://egeria-project.org/types/
|
765
2607
|
|
@@ -767,7 +2609,7 @@ class ClassificationManager(Client2):
|
|
767
2609
|
----------
|
768
2610
|
property_value: str
|
769
2611
|
- property value to be searched.
|
770
|
-
property_names: [str]
|
2612
|
+
property_names: list[str]
|
771
2613
|
- property names to search in.
|
772
2614
|
metadata_element_type_name : str, default = None
|
773
2615
|
- open metadata type to be used to restrict the search
|
@@ -781,10 +2623,70 @@ class ClassificationManager(Client2):
|
|
781
2623
|
- index of the list to start from (0 for start).
|
782
2624
|
page_size
|
783
2625
|
- maximum number of elements to return.
|
2626
|
+
output_format: str, default = "JSON"
|
2627
|
+
- Type of output to return.
|
2628
|
+
output_format_set: dict | str, default = None
|
2629
|
+
- Output format set to use. If None, the default output format set is used.
|
2630
|
+
time_out: int, default = default_time_out
|
2631
|
+
- http request timeout for this request
|
2632
|
+
|
2633
|
+
Returns
|
2634
|
+
-------
|
2635
|
+
[dict] | str
|
2636
|
+
Returns a string if no elements found and a list of dict of elements with the results.
|
2637
|
+
|
2638
|
+
Raises
|
2639
|
+
------
|
2640
|
+
PyegeriaException.
|
2641
|
+
"""
|
2642
|
+
|
2643
|
+
loop = asyncio.get_event_loop()
|
2644
|
+
response = loop.run_until_complete(
|
2645
|
+
self.async_get_elements_by_property_value(property_value, property_names, metadata_element_type_name,
|
2646
|
+
effective_time, for_lineage, for_duplicate_processing, start_from,
|
2647
|
+
page_size, time_out)
|
2648
|
+
)
|
2649
|
+
return response
|
2650
|
+
|
2651
|
+
async def async_find_elements_by_property_value(
|
2652
|
+
self,
|
2653
|
+
property_value: str,
|
2654
|
+
property_names: list[str],
|
2655
|
+
metadata_element_type_name: str = None,
|
2656
|
+
start_from: int = 0,
|
2657
|
+
page_size: int = 0,
|
2658
|
+
time_out: int = default_time_out,
|
2659
|
+
output_format: str = "JSON",
|
2660
|
+
output_format_set: dict | str = None,
|
2661
|
+
body: dict = None,
|
2662
|
+
) -> list | str:
|
2663
|
+
"""
|
2664
|
+
Retrieve elements by a value found in one of the properties specified. The value must only be contained in the
|
2665
|
+
properties rather than needing to be an exact match. An open metadata type name may be supplied to restrict the
|
2666
|
+
results. Async version.
|
784
2667
|
|
2668
|
+
https://egeria-project.org/types/
|
785
2669
|
|
2670
|
+
Parameters
|
2671
|
+
----------
|
2672
|
+
property_value: str
|
2673
|
+
- property value to be searched.
|
2674
|
+
property_names: list[str]
|
2675
|
+
- property names to search in.
|
2676
|
+
metadata_element_type_name : str, default = None
|
2677
|
+
- open metadata type to be used to restrict the search
|
2678
|
+
start_from: int, default = 0
|
2679
|
+
- index of the list to start from (0 for start).
|
2680
|
+
page_size
|
2681
|
+
- maximum number of elements to return.
|
786
2682
|
time_out: int, default = default_time_out
|
787
2683
|
- http request timeout for this request
|
2684
|
+
output_format: str, default = "JSON"
|
2685
|
+
- Type of output to return.
|
2686
|
+
output_format_set: dict | str = None
|
2687
|
+
- Output format set to use. If None, the default output format set is used.
|
2688
|
+
body: dict = None
|
2689
|
+
- - Full request body - supercedes other parameters.
|
788
2690
|
|
789
2691
|
Returns
|
790
2692
|
-------
|
@@ -794,9 +2696,12 @@ class ClassificationManager(Client2):
|
|
794
2696
|
Raises
|
795
2697
|
------
|
796
2698
|
PyegeriaExeception
|
797
|
-
"""
|
798
2699
|
|
799
|
-
|
2700
|
+
Notes
|
2701
|
+
-----
|
2702
|
+
|
2703
|
+
Sample body:
|
2704
|
+
{
|
800
2705
|
"class": "FindPropertyNamesProperties",
|
801
2706
|
"metadataElementTypeName": metadata_element_type_name,
|
802
2707
|
"propertyValue": property_value,
|
@@ -807,6 +2712,18 @@ class ClassificationManager(Client2):
|
|
807
2712
|
"forLineage": for_lineage,
|
808
2713
|
"forDuplicateProcessing": for_duplicate_processing
|
809
2714
|
}
|
2715
|
+
"""
|
2716
|
+
if body is None:
|
2717
|
+
body = {
|
2718
|
+
"class": "FindPropertyNamesProperties",
|
2719
|
+
"metadataElementTypeName": metadata_element_type_name,
|
2720
|
+
"propertyValue": property_value,
|
2721
|
+
"propertyNames": property_names,
|
2722
|
+
"startFrom": start_from,
|
2723
|
+
"pageSize": page_size,
|
2724
|
+
"forLineage": None,
|
2725
|
+
"forDuplicateProcessing": None
|
2726
|
+
}
|
810
2727
|
|
811
2728
|
url = f"{base_path(self, self.view_server)}/elements/by-property-value-search"
|
812
2729
|
|
@@ -815,24 +2732,30 @@ class ClassificationManager(Client2):
|
|
815
2732
|
)
|
816
2733
|
|
817
2734
|
elements = response.json().get("elements", NO_ELEMENTS_FOUND)
|
818
|
-
if type(elements) is list:
|
819
|
-
|
820
|
-
|
821
|
-
|
2735
|
+
if type(elements) is list and len(elements) == 0 or elements == NO_ELEMENTS_FOUND:
|
2736
|
+
return NO_ELEMENTS_FOUND
|
2737
|
+
if output_format == "JSON":
|
2738
|
+
return elements
|
2739
|
+
else:
|
2740
|
+
return self._generate_referenceable_output(
|
2741
|
+
elements=elements,
|
2742
|
+
filter=property_value,
|
2743
|
+
element_type_name=metadata_element_type_name,
|
2744
|
+
output_format=output_format,
|
2745
|
+
output_format_set=output_format_set,
|
2746
|
+
)
|
822
2747
|
|
823
2748
|
def find_elements_by_property_value(
|
824
2749
|
self,
|
825
2750
|
property_value: str,
|
826
|
-
property_names: [str],
|
2751
|
+
property_names: list[str],
|
827
2752
|
metadata_element_type_name: str = None,
|
828
|
-
effective_time: str = None,
|
829
|
-
for_lineage: bool = None,
|
830
|
-
for_duplicate_processing: bool = None,
|
831
2753
|
start_from: int = 0,
|
832
2754
|
page_size: int = 0,
|
833
2755
|
time_out: int = default_time_out,
|
834
2756
|
output_format: str = "JSON",
|
835
2757
|
output_format_set: dict | str = None,
|
2758
|
+
body: dict = None,
|
836
2759
|
) -> list | str:
|
837
2760
|
"""
|
838
2761
|
Retrieve elements by a value found in one of the properties specified. The value must only be contained in the
|
@@ -845,24 +2768,22 @@ class ClassificationManager(Client2):
|
|
845
2768
|
----------
|
846
2769
|
property_value: str
|
847
2770
|
- property value to be searched.
|
848
|
-
property_names: [str]
|
2771
|
+
property_names: list[str]
|
849
2772
|
- property names to search in.
|
850
2773
|
metadata_element_type_name : str, default = None
|
851
2774
|
- open metadata type to be used to restrict the search
|
852
|
-
effective_time: str, default = None
|
853
|
-
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
854
|
-
for_lineage: bool, default is set by server
|
855
|
-
- determines if elements classified as Memento should be returned - normally false
|
856
|
-
for_duplicate_processing: bool, default is set by server
|
857
|
-
- Normally false. Set true when the caller is part of a deduplication function
|
858
2775
|
start_from: int, default = 0
|
859
2776
|
- index of the list to start from (0 for start).
|
860
2777
|
page_size
|
861
2778
|
- maximum number of elements to return.
|
862
|
-
|
863
|
-
|
864
2779
|
time_out: int, default = default_time_out
|
865
2780
|
- http request timeout for this request
|
2781
|
+
output_format: str, default = "JSON"
|
2782
|
+
- Type of output to return.
|
2783
|
+
output_format_set: dict | str = None
|
2784
|
+
- Output format set to use. If None, the default output format set is used.
|
2785
|
+
body: dict = None
|
2786
|
+
- - Full request body - supercedes other parameters.
|
866
2787
|
|
867
2788
|
Returns
|
868
2789
|
-------
|
@@ -871,8 +2792,24 @@ class ClassificationManager(Client2):
|
|
871
2792
|
|
872
2793
|
Raises
|
873
2794
|
------
|
874
|
-
|
875
|
-
|
2795
|
+
PyegeriaExeception
|
2796
|
+
|
2797
|
+
Notes
|
2798
|
+
-----
|
2799
|
+
|
2800
|
+
Sample body:
|
2801
|
+
{
|
2802
|
+
"class": "FindPropertyNamesProperties",
|
2803
|
+
"metadataElementTypeName": metadata_element_type_name,
|
2804
|
+
"propertyValue": property_value,
|
2805
|
+
"propertyNames": property_names,
|
2806
|
+
"effectiveTime": effective_time,
|
2807
|
+
"startFrom": start_from,
|
2808
|
+
"pageSize": page_size,
|
2809
|
+
"forLineage": for_lineage,
|
2810
|
+
"forDuplicateProcessing": for_duplicate_processing
|
2811
|
+
}
|
2812
|
+
"""
|
876
2813
|
|
877
2814
|
loop = asyncio.get_event_loop()
|
878
2815
|
response = loop.run_until_complete(
|
@@ -880,12 +2817,12 @@ class ClassificationManager(Client2):
|
|
880
2817
|
property_value,
|
881
2818
|
property_names,
|
882
2819
|
metadata_element_type_name,
|
883
|
-
effective_time,
|
884
|
-
for_lineage,
|
885
|
-
for_duplicate_processing,
|
886
2820
|
start_from,
|
887
2821
|
page_size,
|
888
2822
|
time_out,
|
2823
|
+
output_format,
|
2824
|
+
output_format_set,
|
2825
|
+
body,
|
889
2826
|
)
|
890
2827
|
)
|
891
2828
|
return response
|
@@ -893,10 +2830,10 @@ class ClassificationManager(Client2):
|
|
893
2830
|
async def async_get_element_by_guid(
|
894
2831
|
self,
|
895
2832
|
element_guid: str,
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
2833
|
+
element_type_name: str = None,
|
2834
|
+
output_format: str = "JSON",
|
2835
|
+
output_format_set: dict | str = "Referenceable",
|
2836
|
+
body: dict | GetRequestBody = None,
|
900
2837
|
) -> dict | str:
|
901
2838
|
"""
|
902
2839
|
Retrieve element by its unique identifier. Async version.
|
@@ -907,16 +2844,14 @@ class ClassificationManager(Client2):
|
|
907
2844
|
----------
|
908
2845
|
element_guid: str
|
909
2846
|
- unique identifier for the element
|
910
|
-
|
911
|
-
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
time_out: int, default = default_time_out
|
919
|
-
- http request timeout for this request
|
2847
|
+
element_type_name : str, default = None
|
2848
|
+
- type of element to be returned
|
2849
|
+
output_format: str, default = "JSON"
|
2850
|
+
- output format to be used
|
2851
|
+
output_format_set: dict | str, default = "Referenceable"
|
2852
|
+
- output format set to be used
|
2853
|
+
body: dict | GetRequestBody, default = None
|
2854
|
+
- full request specification - if provided, overrides other parameters.
|
920
2855
|
|
921
2856
|
Returns
|
922
2857
|
-------
|
@@ -928,32 +2863,21 @@ class ClassificationManager(Client2):
|
|
928
2863
|
PyegeriaException
|
929
2864
|
"""
|
930
2865
|
|
931
|
-
|
932
|
-
|
933
|
-
"effectiveTime": effective_time,
|
934
|
-
"forLineage": for_lineage,
|
935
|
-
"forDuplicateProcessing": for_duplicate_processing
|
936
|
-
}
|
937
|
-
|
938
|
-
url = f"{base_path(self, self.view_server)}/elements/{element_guid}"
|
939
|
-
|
940
|
-
response: Response = await self._async_make_request(
|
941
|
-
"POST", url, body_slimmer(body), time_out=time_out
|
942
|
-
)
|
943
|
-
|
944
|
-
elements = response.json().get("element", NO_ELEMENTS_FOUND)
|
2866
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
2867
|
+
f"classification-explorer/elements/{element_guid}")
|
945
2868
|
|
946
|
-
|
2869
|
+
response = await self._async_get_guid_request(url, element_type_name,
|
2870
|
+
self._generate_referenceable_output,output_format,
|
2871
|
+
output_format_set, body)
|
2872
|
+
return response
|
947
2873
|
|
948
2874
|
def get_element_by_guid(
|
949
2875
|
self,
|
950
2876
|
element_guid: str,
|
951
|
-
|
952
|
-
for_lineage: bool = None,
|
953
|
-
for_duplicate_processing: bool = None,
|
954
|
-
time_out: int = default_time_out,
|
2877
|
+
element_type_name: str = None,
|
955
2878
|
output_format: str = "JSON",
|
956
2879
|
output_format_set: dict | str = None,
|
2880
|
+
body: dict | GetRequestBody = None
|
957
2881
|
) -> dict | str:
|
958
2882
|
"""
|
959
2883
|
Retrieve element by its unique identifier.
|
@@ -964,16 +2888,14 @@ class ClassificationManager(Client2):
|
|
964
2888
|
----------
|
965
2889
|
element_guid: str
|
966
2890
|
- unique identifier for the element
|
967
|
-
|
968
|
-
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
time_out: int, default = default_time_out
|
976
|
-
- http request timeout for this request
|
2891
|
+
element_type_name : str, default = None
|
2892
|
+
- type of element to be returned
|
2893
|
+
output_format: str, default = "JSON"
|
2894
|
+
- output format to be used
|
2895
|
+
output_format_set: dict | str, default = "Referenceable"
|
2896
|
+
- output format set to be used
|
2897
|
+
body: dict | GetRequestBody, default = None
|
2898
|
+
- full request specification - if provided, overrides other parameters.
|
977
2899
|
|
978
2900
|
Returns
|
979
2901
|
-------
|
@@ -989,19 +2911,10 @@ class ClassificationManager(Client2):
|
|
989
2911
|
response = loop.run_until_complete(
|
990
2912
|
self.async_get_element_by_guid(
|
991
2913
|
element_guid,
|
992
|
-
|
993
|
-
for_lineage,
|
994
|
-
for_duplicate_processing,
|
995
|
-
time_out,
|
2914
|
+
element_type_name, output_format, output_format_set, body
|
996
2915
|
)
|
997
2916
|
)
|
998
|
-
return
|
999
|
-
elements=response,
|
1000
|
-
search_string=element_guid,
|
1001
|
-
element_type_name=None,
|
1002
|
-
output_format=output_format,
|
1003
|
-
output_format_set=output_format_set,
|
1004
|
-
)
|
2917
|
+
return response
|
1005
2918
|
|
1006
2919
|
def get_actor_for_guid(self, guid: str) -> str:
|
1007
2920
|
"""Get the name of the actor from the supplied guid."""
|
@@ -1016,13 +2929,13 @@ class ClassificationManager(Client2):
|
|
1016
2929
|
self,
|
1017
2930
|
name: str,
|
1018
2931
|
property_name: str = None,
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
time_out: int = default_time_out,
|
2932
|
+
output_format: str = "JSON",
|
2933
|
+
output_format_set: dict | str = "Referenceable",
|
2934
|
+
body: dict = None
|
1023
2935
|
) -> list | str:
|
1024
2936
|
"""
|
1025
|
-
Retrieve the metadata element using the
|
2937
|
+
Retrieve the metadata element using the suppl
|
2938
|
+
ied unique element name (typically the qualifiedName,
|
1026
2939
|
but it is possible to specify a different property name in the request body as long as its unique.
|
1027
2940
|
If more than one element returned, an exception is thrown. Async version.
|
1028
2941
|
|
@@ -1032,17 +2945,12 @@ class ClassificationManager(Client2):
|
|
1032
2945
|
- element name to be searched.
|
1033
2946
|
property_name: str, optional
|
1034
2947
|
- optional name of property to search. If not specified, defaults to qualifiedName
|
1035
|
-
|
1036
|
-
-
|
1037
|
-
|
1038
|
-
-
|
1039
|
-
|
1040
|
-
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
time_out: int, default = default_time_out
|
1044
|
-
- http request timeout for this request
|
1045
|
-
|
2948
|
+
output_format: str, default = "JSON"
|
2949
|
+
- output format to be used
|
2950
|
+
output_format_set: dict | str, default = "Referenceable"
|
2951
|
+
- output format set to be used
|
2952
|
+
body: dict, default = None
|
2953
|
+
- full request specification - if provided, overrides other parameters.
|
1046
2954
|
Returns
|
1047
2955
|
-------
|
1048
2956
|
str
|
@@ -1054,32 +2962,37 @@ class ClassificationManager(Client2):
|
|
1054
2962
|
"""
|
1055
2963
|
|
1056
2964
|
property_name = "qualifiedName" if property_name is None else property_name
|
2965
|
+
if body is None:
|
2966
|
+
body = {
|
2967
|
+
"class": "FindPropertyNameProperties",
|
2968
|
+
"propertyValue": name,
|
2969
|
+
"propertyName": property_name,
|
2970
|
+
}
|
1057
2971
|
|
1058
|
-
|
1059
|
-
|
1060
|
-
"name": name,
|
1061
|
-
"namePropertyName": property_name,
|
1062
|
-
"forLineage": for_lineage,
|
1063
|
-
"forDuplicateProcessing": for_duplicate_processing,
|
1064
|
-
"effectiveTime": effective_time,
|
1065
|
-
}
|
1066
|
-
|
1067
|
-
url = f"{base_path(self, self.view_server)}/elements/by-unique-name"
|
2972
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
2973
|
+
f"classification-explorer/elements/by-unique-name")
|
1068
2974
|
|
1069
2975
|
response: Response = await self._async_make_request(
|
1070
|
-
"POST", url, body_slimmer(body)
|
2976
|
+
"POST", url, body_slimmer(body)
|
1071
2977
|
)
|
2978
|
+
elements = response.json().get("element", NO_ELEMENTS_FOUND)
|
2979
|
+
if type(elements) is str:
|
2980
|
+
logger.info(NO_ELEMENTS_FOUND)
|
2981
|
+
return NO_ELEMENTS_FOUND
|
2982
|
+
|
2983
|
+
if output_format != 'JSON': # return a simplified markdown representation
|
2984
|
+
logger.info(f"Found element, output format: {output_format} and output_format_set: {output_format_set}")
|
2985
|
+
return self._generate_referenceable_output(elements, "GUID", "Referenceable", output_format, output_format_set)
|
2986
|
+
return elements
|
1072
2987
|
|
1073
|
-
return response.json().get("element", NO_ELEMENTS_FOUND)
|
1074
2988
|
|
1075
2989
|
def get_element_by_unique_name(
|
1076
2990
|
self,
|
1077
2991
|
name: str,
|
1078
2992
|
property_name: str = None,
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
time_out: int = default_time_out,
|
2993
|
+
output_format: str = "JSON",
|
2994
|
+
output_format_set: dict | str = "Referenceable",
|
2995
|
+
body: dict = None
|
1083
2996
|
) -> list | str:
|
1084
2997
|
"""
|
1085
2998
|
Retrieve the metadata element using the supplied unique element name (typically the qualifiedName,
|
@@ -1092,16 +3005,12 @@ class ClassificationManager(Client2):
|
|
1092
3005
|
- element name to be searched.
|
1093
3006
|
property_name: str, optional
|
1094
3007
|
- optional name of property to search. If not specified, defaults to qualifiedName
|
1095
|
-
|
1096
|
-
-
|
1097
|
-
|
1098
|
-
-
|
1099
|
-
|
1100
|
-
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
time_out: int, default = default_time_out
|
1104
|
-
- http request timeout for this request
|
3008
|
+
output_format: str, default = "JSON"
|
3009
|
+
- output format to be used
|
3010
|
+
output_format_set: dict | str, default = "Referenceable"
|
3011
|
+
- output format set to be used
|
3012
|
+
body: dict, default = None
|
3013
|
+
- full request specification - if provided, overrides other parameters.
|
1105
3014
|
|
1106
3015
|
Returns
|
1107
3016
|
-------
|
@@ -1115,26 +3024,15 @@ class ClassificationManager(Client2):
|
|
1115
3024
|
|
1116
3025
|
loop = asyncio.get_event_loop()
|
1117
3026
|
response = loop.run_until_complete(
|
1118
|
-
self.async_get_element_by_unique_name(
|
1119
|
-
name,
|
1120
|
-
property_name,
|
1121
|
-
for_lineage,
|
1122
|
-
for_duplicate_processing,
|
1123
|
-
effective_time,
|
1124
|
-
time_out,
|
1125
|
-
)
|
3027
|
+
self.async_get_element_by_unique_name(name, property_name, output_format, output_format_set, body)
|
1126
3028
|
)
|
1127
3029
|
return response
|
1128
3030
|
|
1129
3031
|
async def async_get_element_guid_by_unique_name(
|
1130
3032
|
self,
|
1131
3033
|
name: str,
|
1132
|
-
property_name: str =
|
1133
|
-
|
1134
|
-
for_duplicate_processing: bool = False,
|
1135
|
-
effective_time: str = None,
|
1136
|
-
time_out: int = default_time_out,
|
1137
|
-
) -> list | str:
|
3034
|
+
property_name: str = None,
|
3035
|
+
body: dict = None ) -> list | str:
|
1138
3036
|
"""
|
1139
3037
|
Retrieve the guid associated with the supplied unique element name.
|
1140
3038
|
If more than one element returned, an exception is thrown. Async version.
|
@@ -1145,16 +3043,8 @@ class ClassificationManager(Client2):
|
|
1145
3043
|
- element name to be searched.
|
1146
3044
|
property_name: str, optional, default = "qualifiedName"
|
1147
3045
|
- optional name of property to search. If not specified, defaults to qualifiedName
|
1148
|
-
|
1149
|
-
-
|
1150
|
-
for_duplicate_processing: bool, default is set by server
|
1151
|
-
- Normally false. Set true when the caller is part of a deduplication function
|
1152
|
-
effective_time: str, default = None
|
1153
|
-
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
1154
|
-
|
1155
|
-
|
1156
|
-
time_out: int, default = default_time_out
|
1157
|
-
- http request timeout for this request
|
3046
|
+
body: dict, default = None
|
3047
|
+
- full request specification - if provided, overrides other parameters.
|
1158
3048
|
|
1159
3049
|
Returns
|
1160
3050
|
-------
|
@@ -1167,126 +3057,38 @@ class ClassificationManager(Client2):
|
|
1167
3057
|
"""
|
1168
3058
|
|
1169
3059
|
property_name = "qualifiedName" if property_name is None else property_name
|
3060
|
+
if body is None:
|
3061
|
+
body = {
|
3062
|
+
"class": "FindPropertyNameProperties",
|
3063
|
+
"propertyValue": name,
|
3064
|
+
"propertyName": property_name,
|
3065
|
+
}
|
1170
3066
|
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
"
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
return response.json().get("guid", NO_ELEMENTS_FOUND)
|
1187
|
-
|
1188
|
-
def get_element_guid_by_unique_name(
|
1189
|
-
self,
|
1190
|
-
name: str,
|
1191
|
-
property_name: str = "qualifiedName",
|
1192
|
-
for_lineage: bool = None,
|
1193
|
-
for_duplicate_processing: bool = None,
|
1194
|
-
effective_time: str = None,
|
1195
|
-
time_out: int = default_time_out,
|
1196
|
-
) -> list | str:
|
1197
|
-
"""
|
1198
|
-
Retrieve the guid associated with the supplied unique element name.
|
1199
|
-
If more than one element returned, an exception is thrown.
|
1200
|
-
|
1201
|
-
Parameters
|
1202
|
-
----------
|
1203
|
-
name: str
|
1204
|
-
- element name to be searched.
|
1205
|
-
property_name: str, optional, default = "qualifiedName"
|
1206
|
-
- optional name of property to search. If not specified, defaults to qualifiedName
|
1207
|
-
for_lineage: bool, default is set by server
|
1208
|
-
- determines if elements classified as Memento should be returned - normally false
|
1209
|
-
for_duplicate_processing: bool, default is set by server
|
1210
|
-
- Normally false. Set true when the caller is part of a deduplication function
|
1211
|
-
effective_time: str, default = None
|
1212
|
-
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
1213
|
-
|
1214
|
-
|
1215
|
-
time_out: int, default = default_time_out
|
1216
|
-
- http request timeout for this request
|
1217
|
-
|
1218
|
-
Returns
|
1219
|
-
-------
|
1220
|
-
str
|
1221
|
-
Returns the guid of the element.
|
1222
|
-
|
1223
|
-
Raises
|
1224
|
-
------
|
1225
|
-
PyegeriaException
|
1226
|
-
"""
|
1227
|
-
|
1228
|
-
loop = asyncio.get_event_loop()
|
1229
|
-
response = loop.run_until_complete(
|
1230
|
-
self.async_get_element_guid_by_unique_name(
|
1231
|
-
name,
|
1232
|
-
property_name,
|
1233
|
-
for_lineage,
|
1234
|
-
for_duplicate_processing,
|
1235
|
-
effective_time,
|
1236
|
-
time_out,
|
1237
|
-
)
|
1238
|
-
)
|
1239
|
-
return response
|
1240
|
-
|
1241
|
-
async def async_get_guid_for_name(
|
1242
|
-
self, name: str
|
1243
|
-
) -> list | str:
|
1244
|
-
"""
|
1245
|
-
Retrieve the guid associated with the supplied element name.
|
1246
|
-
If more than one element returned, an exception is thrown. Async version.
|
1247
|
-
|
1248
|
-
Parameters
|
1249
|
-
----------
|
1250
|
-
name: str
|
1251
|
-
- element name to be searched.
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
Returns
|
1256
|
-
-------
|
1257
|
-
str
|
1258
|
-
Returns the guid of the element.
|
1259
|
-
|
1260
|
-
Raises
|
1261
|
-
------
|
1262
|
-
PyegeriaException
|
1263
|
-
"""
|
1264
|
-
|
1265
|
-
property_name = ["name", "displayName", "title", "qualifiedName"]
|
1266
|
-
elements = await self.async_get_elements_by_property_value(
|
1267
|
-
name, property_name, None
|
1268
|
-
)
|
1269
|
-
|
1270
|
-
if type(elements) is list:
|
1271
|
-
if len(elements) == 0:
|
1272
|
-
return NO_ELEMENTS_FOUND
|
1273
|
-
elif len(elements) > 1:
|
1274
|
-
raise Exception("Multiple elements found for supplied name!")
|
1275
|
-
elif len(elements) == 1:
|
1276
|
-
return elements[0]["elementHeader"]["guid"]
|
1277
|
-
return elements
|
1278
|
-
|
1279
|
-
def get_guid_for_name(
|
1280
|
-
self, name: str, time_out: int = default_time_out
|
1281
|
-
) -> list | str:
|
3067
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
3068
|
+
f"classification-explorer/elements/guid-by-unique-name")
|
3069
|
+
|
3070
|
+
response: Response = await self._async_make_request(
|
3071
|
+
"POST", url, body_slimmer(body)
|
3072
|
+
)
|
3073
|
+
|
3074
|
+
return response.json().get("guid", NO_ELEMENTS_FOUND)
|
3075
|
+
|
3076
|
+
def get_element_guid_by_unique_name(
|
3077
|
+
self,
|
3078
|
+
name: str,
|
3079
|
+
property_name: str = None,
|
3080
|
+
body: dict = None ) -> list | str:
|
1282
3081
|
"""
|
1283
|
-
Retrieve the guid associated with the supplied element name.
|
3082
|
+
Retrieve the guid associated with the supplied unique element name.
|
1284
3083
|
If more than one element returned, an exception is thrown.
|
1285
3084
|
|
1286
3085
|
Parameters
|
1287
3086
|
----------
|
1288
3087
|
name: str
|
1289
3088
|
- element name to be searched.
|
3089
|
+
property_name: str, optional, default = "qualifiedName"
|
3090
|
+
- optional name of property to search. If not specified, defaults to qualifiedName
|
3091
|
+
body: dict, default = None
|
1290
3092
|
|
1291
3093
|
Returns
|
1292
3094
|
-------
|
@@ -1295,164 +3097,87 @@ class ClassificationManager(Client2):
|
|
1295
3097
|
|
1296
3098
|
Raises
|
1297
3099
|
------
|
1298
|
-
|
3100
|
+
PyegeriaException
|
1299
3101
|
"""
|
1300
3102
|
|
1301
3103
|
loop = asyncio.get_event_loop()
|
1302
3104
|
response = loop.run_until_complete(
|
1303
|
-
self.
|
3105
|
+
self.async_get_element_guid_by_unique_name(
|
3106
|
+
name,
|
3107
|
+
property_name,
|
3108
|
+
body
|
3109
|
+
)
|
1304
3110
|
)
|
1305
3111
|
return response
|
1306
3112
|
|
1307
|
-
async def
|
1308
|
-
|
1309
|
-
property_value: str,
|
1310
|
-
property_names: [str],
|
1311
|
-
metadata_element_type_name: str = None,
|
1312
|
-
effective_time: str = None,
|
1313
|
-
for_lineage: bool = None,
|
1314
|
-
for_duplicate_processing: bool = None,
|
1315
|
-
start_from: int = 0,
|
1316
|
-
page_size: int = 0,
|
1317
|
-
time_out: int = default_time_out,
|
1318
|
-
) -> list | str:
|
3113
|
+
async def async_get_guid_for_name(self, name: str, property_name: list[str] = ["qualifiedName","displayName"],
|
3114
|
+
type_name: str = "ValidMetadataValue") -> str:
|
1319
3115
|
"""
|
1320
|
-
Retrieve
|
1321
|
-
|
1322
|
-
the results. Async version.
|
1323
|
-
|
1324
|
-
https://egeria-project.org/types/
|
3116
|
+
Retrieve the guid associated with the supplied element name.
|
3117
|
+
If more than one element returned, an exception is thrown. Async version.
|
1325
3118
|
|
1326
3119
|
Parameters
|
1327
3120
|
----------
|
1328
|
-
|
1329
|
-
-
|
1330
|
-
|
1331
|
-
- property
|
1332
|
-
|
1333
|
-
-
|
1334
|
-
effective_time: str, default = None
|
1335
|
-
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
1336
|
-
for_lineage: bool, default is set by server
|
1337
|
-
- determines if elements classified as Memento should be returned - normally false
|
1338
|
-
for_duplicate_processing: bool, default is set by server
|
1339
|
-
- Normally false. Set true when the caller is part of a deduplication function
|
1340
|
-
start_from: int, default = 0
|
1341
|
-
- index of the list to start from (0 for start).
|
1342
|
-
page_size
|
1343
|
-
- maximum number of elements to return.
|
1344
|
-
|
1345
|
-
|
1346
|
-
time_out: int, default = default_time_out
|
1347
|
-
- http request timeout for this request
|
3121
|
+
name: str
|
3122
|
+
- element name to be searched.
|
3123
|
+
property_name: list[str], default = ["qualifiedName","displayName"]
|
3124
|
+
- optional name of property to search. If not specified, defaults to qualifiedName and displayName.
|
3125
|
+
type_name: str, default = "ValidMetadataValue"
|
3126
|
+
- metadata element type name to be used to restrict the search
|
1348
3127
|
|
1349
3128
|
Returns
|
1350
3129
|
-------
|
1351
|
-
|
1352
|
-
Returns
|
3130
|
+
str
|
3131
|
+
Returns the guid of the element.
|
1353
3132
|
|
1354
3133
|
Raises
|
1355
3134
|
------
|
1356
|
-
|
3135
|
+
PyegeriaException
|
1357
3136
|
"""
|
1358
3137
|
|
1359
|
-
body = {
|
1360
|
-
"class": "FindPropertyNamesProperties",
|
1361
|
-
"metadataElementTypeName": metadata_element_type_name,
|
1362
|
-
"propertyValue": property_value,
|
1363
|
-
"propertyNames": property_names,
|
1364
|
-
"effectiveTime": effective_time,
|
1365
|
-
"forLineage": for_lineage,
|
1366
|
-
"forDuplicateProcessing": for_duplicate_processing,
|
1367
|
-
"startFrom": start_from,
|
1368
|
-
"pageSize": page_size
|
1369
|
-
}
|
1370
3138
|
|
1371
|
-
|
1372
|
-
|
1373
|
-
"POST", url, body_slimmer(body), time_out=time_out
|
1374
|
-
)
|
1375
|
-
elements = response.json().get("elements", NO_ELEMENTS_FOUND)
|
3139
|
+
elements = await self.async_get_elements_by_property_value(name, property_name, type_name)
|
3140
|
+
|
1376
3141
|
if type(elements) is list:
|
1377
3142
|
if len(elements) == 0:
|
1378
3143
|
return NO_ELEMENTS_FOUND
|
3144
|
+
elif len(elements) > 1:
|
3145
|
+
raise PyegeriaException(context = {"output":"Multiple elements found for supplied name!"})
|
3146
|
+
elif len(elements) == 1:
|
3147
|
+
return elements[0]["elementHeader"]["guid"]
|
1379
3148
|
return elements
|
1380
3149
|
|
1381
|
-
def
|
1382
|
-
self,
|
1383
|
-
|
1384
|
-
property_names: [str],
|
1385
|
-
metadata_element_type_name: str = None,
|
1386
|
-
effective_time: str = None,
|
1387
|
-
for_lineage: bool = None,
|
1388
|
-
for_duplicate_processing: bool = None,
|
1389
|
-
start_from: int = 0,
|
1390
|
-
page_size: int = 0,
|
1391
|
-
time_out: int = default_time_out,
|
1392
|
-
output_format: str = "JSON",
|
1393
|
-
output_format_set: dict | str = None,
|
1394
|
-
) -> list | str:
|
3150
|
+
def get_guid_for_name(
|
3151
|
+
self, name: str, property_name: list[str] = ["qualifiedName", "displayName"], type_name: str = "ValidMetadataValue"
|
3152
|
+
) -> str:
|
1395
3153
|
"""
|
1396
|
-
Retrieve
|
1397
|
-
|
1398
|
-
the results.
|
1399
|
-
|
1400
|
-
https://egeria-project.org/types/
|
3154
|
+
Retrieve the guid associated with the supplied element name.
|
3155
|
+
If more than one element returned, an exception is thrown.
|
1401
3156
|
|
1402
3157
|
Parameters
|
1403
3158
|
----------
|
1404
|
-
|
1405
|
-
-
|
1406
|
-
|
1407
|
-
- property
|
1408
|
-
|
1409
|
-
-
|
1410
|
-
effective_time: str, default = None
|
1411
|
-
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
1412
|
-
for_lineage: bool, default is set by server
|
1413
|
-
- determines if elements classified as Memento should be returned - normally false
|
1414
|
-
for_duplicate_processing: bool, default is set by server
|
1415
|
-
- Normally false. Set true when the caller is part of a deduplication function
|
1416
|
-
start_from: int, default = 0
|
1417
|
-
- index of the list to start from (0 for start).
|
1418
|
-
page_size
|
1419
|
-
- maximum number of elements to return.
|
1420
|
-
|
1421
|
-
|
1422
|
-
time_out: int, default = default_time_out
|
1423
|
-
- http request timeout for this request
|
3159
|
+
name: str
|
3160
|
+
- element name to be searched.
|
3161
|
+
property_name: list[str], default = ["qualifiedName","displayName"]
|
3162
|
+
- optional name of property to search. If not specified, defaults to qualifiedName and displayName.
|
3163
|
+
type_name: str, default = "ValidMetadataValue"
|
3164
|
+
- metadata element type name to be used to restrict the search
|
1424
3165
|
|
1425
3166
|
Returns
|
1426
3167
|
-------
|
1427
|
-
|
1428
|
-
Returns
|
3168
|
+
str
|
3169
|
+
Returns the guid of the element.
|
1429
3170
|
|
1430
3171
|
Raises
|
1431
3172
|
------
|
1432
|
-
|
3173
|
+
PyegeriaExeception
|
1433
3174
|
"""
|
1434
3175
|
|
1435
3176
|
loop = asyncio.get_event_loop()
|
1436
3177
|
response = loop.run_until_complete(
|
1437
|
-
self.
|
1438
|
-
property_value,
|
1439
|
-
property_names,
|
1440
|
-
metadata_element_type_name,
|
1441
|
-
effective_time,
|
1442
|
-
for_lineage,
|
1443
|
-
for_duplicate_processing,
|
1444
|
-
start_from,
|
1445
|
-
page_size,
|
1446
|
-
time_out,
|
1447
|
-
)
|
1448
|
-
)
|
1449
|
-
return self._generate_referenceable_output(
|
1450
|
-
elements=response,
|
1451
|
-
search_string=property_value,
|
1452
|
-
element_type_name=metadata_element_type_name,
|
1453
|
-
output_format=output_format,
|
1454
|
-
output_format_set=output_format_set,
|
3178
|
+
self.async_get_guid_for_name(name, property_name, type_name)
|
1455
3179
|
)
|
3180
|
+
return response
|
1456
3181
|
|
1457
3182
|
#
|
1458
3183
|
# Elements by classification
|
@@ -1522,9 +3247,8 @@ class ClassificationManager(Client2):
|
|
1522
3247
|
"POST", url, body_slimmer(body), time_out=time_out
|
1523
3248
|
)
|
1524
3249
|
elements = response.json().get("elements", NO_ELEMENTS_FOUND)
|
1525
|
-
if type(elements) is list:
|
1526
|
-
|
1527
|
-
return NO_ELEMENTS_FOUND
|
3250
|
+
if type(elements) is list and len(elements) == 0:
|
3251
|
+
return NO_ELEMENTS_FOUND
|
1528
3252
|
return elements
|
1529
3253
|
|
1530
3254
|
def get_elements_by_classification(
|
@@ -1561,12 +3285,14 @@ class ClassificationManager(Client2):
|
|
1561
3285
|
- Normally false. Set true when the caller is part of a deduplication function
|
1562
3286
|
start_from: int, default = 0
|
1563
3287
|
- index of the list to start from (0 for start).
|
1564
|
-
page_size
|
3288
|
+
page_size: int, default = 0
|
1565
3289
|
- maximum number of elements to return.
|
1566
|
-
|
1567
|
-
|
1568
3290
|
time_out: int, default = default_time_out
|
1569
3291
|
- http request timeout for this request
|
3292
|
+
output_format: str, default = "JSON"
|
3293
|
+
- Type of output to return.
|
3294
|
+
output_format_set: dict | str, default = None
|
3295
|
+
- Output format set to use. If None, the default output format set is used.
|
1570
3296
|
|
1571
3297
|
Returns
|
1572
3298
|
-------
|
@@ -1593,7 +3319,7 @@ class ClassificationManager(Client2):
|
|
1593
3319
|
)
|
1594
3320
|
return self._generate_referenceable_output(
|
1595
3321
|
elements=response,
|
1596
|
-
|
3322
|
+
filter=classification_name,
|
1597
3323
|
element_type_name=metadata_element_type_name,
|
1598
3324
|
output_format=output_format,
|
1599
3325
|
output_format_set=output_format_set,
|
@@ -1603,7 +3329,7 @@ class ClassificationManager(Client2):
|
|
1603
3329
|
self,
|
1604
3330
|
classification_name: str,
|
1605
3331
|
property_value: str,
|
1606
|
-
property_names: [str],
|
3332
|
+
property_names: list[str],
|
1607
3333
|
metadata_element_type_name: str = None,
|
1608
3334
|
effective_time: str = None,
|
1609
3335
|
for_lineage: bool = None,
|
@@ -1625,7 +3351,7 @@ class ClassificationManager(Client2):
|
|
1625
3351
|
- the classification name to retrieve elements for.
|
1626
3352
|
property_value: str
|
1627
3353
|
- property value to be searched.
|
1628
|
-
property_names: [str]
|
3354
|
+
property_names: list[str]
|
1629
3355
|
- property names to search in.
|
1630
3356
|
metadata_element_type_name : str, default = None
|
1631
3357
|
- open metadata type to be used to restrict the search
|
@@ -1679,16 +3405,15 @@ class ClassificationManager(Client2):
|
|
1679
3405
|
"POST", url, body_slimmer(body), time_out=time_out
|
1680
3406
|
)
|
1681
3407
|
elements = response.json().get("elements", NO_ELEMENTS_FOUND)
|
1682
|
-
if type(elements) is list:
|
1683
|
-
|
1684
|
-
return NO_ELEMENTS_FOUND
|
3408
|
+
if type(elements) is list and len(elements) == 0:
|
3409
|
+
return NO_ELEMENTS_FOUND
|
1685
3410
|
return elements
|
1686
3411
|
|
1687
3412
|
def get_elements_by_classification_with_property_value(
|
1688
3413
|
self,
|
1689
3414
|
classification_name: str,
|
1690
3415
|
property_value: str,
|
1691
|
-
property_names: [str],
|
3416
|
+
property_names: list[str],
|
1692
3417
|
metadata_element_type_name: str = None,
|
1693
3418
|
effective_time: str = None,
|
1694
3419
|
for_lineage: bool = None,
|
@@ -1711,7 +3436,7 @@ class ClassificationManager(Client2):
|
|
1711
3436
|
- the classification name to retrieve elements for.
|
1712
3437
|
property_value: str
|
1713
3438
|
- property value to be searched.
|
1714
|
-
property_names: [str]
|
3439
|
+
property_names: list[str]
|
1715
3440
|
- property names to search in.
|
1716
3441
|
metadata_element_type_name : str, default = None
|
1717
3442
|
- open metadata type to be used to restrict the search
|
@@ -1723,12 +3448,14 @@ class ClassificationManager(Client2):
|
|
1723
3448
|
- Normally false. Set true when the caller is part of a deduplication function
|
1724
3449
|
start_from: int, default = 0
|
1725
3450
|
- index of the list to start from (0 for start).
|
1726
|
-
page_size
|
3451
|
+
page_size: int, default = 0
|
1727
3452
|
- maximum number of elements to return.
|
1728
|
-
|
1729
|
-
|
1730
3453
|
time_out: int, default = default_time_out
|
1731
3454
|
- http request timeout for this request
|
3455
|
+
output_format: str, default = "JSON"
|
3456
|
+
- Type of output to return.
|
3457
|
+
output_format_set: dict | str, default = None
|
3458
|
+
- Output format set to use. If None, the default output format set is used.
|
1732
3459
|
|
1733
3460
|
Returns
|
1734
3461
|
-------
|
@@ -1757,7 +3484,7 @@ class ClassificationManager(Client2):
|
|
1757
3484
|
)
|
1758
3485
|
return self._generate_referenceable_output(
|
1759
3486
|
elements=response,
|
1760
|
-
|
3487
|
+
filter=property_value,
|
1761
3488
|
element_type_name=metadata_element_type_name,
|
1762
3489
|
output_format=output_format,
|
1763
3490
|
output_format_set=output_format_set,
|
@@ -1767,7 +3494,7 @@ class ClassificationManager(Client2):
|
|
1767
3494
|
self,
|
1768
3495
|
classification_name: str,
|
1769
3496
|
property_value: str,
|
1770
|
-
property_names: [str],
|
3497
|
+
property_names: list[str],
|
1771
3498
|
metadata_element_type_name: str = None,
|
1772
3499
|
effective_time: str = None,
|
1773
3500
|
for_lineage: bool = None,
|
@@ -1775,12 +3502,14 @@ class ClassificationManager(Client2):
|
|
1775
3502
|
start_from: int = 0,
|
1776
3503
|
page_size: int = 0,
|
1777
3504
|
time_out: int = default_time_out,
|
3505
|
+
output_format: str = "JSON",
|
3506
|
+
output_format_set: dict | str = None,
|
1778
3507
|
) -> list | str:
|
1779
3508
|
"""
|
1780
3509
|
Retrieve elements with the requested classification name and with the requested value found in
|
1781
3510
|
one of the classification's properties specified. The value must only be contained in the
|
1782
3511
|
properties rather than needing to be an exact match.
|
1783
|
-
An open metadata type name may be supplied to restrict the results.
|
3512
|
+
An open metadata type name may be supplied to restrict the results.
|
1784
3513
|
|
1785
3514
|
https://egeria-project.org/types/
|
1786
3515
|
|
@@ -1790,7 +3519,7 @@ class ClassificationManager(Client2):
|
|
1790
3519
|
- the classification name to retrieve elements for.
|
1791
3520
|
property_value: str
|
1792
3521
|
- property value to be searched.
|
1793
|
-
property_names: [str]
|
3522
|
+
property_names: list[str]
|
1794
3523
|
- property names to search in.
|
1795
3524
|
metadata_element_type_name : str, default = None
|
1796
3525
|
- open metadata type to be used to restrict the search
|
@@ -1802,12 +3531,14 @@ class ClassificationManager(Client2):
|
|
1802
3531
|
- Normally false. Set true when the caller is part of a deduplication function
|
1803
3532
|
start_from: int, default = 0
|
1804
3533
|
- index of the list to start from (0 for start).
|
1805
|
-
page_size
|
3534
|
+
page_size: int, default = 0
|
1806
3535
|
- maximum number of elements to return.
|
1807
|
-
|
1808
|
-
|
1809
3536
|
time_out: int, default = default_time_out
|
1810
3537
|
- http request timeout for this request
|
3538
|
+
output_format: str, default = "JSON"
|
3539
|
+
- Type of output to return.
|
3540
|
+
output_format_set: dict | str, default = None
|
3541
|
+
- Output format set to use. If None, the default output format set is used.
|
1811
3542
|
|
1812
3543
|
Returns
|
1813
3544
|
-------
|
@@ -1841,16 +3572,21 @@ class ClassificationManager(Client2):
|
|
1841
3572
|
"POST", url, body_slimmer(body), time_out=time_out
|
1842
3573
|
)
|
1843
3574
|
elements = response.json().get("elements", NO_ELEMENTS_FOUND)
|
1844
|
-
if type(elements) is list:
|
1845
|
-
|
1846
|
-
|
1847
|
-
|
3575
|
+
if type(elements) is list and len(elements) == 0 and property_value is not None:
|
3576
|
+
return NO_ELEMENTS_FOUND
|
3577
|
+
return self._generate_referenceable_output(
|
3578
|
+
elements=elements,
|
3579
|
+
filter=property_value,
|
3580
|
+
element_type_name=metadata_element_type_name,
|
3581
|
+
output_format=output_format,
|
3582
|
+
output_format_set=output_format_set,
|
3583
|
+
)
|
1848
3584
|
|
1849
3585
|
def find_elements_by_classification_with_property_value(
|
1850
3586
|
self,
|
1851
3587
|
classification_name: str,
|
1852
3588
|
property_value: str,
|
1853
|
-
property_names: [str],
|
3589
|
+
property_names: list[str],
|
1854
3590
|
metadata_element_type_name: str = None,
|
1855
3591
|
effective_time: str = None,
|
1856
3592
|
for_lineage: bool = None,
|
@@ -1875,7 +3611,7 @@ class ClassificationManager(Client2):
|
|
1875
3611
|
- the classification name to retrieve elements for.
|
1876
3612
|
property_value: str
|
1877
3613
|
- property value to be searched.
|
1878
|
-
property_names: [str]
|
3614
|
+
property_names: list[str]
|
1879
3615
|
- property names to search in.
|
1880
3616
|
metadata_element_type_name : str, default = None
|
1881
3617
|
- open metadata type to be used to restrict the search
|
@@ -1889,11 +3625,12 @@ class ClassificationManager(Client2):
|
|
1889
3625
|
- index of the list to start from (0 for start).
|
1890
3626
|
page_size
|
1891
3627
|
- maximum number of elements to return.
|
1892
|
-
|
1893
|
-
|
1894
3628
|
time_out: int, default = default_time_out
|
1895
3629
|
- http request timeout for this request
|
1896
|
-
|
3630
|
+
output_format: str, default = "JSON"
|
3631
|
+
- Type of output to return.
|
3632
|
+
output_format_set: dict | str, default = None
|
3633
|
+
- Output format set to use. If None, the default output format set is used.
|
1897
3634
|
Returns
|
1898
3635
|
-------
|
1899
3636
|
[dict] | str
|
@@ -1917,15 +3654,11 @@ class ClassificationManager(Client2):
|
|
1917
3654
|
start_from,
|
1918
3655
|
page_size,
|
1919
3656
|
time_out,
|
3657
|
+
output_format,
|
3658
|
+
output_format_set
|
1920
3659
|
)
|
1921
3660
|
)
|
1922
|
-
return
|
1923
|
-
elements=response,
|
1924
|
-
search_string=property_value,
|
1925
|
-
element_type_name=metadata_element_type_name,
|
1926
|
-
output_format=output_format,
|
1927
|
-
output_format_set=output_format_set,
|
1928
|
-
)
|
3661
|
+
return response
|
1929
3662
|
|
1930
3663
|
#
|
1931
3664
|
# related elements
|
@@ -1999,21 +3732,20 @@ class ClassificationManager(Client2):
|
|
1999
3732
|
|
2000
3733
|
if relationship_type is None:
|
2001
3734
|
url = (
|
2002
|
-
f"{base_path(self, self.view_server)}/elements/{element_guid}/by-relationship"
|
3735
|
+
f"{base_path(self, self.view_server)}/elements/{element_guid}/by-relationship?startAtEnd={start_at_end}"
|
2003
3736
|
)
|
2004
3737
|
else:
|
2005
3738
|
url = (
|
2006
3739
|
f"{base_path(self, self.view_server)}/elements/{element_guid}/by-relationship/"
|
2007
|
-
f"{relationship_type}"
|
3740
|
+
f"{relationship_type}?startAtEnd={start_at_end}"
|
2008
3741
|
)
|
2009
3742
|
|
2010
3743
|
response: Response = await self._async_make_request(
|
2011
3744
|
"POST", url, body_slimmer(body), time_out=time_out
|
2012
3745
|
)
|
2013
3746
|
elements = response.json().get("elements", NO_ELEMENTS_FOUND)
|
2014
|
-
if type(elements) is list:
|
2015
|
-
|
2016
|
-
return NO_ELEMENTS_FOUND
|
3747
|
+
if type(elements) is list and len(elements) == 0:
|
3748
|
+
return NO_ELEMENTS_FOUND
|
2017
3749
|
return elements
|
2018
3750
|
|
2019
3751
|
def get_related_elements(
|
@@ -2056,12 +3788,14 @@ class ClassificationManager(Client2):
|
|
2056
3788
|
- Normally false. Set true when the caller is part of a deduplication function
|
2057
3789
|
start_from: int, default = 0
|
2058
3790
|
- index of the list to start from (0 for start).
|
2059
|
-
page_size
|
3791
|
+
page_size: int, default = 0
|
2060
3792
|
- maximum number of elements to return.
|
2061
|
-
|
2062
|
-
|
2063
3793
|
time_out: int, default = default_time_out
|
2064
3794
|
- http request timeout for this request
|
3795
|
+
output_format: str, default = "JSON"
|
3796
|
+
- Type of output to return.
|
3797
|
+
output_format_set: dict | str, default = None
|
3798
|
+
- Output format set to use. If None, the default output format set is used.
|
2065
3799
|
|
2066
3800
|
Returns
|
2067
3801
|
-------
|
@@ -2090,7 +3824,7 @@ class ClassificationManager(Client2):
|
|
2090
3824
|
)
|
2091
3825
|
return self._generate_referenceable_output(
|
2092
3826
|
elements=response,
|
2093
|
-
|
3827
|
+
filter=(relationship_type or "AllRelationships"),
|
2094
3828
|
element_type_name=metadata_element_type_name,
|
2095
3829
|
output_format=output_format,
|
2096
3830
|
output_format_set=output_format_set,
|
@@ -2101,7 +3835,7 @@ class ClassificationManager(Client2):
|
|
2101
3835
|
element_guid: str,
|
2102
3836
|
relationship_type: str,
|
2103
3837
|
property_value: str,
|
2104
|
-
property_names: [str],
|
3838
|
+
property_names: list[str],
|
2105
3839
|
metadata_element_type_name: str = None,
|
2106
3840
|
start_at_end: int = 1,
|
2107
3841
|
effective_time: str = None,
|
@@ -2126,13 +3860,12 @@ class ClassificationManager(Client2):
|
|
2126
3860
|
- the type of relationship to navigate to related elements
|
2127
3861
|
property_value: str
|
2128
3862
|
- property value to be searched.
|
2129
|
-
property_names: [str]
|
3863
|
+
property_names: list[str]
|
2130
3864
|
- property names to search in.
|
2131
3865
|
metadata_element_type_name : str, default = None
|
2132
3866
|
- restrict search to elements of this open metadata type
|
2133
3867
|
start_at_end: int, default = 1
|
2134
3868
|
- The end of the relationship to start from - typically End1
|
2135
|
-
- open metadata type to be used to restrict the search
|
2136
3869
|
effective_time: str, default = None
|
2137
3870
|
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
2138
3871
|
for_lineage: bool, default is set by server
|
@@ -2179,9 +3912,8 @@ class ClassificationManager(Client2):
|
|
2179
3912
|
"POST", url, body_slimmer(body), time_out=time_out
|
2180
3913
|
)
|
2181
3914
|
elements = response.json().get("elements", NO_ELEMENTS_FOUND)
|
2182
|
-
if type(elements) is list:
|
2183
|
-
|
2184
|
-
return NO_ELEMENTS_FOUND
|
3915
|
+
if type(elements) is list and len(elements) == 0:
|
3916
|
+
return NO_ELEMENTS_FOUND
|
2185
3917
|
return elements
|
2186
3918
|
|
2187
3919
|
def get_related_elements_with_property_value(
|
@@ -2189,7 +3921,7 @@ class ClassificationManager(Client2):
|
|
2189
3921
|
element_guid: str,
|
2190
3922
|
relationship_type: str,
|
2191
3923
|
property_value: str,
|
2192
|
-
property_names: [str],
|
3924
|
+
property_names: list[str],
|
2193
3925
|
metadata_element_type_name: str = None,
|
2194
3926
|
start_at_end: int = 1,
|
2195
3927
|
effective_time: str = None,
|
@@ -2216,7 +3948,7 @@ class ClassificationManager(Client2):
|
|
2216
3948
|
- the type of relationship to navigate to related elements
|
2217
3949
|
property_value: str
|
2218
3950
|
- property value to be searched.
|
2219
|
-
property_names: [str]
|
3951
|
+
property_names: list[str]
|
2220
3952
|
- property names to search in.
|
2221
3953
|
metadata_element_type_name : str, default = None
|
2222
3954
|
- open metadata type to be used to restrict the search
|
@@ -2230,12 +3962,14 @@ class ClassificationManager(Client2):
|
|
2230
3962
|
- Normally false. Set true when the caller is part of a deduplication function
|
2231
3963
|
start_from: int, default = 0
|
2232
3964
|
- index of the list to start from (0 for start).
|
2233
|
-
page_size
|
3965
|
+
page_size: int, default = 0
|
2234
3966
|
- maximum number of elements to return.
|
2235
|
-
|
2236
|
-
|
2237
3967
|
time_out: int, default = default_time_out
|
2238
3968
|
- http request timeout for this request
|
3969
|
+
output_format: str, default = "JSON"
|
3970
|
+
- Type of output to return.
|
3971
|
+
output_format_set: dict | str, default = None
|
3972
|
+
- Output format set to use. If None, the default output format set is used.
|
2239
3973
|
|
2240
3974
|
Returns
|
2241
3975
|
-------
|
@@ -2266,7 +4000,7 @@ class ClassificationManager(Client2):
|
|
2266
4000
|
)
|
2267
4001
|
return self._generate_referenceable_output(
|
2268
4002
|
elements=response,
|
2269
|
-
|
4003
|
+
filter = property_value,
|
2270
4004
|
element_type_name=metadata_element_type_name,
|
2271
4005
|
output_format=output_format,
|
2272
4006
|
output_format_set=output_format_set,
|
@@ -2277,7 +4011,7 @@ class ClassificationManager(Client2):
|
|
2277
4011
|
element_guid: str,
|
2278
4012
|
relationship_type: str,
|
2279
4013
|
property_value: str,
|
2280
|
-
property_names: [str],
|
4014
|
+
property_names: list[str],
|
2281
4015
|
metadata_element_type_name: str = None,
|
2282
4016
|
start_at_end: int = 1,
|
2283
4017
|
effective_time: str = None,
|
@@ -2303,13 +4037,12 @@ class ClassificationManager(Client2):
|
|
2303
4037
|
- the type of relationship to navigate to related elements
|
2304
4038
|
property_value: str
|
2305
4039
|
- property value to be searched.
|
2306
|
-
property_names: [str]
|
4040
|
+
property_names: list[str]
|
2307
4041
|
- property names to search in.
|
2308
4042
|
metadata_element_type_name : str, default = None
|
2309
4043
|
- restrict search to elements of this open metadata type
|
2310
4044
|
start_at_end: int, default = 1
|
2311
4045
|
- The end of the relationship to start from - typically End1
|
2312
|
-
- open metadata type to be used to restrict the search
|
2313
4046
|
effective_time: str, default = None
|
2314
4047
|
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
2315
4048
|
for_lineage: bool, default is set by server
|
@@ -2349,7 +4082,7 @@ class ClassificationManager(Client2):
|
|
2349
4082
|
|
2350
4083
|
url = (
|
2351
4084
|
f"{base_path(self, self.view_server)}/elements/{element_guid}/by-relationship/"
|
2352
|
-
f"{relationship_type}/with-property-value-search"
|
4085
|
+
f"{relationship_type}/with-property-value-search?startAtEnd={start_at_end}"
|
2353
4086
|
)
|
2354
4087
|
|
2355
4088
|
response: Response = await self._async_make_request(
|
@@ -2367,7 +4100,7 @@ class ClassificationManager(Client2):
|
|
2367
4100
|
element_guid: str,
|
2368
4101
|
relationship_type: str,
|
2369
4102
|
property_value: str,
|
2370
|
-
property_names: [str],
|
4103
|
+
property_names: list[str],
|
2371
4104
|
metadata_element_type_name: str = None,
|
2372
4105
|
start_at_end: int = 1,
|
2373
4106
|
effective_time: str = None,
|
@@ -2395,7 +4128,7 @@ class ClassificationManager(Client2):
|
|
2395
4128
|
- the type of relationship to navigate to related elements
|
2396
4129
|
property_value: str
|
2397
4130
|
- property value to be searched.
|
2398
|
-
property_names: [str]
|
4131
|
+
property_names: list[str]
|
2399
4132
|
- property names to search in.
|
2400
4133
|
metadata_element_type_name : str, default = None
|
2401
4134
|
- open metadata type to be used to restrict the search
|
@@ -2409,12 +4142,14 @@ class ClassificationManager(Client2):
|
|
2409
4142
|
- Normally false. Set true when the caller is part of a deduplication function
|
2410
4143
|
start_from: int, default = 0
|
2411
4144
|
- index of the list to start from (0 for start).
|
2412
|
-
page_size
|
4145
|
+
page_size: int, default = 0
|
2413
4146
|
- maximum number of elements to return.
|
2414
|
-
|
2415
|
-
|
2416
4147
|
time_out: int, default = default_time_out
|
2417
4148
|
- http request timeout for this request
|
4149
|
+
output_format: str, default = "JSON"
|
4150
|
+
- Type of output to return.
|
4151
|
+
output_format_set: dict | str, default = None
|
4152
|
+
- Output format set to use. If None, the default output format set is used.
|
2418
4153
|
|
2419
4154
|
Returns
|
2420
4155
|
-------
|
@@ -2445,7 +4180,7 @@ class ClassificationManager(Client2):
|
|
2445
4180
|
)
|
2446
4181
|
return self._generate_referenceable_output(
|
2447
4182
|
elements=response,
|
2448
|
-
|
4183
|
+
filter = property_value,
|
2449
4184
|
element_type_name=metadata_element_type_name,
|
2450
4185
|
output_format=output_format,
|
2451
4186
|
output_format_set=output_format_set,
|
@@ -2512,9 +4247,8 @@ class ClassificationManager(Client2):
|
|
2512
4247
|
)
|
2513
4248
|
rels = response.json().get("relationships", "No relationships found")
|
2514
4249
|
|
2515
|
-
if type(rels) is list:
|
2516
|
-
|
2517
|
-
return NO_ELEMENTS_FOUND
|
4250
|
+
if type(rels) is list and len(rels) == 0:
|
4251
|
+
return NO_ELEMENTS_FOUND
|
2518
4252
|
return rels
|
2519
4253
|
|
2520
4254
|
def get_relationships(
|
@@ -2577,7 +4311,7 @@ class ClassificationManager(Client2):
|
|
2577
4311
|
self,
|
2578
4312
|
relationship_type: str,
|
2579
4313
|
property_value: str,
|
2580
|
-
property_names: [str],
|
4314
|
+
property_names: list[str],
|
2581
4315
|
effective_time: str = None,
|
2582
4316
|
for_lineage: bool = None,
|
2583
4317
|
for_duplicate_processing: bool = None,
|
@@ -2597,7 +4331,7 @@ class ClassificationManager(Client2):
|
|
2597
4331
|
- the type of relationship to navigate to related elements
|
2598
4332
|
property_value: str
|
2599
4333
|
- property value to be searched.
|
2600
|
-
property_names: [str]
|
4334
|
+
property_names: list[str]
|
2601
4335
|
- property names to search in.
|
2602
4336
|
effective_time: str, default = None
|
2603
4337
|
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
@@ -2645,16 +4379,15 @@ class ClassificationManager(Client2):
|
|
2645
4379
|
"POST", url, body_slimmer(body), time_out=time_out
|
2646
4380
|
)
|
2647
4381
|
rels = response.json().get("relationships", NO_ELEMENTS_FOUND)
|
2648
|
-
if type(rels) is list:
|
2649
|
-
|
2650
|
-
return NO_ELEMENTS_FOUND
|
4382
|
+
if type(rels) is list and len(rels) == 0:
|
4383
|
+
return NO_ELEMENTS_FOUND
|
2651
4384
|
return rels
|
2652
4385
|
|
2653
4386
|
def get_relationships_with_property_value(
|
2654
4387
|
self,
|
2655
4388
|
relationship_type: str,
|
2656
4389
|
property_value: str,
|
2657
|
-
property_names: [str],
|
4390
|
+
property_names: list[str],
|
2658
4391
|
effective_time: str = None,
|
2659
4392
|
for_lineage: bool = None,
|
2660
4393
|
for_duplicate_processing: bool = None,
|
@@ -2672,7 +4405,7 @@ class ClassificationManager(Client2):
|
|
2672
4405
|
- the type of relationship to navigate to related elements
|
2673
4406
|
property_value: str
|
2674
4407
|
- property value to be searched.
|
2675
|
-
property_names: [str]
|
4408
|
+
property_names: list[str]
|
2676
4409
|
- property names to search in.
|
2677
4410
|
effective_time: str, default = None
|
2678
4411
|
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
@@ -2715,158 +4448,6 @@ class ClassificationManager(Client2):
|
|
2715
4448
|
)
|
2716
4449
|
return response
|
2717
4450
|
|
2718
|
-
# async def async_find_relationships_with_property_value(
|
2719
|
-
# self,
|
2720
|
-
# relationship_type: str,
|
2721
|
-
# property_value: str,
|
2722
|
-
# property_names: [str],
|
2723
|
-
# effective_time: str = None,
|
2724
|
-
# for_lineage: bool = None,
|
2725
|
-
# for_duplicate_processing: bool = None,
|
2726
|
-
# start_from: int = 0,
|
2727
|
-
# page_size: int = 0,
|
2728
|
-
# time_out: int = default_time_out,
|
2729
|
-
# ) -> list | str:
|
2730
|
-
# """
|
2731
|
-
# Retrieve relationships of the requested relationship type name and with the requested a value found in one of
|
2732
|
-
# the relationship's properties specified. The value must only be contained in the properties rather than
|
2733
|
-
# needing to be an exact match. Async version.
|
2734
|
-
#
|
2735
|
-
# Parameters
|
2736
|
-
# ----------
|
2737
|
-
# relationship_type: str
|
2738
|
-
# - the type of relationship to navigate to related elements
|
2739
|
-
# property_value: str
|
2740
|
-
# - property value to be searched.
|
2741
|
-
# property_names: [str]
|
2742
|
-
# - property names to search in.
|
2743
|
-
# effective_time: str, default = None
|
2744
|
-
# - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
2745
|
-
# for_lineage: bool, default is set by server
|
2746
|
-
# - determines if elements classified as Memento should be returned - normally false
|
2747
|
-
# for_duplicate_processing: bool, default is set by server
|
2748
|
-
# - Normally false. Set true when the caller is part of a deduplication function
|
2749
|
-
# start_from: int, default = 0
|
2750
|
-
# - index of the list to start from (0 for start).
|
2751
|
-
# page_size
|
2752
|
-
# - maximum number of elements to return.
|
2753
|
-
#
|
2754
|
-
#
|
2755
|
-
# time_out: int, default = default_time_out
|
2756
|
-
# - http request timeout for this request
|
2757
|
-
#
|
2758
|
-
# Returns
|
2759
|
-
# -------
|
2760
|
-
# [dict] | str
|
2761
|
-
# Returns a string if no elements found and a list of dict of elements with the results.
|
2762
|
-
#
|
2763
|
-
# Raises
|
2764
|
-
# ------
|
2765
|
-
# InvalidParameterException
|
2766
|
-
# one of the parameters is null or invalid or
|
2767
|
-
# PropertyServerException
|
2768
|
-
# There is a problem adding the element properties to the metadata repository or
|
2769
|
-
# UserNotAuthorizedException
|
2770
|
-
# the requesting user is not authorized to issue this request.
|
2771
|
-
# """
|
2772
|
-
#
|
2773
|
-
#
|
2774
|
-
#
|
2775
|
-
# body = {
|
2776
|
-
# "class": "FindPropertyNamesProperties",
|
2777
|
-
# "openMetadataType": relationship_type,
|
2778
|
-
# "propertyValue": property_value,
|
2779
|
-
# "propertyNames": property_names,
|
2780
|
-
# "effectiveTime": effective_time,
|
2781
|
-
# }
|
2782
|
-
#
|
2783
|
-
# url = (
|
2784
|
-
# f"{base_path(self, self.view_server)}/relationships"
|
2785
|
-
# f"/with-property-value-search"
|
2786
|
-
# )
|
2787
|
-
#
|
2788
|
-
# response: Response = await self._async_make_request(
|
2789
|
-
# "POST", url, body_slimmer(body), time_out=time_out
|
2790
|
-
# )
|
2791
|
-
#
|
2792
|
-
# rels = response.json().get("relationships", NO_ELEMENTS_FOUND)
|
2793
|
-
# if type(rels) is list:
|
2794
|
-
# if len(rels) == 0:
|
2795
|
-
# return NO_ELEMENTS_FOUND
|
2796
|
-
# return rels
|
2797
|
-
#
|
2798
|
-
# def find_relationships_with_property_value(
|
2799
|
-
# self,
|
2800
|
-
# relationship_type: str,
|
2801
|
-
# property_value: str,
|
2802
|
-
# property_names: [str],
|
2803
|
-
# effective_time: str = None,
|
2804
|
-
# for_lineage: bool = None,
|
2805
|
-
# for_duplicate_processing: bool = None,
|
2806
|
-
# start_from: int = 0,
|
2807
|
-
# page_size: int = 0,
|
2808
|
-
# time_out: int = default_time_out,
|
2809
|
-
# ) -> list | str:
|
2810
|
-
# """
|
2811
|
-
# Retrieve relationships of the requested relationship type name and with the requested a value found in one of
|
2812
|
-
# the relationship's properties specified. The value must only be contained in the properties rather than
|
2813
|
-
# needing to be an exact match..
|
2814
|
-
#
|
2815
|
-
# https://egeria-project.org/types/
|
2816
|
-
#
|
2817
|
-
# Parameters
|
2818
|
-
# ----------
|
2819
|
-
# relationship_type: str
|
2820
|
-
# - the type of relationship to navigate to related elements
|
2821
|
-
# property_value: str
|
2822
|
-
# - property value to be searched.
|
2823
|
-
# property_names: [str]
|
2824
|
-
# - property names to search in.
|
2825
|
-
# effective_time: str, default = None
|
2826
|
-
# - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
2827
|
-
# for_lineage: bool, default is set by server
|
2828
|
-
# - determines if elements classified as Memento should be returned - normally false
|
2829
|
-
# for_duplicate_processing: bool, default is set by server
|
2830
|
-
# - Normally false. Set true when the caller is part of a deduplication function
|
2831
|
-
# start_from: int, default = 0
|
2832
|
-
# - index of the list to start from (0 for start).
|
2833
|
-
# page_size
|
2834
|
-
# - maximum number of elements to return.
|
2835
|
-
#
|
2836
|
-
#
|
2837
|
-
# time_out: int, default = default_time_out
|
2838
|
-
# - http request timeout for this request
|
2839
|
-
#
|
2840
|
-
# Returns
|
2841
|
-
# -------
|
2842
|
-
# [dict] | str
|
2843
|
-
# Returns a string if no elements found and a list of dict of elements with the results.
|
2844
|
-
#
|
2845
|
-
# Raises
|
2846
|
-
# ------
|
2847
|
-
# InvalidParameterException
|
2848
|
-
# one of the parameters is null or invalid or
|
2849
|
-
# PropertyServerException
|
2850
|
-
# There is a problem adding the element properties to the metadata repository or
|
2851
|
-
# UserNotAuthorizedException
|
2852
|
-
# the requesting user is not authorized to issue this request.
|
2853
|
-
# """
|
2854
|
-
#
|
2855
|
-
# loop = asyncio.get_event_loop()
|
2856
|
-
# response = loop.run_until_complete(
|
2857
|
-
# self.async_find_relationships_with_property_value(
|
2858
|
-
# relationship_type,
|
2859
|
-
# property_value,
|
2860
|
-
# property_names,
|
2861
|
-
# effective_time,
|
2862
|
-
# for_lineage,
|
2863
|
-
# for_duplicate_processing,
|
2864
|
-
# start_from,
|
2865
|
-
# page_size,
|
2866
|
-
# time_out,
|
2867
|
-
# )
|
2868
|
-
# )
|
2869
|
-
# return response
|
2870
4451
|
|
2871
4452
|
#
|
2872
4453
|
# guid
|
@@ -3058,12 +4639,6 @@ class ClassificationManager(Client2):
|
|
3058
4639
|
- the identity of the element to update
|
3059
4640
|
body: dict
|
3060
4641
|
- a dictionary structure containing the properties to set - see note below
|
3061
|
-
for_lineage: bool, default is set by server
|
3062
|
-
- determines if elements classified as Memento should be returned - normally false
|
3063
|
-
for_duplicate_processing: bool, default is set by server
|
3064
|
-
- Normally false. Set true when the caller is part of a deduplication function
|
3065
|
-
|
3066
|
-
|
3067
4642
|
time_out: int, default = default_time_out
|
3068
4643
|
- http request timeout for this request
|
3069
4644
|
|
@@ -4131,7 +5706,8 @@ class ClassificationManager(Client2):
|
|
4131
5706
|
|
4132
5707
|
loop = asyncio.get_event_loop()
|
4133
5708
|
loop.run_until_complete(
|
4134
|
-
self.
|
5709
|
+
self.async_clear_gov_definition_from_element(
|
5710
|
+
definition_guid,
|
4135
5711
|
element_guid,
|
4136
5712
|
for_lineage,
|
4137
5713
|
for_duplicate_processing,
|
@@ -5084,10 +6660,10 @@ class ClassificationManager(Client2):
|
|
5084
6660
|
- determines if elements classified as Memento should be returned - normally false
|
5085
6661
|
for_duplicate_processing: bool, default is set by server
|
5086
6662
|
- Normally false. Set true when the caller is part of a deduplication function
|
5087
|
-
|
5088
|
-
|
5089
6663
|
time_out: int, default = default_time_out
|
5090
6664
|
- http request timeout for this request
|
6665
|
+
effective_time: str, default = None
|
6666
|
+
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
5091
6667
|
|
5092
6668
|
Returns
|
5093
6669
|
-------
|