pyegeria 5.3.5.1__py3-none-any.whl → 5.3.5.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyegeria/asset_catalog_omvs.py +67 -11
- pyegeria/commands/cat/freddie_jupyter.py +124 -0
- pyegeria/commands/cat/freddie_md.py +158 -0
- pyegeria/commands/cat/freddie_utils.py +530 -0
- pyegeria/commands/cat/glossary_actions.py +112 -12
- pyegeria/commands/cli/egeria.py +4 -4
- pyegeria/commands/cli/egeria_cat.py +4 -4
- pyegeria/glossary_browser_omvs.py +2 -2
- pyegeria/glossary_manager_omvs.py +779 -570
- {pyegeria-5.3.5.1.dist-info → pyegeria-5.3.5.2.dist-info}/METADATA +2 -1
- {pyegeria-5.3.5.1.dist-info → pyegeria-5.3.5.2.dist-info}/RECORD +14 -11
- {pyegeria-5.3.5.1.dist-info → pyegeria-5.3.5.2.dist-info}/entry_points.txt +5 -2
- {pyegeria-5.3.5.1.dist-info → pyegeria-5.3.5.2.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.5.1.dist-info → pyegeria-5.3.5.2.dist-info}/WHEEL +0 -0
@@ -315,6 +315,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
315
315
|
type_name: str = None,
|
316
316
|
start_from: int = 0,
|
317
317
|
page_size: int = None,
|
318
|
+
output_format: str = "JSON",
|
318
319
|
) -> list | str:
|
319
320
|
"""Retrieve the list of glossary metadata elements that contain the search string. Async version.
|
320
321
|
The search string is located in the request body and is interpreted as a plain string.
|
@@ -346,6 +347,9 @@ class GlossaryManager(GlossaryBrowser):
|
|
346
347
|
page_size: int, [default=None]
|
347
348
|
The number of items to return in a single page. If not specified, the default will be taken from
|
348
349
|
the class instance.
|
350
|
+
output_format: str, [default="JSON"]
|
351
|
+
One of JSON or MD for now
|
352
|
+
|
349
353
|
Returns
|
350
354
|
-------
|
351
355
|
List | str
|
@@ -394,7 +398,11 @@ class GlossaryManager(GlossaryBrowser):
|
|
394
398
|
)
|
395
399
|
|
396
400
|
response = await self._async_make_request("POST", url, body)
|
397
|
-
|
401
|
+
if output_format == "JSON":
|
402
|
+
return response.json().get("elementList", "No Glossaries found")
|
403
|
+
elif output_format == "MD":
|
404
|
+
pass
|
405
|
+
|
398
406
|
|
399
407
|
def find_glossaries(
|
400
408
|
self,
|
@@ -588,6 +596,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
588
596
|
glossary_guid: str,
|
589
597
|
display_name: str,
|
590
598
|
description: str,
|
599
|
+
is_root_category: bool = False,
|
591
600
|
) -> str:
|
592
601
|
"""Create a new category within the specified glossary. Async Version.
|
593
602
|
|
@@ -599,6 +608,8 @@ class GlossaryManager(GlossaryBrowser):
|
|
599
608
|
Display name for the glossary category. Will be used as the base for a constructed unique qualified name.
|
600
609
|
description: str,
|
601
610
|
Description for the category.
|
611
|
+
is_root_category: bool, [default=False], optional
|
612
|
+
Is this category a root category?
|
602
613
|
|
603
614
|
|
604
615
|
Returns
|
@@ -621,7 +632,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
621
632
|
|
622
633
|
url = (
|
623
634
|
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
|
624
|
-
f"{glossary_guid}/categories"
|
635
|
+
f"{glossary_guid}/categories?isRootCategory={is_root_category}"
|
625
636
|
)
|
626
637
|
body = {
|
627
638
|
"class": "ReferenceableRequestBody",
|
@@ -640,6 +651,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
640
651
|
glossary_guid: str,
|
641
652
|
display_name: str,
|
642
653
|
description: str,
|
654
|
+
is_root_category: bool = False,
|
643
655
|
) -> str:
|
644
656
|
"""Create a new category within the specified glossary.
|
645
657
|
|
@@ -651,7 +663,8 @@ class GlossaryManager(GlossaryBrowser):
|
|
651
663
|
Display name for the glossary category. Will be used as the base for a constructed unique qualified name.
|
652
664
|
description: str,
|
653
665
|
Description for the category.
|
654
|
-
|
666
|
+
is_root_category: bool, [default=False], optional
|
667
|
+
Is this category a root category?
|
655
668
|
|
656
669
|
Returns
|
657
670
|
-------
|
@@ -672,30 +685,43 @@ class GlossaryManager(GlossaryBrowser):
|
|
672
685
|
"""
|
673
686
|
loop = asyncio.get_event_loop()
|
674
687
|
response = loop.run_until_complete(
|
675
|
-
self._async_create_category(glossary_guid, display_name, description)
|
688
|
+
self._async_create_category(glossary_guid, display_name, description, is_root_category)
|
676
689
|
)
|
677
690
|
return response
|
678
691
|
|
679
|
-
async def
|
692
|
+
async def _async_update_category(
|
680
693
|
self,
|
681
|
-
|
694
|
+
category_guid: str,
|
695
|
+
display_name: str,
|
696
|
+
description: str,
|
697
|
+
qualified_name: str = None,
|
682
698
|
effective_time: str = None,
|
683
|
-
|
684
|
-
|
685
|
-
|
699
|
+
update_description: str = None,
|
700
|
+
is_merge_update: bool = True,
|
701
|
+
) :
|
702
|
+
"""Create a new category within the specified glossary. Async Version.
|
686
703
|
|
687
704
|
Parameters
|
688
705
|
----------
|
689
|
-
|
690
|
-
Unique identifier for the glossary
|
706
|
+
category_guid: str,
|
707
|
+
Unique identifier for the glossary.
|
708
|
+
display_name: str,
|
709
|
+
Display name for the glossary category. Will be used as the base for a constructed unique qualified name.
|
710
|
+
description: str,
|
711
|
+
Description for the category.
|
712
|
+
qualified_name: str, [default=None], optional
|
713
|
+
Unique identifier for the glossary category. Must be specified if not a merge update.
|
691
714
|
effective_time: datetime, [default=None], optional
|
692
|
-
|
693
|
-
|
715
|
+
Time when the category becomes effective.
|
716
|
+
update_description: str, [default=None], optional
|
717
|
+
Description of the update to the category.
|
718
|
+
is_merge_update: bool, [default=True], optional
|
719
|
+
Should this be a merge or a replace?
|
694
720
|
|
695
721
|
|
696
722
|
Returns
|
697
723
|
-------
|
698
|
-
|
724
|
+
None
|
699
725
|
|
700
726
|
Raises
|
701
727
|
------
|
@@ -710,40 +736,60 @@ class GlossaryManager(GlossaryBrowser):
|
|
710
736
|
Raised when configuration parameters passed on earlier calls turn out to be
|
711
737
|
invalid or make the new call invalid.
|
712
738
|
"""
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
"effectiveTime": effective_time,
|
717
|
-
}
|
718
|
-
|
739
|
+
if not is_merge_update:
|
740
|
+
if qualified_name is None:
|
741
|
+
raise ValueError('qualified_name must be specified for a replace update')
|
719
742
|
url = (
|
720
743
|
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
|
721
|
-
f"
|
744
|
+
f"categories/{category_guid}/update?isMergeUpdate={is_merge_update}"
|
722
745
|
)
|
746
|
+
body = {
|
747
|
+
"class": "ReferenceableUpdateRequestBody",
|
748
|
+
"effectiveTime": effective_time,
|
749
|
+
"updateDescription": update_description,
|
750
|
+
"elementProperties": {
|
751
|
+
"class": "GlossaryCategoryProperties",
|
752
|
+
"qualifiedName": qualified_name ,
|
753
|
+
"displayName": display_name,
|
754
|
+
"description": description
|
755
|
+
},
|
756
|
+
}
|
757
|
+
response = await self._async_make_request("POST", url, body_slimmer(body))
|
758
|
+
return response.json().get("guid", None)
|
723
759
|
|
724
|
-
|
725
|
-
return response.json()
|
726
|
-
|
727
|
-
def get_glossary_for_category(
|
760
|
+
def update_category(
|
728
761
|
self,
|
729
|
-
|
762
|
+
glossary_guid: str,
|
763
|
+
display_name: str,
|
764
|
+
description: str,
|
765
|
+
qualified_name: str = None,
|
730
766
|
effective_time: str = None,
|
731
|
-
|
732
|
-
|
733
|
-
|
767
|
+
update_description: str = None,
|
768
|
+
is_merge_update: bool = True,
|
769
|
+
) -> str:
|
770
|
+
"""Create a new category within the specified glossary.
|
734
771
|
|
735
772
|
Parameters
|
736
773
|
----------
|
737
|
-
|
738
|
-
Unique identifier for the glossary
|
774
|
+
glossary_guid: str,
|
775
|
+
Unique identifier for the glossary.
|
776
|
+
display_name: str,
|
777
|
+
Display name for the glossary category. Will be used as the base for a constructed unique qualified name.
|
778
|
+
description: str,
|
779
|
+
Description for the category.
|
780
|
+
qualified_name: str, [default=None], optional
|
781
|
+
Unique identifier for the glossary category. Must be specified if not a merge update.
|
739
782
|
effective_time: datetime, [default=None], optional
|
740
|
-
|
741
|
-
|
783
|
+
Time when the category becomes effective.
|
784
|
+
update_description: str, [default=None], optional
|
785
|
+
Description of the update to the category.
|
786
|
+
is_merge_update: bool, [default=True], optional
|
787
|
+
Should this be a merge or a replace?
|
742
788
|
|
743
789
|
|
744
790
|
Returns
|
745
791
|
-------
|
746
|
-
|
792
|
+
None
|
747
793
|
|
748
794
|
Raises
|
749
795
|
------
|
@@ -760,52 +806,26 @@ class GlossaryManager(GlossaryBrowser):
|
|
760
806
|
"""
|
761
807
|
loop = asyncio.get_event_loop()
|
762
808
|
response = loop.run_until_complete(
|
763
|
-
self.
|
764
|
-
|
765
|
-
)
|
809
|
+
self._async_update_category(glossary_guid, display_name, description,
|
810
|
+
qualified_name, effective_time, update_description, is_merge_update)
|
766
811
|
)
|
767
812
|
return response
|
768
813
|
|
769
|
-
|
814
|
+
|
815
|
+
async def _async_delete_category(
|
770
816
|
self,
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
ends_with: bool = False,
|
775
|
-
ignore_case: bool = False,
|
776
|
-
start_from: int = 0,
|
777
|
-
page_size: int = None,
|
778
|
-
) -> list | str:
|
779
|
-
"""Retrieve the list of glossary category metadata elements that contain the search string.
|
780
|
-
The search string is located in the request body and is interpreted as a plain string.
|
781
|
-
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
782
|
-
Async version.
|
817
|
+
category_guid: str,
|
818
|
+
) -> None:
|
819
|
+
"""Delete a category. Async Version.
|
783
820
|
|
784
821
|
Parameters
|
785
822
|
----------
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
effective_time: str, [default=None], optional
|
790
|
-
Effective time of the query. If not specified will default to any time. Time format is
|
791
|
-
"YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
823
|
+
category_guid: str,
|
824
|
+
Unique identifier for the category.
|
792
825
|
|
793
|
-
starts_with : bool, [default=False], optional
|
794
|
-
Starts with the supplied string.
|
795
|
-
ends_with : bool, [default=False], optional
|
796
|
-
Ends with the supplied string
|
797
|
-
ignore_case : bool, [default=False], optional
|
798
|
-
Ignore case when searching
|
799
|
-
start_from: int, [default=0], optional
|
800
|
-
When multiple pages of results are available, the page number to start from.
|
801
|
-
page_size: int, [default=None]
|
802
|
-
The number of items to return in a single page. If not specified, the default will be taken from
|
803
|
-
the class instance.
|
804
826
|
Returns
|
805
827
|
-------
|
806
|
-
|
807
|
-
|
808
|
-
A list of glossary definitions active in the server.
|
828
|
+
None
|
809
829
|
|
810
830
|
Raises
|
811
831
|
------
|
@@ -816,75 +836,33 @@ class GlossaryManager(GlossaryBrowser):
|
|
816
836
|
Raised by the server when an issue arises in processing a valid request
|
817
837
|
NotAuthorizedException
|
818
838
|
The principle specified by the user_id does not have authorization for the requested action
|
819
|
-
|
839
|
+
ConfigurationErrorException
|
840
|
+
Raised when configuration parameters passed on earlier calls turn out to be
|
841
|
+
invalid or make the new call invalid.
|
820
842
|
"""
|
821
843
|
|
822
|
-
if page_size is None:
|
823
|
-
page_size = self.page_size
|
824
|
-
starts_with_s = str(starts_with).lower()
|
825
|
-
ends_with_s = str(ends_with).lower()
|
826
|
-
ignore_case_s = str(ignore_case).lower()
|
827
|
-
|
828
|
-
validate_search_string(search_string)
|
829
|
-
|
830
|
-
if search_string == "*":
|
831
|
-
search_string = None
|
832
|
-
|
833
|
-
body = {
|
834
|
-
"class": "SearchStringRequestBody",
|
835
|
-
"searchString": search_string,
|
836
|
-
"effectiveTime": effective_time,
|
837
|
-
}
|
838
|
-
body = body_slimmer(body)
|
839
|
-
|
840
844
|
url = (
|
841
845
|
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
|
842
|
-
f"categories/
|
843
|
-
f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
|
846
|
+
f"categories/{category_guid}/remove"
|
844
847
|
)
|
845
848
|
|
846
|
-
|
847
|
-
|
849
|
+
await self._async_make_request("POST", url)
|
850
|
+
|
848
851
|
|
849
|
-
def
|
852
|
+
def delete_category(
|
850
853
|
self,
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
ends_with: bool = False,
|
855
|
-
ignore_case: bool = False,
|
856
|
-
start_from: int = 0,
|
857
|
-
page_size: int = None,
|
858
|
-
) -> list | str:
|
859
|
-
"""Retrieve the list of glossary category metadata elements that contain the search string.
|
860
|
-
The search string is located in the request body and is interpreted as a plain string.
|
861
|
-
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
854
|
+
category_guid: str,
|
855
|
+
) -> None:
|
856
|
+
"""Delete a category.
|
862
857
|
|
863
858
|
Parameters
|
864
859
|
----------
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
effective_time: str, [default=None], optional
|
869
|
-
Effective time of the query. If not specified will default to any time. Time format is
|
870
|
-
"YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
860
|
+
category_guid: str,
|
861
|
+
Unique identifier for the category.
|
871
862
|
|
872
|
-
starts_with : bool, [default=False], optional
|
873
|
-
Starts with the supplied string.
|
874
|
-
ends_with : bool, [default=False], optional
|
875
|
-
Ends with the supplied string
|
876
|
-
ignore_case : bool, [default=False], optional
|
877
|
-
Ignore case when searching
|
878
|
-
start_from: int, [default=0], optional
|
879
|
-
When multiple pages of results are available, the page number to start from.
|
880
|
-
page_size: int, [default=None]
|
881
|
-
The number of items to return in a single page. If not specified, the default will be taken from
|
882
|
-
the class instance.
|
883
863
|
Returns
|
884
864
|
-------
|
885
|
-
|
886
|
-
|
887
|
-
A list of glossary definitions active in the server.
|
865
|
+
None
|
888
866
|
|
889
867
|
Raises
|
890
868
|
------
|
@@ -895,47 +873,38 @@ class GlossaryManager(GlossaryBrowser):
|
|
895
873
|
Raised by the server when an issue arises in processing a valid request
|
896
874
|
NotAuthorizedException
|
897
875
|
The principle specified by the user_id does not have authorization for the requested action
|
898
|
-
|
876
|
+
ConfigurationErrorException
|
877
|
+
Raised when configuration parameters passed on earlier calls turn out to be
|
878
|
+
invalid or make the new call invalid.
|
899
879
|
"""
|
900
880
|
loop = asyncio.get_event_loop()
|
901
|
-
|
902
|
-
self.
|
903
|
-
search_string,
|
904
|
-
effective_time,
|
905
|
-
starts_with,
|
906
|
-
ends_with,
|
907
|
-
ignore_case,
|
908
|
-
start_from,
|
909
|
-
page_size,
|
910
|
-
)
|
881
|
+
loop.run_until_complete(
|
882
|
+
self._async_delete_category(category_guid)
|
911
883
|
)
|
912
884
|
|
913
|
-
return response
|
914
885
|
|
915
|
-
|
886
|
+
|
887
|
+
|
888
|
+
async def _async_get_glossary_for_category(
|
916
889
|
self,
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
Async version.
|
890
|
+
glossary_category_guid: str,
|
891
|
+
effective_time: str = None,
|
892
|
+
) -> dict | str:
|
893
|
+
"""Retrieve the glossary metadata element for the requested category. The optional request body allows you to
|
894
|
+
specify that the glossary element should only be returned if it was effective at a particular time.
|
923
895
|
|
924
896
|
Parameters
|
925
897
|
----------
|
926
|
-
|
927
|
-
Unique
|
898
|
+
glossary_category_guid: str,
|
899
|
+
Unique identifier for the glossary category.
|
900
|
+
effective_time: datetime, [default=None], optional
|
901
|
+
Effective time of the query. If not specified will default to any effective time. Time format is
|
902
|
+
"YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
903
|
+
|
928
904
|
|
929
|
-
start_from: int, [default=0], optional
|
930
|
-
When multiple pages of results are available, the page number to start from.
|
931
|
-
page_size: int, [default=None]
|
932
|
-
The number of items to return in a single page. If not specified, the default will be taken from
|
933
|
-
the class instance.
|
934
905
|
Returns
|
935
906
|
-------
|
936
|
-
|
937
|
-
|
938
|
-
A list of categories associated with a glossary.
|
907
|
+
A dict structure with the glossary metadata element for the requested category.
|
939
908
|
|
940
909
|
Raises
|
941
910
|
------
|
@@ -946,43 +915,44 @@ class GlossaryManager(GlossaryBrowser):
|
|
946
915
|
Raised by the server when an issue arises in processing a valid request
|
947
916
|
NotAuthorizedException
|
948
917
|
The principle specified by the user_id does not have authorization for the requested action
|
949
|
-
|
918
|
+
ConfigurationErrorException
|
919
|
+
Raised when configuration parameters passed on earlier calls turn out to be
|
920
|
+
invalid or make the new call invalid.
|
950
921
|
"""
|
951
922
|
|
952
|
-
|
953
|
-
|
923
|
+
body = {
|
924
|
+
"class": "EffectiveTimeQueryRequestBody",
|
925
|
+
"effectiveTime": effective_time,
|
926
|
+
}
|
954
927
|
|
955
928
|
url = (
|
956
929
|
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
|
957
|
-
f"{
|
930
|
+
f"for-category/{glossary_category_guid}/retrieve"
|
958
931
|
)
|
959
932
|
|
960
|
-
response = await self._async_make_request("POST", url)
|
961
|
-
return response.json()
|
933
|
+
response = await self._async_make_request("POST", url, body)
|
934
|
+
return response.json()
|
962
935
|
|
963
|
-
def
|
936
|
+
def get_glossary_for_category(
|
964
937
|
self,
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
938
|
+
glossary_category_guid: str,
|
939
|
+
effective_time: str = None,
|
940
|
+
) -> dict | str:
|
941
|
+
"""Retrieve the glossary metadata element for the requested category. The optional request body allows you to
|
942
|
+
specify that the glossary element should only be returned if it was effective at a particular time.
|
970
943
|
|
971
944
|
Parameters
|
972
945
|
----------
|
973
|
-
|
974
|
-
Unique
|
946
|
+
glossary_category_guid: str,
|
947
|
+
Unique identifier for the glossary category.
|
948
|
+
effective_time: datetime, [default=None], optional
|
949
|
+
Effective time of the query. If not specified will default to any effective time. Time format is
|
950
|
+
"YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
951
|
+
|
975
952
|
|
976
|
-
start_from: int, [default=0], optional
|
977
|
-
When multiple pages of results are available, the page number to start from.
|
978
|
-
page_size: int, [default=None]
|
979
|
-
The number of items to return in a single page. If not specified, the default will be taken from
|
980
|
-
the class instance.
|
981
953
|
Returns
|
982
954
|
-------
|
983
|
-
|
984
|
-
|
985
|
-
A list of categories associated with a glossary.
|
955
|
+
A dict structure with the glossary metadata element for the requested category.
|
986
956
|
|
987
957
|
Raises
|
988
958
|
------
|
@@ -993,406 +963,645 @@ class GlossaryManager(GlossaryBrowser):
|
|
993
963
|
Raised by the server when an issue arises in processing a valid request
|
994
964
|
NotAuthorizedException
|
995
965
|
The principle specified by the user_id does not have authorization for the requested action
|
996
|
-
|
966
|
+
ConfigurationErrorException
|
967
|
+
Raised when configuration parameters passed on earlier calls turn out to be
|
968
|
+
invalid or make the new call invalid.
|
997
969
|
"""
|
998
970
|
loop = asyncio.get_event_loop()
|
999
971
|
response = loop.run_until_complete(
|
1000
|
-
self.
|
1001
|
-
|
972
|
+
self._async_get_glossary_for_category(
|
973
|
+
glossary_category_guid, effective_time
|
1002
974
|
)
|
1003
975
|
)
|
1004
976
|
return response
|
1005
977
|
|
1006
|
-
async def
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
978
|
+
# async def _async_find_glossary_categories(
|
979
|
+
# self,
|
980
|
+
# search_string: str,
|
981
|
+
# effective_time: str = None,
|
982
|
+
# starts_with: bool = False,
|
983
|
+
# ends_with: bool = False,
|
984
|
+
# ignore_case: bool = False,
|
985
|
+
# start_from: int = 0,
|
986
|
+
# page_size: int = None,
|
987
|
+
# ) -> list | str:
|
988
|
+
# """Retrieve the list of glossary category metadata elements that contain the search string.
|
989
|
+
# The search string is located in the request body and is interpreted as a plain string.
|
990
|
+
# The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
991
|
+
# Async version.
|
992
|
+
#
|
993
|
+
# Parameters
|
994
|
+
# ----------
|
995
|
+
# search_string: str,
|
996
|
+
# Search string to use to find matching glossaries. If the search string is '*' then all glossaries returned.
|
997
|
+
#
|
998
|
+
# effective_time: str, [default=None], optional
|
999
|
+
# Effective time of the query. If not specified will default to any time. Time format is
|
1000
|
+
# "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
1001
|
+
#
|
1002
|
+
# starts_with : bool, [default=False], optional
|
1003
|
+
# Starts with the supplied string.
|
1004
|
+
# ends_with : bool, [default=False], optional
|
1005
|
+
# Ends with the supplied string
|
1006
|
+
# ignore_case : bool, [default=False], optional
|
1007
|
+
# Ignore case when searching
|
1008
|
+
# start_from: int, [default=0], optional
|
1009
|
+
# When multiple pages of results are available, the page number to start from.
|
1010
|
+
# page_size: int, [default=None]
|
1011
|
+
# The number of items to return in a single page. If not specified, the default will be taken from
|
1012
|
+
# the class instance.
|
1013
|
+
# Returns
|
1014
|
+
# -------
|
1015
|
+
# List | str
|
1016
|
+
#
|
1017
|
+
# A list of glossary definitions active in the server.
|
1018
|
+
#
|
1019
|
+
# Raises
|
1020
|
+
# ------
|
1021
|
+
#
|
1022
|
+
# InvalidParameterException
|
1023
|
+
# If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1024
|
+
# PropertyServerException
|
1025
|
+
# Raised by the server when an issue arises in processing a valid request
|
1026
|
+
# NotAuthorizedException
|
1027
|
+
# The principle specified by the user_id does not have authorization for the requested action
|
1028
|
+
#
|
1029
|
+
# """
|
1030
|
+
#
|
1031
|
+
# if page_size is None:
|
1032
|
+
# page_size = self.page_size
|
1033
|
+
# starts_with_s = str(starts_with).lower()
|
1034
|
+
# ends_with_s = str(ends_with).lower()
|
1035
|
+
# ignore_case_s = str(ignore_case).lower()
|
1036
|
+
#
|
1037
|
+
# validate_search_string(search_string)
|
1038
|
+
#
|
1039
|
+
# if search_string == "*":
|
1040
|
+
# search_string = None
|
1041
|
+
#
|
1042
|
+
# body = {
|
1043
|
+
# "class": "SearchStringRequestBody",
|
1044
|
+
# "searchString": search_string,
|
1045
|
+
# "effectiveTime": effective_time,
|
1046
|
+
# }
|
1047
|
+
# body = body_slimmer(body)
|
1048
|
+
#
|
1049
|
+
# url = (
|
1050
|
+
# f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
|
1051
|
+
# f"categories/by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
1052
|
+
# f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
|
1053
|
+
# )
|
1054
|
+
#
|
1055
|
+
# response = await self._async_make_request("POST", url, body)
|
1056
|
+
# return response.json().get("elementList", "No Categories found")
|
1057
|
+
#
|
1058
|
+
# def find_glossary_categories(
|
1059
|
+
# self,
|
1060
|
+
# search_string: str,
|
1061
|
+
# effective_time: str = None,
|
1062
|
+
# starts_with: bool = False,
|
1063
|
+
# ends_with: bool = False,
|
1064
|
+
# ignore_case: bool = False,
|
1065
|
+
# start_from: int = 0,
|
1066
|
+
# page_size: int = None,
|
1067
|
+
# ) -> list | str:
|
1068
|
+
# """Retrieve the list of glossary category metadata elements that contain the search string.
|
1069
|
+
# The search string is located in the request body and is interpreted as a plain string.
|
1070
|
+
# The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
1071
|
+
#
|
1072
|
+
# Parameters
|
1073
|
+
# ----------
|
1074
|
+
# search_string: str,
|
1075
|
+
# Search string to use to find matching glossaries. If the search string is '*' then all glossaries returned.
|
1076
|
+
#
|
1077
|
+
# effective_time: str, [default=None], optional
|
1078
|
+
# Effective time of the query. If not specified will default to any time. Time format is
|
1079
|
+
# "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
1080
|
+
#
|
1081
|
+
# starts_with : bool, [default=False], optional
|
1082
|
+
# Starts with the supplied string.
|
1083
|
+
# ends_with : bool, [default=False], optional
|
1084
|
+
# Ends with the supplied string
|
1085
|
+
# ignore_case : bool, [default=False], optional
|
1086
|
+
# Ignore case when searching
|
1087
|
+
# start_from: int, [default=0], optional
|
1088
|
+
# When multiple pages of results are available, the page number to start from.
|
1089
|
+
# page_size: int, [default=None]
|
1090
|
+
# The number of items to return in a single page. If not specified, the default will be taken from
|
1091
|
+
# the class instance.
|
1092
|
+
# Returns
|
1093
|
+
# -------
|
1094
|
+
# List | str
|
1095
|
+
#
|
1096
|
+
# A list of glossary definitions active in the server.
|
1097
|
+
#
|
1098
|
+
# Raises
|
1099
|
+
# ------
|
1100
|
+
#
|
1101
|
+
# InvalidParameterException
|
1102
|
+
# If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1103
|
+
# PropertyServerException
|
1104
|
+
# Raised by the server when an issue arises in processing a valid request
|
1105
|
+
# NotAuthorizedException
|
1106
|
+
# The principle specified by the user_id does not have authorization for the requested action
|
1107
|
+
#
|
1108
|
+
# """
|
1109
|
+
# loop = asyncio.get_event_loop()
|
1110
|
+
# response = loop.run_until_complete(
|
1111
|
+
# self._async_find_glossary_categories(
|
1112
|
+
# search_string,
|
1113
|
+
# effective_time,
|
1114
|
+
# starts_with,
|
1115
|
+
# ends_with,
|
1116
|
+
# ignore_case,
|
1117
|
+
# start_from,
|
1118
|
+
# page_size,
|
1119
|
+
# )
|
1120
|
+
# )
|
1121
|
+
#
|
1122
|
+
# return response
|
1123
|
+
|
1124
|
+
# async def _async_get_categories_for_glossary(
|
1125
|
+
# self,
|
1126
|
+
# glossary_guid: str,
|
1127
|
+
# start_from: int = 0,
|
1128
|
+
# page_size: int = None,
|
1129
|
+
# ) -> list | str:
|
1130
|
+
# """Return the list of categories associated with a glossary.
|
1131
|
+
# Async version.
|
1132
|
+
#
|
1133
|
+
# Parameters
|
1134
|
+
# ----------
|
1135
|
+
# glossary_guid: str,
|
1136
|
+
# Unique identity of the glossary
|
1137
|
+
#
|
1138
|
+
# start_from: int, [default=0], optional
|
1139
|
+
# When multiple pages of results are available, the page number to start from.
|
1140
|
+
# page_size: int, [default=None]
|
1141
|
+
# The number of items to return in a single page. If not specified, the default will be taken from
|
1142
|
+
# the class instance.
|
1143
|
+
# Returns
|
1144
|
+
# -------
|
1145
|
+
# List | str
|
1146
|
+
#
|
1147
|
+
# A list of categories associated with a glossary.
|
1148
|
+
#
|
1149
|
+
# Raises
|
1150
|
+
# ------
|
1151
|
+
#
|
1152
|
+
# InvalidParameterException
|
1153
|
+
# If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1154
|
+
# PropertyServerException
|
1155
|
+
# Raised by the server when an issue arises in processing a valid request
|
1156
|
+
# NotAuthorizedException
|
1157
|
+
# The principle specified by the user_id does not have authorization for the requested action
|
1158
|
+
#
|
1159
|
+
# """
|
1160
|
+
#
|
1161
|
+
# if page_size is None:
|
1162
|
+
# page_size = self.page_size
|
1163
|
+
#
|
1164
|
+
# url = (
|
1165
|
+
# f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/"
|
1166
|
+
# f"{glossary_guid}/categories/retrieve?startFrom={start_from}&pageSize={page_size}"
|
1167
|
+
# )
|
1168
|
+
#
|
1169
|
+
# response = await self._async_make_request("POST", url)
|
1170
|
+
# return response.json().get("elementList", "No Categories found")
|
1171
|
+
#
|
1172
|
+
# def get_categories_for_glossary(
|
1173
|
+
# self,
|
1174
|
+
# glossary_guid: str,
|
1175
|
+
# start_from: int = 0,
|
1176
|
+
# page_size: int = None,
|
1177
|
+
# ) -> list | str:
|
1178
|
+
# """Return the list of categories associated with a glossary.
|
1179
|
+
#
|
1180
|
+
# Parameters
|
1181
|
+
# ----------
|
1182
|
+
# glossary_guid: str,
|
1183
|
+
# Unique identity of the glossary
|
1184
|
+
#
|
1185
|
+
# start_from: int, [default=0], optional
|
1186
|
+
# When multiple pages of results are available, the page number to start from.
|
1187
|
+
# page_size: int, [default=None]
|
1188
|
+
# The number of items to return in a single page. If not specified, the default will be taken from
|
1189
|
+
# the class instance.
|
1190
|
+
# Returns
|
1191
|
+
# -------
|
1192
|
+
# List | str
|
1193
|
+
#
|
1194
|
+
# A list of categories associated with a glossary.
|
1195
|
+
#
|
1196
|
+
# Raises
|
1197
|
+
# ------
|
1198
|
+
#
|
1199
|
+
# InvalidParameterException
|
1200
|
+
# If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1201
|
+
# PropertyServerException
|
1202
|
+
# Raised by the server when an issue arises in processing a valid request
|
1203
|
+
# NotAuthorizedException
|
1204
|
+
# The principle specified by the user_id does not have authorization for the requested action
|
1205
|
+
#
|
1206
|
+
# """
|
1207
|
+
# loop = asyncio.get_event_loop()
|
1208
|
+
# response = loop.run_until_complete(
|
1209
|
+
# self._async_get_categories_for_glossary(
|
1210
|
+
# glossary_guid, start_from, page_size
|
1211
|
+
# )
|
1212
|
+
# )
|
1213
|
+
# return response
|
1214
|
+
#
|
1215
|
+
# async def _async_get_categories_for_term(
|
1216
|
+
# self,
|
1217
|
+
# glossary_term_guid: str,
|
1218
|
+
# start_from: int = 0,
|
1219
|
+
# page_size: int = None,
|
1220
|
+
# ) -> list | str:
|
1221
|
+
# """Return the list of categories associated with a glossary term.
|
1222
|
+
# Async version.
|
1223
|
+
#
|
1224
|
+
# Parameters
|
1225
|
+
# ----------
|
1226
|
+
# glossary_term_guid: str,
|
1227
|
+
# Unique identity of a glossary term
|
1228
|
+
#
|
1229
|
+
# start_from: int, [default=0], optional
|
1230
|
+
# When multiple pages of results are available, the page number to start from.
|
1231
|
+
# page_size: int, [default=None]
|
1232
|
+
# The number of items to return in a single page. If not specified, the default will be taken from
|
1233
|
+
# the class instance.
|
1234
|
+
# Returns
|
1235
|
+
# -------
|
1236
|
+
# List | str
|
1237
|
+
#
|
1238
|
+
# A list of categories associated with a glossary term.
|
1239
|
+
#
|
1240
|
+
# Raises
|
1241
|
+
# ------
|
1242
|
+
#
|
1243
|
+
# InvalidParameterException
|
1244
|
+
# If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1245
|
+
# PropertyServerException
|
1246
|
+
# Raised by the server when an issue arises in processing a valid request
|
1247
|
+
# NotAuthorizedException
|
1248
|
+
# The principle specified by the user_id does not have authorization for the requested action
|
1249
|
+
#
|
1250
|
+
# """
|
1251
|
+
#
|
1252
|
+
# if page_size is None:
|
1253
|
+
# page_size = self.page_size
|
1254
|
+
#
|
1255
|
+
# url = (
|
1256
|
+
# f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/terms/"
|
1257
|
+
# f"{glossary_term_guid}/categories/retrieve?startFrom={start_from}&pageSize={page_size}"
|
1258
|
+
# )
|
1259
|
+
#
|
1260
|
+
# response = await self._async_make_request("POST", url)
|
1261
|
+
# return response.json().get("elementList", "No Categories found")
|
1262
|
+
#
|
1263
|
+
# def get_categories_for_term(
|
1264
|
+
# self,
|
1265
|
+
# glossary_term_guid: str,
|
1266
|
+
# start_from: int = 0,
|
1267
|
+
# page_size: int = None,
|
1268
|
+
# ) -> list | str:
|
1269
|
+
# """Return the list of categories associated with a glossary term.
|
1270
|
+
#
|
1271
|
+
# Parameters
|
1272
|
+
# ----------
|
1273
|
+
# glossary_term_guid: str,
|
1274
|
+
# Unique identity of a glossary term
|
1275
|
+
#
|
1276
|
+
# start_from: int, [default=0], optional
|
1277
|
+
# When multiple pages of results are available, the page number to start from.
|
1278
|
+
# page_size: int, [default=None]
|
1279
|
+
# The number of items to return in a single page. If not specified, the default will be taken from
|
1280
|
+
# the class instance.
|
1281
|
+
# Returns
|
1282
|
+
# -------
|
1283
|
+
# List | str
|
1284
|
+
#
|
1285
|
+
# A list of categories associated with a glossary term.
|
1286
|
+
#
|
1287
|
+
# Raises
|
1288
|
+
# ------
|
1289
|
+
#
|
1290
|
+
# InvalidParameterException
|
1291
|
+
# If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1292
|
+
# PropertyServerException
|
1293
|
+
# Raised by the server when an issue arises in processing a valid request
|
1294
|
+
# NotAuthorizedException
|
1295
|
+
# The principle specified by the user_id does not have authorization for the requested action
|
1296
|
+
#
|
1297
|
+
# """
|
1298
|
+
# loop = asyncio.get_event_loop()
|
1299
|
+
# response = loop.run_until_complete(
|
1300
|
+
# self._async_get_categories_for_term(
|
1301
|
+
# glossary_term_guid, start_from, page_size
|
1302
|
+
# )
|
1303
|
+
# )
|
1304
|
+
# return response
|
1305
|
+
#
|
1306
|
+
# async def _async_get_categories_by_name(
|
1307
|
+
# self,
|
1308
|
+
# name: str,
|
1309
|
+
# glossary_guid: str = None,
|
1310
|
+
# status: [str] = ["ACTIVE"],
|
1311
|
+
# start_from: int = 0,
|
1312
|
+
# page_size: int = None,
|
1313
|
+
# ) -> list | str:
|
1314
|
+
# """Retrieve the list of glossary category metadata elements that either have the requested qualified name or display name.
|
1315
|
+
# The name to search for is located in the request body and is interpreted as a plain string.
|
1316
|
+
# The request body also supports the specification of a glossaryGUID to restrict the search to within a single glossary.
|
1317
|
+
#
|
1318
|
+
# Async version.
|
1319
|
+
#
|
1320
|
+
# Parameters
|
1321
|
+
# ----------
|
1322
|
+
# name: str,
|
1323
|
+
# category name to search for.
|
1324
|
+
# glossary_guid: str, optional
|
1325
|
+
# The identity of the glossary to search. If not specified, all glossaries will be searched.
|
1326
|
+
# status: [str], optional
|
1327
|
+
# A list of statuses to optionally restrict results. Default is Active
|
1328
|
+
#
|
1329
|
+
# start_from: int, [default=0], optional
|
1330
|
+
# When multiple pages of results are available, the page number to start from.
|
1331
|
+
# page_size: int, [default=None]
|
1332
|
+
# The number of items to return in a single page. If not specified, the default will be taken from
|
1333
|
+
# the class instance.
|
1334
|
+
# Returns
|
1335
|
+
# -------
|
1336
|
+
# List | str
|
1337
|
+
#
|
1338
|
+
# A list of categories with the corresponding display name or qualified name.
|
1339
|
+
#
|
1340
|
+
# Raises
|
1341
|
+
# ------
|
1342
|
+
#
|
1343
|
+
# InvalidParameterException
|
1344
|
+
# If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1345
|
+
# PropertyServerException
|
1346
|
+
# Raised by the server when an issue arises in processing a valid request
|
1347
|
+
# NotAuthorizedException
|
1348
|
+
# The principle specified by the user_id does not have authorization for the requested action
|
1349
|
+
#
|
1350
|
+
# """
|
1351
|
+
#
|
1352
|
+
# if page_size is None:
|
1353
|
+
# page_size = self.page_size
|
1354
|
+
# validate_name(name)
|
1355
|
+
#
|
1356
|
+
# url = (
|
1357
|
+
# f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/categories/"
|
1358
|
+
# f"by-name?startFrom={start_from}&pageSize={page_size}"
|
1359
|
+
# )
|
1360
|
+
#
|
1361
|
+
# body = {
|
1362
|
+
# "class": "GlossaryNameRequestBody",
|
1363
|
+
# "name": name,
|
1364
|
+
# "glossaryGUID": glossary_guid,
|
1365
|
+
# "limitResultsByStatus": status,
|
1366
|
+
# }
|
1367
|
+
#
|
1368
|
+
# response = await self._async_make_request("POST", url)
|
1369
|
+
# return response.json().get("elementList", "No Categories found")
|
1370
|
+
#
|
1371
|
+
# def get_categories_by_name(
|
1372
|
+
# self,
|
1373
|
+
# name: str,
|
1374
|
+
# glossary_guid: str = None,
|
1375
|
+
# status: [str] = ["ACTIVE"],
|
1376
|
+
# start_from: int = 0,
|
1377
|
+
# page_size: int = None,
|
1378
|
+
# ) -> list | str:
|
1379
|
+
# """Retrieve the list of glossary category metadata elements that either have the requested qualified name or display name.
|
1380
|
+
# The name to search for is located in the request body and is interpreted as a plain string.
|
1381
|
+
# The request body also supports the specification of a glossaryGUID to restrict the search to within a single glossary.
|
1382
|
+
#
|
1383
|
+
# Parameters
|
1384
|
+
# ----------
|
1385
|
+
# name: str,
|
1386
|
+
# category name to search for.
|
1387
|
+
# glossary_guid: str, optional
|
1388
|
+
# The identity of the glossary to search. If not specified, all glossaries will be searched.
|
1389
|
+
# status: [str], optional
|
1390
|
+
# A list of statuses to optionally restrict results. Default is Active
|
1391
|
+
#
|
1392
|
+
# start_from: int, [default=0], optional
|
1393
|
+
# When multiple pages of results are available, the page number to start from.
|
1394
|
+
# page_size: int, [default=None]
|
1395
|
+
# The number of items to return in a single page. If not specified, the default will be taken from
|
1396
|
+
# the class instance.
|
1397
|
+
# Returns
|
1398
|
+
# -------
|
1399
|
+
# List | str
|
1400
|
+
#
|
1401
|
+
# A list of categories with the corresponding display name or qualified name.
|
1402
|
+
#
|
1403
|
+
# Raises
|
1404
|
+
# ------
|
1405
|
+
#
|
1406
|
+
# InvalidParameterException
|
1407
|
+
# If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1408
|
+
# PropertyServerException
|
1409
|
+
# Raised by the server when an issue arises in processing a valid request
|
1410
|
+
# NotAuthorizedException
|
1411
|
+
# The principle specified by the user_id does not have authorization for the requested action
|
1412
|
+
#
|
1413
|
+
# """
|
1414
|
+
# loop = asyncio.get_event_loop()
|
1415
|
+
# response = loop.run_until_complete(
|
1416
|
+
# self._async_get_categories_by_name(
|
1417
|
+
# name, glossary_guid, status, start_from, page_size
|
1418
|
+
# )
|
1419
|
+
# )
|
1420
|
+
# return response
|
1421
|
+
#
|
1422
|
+
# async def _async_get_categories_by_guid(
|
1423
|
+
# self,
|
1424
|
+
# glossary_category_guid: str,
|
1425
|
+
# effective_time: str = None,
|
1426
|
+
# ) -> list | str:
|
1427
|
+
# """Retrieve the requested glossary category metadata element. The optional request body contain an effective
|
1428
|
+
# time for the query..
|
1429
|
+
#
|
1430
|
+
# Async version.
|
1431
|
+
#
|
1432
|
+
# Parameters
|
1433
|
+
# ----------
|
1434
|
+
# glossary_category_guid: str
|
1435
|
+
# The identity of the glossary category to search.
|
1436
|
+
# effective_time: str, optional
|
1437
|
+
# If specified, the category should only be returned if it was effective at the specified time.
|
1438
|
+
# Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
1439
|
+
#
|
1440
|
+
#
|
1441
|
+
# Returns
|
1442
|
+
# -------
|
1443
|
+
# List | str
|
1444
|
+
#
|
1445
|
+
# Details for the category with the glossary category GUID.
|
1446
|
+
#
|
1447
|
+
# Raises
|
1448
|
+
# ------
|
1449
|
+
#
|
1450
|
+
# InvalidParameterException
|
1451
|
+
# If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1452
|
+
# PropertyServerException
|
1453
|
+
# Raised by the server when an issue arises in processing a valid request
|
1454
|
+
# NotAuthorizedException
|
1455
|
+
# The principle specified by the user_id does not have authorization for the requested action
|
1456
|
+
#
|
1457
|
+
# """
|
1458
|
+
#
|
1459
|
+
# url = (
|
1460
|
+
# f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/categories/"
|
1461
|
+
# f"{glossary_category_guid}/retrieve"
|
1462
|
+
# )
|
1463
|
+
#
|
1464
|
+
# body = {
|
1465
|
+
# "class": "EffectiveTimeQueryRequestBody",
|
1466
|
+
# "effectiveTime": effective_time,
|
1467
|
+
# }
|
1468
|
+
#
|
1469
|
+
# response = await self._async_make_request("POST", url, body)
|
1470
|
+
# return response.json().get("element", "No Category found")
|
1471
|
+
#
|
1472
|
+
# def get_categories_by_guid(
|
1473
|
+
# self,
|
1474
|
+
# glossary_category_guid: str,
|
1475
|
+
# effective_time: str = None,
|
1476
|
+
# ) -> list | str:
|
1477
|
+
# """Retrieve the requested glossary category metadata element. The optional request body contain an effective
|
1478
|
+
# time for the query..
|
1479
|
+
#
|
1480
|
+
# Parameters
|
1481
|
+
# ----------
|
1482
|
+
# glossary_category_guid: str
|
1483
|
+
# The identity of the glossary category to search.
|
1484
|
+
# effective_time, datetime, optional
|
1485
|
+
# If specified, the category should only be returned if it was effective at the specified time.
|
1486
|
+
# Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
1487
|
+
#
|
1488
|
+
#
|
1489
|
+
# Returns
|
1490
|
+
# -------
|
1491
|
+
# List | str
|
1492
|
+
#
|
1493
|
+
# Details for the category with the glossary category GUID.
|
1494
|
+
#
|
1495
|
+
# Raises
|
1496
|
+
# ------
|
1497
|
+
#
|
1498
|
+
# InvalidParameterException
|
1499
|
+
# If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1500
|
+
# PropertyServerException
|
1501
|
+
# Raised by the server when an issue arises in processing a valid request
|
1502
|
+
# NotAuthorizedException
|
1503
|
+
# The principle specified by the user_id does not have authorization for the requested action
|
1504
|
+
#
|
1505
|
+
# """
|
1506
|
+
# loop = asyncio.get_event_loop()
|
1507
|
+
# response = loop.run_until_complete(
|
1508
|
+
# self._async_get_categories_by_guid(glossary_category_guid, effective_time)
|
1509
|
+
# )
|
1510
|
+
# return response
|
1511
|
+
#
|
1512
|
+
# async def _async_get_category_parent(
|
1513
|
+
# self,
|
1514
|
+
# glossary_category_guid: str,
|
1515
|
+
# effective_time: str = None,
|
1516
|
+
# ) -> list | str:
|
1517
|
+
# """Glossary categories can be organized in a hierarchy. Retrieve the parent glossary category metadata
|
1518
|
+
# element for the glossary category with the supplied unique identifier. If the requested category
|
1519
|
+
# does not have a parent category, null is returned. The optional request body contain an effective time
|
1520
|
+
# for the query.
|
1521
|
+
#
|
1522
|
+
# Async version.
|
1523
|
+
#
|
1524
|
+
# Parameters
|
1525
|
+
# ----------
|
1526
|
+
# glossary_category_guid: str
|
1527
|
+
# The identity of the glossary category to search.
|
1528
|
+
# effective_time, datetime, optional
|
1529
|
+
# If specified, the category should only be returned if it was effective at the specified time.
|
1530
|
+
# Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
|
1531
|
+
#
|
1532
|
+
#
|
1533
|
+
# Returns
|
1534
|
+
# -------
|
1535
|
+
# List | str
|
1536
|
+
#
|
1537
|
+
# Details for the parent category with the glossary category GUID.
|
1538
|
+
#
|
1539
|
+
# Raises
|
1540
|
+
# ------
|
1541
|
+
#
|
1542
|
+
# InvalidParameterException
|
1543
|
+
# If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1544
|
+
# PropertyServerException
|
1545
|
+
# Raised by the server when an issue arises in processing a valid request
|
1546
|
+
# NotAuthorizedException
|
1547
|
+
# The principle specified by the user_id does not have authorization for the requested action
|
1548
|
+
#
|
1549
|
+
# """
|
1550
|
+
#
|
1551
|
+
# url = (
|
1552
|
+
# f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/categories/"
|
1553
|
+
# f"{glossary_category_guid}/parent/retrieve"
|
1554
|
+
# )
|
1555
|
+
#
|
1556
|
+
# body = {
|
1557
|
+
# "class": "EffectiveTimeQueryRequestBody",
|
1558
|
+
# "effectiveTime": effective_time,
|
1559
|
+
# }
|
1560
|
+
#
|
1561
|
+
# response = await self._async_make_request("POST", url, body)
|
1562
|
+
# return response.json().get("element", "No Parent Category found")
|
1563
|
+
#
|
1564
|
+
# def get_category_parent(
|
1565
|
+
# self,
|
1566
|
+
# glossary_category_guid: str,
|
1567
|
+
# effective_time: str = None,
|
1568
|
+
# ) -> list | str:
|
1569
|
+
# """Glossary categories can be organized in a hierarchy. Retrieve the parent glossary category metadata
|
1570
|
+
# element for the glossary category with the supplied unique identifier. If the requested category
|
1571
|
+
# does not have a parent category, null is returned. The optional request body contain an effective time
|
1572
|
+
# for the query.
|
1573
|
+
#
|
1574
|
+
# Parameters
|
1575
|
+
# ----------
|
1576
|
+
# glossary_category_guid: str
|
1577
|
+
# The identity of the glossary category to search.
|
1578
|
+
# effective_time, datetime, optional
|
1579
|
+
# If specified, the category should only be returned if it was effective at the specified time.
|
1580
|
+
# Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
|
1581
|
+
#
|
1582
|
+
#
|
1583
|
+
# Returns
|
1584
|
+
# -------
|
1585
|
+
# List | str
|
1586
|
+
#
|
1587
|
+
# Details for the parent category with the glossary category GUID.
|
1588
|
+
#
|
1589
|
+
# Raises
|
1590
|
+
# ------
|
1591
|
+
#
|
1592
|
+
# InvalidParameterException
|
1593
|
+
# If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1594
|
+
# PropertyServerException
|
1595
|
+
# Raised by the server when an issue arises in processing a valid request
|
1596
|
+
# NotAuthorizedException
|
1597
|
+
# The principle specified by the user_id does not have authorization for the requested action
|
1598
|
+
#
|
1599
|
+
# """
|
1600
|
+
# loop = asyncio.get_event_loop()
|
1601
|
+
# response = loop.run_until_complete(
|
1602
|
+
# self._async_get_category_parent(glossary_category_guid, effective_time)
|
1603
|
+
# )
|
1604
|
+
# return response
|
1396
1605
|
|
1397
1606
|
#
|
1398
1607
|
# Terms
|
@@ -1528,7 +1737,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
1528
1737
|
|
1529
1738
|
return response
|
1530
1739
|
|
1531
|
-
def
|
1740
|
+
def load_terms_from_csv_file(
|
1532
1741
|
self,
|
1533
1742
|
glossary_name: str,
|
1534
1743
|
filename: str,
|