pyegeria 5.3.6.2.4__py3-none-any.whl → 5.3.6.3__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.
Files changed (31) hide show
  1. pyegeria/__init__.py +3 -0
  2. pyegeria/commands/cat/{freddies-inbox → dr_egeria_inbox}/freddie_intro.md +64 -16
  3. pyegeria/commands/cat/{freddie_jupyter.py → dr_egeria_jupyter.py} +8 -16
  4. pyegeria/commands/cat/{freddie_md.py → dr_egeria_md.py} +29 -32
  5. pyegeria/commands/cat/glossary_actions.py +59 -1
  6. pyegeria/commands/cat/list_categories.py +185 -0
  7. pyegeria/commands/cat/list_glossaries.py +26 -33
  8. pyegeria/commands/cat/list_terms.py +47 -47
  9. pyegeria/commands/cli/egeria.py +51 -61
  10. pyegeria/commands/cli/egeria_cat.py +53 -31
  11. pyegeria/create_tech_guid_lists.py +2 -5
  12. pyegeria/glossary_browser_omvs.py +257 -105
  13. pyegeria/glossary_manager_omvs.py +148 -1591
  14. pyegeria/md_processing_utils.py +816 -0
  15. {pyegeria-5.3.6.2.4.dist-info → pyegeria-5.3.6.3.dist-info}/METADATA +1 -1
  16. {pyegeria-5.3.6.2.4.dist-info → pyegeria-5.3.6.3.dist-info}/RECORD +21 -29
  17. {pyegeria-5.3.6.2.4.dist-info → pyegeria-5.3.6.3.dist-info}/entry_points.txt +5 -0
  18. pyegeria/commands/cat/freddie_jup.py +0 -124
  19. pyegeria/commands/cat/freddie_utils.py +0 -590
  20. pyegeria/commands/cat/freddies-outbox/Terms-2025-03-06-13-19-29-Report.md +0 -69
  21. pyegeria/commands/cat/freddies-outbox/Terms-2025-03-06-13-20-30-Update-Form.md +0 -78
  22. pyegeria/commands/cat/glossary_creation_experiment.ipynb +0 -235
  23. pyegeria/test_j.html +0 -0
  24. pyegeria/test_m.html +0 -213
  25. pyegeria/test_m1.html +0 -273
  26. pyegeria/test_mer.ipynb +0 -596
  27. pyegeria/test_w.html +0 -213
  28. /pyegeria/commands/cat/{freddies-inbox → dr_egeria_inbox}/glossary_creation_experiment.ipynb +0 -0
  29. /pyegeria/commands/cat/{freddies-inbox → dr_egeria_inbox}/glossary_exp.md +0 -0
  30. {pyegeria-5.3.6.2.4.dist-info → pyegeria-5.3.6.3.dist-info}/LICENSE +0 -0
  31. {pyegeria-5.3.6.2.4.dist-info → pyegeria-5.3.6.3.dist-info}/WHEEL +0 -0
@@ -13,15 +13,14 @@ import os
13
13
  import time
14
14
  from datetime import datetime
15
15
  from typing import List
16
- from pyegeria._globals import NO_ELEMENTS_FOUND
17
- from pyegeria._exceptions import InvalidParameterException
18
16
 
19
- # import json
20
17
  from pyegeria._client import Client
21
- from pyegeria._validators import validate_guid, validate_name, validate_search_string
18
+ from pyegeria._exceptions import InvalidParameterException
19
+ from pyegeria._globals import NO_TERMS_FOUND
20
+ from pyegeria._validators import validate_guid, validate_name
22
21
  from pyegeria.glossary_browser_omvs import GlossaryBrowser
23
22
  from pyegeria.utils import body_slimmer
24
- from pyegeria._globals import NO_CATEGORIES_FOUND,NO_TERMS_FOUND, NO_GLOSSARIES_FOUND, NO_ELEMENTS_FOUND
23
+
25
24
 
26
25
  class GlossaryManager(GlossaryBrowser):
27
26
  """
@@ -165,7 +164,6 @@ class GlossaryManager(GlossaryBrowser):
165
164
  )
166
165
 
167
166
  await self._async_make_request("POST", url)
168
- return
169
167
 
170
168
  def delete_glossary(self, glossary_guid: str) -> None:
171
169
  """Create a new glossary.
@@ -182,8 +180,7 @@ class GlossaryManager(GlossaryBrowser):
182
180
 
183
181
  """
184
182
  loop = asyncio.get_event_loop()
185
- response = loop.run_until_complete(self._async_delete_glossary(glossary_guid))
186
- return response
183
+ loop.run_until_complete(self._async_delete_glossary(glossary_guid))
187
184
 
188
185
  async def _async_update_glossary(
189
186
  self,
@@ -240,7 +237,6 @@ class GlossaryManager(GlossaryBrowser):
240
237
  )
241
238
 
242
239
  await self._async_make_request("POST", url, body_slimmer(body))
243
- return
244
240
 
245
241
  def update_glossary(
246
242
  self,
@@ -297,118 +293,13 @@ class GlossaryManager(GlossaryBrowser):
297
293
  for_duplicate_processing,
298
294
  )
299
295
  )
300
- return
301
296
 
302
297
  #
303
298
  # Glossaries
304
299
  #
305
300
 
306
301
 
307
- async def _async_get_glossaries_by_name(
308
- self,
309
- glossary_name: str,
310
- effective_time: str = None,
311
- start_from: int = 0,
312
- page_size: int = None,
313
- ) -> dict | str:
314
- """Retrieve the list of glossary metadata elements with an exactly matching qualified or display name.
315
- There are no wildcards supported on this request.
316
-
317
- Parameters
318
- ----------
319
- glossary_name: str,
320
- Name of the glossary to be retrieved
321
- effective_time: datetime, [default=None], optional
322
- Effective time of the query. If not specified will default to any effective time. Time format is
323
- "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
324
-
325
- start_from: int, [default=0], optional
326
- When multiple pages of results are available, the page number to start from.
327
- page_size: int, [default=None]
328
- The number of items to return in a single page. If not specified, the default will be taken from
329
- the class instance.
330
-
331
- Returns
332
- -------
333
- None
334
-
335
- Raises
336
- ------
337
-
338
- InvalidParameterException
339
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
340
- PropertyServerException
341
- Raised by the server when an issue arises in processing a valid request
342
- NotAuthorizedException
343
- The principle specified by the user_id does not have authorization for the requested action
344
- ConfigurationErrorException
345
- Raised when configuration parameters passed on earlier calls turn out to be
346
- invalid or make the new call invalid.
347
- """
348
-
349
- if page_size is None:
350
- page_size = self.page_size
351
- validate_name(glossary_name)
352
-
353
- if effective_time is None:
354
- body = {"name": glossary_name}
355
- else:
356
- body = {"name": glossary_name, "effectiveTime": effective_time}
357
-
358
- url = (
359
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/"
360
- f"by-name?startFrom={start_from}&pageSize={page_size}"
361
- )
362
-
363
- response = await self._async_make_request("POST", url, body)
364
- return response.json().get("elementList", "No glossaries found")
365
-
366
- def get_glossaries_by_name(
367
- self,
368
- glossary_name: str,
369
- effective_time: str = None,
370
- start_from: int = 0,
371
- page_size: int = None,
372
- ) -> dict | str:
373
- """Retrieve the list of glossary metadata elements with an exactly matching qualified or display name.
374
- There are no wildcards supported on this request.
375
-
376
- Parameters
377
- ----------
378
- glossary_name: str,
379
- Name of the glossary to be retrieved
380
- effective_time: datetime, [default=None], optional
381
- Effective time of the query. If not specified will default to any effective time.
382
-
383
- start_from: int, [default=0], optional
384
- When multiple pages of results are available, the page number to start from.
385
- page_size: int, [default=None]
386
- The number of items to return in a single page. If not specified, the default will be taken from
387
- he class instance.
388
-
389
- Returns
390
- -------
391
- None
392
302
 
393
- Raises
394
- ------
395
- InvalidParameterException
396
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
397
- PropertyServerException
398
- Raised by the server when an issue arises in processing a valid request
399
- NotAuthorizedException
400
- The principle specified by the user_id does not have authorization for the requested action
401
- ConfigurationErrorException
402
- Raised when configuration parameters passed on earlier calls turn out to be
403
- invalid or make the new call invalid.
404
- """
405
- loop = asyncio.get_event_loop()
406
- response = loop.run_until_complete(
407
- self._async_get_glossaries_by_name(
408
- glossary_name, effective_time, start_from, page_size
409
- )
410
- )
411
- return response
412
303
 
413
304
  #
414
305
  # Glossary Categories
@@ -558,9 +449,8 @@ class GlossaryManager(GlossaryBrowser):
558
449
  Raised when configuration parameters passed on earlier calls turn out to be
559
450
  invalid or make the new call invalid.
560
451
  """
561
- if not is_merge_update:
562
- if qualified_name is None:
563
- raise ValueError('qualified_name must be specified for a replace update')
452
+ if (not is_merge_update and qualified_name is None):
453
+ raise ValueError('qualified_name must be specified for a replace update')
564
454
  url = (
565
455
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
566
456
  f"categories/{category_guid}/update?isMergeUpdate={is_merge_update}"
@@ -707,724 +597,6 @@ class GlossaryManager(GlossaryBrowser):
707
597
 
708
598
 
709
599
 
710
- async def _async_get_glossary_for_category(
711
- self,
712
- glossary_category_guid: str,
713
- effective_time: str = None,
714
- ) -> dict | str:
715
- """Retrieve the glossary metadata element for the requested category. The optional request body allows you to
716
- specify that the glossary element should only be returned if it was effective at a particular time.
717
-
718
- Parameters
719
- ----------
720
- glossary_category_guid: str,
721
- Unique identifier for the glossary category.
722
- effective_time: datetime, [default=None], optional
723
- Effective time of the query. If not specified will default to any effective time. Time format is
724
- "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
725
-
726
-
727
- Returns
728
- -------
729
- A dict structure with the glossary metadata element for the requested category.
730
-
731
- Raises
732
- ------
733
-
734
- InvalidParameterException
735
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
736
- PropertyServerException
737
- Raised by the server when an issue arises in processing a valid request
738
- NotAuthorizedException
739
- The principle specified by the user_id does not have authorization for the requested action
740
- ConfigurationErrorException
741
- Raised when configuration parameters passed on earlier calls turn out to be
742
- invalid or make the new call invalid.
743
- """
744
-
745
- body = {
746
- "class": "EffectiveTimeQueryRequestBody",
747
- "effectiveTime": effective_time,
748
- }
749
-
750
- url = (
751
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
752
- f"for-category/{glossary_category_guid}/retrieve"
753
- )
754
-
755
- response = await self._async_make_request("POST", url, body)
756
- return response.json()
757
-
758
- def get_glossary_for_category(
759
- self,
760
- glossary_category_guid: str,
761
- effective_time: str = None,
762
- ) -> dict | str:
763
- """Retrieve the glossary metadata element for the requested category. The optional request body allows you to
764
- specify that the glossary element should only be returned if it was effective at a particular time.
765
-
766
- Parameters
767
- ----------
768
- glossary_category_guid: str,
769
- Unique identifier for the glossary category.
770
- effective_time: datetime, [default=None], optional
771
- Effective time of the query. If not specified will default to any effective time. Time format is
772
- "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
773
-
774
-
775
- Returns
776
- -------
777
- A dict structure with the glossary metadata element for the requested category.
778
-
779
- Raises
780
- ------
781
-
782
- InvalidParameterException
783
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
784
- PropertyServerException
785
- Raised by the server when an issue arises in processing a valid request
786
- NotAuthorizedException
787
- The principle specified by the user_id does not have authorization for the requested action
788
- ConfigurationErrorException
789
- Raised when configuration parameters passed on earlier calls turn out to be
790
- invalid or make the new call invalid.
791
- """
792
- loop = asyncio.get_event_loop()
793
- response = loop.run_until_complete(
794
- self._async_get_glossary_for_category(
795
- glossary_category_guid, effective_time
796
- )
797
- )
798
- return response
799
-
800
- # async def _async_find_glossary_categories(
801
- # self,
802
- # search_string: str,
803
- # effective_time: str = None,
804
- # starts_with: bool = False,
805
- # ends_with: bool = False,
806
- # ignore_case: bool = False,
807
- # start_from: int = 0,
808
- # page_size: int = None,
809
- # ) -> list | str:
810
- # """Retrieve the list of glossary category metadata elements that contain the search string.
811
- # The search string is located in the request body and is interpreted as a plain string.
812
- # The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
813
- # Async version.
814
- #
815
- # Parameters
816
- # ----------
817
- # search_string: str,
818
- # Search string to use to find matching glossaries. If the search string is '*' then all glossaries returned.
819
- #
820
- # effective_time: str, [default=None], optional
821
- # Effective time of the query. If not specified will default to any time. Time format is
822
- # "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
823
- #
824
- # starts_with : bool, [default=False], optional
825
- # Starts with the supplied string.
826
- # ends_with : bool, [default=False], optional
827
- # Ends with the supplied string
828
- # ignore_case : bool, [default=False], optional
829
- # Ignore case when searching
830
- # start_from: int, [default=0], optional
831
- # When multiple pages of results are available, the page number to start from.
832
- # page_size: int, [default=None]
833
- # The number of items to return in a single page. If not specified, the default will be taken from
834
- # the class instance.
835
- # Returns
836
- # -------
837
- # List | str
838
- #
839
- # A list of glossary definitions active in the server.
840
- #
841
- # Raises
842
- # ------
843
- #
844
- # InvalidParameterException
845
- # If the client passes incorrect parameters on the request - such as bad URLs or invalid values
846
- # PropertyServerException
847
- # Raised by the server when an issue arises in processing a valid request
848
- # NotAuthorizedException
849
- # The principle specified by the user_id does not have authorization for the requested action
850
- #
851
- # """
852
- #
853
- # if page_size is None:
854
- # page_size = self.page_size
855
- # starts_with_s = str(starts_with).lower()
856
- # ends_with_s = str(ends_with).lower()
857
- # ignore_case_s = str(ignore_case).lower()
858
- #
859
- # validate_search_string(search_string)
860
- #
861
- # if search_string == "*":
862
- # search_string = None
863
- #
864
- # body = {
865
- # "class": "SearchStringRequestBody",
866
- # "searchString": search_string,
867
- # "effectiveTime": effective_time,
868
- # }
869
- # body = body_slimmer(body)
870
- #
871
- # url = (
872
- # f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
873
- # f"categories/by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
874
- # f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
875
- # )
876
- #
877
- # response = await self._async_make_request("POST", url, body)
878
- # return response.json().get("elementList", "No Categories found")
879
- #
880
- # def find_glossary_categories(
881
- # self,
882
- # search_string: str,
883
- # effective_time: str = None,
884
- # starts_with: bool = False,
885
- # ends_with: bool = False,
886
- # ignore_case: bool = False,
887
- # start_from: int = 0,
888
- # page_size: int = None,
889
- # ) -> list | str:
890
- # """Retrieve the list of glossary category metadata elements that contain the search string.
891
- # The search string is located in the request body and is interpreted as a plain string.
892
- # The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
893
- #
894
- # Parameters
895
- # ----------
896
- # search_string: str,
897
- # Search string to use to find matching glossaries. If the search string is '*' then all glossaries returned.
898
- #
899
- # effective_time: str, [default=None], optional
900
- # Effective time of the query. If not specified will default to any time. Time format is
901
- # "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
902
- #
903
- # starts_with : bool, [default=False], optional
904
- # Starts with the supplied string.
905
- # ends_with : bool, [default=False], optional
906
- # Ends with the supplied string
907
- # ignore_case : bool, [default=False], optional
908
- # Ignore case when searching
909
- # start_from: int, [default=0], optional
910
- # When multiple pages of results are available, the page number to start from.
911
- # page_size: int, [default=None]
912
- # The number of items to return in a single page. If not specified, the default will be taken from
913
- # the class instance.
914
- # Returns
915
- # -------
916
- # List | str
917
- #
918
- # A list of glossary definitions active in the server.
919
- #
920
- # Raises
921
- # ------
922
- #
923
- # InvalidParameterException
924
- # If the client passes incorrect parameters on the request - such as bad URLs or invalid values
925
- # PropertyServerException
926
- # Raised by the server when an issue arises in processing a valid request
927
- # NotAuthorizedException
928
- # The principle specified by the user_id does not have authorization for the requested action
929
- #
930
- # """
931
- # loop = asyncio.get_event_loop()
932
- # response = loop.run_until_complete(
933
- # self._async_find_glossary_categories(
934
- # search_string,
935
- # effective_time,
936
- # starts_with,
937
- # ends_with,
938
- # ignore_case,
939
- # start_from,
940
- # page_size,
941
- # )
942
- # )
943
- #
944
- # return response
945
-
946
- # async def _async_get_categories_for_glossary(
947
- # self,
948
- # glossary_guid: str,
949
- # start_from: int = 0,
950
- # page_size: int = None,
951
- # ) -> list | str:
952
- # """Return the list of categories associated with a glossary.
953
- # Async version.
954
- #
955
- # Parameters
956
- # ----------
957
- # glossary_guid: str,
958
- # Unique identity of the glossary
959
- #
960
- # start_from: int, [default=0], optional
961
- # When multiple pages of results are available, the page number to start from.
962
- # page_size: int, [default=None]
963
- # The number of items to return in a single page. If not specified, the default will be taken from
964
- # the class instance.
965
- # Returns
966
- # -------
967
- # List | str
968
- #
969
- # A list of categories associated with a glossary.
970
- #
971
- # Raises
972
- # ------
973
- #
974
- # InvalidParameterException
975
- # If the client passes incorrect parameters on the request - such as bad URLs or invalid values
976
- # PropertyServerException
977
- # Raised by the server when an issue arises in processing a valid request
978
- # NotAuthorizedException
979
- # The principle specified by the user_id does not have authorization for the requested action
980
- #
981
- # """
982
- #
983
- # if page_size is None:
984
- # page_size = self.page_size
985
- #
986
- # url = (
987
- # f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/"
988
- # f"{glossary_guid}/categories/retrieve?startFrom={start_from}&pageSize={page_size}"
989
- # )
990
- #
991
- # response = await self._async_make_request("POST", url)
992
- # return response.json().get("elementList", "No Categories found")
993
- #
994
- # def get_categories_for_glossary(
995
- # self,
996
- # glossary_guid: str,
997
- # start_from: int = 0,
998
- # page_size: int = None,
999
- # ) -> list | str:
1000
- # """Return the list of categories associated with a glossary.
1001
- #
1002
- # Parameters
1003
- # ----------
1004
- # glossary_guid: str,
1005
- # Unique identity of the glossary
1006
- #
1007
- # start_from: int, [default=0], optional
1008
- # When multiple pages of results are available, the page number to start from.
1009
- # page_size: int, [default=None]
1010
- # The number of items to return in a single page. If not specified, the default will be taken from
1011
- # the class instance.
1012
- # Returns
1013
- # -------
1014
- # List | str
1015
- #
1016
- # A list of categories associated with a glossary.
1017
- #
1018
- # Raises
1019
- # ------
1020
- #
1021
- # InvalidParameterException
1022
- # If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1023
- # PropertyServerException
1024
- # Raised by the server when an issue arises in processing a valid request
1025
- # NotAuthorizedException
1026
- # The principle specified by the user_id does not have authorization for the requested action
1027
- #
1028
- # """
1029
- # loop = asyncio.get_event_loop()
1030
- # response = loop.run_until_complete(
1031
- # self._async_get_categories_for_glossary(
1032
- # glossary_guid, start_from, page_size
1033
- # )
1034
- # )
1035
- # return response
1036
- #
1037
- # async def _async_get_categories_for_term(
1038
- # self,
1039
- # glossary_term_guid: str,
1040
- # start_from: int = 0,
1041
- # page_size: int = None,
1042
- # ) -> list | str:
1043
- # """Return the list of categories associated with a glossary term.
1044
- # Async version.
1045
- #
1046
- # Parameters
1047
- # ----------
1048
- # glossary_term_guid: str,
1049
- # Unique identity of a glossary term
1050
- #
1051
- # start_from: int, [default=0], optional
1052
- # When multiple pages of results are available, the page number to start from.
1053
- # page_size: int, [default=None]
1054
- # The number of items to return in a single page. If not specified, the default will be taken from
1055
- # the class instance.
1056
- # Returns
1057
- # -------
1058
- # List | str
1059
- #
1060
- # A list of categories associated with a glossary term.
1061
- #
1062
- # Raises
1063
- # ------
1064
- #
1065
- # InvalidParameterException
1066
- # If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1067
- # PropertyServerException
1068
- # Raised by the server when an issue arises in processing a valid request
1069
- # NotAuthorizedException
1070
- # The principle specified by the user_id does not have authorization for the requested action
1071
- #
1072
- # """
1073
- #
1074
- # if page_size is None:
1075
- # page_size = self.page_size
1076
- #
1077
- # url = (
1078
- # f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/terms/"
1079
- # f"{glossary_term_guid}/categories/retrieve?startFrom={start_from}&pageSize={page_size}"
1080
- # )
1081
- #
1082
- # response = await self._async_make_request("POST", url)
1083
- # return response.json().get("elementList", "No Categories found")
1084
- #
1085
- # def get_categories_for_term(
1086
- # self,
1087
- # glossary_term_guid: str,
1088
- # start_from: int = 0,
1089
- # page_size: int = None,
1090
- # ) -> list | str:
1091
- # """Return the list of categories associated with a glossary term.
1092
- #
1093
- # Parameters
1094
- # ----------
1095
- # glossary_term_guid: str,
1096
- # Unique identity of a glossary term
1097
- #
1098
- # start_from: int, [default=0], optional
1099
- # When multiple pages of results are available, the page number to start from.
1100
- # page_size: int, [default=None]
1101
- # The number of items to return in a single page. If not specified, the default will be taken from
1102
- # the class instance.
1103
- # Returns
1104
- # -------
1105
- # List | str
1106
- #
1107
- # A list of categories associated with a glossary term.
1108
- #
1109
- # Raises
1110
- # ------
1111
- #
1112
- # InvalidParameterException
1113
- # If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1114
- # PropertyServerException
1115
- # Raised by the server when an issue arises in processing a valid request
1116
- # NotAuthorizedException
1117
- # The principle specified by the user_id does not have authorization for the requested action
1118
- #
1119
- # """
1120
- # loop = asyncio.get_event_loop()
1121
- # response = loop.run_until_complete(
1122
- # self._async_get_categories_for_term(
1123
- # glossary_term_guid, start_from, page_size
1124
- # )
1125
- # )
1126
- # return response
1127
- #
1128
- # async def _async_get_categories_by_name(
1129
- # self,
1130
- # name: str,
1131
- # glossary_guid: str = None,
1132
- # status: [str] = ["ACTIVE"],
1133
- # start_from: int = 0,
1134
- # page_size: int = None,
1135
- # ) -> list | str:
1136
- # """Retrieve the list of glossary category metadata elements that either have the requested qualified name or display name.
1137
- # The name to search for is located in the request body and is interpreted as a plain string.
1138
- # The request body also supports the specification of a glossaryGUID to restrict the search to within a single glossary.
1139
- #
1140
- # Async version.
1141
- #
1142
- # Parameters
1143
- # ----------
1144
- # name: str,
1145
- # category name to search for.
1146
- # glossary_guid: str, optional
1147
- # The identity of the glossary to search. If not specified, all glossaries will be searched.
1148
- # status: [str], optional
1149
- # A list of statuses to optionally restrict results. Default is Active
1150
- #
1151
- # start_from: int, [default=0], optional
1152
- # When multiple pages of results are available, the page number to start from.
1153
- # page_size: int, [default=None]
1154
- # The number of items to return in a single page. If not specified, the default will be taken from
1155
- # the class instance.
1156
- # Returns
1157
- # -------
1158
- # List | str
1159
- #
1160
- # A list of categories with the corresponding display name or qualified name.
1161
- #
1162
- # Raises
1163
- # ------
1164
- #
1165
- # InvalidParameterException
1166
- # If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1167
- # PropertyServerException
1168
- # Raised by the server when an issue arises in processing a valid request
1169
- # NotAuthorizedException
1170
- # The principle specified by the user_id does not have authorization for the requested action
1171
- #
1172
- # """
1173
- #
1174
- # if page_size is None:
1175
- # page_size = self.page_size
1176
- # validate_name(name)
1177
- #
1178
- # url = (
1179
- # f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/categories/"
1180
- # f"by-name?startFrom={start_from}&pageSize={page_size}"
1181
- # )
1182
- #
1183
- # body = {
1184
- # "class": "GlossaryNameRequestBody",
1185
- # "name": name,
1186
- # "glossaryGUID": glossary_guid,
1187
- # "limitResultsByStatus": status,
1188
- # }
1189
- #
1190
- # response = await self._async_make_request("POST", url)
1191
- # return response.json().get("elementList", "No Categories found")
1192
- #
1193
- # def get_categories_by_name(
1194
- # self,
1195
- # name: str,
1196
- # glossary_guid: str = None,
1197
- # status: [str] = ["ACTIVE"],
1198
- # start_from: int = 0,
1199
- # page_size: int = None,
1200
- # ) -> list | str:
1201
- # """Retrieve the list of glossary category metadata elements that either have the requested qualified name or display name.
1202
- # The name to search for is located in the request body and is interpreted as a plain string.
1203
- # The request body also supports the specification of a glossaryGUID to restrict the search to within a single glossary.
1204
- #
1205
- # Parameters
1206
- # ----------
1207
- # name: str,
1208
- # category name to search for.
1209
- # glossary_guid: str, optional
1210
- # The identity of the glossary to search. If not specified, all glossaries will be searched.
1211
- # status: [str], optional
1212
- # A list of statuses to optionally restrict results. Default is Active
1213
- #
1214
- # start_from: int, [default=0], optional
1215
- # When multiple pages of results are available, the page number to start from.
1216
- # page_size: int, [default=None]
1217
- # The number of items to return in a single page. If not specified, the default will be taken from
1218
- # the class instance.
1219
- # Returns
1220
- # -------
1221
- # List | str
1222
- #
1223
- # A list of categories with the corresponding display name or qualified name.
1224
- #
1225
- # Raises
1226
- # ------
1227
- #
1228
- # InvalidParameterException
1229
- # If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1230
- # PropertyServerException
1231
- # Raised by the server when an issue arises in processing a valid request
1232
- # NotAuthorizedException
1233
- # The principle specified by the user_id does not have authorization for the requested action
1234
- #
1235
- # """
1236
- # loop = asyncio.get_event_loop()
1237
- # response = loop.run_until_complete(
1238
- # self._async_get_categories_by_name(
1239
- # name, glossary_guid, status, start_from, page_size
1240
- # )
1241
- # )
1242
- # return response
1243
- #
1244
- # async def _async_get_categories_by_guid(
1245
- # self,
1246
- # glossary_category_guid: str,
1247
- # effective_time: str = None,
1248
- # ) -> list | str:
1249
- # """Retrieve the requested glossary category metadata element. The optional request body contain an effective
1250
- # time for the query..
1251
- #
1252
- # Async version.
1253
- #
1254
- # Parameters
1255
- # ----------
1256
- # glossary_category_guid: str
1257
- # The identity of the glossary category to search.
1258
- # effective_time: str, optional
1259
- # If specified, the category should only be returned if it was effective at the specified time.
1260
- # Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
1261
- #
1262
- #
1263
- # Returns
1264
- # -------
1265
- # List | str
1266
- #
1267
- # Details for the category with the glossary category GUID.
1268
- #
1269
- # Raises
1270
- # ------
1271
- #
1272
- # InvalidParameterException
1273
- # If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1274
- # PropertyServerException
1275
- # Raised by the server when an issue arises in processing a valid request
1276
- # NotAuthorizedException
1277
- # The principle specified by the user_id does not have authorization for the requested action
1278
- #
1279
- # """
1280
- #
1281
- # url = (
1282
- # f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/categories/"
1283
- # f"{glossary_category_guid}/retrieve"
1284
- # )
1285
- #
1286
- # body = {
1287
- # "class": "EffectiveTimeQueryRequestBody",
1288
- # "effectiveTime": effective_time,
1289
- # }
1290
- #
1291
- # response = await self._async_make_request("POST", url, body)
1292
- # return response.json().get("element", "No Category found")
1293
- #
1294
- # def get_categories_by_guid(
1295
- # self,
1296
- # glossary_category_guid: str,
1297
- # effective_time: str = None,
1298
- # ) -> list | str:
1299
- # """Retrieve the requested glossary category metadata element. The optional request body contain an effective
1300
- # time for the query..
1301
- #
1302
- # Parameters
1303
- # ----------
1304
- # glossary_category_guid: str
1305
- # The identity of the glossary category to search.
1306
- # effective_time, datetime, optional
1307
- # If specified, the category should only be returned if it was effective at the specified time.
1308
- # Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
1309
- #
1310
- #
1311
- # Returns
1312
- # -------
1313
- # List | str
1314
- #
1315
- # Details for the category with the glossary category GUID.
1316
- #
1317
- # Raises
1318
- # ------
1319
- #
1320
- # InvalidParameterException
1321
- # If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1322
- # PropertyServerException
1323
- # Raised by the server when an issue arises in processing a valid request
1324
- # NotAuthorizedException
1325
- # The principle specified by the user_id does not have authorization for the requested action
1326
- #
1327
- # """
1328
- # loop = asyncio.get_event_loop()
1329
- # response = loop.run_until_complete(
1330
- # self._async_get_categories_by_guid(glossary_category_guid, effective_time)
1331
- # )
1332
- # return response
1333
- #
1334
- # async def _async_get_category_parent(
1335
- # self,
1336
- # glossary_category_guid: str,
1337
- # effective_time: str = None,
1338
- # ) -> list | str:
1339
- # """Glossary categories can be organized in a hierarchy. Retrieve the parent glossary category metadata
1340
- # element for the glossary category with the supplied unique identifier. If the requested category
1341
- # does not have a parent category, null is returned. The optional request body contain an effective time
1342
- # for the query.
1343
- #
1344
- # Async version.
1345
- #
1346
- # Parameters
1347
- # ----------
1348
- # glossary_category_guid: str
1349
- # The identity of the glossary category to search.
1350
- # effective_time, datetime, optional
1351
- # If specified, the category should only be returned if it was effective at the specified time.
1352
- # Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
1353
- #
1354
- #
1355
- # Returns
1356
- # -------
1357
- # List | str
1358
- #
1359
- # Details for the parent category with the glossary category GUID.
1360
- #
1361
- # Raises
1362
- # ------
1363
- #
1364
- # InvalidParameterException
1365
- # If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1366
- # PropertyServerException
1367
- # Raised by the server when an issue arises in processing a valid request
1368
- # NotAuthorizedException
1369
- # The principle specified by the user_id does not have authorization for the requested action
1370
- #
1371
- # """
1372
- #
1373
- # url = (
1374
- # f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/categories/"
1375
- # f"{glossary_category_guid}/parent/retrieve"
1376
- # )
1377
- #
1378
- # body = {
1379
- # "class": "EffectiveTimeQueryRequestBody",
1380
- # "effectiveTime": effective_time,
1381
- # }
1382
- #
1383
- # response = await self._async_make_request("POST", url, body)
1384
- # return response.json().get("element", "No Parent Category found")
1385
- #
1386
- # def get_category_parent(
1387
- # self,
1388
- # glossary_category_guid: str,
1389
- # effective_time: str = None,
1390
- # ) -> list | str:
1391
- # """Glossary categories can be organized in a hierarchy. Retrieve the parent glossary category metadata
1392
- # element for the glossary category with the supplied unique identifier. If the requested category
1393
- # does not have a parent category, null is returned. The optional request body contain an effective time
1394
- # for the query.
1395
- #
1396
- # Parameters
1397
- # ----------
1398
- # glossary_category_guid: str
1399
- # The identity of the glossary category to search.
1400
- # effective_time, datetime, optional
1401
- # If specified, the category should only be returned if it was effective at the specified time.
1402
- # Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
1403
- #
1404
- #
1405
- # Returns
1406
- # -------
1407
- # List | str
1408
- #
1409
- # Details for the parent category with the glossary category GUID.
1410
- #
1411
- # Raises
1412
- # ------
1413
- #
1414
- # InvalidParameterException
1415
- # If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1416
- # PropertyServerException
1417
- # Raised by the server when an issue arises in processing a valid request
1418
- # NotAuthorizedException
1419
- # The principle specified by the user_id does not have authorization for the requested action
1420
- #
1421
- # """
1422
- # loop = asyncio.get_event_loop()
1423
- # response = loop.run_until_complete(
1424
- # self._async_get_category_parent(glossary_category_guid, effective_time)
1425
- # )
1426
- # return response
1427
-
1428
600
  #
1429
601
  # Terms
1430
602
  #
@@ -2125,9 +1297,147 @@ class GlossaryManager(GlossaryBrowser):
2125
1297
 
2126
1298
  return
2127
1299
 
2128
- async def _async_add_confidentiality_to_term(
2129
- self,
2130
- glossary_term_guid: str,
1300
+ async def _async_add_term_to_category(
1301
+ self, glossary_term_guid: str, glossary_category_guid: str
1302
+ ) -> None:
1303
+ """Add the term to the specified category. Async Version.
1304
+
1305
+ Parameters
1306
+ ----------
1307
+ glossary_term_guid : str
1308
+ Unique identifier for the glossary term to assign.
1309
+ glossary_category_guid: str
1310
+ Unique identifier for the category the term will be assigned to.
1311
+
1312
+ Returns
1313
+ -------
1314
+ None
1315
+
1316
+ Raises
1317
+ ------
1318
+ InvalidParameterException
1319
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
1320
+ PropertyServerException
1321
+ Raised by the server when an issue arises in processing a valid request.
1322
+ NotAuthorizedException
1323
+ The principle specified by the user_id does not have authorization for the requested action.
1324
+
1325
+ """
1326
+
1327
+ validate_guid(glossary_term_guid)
1328
+ validate_guid(glossary_category_guid)
1329
+
1330
+ url = (
1331
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
1332
+ f"categories/{glossary_category_guid}/terms/{glossary_term_guid}"
1333
+ )
1334
+ body = {
1335
+ "class": "RelationshipRequestBody",
1336
+ "properties": {
1337
+ "class": "GlossaryTermCategorization"
1338
+
1339
+ }
1340
+ }
1341
+
1342
+ await self._async_make_request("POST", url, body)
1343
+
1344
+
1345
+ def add_term_to_category(self, glossary_term_guid: str, glossary_category_guid: str) -> None:
1346
+ """Add the term to the specified category.
1347
+
1348
+ Parameters
1349
+ ----------
1350
+ glossary_term_guid : str
1351
+ Unique identifier for the glossary term to assign.
1352
+ glossary_category_guid: str
1353
+ Unique identifier for the category the term will be assigned to.
1354
+
1355
+ Returns
1356
+ -------
1357
+
1358
+ Raises
1359
+ ------
1360
+ InvalidParameterException
1361
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
1362
+ PropertyServerException
1363
+ Raised by the server when an issue arises in processing a valid request.
1364
+ NotAuthorizedException
1365
+ The principle specified by the user_id does not have authorization for the requested action.
1366
+
1367
+ """
1368
+ loop = asyncio.get_event_loop()
1369
+ loop.run_until_complete(
1370
+ self._async_add_term_to_category(glossary_term_guid, glossary_category_guid)
1371
+ )
1372
+
1373
+ async def _async_remove_term_from_category(
1374
+ self, glossary_term_guid: str, glossary_category_guid: str
1375
+ ) -> None:
1376
+ """Remove the term from the specified category. Async Version.
1377
+
1378
+ Parameters
1379
+ ----------
1380
+ glossary_term_guid : str
1381
+ Unique identifier for the glossary term to assign.
1382
+ glossary_category_guid: str
1383
+ Unique identifier for the category the term will be assigned to.
1384
+
1385
+ Returns
1386
+ -------
1387
+ None
1388
+
1389
+ Raises
1390
+ ------
1391
+ InvalidParameterException
1392
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
1393
+ PropertyServerException
1394
+ Raised by the server when an issue arises in processing a valid request.
1395
+ NotAuthorizedException
1396
+ The principle specified by the user_id does not have authorization for the requested action.
1397
+
1398
+ """
1399
+
1400
+ validate_guid(glossary_term_guid)
1401
+ validate_guid(glossary_category_guid)
1402
+
1403
+ url = (
1404
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
1405
+ f"categories/{glossary_category_guid}/terms/{glossary_term_guid}/remove"
1406
+ )
1407
+ await self._async_make_request("POST", url)
1408
+
1409
+
1410
+ def remove_term_from_category(self, glossary_term_guid: str, glossary_category_guid: str) -> None:
1411
+ """Remove the term from the specified category.
1412
+
1413
+ Parameters
1414
+ ----------
1415
+ glossary_term_guid : str
1416
+ Unique identifier for the glossary term to assign.
1417
+ glossary_category_guid: str
1418
+ Unique identifier for the category the term will be assigned to.
1419
+
1420
+ Returns
1421
+ -------
1422
+
1423
+ Raises
1424
+ ------
1425
+ InvalidParameterException
1426
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
1427
+ PropertyServerException
1428
+ Raised by the server when an issue arises in processing a valid request.
1429
+ NotAuthorizedException
1430
+ The principle specified by the user_id does not have authorization for the requested action.
1431
+
1432
+ """
1433
+ loop = asyncio.get_event_loop()
1434
+ loop.run_until_complete(
1435
+ self._async_remove_term_from_category(glossary_term_guid, glossary_category_guid)
1436
+ )
1437
+
1438
+ async def _async_add_confidentiality_to_term(
1439
+ self,
1440
+ glossary_term_guid: str,
2131
1441
  confidentiality_level: int,
2132
1442
  ) -> None:
2133
1443
  """Add the confidentiality classification to a glossary term
@@ -2594,114 +1904,7 @@ class GlossaryManager(GlossaryBrowser):
2594
1904
  loop = asyncio.get_event_loop()
2595
1905
  loop.run_until_complete(self._async_undo_term_update(glossary_term_guid))
2596
1906
 
2597
- async def _async_get_terms_for_category(
2598
- self,
2599
- glossary_category_guid: str,
2600
- effective_time: str = None,
2601
- start_from: int = 0,
2602
- page_size: int = None,
2603
- ) -> list | str:
2604
- """Retrieve ALL the glossary terms in a category.
2605
- The request body also supports the specification of an effective time for the query.
2606
-
2607
- Async Version.
2608
-
2609
- Parameters
2610
- ----------
2611
- glossary_category_guid : str
2612
- Unique identifier for the glossary category to retrieve terms from.
2613
- effective_time : str, optional
2614
- If specified, the terms are returned if they are active at the `effective_time
2615
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
2616
- start_from: int, optional defaults to 0
2617
- The page number to start retrieving elements from
2618
- page_size : int, optional defaults to None
2619
- The number of elements to retrieve
2620
- Returns
2621
- -------
2622
- dict
2623
- The glossary definition associated with the glossary_guid
2624
-
2625
- Raises
2626
- ------
2627
- InvalidParameterException
2628
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2629
- PropertyServerException
2630
- Raised by the server when an issue arises in processing a valid request.
2631
- NotAuthorizedException
2632
- The principle specified by the user_id does not have authorization for the requested action.
2633
- Notes
2634
- -----
2635
- """
2636
-
2637
- validate_guid(glossary_category_guid)
2638
-
2639
- if page_size is None:
2640
- page_size = self.page_size
2641
-
2642
- url = (
2643
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/terms/"
2644
- f"{glossary_category_guid}/terms/retrieve?startFrom={start_from}&pageSize={page_size}"
2645
- )
2646
-
2647
- if effective_time is not None:
2648
- body = {"effectiveTime": effective_time}
2649
- response = await self._async_make_request("POST", url, body)
2650
- else:
2651
- response = await self._async_make_request("POST", url)
2652
-
2653
- return response.json().get("elementList", NO_TERMS_FOUND)
2654
-
2655
- def get_terms_for_category(
2656
- self,
2657
- glossary_category_guid: str,
2658
- effective_time: str = None,
2659
- start_from: int = 0,
2660
- page_size: int = None,
2661
- ) -> list | str:
2662
- """Retrieve ALL the glossary terms in a category.
2663
- The request body also supports the specification of an effective time for the query.
2664
-
2665
- Async Version.
2666
-
2667
- Parameters
2668
- ----------
2669
- glossary_category_guid : str
2670
- Unique identifier for the glossary category to retrieve terms from.
2671
- effective_time : str, optional
2672
- If specified, the terms are returned if they are active at the `effective_time.
2673
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)`.
2674
- start_from: int, optional defaults to 0
2675
- The page number to start retrieving elements from
2676
- page_size : int, optional defaults to None
2677
- The number of elements to retrieve
2678
- Returns
2679
- -------
2680
- dict
2681
- The glossary definition associated with the glossary_guid
2682
-
2683
- Raises
2684
- ------
2685
- InvalidParameterException
2686
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2687
- PropertyServerException
2688
- Raised by the server when an issue arises in processing a valid request.
2689
- NotAuthorizedException
2690
- The principle specified by the user_id does not have authorization for the requested action.
2691
- Notes
2692
- -----
2693
- """
2694
- loop = asyncio.get_event_loop()
2695
- response = loop.run_until_complete(
2696
- self._async_get_terms_for_category(
2697
- glossary_category_guid,
2698
- effective_time,
2699
- start_from,
2700
- page_size,
2701
- )
2702
- )
2703
1907
 
2704
- return response
2705
1908
 
2706
1909
  async def _async_delete_term(
2707
1910
  self,
@@ -2785,652 +1988,6 @@ class GlossaryManager(GlossaryBrowser):
2785
1988
 
2786
1989
  return
2787
1990
 
2788
- async def _async_get_term_relationships(
2789
- self,
2790
- term_guid: str,
2791
- effective_time: str = None,
2792
- start_from: int = 0,
2793
- page_size: int = None,
2794
- ) -> list | str:
2795
- """This call retrieves details of the glossary terms linked to this glossary term.
2796
- Notice the original org 1 glossary term is linked via the "SourcedFrom" relationship..
2797
- Parameters
2798
- ----------
2799
- term_guid : str
2800
- Unique identifier for the glossary term
2801
- effective_time : str, optional
2802
- If specified, term relationships are included if they are active at the `effective_time`.
2803
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
2804
- start_from: int, optional defaults to 0
2805
- The page number to start retrieving elements from
2806
- page_size : int, optional defaults to None
2807
- The number of elements to retrieve
2808
- Returns
2809
- -------
2810
- dict
2811
- The glossary definition associated with the glossary_guid
2812
-
2813
- Raises
2814
- ------
2815
- InvalidParameterException
2816
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2817
- PropertyServerException
2818
- Raised by the server when an issue arises in processing a valid request.
2819
- NotAuthorizedException
2820
- The principle specified by the user_id does not have authorization for the requested action.
2821
- Notes
2822
- -----
2823
- """
2824
-
2825
- validate_guid(term_guid)
2826
-
2827
- if page_size is None:
2828
- page_size = self.page_size
2829
-
2830
- url = (
2831
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/terms/"
2832
- f"{term_guid}/related-terms?startFrom={start_from}&pageSize={page_size}"
2833
- )
2834
-
2835
- if effective_time is not None:
2836
- body = {"effectiveTime": effective_time}
2837
- response = await self._async_make_request("POST", url, body)
2838
- else:
2839
- response = await self._async_make_request("POST", url)
2840
-
2841
- return response.json().get("elementList", NO_TERMS_FOUND)
2842
-
2843
- def get_term_relationships(
2844
- self,
2845
- term_guid: str,
2846
- effective_time: str = None,
2847
- start_from: int = 0,
2848
- page_size: int = None,
2849
- ) -> list | str:
2850
- """This call retrieves details of the glossary terms linked to this glossary term.
2851
- Notice the original org 1 glossary term is linked via the "SourcedFrom" relationship..
2852
- Parameters
2853
- ----------
2854
- term_guid : str
2855
- Unique identifier for the glossary term
2856
- effective_time : str, optional
2857
- If specified, term relationships are included if they are active at the `effective_time`.
2858
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
2859
- start_from: int, optional defaults to 0
2860
- The page number to start retrieving elements from
2861
- page_size : int, optional defaults to None
2862
- The number of elements to retrieve
2863
- Returns
2864
- -------
2865
- dict
2866
- The glossary definition associated with the glossary_guid
2867
-
2868
- Raises
2869
- ------
2870
- InvalidParameterException
2871
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2872
- PropertyServerException
2873
- Raised by the server when an issue arises in processing a valid request.
2874
- NotAuthorizedException
2875
- The principle specified by the user_id does not have authorization for the requested action.
2876
- Notes
2877
- -----
2878
- """
2879
- loop = asyncio.get_event_loop()
2880
- response = loop.run_until_complete(
2881
- self._async_get_term_relationships(
2882
- term_guid, effective_time, start_from, page_size
2883
- )
2884
- )
2885
-
2886
- return response
2887
-
2888
- async def _async_get_glossary_for_term(
2889
- self, term_guid: str, effective_time: str = None
2890
- ) -> dict | str:
2891
- """Retrieve the glossary metadata element for the requested term. The optional request body allows you to specify
2892
- that the glossary element should only be returned if it was effective at a particular time.
2893
-
2894
- Async Version.
2895
-
2896
- Parameters
2897
- ----------
2898
- term_guid : str
2899
- The unique identifier for the term.
2900
-
2901
- effective_time : datetime, optional
2902
- If specified, the term information will be retrieved if it is active at the `effective_time`.
2903
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
2904
-
2905
- Returns
2906
- -------
2907
- dict
2908
- The glossary information retrieved for the specified term.
2909
- Raises
2910
- ------
2911
- InvalidParameterException
2912
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2913
- PropertyServerException
2914
- Raised by the server when an issue arises in processing a valid request.
2915
- NotAuthorizedException
2916
- The principle specified by the user_id does not have authorization for the requested action.
2917
- Notes
2918
- -----
2919
- """
2920
-
2921
- validate_guid(term_guid)
2922
-
2923
- body = {
2924
- "class": "EffectiveTimeQueryRequestBody",
2925
- "effectiveTime": effective_time,
2926
- }
2927
- url = (
2928
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/"
2929
- f"for-term/{term_guid}/retrieve"
2930
- )
2931
-
2932
- response = await self._async_make_request("POST", url, body)
2933
- return response.json().get("element", "No glossary found")
2934
-
2935
- def get_glossary_for_term(
2936
- self, term_guid: str, effective_time: str = None
2937
- ) -> dict | str:
2938
- """Retrieve the glossary metadata element for the requested term. The optional request body allows you to specify
2939
- that the glossary element should only be returned if it was effective at a particular time.
2940
-
2941
- Async Version.
2942
-
2943
- Parameters
2944
- ----------
2945
- term_guid : str
2946
- The unique identifier for the term.
2947
-
2948
- effective_time : datetime, optional
2949
- TIf specified, the term information will be retrieved if it is active at the `effective_time`.
2950
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
2951
-
2952
- Returns
2953
- -------
2954
- dict
2955
- The glossary information retrieved for the specified term.
2956
- Raises
2957
- ------
2958
- InvalidParameterException
2959
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2960
- PropertyServerException
2961
- Raised by the server when an issue arises in processing a valid request.
2962
- NotAuthorizedException
2963
- The principle specified by the user_id does not have authorization for the requested action.
2964
- Notes
2965
- -----
2966
- """
2967
- loop = asyncio.get_event_loop()
2968
- response = loop.run_until_complete(
2969
- self._async_get_glossary_for_term(term_guid, effective_time)
2970
- )
2971
- return response
2972
-
2973
- async def _async_get_terms_by_name(
2974
- self,
2975
- term: str,
2976
- glossary_guid: str = None,
2977
- status_filter: list = [],
2978
- effective_time: str = None,
2979
- for_lineage: bool = False,
2980
- for_duplicate_processing: bool = False,
2981
- start_from: int = 0,
2982
- page_size: int = None,
2983
- ) -> list:
2984
- """Retrieve glossary terms by display name or qualified name. Async Version.
2985
-
2986
- Parameters
2987
- ----------
2988
- term : str
2989
- The term to search for in the glossaries.
2990
- glossary_guid : str, optional
2991
- The GUID of the glossary to search in. If not provided, the search will be performed in all glossaries.
2992
- status_filter : list, optional
2993
- A list of status values to filter the search results. Default is an empty list, which means no filtering.
2994
-
2995
- effective_time : datetime, optional
2996
- If specified, the term information will be retrieved if it is active at the `effective_time`.
2997
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
2998
- for_lineage : bool, optional
2999
- Flag to indicate whether the search should include lineage information. Default is False.
3000
- for_duplicate_processing : bool, optional
3001
- Flag to indicate whether the search should include duplicate processing information. Default is False.
3002
- start_from : int, optional
3003
- The index of the first term to retrieve. Default is 0.
3004
- page_size : int, optional
3005
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3006
-
3007
- Returns
3008
- -------
3009
- list
3010
- A list of terms matching the search criteria. If no terms are found, it returns the string NO_TERMS_FOUND.
3011
-
3012
- Raises
3013
- ------
3014
- InvalidParameterException
3015
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3016
- PropertyServerException
3017
- Raised by the server when an issue arises in processing a valid request.
3018
- NotAuthorizedException
3019
- The principle specified by the user_id does not have authorization for the requested action.
3020
- """
3021
-
3022
- if page_size is None:
3023
- page_size = self.page_size
3024
-
3025
- validate_name(term)
3026
-
3027
- for_lineage_s = str(for_lineage).lower()
3028
- for_duplicate_processing_s = str(for_duplicate_processing).lower()
3029
-
3030
- body = {
3031
- "class": "GlossaryNameRequestBody",
3032
- "glossaryGUID": glossary_guid,
3033
- "name": term,
3034
- "effectiveTime": effective_time,
3035
- "limitResultsByStatus": status_filter,
3036
- }
3037
- # body = body_slimmer(body)
3038
-
3039
- url = (
3040
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/"
3041
- f"terms/by-name?startFrom={start_from}&pageSize={page_size}&"
3042
- f"&forLineage={for_lineage_s}&forDuplicateProcessing={for_duplicate_processing_s}"
3043
- )
3044
-
3045
- # print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
3046
-
3047
- response = await self._async_make_request("POST", url, body)
3048
- return response.json().get("elementList", NO_TERMS_FOUND)
3049
-
3050
- def get_terms_by_name(
3051
- self,
3052
- term: str,
3053
- glossary_guid: str = None,
3054
- status_filter: list = [],
3055
- effective_time: str = None,
3056
- for_lineage: bool = False,
3057
- for_duplicate_processing: bool = False,
3058
- start_from: int = 0,
3059
- page_size: int = None,
3060
- ) -> list:
3061
- """Retrieve glossary terms by display name or qualified name.
3062
-
3063
- Parameters
3064
- ----------
3065
- term : str
3066
- The term to search for in the glossaries.
3067
- glossary_guid : str, optional
3068
- The GUID of the glossary to search in. If not provided, the search will be performed in all glossaries.
3069
- status_filter : list, optional
3070
- A list of status values to filter the search results. Default is an empty list, which means no filtering.
3071
-
3072
- effective_time : datetime, optional
3073
- If specified, the term information will be retrieved if it is active at the `effective_time`.
3074
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
3075
- for_lineage : bool, optional
3076
- Flag to indicate whether the search should include lineage information. Default is False.
3077
- for_duplicate_processing : bool, optional
3078
- Flag to indicate whether the search should include duplicate processing information. Default is False.
3079
- start_from : int, optional
3080
- The index of the first term to retrieve. Default is 0.
3081
- page_size : int, optional
3082
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3083
-
3084
- Returns
3085
- -------
3086
- list
3087
- A list of terms matching the search criteria. If no terms are found,
3088
- it returns the string NO_TERMS_FOUND.
3089
-
3090
- Raises
3091
- ------
3092
- InvalidParameterException
3093
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3094
- PropertyServerException
3095
- Raised by the server when an issue arises in processing a valid request.
3096
- NotAuthorizedException
3097
- The principle specified by the user_id does not have authorization for the requested action.
3098
- """
3099
- loop = asyncio.get_event_loop()
3100
- response = loop.run_until_complete(
3101
- self._async_get_terms_by_name(
3102
- term,
3103
- glossary_guid,
3104
- status_filter,
3105
- effective_time,
3106
- for_lineage,
3107
- for_duplicate_processing,
3108
- start_from,
3109
- page_size,
3110
- )
3111
- )
3112
- return response
3113
-
3114
- async def _async_get_terms_by_guid(self, term_guid: str) -> dict | str:
3115
- """Retrieve a term using its unique id. Async version.
3116
- Parameters
3117
- ----------
3118
- term_guid : str
3119
- The GUID of the glossary term to retrieve.
3120
-
3121
- Returns
3122
- -------
3123
- dict | str
3124
- A dict detailing the glossary term represented by the GUID. If no term is found, the string
3125
- "No term found" will be returned.
3126
-
3127
- Raises
3128
- ------
3129
- InvalidParameterException
3130
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3131
- PropertyServerException
3132
- Raised by the server when an issue arises in processing a valid request.
3133
- NotAuthorizedException
3134
- The principle specified by the user_id does not have authorization for the requested action.
3135
- """
3136
-
3137
- validate_guid(term_guid)
3138
-
3139
- url = (
3140
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/terms/"
3141
- f"{term_guid}/retrieve"
3142
- )
3143
-
3144
- response = await self._async_make_request("POST", url)
3145
- return response.json().get("element", "No term found")
3146
-
3147
- def get_terms_by_guid(self, term_guid: str) -> dict | str:
3148
- """Retrieve a term using its unique id. Async version.
3149
- Parameters
3150
- ----------
3151
- term_guid : str
3152
- The GUID of the glossary term to retrieve.
3153
-
3154
- Returns
3155
- -------
3156
- dict | str
3157
- A dict detailing the glossary term represented by the GUID. If no term is found, the string
3158
- "No term found" will be returned.
3159
-
3160
- Raises
3161
- ------
3162
- InvalidParameterException
3163
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3164
- PropertyServerException
3165
- Raised by the server when an issue arises in processing a valid request.
3166
- NotAuthorizedException
3167
- The principle specified by the user_id does not have authorization for the requested action.
3168
- """
3169
-
3170
- loop = asyncio.get_event_loop()
3171
- response = loop.run_until_complete(self._async_get_terms_by_guid(term_guid))
3172
-
3173
- return response
3174
-
3175
- async def _async_get_terms_versions(
3176
- self,
3177
- term_guid: str,
3178
- start_from: int = 0,
3179
- page_size=None,
3180
- ) -> dict | str:
3181
- """Retrieve the versions of a glossary term. Async version.
3182
- Parameters
3183
- ----------
3184
- term_guid : str
3185
- The GUID of the glossary term to retrieve.
3186
- start_from : int, optional
3187
- The index of the first term to retrieve. Default is 0.
3188
- page_size : int, optional
3189
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3190
- Returns
3191
- -------
3192
- dict | str
3193
- A dict detailing the glossary term represented by the GUID. If no term is found, the string
3194
- "No term found" will be returned.
3195
-
3196
- Raises
3197
- ------
3198
- InvalidParameterException
3199
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3200
- PropertyServerException
3201
- Raised by the server when an issue arises in processing a valid request.
3202
- NotAuthorizedException
3203
- The principle specified by the user_id does not have authorization for the requested action.
3204
- """
3205
-
3206
- if page_size is None:
3207
- page_size = self.page_size
3208
-
3209
- validate_guid(term_guid)
3210
-
3211
- url = (
3212
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/terms/"
3213
- f"{term_guid}/history?startFrom={start_from}&pageSize={page_size}"
3214
- )
3215
-
3216
- response = await self._async_make_request("POST", url)
3217
- return response.json().get("element", "No term found")
3218
-
3219
- def get_terms_versions(
3220
- self,
3221
- term_guid: str,
3222
- start_from: int = 0,
3223
- page_size=None,
3224
- ) -> dict | str:
3225
- """Retrieve the versions of a glossary term.
3226
- Parameters
3227
- ----------
3228
- term_guid : str
3229
- The GUID of the glossary term to retrieve.
3230
- start_from : int, optional
3231
- The index of the first term to retrieve. Default is 0.
3232
- page_size : int, optional
3233
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3234
- Returns
3235
- -------
3236
- dict | str
3237
- A dict detailing the glossary term represented by the GUID. If no term is found, the string
3238
- "No term found" will be returned.
3239
-
3240
- Raises
3241
- ------
3242
- InvalidParameterException
3243
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3244
- PropertyServerException
3245
- Raised by the server when an issue arises in processing a valid request.
3246
- NotAuthorizedException
3247
- The principle specified by the user_id does not have authorization for the requested action.
3248
- """
3249
-
3250
- loop = asyncio.get_event_loop()
3251
- response = loop.run_until_complete(
3252
- self._async_get_terms_versions(term_guid, start_from, page_size)
3253
- )
3254
-
3255
- return response
3256
-
3257
- async def _async_get_term_revision_logs(
3258
- self,
3259
- term_guid: str,
3260
- start_from: int = 0,
3261
- page_size=None,
3262
- ) -> dict | str:
3263
- """Retrieve the revision log history for a term. Async version.
3264
- Parameters
3265
- ----------
3266
- term_guid : str
3267
- The GUID of the glossary term to retrieve.
3268
- start_from : int, optional
3269
- The index of the first term to retrieve. Default is 0.
3270
- page_size : int, optional
3271
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3272
- Returns
3273
- -------
3274
- dict | str
3275
- A dict detailing the glossary term revision log history. If no term is found, the string
3276
- "No log found" will be returned.
3277
-
3278
- Raises
3279
- ------
3280
- InvalidParameterException
3281
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3282
- PropertyServerException
3283
- Raised by the server when an issue arises in processing a valid request.
3284
- NotAuthorizedException
3285
- The principle specified by the user_id does not have authorization for the requested action.
3286
- """
3287
-
3288
- if page_size is None:
3289
- page_size = self.page_size
3290
-
3291
- validate_guid(term_guid)
3292
-
3293
- url = (
3294
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/elements/"
3295
- f"{term_guid}/notes/retrieve?startFrom={start_from}&pageSize={page_size}"
3296
- )
3297
-
3298
- response = await self._async_make_request("POST", url)
3299
- return response.json().get("elementList", "No log found")
3300
-
3301
- def get_term_revision_logs(
3302
- self,
3303
- term_guid: str,
3304
- start_from: int = 0,
3305
- page_size=None,
3306
- ) -> dict | str:
3307
- """Retrieve the revision log history for a term.
3308
- Parameters
3309
- ----------
3310
- term_guid : str
3311
- The GUID of the glossary term to retrieve.
3312
- start_from : int, optional
3313
- The index of the first term to retrieve. Default is 0.
3314
- page_size : int, optional
3315
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3316
- Returns
3317
- -------
3318
- dict | str
3319
- A dict detailing the glossary term revision log history. If no term is found, the string
3320
- "No log found" will be returned.
3321
-
3322
- Raises
3323
- ------
3324
- InvalidParameterException
3325
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3326
- PropertyServerException
3327
- Raised by the server when an issue arises in processing a valid request.
3328
- NotAuthorizedException
3329
- The principle specified by the user_id does not have authorization for the requested action.
3330
- """
3331
-
3332
- loop = asyncio.get_event_loop()
3333
- response = loop.run_until_complete(
3334
- self._async_get_term_revision_logs(term_guid, start_from, page_size)
3335
- )
3336
-
3337
- return response
3338
-
3339
- async def _async_get_term_revision_history(
3340
- self,
3341
- term_revision_log_guid: str,
3342
- start_from: int = 0,
3343
- page_size=None,
3344
- ) -> dict | str:
3345
- """Retrieve the revision history for a glossary term. Async version.
3346
-
3347
- Parameters
3348
- ----------
3349
- term_revision_log_guid : str
3350
- The GUID of the glossary term revision log to retrieve.
3351
- start_from : int, optional
3352
- The index of the first term to retrieve. Default is 0.
3353
- page_size : int, optional
3354
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3355
- Returns
3356
- -------
3357
- dict | str
3358
- A dict detailing the glossary term revision history.
3359
-
3360
- Raises
3361
- ------
3362
- InvalidParameterException
3363
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3364
- PropertyServerException
3365
- Raised by the server when an issue arises in processing a valid request.
3366
- NotAuthorizedException
3367
- The principle specified by the user_id does not have authorization for the requested action.
3368
-
3369
-
3370
- Notes
3371
- -----
3372
- This revision history is created automatically. The text is supplied on the update request.
3373
- If no text is supplied, the value "None" is show.
3374
- """
3375
-
3376
- if page_size is None:
3377
- page_size = self.page_size
3378
-
3379
- validate_guid(term_revision_log_guid)
3380
-
3381
- url = (
3382
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/note-logs/"
3383
- f"{term_revision_log_guid}/notes/retrieve?startFrom={start_from}&pageSize={page_size}"
3384
- )
3385
-
3386
- response = await self._async_make_request("POST", url)
3387
- return response.json().get("elementList", "No logs found")
3388
-
3389
- def get_term_revision_history(
3390
- self,
3391
- term_revision_log_guid: str,
3392
- start_from: int = 0,
3393
- page_size=None,
3394
- ) -> dict | str:
3395
- """Retrieve the revision history for a glossary term.
3396
-
3397
- Parameters
3398
- ----------
3399
- term_revision_log_guid : str
3400
- The GUID of the glossary term revision log to retrieve.
3401
- start_from : int, optional
3402
- The index of the first term to retrieve. Default is 0.
3403
- page_size : int, optional
3404
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3405
- Returns
3406
- -------
3407
- dict | str
3408
- A dict detailing the glossary term revision history.
3409
-
3410
- Raises
3411
- ------
3412
- InvalidParameterException
3413
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3414
- PropertyServerException
3415
- Raised by the server when an issue arises in processing a valid request.
3416
- NotAuthorizedException
3417
- The principle specified by the user_id does not have authorization for the requested action.
3418
-
3419
-
3420
- Notes
3421
- -----
3422
- This revision history is created automatically. The text is supplied on the update request.
3423
- If no text is supplied, the value "None" is show.
3424
- """
3425
-
3426
- loop = asyncio.get_event_loop()
3427
- response = loop.run_until_complete(
3428
- self._async_get_term_revision_history(
3429
- term_revision_log_guid, start_from, page_size
3430
- )
3431
- )
3432
-
3433
- return response
3434
1991
 
3435
1992
 
3436
1993