pyegeria 5.4.8__py3-none-any.whl → 5.4.8.3__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.
- md_processing/__init__.py +2 -1
- md_processing/data/commands.json +59579 -52198
- md_processing/dr_egeria.py +7 -5
- md_processing/md_commands/solution_architect_commands.py +54 -10
- md_processing/md_processing_utils/common_md_proc_utils.py +8 -4
- md_processing/md_processing_utils/common_md_utils.py +41 -2
- pyegeria/_base_client.py +1 -17
- pyegeria/_client_new.py +1008 -323
- pyegeria/_client_new_backup.py +5359 -0
- pyegeria/_exceptions_new.py +6 -1
- pyegeria/base_report_formats.py +31 -2
- pyegeria/classification_manager.py +1430 -357
- pyegeria/collection_manager.py +52 -54
- pyegeria/config.py +1 -0
- pyegeria/data_designer.py +41 -41
- pyegeria/external_links.py +26 -26
- pyegeria/feedback_manager_omvs.py +13 -31
- pyegeria/glossary_manager.py +32 -35
- pyegeria/governance_officer.py +31 -31
- pyegeria/output_formatter.py +36 -11
- pyegeria/output_formatter_with_machine_keys.py +1127 -0
- pyegeria/project_manager.py +21 -21
- pyegeria/reference_data.py +2 -2
- pyegeria/solution_architect.py +112 -91
- {pyegeria-5.4.8.dist-info → pyegeria-5.4.8.3.dist-info}/METADATA +6 -5
- {pyegeria-5.4.8.dist-info → pyegeria-5.4.8.3.dist-info}/RECORD +30 -29
- pyegeria/md_processing_utils_orig.py +0 -1103
- {pyegeria-5.4.8.dist-info → pyegeria-5.4.8.3.dist-info}/WHEEL +0 -0
- {pyegeria-5.4.8.dist-info → pyegeria-5.4.8.3.dist-info}/entry_points.txt +0 -0
- {pyegeria-5.4.8.dist-info → pyegeria-5.4.8.3.dist-info}/licenses/LICENSE +0 -0
- {pyegeria-5.4.8.dist-info → pyegeria-5.4.8.3.dist-info}/top_level.txt +0 -0
md_processing/dr_egeria.py
CHANGED
|
@@ -10,14 +10,11 @@ from pydantic import ValidationError
|
|
|
10
10
|
|
|
11
11
|
from .md_commands.project_commands import process_link_project_dependency_command
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
logger.remove()
|
|
15
|
-
logger.add(sys.stderr, level="ERROR", format=log_format, colorize=True)
|
|
16
|
-
logger.add("debug_log.log", rotation="1 day", retention="1 week", compression="zip", level="INFO", format=log_format,
|
|
17
|
-
colorize=True)
|
|
13
|
+
|
|
18
14
|
|
|
19
15
|
from rich import print
|
|
20
16
|
from rich.console import Console
|
|
17
|
+
from md_processing.md_commands.product_manager_commands import process_csv_element_upsert_command
|
|
21
18
|
|
|
22
19
|
from md_processing import (extract_command, process_glossary_upsert_command, process_term_upsert_command,
|
|
23
20
|
process_provenance_command, get_current_datetime_string,
|
|
@@ -69,6 +66,11 @@ EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", "../../")
|
|
|
69
66
|
EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", "md_processing/dr_egeria_inbox")
|
|
70
67
|
EGERIA_OUTBOX_PATH = os.environ.get("EGERIA_OUTBOX_PATH", "md_processing/dr_egeria_outbox")
|
|
71
68
|
|
|
69
|
+
log_format = "{time} | {level} | {function} | {line} | {message} | {extra}"
|
|
70
|
+
logger.remove()
|
|
71
|
+
logger.add(sys.stderr, level="ERROR", format=log_format, colorize=True)
|
|
72
|
+
logger.add("debug_log.log", rotation="1 day", retention="1 week", compression="zip", level="INFO", format=log_format,
|
|
73
|
+
colorize=True)
|
|
72
74
|
|
|
73
75
|
@logger.catch
|
|
74
76
|
def process_md_file(input_file: str, output_folder:str, directive: str, server: str, url: str, userid: str,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"""
|
|
2
2
|
This file contains blueprint/solution-related object_action functions for processing Egeria Markdown
|
|
3
3
|
"""
|
|
4
|
+
|
|
4
5
|
import json
|
|
5
6
|
import sys
|
|
7
|
+
from datetime import datetime
|
|
6
8
|
from typing import Optional
|
|
7
9
|
|
|
8
10
|
from loguru import logger
|
|
@@ -13,7 +15,7 @@ from rich.markdown import Markdown
|
|
|
13
15
|
|
|
14
16
|
from md_processing.md_processing_utils.common_md_proc_utils import (parse_upsert_command, parse_view_command)
|
|
15
17
|
from md_processing.md_processing_utils.common_md_utils import update_element_dictionary, set_element_prop_body, \
|
|
16
|
-
set_update_body, set_create_body
|
|
18
|
+
set_update_body, set_create_body, add_search_keywords, add_note_in_dr_e
|
|
17
19
|
from md_processing.md_processing_utils.extraction_utils import (extract_command_plus, update_a_command)
|
|
18
20
|
from md_processing.md_processing_utils.md_processing_constants import (load_commands)
|
|
19
21
|
from pyegeria import body_slimmer, EgeriaTech, PyegeriaException, print_basic_exception
|
|
@@ -68,7 +70,7 @@ def sync_chain_related_elements(egeria_client: EgeriaTech, guid:str, in_supply_c
|
|
|
68
70
|
@logger.catch
|
|
69
71
|
def sync_component_related_elements(egeria_client: EgeriaTech, object_type: str,
|
|
70
72
|
supply_chain_guids: list, parent_component_guids: list,
|
|
71
|
-
actor_guids: list, in_blueprint_guids: list, guid: str, qualified_name: str,
|
|
73
|
+
actor_guids: list, in_blueprint_guids: list, keywords: list[str], guid: str, qualified_name: str,
|
|
72
74
|
display_name: str, merge_update: bool = True) -> None:
|
|
73
75
|
"""Sync a components related elements.
|
|
74
76
|
|
|
@@ -81,12 +83,15 @@ def sync_component_related_elements(egeria_client: EgeriaTech, object_type: str,
|
|
|
81
83
|
as_is_blueprints = set(rel_el_list.get("blueprint_guids", []))
|
|
82
84
|
as_is_parent_components = set(rel_el_list.get("parent_component_guids", []))
|
|
83
85
|
as_is_supply_chains = set(rel_el_list.get("supply_chain_guids", []))
|
|
86
|
+
as_is_keywords_list = set(rel_el_list.get("keywords_list", {}))
|
|
87
|
+
as_is_keywords = set(rel_el_list.get("keywords_list", {}).keys())
|
|
84
88
|
|
|
85
89
|
|
|
86
90
|
to_be_actors = set(actor_guids) if actor_guids is not None else set()
|
|
87
91
|
to_be_blueprints = set(in_blueprint_guids) if in_blueprint_guids is not None else set()
|
|
88
92
|
to_be_parent_components = set(parent_component_guids) if parent_component_guids is not None else set()
|
|
89
93
|
to_be_supply_chains = set(supply_chain_guids) if supply_chain_guids is not None else set()
|
|
94
|
+
to_be_keywords_list = set(keywords) if keywords is not None else set()
|
|
90
95
|
|
|
91
96
|
|
|
92
97
|
logger.trace(
|
|
@@ -94,6 +99,22 @@ def sync_component_related_elements(egeria_client: EgeriaTech, object_type: str,
|
|
|
94
99
|
logger.trace(f"as_is_actors: {list(as_is_actors)} to_be_actors: {list(to_be_actors)}")
|
|
95
100
|
logger.trace(f"as_is_blueprints: {list(as_is_blueprints)} to_be_blueprints: {list(to_be_blueprints)}")
|
|
96
101
|
|
|
102
|
+
keywords_to_add = to_be_keywords_list - as_is_keywords
|
|
103
|
+
logger.trace(f"keywords_to_add: {list(keywords_to_add)}")
|
|
104
|
+
if len(keywords_to_add) > 0:
|
|
105
|
+
for ds in keywords_to_add:
|
|
106
|
+
egeria_client.add_search_keyword_to_element(guid, ds)
|
|
107
|
+
msg = f"Added `{ds}` to component `{guid}`"
|
|
108
|
+
logger.trace(msg)
|
|
109
|
+
|
|
110
|
+
keywords_to_remove = as_is_keywords_list - to_be_keywords_list
|
|
111
|
+
logger.trace(f"keyword_to_remove: {list(keywords_to_remove)}")
|
|
112
|
+
if len(keywords_to_remove) > 0:
|
|
113
|
+
for ds in keywords_to_remove: ## change structure of get related elements to return pairs of keywords and guids
|
|
114
|
+
egeria_client.remove_search_keyword(rel_el_list['keywords_list'][ds])
|
|
115
|
+
msg = f"Removed `{ds}` from component `{guid}`"
|
|
116
|
+
logger.trace(msg)
|
|
117
|
+
|
|
97
118
|
parent_components_to_remove = as_is_parent_components - to_be_parent_components
|
|
98
119
|
logger.trace(f"sub_components_to_remove: {list(parent_components_to_remove)}")
|
|
99
120
|
if len(parent_components_to_remove) > 0:
|
|
@@ -102,6 +123,8 @@ def sync_component_related_elements(egeria_client: EgeriaTech, object_type: str,
|
|
|
102
123
|
msg = f"Removed `{display_name}` from component `{ds}`"
|
|
103
124
|
logger.trace(msg)
|
|
104
125
|
|
|
126
|
+
|
|
127
|
+
|
|
105
128
|
parent_components_to_add = to_be_parent_components - as_is_parent_components
|
|
106
129
|
logger.trace(f"parent_components_to_add: {list(parent_components_to_add)}")
|
|
107
130
|
if len(parent_components_to_add) > 0:
|
|
@@ -186,6 +209,9 @@ def sync_component_related_elements(egeria_client: EgeriaTech, object_type: str,
|
|
|
186
209
|
msg = f"Added `{in_blueprint_guids}` to `{display_name}`"
|
|
187
210
|
logger.trace(msg)
|
|
188
211
|
|
|
212
|
+
if keywords:
|
|
213
|
+
add_search_keywords(egeria_client, guid, keywords)
|
|
214
|
+
|
|
189
215
|
if supply_chain_guids:
|
|
190
216
|
body = {
|
|
191
217
|
"class": "NewRelationshipRequestBody",
|
|
@@ -268,7 +294,7 @@ def process_blueprint_upsert_command(egeria_client: EgeriaTech, txt: str, direct
|
|
|
268
294
|
|
|
269
295
|
qualified_name = parsed_output.get('qualified_name', None)
|
|
270
296
|
guid = parsed_output.get('guid', None)
|
|
271
|
-
|
|
297
|
+
journal_entry = parsed_output.get('Journey Entry', {}.get('value', None))
|
|
272
298
|
print(Markdown(parsed_output['display']))
|
|
273
299
|
|
|
274
300
|
logger.debug(json.dumps(parsed_output, indent=4))
|
|
@@ -276,7 +302,7 @@ def process_blueprint_upsert_command(egeria_client: EgeriaTech, txt: str, direct
|
|
|
276
302
|
attributes = parsed_output['attributes']
|
|
277
303
|
description = attributes.get('Description', {}).get('value', None)
|
|
278
304
|
display_name = attributes['Display Name'].get('value', None)
|
|
279
|
-
|
|
305
|
+
search_keywords = attributes['Search Keywords'].get('value', None)
|
|
280
306
|
|
|
281
307
|
|
|
282
308
|
|
|
@@ -328,6 +354,8 @@ def process_blueprint_upsert_command(egeria_client: EgeriaTech, txt: str, direct
|
|
|
328
354
|
logger.success(msg)
|
|
329
355
|
sync_blueprint_related_elements(egeria_client, object_type, component_guids, guid, qualified_name,
|
|
330
356
|
display_name, replace_all_props)
|
|
357
|
+
|
|
358
|
+
journal_entry_guid = add_note_in_dr_e(egeria_client, qualified_name, display_name, journal_entry)
|
|
331
359
|
logger.success(f"===> Updated {object_type} `{display_name}` related elements\n\n")
|
|
332
360
|
return egeria_client.get_solution_blueprints_by_name(qualified_name, output_format='MD', report_spec = "Solution-Blueprint-DrE")
|
|
333
361
|
|
|
@@ -360,6 +388,7 @@ def process_blueprint_upsert_command(egeria_client: EgeriaTech, txt: str, direct
|
|
|
360
388
|
update_element_dictionary(qualified_name, {
|
|
361
389
|
'guid': guid, 'display_name': display_name
|
|
362
390
|
})
|
|
391
|
+
journal_entry_guid = add_note_in_dr_e(egeria_client, qualified_name, display_name, journal_entry)
|
|
363
392
|
msg = f"Created Element `{display_name}` with GUID {guid}\n\n___"
|
|
364
393
|
print(Markdown(msg))
|
|
365
394
|
logger.success(msg)
|
|
@@ -413,6 +442,9 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
|
413
442
|
solution_component_type = attributes.get('Solution Component Type', {}).get('value', None)
|
|
414
443
|
planned_deployed_impl_type = attributes.get('Planned Deployed Implementation Type', {}).get('value', None)
|
|
415
444
|
initial_status = attributes.get('Status', {}).get('value', None)
|
|
445
|
+
url = attributes.get('URL', {}).get('value', None)
|
|
446
|
+
search_keywords = attributes.get('Search Keywords', {}).get('value', None)
|
|
447
|
+
journal_entry = attributes.get('Journal Entry', {}).get('value', None)
|
|
416
448
|
user_defined_status = attributes.get('User Defined Status', {}).get('value', None)
|
|
417
449
|
if initial_status != "OTHER":
|
|
418
450
|
user_defined_status = None
|
|
@@ -499,7 +531,8 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
|
499
531
|
"additionalProperties": additional_properties,
|
|
500
532
|
"extendedProperties": extended_properties,
|
|
501
533
|
"effectiveFrom": effective_from,
|
|
502
|
-
"effectiveTo": effective_to
|
|
534
|
+
"effectiveTo": effective_to,
|
|
535
|
+
"URL": url
|
|
503
536
|
}
|
|
504
537
|
})
|
|
505
538
|
|
|
@@ -511,10 +544,12 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
|
511
544
|
# Sync Parent Components and Blueprints
|
|
512
545
|
sync_component_related_elements(egeria_client, object_type ,
|
|
513
546
|
in_supply_chain_guids,parent_component_guids,actor_guids,
|
|
514
|
-
in_blueprint_guids, guid, qualified_name,
|
|
547
|
+
in_blueprint_guids, search_keywords, guid, qualified_name,
|
|
515
548
|
display_name,
|
|
516
549
|
merge_update)
|
|
517
|
-
|
|
550
|
+
|
|
551
|
+
if journal_entry:
|
|
552
|
+
journal_entry_guid = add_note_in_dr_e(egeria_client, qualified_name, display_name, journal_entry)
|
|
518
553
|
return egeria_client.get_solution_component_by_guid(guid, output_format='MD', report_spec = "Solution-Component-DrE")
|
|
519
554
|
|
|
520
555
|
|
|
@@ -551,7 +586,8 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
|
551
586
|
"additionalProperties": additional_properties,
|
|
552
587
|
"extendedProperties": extended_properties,
|
|
553
588
|
"effectiveFrom": effective_from,
|
|
554
|
-
"effectiveTo": effective_to
|
|
589
|
+
"effectiveTo": effective_to,
|
|
590
|
+
"URL": url
|
|
555
591
|
},
|
|
556
592
|
"initialStatus": initial_status,
|
|
557
593
|
"externalSourceGUID": external_source_guid,
|
|
@@ -568,6 +604,9 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
|
568
604
|
})
|
|
569
605
|
msg = f"Created Element `{display_name}` with GUID {guid}\n\n___"
|
|
570
606
|
logger.success(msg)
|
|
607
|
+
if search_keywords:
|
|
608
|
+
add_search_keywords(egeria_client, guid, search_keywords)
|
|
609
|
+
|
|
571
610
|
if in_component_guids:
|
|
572
611
|
for comp in in_component_guids:
|
|
573
612
|
egeria_client.link_subcomponent(comp, guid, None)
|
|
@@ -591,7 +630,8 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
|
591
630
|
egeria_client.link_design_to_implementation(isc, guid, None)
|
|
592
631
|
msg = f"Added `{display_name}`to supply chain `{in_supply_chain_names}`"
|
|
593
632
|
logger.trace(msg)
|
|
594
|
-
|
|
633
|
+
journal_entry_guid = add_note_in_dr_e(egeria_client, qualified_name, display_name,
|
|
634
|
+
journal_entry)
|
|
595
635
|
return egeria_client.get_solution_component_by_guid(guid, output_format='MD')
|
|
596
636
|
else:
|
|
597
637
|
msg = f"Failed to create element `{display_name}` with GUID {guid}\n\n___"
|
|
@@ -762,6 +802,7 @@ def process_information_supply_chain_upsert_command(egeria_client: EgeriaTech, t
|
|
|
762
802
|
description = attributes.get('Description', {}).get('value', None)
|
|
763
803
|
display_name = attributes['Display Name'].get('value', None)
|
|
764
804
|
version_identifier = attributes.get('Version Identifier', {}).get('value', None)
|
|
805
|
+
journal_entry = attributes.get('Journal Entry', {}).get('Value', None)
|
|
765
806
|
effective_time = attributes.get('Effective Time', {}).get('value', None)
|
|
766
807
|
effective_from = attributes.get('Effective From', {}).get('value', None)
|
|
767
808
|
effective_to = attributes.get('Effective To', {}).get('value', None)
|
|
@@ -836,8 +877,9 @@ def process_information_supply_chain_upsert_command(egeria_client: EgeriaTech, t
|
|
|
836
877
|
update_element_dictionary(qualified_name, {
|
|
837
878
|
'guid': guid, 'display_name': display_name
|
|
838
879
|
})
|
|
880
|
+
journal_entry_guid = add_note_in_dr_e(egeria_client, qualified_name, display_name, journal_entry)
|
|
839
881
|
|
|
840
|
-
|
|
882
|
+
logger.success(f"===> Updated {object_type} `{display_name}` related elements\n\n")
|
|
841
883
|
return egeria_client.get_info_supply_chain_by_guid(guid, output_format='MD')
|
|
842
884
|
|
|
843
885
|
|
|
@@ -890,6 +932,8 @@ def process_information_supply_chain_upsert_command(egeria_client: EgeriaTech, t
|
|
|
890
932
|
if len(in_supply_chain_guids) > 0:
|
|
891
933
|
for nested_chain in in_supply_chain_guids:
|
|
892
934
|
egeria_client.compose_info_supply_chains(guid, nested_chain)
|
|
935
|
+
journal_entry_guid = add_note_in_dr_e(egeria_client, qualified_name, display_name,
|
|
936
|
+
journal_entry)
|
|
893
937
|
|
|
894
938
|
msg = f"==>Created Element `{display_name}` with GUID {guid}\n"
|
|
895
939
|
logger.success(msg)
|
|
@@ -13,7 +13,7 @@ from rich import print
|
|
|
13
13
|
from rich.markdown import Markdown
|
|
14
14
|
from rich.console import Console
|
|
15
15
|
from pyegeria.utils import parse_to_dict
|
|
16
|
-
|
|
16
|
+
from pyegeria.config import settings
|
|
17
17
|
from md_processing.md_processing_utils.common_md_utils import (get_current_datetime_string, get_element_dictionary,
|
|
18
18
|
update_element_dictionary,
|
|
19
19
|
split_tb_string, str_to_bool, )
|
|
@@ -33,15 +33,19 @@ from pyegeria import EgeriaTech, select_report_spec, PyegeriaException, print_ba
|
|
|
33
33
|
|
|
34
34
|
from pyegeria._globals import DEBUG_LEVEL
|
|
35
35
|
|
|
36
|
+
debug_level = DEBUG_LEVEL
|
|
37
|
+
global COMMAND_DEFINITIONS
|
|
38
|
+
|
|
39
|
+
user_config = settings.User_Profile
|
|
36
40
|
|
|
37
41
|
# Constants
|
|
38
42
|
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
|
39
|
-
EGERIA_USAGE_LEVEL = os.environ.get("EGERIA_USAGE_LEVEL",
|
|
43
|
+
EGERIA_USAGE_LEVEL = os.environ.get("EGERIA_USAGE_LEVEL", user_config.egeria_usage_level)
|
|
40
44
|
LOCAL_QUALIFIER = os.environ.get("EGERIA_LOCAL_QUALIFIER", None)
|
|
41
45
|
console = Console(width=EGERIA_WIDTH)
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
|
|
48
|
+
|
|
45
49
|
|
|
46
50
|
|
|
47
51
|
@logger.catch
|
|
@@ -11,6 +11,8 @@ from loguru import logger
|
|
|
11
11
|
from rich import print
|
|
12
12
|
from rich.console import Console
|
|
13
13
|
from rich.markdown import Markdown
|
|
14
|
+
|
|
15
|
+
from pyegeria import Client2, PyegeriaException, egeria_client
|
|
14
16
|
from pyegeria.utils import (camel_to_title_case, body_slimmer)
|
|
15
17
|
from pyegeria._globals import DEBUG_LEVEL
|
|
16
18
|
from md_processing.md_processing_utils.message_constants import message_types
|
|
@@ -482,7 +484,7 @@ def set_rel_request_body_for_type(object_type: str, attributes: dict)->dict:
|
|
|
482
484
|
|
|
483
485
|
def set_delete_request_body(object_type: str, attributes: dict)->dict:
|
|
484
486
|
return {
|
|
485
|
-
"class": "
|
|
487
|
+
"class": "DeleteElementRequestBody",
|
|
486
488
|
"externalSourceGUID": attributes.get('External Source GUID', {}).get('guid', None),
|
|
487
489
|
"externalSourceName": attributes.get('External Source Name', {}).get('value', None),
|
|
488
490
|
"effectiveTime": attributes.get('Effective Time', {}).get('value', None),
|
|
@@ -538,4 +540,41 @@ def set_object_classifications(object_type: str, attributes: dict, obj_types: li
|
|
|
538
540
|
if classifications:
|
|
539
541
|
for classification in classifications:
|
|
540
542
|
body[classification] = {"class" : f"{classification}Properties"}
|
|
541
|
-
return body
|
|
543
|
+
return body
|
|
544
|
+
|
|
545
|
+
def add_search_keywords(client: Client2, element_guid: str, keywords: list[str]):
|
|
546
|
+
"""Add a search keyword to an element. Throw an exception if a problem is encountered.
|
|
547
|
+
|
|
548
|
+
Args:
|
|
549
|
+
client (Client2): The Egeria client instance.
|
|
550
|
+
element_guid (str): The GUID of the element to add the keyword to.
|
|
551
|
+
keyword (str): The search keyword to add.
|
|
552
|
+
|
|
553
|
+
Returns:
|
|
554
|
+
None
|
|
555
|
+
"""
|
|
556
|
+
try:
|
|
557
|
+
for keyword in keywords:
|
|
558
|
+
client.add_search_keyword_to_element(element_guid, keyword)
|
|
559
|
+
print("Added keyword `{}` to element `{}`".format(keyword, element_guid))
|
|
560
|
+
|
|
561
|
+
except PyegeriaException as e:
|
|
562
|
+
context = {
|
|
563
|
+
"readon" : "Exception encountered executing add_search_keyword",
|
|
564
|
+
"element_guid": element_guid,
|
|
565
|
+
"keyword": keyword,
|
|
566
|
+
"exception": str(e)
|
|
567
|
+
}
|
|
568
|
+
raise PyegeriaException(context = context)
|
|
569
|
+
|
|
570
|
+
def add_note_in_dr_e(client: Client2, qualified_name: str, display_name: str, journal_entry: str)-> str:
|
|
571
|
+
if journal_entry:
|
|
572
|
+
note_log_qn = f"{qualified_name}-NoteLog"
|
|
573
|
+
note_log_display_name = f"{display_name}-NoteLog"
|
|
574
|
+
note_display_name = f"{qualified_name}-Journal-Entry-{datetime.now().strftime('%Y-%m-%d %H:%M')}"
|
|
575
|
+
journal_entry_guid = client.add_journal_entry(note_log_qn, qualified_name, note_log_display_name, note_display_name,
|
|
576
|
+
journal_entry)
|
|
577
|
+
logger.info(f"Added journal entry `{journal_entry_guid}` to `{qualified_name}`")
|
|
578
|
+
return journal_entry_guid
|
|
579
|
+
else:
|
|
580
|
+
return None
|
pyegeria/_base_client.py
CHANGED
|
@@ -37,7 +37,7 @@ from pyegeria._validators import (
|
|
|
37
37
|
from pyegeria.models import (SearchStringRequestBody, FilterRequestBody, GetRequestBody, NewElementRequestBody,
|
|
38
38
|
TemplateRequestBody, UpdateStatusRequestBody, UpdateElementRequestBody,
|
|
39
39
|
NewRelationshipRequestBody,
|
|
40
|
-
|
|
40
|
+
UpdateRelationshipRequestBody, ResultsRequestBody,
|
|
41
41
|
NewClassificationRequestBody,
|
|
42
42
|
DeleteElementRequestBody, DeleteRelationshipRequestBody, DeleteClassificationRequestBody,
|
|
43
43
|
LevelIdentifierQueryBody)
|
|
@@ -147,22 +147,6 @@ class BaseClient:
|
|
|
147
147
|
self.server_name = server_name
|
|
148
148
|
self.session = AsyncClient(verify=enable_ssl_check)
|
|
149
149
|
self.command_root: str = f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/generic"
|
|
150
|
-
self._search_string_request_adapter = TypeAdapter(SearchStringRequestBody)
|
|
151
|
-
self._filter_request_adapter = TypeAdapter(FilterRequestBody)
|
|
152
|
-
self._get_request_adapter = TypeAdapter(GetRequestBody)
|
|
153
|
-
self._new_element_request_adapter = TypeAdapter(NewElementRequestBody)
|
|
154
|
-
self._update_element_request_adapter = TypeAdapter(UpdateElementRequestBody)
|
|
155
|
-
self._update_status_request_adapter = TypeAdapter(UpdateStatusRequestBody)
|
|
156
|
-
self._new_relationship_request_adapter = TypeAdapter(NewRelationshipRequestBody)
|
|
157
|
-
self._new_classification_request_adapter = TypeAdapter(NewClassificationRequestBody)
|
|
158
|
-
self._delete_request_adapter = TypeAdapter(DeleteRequestBody)
|
|
159
|
-
self._delete_element_request_adapter = TypeAdapter(DeleteElementRequestBody)
|
|
160
|
-
self._delete_relationship_request_adapter = TypeAdapter(DeleteRelationshipRequestBody)
|
|
161
|
-
self._delete_classification_request_adapter = TypeAdapter(DeleteClassificationRequestBody)
|
|
162
|
-
self._template_request_adapter = TypeAdapter(TemplateRequestBody)
|
|
163
|
-
self._update_relationship_request_adapter = TypeAdapter(UpdateRelationshipRequestBody)
|
|
164
|
-
self._results_request_adapter = TypeAdapter(ResultsRequestBody)
|
|
165
|
-
self._level_identifier_query_body = TypeAdapter(LevelIdentifierQueryBody)
|
|
166
150
|
|
|
167
151
|
try:
|
|
168
152
|
result = self.check_connection()
|