pyegeria 5.4.4.2__py3-none-any.whl → 5.4.4.4__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/list_format_set.py +6 -2
- md_processing/.obsidian/plugins/obsidian-sample-plugin/.git/index +0 -0
- md_processing/__init__.py +1 -1
- md_processing/dr_egeria.py +5 -0
- md_processing/md_commands/data_designer_commands.py +17 -11
- md_processing/md_commands/ext_ref_commands.py +9 -6
- md_processing/md_commands/glossary_commands.py +6 -2
- md_processing/md_commands/governance_officer_commands.py +122 -13
- md_processing/md_commands/product_manager_commands.py +10 -6
- md_processing/md_commands/project_commands.py +5 -2
- md_processing/md_processing_utils/md_processing_constants.py +4 -2
- pyegeria/__init__.py +1 -1
- pyegeria/_client_new.py +471 -44
- pyegeria/_output_formats.py +1384 -143
- pyegeria/classification_manager_omvs.py +4 -4
- pyegeria/collection_manager.py +2 -2
- pyegeria/external_references.py +100 -209
- pyegeria/glossary_manager.py +3 -89
- pyegeria/governance_officer.py +194 -95
- pyegeria/output_formatter.py +4 -0
- pyegeria/project_manager.py +1 -0
- pyegeria/solution_architect.py +0 -90
- pyegeria/utils.py +5 -64
- {pyegeria-5.4.4.2.dist-info → pyegeria-5.4.4.4.dist-info}/METADATA +1 -1
- {pyegeria-5.4.4.2.dist-info → pyegeria-5.4.4.4.dist-info}/RECORD +28 -31
- commands/cat/debug_log.2025-09-10_13-48-37_153090.log.zip +0 -0
- md_processing/dr-egeria-outbox/Business-Imperative-DrE-2025-09-11-21-21-15.md +0 -33
- md_processing/md_commands/old_solution_architect_commands.py +0 -1139
- {pyegeria-5.4.4.2.dist-info → pyegeria-5.4.4.4.dist-info}/LICENSE +0 -0
- {pyegeria-5.4.4.2.dist-info → pyegeria-5.4.4.4.dist-info}/WHEEL +0 -0
- {pyegeria-5.4.4.2.dist-info → pyegeria-5.4.4.4.dist-info}/entry_points.txt +0 -0
pyegeria/glossary_manager.py
CHANGED
@@ -87,15 +87,17 @@ class GlossaryManager(CollectionManager):
|
|
87
87
|
user_pwd: str = None,
|
88
88
|
token: str = None,
|
89
89
|
):
|
90
|
-
self.gl_mgr_command_root: str
|
91
90
|
self.view_server = view_server
|
92
91
|
self.platform_url = platform_url
|
93
92
|
self.user_id = user_id
|
94
93
|
self.user_pwd = user_pwd
|
94
|
+
self.url_marker = "glossary-manager"
|
95
|
+
|
95
96
|
|
96
97
|
CollectionManager.__init__(self, view_server, platform_url, user_id, user_pwd, token)
|
97
98
|
result = self.get_platform_origin()
|
98
99
|
logger.info(f"GlossaryManager initialized, platform origin is: {result}")
|
100
|
+
self.glossary_command_root = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager"
|
99
101
|
#
|
100
102
|
# Get Valid Values for Enumerations
|
101
103
|
#
|
@@ -990,94 +992,6 @@ class GlossaryManager(CollectionManager):
|
|
990
992
|
|
991
993
|
|
992
994
|
@dynamic_catch
|
993
|
-
async def _async_update_term_status(self, term_guid: str, status: str = None,
|
994
|
-
body: dict | UpdateStatusRequestBody = None):
|
995
|
-
"""Update the status of a collection. Async version.
|
996
|
-
|
997
|
-
Parameters
|
998
|
-
----------
|
999
|
-
collection_guid: str
|
1000
|
-
The guid of the collection to update.
|
1001
|
-
status: str, optional
|
1002
|
-
The new lifecycle status for the collection. Ignored, if the body is provided.
|
1003
|
-
body: dict | UpdateStatusRequestBody, optional
|
1004
|
-
A structure representing the details of the collection to create. If supplied, these details
|
1005
|
-
supersede the status parameter provided.
|
1006
|
-
|
1007
|
-
Returns
|
1008
|
-
-------
|
1009
|
-
Nothing
|
1010
|
-
|
1011
|
-
Raises
|
1012
|
-
------
|
1013
|
-
InvalidParameterException
|
1014
|
-
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1015
|
-
PropertyServerException
|
1016
|
-
Raised by the server when an issue arises in processing a valid request
|
1017
|
-
NotAuthorizedException
|
1018
|
-
The principle specified by the user_id does not have authorization for the requested action
|
1019
|
-
|
1020
|
-
Notes
|
1021
|
-
-----
|
1022
|
-
JSON Structure looks like:
|
1023
|
-
{
|
1024
|
-
"class": "UpdateStatusRequestBody",
|
1025
|
-
"status": "APPROVED",
|
1026
|
-
"externalSourceGUID": "add guid here",
|
1027
|
-
"externalSourceName": "add qualified name here",
|
1028
|
-
"effectiveTime": "{{$isoTimestamp}}",
|
1029
|
-
"forLineage": false,
|
1030
|
-
"forDuplicateProcessing": false
|
1031
|
-
}
|
1032
|
-
"""
|
1033
|
-
|
1034
|
-
url = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/metadata-elements/{term_guid}/update-status"
|
1035
|
-
await self._async_update_status_request(url, status, body)
|
1036
|
-
logger.info(f"Updated status for term {term_guid}")
|
1037
|
-
|
1038
|
-
@dynamic_catch
|
1039
|
-
def update_term_status(self, term_guid: str, status: str = None,
|
1040
|
-
body: dict | UpdateStatusRequestBody = None):
|
1041
|
-
"""Update the status of a DigitalProduct collection.
|
1042
|
-
|
1043
|
-
Parameters
|
1044
|
-
----------
|
1045
|
-
collection_guid: str
|
1046
|
-
The guid of the collection to update.
|
1047
|
-
status: str, optional
|
1048
|
-
The new lifecycle status for the digital product. Ignored, if the body is provided.
|
1049
|
-
body: dict | UpdateStatusRequestBody, optional
|
1050
|
-
A structure representing the details of the collection to create. If supplied, these details
|
1051
|
-
supersede the status parameter provided.
|
1052
|
-
|
1053
|
-
Returns
|
1054
|
-
-------
|
1055
|
-
Nothing
|
1056
|
-
|
1057
|
-
Raises
|
1058
|
-
------
|
1059
|
-
InvalidParameterException
|
1060
|
-
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1061
|
-
PropertyServerException
|
1062
|
-
Raised by the server when an issue arises in processing a valid request
|
1063
|
-
NotAuthorizedException
|
1064
|
-
The principle specified by the user_id does not have authorization for the requested action
|
1065
|
-
|
1066
|
-
Notes
|
1067
|
-
-----
|
1068
|
-
JSON Structure looks like:
|
1069
|
-
{
|
1070
|
-
"class": "UpdateStatusRequestBody",
|
1071
|
-
"status": "APPROVED",
|
1072
|
-
"externalSourceGUID": "add guid here",
|
1073
|
-
"externalSourceName": "add qualified name here",
|
1074
|
-
"effectiveTime": "{{$isoTimestamp}}",
|
1075
|
-
"forLineage": false,
|
1076
|
-
"forDuplicateProcessing": false
|
1077
|
-
}
|
1078
|
-
"""
|
1079
|
-
loop = asyncio.get_event_loop()
|
1080
|
-
loop.run_until_complete(self._async_update_collection_status(term_guid, status, body))
|
1081
995
|
|
1082
996
|
|
1083
997
|
async def _async_delete_term(
|
pyegeria/governance_officer.py
CHANGED
@@ -849,99 +849,6 @@ class GovernanceOfficer(Client2):
|
|
849
849
|
loop = asyncio.get_event_loop()
|
850
850
|
loop.run_until_complete(self._async_update_governance_definition(guid, body))
|
851
851
|
|
852
|
-
@dynamic_catch
|
853
|
-
async def _async_update_governance_definition_status(self, guid: str, status: str = None,
|
854
|
-
body: dict | UpdateStatusRequestBody = None) -> None:
|
855
|
-
""" Update the status of a governance definition. Async Version.
|
856
|
-
|
857
|
-
Parameters
|
858
|
-
----------
|
859
|
-
guid: str
|
860
|
-
guid of the governance definition to update.
|
861
|
-
status: str, optional, default is None
|
862
|
-
The status to update the governance definition to. Superseded by the body definition if present.
|
863
|
-
body: dict
|
864
|
-
A dictionary containing the updates to the governance definition.
|
865
|
-
|
866
|
-
Returns
|
867
|
-
-------
|
868
|
-
|
869
|
-
None
|
870
|
-
|
871
|
-
Raises
|
872
|
-
------
|
873
|
-
InvalidParameterException
|
874
|
-
one of the parameters is null or invalid or
|
875
|
-
PropertyServerException
|
876
|
-
There is a problem adding the element properties to the metadata repository or
|
877
|
-
UserNotAuthorizedException
|
878
|
-
the requesting user is not authorized to issue this request.
|
879
|
-
|
880
|
-
Notes
|
881
|
-
----
|
882
|
-
|
883
|
-
Body structure:
|
884
|
-
{
|
885
|
-
"class": "UpdateGovernanceDefinitionRequestBody",
|
886
|
-
"externalSourceGUID": "add guid here",
|
887
|
-
"externalSourceName": "add qualified name here",
|
888
|
-
"effectiveTime": "{{$isoTimestamp}}",
|
889
|
-
"forLineage": false,
|
890
|
-
"forDuplicateProcessing": false,
|
891
|
-
"status": "ACTIVE"
|
892
|
-
}
|
893
|
-
"""
|
894
|
-
|
895
|
-
url = (
|
896
|
-
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/{self.url_marker}/governance-defnitions/"
|
897
|
-
f"{guid}/update-status")
|
898
|
-
|
899
|
-
# await self._async_update_status_request(url, status, body)
|
900
|
-
|
901
|
-
def update_governance_definition_status(self, guid: str, status: str = None,
|
902
|
-
body: dict | UpdateStatusRequestBody = None) -> None:
|
903
|
-
""" Update the status of a governance definition.
|
904
|
-
|
905
|
-
Parameters
|
906
|
-
----------
|
907
|
-
guid: str
|
908
|
-
guid of the information governance definition to update.
|
909
|
-
status: str, optional, default is None
|
910
|
-
The status to update the governance definition to. Superseded by the body definition if present.
|
911
|
-
body: dict
|
912
|
-
A dictionary containing the updates to the governance definition.
|
913
|
-
|
914
|
-
Returns
|
915
|
-
-------
|
916
|
-
|
917
|
-
None
|
918
|
-
|
919
|
-
Raises
|
920
|
-
------
|
921
|
-
InvalidParameterException
|
922
|
-
one of the parameters is null or invalid or
|
923
|
-
PropertyServerException
|
924
|
-
There is a problem adding the element properties to the metadata repository or
|
925
|
-
UserNotAuthorizedException
|
926
|
-
the requesting user is not authorized to issue this request.
|
927
|
-
|
928
|
-
Notes
|
929
|
-
----
|
930
|
-
|
931
|
-
Body structure:
|
932
|
-
{
|
933
|
-
"class" : "UpdateGovernanceDefinitionRequestBody",
|
934
|
-
"externalSourceGUID": "add guid here",
|
935
|
-
"externalSourceName": "add qualified name here",
|
936
|
-
"effectiveTime" : "{{$isoTimestamp}}",
|
937
|
-
"forLineage" : false,
|
938
|
-
"forDuplicateProcessing" : false,
|
939
|
-
"status": "ACTIVE"
|
940
|
-
}
|
941
|
-
"""
|
942
|
-
loop = asyncio.get_event_loop()
|
943
|
-
loop.run_until_complete(self._async_update_governance_definition_status(guid, status, body))
|
944
|
-
|
945
852
|
@dynamic_catch
|
946
853
|
async def _async_delete_governance_definition(self, definition_guid: str,
|
947
854
|
body: dict | DeleteRequestBody = None,
|
@@ -1430,7 +1337,7 @@ class GovernanceOfficer(Client2):
|
|
1430
1337
|
logger.info(f"Detached digital supporting definitions: {definition_guid1} -> {definition_guid2}")
|
1431
1338
|
|
1432
1339
|
@dynamic_catch
|
1433
|
-
def detach_supporting_definitions(self,
|
1340
|
+
def detach_supporting_definitions(self, definition_guid: str, relationship_type: str, definition_guid2: str,
|
1434
1341
|
body: dict | DeleteRequestBody = None) -> None:
|
1435
1342
|
""" Detach a governance definition from a supporting governance definition.
|
1436
1343
|
Request body is optional.
|
@@ -1476,6 +1383,197 @@ class GovernanceOfficer(Client2):
|
|
1476
1383
|
loop.run_until_complete(
|
1477
1384
|
self._async_detach_supporting_definitions(definition_guid1, relationship_type, definition_guid2, body))
|
1478
1385
|
|
1386
|
+
|
1387
|
+
|
1388
|
+
async def _async_attach_governed_by_definition(self, element_guid: str, definition_guid: str,
|
1389
|
+
body: dict | NewRelationshipRequestBody = None) -> None:
|
1390
|
+
""" Link a governance definition to an element using the GovernedBy relationship. Request body is optional.
|
1391
|
+
|
1392
|
+
Async Version.
|
1393
|
+
|
1394
|
+
Parameters
|
1395
|
+
----------
|
1396
|
+
element_guid: str
|
1397
|
+
guid of the element to be governed.
|
1398
|
+
definition_guid: str
|
1399
|
+
the governance definition guid.
|
1400
|
+
body: dict
|
1401
|
+
The body describing the link between the two.
|
1402
|
+
|
1403
|
+
Returns
|
1404
|
+
-------
|
1405
|
+
None
|
1406
|
+
|
1407
|
+
Raises
|
1408
|
+
------
|
1409
|
+
PyegeriaException
|
1410
|
+
ValidationError
|
1411
|
+
|
1412
|
+
Notes
|
1413
|
+
----
|
1414
|
+
|
1415
|
+
Body structure:
|
1416
|
+
{
|
1417
|
+
"class" : "NewRelationshipRequestBody",
|
1418
|
+
"properties" : {
|
1419
|
+
"class" : "GovernedByProperties",
|
1420
|
+
"label" : "add label here",
|
1421
|
+
"description" : "add description here"
|
1422
|
+
},
|
1423
|
+
"externalSourceGUID": "Add guid here",
|
1424
|
+
"externalSourceName": "Add qualified name here",
|
1425
|
+
"forLineage": false,
|
1426
|
+
"forDuplicateProcessing": false,
|
1427
|
+
"effectiveTime" : "{{$isoTimestamp}}"
|
1428
|
+
}
|
1429
|
+
"""
|
1430
|
+
url = (
|
1431
|
+
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
1432
|
+
f"{self.url_marker}/elements/{element_guid}/governed-by/{definition_guid}/attach"
|
1433
|
+
)
|
1434
|
+
await self._async_new_relationship_request(url, "GovernedByProperties", body)
|
1435
|
+
logger.info(f"Linked Governed-By {definition_guid1} -> {definition_guid2}")
|
1436
|
+
|
1437
|
+
@dynamic_catch
|
1438
|
+
def attach_governed_by_definition(self, element_guid: str, definition_guid: str,
|
1439
|
+
body: dict | NewRelationshipRequestBody = None) -> None:
|
1440
|
+
""" Link a governance definition to an element using the GovernedBy relationship. Request body is optional.
|
1441
|
+
|
1442
|
+
Parameters
|
1443
|
+
----------
|
1444
|
+
element_guid: str
|
1445
|
+
guid of the element to be governed.
|
1446
|
+
definition_guid: str
|
1447
|
+
the governance definition guid.
|
1448
|
+
body: dict
|
1449
|
+
The body describing the link between the two.
|
1450
|
+
|
1451
|
+
Returns
|
1452
|
+
-------
|
1453
|
+
None
|
1454
|
+
|
1455
|
+
Raises
|
1456
|
+
------
|
1457
|
+
PyegeriaException
|
1458
|
+
ValidationError
|
1459
|
+
|
1460
|
+
Notes
|
1461
|
+
----
|
1462
|
+
|
1463
|
+
Body structure:
|
1464
|
+
{
|
1465
|
+
"class" : "NewRelationshipRequestBody",
|
1466
|
+
"properties" : {
|
1467
|
+
"class" : "GovernedByProperties",
|
1468
|
+
"label" : "add label here",
|
1469
|
+
"description" : "add description here"
|
1470
|
+
},
|
1471
|
+
"externalSourceGUID": "Add guid here",
|
1472
|
+
"externalSourceName": "Add qualified name here",
|
1473
|
+
"forLineage": false,
|
1474
|
+
"forDuplicateProcessing": false,
|
1475
|
+
"effectiveTime" : "{{$isoTimestamp}}"
|
1476
|
+
}
|
1477
|
+
"""
|
1478
|
+
loop = asyncio.get_event_loop()
|
1479
|
+
loop.run_until_complete(
|
1480
|
+
self._async_attach_governed_by_definition(element_guid, definition_guid, body))
|
1481
|
+
|
1482
|
+
@dynamic_catch
|
1483
|
+
async def _async_detach_governed_by_definition(self, element_guid: str, definition_guid: str,
|
1484
|
+
body: dict | DeleteRequestBody = None) -> None:
|
1485
|
+
""" Detach a governance definition from a supporting governance definition.
|
1486
|
+
Request body is optional. Async Version.
|
1487
|
+
|
1488
|
+
Parameters
|
1489
|
+
----------
|
1490
|
+
element_guid: str
|
1491
|
+
guid of the element to be governed.
|
1492
|
+
definition_guid: str
|
1493
|
+
the governance definition guid.
|
1494
|
+
body: dict
|
1495
|
+
The body describing the link between the two.
|
1496
|
+
|
1497
|
+
Returns
|
1498
|
+
-------
|
1499
|
+
None
|
1500
|
+
|
1501
|
+
Raises
|
1502
|
+
------
|
1503
|
+
InvalidParameterException
|
1504
|
+
one of the parameters is null or invalid or
|
1505
|
+
PropertyServerException
|
1506
|
+
There is a problem adding the element properties to the metadata repository or
|
1507
|
+
UserNotAuthorizedException
|
1508
|
+
the requesting user is not authorized to issue this request.
|
1509
|
+
|
1510
|
+
Notes
|
1511
|
+
----
|
1512
|
+
|
1513
|
+
Body structure:
|
1514
|
+
{
|
1515
|
+
"class" : "DeleteRequestBody",
|
1516
|
+
"externalSourceGUID": "add guid here",
|
1517
|
+
"externalSourceName": "add qualified name here",
|
1518
|
+
"effectiveTime" : "{{$isoTimestamp}}",
|
1519
|
+
"forLineage" : false,
|
1520
|
+
"forDuplicateProcessing" : false
|
1521
|
+
}
|
1522
|
+
"""
|
1523
|
+
url = (
|
1524
|
+
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
|
1525
|
+
f"{self.url_marker}/elements/{element_guid}/governed-by/{definition_guid}/detach"
|
1526
|
+
)
|
1527
|
+
await self._async_delete_request(url, body)
|
1528
|
+
logger.info(f"Detached governed-by relationshup between: {definition_guid} -> {element_guid}")
|
1529
|
+
|
1530
|
+
@dynamic_catch
|
1531
|
+
def detach_governed_by_definitio(self, element_guid: str, definition_guid: str,
|
1532
|
+
body: dict | DeleteRequestBody = None) -> None:
|
1533
|
+
""" Detach a governance definition from a supporting governance definition.
|
1534
|
+
Request body is optional.
|
1535
|
+
|
1536
|
+
Parameters
|
1537
|
+
----------
|
1538
|
+
element_guid: str
|
1539
|
+
guid of the element to be governed.
|
1540
|
+
definition_guid: str
|
1541
|
+
the governance definition guid.
|
1542
|
+
body: dict
|
1543
|
+
The body describing the link between the two.
|
1544
|
+
|
1545
|
+
Returns
|
1546
|
+
-------
|
1547
|
+
None
|
1548
|
+
|
1549
|
+
Raises
|
1550
|
+
------
|
1551
|
+
InvalidParameterException
|
1552
|
+
one of the parameters is null or invalid or
|
1553
|
+
PropertyServerException
|
1554
|
+
There is a problem adding the element properties to the metadata repository or
|
1555
|
+
UserNotAuthorizedException
|
1556
|
+
the requesting user is not authorized to issue this request.
|
1557
|
+
|
1558
|
+
Notes
|
1559
|
+
----
|
1560
|
+
|
1561
|
+
Body structure:
|
1562
|
+
{
|
1563
|
+
"class" : "DeleteRequestBody",
|
1564
|
+
"externalSourceGUID": "add guid here",
|
1565
|
+
"externalSourceName": "add qualified name here",
|
1566
|
+
"effectiveTime" : "{{$isoTimestamp}}",
|
1567
|
+
"forLineage" : false,
|
1568
|
+
"forDuplicateProcessing" : false
|
1569
|
+
}
|
1570
|
+
"""
|
1571
|
+
loop = asyncio.get_event_loop()
|
1572
|
+
loop.run_until_complete(
|
1573
|
+
self._async_detach_governed_by_definition(element_guid, definition_guid, body))
|
1574
|
+
|
1575
|
+
|
1576
|
+
|
1479
1577
|
@dynamic_catch
|
1480
1578
|
async def _async_delete_governance_definition(self, guid: str, body: dict | DeleteRequestBody = None) -> None:
|
1481
1579
|
""" Delete an information supply. Async version.
|
@@ -1484,7 +1582,7 @@ class GovernanceOfficer(Client2):
|
|
1484
1582
|
----------
|
1485
1583
|
guid: str
|
1486
1584
|
GUID of the governance definition to delete.
|
1487
|
-
|
1585
|
+
|
1488
1586
|
body: dict, optional
|
1489
1587
|
A dictionary containing the definition of the governance definition to create.
|
1490
1588
|
|
@@ -1522,6 +1620,7 @@ class GovernanceOfficer(Client2):
|
|
1522
1620
|
await self._async_delete_request(url, body)
|
1523
1621
|
logger.info(f"Deleted governance definition: {guid} ")
|
1524
1622
|
|
1623
|
+
|
1525
1624
|
@dynamic_catch
|
1526
1625
|
def delete_governance_definition(self, guid: str, body: dict | DeleteRequestBody = None) -> None:
|
1527
1626
|
""" Delete an information supply. Request body is optional. Async version.
|
pyegeria/output_formatter.py
CHANGED
@@ -948,6 +948,10 @@ def generate_output(elements: Union[Dict, List[Dict]],
|
|
948
948
|
if search_string is None or search_string == '':
|
949
949
|
search_string = "All"
|
950
950
|
|
951
|
+
# Set the output format to DICT to return values to table display
|
952
|
+
if output_format == "TABLE":
|
953
|
+
output_format = "DICT"
|
954
|
+
|
951
955
|
# Generate output based on format
|
952
956
|
if output_format == 'MERMAID':
|
953
957
|
return extract_mermaid_only(elements)
|
pyegeria/project_manager.py
CHANGED
@@ -72,6 +72,7 @@ class ProjectManager(Client2):
|
|
72
72
|
self.project_command_base: str = (
|
73
73
|
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects"
|
74
74
|
)
|
75
|
+
self.url_marker = 'project-manager'
|
75
76
|
Client2.__init__(self, view_server, platform_url, user_id, user_pwd, token)
|
76
77
|
|
77
78
|
def _extract_additional_project_properties(self, element: dict, columns_struct: dict)-> dict:
|
pyegeria/solution_architect.py
CHANGED
@@ -2612,96 +2612,6 @@ class SolutionArchitect(Client2):
|
|
2612
2612
|
loop.run_until_complete(self._async_delete_info_supply_chain(guid, body, cascade))
|
2613
2613
|
|
2614
2614
|
|
2615
|
-
@dynamic_catch
|
2616
|
-
async def _async_update_solution_element_status(self, guid: str, status: str= None, body: dict| UpdateStatusRequestBody = None,
|
2617
|
-
) -> None:
|
2618
|
-
""" Update the properties of a blueprint, solution component, or solution port. Async Version.
|
2619
|
-
|
2620
|
-
Parameters
|
2621
|
-
----------
|
2622
|
-
guid: str
|
2623
|
-
guid of the information supply chain to update.
|
2624
|
-
body: dict | UpdateStatusRequestBody, optional
|
2625
|
-
A dictionary containing the updates to the supply chain.
|
2626
|
-
status: str, optional
|
2627
|
-
The status to update the supply chain to.
|
2628
|
-
|
2629
|
-
Returns
|
2630
|
-
-------
|
2631
|
-
|
2632
|
-
None
|
2633
|
-
|
2634
|
-
Raises
|
2635
|
-
------
|
2636
|
-
InvalidParameterException
|
2637
|
-
one of the parameters is null or invalid or
|
2638
|
-
PropertyServerException
|
2639
|
-
There is a problem adding the element properties to the metadata repository or
|
2640
|
-
UserNotAuthorizedException
|
2641
|
-
the requesting user is not authorized to issue this request.
|
2642
|
-
|
2643
|
-
Notes
|
2644
|
-
----
|
2645
|
-
|
2646
|
-
Body structure:
|
2647
|
-
{
|
2648
|
-
"class" : "UpdateStatusRequestBody",
|
2649
|
-
"status" : "APPROVED",
|
2650
|
-
"externalSourceGUID": "add guid here",
|
2651
|
-
"externalSourceName": "add qualified name here",
|
2652
|
-
"effectiveTime" : "{{$isoTimestamp}}",
|
2653
|
-
"forLineage" : false,
|
2654
|
-
"forDuplicateProcessing" : false
|
2655
|
-
}
|
2656
|
-
"""
|
2657
|
-
|
2658
|
-
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/solution-architect/"
|
2659
|
-
f"solution-blueprints/{guid}/update")
|
2660
|
-
|
2661
|
-
await self._async_update_status_request(url, status, body)
|
2662
|
-
|
2663
|
-
@dynamic_catch
|
2664
|
-
def update_solution_element_status(self, guid: str, status: str = None, body: dict| UpdateStatusRequestBody = None) -> None:
|
2665
|
-
""" Update the status of a blueprint, solution component, or solution port.
|
2666
|
-
|
2667
|
-
Parameters
|
2668
|
-
----------
|
2669
|
-
guid: str
|
2670
|
-
guid of the information supply chain to update.
|
2671
|
-
body: dict
|
2672
|
-
A dictionary containing the updates to the supply chain.
|
2673
|
-
|
2674
|
-
Returns
|
2675
|
-
-------
|
2676
|
-
None
|
2677
|
-
|
2678
|
-
Raises
|
2679
|
-
------
|
2680
|
-
InvalidParameterException
|
2681
|
-
one of the parameters is null or invalid or
|
2682
|
-
PropertyServerException
|
2683
|
-
There is a problem adding the element properties to the metadata repository or
|
2684
|
-
UserNotAuthorizedException
|
2685
|
-
the requesting user is not authorized to issue this request.
|
2686
|
-
|
2687
|
-
Notes
|
2688
|
-
----
|
2689
|
-
|
2690
|
-
Body structure:
|
2691
|
-
{
|
2692
|
-
"class" : "SolutionElementStatusRequestBody",
|
2693
|
-
"status" : "APPROVED",
|
2694
|
-
"externalSourceGUID": "add guid here",
|
2695
|
-
"externalSourceName": "add qualified name here",
|
2696
|
-
"effectiveTime" : "{{$isoTimestamp}}",
|
2697
|
-
"forLineage" : false,
|
2698
|
-
"forDuplicateProcessing" : false
|
2699
|
-
}
|
2700
|
-
"""
|
2701
|
-
loop = asyncio.get_event_loop()
|
2702
|
-
loop.run_until_complete(self._async_update_solution_element_status(guid = guid, status= status, body=body))
|
2703
|
-
|
2704
|
-
|
2705
2615
|
@dynamic_catch
|
2706
2616
|
async def _async_link_solution_component_to_blueprint(self, blueprint_guid: str, component_guid: str,
|
2707
2617
|
body: dict | NewRelationshipRequestBody) -> None:
|
pyegeria/utils.py
CHANGED
@@ -57,70 +57,6 @@ def print_guid_list(guids):
|
|
57
57
|
#
|
58
58
|
|
59
59
|
|
60
|
-
def print_response(response):
|
61
|
-
"""
|
62
|
-
|
63
|
-
Args:
|
64
|
-
response:
|
65
|
-
|
66
|
-
Returns:
|
67
|
-
: str
|
68
|
-
"""
|
69
|
-
pretty_response = json.dumps(response.json(), indent=4)
|
70
|
-
print(" ")
|
71
|
-
print("Response: ")
|
72
|
-
print(pretty_response)
|
73
|
-
print(" ")
|
74
|
-
|
75
|
-
|
76
|
-
def print_unexpected_response(server_name, platform_name, platform_url, response):
|
77
|
-
"""
|
78
|
-
|
79
|
-
Args:
|
80
|
-
server_name:
|
81
|
-
platform_name:
|
82
|
-
platform_url:
|
83
|
-
response:
|
84
|
-
"""
|
85
|
-
if response.status_code == 200:
|
86
|
-
related_http_code = response.json().get("related_http_code")
|
87
|
-
if related_http_code == 200:
|
88
|
-
print("Unexpected response from server " + server_name)
|
89
|
-
print_response(response)
|
90
|
-
else:
|
91
|
-
exceptionErrorMessage = response.json().get("exceptionErrorMessage")
|
92
|
-
exceptionSystemAction = response.json().get("exceptionSystemAction")
|
93
|
-
exceptionUserAction = response.json().get("exceptionUserAction")
|
94
|
-
if exceptionErrorMessage is not None:
|
95
|
-
print(exceptionErrorMessage)
|
96
|
-
print(" * " + exceptionSystemAction)
|
97
|
-
print(" * " + exceptionUserAction)
|
98
|
-
else:
|
99
|
-
print("Unexpected response from server " + server_name)
|
100
|
-
print_response(response)
|
101
|
-
else:
|
102
|
-
print(
|
103
|
-
"Unexpected response from server platform "
|
104
|
-
+ platform_name
|
105
|
-
+ " at "
|
106
|
-
+ platform_url
|
107
|
-
)
|
108
|
-
print_response(response)
|
109
|
-
|
110
|
-
|
111
|
-
def get_last_guid(guids):
|
112
|
-
"""
|
113
|
-
|
114
|
-
Args:
|
115
|
-
guids:
|
116
|
-
|
117
|
-
Returns:
|
118
|
-
|
119
|
-
"""
|
120
|
-
if guids is None:
|
121
|
-
return None
|
122
|
-
else:
|
123
|
-
return guids[-1]
|
124
60
|
|
125
61
|
|
126
62
|
def body_slimmer(body: dict) -> dict:
|
@@ -362,5 +298,10 @@ def dynamic_catch(func: T) -> T:
|
|
362
298
|
else:
|
363
299
|
return func # Return the function unwrapped
|
364
300
|
|
301
|
+
def make_format_set_name_from_type(obj_type: str)-> str:
|
302
|
+
formatted_name = obj_type.replace(" ", "-")
|
303
|
+
return f"{formatted_name}-DrE"
|
304
|
+
|
305
|
+
|
365
306
|
if __name__ == "__main__":
|
366
307
|
print("Main-Utils")
|