pyegeria 1.5.1.1.60__py3-none-any.whl → 1.5.1.1.61__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.
@@ -0,0 +1,156 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ SPDX-License-Identifier: Apache-2.0
4
+ Copyright Contributors to the ODPi Egeria project.
5
+
6
+ Unit tests for the Utils helper functions using the Pytest framework.
7
+
8
+
9
+ A simple display for glossary terms
10
+ """
11
+ import argparse
12
+ import os
13
+ import sys
14
+ import time
15
+
16
+ from rich import box, print
17
+ from rich.console import Console
18
+ from rich.markdown import Markdown
19
+ from rich.prompt import Prompt
20
+ from rich.table import Table
21
+ from rich.text import Text
22
+ from rich_pixels import Pixels
23
+
24
+
25
+ from pyegeria import (
26
+ InvalidParameterException,
27
+ PropertyServerException,
28
+ UserNotAuthorizedException,
29
+ EgeriaTech,
30
+ print_exception_response,
31
+ )
32
+
33
+ disable_ssl_warnings = True
34
+
35
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
36
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
37
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
38
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
39
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
40
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
41
+ )
42
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
43
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
44
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
45
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
46
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
47
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
48
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
49
+
50
+
51
+ def display_glossaries(
52
+ search_string: str = "*",
53
+ view_server: str = EGERIA_VIEW_SERVER,
54
+ view_url: str = EGERIA_VIEW_SERVER_URL,
55
+ user: str = EGERIA_USER,
56
+ user_pass: str = EGERIA_USER_PASSWORD,
57
+ jupyter: bool = EGERIA_JUPYTER,
58
+ width: int = EGERIA_WIDTH,
59
+ ):
60
+ """Display either a specified glossary or all glossaries if the search_string is '*'.
61
+ Parameters
62
+ ----------
63
+ search_string : str, default is '*'
64
+ The string used to search for glossaries.
65
+ view_server : str
66
+ The view server name or address where the Egeria services are hosted.
67
+ view_url : str
68
+ The URL of the platform the view server is on.
69
+ user : str
70
+ The user ID for authentication with the Egeria server.
71
+ user_pass : str
72
+ The password for authentication with the Egeria server.
73
+ jupyter : bool, optional
74
+ A boolean indicating whether the output is intended for a Jupyter notebook (default is EGERIA_JUPYTER).
75
+ width : int, optional
76
+ The width of the console output (default is EGERIA_WIDTH).
77
+ """
78
+ m_client = EgeriaTech(view_server, view_url, user_id=user, user_pwd=user_pass)
79
+ token = m_client.create_egeria_bearer_token()
80
+ try:
81
+ table = Table(
82
+ title=f"Glossary List @ {time.asctime()}",
83
+ style="bright_white on black",
84
+ header_style="bright_white on dark_blue",
85
+ title_style="bold white on black",
86
+ caption_style="white on black",
87
+ show_lines=True,
88
+ box=box.ROUNDED,
89
+ caption=f"View Server '{view_server}' @ Platform - {view_url}",
90
+ expand=True,
91
+ )
92
+ table.add_column("Glossary Name")
93
+ table.add_column(
94
+ "Qualified Name & GUID", width=38, no_wrap=True, justify="center"
95
+ )
96
+ table.add_column("Language")
97
+
98
+ table.add_column("Usage", width=50, justify="center")
99
+
100
+ glossaries = m_client.find_glossaries(search_string)
101
+ if type(glossaries) is list:
102
+ sorted_glossary_list = sorted(
103
+ glossaries, key=lambda k: k["glossaryProperties"]["displayName"]
104
+ )
105
+ for glossary in sorted_glossary_list:
106
+ display_name = glossary["glossaryProperties"]["displayName"]
107
+ qualified_name = glossary["glossaryProperties"]["qualifiedName"]
108
+ guid = glossary["elementHeader"]["guid"]
109
+ q_name = Text(f"{qualified_name}\n&\n{guid}", justify="center")
110
+ language = glossary["glossaryProperties"]["language"]
111
+ description = glossary["glossaryProperties"]["description"]
112
+ usage = glossary["glossaryProperties"]["usage"]
113
+ text = "http://100.83.199.62:8088/superset/dashboard/p/xOgE56dLNaY/"
114
+
115
+ table.add_row(display_name, q_name, language, text)
116
+ console = Console(
117
+ style="bold bright_white on black",
118
+ width=width,
119
+ force_terminal=not jupyter,
120
+ )
121
+ console.print(table)
122
+ print("Visit my [link=https://www.willmcgugan.com]blog[/link]!")
123
+
124
+ except (InvalidParameterException, PropertyServerException) as e:
125
+ print_exception_response(e)
126
+ finally:
127
+ m_client.close_session()
128
+
129
+
130
+ def main():
131
+ parser = argparse.ArgumentParser()
132
+ parser.add_argument("--server", help="Name of the server to display status for")
133
+ parser.add_argument("--url", help="URL Platform to connect to")
134
+ parser.add_argument("--userid", help="User Id")
135
+ parser.add_argument("--password", help="User Password")
136
+
137
+ args = parser.parse_args()
138
+
139
+ server = args.server if args.server is not None else EGERIA_VIEW_SERVER
140
+ url = args.url if args.url is not None else EGERIA_PLATFORM_URL
141
+ userid = args.userid if args.userid is not None else EGERIA_USER
142
+ user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
143
+
144
+ try:
145
+ search_string = Prompt.ask(
146
+ "Enter the glossary you are searching for or '*' for all:", default="*"
147
+ )
148
+
149
+ display_glossaries(search_string, server, url, userid, user_pass)
150
+
151
+ except KeyboardInterrupt:
152
+ pass
153
+
154
+
155
+ if __name__ == "__main__":
156
+ main()
@@ -169,7 +169,7 @@ def main():
169
169
  parser.add_argument("--password", help="User Password")
170
170
  args = parser.parse_args()
171
171
 
172
- full = args.extended if args.extended is not None else False
172
+ full = args.full if args.full is not None else False
173
173
  server = args.server if args.server is not None else EGERIA_VIEW_SERVER
174
174
  url = args.url if args.url is not None else EGERIA_PLATFORM_URL
175
175
  userid = args.userid if args.userid is not None else EGERIA_ADMIN_USER
@@ -818,6 +818,42 @@ class CoreServerConfig(Client):
818
818
  )
819
819
  self.make_request("POST", url, severities)
820
820
 
821
+ def add_postgres_log_destinations(
822
+ self, config_body: dict, server_name: str = None
823
+ ) -> None:
824
+ """Adds a postgres log destination to a server.
825
+
826
+ Parameters
827
+ ----------
828
+ config_body : str
829
+ Configuration of the postgres database for the audit log destination.
830
+ server_name : str
831
+ Name of the server to update.
832
+
833
+ Returns
834
+ -------
835
+ Void
836
+
837
+ Raises
838
+ ------
839
+
840
+ InvalidParameterException:
841
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
842
+ PropertyServerException:
843
+ Raised by the server when an issue arises in processing a valid request
844
+ NotAuthorizedException:
845
+ The principle specified by the user_id does not have authorization for the requested action
846
+ ConfigurationErrorException:
847
+ Raised when configuration parameters passed on earlier calls turn out to be
848
+ invalid or make the new call invalid.
849
+
850
+ """
851
+ if server_name is None:
852
+ server_name = self.server_name
853
+
854
+ url = f"{self.core_command_root}/servers/{server_name}/audit-log-destinations/postgres"
855
+ self.make_request("POST", url, config_body)
856
+
821
857
  def add_slf4j_log_destination(
822
858
  self, severities: [str] = None, server_name: str = None
823
859
  ) -> None:
@@ -1,29 +1,29 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 1.5.1.1.60
3
+ Version: 1.5.1.1.61
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
7
7
  Keywords: egeria,metadata,governance
8
8
  Author: Dan Wolfson
9
9
  Author-email: dan.wolfson@pdr-associates.com
10
- Requires-Python: >=3.11,<4.0
10
+ Requires-Python: >=3.12,<4.0
11
11
  Classifier: License :: OSI Approved :: Apache Software License
12
12
  Classifier: License :: Other/Proprietary License
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
17
16
  Requires-Dist: click (>=8.1.7,<9.0.0)
18
17
  Requires-Dist: confluent-kafka (>=2.5.0,<3.0.0)
19
- Requires-Dist: httpx (>=0.27.0,<0.28.0)
18
+ Requires-Dist: httpx (>=0.27,<0.28)
20
19
  Requires-Dist: jupyter (>=1.0.0,<2.0.0)
21
20
  Requires-Dist: mermaid-py (>=0.5.3,<0.6.0)
22
21
  Requires-Dist: psycopg2-binary (>=2.9.9,<3.0.0)
23
22
  Requires-Dist: pytest (>=8.2.2,<9.0.0)
24
23
  Requires-Dist: requests (>=2.32.3,<3.0.0)
25
- Requires-Dist: rich (>=13.8.1,<14.0.0)
26
- Requires-Dist: textual (>=0.75.1,<0.76.0)
24
+ Requires-Dist: rich (>=13,<14)
25
+ Requires-Dist: rich-pixels (>=3.0.1,<4.0.0)
26
+ Requires-Dist: textual (>=0.86,<0.87)
27
27
  Requires-Dist: textual-forms (>=0.3.0,<0.4.0)
28
28
  Requires-Dist: trogon (>=0.5.0,<0.6.0)
29
29
  Requires-Dist: urllib3 (>=2.2.2,<3.0.0)
@@ -13,6 +13,7 @@ pyegeria/commands/README.md,sha256=zNfWZppDxoKqTJeRtcewzku9z1m6_hKacCyQUQw1iq4,1
13
13
  pyegeria/commands/__init__.py,sha256=IBYAvBbuGneZ06YSFjZsU-Zxx-b-Qo4ZV_Vd4zz4AI0,844
14
14
  pyegeria/commands/cat/README.md,sha256=-aaAnIT2fcfU63vajgB-RzQk4l4yFdhkyVfSaTPiqRY,967
15
15
  pyegeria/commands/cat/__init__.py,sha256=3LHTWeyxLdFGDhWVTBzgJ6Y_9b2pM5CO2-kbsUASv4M,300
16
+ pyegeria/commands/cat/exp_list_glossaries.py,sha256=Gz_4XdwxhblIriuXajjwXueyRRGDwwyTXcfQiFjn1xY,5804
16
17
  pyegeria/commands/cat/get_asset_graph.py,sha256=4AO4KlCgb7vbMihJK7W_GAnrd4J9sKwc4kXxa2ZrRW4,12447
17
18
  pyegeria/commands/cat/get_collection.py,sha256=v7hCeEDcAQmcjM9qepuk8gg_RnYra3_v009AJOunkKk,5005
18
19
  pyegeria/commands/cat/get_project_dependencies.py,sha256=B0JaMSUi0hzVgos1sTY2uUPGy1DzKEJMIbbYfMUWvQA,5981
@@ -75,6 +76,7 @@ pyegeria/commands/doc/glossary/images/tui-show-glossary-terms 2024-11-05 at 19.3
75
76
  pyegeria/commands/doc/glossary/images/tui-upsert 2024-11-07 at 11.49.04.png,sha256=tLM_fX53WHDL3bALqvTugOsq_v-CcwaLQpJ0325gewE,347024
76
77
  pyegeria/commands/doc/glossary/images/upsert-example.om-terms 2024-11-07 at 11.44.05.png,sha256=h0VE0ybRygOToKYnRplTwXcQlK4H7AzCySO7YEfkKuc,174761
77
78
  pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/hey_egeria: overview.md,sha256=kCKj6rYTBj2De4XJYatP2X0m-7iS43r5zUTeLyDEVYE,18950
79
+ pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/CleanShot 2024-11-18 at 21.32.03@2x.png,sha256=VAlnHSpnDqCGTIc-IOozARcR6sSl9QNgmhuPOeiM-4s,913730
78
80
  pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/Xmind 1731421782704.png,sha256=8lfyO8prtahjTqqT4Uk3HSICipBpf1ly2bXp00csRb8,314990
79
81
  pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/Xmind 1731422134920.png,sha256=Ri4xBHuYzsMrOpoq48-3UkfQNLm9coJxLT_LJGNIU80,745535
80
82
  pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/hey_egeria 2024-11-12 at 20.38.43.png,sha256=J9g754NN27AOk_OYUPI4o0A7cM5oHUqO-P5sjUmBsxM,387071
@@ -110,7 +112,7 @@ pyegeria/commands/ops/monitor_gov_eng_status.py,sha256=nR0xI_8L8W6gOJm8-jp8BaAeO
110
112
  pyegeria/commands/ops/monitor_integ_daemon_status.py,sha256=NQVHJuZfRfSaO7WjZnziI6ckHLCl06ykliJCV_sICOI,11368
111
113
  pyegeria/commands/ops/monitor_platform_status.py,sha256=E4Qf6m1dv8EqUV1-LAxWAlOrZRqNSXJgJ0i_cczW1aI,6578
112
114
  pyegeria/commands/ops/monitor_server_startup.py,sha256=0pwnhv761uuFHGJXVANa5RhQQPPTXFldJ45TfeT7qfk,3901
113
- pyegeria/commands/ops/monitor_server_status.py,sha256=TLdtjt5EFR-VVC2jAZqiBlGMvtb5IjOTdtdVZfHMz0o,6878
115
+ pyegeria/commands/ops/monitor_server_status.py,sha256=O7iixd-6jzaDO7QrK1JuXLdrDF291YvxLbgLUk3BYQs,6870
114
116
  pyegeria/commands/ops/orig_monitor_server_list.py,sha256=Uhtn8lv7QVXJBi9DSR3Nelmz8TB0vOsat10nFS6Nu20,4637
115
117
  pyegeria/commands/ops/orig_monitor_server_status.py,sha256=A-8hMDfbscdcq-b1OD4wKn0tphumX8WIK-Hz8uPoFkc,3974
116
118
  pyegeria/commands/ops/refresh_integration_daemon.py,sha256=WEAeaFAEWLJ055pGfzX6rkn7mq3Z0FYqJ0Xn0z1VjtA,2962
@@ -138,7 +140,7 @@ pyegeria/commands/tech/list_tech_templates.py,sha256=FIeYWnJY2bVUrfDQBJX2bpkp5cU
138
140
  pyegeria/commands/tech/list_valid_metadata_values.py,sha256=N3D0_BmREPszgde3uvvYdfzq7DJ46uMOv2t1vtncGsw,6333
139
141
  pyegeria/commands/tech/table_tech_templates.py,sha256=_aWI4U8CMO0c2JdUxfqW7b2RQADMPUBvTulWk6m50VA,9318
140
142
  pyegeria/commands/tech/x_list_related_elements.py,sha256=qBsf1619cecaMCTzG0MG22fAT32WNH2Z3CXrjo9z-5Y,5853
141
- pyegeria/core_omag_server_config.py,sha256=UKgnMGjB-WikvRjjkVjkAcbWEsL5G10BlHBFPgCoCw8,96497
143
+ pyegeria/core_omag_server_config.py,sha256=ej0oNpGelSTTm2oERS86LpgT9O9E5CZFbUm2Iek8f1E,97764
142
144
  pyegeria/create_tech_guid_lists.py,sha256=HHkC6HW58EN1BiolrYSRqSE0JhPbTepOFzwtdwBxVaU,4640
143
145
  pyegeria/egeria_cat_client.py,sha256=NzwDbdi5OBHOOA7JzIQC5LqJJ7xtEwHA5yaKrGkDFnc,2022
144
146
  pyegeria/egeria_client.py,sha256=gZjo_Z8n7r05KJnQgJuQibGOvCA90JCDlzyFRGkZV-I,3366
@@ -160,8 +162,8 @@ pyegeria/template_manager_omvs.py,sha256=heqbKeum5hPCHap4r1RUZU8YB3QaQlxVNbq4GZi
160
162
  pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
161
163
  pyegeria/valid_metadata_omvs.py,sha256=tfCGXed5LLt59YA8uZNNtd9UJ-lRZfPU_uZxK31Yux0,65069
162
164
  pyegeria/x_action_author_omvs.py,sha256=xu1IQ0YbhIKi17C5a7Aq9u1Az2czwahNPpX9czmyVxE,6454
163
- pyegeria-1.5.1.1.60.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
164
- pyegeria-1.5.1.1.60.dist-info/METADATA,sha256=jSeDNCcs-ovkGuyFsD9jkBDQwd-_HBucn_rAzjL4o3I,2998
165
- pyegeria-1.5.1.1.60.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
166
- pyegeria-1.5.1.1.60.dist-info/entry_points.txt,sha256=oG-N-_kcUg7NFj2XchfxtFqsL4d4uOxlGYZOzDta1Pg,5171
167
- pyegeria-1.5.1.1.60.dist-info/RECORD,,
165
+ pyegeria-1.5.1.1.61.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
166
+ pyegeria-1.5.1.1.61.dist-info/METADATA,sha256=LPbV3MEz4VPkgPeKrC53vdWDLASlTN7XuVeGWvjIf74,2975
167
+ pyegeria-1.5.1.1.61.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
168
+ pyegeria-1.5.1.1.61.dist-info/entry_points.txt,sha256=oG-N-_kcUg7NFj2XchfxtFqsL4d4uOxlGYZOzDta1Pg,5171
169
+ pyegeria-1.5.1.1.61.dist-info/RECORD,,