pyegeria 5.4.0.dev10__py3-none-any.whl → 5.4.0.dev12__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/cat/debug_log +6290 -6042
- commands/cat/debug_log.2025-07-01_15-22-20_102237.zip +0 -0
- commands/cat/debug_log.2025-07-04_15-43-28_460900.zip +0 -0
- commands/cat/debug_log.2025-07-06_20-48-04_338314.zip +0 -0
- commands/cat/debug_log.2025-07-09_10-17-09_526262.zip +0 -0
- commands/cat/dr_egeria_md.py +24 -14
- commands/cat/list_collections.py +11 -4
- md_processing/__init__.py +3 -1
- md_processing/data/commands.json +7842 -2231
- md_processing/md_commands/data_designer_commands.py +67 -80
- md_processing/md_commands/glossary_commands.py +3 -1
- md_processing/md_commands/product_manager_commands.py +1746 -0
- md_processing/md_commands/solution_architect_commands.py +390 -236
- md_processing/md_processing_utils/common_md_proc_utils.py +8 -6
- md_processing/md_processing_utils/md_processing_constants.py +25 -4
- pyegeria/__init__.py +1 -0
- pyegeria/_client.py +0 -1
- pyegeria/collection_manager_omvs.py +504 -546
- pyegeria/data_designer_omvs.py +16 -8
- pyegeria/egeria_tech_client.py +9 -25
- pyegeria/governance_officer_omvs.py +1446 -1343
- pyegeria/output_formatter.py +96 -8
- pyegeria/solution_architect_omvs.py +2278 -1728
- {pyegeria-5.4.0.dev10.dist-info → pyegeria-5.4.0.dev12.dist-info}/METADATA +1 -1
- {pyegeria-5.4.0.dev10.dist-info → pyegeria-5.4.0.dev12.dist-info}/RECORD +28 -25
- commands/cat/debug_log.2025-06-24_15-51-28_769553.zip +0 -0
- commands/cat/debug_log.2025-06-26_11-18-40_644650.zip +0 -0
- {pyegeria-5.4.0.dev10.dist-info → pyegeria-5.4.0.dev12.dist-info}/LICENSE +0 -0
- {pyegeria-5.4.0.dev10.dist-info → pyegeria-5.4.0.dev12.dist-info}/WHEEL +0 -0
- {pyegeria-5.4.0.dev10.dist-info → pyegeria-5.4.0.dev12.dist-info}/entry_points.txt +0 -0
@@ -27,94 +27,182 @@ logger.add(sys.stderr, level="INFO", format=log_format, colorize=True)
|
|
27
27
|
logger.add("solution_architect_log.log", rotation="1 day", retention="1 week", compression="zip", level="TRACE",
|
28
28
|
format=log_format, colorize=True)
|
29
29
|
|
30
|
+
@logger.catch
|
31
|
+
def sync_chain_related_elements(egeria_client: EgeriaTech, guid:str, in_supply_chain_guids:list, display_name:str,
|
32
|
+
replace_all_props:bool):
|
33
|
+
if replace_all_props:
|
34
|
+
rel_el_list = egeria_client._get_supply_chain_rel_elements(guid)
|
35
|
+
if rel_el_list is None:
|
36
|
+
logger.warning("Unexpected -> the list was None - assigning empty list")
|
37
|
+
rel_el_list = {}
|
38
|
+
|
39
|
+
as_is_parent_guids = set(rel_el_list.get("parent_guids", []))
|
40
|
+
|
41
|
+
to_be_parent_guids = set(in_supply_chain_guids) if in_supply_chain_guids is not None else set()
|
42
|
+
|
43
|
+
logger.trace(
|
44
|
+
f"as_is_parent supply chains: {list(as_is_parent_guids)} to_be_parent supply chains: {list(to_be_parent_guids)}")
|
45
|
+
|
46
|
+
|
47
|
+
parent_guids_to_remove = as_is_parent_guids - to_be_parent_guids
|
48
|
+
logger.trace(f"parent_guids_to_remove: {list(parent_guids_to_remove)}")
|
49
|
+
if len(parent_guids_to_remove) > 0:
|
50
|
+
for parent_guid in parent_guids_to_remove:
|
51
|
+
egeria_client.decompose_info_supply_chains(parent_guid, guid, None)
|
52
|
+
msg = f"Removed `{display_name}` from supply chain parent `{parent_guid}`"
|
53
|
+
logger.trace(msg)
|
54
|
+
|
55
|
+
parent_guids_to_add = to_be_parent_guids - as_is_parent_guids
|
56
|
+
logger.trace(f"parent supply chains_to_add: {list(parent_guids_to_add)}")
|
57
|
+
if len(parent_guids_to_add) > 0:
|
58
|
+
for parent_guid in parent_guids_to_add:
|
59
|
+
egeria_client.compose_info_supply_chains(parent_guid, guid, None)
|
60
|
+
msg = f"Added `{display_name}` to supply chain parent `{parent_guid}`"
|
61
|
+
logger.trace(msg)
|
62
|
+
|
63
|
+
else: # merge - add supply chain to parents
|
64
|
+
if in_supply_chain_guids:
|
65
|
+
for parent_guid in in_supply_chain_guids:
|
66
|
+
egeria_client.compose_info_supply_chains(parent_guid, guid, None)
|
67
|
+
msg = f"Added `{display_name}` to supply chain `{parent_guid}`"
|
68
|
+
logger.trace(msg)
|
69
|
+
|
70
|
+
|
30
71
|
|
31
72
|
@logger.catch
|
32
|
-
def sync_component_related_elements(egeria_client: EgeriaTech, object_type: str,
|
73
|
+
def sync_component_related_elements(egeria_client: EgeriaTech, object_type: str,
|
74
|
+
supply_chain_guids: list, parent_component_guids: list,
|
33
75
|
actor_guids: list, in_blueprint_guids: list, guid: str, qualified_name: str,
|
34
|
-
display_name: str,
|
76
|
+
display_name: str, merge_update: bool = True) -> None:
|
35
77
|
"""Sync a components related elements.
|
36
78
|
|
37
79
|
"""
|
38
|
-
if
|
80
|
+
if not merge_update:
|
39
81
|
rel_el_list = egeria_client.get_component_related_elements(guid)
|
40
82
|
# should I throw an exception if empty?
|
41
|
-
|
83
|
+
|
42
84
|
as_is_actors = set(rel_el_list.get("actor_guids", []))
|
43
85
|
as_is_blueprints = set(rel_el_list.get("blueprint_guids", []))
|
86
|
+
as_is_parent_components = set(rel_el_list.get("parent_component_guids", []))
|
87
|
+
as_is_supply_chains = set(rel_el_list.get("supply_chain_guids", []))
|
88
|
+
|
44
89
|
|
45
|
-
to_be_sub_components = set(sub_component_guids) if sub_component_guids is not None else set()
|
46
90
|
to_be_actors = set(actor_guids) if actor_guids is not None else set()
|
47
91
|
to_be_blueprints = set(in_blueprint_guids) if in_blueprint_guids is not None else set()
|
92
|
+
to_be_parent_components = set(parent_component_guids) if parent_component_guids is not None else set()
|
93
|
+
to_be_supply_chains = set(supply_chain_guids) if supply_chain_guids is not None else set()
|
94
|
+
|
48
95
|
|
49
96
|
logger.trace(
|
50
|
-
f"as_is_sub_components: {list(
|
97
|
+
f"as_is_sub_components: {list(as_is_parent_components)} to_be_sub_components: {list(to_be_parent_components)}")
|
51
98
|
logger.trace(f"as_is_actors: {list(as_is_actors)} to_be_actors: {list(to_be_actors)}")
|
52
99
|
logger.trace(f"as_is_blueprints: {list(as_is_blueprints)} to_be_blueprints: {list(to_be_blueprints)}")
|
53
100
|
|
54
|
-
|
55
|
-
logger.trace(f"sub_components_to_remove: {list(
|
56
|
-
if len(
|
57
|
-
for ds in
|
58
|
-
egeria_client.detach_sub_component(
|
59
|
-
msg = f"Removed `{
|
101
|
+
parent_components_to_remove = as_is_parent_components - to_be_parent_components
|
102
|
+
logger.trace(f"sub_components_to_remove: {list(parent_components_to_remove)}")
|
103
|
+
if len(parent_components_to_remove) > 0:
|
104
|
+
for ds in parent_components_to_remove:
|
105
|
+
egeria_client.detach_sub_component(ds, guid, None)
|
106
|
+
msg = f"Removed `{display_name}` from component `{ds}`"
|
60
107
|
logger.trace(msg)
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
108
|
+
|
109
|
+
parent_components_to_add = to_be_parent_components - as_is_parent_components
|
110
|
+
logger.trace(f"parent_components_to_add: {list(parent_components_to_add)}")
|
111
|
+
if len(parent_components_to_add) > 0:
|
112
|
+
for ds in parent_components_to_add:
|
113
|
+
egeria_client.link_subcomponent(ds, guid, None)
|
114
|
+
msg = f"Added `{display_name}` to component `{ds}`"
|
115
|
+
logger.trace(msg)
|
116
|
+
|
117
|
+
blueprints_to_remove = as_is_blueprints - to_be_blueprints
|
118
|
+
logger.trace(f"blueprints_to_remove: {list(blueprints_to_remove)}")
|
119
|
+
if len(blueprints_to_remove) > 0:
|
120
|
+
for bp in blueprints_to_remove:
|
121
|
+
egeria_client.detach_solution_component_from_blueprint(bp, guid, None)
|
122
|
+
msg = f"Removed `{display_name}` from blueprintt `{bp}`"
|
123
|
+
logger.trace(msg)
|
124
|
+
|
125
|
+
blueprints_to_add = to_be_blueprints - as_is_blueprints
|
126
|
+
logger.trace(f"blueprints_to_add: {list(blueprints_to_add)}")
|
127
|
+
if len(blueprints_to_add) > 0:
|
128
|
+
for bp in blueprints_to_add:
|
129
|
+
egeria_client.link_solution_component_to_blueprint(bp, guid, None)
|
130
|
+
msg = f"Added `{display_name}` to component `{bp}`"
|
67
131
|
logger.trace(msg)
|
68
132
|
|
133
|
+
|
134
|
+
|
69
135
|
actors_to_remove = to_be_actors - as_is_actors
|
70
136
|
logger.trace(f"actors_to_remove: {list(actors_to_remove)}")
|
71
137
|
if len(actors_to_remove) > 0:
|
72
138
|
for actor in actors_to_remove:
|
73
|
-
egeria_client.
|
139
|
+
egeria_client.detach_component_actore(actor, guid, None)
|
74
140
|
msg = f"Removed actor `{actor}` from component `{display_name}`"
|
75
141
|
logger.trace(msg)
|
142
|
+
|
76
143
|
actors_to_add = to_be_actors - as_is_actors
|
77
144
|
logger.trace(f"actors_to_add: {list(actors_to_add)}")
|
78
145
|
if len(actors_to_add) > 0:
|
79
146
|
for actor in actors_to_add:
|
80
|
-
egeria_client.
|
147
|
+
egeria_client.link_component_to_actor(actor, guid, None)
|
81
148
|
msg = f"Added `{display_name}` to role `{actor}`"
|
82
149
|
logger.trace(msg)
|
83
150
|
|
84
|
-
|
85
|
-
logger.trace(f"
|
86
|
-
if len(
|
87
|
-
for
|
88
|
-
egeria_client.
|
89
|
-
msg = f"Removed `{
|
151
|
+
supply_chains_to_remove = as_is_supply_chains - to_be_supply_chains
|
152
|
+
logger.trace(f"supply_chains_to_remove: {list(supply_chains_to_remove)}")
|
153
|
+
if len(supply_chains_to_remove) > 0:
|
154
|
+
for isc in supply_chains_to_remove:
|
155
|
+
egeria_client.detach_design_from_implementation(isc, guid)
|
156
|
+
msg = f"Removed `{isc}` from `{display_name}`"
|
90
157
|
logger.trace(msg)
|
91
|
-
|
92
|
-
logger.trace(f"
|
93
|
-
if len(
|
94
|
-
|
95
|
-
|
96
|
-
|
158
|
+
supply_chains_to_add = to_be_supply_chains - as_is_supply_chains
|
159
|
+
logger.trace(f"supply_chains_to_add: {list(supply_chains_to_add)}")
|
160
|
+
if len(supply_chains_to_add) > 0:
|
161
|
+
body = {
|
162
|
+
"class": "RelationshipRequestBody",
|
163
|
+
"properties": {
|
164
|
+
"class": "ImplementedByProperties",
|
165
|
+
"description": "a blank description to satisfy the Egeria gods"
|
166
|
+
}
|
167
|
+
}
|
168
|
+
for isc in supply_chains_to_add:
|
169
|
+
egeria_client.link_design_to_implementation(isc, guid, body)
|
170
|
+
msg = f"Added `{isc}` to`{display_name}`"
|
97
171
|
logger.trace(msg)
|
98
|
-
|
172
|
+
logger.info(f"Replaced the related elements in `{display_name}`")
|
99
173
|
|
100
174
|
else: # merge - add field to related elements
|
101
|
-
if
|
102
|
-
for comp in
|
175
|
+
if parent_component_guids:
|
176
|
+
for comp in parent_component_guids:
|
103
177
|
egeria_client.link_subcomponent(guid, comp, None)
|
104
|
-
|
105
|
-
|
178
|
+
msg = f"Added `{parent_component_guids}` to `{display_name}`"
|
179
|
+
logger.trace(msg)
|
106
180
|
|
107
181
|
if actor_guids:
|
108
182
|
for actor in actor_guids:
|
109
|
-
egeria_client.
|
110
|
-
|
111
|
-
|
183
|
+
egeria_client.link_component_to_actor(actor, guid, None)
|
184
|
+
msg = f"Added `{actor_guids}` to `{display_name}`"
|
185
|
+
logger.trace(msg)
|
112
186
|
|
113
187
|
if in_blueprint_guids:
|
114
188
|
for bp in in_blueprint_guids:
|
115
189
|
egeria_client.link_solution_component_to_blueprint(bp, guid, None)
|
116
|
-
|
117
|
-
|
190
|
+
msg = f"Added `{in_blueprint_guids}` to `{display_name}`"
|
191
|
+
logger.trace(msg)
|
192
|
+
|
193
|
+
if supply_chain_guids:
|
194
|
+
body = {
|
195
|
+
"class": "RelationshipRequestBody",
|
196
|
+
"properties": {
|
197
|
+
"class": "ImplementedByProperties",
|
198
|
+
"description": "a blank description to satisfy the Egeria gods"
|
199
|
+
}
|
200
|
+
}
|
201
|
+
for isc in supply_chain_guids:
|
202
|
+
egeria_client.link_design_to_implementation(isc, guid, body)
|
203
|
+
msg = f"Added `{display_name}` to `{isc}`"
|
204
|
+
logger.trace(msg)
|
205
|
+
|
118
206
|
logger.info(f"Merged related elements in `{display_name}`")
|
119
207
|
|
120
208
|
|
@@ -215,6 +303,8 @@ def process_blueprint_upsert_command(egeria_client: EgeriaTech, txt: str, direct
|
|
215
303
|
extended_properties = json.loads(extended_prop) if extended_prop is not None else None
|
216
304
|
component_guids = attributes.get('Solution Components', {}).get('guid_list', None)
|
217
305
|
|
306
|
+
initial_status = "ACTIVE"
|
307
|
+
|
218
308
|
replace_all_props = not attributes.get('Merge Update', {}).get('value', True)
|
219
309
|
|
220
310
|
if directive == "display":
|
@@ -264,33 +354,51 @@ def process_blueprint_upsert_command(egeria_client: EgeriaTech, txt: str, direct
|
|
264
354
|
|
265
355
|
|
266
356
|
elif object_action == "Create":
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
357
|
+
print(f"valid: {valid}, type: {type(valid)}")
|
358
|
+
try:
|
359
|
+
if valid is False and exists:
|
360
|
+
msg = (f" Data Specification `{display_name}` already exists and result document updated changing "
|
361
|
+
f"`Create` to `Update` in processed output\n\n___")
|
362
|
+
logger.error(msg)
|
363
|
+
return update_a_command(txt, object_action, object_type, qualified_name, guid)
|
272
364
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
"
|
286
|
-
"
|
287
|
-
"
|
288
|
-
"
|
289
|
-
"
|
365
|
+
elif not valid:
|
366
|
+
msg = (f"==>{object_type} `{display_name}` is not valid and can't be created")
|
367
|
+
logger.error(msg)
|
368
|
+
return
|
369
|
+
|
370
|
+
else:
|
371
|
+
body = {
|
372
|
+
"class": "NewSolutionBlueprintRequestBody",
|
373
|
+
"externalSourceGUID": external_source_guid,
|
374
|
+
"externalSourceName": external_source_name,
|
375
|
+
"forLineage": False,
|
376
|
+
"forDuplicateProcessing": False,
|
377
|
+
"effectiveTime": effective_time,
|
378
|
+
"anchorGUID": anchor_guid,
|
379
|
+
"isOwnAnchor": is_own_anchor,
|
380
|
+
"anchorScopeGUID": anchor_scope_guid,
|
381
|
+
"parentGUID": parent_guid,
|
382
|
+
"parentRelationshipTypeName": parent_relationship_type_name,
|
383
|
+
"parentAtEnd1": parent_at_end1,
|
384
|
+
"properties": {
|
385
|
+
"class": "SolutionBlueprintProperties",
|
386
|
+
"effectiveFrom": effective_from,
|
387
|
+
"effectiveTo": effective_to, # "typeName": type_name,
|
388
|
+
"extendedProperties": extended_properties,
|
389
|
+
"qualifiedName": qualified_name,
|
390
|
+
"additionalProperties": additional_properties,
|
391
|
+
"displayName": display_name,
|
392
|
+
"description": description,
|
393
|
+
"versionIdentifier": version_identifier
|
394
|
+
},
|
395
|
+
"initialStatus": initial_status,
|
290
396
|
}
|
291
|
-
|
397
|
+
guid = egeria_client.create_solution_blueprint(body)
|
398
|
+
except Exception as e:
|
399
|
+
print(f"Unexpected error: {e}, {type(valid)}, {valid}")
|
400
|
+
|
292
401
|
|
293
|
-
guid = egeria_client.create_solution_blueprint(body)
|
294
402
|
if guid:
|
295
403
|
update_element_dictionary(qualified_name, {
|
296
404
|
'guid': guid, 'display_name': display_name
|
@@ -304,6 +412,7 @@ def process_blueprint_upsert_command(egeria_client: EgeriaTech, txt: str, direct
|
|
304
412
|
return None
|
305
413
|
|
306
414
|
except Exception as e:
|
415
|
+
print("why did I get here")
|
307
416
|
logger.error(f"Error performing {command}: {e}")
|
308
417
|
return None
|
309
418
|
else:
|
@@ -337,9 +446,30 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
337
446
|
logger.debug(json.dumps(parsed_output, indent=4))
|
338
447
|
|
339
448
|
attributes = parsed_output['attributes']
|
449
|
+
|
340
450
|
description = attributes.get('Description', {}).get('value', None)
|
341
451
|
display_name = attributes['Display Name'].get('value', None)
|
342
452
|
version_identifier = attributes.get('Version Identifier', {}).get('value', None)
|
453
|
+
solution_component_type = attributes.get('Solution Component Type', {}).get('value', None)
|
454
|
+
planned_deployed_impl_type = attributes.get('Planned Deployed Implementation Type', {}).get('value', None)
|
455
|
+
initial_status = attributes.get('Initial Status', {}).get('value', None)
|
456
|
+
user_defined_status = attributes.get('User Defined Status', {}).get('value', None)
|
457
|
+
if initial_status != "OTHER":
|
458
|
+
user_defined_status = None
|
459
|
+
|
460
|
+
# sub_component_names = attributes.get('Solution SubComponents', {}).get('name_list', None)
|
461
|
+
# sub_component_guids = attributes.get('Solution SubComponents', {}).get('guid_list', None)
|
462
|
+
actor_names = attributes.get('Actors', {}).get('name_list', None)
|
463
|
+
actor_guids = attributes.get('Actors', {}).get('guid_list', None)
|
464
|
+
in_blueprint_names = attributes.get('In Solution Blueprints', {}).get('name_list', None)
|
465
|
+
in_blueprint_guids = attributes.get('In Solution Blueprints', {}).get('guid_list', None)
|
466
|
+
in_supply_chain_names = attributes.get('In Information Supply Chains', {}).get('name_list', None)
|
467
|
+
in_supply_chain_guids = attributes.get('In Information Supply Chains', {}).get('guid_list', None)
|
468
|
+
in_component_names = attributes.get('In Solution Components', {}).get('name_list', None)
|
469
|
+
in_component_guids = attributes.get('In Solution Components', {}).get('guid_list', None)
|
470
|
+
parent_component_guids = attributes.get('Parent Components', {}).get('guid_list', None)
|
471
|
+
parent_component_names = attributes.get('Parent Components', {}).get('name_list', None)
|
472
|
+
|
343
473
|
effective_time = attributes.get('Effective Time', {}).get('value', None)
|
344
474
|
effective_from = attributes.get('Effective From', {}).get('value', None)
|
345
475
|
effective_to = attributes.get('Effective To', {}).get('value', None)
|
@@ -349,6 +479,7 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
349
479
|
anchor_guid = attributes.get('Anchor ID', {}).get('guid', None)
|
350
480
|
parent_guid = attributes.get('Parent ID', {}).get('guid', None)
|
351
481
|
parent_relationship_type_name = attributes.get('Parent Relationship Type Name', {}).get('value', None)
|
482
|
+
parent_relationship_properties = attributes.get('Parent Relationship Properties', {}).get('value', None)
|
352
483
|
parent_at_end1 = attributes.get('Parent at End1', {}).get('value', True)
|
353
484
|
|
354
485
|
anchor_scope_guid = attributes.get('Anchor Scope GUID', {}).get('value', None)
|
@@ -361,16 +492,9 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
361
492
|
extended_prop = attributes.get('Extended Properties', {}).get('value', None)
|
362
493
|
extended_properties = json.loads(extended_prop) if extended_prop is not None else None
|
363
494
|
|
364
|
-
|
495
|
+
merge_update = attributes.get('Merge Update', {}).get('value', True)
|
496
|
+
|
365
497
|
|
366
|
-
solution_component_type = attributes.get('Solution Component Type', {}).get('value', None)
|
367
|
-
planned_deployed_impl_type = attributes.get('Planned Deployed Implementation Type', {}).get('value', None)
|
368
|
-
sub_component_names = attributes.get('Solution SubComponents', {}).get('name_list', None)
|
369
|
-
sub_component_guids = attributes.get('Solution SubComponents', {}).get('guid_list', None)
|
370
|
-
actor_names = attributes.get('Actors', {}).get('name_list', None)
|
371
|
-
actor_guids = attributes.get('Actors', {}).get('guid_list', None)
|
372
|
-
in_blueprint_names = attributes.get('Solution Blueprints', {}).get('name_list', None)
|
373
|
-
in_blueprint_guids = attributes.get('Solution Blueprints', {}).get('guid_list', None)
|
374
498
|
|
375
499
|
if directive == "display":
|
376
500
|
|
@@ -398,27 +522,37 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
398
522
|
f"==> Validation of {command} completed successfully! Proceeding to apply the changes.\n"))
|
399
523
|
|
400
524
|
body = body_slimmer({
|
401
|
-
"class": "
|
402
|
-
"
|
403
|
-
"
|
404
|
-
|
405
|
-
|
525
|
+
"class": "UpdateElementRequestBody",
|
526
|
+
"externalSourceGUID": external_source_guid,
|
527
|
+
"externalSourceName": external_source_name,
|
528
|
+
"effectiveTime": effective_time, "forLineage": False,
|
529
|
+
"forDuplicateProcessing": False,
|
530
|
+
"parentAtEnd1": parent_at_end1,
|
531
|
+
"properties": {
|
532
|
+
"class": "SolutionComponentProperties",
|
533
|
+
"qualifiedName": qualified_name,
|
534
|
+
"displayName": display_name,
|
535
|
+
"description": description,
|
406
536
|
"solutionComponentType": solution_component_type,
|
407
537
|
"plannedDeployedImplementationType": planned_deployed_impl_type,
|
408
|
-
"additionalProperties": additional_properties,
|
409
|
-
"
|
538
|
+
"additionalProperties": additional_properties,
|
539
|
+
"extendedProperties": extended_properties,
|
540
|
+
"effectiveFrom": effective_from,
|
541
|
+
"effectiveTo": effective_to
|
410
542
|
}
|
411
543
|
})
|
412
544
|
|
413
|
-
egeria_client.update_solution_component(guid, body,
|
545
|
+
egeria_client.update_solution_component(guid, body, not merge_update)
|
414
546
|
logger.success(f"==>Updated {object_type} `{display_name}` with GUID {guid}\n")
|
415
547
|
update_element_dictionary(qualified_name, {
|
416
548
|
'guid': guid, 'display_name': display_name
|
417
549
|
})
|
418
550
|
# Sync Parent Components and Blueprints
|
419
|
-
sync_component_related_elements(egeria_client, object_type
|
420
|
-
|
421
|
-
|
551
|
+
sync_component_related_elements(egeria_client, object_type ,
|
552
|
+
in_supply_chain_guids,parent_component_guids,actor_guids,
|
553
|
+
in_blueprint_guids, guid, qualified_name,
|
554
|
+
display_name,
|
555
|
+
merge_update)
|
422
556
|
logger.success(f"==>Updated {object_type} `{display_name}` with related elements")
|
423
557
|
return egeria_client.get_solution_component_by_guid(guid, output_format='MD')
|
424
558
|
|
@@ -437,21 +571,34 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
437
571
|
|
438
572
|
else:
|
439
573
|
body = body_slimmer({
|
440
|
-
"class": "
|
441
|
-
"
|
442
|
-
"
|
443
|
-
"
|
444
|
-
"parentRelationshipTypeName": parent_relationship_type_name,
|
574
|
+
"class": "NewSolutionElementRequestBody",
|
575
|
+
"anchorGUID": anchor_guid,
|
576
|
+
"isOwnAnchor": is_own_anchor,
|
577
|
+
"parentGUID": parent_guid,
|
578
|
+
"parentRelationshipTypeName": parent_relationship_type_name,
|
579
|
+
"parentRelationshipProperties": parent_relationship_properties,
|
580
|
+
"parentAtEnd1": parent_at_end1,
|
445
581
|
"properties": {
|
446
|
-
"class": "SolutionComponentProperties",
|
447
|
-
"
|
448
|
-
"
|
449
|
-
"
|
582
|
+
"class": "SolutionComponentProperties",
|
583
|
+
"qualifiedName": qualified_name,
|
584
|
+
"displayName": display_name,
|
585
|
+
"description": description,
|
450
586
|
"solutionComponentType": solution_component_type,
|
451
|
-
"
|
452
|
-
|
453
|
-
|
454
|
-
|
587
|
+
"versionIdentifier" : version_identifier,
|
588
|
+
"plannedDeployedImplementationType": planned_deployed_impl_type,
|
589
|
+
"userDefinedStatus" : user_defined_status,
|
590
|
+
"additionalProperties": additional_properties,
|
591
|
+
"extendedProperties": extended_properties,
|
592
|
+
"effectiveFrom": effective_from,
|
593
|
+
"effectiveTo": effective_to
|
594
|
+
},
|
595
|
+
"initialStatus": initial_status,
|
596
|
+
"externalSourceGUID": external_source_guid,
|
597
|
+
"externalSourceName": external_source_name,
|
598
|
+
"effectiveTime": effective_time,
|
599
|
+
"forLineage": False,
|
600
|
+
"forDuplicateProcessing": False
|
601
|
+
})
|
455
602
|
|
456
603
|
guid = egeria_client.create_solution_component(body)
|
457
604
|
if guid:
|
@@ -460,22 +607,28 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
460
607
|
})
|
461
608
|
msg = f"Created Element `{display_name}` with GUID {guid}\n\n___"
|
462
609
|
logger.success(msg)
|
463
|
-
if
|
464
|
-
for comp in
|
465
|
-
egeria_client.link_subcomponent(
|
466
|
-
msg = f"Added
|
610
|
+
if in_component_guids:
|
611
|
+
for comp in in_component_guids:
|
612
|
+
egeria_client.link_subcomponent(comp, guid, None)
|
613
|
+
msg = f"Added to parent components `{in_component_names}` "
|
467
614
|
logger.trace(msg)
|
468
615
|
|
469
616
|
if actor_guids:
|
470
617
|
for actor in actor_guids:
|
471
|
-
egeria_client.
|
618
|
+
egeria_client.link_component_to_actor(actor, guid, None)
|
472
619
|
msg = f"Added `{actor_guids}` to `{display_name}`"
|
473
620
|
logger.trace(msg)
|
474
621
|
|
475
622
|
if in_blueprint_guids:
|
476
623
|
for bp in in_blueprint_guids:
|
477
624
|
egeria_client.link_solution_component_to_blueprint(bp, guid, None)
|
478
|
-
msg = f"Added
|
625
|
+
msg = f"Added `{display_name}`to blueprints `{in_blueprint_names}`"
|
626
|
+
logger.trace(msg)
|
627
|
+
|
628
|
+
if in_supply_chain_guids:
|
629
|
+
for isc in in_supply_chain_guids:
|
630
|
+
egeria_client.link_design_to_implementation(isc, guid, None)
|
631
|
+
msg = f"Added `{display_name}`to supply chain `{in_supply_chain_names}`"
|
479
632
|
logger.trace(msg)
|
480
633
|
|
481
634
|
return egeria_client.get_solution_component_by_guid(guid, output_format='MD')
|
@@ -492,12 +645,10 @@ def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: st
|
|
492
645
|
|
493
646
|
|
494
647
|
@logger.catch
|
495
|
-
def
|
496
|
-
|
497
|
-
Optional[str]:
|
648
|
+
def process_component_link_unlink_command(egeria_client: EgeriaTech, txt: str,
|
649
|
+
directive: str = "display") -> Optional[str]:
|
498
650
|
"""
|
499
|
-
Processes a
|
500
|
-
blueprint name, description, and usage from the given text.
|
651
|
+
Processes a link or unlink command to wire solution components.
|
501
652
|
|
502
653
|
:param txt: A string representing the input cell to be processed for
|
503
654
|
extracting blueprint-related attributes.
|
@@ -506,49 +657,35 @@ def process_information_supply_chain_upsert_command(egeria_client: EgeriaTech, t
|
|
506
657
|
"""
|
507
658
|
command, object_type, object_action = extract_command_plus(txt)
|
508
659
|
|
509
|
-
parsed_output =
|
510
|
-
|
511
|
-
valid = parsed_output['valid']
|
512
|
-
exists = parsed_output['exists']
|
513
|
-
|
514
|
-
qualified_name = parsed_output.get('qualified_name', None)
|
515
|
-
guid = parsed_output.get('guid', None)
|
660
|
+
parsed_output = parse_view_command(egeria_client, object_type, object_action, txt, directive)
|
516
661
|
|
517
662
|
print(Markdown(parsed_output['display']))
|
518
663
|
|
519
664
|
logger.debug(json.dumps(parsed_output, indent=4))
|
520
665
|
|
521
666
|
attributes = parsed_output['attributes']
|
667
|
+
|
668
|
+
component1 = attributes.get('Component1', {}).get('guid', None)
|
669
|
+
component2 = attributes.get('Component2', {}).get('guid', None)
|
670
|
+
label = attributes.get('Wire Label', {}).get('value', None)
|
522
671
|
description = attributes.get('Description', {}).get('value', None)
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
672
|
+
|
673
|
+
valid = parsed_output['valid']
|
674
|
+
exists = component1 is not None and component2 is not None
|
675
|
+
|
676
|
+
|
528
677
|
external_source_guid = attributes.get('External Source GUID', {}).get('value', None)
|
529
678
|
external_source_name = attributes.get('External Source Name', {}).get('value', None)
|
530
679
|
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
parent_at_end1 = attributes.get('Parent at End1', {}).get('value', True)
|
535
|
-
|
536
|
-
anchor_scope_guid = attributes.get('Anchor Scope GUID', {}).get('value', None)
|
537
|
-
is_own_anchor = attributes.get('Is Own Anchor', {}).get('value', True)
|
538
|
-
if parent_guid is None:
|
539
|
-
is_own_anchor = True
|
680
|
+
effective_time = attributes.get('Effective Time', {}).get('value', None)
|
681
|
+
effective_from = attributes.get('Effective From', {}).get('value', None)
|
682
|
+
effective_to = attributes.get('Effective To', {}).get('value', None)
|
540
683
|
|
541
684
|
additional_prop = attributes.get('Additional Properties', {}).get('value', None)
|
542
685
|
additional_properties = json.loads(additional_prop) if additional_prop is not None else None
|
543
686
|
extended_prop = attributes.get('Extended Properties', {}).get('value', None)
|
544
687
|
extended_properties = json.loads(extended_prop) if extended_prop is not None else None
|
545
688
|
|
546
|
-
scope = attributes.get('Scope', {}).get('value', None)
|
547
|
-
purposes = attributes.get('Purposes', {}).get('value', None)
|
548
|
-
segment_guids = attributes.get('Information Supply Chain Segments', {}).get('guid_list', None)
|
549
|
-
|
550
|
-
replace_all_props = not attributes.get('Merge Update', {}).get('value', True)
|
551
|
-
|
552
689
|
if directive == "display":
|
553
690
|
|
554
691
|
return None
|
@@ -561,12 +698,13 @@ def process_information_supply_chain_upsert_command(egeria_client: EgeriaTech, t
|
|
561
698
|
|
562
699
|
elif directive == "process":
|
563
700
|
try:
|
564
|
-
if object_action == "
|
701
|
+
if object_action == "Unlink":
|
565
702
|
if not exists:
|
566
|
-
msg = (f"
|
703
|
+
msg = (f" Link `{label}` does not exist! Updating result document with Link "
|
567
704
|
f"object_action\n")
|
568
705
|
logger.error(msg)
|
569
|
-
|
706
|
+
out = parsed_output['display'].replace('Link', 'Detach', 1)
|
707
|
+
return out
|
570
708
|
elif not valid:
|
571
709
|
return None
|
572
710
|
else:
|
@@ -574,68 +712,53 @@ def process_information_supply_chain_upsert_command(egeria_client: EgeriaTech, t
|
|
574
712
|
f"==> Validation of {command} completed successfully! Proceeding to apply the changes.\n"))
|
575
713
|
|
576
714
|
body = body_slimmer({
|
577
|
-
"class": "
|
578
|
-
"
|
579
|
-
"
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
"displayName": display_name, "description": description, "scope": scope,
|
584
|
-
"purposes": purposes, "version": version_identifier
|
585
|
-
}
|
715
|
+
"class": "MetadataSourceRequestBody",
|
716
|
+
"externalSourceGUID": external_source_guid,
|
717
|
+
"externalSourceName": external_source_name,
|
718
|
+
"effectiveTime": effective_time,
|
719
|
+
"forLineage": False,
|
720
|
+
"forDuplicateProcessing": False
|
586
721
|
})
|
587
722
|
|
588
|
-
egeria_client.
|
589
|
-
logger.success(f"==> Updated {object_type} `{display_name}` with GUID {guid}\n\n")
|
590
|
-
update_element_dictionary(qualified_name, {
|
591
|
-
'guid': guid, 'display_name': display_name
|
592
|
-
})
|
593
|
-
# sync_blueprint_related_elements(egeria_client,object_type, segment_guids, guid, qualified_name,
|
594
|
-
# display_name, replace_all_props)
|
595
|
-
# logger.success(f"===> Updated {object_type} `{display_name}` related elements\n\n")
|
596
|
-
return egeria_client.get_info_supply_chain_by_guid(guid, output_format='MD')
|
723
|
+
egeria_client.detach_solution_linking_wire(component1, component2, body)
|
597
724
|
|
725
|
+
logger.success(f"===> Detached segment with {label} from `{component1}`to {component2}\n")
|
726
|
+
out = parsed_output['display'].replace('Unlink', 'Link', 1)
|
598
727
|
|
599
|
-
|
728
|
+
return (out)
|
729
|
+
|
730
|
+
|
731
|
+
elif object_action == "Link":
|
600
732
|
if valid is False and exists:
|
601
|
-
msg = (
|
602
|
-
|
603
|
-
f"`Create` to `Update` in processed output\n")
|
733
|
+
msg = (f"--> Link called `{label}` already exists and result document updated changing "
|
734
|
+
f"`Link` to `Detach` in processed output\n")
|
604
735
|
logger.error(msg)
|
605
|
-
return update_a_command(txt, object_action, object_type, qualified_name, guid)
|
606
736
|
|
607
737
|
elif valid is False:
|
608
|
-
msg = f"==>{object_type} `{
|
738
|
+
msg = f"==>{object_type} Link with label `{label}` is not valid and can't be created"
|
609
739
|
logger.error(msg)
|
610
740
|
return
|
611
741
|
else:
|
612
742
|
body = {
|
613
|
-
"class": "
|
614
|
-
"
|
615
|
-
"
|
616
|
-
"
|
617
|
-
"parentRelationshipTypeName": parent_relationship_type_name, "parentAtEnd1": parent_at_end1,
|
743
|
+
"class": "RelationshipRequestBody",
|
744
|
+
"effectiveTime": effective_time,
|
745
|
+
"forLineage": False,
|
746
|
+
"forDuplicateProcessing": False,
|
618
747
|
"properties": {
|
619
|
-
"class": "
|
620
|
-
"
|
621
|
-
"
|
622
|
-
"
|
623
|
-
"
|
748
|
+
"class": "SolutionLinkingWireProperties",
|
749
|
+
"label": label,
|
750
|
+
"description": description,
|
751
|
+
"effectiveFrom": effective_from,
|
752
|
+
"effectiveTo": effective_to
|
624
753
|
}
|
625
754
|
}
|
626
755
|
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
logger.success(msg)
|
634
|
-
return egeria_client.get_info_supply_chain_by_guid(guid, output_format='MD')
|
635
|
-
else:
|
636
|
-
msg = f"==>Failed to create element `{display_name}` with GUID {guid}\n"
|
637
|
-
logger.error(msg)
|
638
|
-
return None
|
756
|
+
egeria_client.link_solution_linking_wire(component1, component2, None)
|
757
|
+
msg = f"==>Created {object_type} link named `{label}`\n"
|
758
|
+
logger.success(msg)
|
759
|
+
out = parsed_output['display'].replace('Link', 'Detach', 1)
|
760
|
+
return out
|
761
|
+
|
639
762
|
|
640
763
|
except Exception as e:
|
641
764
|
logger.error(f"Error performing {command}: {e}")
|
@@ -644,9 +767,11 @@ def process_information_supply_chain_upsert_command(egeria_client: EgeriaTech, t
|
|
644
767
|
return None
|
645
768
|
|
646
769
|
|
770
|
+
|
647
771
|
@logger.catch
|
648
|
-
def
|
649
|
-
|
772
|
+
def process_information_supply_chain_upsert_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") \
|
773
|
+
-> \
|
774
|
+
Optional[str]:
|
650
775
|
"""
|
651
776
|
Processes a solution blueprint create or update object_action by extracting key attributes such as
|
652
777
|
blueprint name, description, and usage from the given text.
|
@@ -689,17 +814,16 @@ def process_information_supply_chain_segment_upsert_command(egeria_client: Egeri
|
|
689
814
|
is_own_anchor = attributes.get('Is Own Anchor', {}).get('value', True)
|
690
815
|
if parent_guid is None:
|
691
816
|
is_own_anchor = True
|
692
|
-
|
817
|
+
nested_supply_chain_guids = attributes.get('Nested Supply Chain', {}).get('guids', None)
|
693
818
|
additional_prop = attributes.get('Additional Properties', {}).get('value', None)
|
694
819
|
additional_properties = json.loads(additional_prop) if additional_prop is not None else None
|
695
820
|
extended_prop = attributes.get('Extended Properties', {}).get('value', None)
|
696
821
|
extended_properties = json.loads(extended_prop) if extended_prop is not None else None
|
697
822
|
|
698
823
|
scope = attributes.get('Scope', {}).get('value', None)
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
info_supply_chain_guid = attributes.get('Information Supply Chain', {}).get('guid', None)
|
824
|
+
purposes = attributes.get('Purposes', {}).get('value', None)
|
825
|
+
in_supply_chain_guids = attributes.get('In Information Supply Chain', {}).get('guid_list', None)
|
826
|
+
|
703
827
|
replace_all_props = not attributes.get('Merge Update', {}).get('value', True)
|
704
828
|
|
705
829
|
if directive == "display":
|
@@ -727,28 +851,31 @@ def process_information_supply_chain_segment_upsert_command(egeria_client: Egeri
|
|
727
851
|
f"==> Validation of {command} completed successfully! Proceeding to apply the changes.\n"))
|
728
852
|
|
729
853
|
body = body_slimmer({
|
730
|
-
"class": "
|
731
|
-
"externalSourceGUID": external_source_guid,
|
732
|
-
"
|
854
|
+
"class": "UpdateElementRequestBody",
|
855
|
+
"externalSourceGUID": external_source_guid,
|
856
|
+
"externalSourceName": external_source_name,
|
857
|
+
"effectiveTime": effective_time,
|
858
|
+
"forLineage": False,
|
859
|
+
"forDuplicateProcessing": False,
|
733
860
|
"properties": {
|
734
|
-
"class": "
|
861
|
+
"class": "InformationSupplyChainProperties", "effectiveFrom": effective_from,
|
735
862
|
"effectiveTo": effective_to, "extendedProperties": extended_properties,
|
736
863
|
"qualifiedName": qualified_name, "additionalProperties": additional_properties,
|
737
864
|
"displayName": display_name, "description": description, "scope": scope,
|
738
|
-
"
|
739
|
-
"version": version_identifier
|
865
|
+
"purposes": purposes, "version": version_identifier
|
740
866
|
}
|
741
867
|
})
|
742
868
|
|
743
|
-
egeria_client.
|
869
|
+
egeria_client.update_info_supply_chain(guid, body, replace_all_props)
|
870
|
+
|
871
|
+
sync_chain_related_elements(egeria_client, guid, in_supply_chain_guids, display_name, replace_all_props)
|
872
|
+
logger.success(f"==> Updated {object_type} `{display_name}` with GUID {guid}\n\n")
|
744
873
|
update_element_dictionary(qualified_name, {
|
745
874
|
'guid': guid, 'display_name': display_name
|
746
875
|
})
|
747
|
-
|
748
|
-
# sync_blueprint_related_elements(egeria_client,object_type, segment_guids, guid, qualified_name,
|
749
|
-
# display_name, replace_all_props)
|
876
|
+
|
750
877
|
# logger.success(f"===> Updated {object_type} `{display_name}` related elements\n\n")
|
751
|
-
return egeria_client.
|
878
|
+
return egeria_client.get_info_supply_chain_by_guid(guid, output_format='MD')
|
752
879
|
|
753
880
|
|
754
881
|
elif object_action == "Create":
|
@@ -765,29 +892,45 @@ def process_information_supply_chain_segment_upsert_command(egeria_client: Egeri
|
|
765
892
|
return
|
766
893
|
else:
|
767
894
|
body = {
|
768
|
-
"class": "
|
769
|
-
"externalSourceGUID": external_source_guid,
|
770
|
-
"
|
771
|
-
"
|
772
|
-
"
|
773
|
-
"
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
895
|
+
"class": "NewElementRequestBody",
|
896
|
+
"externalSourceGUID": external_source_guid,
|
897
|
+
"externalSourceName": external_source_name,
|
898
|
+
"forLineage": False,
|
899
|
+
"forDuplicateProcessing": False,
|
900
|
+
"effectiveTime": effective_time,
|
901
|
+
"anchorGUID": anchor_guid,
|
902
|
+
"isOwnAnchor": is_own_anchor,
|
903
|
+
"anchorScopeGUID": anchor_scope_guid,
|
904
|
+
"parentGUID": parent_guid,
|
905
|
+
"parentRelationshipTypeName": parent_relationship_type_name,
|
906
|
+
"parentAtEnd1": parent_at_end1,
|
907
|
+
"properties": {
|
908
|
+
"class": "InformationSupplyChainProperties",
|
909
|
+
"effectiveFrom": effective_from,
|
910
|
+
"effectiveTo": effective_to,
|
911
|
+
"extendedProperties": extended_properties,
|
912
|
+
"qualifiedName": qualified_name,
|
913
|
+
"additionalProperties": additional_properties,
|
914
|
+
"displayName": display_name,
|
915
|
+
"description": description,
|
916
|
+
"scope": scope,
|
917
|
+
"purposes": purposes,
|
779
918
|
"version": version_identifier
|
780
919
|
}
|
781
920
|
}
|
782
921
|
|
783
|
-
guid = egeria_client.
|
922
|
+
guid = egeria_client.create_info_supply_chain(body)
|
784
923
|
if guid:
|
785
924
|
update_element_dictionary(qualified_name, {
|
786
925
|
'guid': guid, 'display_name': display_name
|
787
926
|
})
|
927
|
+
if len(in_supply_chain_guids) > 0:
|
928
|
+
for nested_chain in in_supply_chain_guids:
|
929
|
+
egeria_client.compose_info_supply_chains(guid, nested_chain)
|
930
|
+
|
788
931
|
msg = f"==>Created Element `{display_name}` with GUID {guid}\n"
|
789
932
|
logger.success(msg)
|
790
|
-
return egeria_client.
|
933
|
+
return egeria_client.get_info_supply_chain_by_guid(guid, output_format='MD')
|
791
934
|
else:
|
792
935
|
msg = f"==>Failed to create element `{display_name}` with GUID {guid}\n"
|
793
936
|
logger.error(msg)
|
@@ -800,12 +943,12 @@ def process_information_supply_chain_segment_upsert_command(egeria_client: Egeri
|
|
800
943
|
return None
|
801
944
|
|
802
945
|
|
946
|
+
|
803
947
|
@logger.catch
|
804
948
|
def process_information_supply_chain_link_unlink_command(egeria_client: EgeriaTech, txt: str,
|
805
949
|
directive: str = "display") -> Optional[str]:
|
806
950
|
"""
|
807
|
-
Processes a
|
808
|
-
blueprint name, description, and usage from the given text.
|
951
|
+
Processes a link or unlink command to associate or break up peer supply chains..
|
809
952
|
|
810
953
|
:param txt: A string representing the input cell to be processed for
|
811
954
|
extracting blueprint-related attributes.
|
@@ -814,7 +957,7 @@ def process_information_supply_chain_link_unlink_command(egeria_client: EgeriaTe
|
|
814
957
|
"""
|
815
958
|
command, object_type, object_action = extract_command_plus(txt)
|
816
959
|
|
817
|
-
parsed_output =
|
960
|
+
parsed_output = parse_view_command(egeria_client, object_type, object_action, txt, directive)
|
818
961
|
|
819
962
|
print(Markdown(parsed_output['display']))
|
820
963
|
|
@@ -822,13 +965,14 @@ def process_information_supply_chain_link_unlink_command(egeria_client: EgeriaTe
|
|
822
965
|
|
823
966
|
attributes = parsed_output['attributes']
|
824
967
|
|
825
|
-
|
826
|
-
|
968
|
+
component1 = attributes.get('component1', {}).get('guid', None)
|
969
|
+
component2 = attributes.get('component2', {}).get('guid', None)
|
827
970
|
label = attributes.get('Link Label', {}).get('value', None)
|
828
971
|
description = attributes.get('Description', {}).get('value', None)
|
829
972
|
|
830
973
|
valid = parsed_output['valid']
|
831
|
-
exists =
|
974
|
+
exists = component1 is not None and component2 is not None
|
975
|
+
|
832
976
|
|
833
977
|
external_source_guid = attributes.get('External Source GUID', {}).get('value', None)
|
834
978
|
external_source_name = attributes.get('External Source Name', {}).get('value', None)
|
@@ -854,7 +998,7 @@ def process_information_supply_chain_link_unlink_command(egeria_client: EgeriaTe
|
|
854
998
|
|
855
999
|
elif directive == "process":
|
856
1000
|
try:
|
857
|
-
if object_action == "
|
1001
|
+
if object_action == "Unlink":
|
858
1002
|
if not exists:
|
859
1003
|
msg = (f" Link `{label}` does not exist! Updating result document with Link "
|
860
1004
|
f"object_action\n")
|
@@ -868,16 +1012,18 @@ def process_information_supply_chain_link_unlink_command(egeria_client: EgeriaTe
|
|
868
1012
|
f"==> Validation of {command} completed successfully! Proceeding to apply the changes.\n"))
|
869
1013
|
|
870
1014
|
body = body_slimmer({
|
871
|
-
"class": "MetadataSourceRequestBody",
|
872
|
-
"
|
873
|
-
"
|
874
|
-
|
1015
|
+
"class": "MetadataSourceRequestBody",
|
1016
|
+
"externalSourceGUID": external_source_guid,
|
1017
|
+
"externalSourceName": external_source_name,
|
1018
|
+
"effectiveTime": effective_time,
|
1019
|
+
"forLineage": False,
|
1020
|
+
"forDuplicateProcessing": False
|
875
1021
|
})
|
876
1022
|
|
877
|
-
egeria_client.
|
1023
|
+
egeria_client.unlink_peer_info_supply_chains(component1, component2, body)
|
878
1024
|
|
879
|
-
logger.success(f"===> Detached segment with {label} from `{
|
880
|
-
out = parsed_output['display'].replace('
|
1025
|
+
logger.success(f"===> Detached segment with {label} from `{component1}`to {component2}\n")
|
1026
|
+
out = parsed_output['display'].replace('Unlink', 'Link', 1)
|
881
1027
|
|
882
1028
|
return (out)
|
883
1029
|
|
@@ -894,14 +1040,20 @@ def process_information_supply_chain_link_unlink_command(egeria_client: EgeriaTe
|
|
894
1040
|
return
|
895
1041
|
else:
|
896
1042
|
body = {
|
897
|
-
"class": "
|
898
|
-
"
|
899
|
-
|
900
|
-
|
1043
|
+
"class": "RelationshipRequestBody",
|
1044
|
+
"effectiveTime": effective_time,
|
1045
|
+
"forLineage": False,
|
1046
|
+
"forDuplicateProcessing": False,
|
1047
|
+
"properties": {
|
1048
|
+
"class": "InformationSupplyChainLinkProperties",
|
1049
|
+
"label": label,
|
1050
|
+
"description": description,
|
1051
|
+
"effectiveFrom": effective_from,
|
1052
|
+
"effectiveTo": effective_to
|
901
1053
|
}
|
902
1054
|
}
|
903
1055
|
|
904
|
-
egeria_client.
|
1056
|
+
egeria_client.link_peer_info_supply_chain(component1, component2, body)
|
905
1057
|
msg = f"==>Created {object_type} link named `{label}`\n"
|
906
1058
|
logger.success(msg)
|
907
1059
|
out = parsed_output['display'].replace('Link', 'Detach', 1)
|
@@ -983,3 +1135,5 @@ def process_sol_arch_list_command(egeria_client: EgeriaTech, txt: str, kind:str,
|
|
983
1135
|
return None
|
984
1136
|
else:
|
985
1137
|
return None
|
1138
|
+
|
1139
|
+
|