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