pyegeria 5.4.7.4__py3-none-any.whl → 5.4.7.5__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/ops/__init__.py CHANGED
@@ -5,8 +5,6 @@ Copyright Contributors to the ODPi Egeria project.
5
5
 
6
6
  """
7
7
  from pyegeria import (
8
- INTEGRATION_GUIDS,
9
- TEMPLATE_GUIDS,
10
8
  default_time_out,
11
9
  disable_ssl_warnings,
12
10
  enable_ssl_check,
@@ -21,7 +21,6 @@ from rich.table import Table
21
21
 
22
22
 
23
23
  from pyegeria import (
24
- INTEGRATION_GUIDS,
25
24
  AutomatedCuration,
26
25
  EgeriaTech,
27
26
  PyegeriaException,
@@ -12,7 +12,7 @@ import os
12
12
 
13
13
  import click
14
14
  from loguru import logger
15
- from pyegeria import AutomatedCuration, EgeriaTech
15
+ from pyegeria import EgeriaTech, PyegeriaAPIException
16
16
  from pyegeria.config import settings
17
17
  from pyegeria.logging_configuration import config_logging
18
18
  from pyegeria._exceptions_new import (
@@ -64,13 +64,13 @@ def load_archive(file_name, server_name, view_server, url, userid, password, tim
64
64
  try:
65
65
  s_client = EgeriaTech(view_server, url, userid, password)
66
66
  token = s_client.create_egeria_bearer_token()
67
- server_guid = None
67
+ server_guid = s_client.__get_guid__(display_name = server_name, property_name = "displayName", tech_type = "MetadataStore")
68
68
  file_name = file_name.strip()
69
69
  s_client.add_archive_file(file_name, server_guid, server_name, time_out=timeout)
70
70
 
71
71
  click.echo(f"Loaded archive: {file_name}")
72
72
 
73
- except (PyegeriaException) as e:
73
+ except (PyegeriaException, PyegeriaAPIException) as e:
74
74
  print(
75
75
  f"Perhaps there was a timeout? If so, the command will complete despite the exception\n"
76
76
  f"===> You can check by rerunning the command in a few minutes"
commands/tech/__init__.py CHANGED
@@ -4,8 +4,6 @@ Copyright Contributors to the ODPi Egeria project.
4
4
 
5
5
  """
6
6
  from pyegeria import (
7
- INTEGRATION_GUIDS,
8
- TEMPLATE_GUIDS,
9
7
  default_time_out,
10
8
  disable_ssl_warnings,
11
9
  enable_ssl_check,
pyegeria/__init__.py CHANGED
@@ -12,11 +12,11 @@ the server platform and servers.
12
12
  """
13
13
  # from .load_config import load_app_config, get_app_config
14
14
  # from .logging_configuration import config_logging, init_logging
15
- from ._globals import (INTEGRATION_GUIDS, TEMPLATE_GUIDS, default_time_out, disable_ssl_warnings, enable_ssl_check,
15
+ from ._globals import (default_time_out, disable_ssl_warnings, enable_ssl_check,
16
16
  is_debug, max_paging_size, NO_ELEMENTS_FOUND, NO_ASSETS_FOUND, NO_SERVERS_FOUND,
17
17
  NO_CATALOGS_FOUND, NO_GLOSSARIES_FOUND, NO_TERMS_FOUND, NO_CATEGORIES_FOUND, NO_ELEMENT_FOUND,
18
- NO_PROJECTS_FOUND, DEBUG_LEVEL, NO_COLLECTION_FOUND, NO_GUID_RETURNED, TEMPLATE_GUIDS,
19
- INTEGRATION_GUIDS)
18
+ NO_PROJECTS_FOUND, DEBUG_LEVEL, NO_COLLECTION_FOUND, NO_GUID_RETURNED,
19
+ )
20
20
 
21
21
 
22
22
 
pyegeria/_client_new.py CHANGED
@@ -562,56 +562,6 @@ class Client2:
562
562
  response, context, e=e
563
563
  )
564
564
 
565
- def build_global_guid_lists(self) -> None:
566
- global template_guids, integration_guids
567
-
568
- self.create_egeria_bearer_token(self.user_id, self.user_pwd)
569
- # get all technology types
570
- url = (
571
- f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/automated-curation/technology-types/"
572
- f"by-search-string?startFrom=0&pageSize=0&startsWith=false&"
573
- f"endsWith=false&ignoreCase=true"
574
- )
575
- body = {"filter": ""}
576
-
577
- response = self.make_request("POST", url, body)
578
- tech_types = response.json().get("elements", "no tech found")
579
- if type(tech_types) is list:
580
- for tech_type in tech_types:
581
- # get tech type details
582
- display_name = tech_type["name"]
583
-
584
- url = (f"{self.platform_url}/servers/"
585
- f"{self.server_name}/api/open-metadata/automated-curation/technology-types/by-name")
586
- body = {"filter": display_name}
587
- response = self.make_request("POST", url, body)
588
- details = response.json().get("element", "no type found")
589
- if type(details) is str:
590
- continue
591
- # get templates and update the template_guids global
592
- templates = details.get("catalogTemplates", "Not Found")
593
- if type(templates) is str:
594
- template_guids[display_name] = None
595
- else:
596
- for template in templates:
597
- template_name = template.get("name", None)
598
- template_guid = template["relatedElement"]["guid"]
599
- template_guids[template_name] = template_guid
600
- # print(f"Added {template_name} template with GUID {template_guids[template_name]}")
601
-
602
- # Now find the integration connector guids
603
- resource_list = details.get("resourceList", " ")
604
- if type(resource_list) is str:
605
- integration_guids[display_name] = None
606
- else:
607
- for resource in resource_list:
608
- resource_guid = resource["relatedElement"]["guid"]
609
- resource_type = resource["relatedElement"]["type"]["typeName"]
610
- if resource_type == "IntegrationConnector":
611
- integration_guids[display_name] = resource_guid
612
- # print(f"Added {display_name} integration connector with GUID {integration_guids[
613
- # display_name]}")
614
-
615
565
  async def __async_get_guid__(
616
566
  self,
617
567
  guid: str = None,
@@ -727,6 +677,11 @@ class Client2:
727
677
  )
728
678
  return result
729
679
 
680
+
681
+
682
+
683
+
684
+
730
685
  def __create_qualified_name__(self, type: str, display_name: str, local_qualifier: str = None,
731
686
  version_identifier: str = None) -> str:
732
687
  """Helper function to create a qualified name for a given type and display name.
@@ -893,10 +848,228 @@ class Client2:
893
848
  )
894
849
  return response
895
850
 
851
+
852
+ async def async_get_elements_by_property_value(
853
+ self,
854
+ property_value: str,
855
+ property_names: [str],
856
+ metadata_element_type_name: str = None,
857
+ effective_time: str = None,
858
+ for_lineage: bool = None,
859
+ for_duplicate_processing: bool = None,
860
+ start_from: int = 0,
861
+ page_size: int = 0,
862
+ time_out: int = default_time_out,
863
+ ) -> list | str:
864
+ """
865
+ Retrieve elements by a value found in one of the properties specified. The value must match exactly.
866
+ An open metadata type name may be supplied to restrict the results. Async version.
867
+
868
+ https://egeria-project.org/types/
869
+
870
+ Parameters
871
+ ----------
872
+ property_value: str
873
+ - property value to be searched.
874
+ property_names: [str]
875
+ - property names to search in.
876
+ metadata_element_type_name : str, default = None
877
+ - open metadata type to be used to restrict the search
878
+ effective_time: str, default = None
879
+ - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
880
+ for_lineage: bool, default is set by server
881
+ - determines if elements classified as Memento should be returned - normally false
882
+ for_duplicate_processing: bool, default is set by server
883
+ - Normally false. Set true when the caller is part of a deduplication function
884
+ start_from: int, default = 0
885
+ - index of the list to start from (0 for start).
886
+ page_size
887
+ - maximum number of elements to return.
888
+
889
+
890
+ time_out: int, default = default_time_out
891
+ - http request timeout for this request
892
+
893
+ Returns
894
+ -------
895
+ [dict] | str
896
+ Returns a string if no elements found and a list of dict of elements with the results.
897
+
898
+ Raises
899
+ ------
900
+ PyegeriaException
901
+ """
902
+
903
+ body = {
904
+ "class": "FindPropertyNamesProperties",
905
+ "metadataElementTypeName": metadata_element_type_name,
906
+ "propertyValue": property_value,
907
+ "propertyNames": property_names,
908
+ "effectiveTime": effective_time,
909
+ "startFrom": start_from,
910
+ "pageSize": page_size,
911
+ "forLineage": for_lineage,
912
+ "forDuplicateProcessing": for_duplicate_processing
913
+ }
914
+
915
+ url = f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/classification-explorer/elements/by-exact-property-value"
916
+
917
+ response: Response = await self._async_make_request(
918
+ "POST", url, body_slimmer(body), time_out=time_out
919
+ )
920
+
921
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
922
+ if type(elements) is list:
923
+ if len(elements) == 0:
924
+ return NO_ELEMENTS_FOUND
925
+ return elements
926
+
927
+ def get_elements_by_property_value(
928
+ self,
929
+ property_value: str,
930
+ property_names: [str],
931
+ metadata_element_type_name: str = None,
932
+ effective_time: str = None,
933
+ for_lineage: bool = None,
934
+ for_duplicate_processing: bool = None,
935
+ start_from: int = 0,
936
+ page_size: int = 0,
937
+ time_out: int = default_time_out,
938
+ output_format: str = "JSON",
939
+ output_format_set: dict | str = None,
940
+ ) -> list | str:
941
+ """
942
+ Retrieve elements by a value found in one of the properties specified. The value must match exactly.
943
+ An open metadata type name may be supplied to restrict the results.
944
+
945
+ https://egeria-project.org/types/
946
+
947
+ Parameters
948
+ ----------
949
+ property_value: str
950
+ - property value to be searched.
951
+ property_names: [str]
952
+ - property names to search in.
953
+ metadata_element_type_name : str, default = None
954
+ - open metadata type to be used to restrict the search
955
+ effective_time: str, default = None
956
+ - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
957
+ for_lineage: bool, default is set by server
958
+ - determines if elements classified as Memento should be returned - normally false
959
+ for_duplicate_processing: bool, default is set by server
960
+ - Normally false. Set true when the caller is part of a deduplication function
961
+ start_from: int, default = 0
962
+ - index of the list to start from (0 for start).
963
+ page_size
964
+ - maximum number of elements to return.
965
+ time_out: int, default = default_time_out
966
+ - http request timeout for this request
967
+ output_format: str, default = "JSON"
968
+ - Type of output to return.
969
+ output_format_set: dict | str, default = None
970
+ - Output format set to use. If None, the default output format set is used.
971
+
972
+ Returns
973
+ -------
974
+ [dict] | str
975
+ Returns a string if no elements found and a list of dict of elements with the results.
976
+
977
+ Raises
978
+ ------
979
+ PyegeriaException.
980
+ """
981
+
982
+ loop = asyncio.get_event_loop()
983
+ response = loop.run_until_complete(
984
+ self.async_get_elements_by_property_value(
985
+ property_value,
986
+ property_names,
987
+ metadata_element_type_name,
988
+ effective_time,
989
+ for_lineage,
990
+ for_duplicate_processing,
991
+ start_from,
992
+ page_size,
993
+ time_out,
994
+ )
995
+ )
996
+ return response
997
+
998
+ async def async_get_guid_for_name(
999
+ self, name: str, property_name: [str] = ["qualifiedName","displayName"], type_name: str = "ValidMetadataValue"
1000
+
1001
+ ) -> list | str:
1002
+ """
1003
+ Retrieve the guid associated with the supplied element name.
1004
+ If more than one element returned, an exception is thrown. Async version.
1005
+
1006
+ Parameters
1007
+ ----------
1008
+ name: str
1009
+ - element name to be searched.
1010
+ property_name: [str], default = ["qualifiedName","displayName"]
1011
+ - propertys to search in.
1012
+ type_name: str, default = "ValidMetadataValue"
1013
+ - metadata element type name to be used to restrict the search
1014
+ Returns
1015
+ -------
1016
+ str
1017
+ Returns the guid of the element.
1018
+
1019
+ Raises
1020
+ ------
1021
+ PyegeriaException
1022
+ """
1023
+
1024
+ elements = await self.async_get_elements_by_property_value(
1025
+ name, property_name, type_name
1026
+ )
1027
+
1028
+ if type(elements) is list:
1029
+ if len(elements) == 0:
1030
+ return NO_ELEMENTS_FOUND
1031
+ elif len(elements) > 1:
1032
+ raise Exception("Multiple elements found for supplied name!")
1033
+ elif len(elements) == 1:
1034
+ return elements[0]["elementHeader"]["guid"]
1035
+ return elements
1036
+
1037
+ def get_guid_for_name(
1038
+ self, name: str, property_name: [str] = ["qualifiedName","displayName"], type_name: str = "ValidMetadataValue"
1039
+ ) -> list | str:
1040
+ """
1041
+ Retrieve the guid associated with the supplied element name.
1042
+ If more than one element returned, an exception is thrown.
1043
+
1044
+ Parameters
1045
+ ----------
1046
+ name: str
1047
+ - element name to be searched.
1048
+ property_name: [str], default = ["qualifiedName","displayName"]
1049
+ - propertys to search in.
1050
+ type_name: str, default = "ValidMetadataValue"
1051
+ - metadata element type name to be used to restrict the search
1052
+ Returns
1053
+ -------
1054
+ str
1055
+ Returns the guid of the element.
1056
+
1057
+ Raises
1058
+ ------
1059
+ PyegeriaExeception
1060
+ """
1061
+
1062
+ loop = asyncio.get_event_loop()
1063
+ response = loop.run_until_complete(
1064
+ self.async_get_guid_for_name(name, property_name, type_name)
1065
+ )
1066
+ return response
1067
+
1068
+
896
1069
  async def async_get_element_by_guid_(self, element_guid: str) -> dict | str:
897
1070
  """
898
- Simplified, internal version of get_element_by_guid found in Classification Manager.
899
- Retrieve an element by its guid. Async version.
1071
+ Simplified, internal version of get_element_by_guid found in Classification Manager.
1072
+ Retrieve an element by its guid. Async version.
900
1073
 
901
1074
  Parameters
902
1075
  ----------
@@ -923,7 +1096,7 @@ class Client2:
923
1096
  "effectiveTime": None,
924
1097
  }
925
1098
 
926
- url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/elements/"
1099
+ url = (f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/classification-manager/elements/"
927
1100
  f"{element_guid}?forLineage=false&forDuplicateProcessing=false")
928
1101
 
929
1102
  response: Response = await self._async_make_request("POST", url, body_slimmer(body))
@@ -932,6 +1105,163 @@ class Client2:
932
1105
 
933
1106
  return elements
934
1107
 
1108
+ async def async_get_related_elements_with_property_value(
1109
+ self,
1110
+ element_guid: str,
1111
+ relationship_type: str,
1112
+ property_value: str,
1113
+ property_names: [str],
1114
+ metadata_element_type_name: str = None,
1115
+ start_at_end: int = 1,
1116
+ effective_time: str = None,
1117
+ for_lineage: bool = None,
1118
+ for_duplicate_processing: bool = None,
1119
+ start_from: int = 0,
1120
+ page_size: int = 0,
1121
+ time_out: int = default_time_out,
1122
+ ) -> list | str:
1123
+ """
1124
+ Retrieve elements linked via the requested relationship type name and with the requested a value found in one of
1125
+ the classification's properties specified. The value must match exactly. An open metadata type name may be
1126
+ supplied to restrict the types of elements returned. Async version.
1127
+
1128
+ https://egeria-project.org/types/
1129
+
1130
+ Parameters
1131
+ ----------
1132
+ element_guid: str
1133
+ - the base element to get related elements for
1134
+ relationship_type: str
1135
+ - the type of relationship to navigate to related elements
1136
+ property_value: str
1137
+ - property value to be searched.
1138
+ property_names: [str]
1139
+ - property names to search in.
1140
+ metadata_element_type_name : str, default = None
1141
+ - restrict search to elements of this open metadata type
1142
+ start_at_end: int, default = 1
1143
+ - The end of the relationship to start from - typically End1
1144
+ - open metadata type to be used to restrict the search
1145
+ effective_time: str, default = None
1146
+ - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
1147
+ for_lineage: bool, default is set by server
1148
+ - determines if elements classified as Memento should be returned - normally false
1149
+ for_duplicate_processing: bool, default is set by server
1150
+ - Normally false. Set true when the caller is part of a deduplication function
1151
+ start_from: int, default = 0
1152
+ - index of the list to start from (0 for start).
1153
+ page_size
1154
+ - maximum number of elements to return.
1155
+
1156
+
1157
+ time_out: int, default = default_time_out
1158
+ - http request timeout for this request
1159
+
1160
+ Returns
1161
+ -------
1162
+ [dict] | str
1163
+ Returns a string if no elements found and a list of dict of elements with the results.
1164
+
1165
+ Raises
1166
+ ------
1167
+ PyegeriaException
1168
+ """
1169
+
1170
+ body = {
1171
+ "class": "FindPropertyNamesProperties",
1172
+ "metadataElementTypeName": metadata_element_type_name,
1173
+ "propertyValue": property_value,
1174
+ "propertyNames": property_names,
1175
+ "effectiveTime": effective_time,
1176
+ "forLineage": for_lineage,
1177
+ "forDuplicateProcessing": for_duplicate_processing,
1178
+ "startFrom": start_from,
1179
+ "pageSize": page_size
1180
+ }
1181
+
1182
+ url = (
1183
+ f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/classification-explorer/elements/{element_guid}"
1184
+ f"/by-relationship/{relationship_type}/with-exact-property-value?startAtEnd={start_at_end}"
1185
+ )
1186
+
1187
+ response: Response = await self._async_make_request(
1188
+ "POST", url, body_slimmer(body), time_out=time_out
1189
+ )
1190
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
1191
+ if type(elements) is list:
1192
+ if len(elements) == 0:
1193
+ return NO_ELEMENTS_FOUND
1194
+ return elements
1195
+
1196
+ def get_relationships_with_property_value(
1197
+ self,
1198
+ relationship_type: str,
1199
+ property_value: str,
1200
+ property_names: [str],
1201
+ effective_time: str = None,
1202
+ for_lineage: bool = None,
1203
+ for_duplicate_processing: bool = None,
1204
+ start_from: int = 0,
1205
+ page_size: int = max_paging_size,
1206
+ time_out: int = default_time_out,
1207
+ ) -> list | str:
1208
+ """
1209
+ Retrieve relationships of the requested relationship type name and with the requested a value found in
1210
+ one of the relationship's properties specified. The value must match exactly.
1211
+
1212
+ Parameters
1213
+ ----------
1214
+ relationship_type: str
1215
+ - the type of relationship to navigate to related elements
1216
+ property_value: str
1217
+ - property value to be searched.
1218
+ property_names: [str]
1219
+ - property names to search in.
1220
+ effective_time: str, default = None
1221
+ - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
1222
+ for_lineage: bool, default is set by server
1223
+ - determines if elements classified as Memento should be returned - normally false
1224
+ for_duplicate_processing: bool, default is set by server
1225
+ - Normally false. Set true when the caller is part of a deduplication function
1226
+ start_from: int, default = 0
1227
+ - index of the list to start from (0 for start).
1228
+ page_size
1229
+ - maximum number of elements to return.
1230
+
1231
+
1232
+ time_out: int, default = default_time_out
1233
+ - http request timeout for this request
1234
+
1235
+ Returns
1236
+ -------
1237
+ [dict] | str
1238
+ Returns a string if no elements found and a list of dict of elements with the results.
1239
+
1240
+ Raises
1241
+ ------
1242
+ InvalidParameterException
1243
+ one of the parameters is null or invalid or
1244
+ PropertyServerException
1245
+ There is a problem adding the element properties to the metadata repository or
1246
+ UserNotAuthorizedException
1247
+ the requesting user is not authorized to issue this request.
1248
+ """
1249
+
1250
+ loop = asyncio.get_event_loop()
1251
+ response = loop.run_until_complete(
1252
+ self._async_get_relationships_with_property_value(
1253
+ relationship_type,
1254
+ property_value,
1255
+ property_names,
1256
+ effective_time,
1257
+ for_lineage,
1258
+ for_duplicate_processing,
1259
+ start_from,
1260
+ page_size,
1261
+ time_out,
1262
+ )
1263
+ )
1264
+ return response
935
1265
 
936
1266
  async def async_get_connector_guid(self, connector_name: str) -> str:
937
1267
  """Get the guid of a connector. Async version.
@@ -940,7 +1270,7 @@ class Client2:
940
1270
  Returns:
941
1271
  str: The guid of the connector.
942
1272
  """
943
- rel = await self.async_get_relationships_with_property_value(relationship_type="RegisteredIntegrationConnector",
1273
+ rel = await self._async_get_relationships_with_property_value(relationship_type="RegisteredIntegrationConnector",
944
1274
  property_names=["connectorName"],
945
1275
  property_value=connector_name,
946
1276
  )
@@ -972,123 +1302,7 @@ class Client2:
972
1302
  )
973
1303
  return result
974
1304
 
975
- # async def async_get_catalog_template_guids(
976
- # self,
977
- # element_name: str
978
- # ) -> lists | str:
979
- # """
980
- # Retrieve template guids for an element.
981
- # Parameters
982
- # ----------
983
- # element_name: str
984
- # - unique identifier for the element to retrieve the guids for.
985
- #
986
- # Returns
987
- # -------
988
- # [str]] | str
989
- # Returns a string if no elements found and a list of dict of elements with the results.
990
- #
991
- # Raises
992
- # ------
993
- # InvalidParameterException
994
- # one of the parameters is null or invalid or
995
- # PropertyServerException
996
- # There is a problem adding the element properties to the metadata repository or
997
- # UserNotAuthorizedException
998
- # the requesting user is not authorized to issue this request.
999
- # """
1000
- #
1001
- # body = {
1002
- # "class": "FindPropertyNamesProperties",
1003
- # "openMetadataType": relationship_type,
1004
- # "propertyValue": property_value,
1005
- # "propertyNames": property_names,
1006
- # "effectiveTime": effective_time,
1007
- # }
1008
- #
1009
- # url = (
1010
- # f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/classification-manager/relationships/"
1011
- # f"with-exact-property-value"
1012
- # )
1013
- #
1014
- # response: Response = await self._async_make_request(
1015
- # "POST", url, body_slimmer(body), time_out=time_out
1016
- # )
1017
- # rels = response.json().get("relationships", NO_ELEMENTS_FOUND)
1018
- # if type(rels) is list:
1019
- # if len(rels) == 0:
1020
- # return NO_ELEMENTS_FOUND
1021
- # return rels
1022
- #
1023
- # def get_relationships_with_property_value(
1024
- # self,
1025
- # relationship_type: str,
1026
- # property_value: str,
1027
- # property_names: [str],
1028
- # effective_time: str = None,
1029
- # for_lineage: bool = None,
1030
- # for_duplicate_processing: bool = None,
1031
- # start_from: int = 0,
1032
- # page_size: int = max_paging_size,
1033
- # time_out: int = default_time_out,
1034
- # ) -> list | str:
1035
- # """
1036
- # Retrieve relationships of the requested relationship type name and with the requested a value found in
1037
- # one of the relationship's properties specified. The value must match exactly.
1038
- #
1039
- # Parameters
1040
- # ----------
1041
- # relationship_type: str
1042
- # - the type of relationship to navigate to related elements
1043
- # property_value: str
1044
- # - property value to be searched.
1045
- # property_names: [str]
1046
- # - property names to search in.
1047
- # effective_time: str, default = None
1048
- # - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
1049
- # for_lineage: bool, default is set by server
1050
- # - determines if elements classified as Memento should be returned - normally false
1051
- # for_duplicate_processing: bool, default is set by server
1052
- # - Normally false. Set true when the caller is part of a deduplication function
1053
- # start_from: int, default = 0
1054
- # - index of the list to start from (0 for start).
1055
- # page_size
1056
- # - maximum number of elements to return.
1057
- #
1058
- #
1059
- # time_out: int, default = default_time_out
1060
- # - http request timeout for this request
1061
- #
1062
- # Returns
1063
- # -------
1064
- # [dict] | str
1065
- # Returns a string if no elements found and a list of dict of elements with the results.
1066
- #
1067
- # Raises
1068
- # ------
1069
- # InvalidParameterException
1070
- # one of the parameters is null or invalid or
1071
- # PropertyServerException
1072
- # There is a problem adding the element properties to the metadata repository or
1073
- # UserNotAuthorizedException
1074
- # the requesting user is not authorized to issue this request.
1075
- # """
1076
- #
1077
- # loop = asyncio.get_event_loop()
1078
- # response = loop.run_until_complete(
1079
- # self._async_get_relationships_with_property_value(
1080
- # relationship_type,
1081
- # property_value,
1082
- # property_names,
1083
- # effective_time,
1084
- # for_lineage,
1085
- # for_duplicate_processing,
1086
- # start_from,
1087
- # page_size,
1088
- # time_out,
1089
- # )
1090
- # )
1091
- # return response
1305
+
1092
1306
 
1093
1307
  #
1094
1308
  # Helper functions for requests
@@ -1351,7 +1565,7 @@ class Client2:
1351
1565
  json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
1352
1566
 
1353
1567
  response = await self._async_make_request("POST", url, json_body)
1354
- elements = response.json().get("elements", NO_ELEMENTS_FOUND)
1568
+ elements = response.json().get("element", NO_ELEMENTS_FOUND)
1355
1569
  if type(elements) is str:
1356
1570
  logger.info(NO_ELEMENTS_FOUND)
1357
1571
  return NO_ELEMENTS_FOUND