pyegeria 0.8.4.10__py3-none-any.whl → 0.8.4.11__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.
- pyegeria/classification_manager_omvs.py +223 -14
- pyegeria/runtime_manager_omvs.py +120 -0
- {pyegeria-0.8.4.10.dist-info → pyegeria-0.8.4.11.dist-info}/METADATA +1 -1
- {pyegeria-0.8.4.10.dist-info → pyegeria-0.8.4.11.dist-info}/RECORD +7 -7
- {pyegeria-0.8.4.10.dist-info → pyegeria-0.8.4.11.dist-info}/LICENSE +0 -0
- {pyegeria-0.8.4.10.dist-info → pyegeria-0.8.4.11.dist-info}/WHEEL +0 -0
- {pyegeria-0.8.4.10.dist-info → pyegeria-0.8.4.11.dist-info}/entry_points.txt +0 -0
@@ -558,7 +558,81 @@ class ClassificationManager(Client):
|
|
558
558
|
)
|
559
559
|
return response
|
560
560
|
|
561
|
-
async def
|
561
|
+
async def _async_get_element_by_unique_name(
|
562
|
+
self,
|
563
|
+
name: str,
|
564
|
+
property_name: str = None,
|
565
|
+
for_lineage: bool = False,
|
566
|
+
for_duplicate_processing: bool = False,
|
567
|
+
effective_time: str = None,
|
568
|
+
server_name: str = None,
|
569
|
+
time_out: int = default_time_out,
|
570
|
+
) -> list | str:
|
571
|
+
"""
|
572
|
+
Retrieve the metadata element using the supplied unique element name (typically the qualifiedName,
|
573
|
+
but it is possible to specify a different property name in the request body as long as its unique.
|
574
|
+
If more than one element returned, an exception is thrown. Async version.
|
575
|
+
|
576
|
+
Parameters
|
577
|
+
----------
|
578
|
+
name: str
|
579
|
+
- element name to be searched.
|
580
|
+
property_name: str, optional
|
581
|
+
- optional name of property to search. If not specified, defaults to qualifiedName
|
582
|
+
for_lineage: bool, default is set by server
|
583
|
+
- determines if elements classified as Memento should be returned - normally false
|
584
|
+
for_duplicate_processing: bool, default is set by server
|
585
|
+
- Normally false. Set true when the caller is part of a deduplication function
|
586
|
+
effective_time: str, default = None
|
587
|
+
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
588
|
+
server_name: str, default = None
|
589
|
+
- name of the server instances for this request.
|
590
|
+
time_out: int, default = default_time_out
|
591
|
+
- http request timeout for this request
|
592
|
+
|
593
|
+
Returns
|
594
|
+
-------
|
595
|
+
str
|
596
|
+
Returns the guid of the element.
|
597
|
+
|
598
|
+
Raises
|
599
|
+
------
|
600
|
+
InvalidParameterException
|
601
|
+
one of the parameters is null or invalid or
|
602
|
+
PropertyServerException
|
603
|
+
There is a problem adding the element properties to the metadata repository or
|
604
|
+
UserNotAuthorizedException
|
605
|
+
the requesting user is not authorized to issue this request.
|
606
|
+
"""
|
607
|
+
if server_name is None:
|
608
|
+
server_name = self.server_name
|
609
|
+
property_name = "qualifiedName" if property_name is None else property_name
|
610
|
+
|
611
|
+
possible_query_params = query_string(
|
612
|
+
[
|
613
|
+
("forLineage", for_lineage),
|
614
|
+
("forDuplicateProcessing", for_duplicate_processing),
|
615
|
+
]
|
616
|
+
)
|
617
|
+
|
618
|
+
body = {
|
619
|
+
"class": "NameRequestBody",
|
620
|
+
"name": name,
|
621
|
+
"namePropertyName": property_name,
|
622
|
+
"forLineage": for_lineage,
|
623
|
+
"forDuplicateProcessing": for_duplicate_processing,
|
624
|
+
"effectiveTime": effective_time,
|
625
|
+
}
|
626
|
+
|
627
|
+
url = f"{base_path(self, server_name)}/elements/by-unique-name{possible_query_params}"
|
628
|
+
|
629
|
+
response: Response = await self._async_make_request(
|
630
|
+
"POST", url, body_slimmer(body), time_out=time_out
|
631
|
+
)
|
632
|
+
|
633
|
+
return response.json().get("element", "No elements found")
|
634
|
+
|
635
|
+
def get_element_by_unique_name(
|
562
636
|
self,
|
563
637
|
name: str,
|
564
638
|
property_name: str = None,
|
@@ -567,6 +641,67 @@ class ClassificationManager(Client):
|
|
567
641
|
effective_time: str = None,
|
568
642
|
server_name: str = None,
|
569
643
|
time_out: int = default_time_out,
|
644
|
+
) -> list | str:
|
645
|
+
"""
|
646
|
+
Retrieve the metadata element using the supplied unique element name (typically the qualifiedName,
|
647
|
+
but it is possible to specify a different property name in the request body as long as its unique.
|
648
|
+
If more than one element returned, an exception is thrown.
|
649
|
+
|
650
|
+
Parameters
|
651
|
+
----------
|
652
|
+
name: str
|
653
|
+
- element name to be searched.
|
654
|
+
property_name: str, optional
|
655
|
+
- optional name of property to search. If not specified, defaults to qualifiedName
|
656
|
+
for_lineage: bool, default is set by server
|
657
|
+
- determines if elements classified as Memento should be returned - normally false
|
658
|
+
for_duplicate_processing: bool, default is set by server
|
659
|
+
- Normally false. Set true when the caller is part of a deduplication function
|
660
|
+
effective_time: str, default = None
|
661
|
+
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
662
|
+
server_name: str, default = None
|
663
|
+
- name of the server instances for this request.
|
664
|
+
time_out: int, default = default_time_out
|
665
|
+
- http request timeout for this request
|
666
|
+
|
667
|
+
Returns
|
668
|
+
-------
|
669
|
+
str
|
670
|
+
Returns the guid of the element.
|
671
|
+
|
672
|
+
Raises
|
673
|
+
------
|
674
|
+
InvalidParameterException
|
675
|
+
one of the parameters is null or invalid or
|
676
|
+
PropertyServerException
|
677
|
+
There is a problem adding the element properties to the metadata repository or
|
678
|
+
UserNotAuthorizedException
|
679
|
+
the requesting user is not authorized to issue this request.
|
680
|
+
"""
|
681
|
+
|
682
|
+
loop = asyncio.get_event_loop()
|
683
|
+
response = loop.run_until_complete(
|
684
|
+
self._async_get_element_by_unique_name(
|
685
|
+
name,
|
686
|
+
property_name,
|
687
|
+
for_lineage,
|
688
|
+
for_duplicate_processing,
|
689
|
+
effective_time,
|
690
|
+
server_name,
|
691
|
+
time_out,
|
692
|
+
)
|
693
|
+
)
|
694
|
+
return response
|
695
|
+
|
696
|
+
async def _async_get_element_guid_by_unique_name(
|
697
|
+
self,
|
698
|
+
name: str,
|
699
|
+
property_name: str = None,
|
700
|
+
for_lineage: bool = False,
|
701
|
+
for_duplicate_processing: bool = False,
|
702
|
+
effective_time: str = None,
|
703
|
+
server_name: str = None,
|
704
|
+
time_out: int = default_time_out,
|
570
705
|
) -> list | str:
|
571
706
|
"""
|
572
707
|
Retrieve the guid associated with the supplied unique element name.
|
@@ -617,9 +752,9 @@ class ClassificationManager(Client):
|
|
617
752
|
body = {
|
618
753
|
"class": "NameRequestBody",
|
619
754
|
"name": name,
|
755
|
+
"namePropertyName": property_name,
|
620
756
|
"forLineage": for_lineage,
|
621
757
|
"forDuplicateProcessing": for_duplicate_processing,
|
622
|
-
"namePropertyName": property_name,
|
623
758
|
"effectiveTime": effective_time,
|
624
759
|
}
|
625
760
|
|
@@ -629,18 +764,9 @@ class ClassificationManager(Client):
|
|
629
764
|
"POST", url, body_slimmer(body), time_out=time_out
|
630
765
|
)
|
631
766
|
|
632
|
-
|
767
|
+
return response.json().get("guid", "No elements found")
|
633
768
|
|
634
|
-
|
635
|
-
if len(elements) == 0:
|
636
|
-
return "No elements found"
|
637
|
-
elif len(elements) > 1:
|
638
|
-
raise Exception("Multiple elements found for supplied name!")
|
639
|
-
elif len(elements) == 1:
|
640
|
-
return elements[0]["elementHeader"]["guid"]
|
641
|
-
return elements
|
642
|
-
|
643
|
-
def get_guid_for_name(
|
769
|
+
def get_element_guid_by_unique_name(
|
644
770
|
self,
|
645
771
|
name: str,
|
646
772
|
property_name: str = None,
|
@@ -688,7 +814,7 @@ class ClassificationManager(Client):
|
|
688
814
|
|
689
815
|
loop = asyncio.get_event_loop()
|
690
816
|
response = loop.run_until_complete(
|
691
|
-
self.
|
817
|
+
self._async_get_element_guid_by_unique_name(
|
692
818
|
name,
|
693
819
|
property_name,
|
694
820
|
for_lineage,
|
@@ -700,6 +826,89 @@ class ClassificationManager(Client):
|
|
700
826
|
)
|
701
827
|
return response
|
702
828
|
|
829
|
+
async def _async_get_guid_for_name(
|
830
|
+
self, name: str, server_name: str = None, time_out: int = default_time_out
|
831
|
+
) -> list | str:
|
832
|
+
"""
|
833
|
+
Retrieve the guid associated with the supplied element name.
|
834
|
+
If more than one element returned, an exception is thrown. Async version.
|
835
|
+
|
836
|
+
Parameters
|
837
|
+
----------
|
838
|
+
name: str
|
839
|
+
- element name to be searched.
|
840
|
+
server_name: str, default = None
|
841
|
+
- name of the server instances for this request.
|
842
|
+
time_out: int, default = default_time_out
|
843
|
+
- http request timeout for this request
|
844
|
+
|
845
|
+
Returns
|
846
|
+
-------
|
847
|
+
str
|
848
|
+
Returns the guid of the element.
|
849
|
+
|
850
|
+
Raises
|
851
|
+
------
|
852
|
+
InvalidParameterException
|
853
|
+
one of the parameters is null or invalid or
|
854
|
+
PropertyServerException
|
855
|
+
There is a problem adding the element properties to the metadata repository or
|
856
|
+
UserNotAuthorizedException
|
857
|
+
the requesting user is not authorized to issue this request.
|
858
|
+
"""
|
859
|
+
if server_name is None:
|
860
|
+
server_name = self.server_name
|
861
|
+
property_name = ["name", "qualifiedName", "title"]
|
862
|
+
elements = await self._async_get_elements_by_property_value(
|
863
|
+
name, property_name, None
|
864
|
+
)
|
865
|
+
|
866
|
+
if type(elements) is list:
|
867
|
+
if len(elements) == 0:
|
868
|
+
return "No elements found"
|
869
|
+
elif len(elements) > 1:
|
870
|
+
raise Exception("Multiple elements found for supplied name!")
|
871
|
+
elif len(elements) == 1:
|
872
|
+
return elements[0]["elementHeader"]["guid"]
|
873
|
+
return elements
|
874
|
+
|
875
|
+
def get_guid_for_name(
|
876
|
+
self, name: str, server_name: str = None, time_out: int = default_time_out
|
877
|
+
) -> list | str:
|
878
|
+
"""
|
879
|
+
Retrieve the guid associated with the supplied element name.
|
880
|
+
If more than one element returned, an exception is thrown.
|
881
|
+
|
882
|
+
Parameters
|
883
|
+
----------
|
884
|
+
name: str
|
885
|
+
- element name to be searched.
|
886
|
+
server_name: str, default = None
|
887
|
+
- name of the server instances for this request.
|
888
|
+
time_out: int, default = default_time_out
|
889
|
+
- http request timeout for this request
|
890
|
+
|
891
|
+
Returns
|
892
|
+
-------
|
893
|
+
str
|
894
|
+
Returns the guid of the element.
|
895
|
+
|
896
|
+
Raises
|
897
|
+
------
|
898
|
+
InvalidParameterException
|
899
|
+
one of the parameters is null or invalid or
|
900
|
+
PropertyServerException
|
901
|
+
There is a problem adding the element properties to the metadata repository or
|
902
|
+
UserNotAuthorizedException
|
903
|
+
the requesting user is not authorized to issue this request.
|
904
|
+
"""
|
905
|
+
|
906
|
+
loop = asyncio.get_event_loop()
|
907
|
+
response = loop.run_until_complete(
|
908
|
+
self._async_get_guid_for_name(name, server_name, time_out)
|
909
|
+
)
|
910
|
+
return response
|
911
|
+
|
703
912
|
async def _async_find_elements_by_property_value(
|
704
913
|
self,
|
705
914
|
property_value: str,
|
pyegeria/runtime_manager_omvs.py
CHANGED
@@ -1043,9 +1043,102 @@ class RuntimeManager(Client):
|
|
1043
1043
|
)
|
1044
1044
|
return response
|
1045
1045
|
|
1046
|
+
async def _async_add_archive_file(
|
1047
|
+
self,
|
1048
|
+
archive_file: str,
|
1049
|
+
server_guid: str,
|
1050
|
+
view_server: str = None,
|
1051
|
+
time_out: int = 60,
|
1052
|
+
) -> None:
|
1053
|
+
"""Add a new open metadata archive to running OMAG Server's repository.
|
1054
|
+
An open metadata archive contains metadata types and instances. This operation loads an open metadata archive
|
1055
|
+
that is stored in the named file. It can be used with OMAG servers that are of type Open Metadata Store.
|
1056
|
+
Async version.
|
1057
|
+
|
1058
|
+
https://egeria-project.org/concepts/open-metadata-archives/
|
1059
|
+
|
1060
|
+
Parameters
|
1061
|
+
----------
|
1062
|
+
archive_file: str
|
1063
|
+
Open metadata archive file to load.
|
1064
|
+
server_guid: str
|
1065
|
+
GUID of the server to load the file into.
|
1066
|
+
server : str, optional
|
1067
|
+
The name of the view server to work with. If not provided, the default server name
|
1068
|
+
will be used.
|
1069
|
+
time_out: int, optional
|
1070
|
+
Time out for the rest call.
|
1071
|
+
|
1072
|
+
Returns
|
1073
|
+
-------
|
1074
|
+
Response
|
1075
|
+
None
|
1076
|
+
|
1077
|
+
Raises
|
1078
|
+
------
|
1079
|
+
InvalidParameterException
|
1080
|
+
PropertyServerException
|
1081
|
+
UserNotAuthorizedException
|
1082
|
+
|
1083
|
+
"""
|
1084
|
+
if view_server is None:
|
1085
|
+
server = self.server_name
|
1086
|
+
|
1087
|
+
url = f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/omag-servers/{server_guid}/instance/load/open-metadata-archives/file"
|
1088
|
+
|
1089
|
+
await self._async_make_request(
|
1090
|
+
"POST-DATA", url, archive_file, time_out=time_out
|
1091
|
+
)
|
1092
|
+
return
|
1093
|
+
|
1094
|
+
def add_archive_file(
|
1095
|
+
self,
|
1096
|
+
archive_file: str,
|
1097
|
+
server_guid: str,
|
1098
|
+
view_server: str = None,
|
1099
|
+
time_out: int = 60,
|
1100
|
+
) -> None:
|
1101
|
+
"""Add a new open metadata archive to running OMAG Server's repository.
|
1102
|
+
An open metadata archive contains metadata types and instances. This operation loads an open metadata archive
|
1103
|
+
that is stored in the named file. It can be used with OMAG servers that are of type Open Metadata Store.
|
1104
|
+
|
1105
|
+
https://egeria-project.org/concepts/open-metadata-archives/
|
1106
|
+
|
1107
|
+
Parameters
|
1108
|
+
----------
|
1109
|
+
archive_file: str
|
1110
|
+
Open metadata archive file to load.
|
1111
|
+
server_guid: str
|
1112
|
+
GUID of the server to load the file into.
|
1113
|
+
server : str, optional
|
1114
|
+
The name of the view server to work with. If not provided, the default server name
|
1115
|
+
will be used.
|
1116
|
+
|
1117
|
+
Returns
|
1118
|
+
-------
|
1119
|
+
Response
|
1120
|
+
None
|
1121
|
+
|
1122
|
+
Raises
|
1123
|
+
------
|
1124
|
+
InvalidParameterException
|
1125
|
+
PropertyServerException
|
1126
|
+
UserNotAuthorizedException
|
1127
|
+
|
1128
|
+
"""
|
1129
|
+
|
1130
|
+
loop = asyncio.get_event_loop()
|
1131
|
+
loop.run_until_complete(
|
1132
|
+
self._async_add_archive_file(
|
1133
|
+
archive_file, server_guid, view_server, time_out
|
1134
|
+
)
|
1135
|
+
)
|
1136
|
+
return
|
1137
|
+
|
1046
1138
|
#
|
1047
1139
|
# Activate
|
1048
1140
|
#
|
1141
|
+
|
1049
1142
|
async def _async_activate_with_stored_config(
|
1050
1143
|
self, server_guid: str, server: str = None
|
1051
1144
|
) -> None:
|
@@ -1066,6 +1159,33 @@ class RuntimeManager(Client):
|
|
1066
1159
|
None
|
1067
1160
|
|
1068
1161
|
|
1162
|
+
Raises
|
1163
|
+
------
|
1164
|
+
InvalidParameterException
|
1165
|
+
PropertyServerException
|
1166
|
+
UserNotAuthorizedException
|
1167
|
+
|
1168
|
+
"""
|
1169
|
+
pass
|
1170
|
+
|
1171
|
+
def activate_with_stored_config(self, server_guid: str, server: str = None) -> None:
|
1172
|
+
"""Activate the Open Metadata and Governance (OMAG) server using the configuration document stored for this
|
1173
|
+
server. Async Version
|
1174
|
+
|
1175
|
+
Parameters
|
1176
|
+
----------
|
1177
|
+
server_guid: str
|
1178
|
+
Identity of the server to activate.
|
1179
|
+
|
1180
|
+
server : str, optional
|
1181
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
1182
|
+
will be used.
|
1183
|
+
|
1184
|
+
Returns
|
1185
|
+
-------
|
1186
|
+
None
|
1187
|
+
|
1188
|
+
|
1069
1189
|
Raises
|
1070
1190
|
------
|
1071
1191
|
InvalidParameterException
|
@@ -70,7 +70,7 @@ pyegeria/_validators.py,sha256=DQuMsATRGxGSBtOrVtXlCgWXGhj6Nh-uqPtCsrUGLxk,12703
|
|
70
70
|
pyegeria/action_author_omvs.py,sha256=LbJ8dTHrjy2OHvP1sHCCIRgRU2AD3IV-49kB1UCoQPc,6451
|
71
71
|
pyegeria/asset_catalog_omvs.py,sha256=GzTYJjeXh3rY5Ykok0ZcJ3H1bGyQcubI0ZWjFF78iCU,24335
|
72
72
|
pyegeria/automated_curation_omvs.py,sha256=DhSrDX_uS0SfmzRRNi1Th0jmdQa9N4S42mIunxrih9s,150418
|
73
|
-
pyegeria/classification_manager_omvs.py,sha256=
|
73
|
+
pyegeria/classification_manager_omvs.py,sha256=hOKYqNWfAFqwwVgvkUok8kzD4g0pOaNI7QxrkjPZDMI,200796
|
74
74
|
pyegeria/collection_manager_omvs.py,sha256=C8cfgGsx6MpG1Nds3JahyqXel8zpb-9iwXsXCAuzmg0,109717
|
75
75
|
pyegeria/core_omag_server_config.py,sha256=_GstDYb6XYNCt59l1mMxTR8EoUvwlBi3RK93wKvrcWk,93730
|
76
76
|
pyegeria/create_tech_guid_lists.py,sha256=RYRWdXm2bhCMkbUlOdMJ8cKZnamJvSkY5XMK2RjLX4M,4631
|
@@ -88,12 +88,12 @@ pyegeria/my_profile_omvs.py,sha256=vxi0Dr0qwHV4auqKCjYvWYpF-BAUbLQt58fXGYcqEu4,4
|
|
88
88
|
pyegeria/platform_services.py,sha256=4BfyGdQwGwi2cd9mJdNoUB3LNFNbiyC2_ZQhGtpcxTA,41624
|
89
89
|
pyegeria/project_manager_omvs.py,sha256=f8ahjdPxFv90JEE0fc2AV7Kc0hd9jazGQbx5KVe7gQM,74521
|
90
90
|
pyegeria/registered_info.py,sha256=WWWxkQJbHnu6KItVpMjOqLerq5thP35qih7rFgW8v9w,6356
|
91
|
-
pyegeria/runtime_manager_omvs.py,sha256=
|
91
|
+
pyegeria/runtime_manager_omvs.py,sha256=ER4oTdbUNFLrO9Gihzd_wcnAIBdlry450NxezMYcl70,39488
|
92
92
|
pyegeria/server_operations.py,sha256=ciH890hYT85YQ6OpByn4w7s3a7TtvWZpIG5rkRqbcI0,16766
|
93
93
|
pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
|
94
94
|
pyegeria/valid_metadata_omvs.py,sha256=6Hc4g9BOS8w1ILfTG3_A1tfIX3HLtpgZZvcC-z9GePU,36185
|
95
|
-
pyegeria-0.8.4.
|
96
|
-
pyegeria-0.8.4.
|
97
|
-
pyegeria-0.8.4.
|
98
|
-
pyegeria-0.8.4.
|
99
|
-
pyegeria-0.8.4.
|
95
|
+
pyegeria-0.8.4.11.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
96
|
+
pyegeria-0.8.4.11.dist-info/METADATA,sha256=JgfmTJbjUQi2aSvJHpQ3NmTSh-eX6Vq0gt76Y2wBs9Y,2820
|
97
|
+
pyegeria-0.8.4.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
98
|
+
pyegeria-0.8.4.11.dist-info/entry_points.txt,sha256=5Q9bDxIqPgdhd3lDnzdRSCYy9hZtNm_BL49bcmbBpGQ,3808
|
99
|
+
pyegeria-0.8.4.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|