pyegeria 1.5.1.1.28__tar.gz → 1.5.1.1.31__tar.gz

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 (117) hide show
  1. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/PKG-INFO +1 -1
  2. pyegeria-1.5.1.1.31/pyegeria/commands/__init__.py +21 -0
  3. pyegeria-1.5.1.1.31/pyegeria/commands/cat/__init__.py +5 -0
  4. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/glossary_actions.py +0 -88
  5. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/list_deployed_catalogs.py +27 -7
  6. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/list_deployed_database_schemas.py +25 -7
  7. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/list_deployed_databases.py +22 -6
  8. pyegeria-1.5.1.1.31/pyegeria/commands/cat/list_glossaries.py +148 -0
  9. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/list_terms.py +37 -10
  10. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cli/egeria.py +18 -2
  11. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cli/egeria_cat.py +18 -3
  12. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/__init__.py +6 -6
  13. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/monitor_engine_activity_c.py +28 -9
  14. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/monitor_gov_eng_status.py +31 -1
  15. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/monitor_integ_daemon_status.py +43 -1
  16. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/monitor_platform_status.py +6 -6
  17. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/table_integ_daemon_status.py +48 -103
  18. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyproject.toml +2 -2
  19. pyegeria-1.5.1.1.28/pyegeria/commands/__init__.py +0 -14
  20. pyegeria-1.5.1.1.28/pyegeria/commands/cat/__init__.py +0 -5
  21. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/LICENSE +0 -0
  22. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/README.md +0 -0
  23. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/README.md +0 -0
  24. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/__init__.py +0 -0
  25. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/_client.py +0 -0
  26. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/_deprecated_gov_engine.py +0 -0
  27. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/_exceptions.py +0 -0
  28. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/_globals.py +0 -0
  29. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/_validators.py +0 -0
  30. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/asset_catalog_omvs.py +0 -0
  31. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/automated_curation_omvs.py +0 -0
  32. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/classification_manager_omvs.py +0 -0
  33. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/collection_manager_omvs.py +0 -0
  34. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/.DS_Store +0 -0
  35. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/README.md +0 -0
  36. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/__pycache__/server_status_widget.cpython-312-pytest-7.4.4.pyc +0 -0
  37. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/README.md +0 -0
  38. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/get_asset_graph.py +0 -0
  39. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/get_collection.py +0 -0
  40. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/get_project_dependencies.py +0 -0
  41. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/get_project_structure.py +0 -0
  42. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/get_tech_type_elements.py +0 -0
  43. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/get_tech_type_template.py +0 -0
  44. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/list_archives.py +0 -0
  45. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/list_assets.py +0 -0
  46. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/list_cert_types.py +0 -0
  47. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/list_projects.py +0 -0
  48. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/list_relationships.py +0 -0
  49. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/list_tech_types.py +0 -0
  50. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/list_todos.py +0 -0
  51. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cat/list_user_ids.py +0 -0
  52. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cli/__init__.py +0 -0
  53. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cli/egeria_my.py +0 -0
  54. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cli/egeria_ops.py +0 -0
  55. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cli/egeria_tech.py +0 -0
  56. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/cli/ops_config.py +0 -0
  57. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/my/README.md +0 -0
  58. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/my/__init__.py +0 -0
  59. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/my/list_my_profile.py +0 -0
  60. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/my/list_my_roles.py +0 -0
  61. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/my/monitor_my_todos.py +0 -0
  62. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/my/monitor_open_todos.py +0 -0
  63. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/my/todo_actions.py +0 -0
  64. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/README.md +0 -0
  65. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/engine_actions.py +0 -0
  66. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/gov_server_actions.py +0 -0
  67. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/list_catalog_targets.py +0 -0
  68. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/load_archive.py +0 -0
  69. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/monitor_asset_events.py +0 -0
  70. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/monitor_engine_activity.py +0 -0
  71. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/monitor_server_startup.py +0 -0
  72. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/monitor_server_status.py +0 -0
  73. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/orig_monitor_server_list.py +0 -0
  74. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/orig_monitor_server_status.py +0 -0
  75. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/refresh_integration_daemon.py +0 -0
  76. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/ops/restart_integration_daemon.py +0 -0
  77. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/README.md +0 -0
  78. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/__init__.py +0 -0
  79. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/get_element_graph.py +0 -0
  80. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/get_element_info.py +0 -0
  81. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/get_guid_info.py +0 -0
  82. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/get_tech_details.py +0 -0
  83. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/list_asset_types.py +0 -0
  84. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/list_elements.py +0 -0
  85. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/list_elements_for_classification.py +0 -0
  86. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/list_elements_x.py +0 -0
  87. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/list_gov_action_processes.py +0 -0
  88. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/list_registered_services.py +0 -0
  89. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/list_related_elements.py +0 -0
  90. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/list_related_specification.py +0 -0
  91. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/list_relationship_types.py +0 -0
  92. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/list_tech_templates.py +0 -0
  93. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/list_valid_metadata_values.py +0 -0
  94. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/table_tech_templates.py +0 -0
  95. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/commands/tech/x_list_related_elements.py +0 -0
  96. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/core_omag_server_config.py +0 -0
  97. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/create_tech_guid_lists.py +0 -0
  98. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/egeria_cat_client.py +0 -0
  99. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/egeria_client.py +0 -0
  100. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/egeria_config_client.py +0 -0
  101. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/egeria_my_client.py +0 -0
  102. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/egeria_tech_client.py +0 -0
  103. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/feedback_manager_omvs.py +0 -0
  104. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/full_omag_server_config.py +0 -0
  105. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/glossary_browser_omvs.py +0 -0
  106. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/glossary_manager_omvs.py +0 -0
  107. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/mermaid_utilities.py +0 -0
  108. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/my_profile_omvs.py +0 -0
  109. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/platform_services.py +0 -0
  110. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/project_manager_omvs.py +0 -0
  111. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/registered_info.py +0 -0
  112. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/runtime_manager_omvs.py +0 -0
  113. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/server_operations.py +0 -0
  114. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/template_manager_omvs.py +0 -0
  115. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/utils.py +0 -0
  116. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/valid_metadata_omvs.py +0 -0
  117. {pyegeria-1.5.1.1.28 → pyegeria-1.5.1.1.31}/pyegeria/x_action_author_omvs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 1.5.1.1.28
3
+ Version: 1.5.1.1.31
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -0,0 +1,21 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+
6
+
7
+ pyegeria commands available also from python.
8
+ """
9
+
10
+ from .ops.monitor_gov_eng_status import display_gov_eng_status
11
+ from .ops.monitor_integ_daemon_status import display_integration_daemon_status
12
+ from .ops.table_integ_daemon_status import (
13
+ display_integration_daemon_status as table_integ_daemon_status,
14
+ )
15
+ from .ops.monitor_engine_activity_c import display_engine_activity_c
16
+
17
+ from .cat.list_glossaries import display_glossaries
18
+ from .cat.list_terms import display_glossary_terms
19
+ from .cat.list_deployed_catalogs import list_deployed_catalogs
20
+ from .cat.list_deployed_database_schemas import list_deployed_database_schemas
21
+ from .cat.list_deployed_databases import list_deployed_databases
@@ -0,0 +1,5 @@
1
+ from .list_glossaries import display_glossaries
2
+ from .list_terms import display_glossary_terms
3
+ from .list_deployed_catalogs import list_deployed_catalogs
4
+ from .list_deployed_database_schemas import list_deployed_database_schemas
5
+ from .list_deployed_databases import list_deployed_databases
@@ -117,94 +117,6 @@ def create_glossary(
117
117
  m_client.close_session()
118
118
 
119
119
 
120
- def display_glossaries(
121
- search_string: str,
122
- server: str,
123
- url: str,
124
- userid: str,
125
- password: str,
126
- timeout: int,
127
- jupyter: bool,
128
- width: int,
129
- ):
130
- list_glossaries(
131
- search_string, server, url, userid, password, timeout, jupyter, width
132
- )
133
-
134
-
135
- @click.command("glossaries")
136
- @click.option("--search-string", default="*", help="Glossaries to search for")
137
- @click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
138
- @click.option(
139
- "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
140
- )
141
- @click.option("--userid", default=EGERIA_USER, help="Egeria user")
142
- @click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
143
- @click.option("--timeout", default=60, help="Number of seconds to wait")
144
- @click.option(
145
- "--jupyter",
146
- is_flag=True,
147
- default=False,
148
- envvar="EGERIA_JUPYTER",
149
- help="Enable for rendering in a Jupyter terminal",
150
- )
151
- @click.option(
152
- "--width",
153
- default=200,
154
- envvar="EGERIA_WIDTH",
155
- help="Screen width, in characters, to use",
156
- )
157
- def list_glossaries(
158
- search_string, server, url, userid, password, timeout, jupyter, width
159
- ):
160
- """List all glossaries"""
161
- m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
162
- token = m_client.create_egeria_bearer_token()
163
- try:
164
- table = Table(
165
- title=f"Glossary List @ {time.asctime()}",
166
- style="bright_white on black",
167
- header_style="bright_white on dark_blue",
168
- title_style="bold white on black",
169
- caption_style="white on black",
170
- show_lines=True,
171
- box=box.ROUNDED,
172
- caption=f"View Server '{server}' @ Platform - {url}",
173
- expand=True,
174
- )
175
- table.add_column("Glossary Name")
176
- table.add_column("Qualified Name / GUID", width=38, no_wrap=True)
177
- table.add_column("Language")
178
- table.add_column("Description")
179
- table.add_column("Usage")
180
-
181
- glossaries = m_client.find_glossaries(search_string)
182
- if type(glossaries) is list:
183
- sorted_glossary_list = sorted(
184
- glossaries, key=lambda k: k["glossaryProperties"]["displayName"]
185
- )
186
- for glossary in sorted_glossary_list:
187
- display_name = glossary["glossaryProperties"]["displayName"]
188
- qualified_name = glossary["glossaryProperties"]["qualifiedName"]
189
- guid = glossary["elementHeader"]["guid"]
190
- q_name = f"{qualified_name}\n\n{guid}"
191
- language = glossary["glossaryProperties"]["language"]
192
- description = glossary["glossaryProperties"]["description"]
193
- usage = glossary["glossaryProperties"]["usage"]
194
- table.add_row(display_name, q_name, language, description, usage)
195
- console = Console(
196
- style="bold bright_white on black",
197
- width=width,
198
- force_terminal=not jupyter,
199
- )
200
- console.print(table)
201
-
202
- except (InvalidParameterException, PropertyServerException) as e:
203
- print_exception_response(e)
204
- finally:
205
- m_client.close_session()
206
-
207
-
208
120
  @click.command("delete-glossary")
209
121
  @click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
210
122
  @click.option(
@@ -47,21 +47,41 @@ def check_if_template(header: dict) -> bool:
47
47
 
48
48
 
49
49
  def list_deployed_catalogs(
50
- catalog_server: str,
51
- server: str,
52
- url: str,
53
- username: str,
54
- password: str,
50
+ catalog_server: str = "*",
51
+ view_server: str = EGERIA_VIEW_SERVER,
52
+ view_url: str = EGERIA_VIEW_SERVER_URL,
53
+ user: str = EGERIA_USER,
54
+ user_pass: str = EGERIA_USER_PASSWORD,
55
55
  jupyter: bool = EGERIA_JUPYTER,
56
56
  width: int = EGERIA_WIDTH,
57
57
  ):
58
- c_client = EgeriaTech(server, url, user_id=username, user_pwd=password)
58
+ """
59
+ Display the list of deployed catalogs. These could be metadata catalogs or other catalogs such as database catalogs..
60
+
61
+ Parameters
62
+ ----------
63
+ catalog_server : str, optional
64
+ The name of the catalog server to query. Default is "*" for all catalog servers.
65
+ view_server : str, optional
66
+ The server providing the view. Default is EGERIA_VIEW_SERVER.
67
+ view_url : str, optional
68
+ The URL of the view server. Default is EGERIA_VIEW_SERVER_URL.
69
+ user : str, optional
70
+ The user ID for authentication. Default is EGERIA_USER.
71
+ user_pass : str, optional
72
+ The password for the user. Default is EGERIA_USER_PASSWORD.
73
+ jupyter : bool, optional
74
+ Enable Jupyter notebook output. Default is EGERIA_JUPYTER.
75
+ width : int, optional
76
+ The width of the console output. Default is EGERIA_WIDTH.
77
+ """
78
+ c_client = EgeriaTech(view_server, view_url, user_id=user, user_pwd=user_pass)
59
79
  token = c_client.create_egeria_bearer_token()
60
80
 
61
81
  def generate_table() -> Table:
62
82
  """Make a new table."""
63
83
  table = Table(
64
- caption=f"Databases found: {url} - {server} @ {time.asctime()}",
84
+ caption=f"Databases found: {view_url} - {view_server} @ {time.asctime()}",
65
85
  style="bold bright_white on black",
66
86
  row_styles=["bold bright_white on black"],
67
87
  header_style="white on dark_blue",
@@ -55,21 +55,39 @@ def make_prop_md(props: dict) -> str:
55
55
 
56
56
 
57
57
  def list_deployed_database_schemas(
58
- db_name: str,
59
- server: str,
60
- url: str,
61
- username: str,
62
- password: str,
58
+ db_name: str = "*",
59
+ view_server: str = EGERIA_VIEW_SERVER,
60
+ view_url: str = EGERIA_VIEW_SERVER_URL,
61
+ user: str = EGERIA_USER,
62
+ user_pass: str = EGERIA_USER_PASSWORD,
63
63
  jupyter: bool = EGERIA_JUPYTER,
64
64
  width: int = EGERIA_WIDTH,
65
65
  ):
66
- c_client = EgeriaTech(server, url, user_id=username, user_pwd=password)
66
+ """List schemas that have been deployed in database catalogs or databases.
67
+ Parameters
68
+ ----------
69
+ db_name : str
70
+ Name of the database or catalog to get schemas for, or '*' for all databases.
71
+ view_server : str
72
+ The view server to connect to.
73
+ view_url : str
74
+ URL of the view server.
75
+ user : str
76
+ Username for authentication.
77
+ user_pass : str
78
+ Password for authentication.
79
+ jupyter : bool
80
+ Whether to force the terminal output to behave as if in a Jupyter notebook.
81
+ width : int
82
+ Width of the console output.
83
+ """
84
+ c_client = EgeriaTech(view_server, view_url, user_id=user, user_pwd=user_pass)
67
85
  token = c_client.create_egeria_bearer_token()
68
86
 
69
87
  def generate_table() -> Table:
70
88
  """Make a new table."""
71
89
  table = Table(
72
- caption=f"Databases found: {url} - {server} @ {time.asctime()}",
90
+ caption=f"Databases found: {view_url} - {view_server} @ {time.asctime()}",
73
91
  style="bold bright_white on black",
74
92
  row_styles=["bold bright_white on black"],
75
93
  header_style="white on dark_blue",
@@ -47,20 +47,36 @@ def check_if_template(header: dict) -> bool:
47
47
 
48
48
 
49
49
  def list_deployed_databases(
50
- server: str,
51
- url: str,
52
- username: str,
53
- password: str,
50
+ view_server: str = EGERIA_VIEW_SERVER,
51
+ view_url: str = EGERIA_VIEW_SERVER_URL,
52
+ user: str = EGERIA_USER,
53
+ user_pass: str = EGERIA_USER_PASSWORD,
54
54
  jupyter: bool = EGERIA_JUPYTER,
55
55
  width: int = EGERIA_WIDTH,
56
56
  ):
57
- c_client = EgeriaTech(server, url, user_id=username, user_pwd=password)
57
+ """
58
+ Parameters
59
+ ----------
60
+ view_server : str
61
+ The view server name to which the Egeria client will connect. By default, this is set to EGERIA_VIEW_SERVER.
62
+ view_url : str
63
+ The URL of the Egeria view server. By default, this is set to EGERIA_VIEW_SERVER_URL.
64
+ user : str
65
+ The username used for authentication with the Egeria server. By default, it is set to EGERIA_USER.
66
+ user_pass : str
67
+ The password used for authentication with the Egeria server. By default, it is set to EGERIA_USER_PASSWORD.
68
+ jupyter : bool
69
+ A flag indicating whether the output is displayed within a Jupyter notebook. Default is set to EGERIA_JUPYTER.
70
+ width : int
71
+ The width of the output console. By default, it is set to EGERIA_WIDTH.
72
+ """
73
+ c_client = EgeriaTech(view_server, view_url, user_id=user, user_pwd=user_pass)
58
74
  token = c_client.create_egeria_bearer_token()
59
75
 
60
76
  def generate_table() -> Table:
61
77
  """Make a new table."""
62
78
  table = Table(
63
- caption=f"Databases found: {url} - {server} @ {time.asctime()}",
79
+ caption=f"Databases found: {view_url} - {view_server} @ {time.asctime()}",
64
80
  style="bold bright_white on black",
65
81
  row_styles=["bold bright_white on black"],
66
82
  header_style="white on dark_blue",
@@ -0,0 +1,148 @@
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
17
+ from rich.console import Console
18
+ from rich.prompt import Prompt
19
+ from rich.table import Table
20
+ from rich.text import Text
21
+
22
+ from pyegeria import (
23
+ InvalidParameterException,
24
+ PropertyServerException,
25
+ UserNotAuthorizedException,
26
+ EgeriaTech,
27
+ print_exception_response,
28
+ )
29
+
30
+ disable_ssl_warnings = True
31
+
32
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
33
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
34
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
35
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
36
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
37
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
38
+ )
39
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
40
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
41
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
42
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
43
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
44
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
45
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
46
+
47
+
48
+ def display_glossaries(
49
+ search_string: str = "*",
50
+ view_server: str = EGERIA_VIEW_SERVER,
51
+ view_url: str = EGERIA_VIEW_SERVER_URL,
52
+ user: str = EGERIA_USER,
53
+ user_pass: str = EGERIA_USER_PASSWORD,
54
+ jupyter: bool = EGERIA_JUPYTER,
55
+ width: int = EGERIA_WIDTH,
56
+ ):
57
+ """Display either a specified glossary or all glossaries if the search_string is '*'.
58
+ Parameters
59
+ ----------
60
+ search_string : str, default is '*'
61
+ The string used to search for glossaries.
62
+ view_server : str
63
+ The view server name or address where the Egeria services are hosted.
64
+ view_url : str
65
+ The URL of the platform the view server is on.
66
+ user : str
67
+ The user ID for authentication with the Egeria server.
68
+ user_pass : str
69
+ The password for authentication with the Egeria server.
70
+ jupyter : bool, optional
71
+ A boolean indicating whether the output is intended for a Jupyter notebook (default is EGERIA_JUPYTER).
72
+ width : int, optional
73
+ The width of the console output (default is EGERIA_WIDTH).
74
+ """
75
+ m_client = EgeriaTech(view_server, view_url, user_id=user, user_pwd=user_pass)
76
+ token = m_client.create_egeria_bearer_token()
77
+ try:
78
+ table = Table(
79
+ title=f"Glossary List @ {time.asctime()}",
80
+ style="bright_white on black",
81
+ header_style="bright_white on dark_blue",
82
+ title_style="bold white on black",
83
+ caption_style="white on black",
84
+ show_lines=True,
85
+ box=box.ROUNDED,
86
+ caption=f"View Server '{view_server}' @ Platform - {view_url}",
87
+ expand=True,
88
+ )
89
+ table.add_column("Glossary Name")
90
+ table.add_column("Qualified Name / GUID", width=38, no_wrap=True)
91
+ table.add_column("Language")
92
+ table.add_column("Description")
93
+ table.add_column("Usage")
94
+
95
+ glossaries = m_client.find_glossaries(search_string)
96
+ if type(glossaries) is list:
97
+ sorted_glossary_list = sorted(
98
+ glossaries, key=lambda k: k["glossaryProperties"]["displayName"]
99
+ )
100
+ for glossary in sorted_glossary_list:
101
+ display_name = glossary["glossaryProperties"]["displayName"]
102
+ qualified_name = glossary["glossaryProperties"]["qualifiedName"]
103
+ guid = glossary["elementHeader"]["guid"]
104
+ q_name = f"{qualified_name}\n\n{guid}"
105
+ language = glossary["glossaryProperties"]["language"]
106
+ description = glossary["glossaryProperties"]["description"]
107
+ usage = glossary["glossaryProperties"]["usage"]
108
+ table.add_row(display_name, q_name, language, description, usage)
109
+ console = Console(
110
+ style="bold bright_white on black",
111
+ width=width,
112
+ force_terminal=not jupyter,
113
+ )
114
+ console.print(table)
115
+
116
+ except (InvalidParameterException, PropertyServerException) as e:
117
+ print_exception_response(e)
118
+ finally:
119
+ m_client.close_session()
120
+
121
+
122
+ def main():
123
+ parser = argparse.ArgumentParser()
124
+ parser.add_argument("--server", help="Name of the server to display status for")
125
+ parser.add_argument("--url", help="URL Platform to connect to")
126
+ parser.add_argument("--userid", help="User Id")
127
+ parser.add_argument("--password", help="User Password")
128
+
129
+ args = parser.parse_args()
130
+
131
+ server = args.server if args.server is not None else EGERIA_VIEW_SERVER
132
+ url = args.url if args.url is not None else EGERIA_PLATFORM_URL
133
+ userid = args.userid if args.userid is not None else EGERIA_USER
134
+ user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
135
+
136
+ try:
137
+ search_string = Prompt.ask(
138
+ "Enter the glossary you are searching for or '*' for all:", default="*"
139
+ )
140
+
141
+ display_glossaries(search_string, server, url, userid, user_pass)
142
+
143
+ except KeyboardInterrupt:
144
+ pass
145
+
146
+
147
+ if __name__ == "__main__":
148
+ main()
@@ -46,18 +46,45 @@ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
46
46
 
47
47
 
48
48
  def display_glossary_terms(
49
- search_string: str,
50
- glossary_guid: str,
51
- glossary_name: str,
52
- server: str,
53
- url: str,
54
- username: str,
55
- user_password: str,
49
+ search_string: str = "*",
50
+ glossary_guid: str = None,
51
+ glossary_name: str = None,
52
+ view_server: str = EGERIA_VIEW_SERVER,
53
+ view_url: str = EGERIA_VIEW_SERVER_URL,
54
+ user_id: str = EGERIA_USER,
55
+ user_pass: str = EGERIA_USER_PASSWORD,
56
56
  jupyter: bool = EGERIA_JUPYTER,
57
57
  width: int = EGERIA_WIDTH,
58
58
  ):
59
- """Display glossary terms in a table"""
60
- g_client = EgeriaTech(server, url, username, user_password)
59
+ """Display a table of glossary terms filtered by search_string and glossary, if specified. If no
60
+ filters then all terms are displayed. If glossary_guid or name is specified, then only terms from that
61
+ glossary are displayed.
62
+ Parameters
63
+ ----------
64
+ search_string : str, optional
65
+ The string to search for terms. Defaults to "*".
66
+ glossary_guid : str, optional
67
+ The unique identifier of the glossary. Defaults to None. If specified, then only terms from that glossary
68
+ are displayed. If both glossary_guid and glossary_name are provided then glossary_guid will take precedence.
69
+ glossary_name : str, optional
70
+ The display name of the glossary. Defaults to None. If specified, then only terms from that glossary
71
+ are displayed. If both glossary_guid and glossary_name are provided then glossary_guid will take precedence.
72
+ Note that the use of glossary display name relies on the qualified name conforming to convention. GUID is more
73
+ reliable.
74
+ view_server : str
75
+ The server where the glossary is hosted. Defaults to EGERIA_VIEW_SERVER.
76
+ view_url : str
77
+ The URL of the server where the glossary is hosted. Defaults to EGERIA_VIEW_SERVER_URL.
78
+ user_id : str
79
+ The user ID for authentication. Defaults to EGERIA_USER.
80
+ user_pass : str
81
+ The user password for authentication. Defaults to EGERIA_USER_PASSWORD.
82
+ jupyter : bool
83
+ Flag to indicate if the output should be formatted for Jupyter notebook. Defaults to EGERIA_JUPYTER.
84
+ width : int
85
+ The width of the console output. Defaults to EGERIA_WIDTH.
86
+ """
87
+ g_client = EgeriaTech(view_server, view_url, user_id, user_pass)
61
88
  token = g_client.create_egeria_bearer_token()
62
89
  if (glossary_name is not None) and (glossary_name != "*"):
63
90
  glossary_guid = g_client.__get_guid__(
@@ -78,7 +105,7 @@ def display_glossary_terms(
78
105
  caption_style="white on black",
79
106
  show_lines=True,
80
107
  box=box.ROUNDED,
81
- caption=f"View Server '{server}' @ Platform - {url}",
108
+ caption=f"View Server '{view_server}' @ Platform - {view_url}",
82
109
  expand=True,
83
110
  )
84
111
  table.add_column("Term Name")
@@ -40,11 +40,12 @@ from pyegeria.commands.cat.list_deployed_databases import list_deployed_database
40
40
  from pyegeria.commands.cat.glossary_actions import (
41
41
  create_glossary,
42
42
  delete_glossary,
43
- list_glossaries,
44
43
  create_term,
45
44
  load_terms,
46
45
  export_terms,
47
46
  )
47
+ from pyegeria.commands.cat.list_glossaries import display_glossaries
48
+
48
49
  from pyegeria.commands.my.todo_actions import (
49
50
  mark_todo_complete,
50
51
  reassign_todo,
@@ -978,7 +979,22 @@ def list_databases(ctx):
978
979
  )
979
980
 
980
981
 
981
- show.add_command(list_glossaries)
982
+ @show.command("list-glossaries")
983
+ @click.option("--search_string", default="*", help="Name to search for glossaries")
984
+ @click.pass_context
985
+ def list_glossaries(ctx, search_string):
986
+ """Display a tree graph of information about an asset"""
987
+ c = ctx.obj
988
+ display_glossaries(
989
+ search_string,
990
+ c.view_server,
991
+ c.view_server_url,
992
+ c.userid,
993
+ c.password,
994
+ c.jupyter,
995
+ c.width,
996
+ )
997
+
982
998
 
983
999
  #
984
1000
  # Catalog User: Tell
@@ -23,9 +23,9 @@ from pyegeria.commands.cat.glossary_actions import (
23
23
  delete_glossary,
24
24
  create_term,
25
25
  load_terms,
26
- list_glossaries,
27
26
  export_terms,
28
27
  )
28
+ from pyegeria.commands.cat.list_glossaries import display_glossaries
29
29
  from pyegeria.commands.cat.list_archives import display_archive_list
30
30
  from pyegeria.commands.cat.list_assets import display_assets
31
31
  from pyegeria.commands.cat.list_cert_types import display_certifications
@@ -550,6 +550,23 @@ def list_catalogs(ctx, search_server):
550
550
  )
551
551
 
552
552
 
553
+ @show.command("list-glossaries")
554
+ @click.option("--search_string", default="*", help="Name to search for glossaries")
555
+ @click.pass_context
556
+ def list_glossaries(ctx, search_string):
557
+ """Display a tree graph of information about an asset"""
558
+ c = ctx.obj
559
+ display_glossaries(
560
+ search_string,
561
+ c.view_server,
562
+ c.view_server_url,
563
+ c.userid,
564
+ c.password,
565
+ c.jupyter,
566
+ c.width,
567
+ )
568
+
569
+
553
570
  @show.command("list-databases")
554
571
  @click.pass_context
555
572
  def list_databases(ctx):
@@ -560,8 +577,6 @@ def list_databases(ctx):
560
577
  )
561
578
 
562
579
 
563
- show.add_command(list_glossaries)
564
-
565
580
  #
566
581
  # Tell
567
582
  #
@@ -4,12 +4,12 @@ Copyright Contributors to the ODPi Egeria project.
4
4
 
5
5
 
6
6
  """
7
-
8
- from monitor_integ_daemon_status import display_integration_daemon_status
9
- from monitor_gov_eng_status import display_gov_eng_status
10
- from monitor_platform_status import display_status as display_platform_status
11
- from monitor_server_status import display_status as display_server_status
12
- from monitor_engine_activity_c import display_engine_activity_c
7
+ #
8
+ # from .monitor_integ_daemon_status import display_integration_daemon_status
9
+ # from .monitor_gov_eng_status import display_gov_eng_status
10
+ # from .monitor_platform_status import display_status as display_platform_status
11
+ # from .monitor_server_status import display_status as display_server_status
12
+ # from .monitor_engine_activity_c import display_engine_activity_c
13
13
 
14
14
  # import monitor_server_status
15
15
  # import monitor_server_list
@@ -54,20 +54,39 @@ disable_ssl_warnings = True
54
54
 
55
55
 
56
56
  def display_engine_activity_c(
57
- server: str,
58
- url: str,
59
- user: str,
60
- user_pass: str,
61
- paging: bool,
57
+ view_server: str = EGERIA_VIEW_SERVER,
58
+ view_url: str = EGERIA_VIEW_SERVER_URL,
59
+ user: str = EGERIA_USER,
60
+ user_pass: str = EGERIA_USER_PASSWORD,
61
+ paging: bool = True,
62
62
  jupyter: bool = EGERIA_JUPYTER,
63
- width=EGERIA_WIDTH,
63
+ width: int = EGERIA_WIDTH,
64
64
  ):
65
- g_client = AutomatedCuration(server, url, user, user_pwd=user_pass)
65
+ """Display governance engine activity as a table.
66
+
67
+ Parameters
68
+ ----------
69
+ view_server : str
70
+ The Egeria view server name.
71
+ view_url : str
72
+ The URL for the Egeria view server.
73
+ user : str
74
+ The user name for authenticating with the Egeria server.
75
+ user_pass : str
76
+ The user password for authenticating with the Egeria server.
77
+ paging : bool, default is True
78
+ Whether to enable paging mode when displaying the table.
79
+ jupyter : bool
80
+ Indicates if the environment is a Jupyter notebook.
81
+ width : int
82
+ The width of the console for table printing.
83
+ """
84
+ g_client = AutomatedCuration(view_server, view_url, user, user_pwd=user_pass)
66
85
 
67
86
  def generate_table() -> Table:
68
87
  """Make a new table."""
69
88
  table = Table(
70
- title=f"Engine Action Status for Platform {url} @ {time.asctime()}",
89
+ title=f"Engine Action Status for Platform {view_url} @ {time.asctime()}",
71
90
  style="bold white on black",
72
91
  row_styles=["bold white on black"],
73
92
  header_style="white on dark_blue",
@@ -75,7 +94,7 @@ def display_engine_activity_c(
75
94
  caption_style="white on black",
76
95
  show_lines=True,
77
96
  box=box.ROUNDED,
78
- caption=f"Engine Status for Server '{server}' @ Platform - {url}",
97
+ caption=f"Engine Status for Server '{view_server}' @ Platform - {view_url}",
79
98
  expand=True,
80
99
  )
81
100
  table.add_column("Requested Time")