pyegeria 5.4.7.6__py3-none-any.whl → 5.4.7.8__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.

Potentially problematic release.


This version of pyegeria might be problematic. Click here for more details.

@@ -204,7 +204,7 @@ class SolutionArchitect(Client2):
204
204
  "mermaid" : mermaid,
205
205
  }
206
206
 
207
-
207
+
208
208
  def _extract_supply_chain_list(self, element: Union[Dict,List[Dict]])->List[Dict]:
209
209
  """
210
210
  Normalize supply chain response for a list of dictionaries.
@@ -256,16 +256,20 @@ class SolutionArchitect(Client2):
256
256
  Returns:
257
257
  Dictionary with extracted properties
258
258
  """
259
- return populate_common_columns(
259
+ struct = populate_common_columns(
260
260
  element,
261
261
  columns_struct,
262
262
  include_header=True,
263
263
  include_relationships=True,
264
264
  include_subject_area=True,
265
265
  mermaid_source_key='mermaidGraph',
266
- mermaid_dest_key='mermaid'
266
+ mermaid_dest_key='mermaid',
267
267
  )
268
268
 
269
+ # solution blueprint
270
+
271
+ return struct
272
+
269
273
  def _extract_solution_roles_properties(self, element: dict, columns_struct: dict) -> dict:
270
274
  """
271
275
  Extract properties from a solution role element.
@@ -287,9 +291,6 @@ class SolutionArchitect(Client2):
287
291
  )
288
292
 
289
293
 
290
-
291
-
292
-
293
294
  def _get_component_rel_elements(self, guid:str)-> dict | str:
294
295
  elements = self.get_info_supply_chain_by_guid(guid)
295
296
  return self._get_supply_chain_rel_elements_dict(elements)
@@ -301,7 +302,7 @@ class SolutionArchitect(Client2):
301
302
  actor_guids = []
302
303
  actor_name_roles = []
303
304
  actor_qnames = []
304
-
305
+
305
306
  parent_guids = []
306
307
  parent_names = []
307
308
  parent_qnames = []
@@ -318,60 +319,92 @@ class SolutionArchitect(Client2):
318
319
  blueprint_names = []
319
320
  blueprint_qnames = []
320
321
 
321
-
322
- external_references_guids = []
323
- external_references_names = []
324
- external_references_qnames = []
325
-
326
- other_related_elements_guids = []
327
- other_related_elements_names = []
328
- other_related_elements_qnames = []
329
-
330
- owning_info_supply_chain_guids = []
331
- owning_info_supply_chain_qnames = []
332
- owning_info_supply_chain_names = []
322
+ supply_chain_guids = []
323
+ supply_chain_qnames = []
324
+ supply_chain_names = []
333
325
 
334
326
  wired_to_guids = []
335
327
  wired_to_names = []
336
328
  wired_to_link_labels = []
337
329
  wired_to_qnames = []
338
-
330
+
339
331
  wired_from_guids = []
340
332
  wired_from_names = []
341
333
  wired_from_link_labels = []
342
334
  wired_from_qnames = []
343
335
 
336
+ sub_component_guids = []
337
+ actor_guids = []
338
+ blueprint_guids = []
339
+ supply_chain_guids = []
340
+
341
+
342
+
343
+ sub_components = el_struct.get('nestedSolutionComponents', None)
344
+ if sub_components is not None:
345
+ for comp in sub_components:
346
+ guid = comp['relatedElement']['elementHeader'].get('guid', None)
347
+ sub_component_guids.append(guid)
348
+ sub_component_qnames.append(comp['relatedElement']['properties'].get("qualifiedName", ""))
349
+ sub_component_names.append(comp['relatedElement']['properties'].get('displayName', ""))
350
+
344
351
  actors = el_struct.get("actors", {})
345
352
  if actors:
346
353
  for actor in actors:
347
354
  actor_guids.append(actor['relatedElement']['elementHeader'].get("guid", None))
348
- actor_role = actor['relationshipProperties'].get('role',"")
355
+ actor_role = actor['relationshipProperties'].get('role',"")
349
356
  actor_name = actor['relatedElement']['properties'].get("displayName", "")
350
357
  actor_name_roles.append(f"`{actor_name}` in role `{actor_role}`")
351
358
  actor_qnames.append(actor['relatedElement']['properties'].get("qualifiedName", ""))
352
359
 
353
- wired_to = el_struct.get("wiredToLinks", {})
360
+ wired_to = el_struct.get("wiredTo", {})
354
361
  if wired_to:
355
362
  for wire in wired_to:
356
- wired_to_link_labels.append(wire['properties'].get("label", ""))
357
- wired_to_guids.append(wire['linkedElement']['elementHeader']['guid'])
358
- wired_to_qnames.append(wire['linkedElement']['properties'].get("qualifiedName", ""))
359
- wired_to_names.append(wire['linkedElement']['properties'].get('displayName', ""))
360
-
361
- wired_from = el_struct.get("wiredFromLinks", {})
362
- if wired_from:
363
- for wire in wired_from:
364
- wired_from_link_labels.append(wire['properties'].get("label", ""))
365
- wired_from_guids.append(wire['linkedElement']['elementHeader']['guid'])
366
- wired_from_qnames.append(wire['linkedElement']['properties'].get("qualifiedName", ""))
367
- wired_from_names.append(wire['linkedElement']['properties'].get('displayName', ""))
368
-
369
- blueprints = el_struct.get("blueprints", {})
370
- if blueprints:
371
- for bp in blueprints:
372
- blueprint_guids.append(bp['relatedElement']['elementHeader']['guid'])
373
- blueprint_qnames.append(bp['relatedElement']['properties'].get("qualifiedName", ""))
374
- blueprint_names.append(bp['relatedElement']['properties'].get('displayName', ""))
363
+ end_1 = wire['relatedElementAtEnd1']
364
+ if end_1:
365
+ wired_from_link_labels.append(wire['relationshipProperties'].get("label", ""))
366
+ wired_from_guids.append(wire['relatedElement']['elementHeader']['guid'])
367
+ wired_from_qnames.append(wire['relatedElement']['properties'].get("qualifiedName", ""))
368
+ wired_from_names.append(wire['relatedElement']['properties'].get('displayName', ""))
369
+ else:
370
+ wired_to_link_labels.append(wire['relationshipProperties'].get("label", ""))
371
+ wired_to_guids.append(wire['relatedElement']['elementHeader']['guid'])
372
+ wired_to_qnames.append(wire['relatedElement']['properties'].get("qualifiedName", ""))
373
+ wired_to_names.append(wire['relatedElement']['properties'].get('displayName', ""))
374
+
375
+
376
+ col_members = el_struct.get('memberOfCollections', None)
377
+ if col_members is not None:
378
+ for member in col_members:
379
+ guid = member['relatedElement'].get('guid', None)
380
+ member_props = member['relatedElement'].get('properties', None)
381
+ if member_props is not None:
382
+ if member_props.get('typeName', None) == 'SolutionBlueprint':
383
+ blueprint_guids.append(guid)
384
+ blueprint_names.append(member_props.get('displayName',""))
385
+ blueprint_qnames.append(member_props.get('qualifiedName', ""))
386
+
387
+ elif member_props.get('class', None) == 'InformationSupplyChain':
388
+ supply_chain_guids.append(guid)
389
+ supply_chain_names.append(member_props.get('displayName',""))
390
+ supply_chain_qnames.append(member_props.get('qualifiedName', ""))
391
+
392
+ isc = el_struct.get('derivedFrom', None)
393
+ if isc is not None:
394
+ for member in isc:
395
+ supply_chain_guids.append(member['relatedElement']['elementHeader'].get("guid", None))
396
+ member_props = member['relatedElement'].get('properties', None)
397
+ supply_chain_names.append(member_props.get('displayName', ""))
398
+ supply_chain_qnames.append(member_props.get('qualifiedName', ""))
399
+
400
+
401
+ parent_components = el_struct.get('usedInSolutionComponents', None)
402
+ if parent_components is not None:
403
+ for comp in parent_components:
404
+ guid = comp['relatedElement']['elementHeader'].get('guid', None)
405
+ parent_guids.append(guid)
406
+ parent_qnames.append(comp['relatedElement']['properties'].get("qualifiedName", ""))
407
+ parent_names.append(comp['relatedElement']['properties'].get('displayName', ""))
375
408
 
376
409
  sub_components = el_struct.get("subComponents", {})
377
410
  if sub_components:
@@ -380,39 +413,12 @@ class SolutionArchitect(Client2):
380
413
  sub_component_qnames.append(sub_component['properties'].get("qualifiedName", ""))
381
414
  sub_component_names.append(sub_component['properties'].get('displayName', ""))
382
415
 
383
- context = el_struct.get("context", None)
384
- if context:
385
- for c in context:
386
-
387
- parents = c.get("parentComponents", None) if context else None
388
- if parents:
389
- for parent in parents:
390
- parent_guids.append(parent['relatedElement']['elementHeader']["guid"])
391
- parent_names.append(parent['relatedElement']['properties'].get("displayName",""))
392
- parent_qnames.append(parent['relatedElement']['properties'].get("qualifiedName",""))
393
-
394
- owning_isc = c.get("owningInformationSupplyChains", None) if context else None
395
- if owning_isc:
396
- for isc in owning_isc:
397
- owning_info_supply_chain_guids.append(isc['relatedElement']['elementHeader']["guid"])
398
- owning_info_supply_chain_names.append(isc['relatedElement']['properties'].get("displayName", ""))
399
- owning_info_supply_chain_qnames.append(isc['relatedElement']['properties'].get("qualifiedName", ""))
400
-
401
-
402
-
403
- # implemented_by = el_struct.get("implementedByList", {})
404
- # if len(implemented_by) > 0:
405
- # for peer in peer_supply_chains:
406
- # implemented_by_guids.append(peer['relatedElement']['elementHeader']['guid'])
407
- # implemented_by_names.append(peer['relatedElement']['properties'].get("displayName", ""))
408
- # implemented_by_qnames.append(peer['relatedElement']['properties'].get("qualifiedName", ""))
409
-
410
416
 
411
417
  mermaid = el_struct.get("mermaidGraph", {})
412
418
 
413
- return {"parent_guids": parent_guids,
414
- "parent_names": parent_names,
415
- "parent_qnames": parent_qnames,
419
+ return {"in_components_guids": parent_guids,
420
+ "in_components_names": parent_names,
421
+ "in_components": parent_qnames,
416
422
 
417
423
  "actor_guids": actor_guids,
418
424
  "actor_name_roles": actor_name_roles,
@@ -422,13 +428,9 @@ class SolutionArchitect(Client2):
422
428
  "sub_component_names": sub_component_names,
423
429
  "sub_component_qnames": sub_component_qnames,
424
430
 
425
- "blueprint_guids": blueprint_guids,
426
- "blueprint_names": blueprint_names,
427
- "blueprint_qnames": blueprint_qnames,
428
-
429
- "owning_info_supply_chain_guids": owning_info_supply_chain_guids,
430
- "owning_info_supply_chain_names": owning_info_supply_chain_names,
431
- "owning_info_supply_chain_qnames": owning_info_supply_chain_qnames,
431
+ "solution_blueprint_guids": blueprint_guids,
432
+ "solution_blueprint_names": blueprint_names,
433
+ "solution_blueprints": blueprint_qnames,
432
434
 
433
435
  "implemented_by_guids": implemented_by_guids,
434
436
  "implemented_by_names": implemented_by_names,
@@ -444,32 +446,32 @@ class SolutionArchitect(Client2):
444
446
  "wired_to_qnames": wired_to_qnames,
445
447
  "wired_to_link_labels": wired_to_link_labels,
446
448
 
447
- "external_references_guids": external_references_guids,
448
- "external_references_names": external_references_names,
449
- "external_references_qnames": external_references_qnames,
449
+ "in_supply_chain_guids": supply_chain_guids,
450
+ "in_supply_chain_names": supply_chain_names,
451
+ "in_supply_chains": supply_chain_qnames,
450
452
 
451
453
  "mermaid" : mermaid,
452
454
  }
453
-
454
- def _extract_component_list(self, element: Union[Dict,List[Dict]])->List[Dict]:
455
- """
456
- Normalize for a list of dictionaries.
457
- Args:
458
- element: Dict or List
459
-
460
- Returns:
461
- list of Dict
462
-
463
- """
464
- if isinstance(element, dict):
465
- return [self._extract_solution_components_properties(element)]
466
- elif isinstance(element, list):
467
- comp_list = []
468
- for i in range(len(element)):
469
- comp_list.append( self._extract_solution_components_properties(element[i]))
470
- return comp_list
471
- else:
472
- return []
455
+ #
456
+ # def _extract_component_list(self, element: Union[Dict,List[Dict]])->List[Dict]:
457
+ # """
458
+ # Normalize for a list of dictionaries.
459
+ # Args:
460
+ # element: Dict or List
461
+ #
462
+ # Returns:
463
+ # list of Dict
464
+ #
465
+ # """
466
+ # if isinstance(element, dict):
467
+ # return [self._extract_solution_components_properties(element)]
468
+ # elif isinstance(element, list):
469
+ # comp_list = []
470
+ # for i in range(len(element)):
471
+ # comp_list.append( self._extract_solution_components_properties(element[i]))
472
+ # return comp_list
473
+ # else:
474
+ # return []
473
475
 
474
476
  def _extract_solution_components_properties(self, element: Union[Dict,List[Dict]], columns_struct: dict) -> dict:
475
477
  """
@@ -482,7 +484,8 @@ class SolutionArchitect(Client2):
482
484
  Dictionary with extracted properties
483
485
  """
484
486
 
485
- return populate_common_columns(
487
+ # Start with common columns (header, relationships, subject area, and mermaid where applicable)
488
+ col_data = populate_common_columns(
486
489
  element,
487
490
  columns_struct,
488
491
  include_header=True,
@@ -492,6 +495,38 @@ class SolutionArchitect(Client2):
492
495
  mermaid_dest_key='mermaid'
493
496
  )
494
497
 
498
+ # Build a dictionary of relationship-derived values for this component
499
+ rel_dict = self._get_component_rel_elements_dict(element)
500
+
501
+ # If we have a columns structure, populate any matching keys from rel_dict.
502
+ # We only set a column's value if it is currently empty (None or "").
503
+ try:
504
+ formats = col_data.get('formats') if isinstance(col_data, dict) else None
505
+ columns = formats.get('columns') if isinstance(formats, dict) else None
506
+ if isinstance(columns, list) and isinstance(rel_dict, dict):
507
+ for col in columns:
508
+ if not isinstance(col, dict):
509
+ continue
510
+ key = col.get('key')
511
+ if not key:
512
+ continue
513
+ # Skip if already has a value
514
+ if col.get('value') not in (None, ""):
515
+ continue
516
+ if key in rel_dict:
517
+ val = rel_dict.get(key)
518
+ # Join lists to a readable string; stringify primitives
519
+ if isinstance(val, list):
520
+ col['value'] = ", ".join([str(v) for v in val])
521
+ elif val is None:
522
+ col['value'] = ""
523
+ else:
524
+ col['value'] = str(val)
525
+ except Exception as e:
526
+ # Keep extraction resilient; log at debug level and proceed with existing col_data
527
+ logger.debug(f"_extract_solution_components_properties: error applying rel_dict values: {e}")
528
+
529
+ return col_data
495
530
  #
496
531
  # Markdown output support
497
532
  #
@@ -609,8 +644,8 @@ class SolutionArchitect(Client2):
609
644
  Generate output for solution components in the specified format.
610
645
 
611
646
  Given a set of elements representing solution components (either as a list or a dictionary),
612
- this function generates output in the specified format. The output includes various
613
- attributes of the solution components, such as their names, descriptions, types, and
647
+ this function generates output in the specified format. The output includes various
648
+ attributes of the solution components, such as their names, descriptions, types, and
614
649
  related information like blueprints, parents, and extended properties.
615
650
 
616
651
  Args:
@@ -2912,7 +2947,7 @@ class SolutionArchitect(Client2):
2912
2947
  starts_with: bool = True, ends_with: bool = False,
2913
2948
  ignore_case: bool = False, start_from: int = 0,
2914
2949
  page_size: int = 0, output_format: str = 'JSON',
2915
- output_format_set: str = None,
2950
+ output_format_set: str = "Solution-Blueprint",
2916
2951
  body: dict| SearchStringRequestBody = None) -> list[dict] | str:
2917
2952
  """Retrieve the solution blueprint elements that contain the search string.
2918
2953
  https://egeria-project.org/concepts/solution-blueprint
@@ -3068,7 +3103,8 @@ class SolutionArchitect(Client2):
3068
3103
 
3069
3104
 
3070
3105
  async def _async_get_solution_blueprint_by_guid(self, guid: str, body: dict = None,
3071
- output_format: str = "JSON") -> dict | str:
3106
+ output_format: str = "JSON",
3107
+ output_format_set: str| Dict = "Solution-Blueprint") -> dict | str:
3072
3108
  """Return the properties of a specific solution blueprint. Async Version.
3073
3109
 
3074
3110
  Parameters
@@ -3084,6 +3120,8 @@ class SolutionArchitect(Client2):
3084
3120
  FORM - output markdown with a preamble for a form
3085
3121
  REPORT - output markdown with a preamble for a report
3086
3122
  MERMAID - output mermaid markdown
3123
+ output_format_set: str|Dict, optional
3124
+ Structure of content to return.
3087
3125
 
3088
3126
  Returns
3089
3127
  -------
@@ -3122,10 +3160,12 @@ class SolutionArchitect(Client2):
3122
3160
  if element == NO_ELEMENTS_FOUND:
3123
3161
  return NO_ELEMENTS_FOUND
3124
3162
  if output_format != 'JSON': # return a simplified markdown representation
3125
- return self.generate_solution_blueprint_output(element, None, output_format)
3163
+ return self.generate_solution_blueprint_output(element, guid, "SolutionBlueprint",
3164
+ output_format, output_format_set=output_format_set)
3126
3165
  return response.json().get("element", NO_ELEMENTS_FOUND)
3127
3166
 
3128
- def get_solution_blueprint_by_guid(self, guid: str, body: dict = None, output_format: str = "JSON") -> dict | str:
3167
+ def get_solution_blueprint_by_guid(self, guid: str, body: dict = None, output_format: str = "JSON",
3168
+ output_format_set: str| Dict = "Solution-Blueprint") -> dict | str:
3129
3169
  """ Return the properties of a specific solution blueprint.
3130
3170
 
3131
3171
  Parameters
@@ -3141,6 +3181,8 @@ class SolutionArchitect(Client2):
3141
3181
  FORM - output markdown with a preamble for a form
3142
3182
  REPORT - output markdown with a preamble for a report
3143
3183
  MERMAID - output mermaid markdown
3184
+ output_format_set: str|Dict, optional
3185
+ Structure of content to return.
3144
3186
 
3145
3187
  Returns
3146
3188
  -------
@@ -3168,12 +3210,13 @@ class SolutionArchitect(Client2):
3168
3210
 
3169
3211
  """
3170
3212
  loop = asyncio.get_event_loop()
3171
- response = loop.run_until_complete(self._async_get_solution_blueprint_by_guid(guid, body, output_format))
3213
+ response = loop.run_until_complete(self._async_get_solution_blueprint_by_guid(guid, body,
3214
+ output_format, output_format_set))
3172
3215
  return response
3173
3216
 
3174
3217
  async def _async_get_solution_blueprints_by_name(self, search_filter: str, body: dict = None, start_from: int = 0,
3175
3218
  page_size: int = max_paging_size,
3176
- output_format: str = "JSON") -> dict | str:
3219
+ output_format: str = "JSON", output_format_set: str| Dict = "Solution-Blueprint") -> dict | str:
3177
3220
  """ Returns the list of solution blueprints with a particular name. Async Version.
3178
3221
 
3179
3222
  Parameters
@@ -3189,6 +3232,8 @@ class SolutionArchitect(Client2):
3189
3232
  FORM - output markdown with a preamble for a form
3190
3233
  REPORT - output markdown with a preamble for a report
3191
3234
  MERMAID - output mermaid markdown
3235
+ output_format_set: str|Dict, optional
3236
+ Structure of content to return.
3192
3237
 
3193
3238
  Returns
3194
3239
  -------
@@ -3221,8 +3266,6 @@ class SolutionArchitect(Client2):
3221
3266
 
3222
3267
  """
3223
3268
 
3224
- possible_query_params = query_string([("startFrom", start_from), ("pageSize", page_size)])
3225
-
3226
3269
  if body is None:
3227
3270
  body = {
3228
3271
  "filter": search_filter,
@@ -3230,18 +3273,19 @@ class SolutionArchitect(Client2):
3230
3273
  else:
3231
3274
  body["filter"] = search_filter
3232
3275
 
3233
- url = (f"{self.solution_architect_command_root}/solution-blueprints/by-name"
3234
- f"{possible_query_params}")
3276
+ url = f"{self.solution_architect_command_root}/solution-blueprints/by-name"
3277
+
3235
3278
  response: Response = await self._async_make_request("POST", url, body_slimmer(body))
3236
3279
  element = response.json().get("elements", NO_ELEMENTS_FOUND)
3237
3280
  if element == NO_ELEMENTS_FOUND:
3238
3281
  return NO_ELEMENTS_FOUND
3239
3282
  if output_format != 'JSON': # return a simplified markdown representation
3240
- return self.generate_solution_blueprint_output(element, search_filter, output_format)
3283
+ return self.generate_solution_blueprint_output(element, search_filter, output_format, output_format_set=output_format_set)
3241
3284
  return response.json().get("elements", NO_ELEMENTS_FOUND)
3242
3285
 
3243
3286
  def get_solution_blueprints_by_name(self, search_filter: str, body: dict = None, start_from: int = 0,
3244
- page_size: int = max_paging_size, output_format: str = "JSON") -> dict | str:
3287
+ page_size: int = max_paging_size, output_format: str = "JSON",
3288
+ output_format_set: str| Dict = "Solution-Blueprint") -> dict | str:
3245
3289
  """ Returns the list of solution blueprints with a particular name.
3246
3290
 
3247
3291
  Parameters
@@ -3262,6 +3306,8 @@ class SolutionArchitect(Client2):
3262
3306
  FORM - output markdown with a preamble for a form
3263
3307
  REPORT - output markdown with a preamble for a report
3264
3308
  MERMAID - output mermaid markdown
3309
+ output_format_set: str|Dict, optional
3310
+ Structure of content to return.
3265
3311
 
3266
3312
  Returns
3267
3313
  -------
@@ -3295,7 +3341,7 @@ class SolutionArchitect(Client2):
3295
3341
  """
3296
3342
  loop = asyncio.get_event_loop()
3297
3343
  response = loop.run_until_complete(
3298
- self._async_get_solution_blueprints_by_name(search_filter, body, start_from, page_size, output_format))
3344
+ self._async_get_solution_blueprints_by_name(search_filter, body, start_from, page_size, output_format, output_format_set))
3299
3345
  return response
3300
3346
 
3301
3347
 
@@ -3982,7 +4028,7 @@ class SolutionArchitect(Client2):
3982
4028
 
3983
4029
  url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/solution-architect/"
3984
4030
  f"solution-components/{component1_guid}/wired-to/{component2_guid}/attach")
3985
- await self._async_new_relationship_request(url, ["SolutionLinkingWireProperties"], body)
4031
+ await self._async_new_relationship_request(url, "SolutionLinkingWireProperties", body)
3986
4032
  logger.info(f"Linked Solution Linking wires between {component1_guid} -> {component2_guid}")
3987
4033
 
3988
4034
  @dynamic_catch
@@ -4283,8 +4329,8 @@ class SolutionArchitect(Client2):
4283
4329
 
4284
4330
  url = f"{self.solution_architect_command_root}/solution-components/by-search-string"
4285
4331
 
4286
- return await self._async_find_request(url, _type="GovernanceDefinition",
4287
- _gen_output=self.generate_info_supply_chain_output,
4332
+ return await self._async_find_request(url, _type="SolutionComponent",
4333
+ _gen_output=self.generate_solution_components_output,
4288
4334
  search_string=search_string, classification_names=classification_names,
4289
4335
  metadata_element_types=metadata_element_types,
4290
4336
  starts_with=starts_with, ends_with=ends_with, ignore_case=ignore_case,
@@ -4371,6 +4417,7 @@ class SolutionArchitect(Client2):
4371
4417
  """
4372
4418
  return self.find_solution_components("*", classification_names, metadata_element_types, starts_with, ends_with, ignore_case, start_from, page_size, output_format, output_format_set, body)
4373
4419
 
4420
+
4374
4421
  async def _async_get_solution_components_by_name(self, search_filter: str, body: dict = None, start_from: int = 0,
4375
4422
  page_size: int = 0, output_format: str = "JSON") -> dict | str:
4376
4423
  """ Returns the list of solution components with a particular name. Async Version.
@@ -4496,7 +4543,7 @@ class SolutionArchitect(Client2):
4496
4543
  return response
4497
4544
 
4498
4545
  async def _async_get_solution_component_by_guid(self, guid: str, body: dict = None,
4499
- output_format: str = "JSON") -> dict | str:
4546
+ output_format: str = "JSON", output_format_set: str = "Solution-Component-DrE") -> dict | str:
4500
4547
  """ Return the properties of a specific solution component. Async Version.
4501
4548
 
4502
4549
  Parameters
@@ -4512,6 +4559,8 @@ class SolutionArchitect(Client2):
4512
4559
  FORM - output markdown with a preamble for a form
4513
4560
  REPORT - output markdown with a preamble for a report
4514
4561
  MERMAID - output mermaid markdown
4562
+ output_format_set: str, default = "Solution-Component-DrE"
4563
+ Structure of output to produce:
4515
4564
 
4516
4565
  Returns
4517
4566
  -------
@@ -4541,17 +4590,21 @@ class SolutionArchitect(Client2):
4541
4590
  validate_guid(guid)
4542
4591
  url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/solution-architect/"
4543
4592
  f"solution-components/{guid}/retrieve")
4593
+ response = await self._async_get_guid_request(url, 'SolutionComponent',
4594
+ self.generate_solution_components_output,
4595
+ output_format, output_format_set, body)
4596
+ return response
4544
4597
 
4545
- if body is None:
4546
- response = await self._async_make_request("POST", url)
4547
- else:
4548
- response = await self._async_make_request("POST", url, body_slimmer(body))
4549
- element = response.json().get("element", NO_ELEMENTS_FOUND)
4550
- if element == NO_ELEMENTS_FOUND:
4551
- return NO_ELEMENTS_FOUND
4552
- if output_format != 'JSON': # return a simplified markdown representation
4553
- return self.generate_solution_components_output(element, None, output_format)
4554
- return response.json().get("element", NO_ELEMENTS_FOUND)
4598
+ # if body is None:
4599
+ # response = await self._async_make_request("POST", url)
4600
+ # else:
4601
+ # response = await self._async_make_request("POST", url, body_slimmer(body))
4602
+ # element = response.json().get("element", NO_ELEMENTS_FOUND)
4603
+ # if element == NO_ELEMENTS_FOUND:
4604
+ # return NO_ELEMENTS_FOUND
4605
+ # if output_format != 'JSON': # return a simplified markdown representation
4606
+ # return self.generate_solution_components_output(element, None, output_format)
4607
+ # return response.json().get("element", NO_ELEMENTS_FOUND)
4555
4608
 
4556
4609
  def get_solution_component_by_guid(self, guid: str, body: dict = None, output_format: str = "JSON") -> dict | str:
4557
4610
  """ Return the properties of a specific solution component.
@@ -4614,29 +4667,37 @@ class SolutionArchitect(Client2):
4614
4667
  supply_chain_guids = []
4615
4668
  parent_component_guids = []
4616
4669
 
4670
+ col_members = response.get('memberOfCollection', None)
4671
+ if col_members is not None:
4672
+ for member in col_members:
4673
+ guid = member['relatedElement'].get('guid', None)
4674
+ member_props = member['relatedElement'].get('properties', None)
4675
+ if member_props is not None:
4676
+ if member_props.get('typeName', None) == 'SolutionBlueprint':
4677
+ blueprint_guids.append(guid)
4678
+ elif member_props.get('class', None) == 'InformationSupplyChain':
4679
+ supply_chain_guids.append(guid)
4680
+
4681
+ sub_components = response.get('nestedSolutionComponents', None)
4682
+ if sub_components is not None:
4683
+ for comp in sub_components:
4684
+ guid = comp['relatedElement']['elementHeader'].get('guid', None)
4685
+ sub_component_guids.append(guid)
4686
+
4617
4687
  sub_components = response.get("subComponents",{})
4618
4688
  for sub_component in sub_components:
4619
4689
  sub_component_guids.append(sub_component["elementHeader"]["guid"])
4620
4690
 
4691
+ parent_components = response.get('usedInSolutionComponents', None)
4692
+ if parent_components is not None:
4693
+ for comp in parent_components:
4694
+ guid = comp['relatedElement']['elementHeader'].get('guid', None)
4695
+ parent_component_guids.append(guid)
4696
+
4621
4697
  actors = response.get("actors",{})
4622
4698
  for actor in actors:
4623
4699
  actor_guids.append(actor["elementHeader"]["guid"])
4624
4700
 
4625
- blueprints = response.get("blueprints",{})
4626
- for blueprint in blueprints:
4627
- blueprint_guids.append(blueprint["relatedElement"]['elementHeader']["guid"])
4628
-
4629
- context = response.get("context",[])
4630
- for c in context:
4631
- supply_chains = c.get("owningInformationSupplyChains", [])
4632
- if supply_chains:
4633
- for chain in supply_chains:
4634
- supply_chain_guids.append(chain['relatedElement']["elementHeader"]["guid"])
4635
-
4636
- parent_components = c.get("parentComponents",[])
4637
- if parent_components:
4638
- for parent_component in parent_components:
4639
- parent_component_guids.append(parent_component["elementHeader"]["guid"])
4640
4701
 
4641
4702
  return {
4642
4703
  "sub_component_guids": sub_component_guids,
@@ -5532,7 +5593,7 @@ class SolutionArchitect(Client2):
5532
5593
  Notes
5533
5594
  -----
5534
5595
  Sample body:
5535
-
5596
+
5536
5597
  {
5537
5598
  "class": "FilterRequestBody",
5538
5599
  "asOfTime": "{{$isoTimestamp}}",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyegeria
3
- Version: 5.4.7.6
3
+ Version: 5.4.7.8
4
4
  Summary: A python client for Egeria
5
5
  Author-email: Dan Wolfson <dan.wolfson@pdr-associates.com>
6
6
  License-Expression: Apache-2.0