pyegeria 1.5.1.0.3__tar.gz → 1.5.1.0.6__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 (107) hide show
  1. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/PKG-INFO +1 -1
  2. pyegeria-1.5.1.0.6/commands/cat/glossary_actions.py +212 -0
  3. pyegeria-1.5.1.0.6/commands/cat/list_deployed_catalogs.py +187 -0
  4. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/list_deployed_database_schemas.py +37 -13
  5. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cli/egeria.py +73 -0
  6. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cli/egeria_cat.py +54 -0
  7. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cli/egeria_tech.py +18 -1
  8. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/my/todo_actions.py +5 -5
  9. pyegeria-1.5.1.0.6/commands/tech/list_gov_action_processes.py +139 -0
  10. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/automated_curation_omvs.py +2 -2
  11. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/classification_manager_omvs.py +2 -4
  12. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/glossary_manager_omvs.py +11 -0
  13. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyproject.toml +8 -2
  14. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/LICENSE +0 -0
  15. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/README.md +0 -0
  16. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/README.md +0 -0
  17. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/__init__.py +0 -0
  18. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/get_asset_graph.py +0 -0
  19. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/get_collection.py +0 -0
  20. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/get_project_dependencies.py +0 -0
  21. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/get_project_structure.py +0 -0
  22. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/get_tech_type_elements.py +0 -0
  23. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/get_tech_type_template.py +0 -0
  24. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/list_archives.py +0 -0
  25. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/list_assets.py +0 -0
  26. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/list_cert_types.py +0 -0
  27. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/list_deployed_databases.py +0 -0
  28. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/list_glossary.py +0 -0
  29. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/list_projects.py +0 -0
  30. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/list_relationships.py +0 -0
  31. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/list_tech_types.py +0 -0
  32. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/list_todos.py +0 -0
  33. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cat/list_user_ids.py +0 -0
  34. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cli/__init__.py +0 -0
  35. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cli/egeria_my.py +0 -0
  36. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cli/egeria_ops.py +0 -0
  37. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/cli/ops_config.py +0 -0
  38. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/my/README.md +0 -0
  39. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/my/__init__.py +0 -0
  40. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/my/list_my_profile.py +0 -0
  41. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/my/list_my_roles.py +0 -0
  42. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/my/monitor_my_todos.py +0 -0
  43. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/my/monitor_open_todos.py +0 -0
  44. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/README.md +0 -0
  45. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/__init__.py +0 -0
  46. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/engine_actions.py +0 -0
  47. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/gov_server_actions.py +0 -0
  48. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/list_catalog_targets.py +0 -0
  49. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/load_archive.py +0 -0
  50. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/monitor_asset_events.py +0 -0
  51. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/monitor_engine_activity.py +0 -0
  52. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/monitor_engine_activity_c.py +0 -0
  53. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/monitor_gov_eng_status.py +0 -0
  54. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/monitor_integ_daemon_status.py +0 -0
  55. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/monitor_platform_status.py +0 -0
  56. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/monitor_server_startup.py +0 -0
  57. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/monitor_server_status.py +0 -0
  58. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/orig_monitor_server_list.py +0 -0
  59. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/orig_monitor_server_status.py +0 -0
  60. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/refresh_integration_daemon.py +0 -0
  61. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/ops/restart_integration_daemon.py +0 -0
  62. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/README.md +0 -0
  63. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/__init__.py +0 -0
  64. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/get_element_graph.py +0 -0
  65. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/get_element_info.py +0 -0
  66. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/get_guid_info.py +0 -0
  67. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/get_tech_details.py +0 -0
  68. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/list_asset_types.py +0 -0
  69. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/list_elements.py +0 -0
  70. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/list_elements_for_classification.py +0 -0
  71. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/list_elements_x.py +0 -0
  72. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/list_registered_services.py +0 -0
  73. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/list_related_elements.py +0 -0
  74. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/list_related_specification.py +0 -0
  75. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/list_relationship_types.py +0 -0
  76. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/list_tech_templates.py +0 -0
  77. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/list_valid_metadata_values.py +0 -0
  78. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/commands/tech/x_list_related_elements.py +0 -0
  79. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/README.md +0 -0
  80. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/__init__.py +0 -0
  81. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/_client.py +0 -0
  82. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/_deprecated_gov_engine.py +0 -0
  83. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/_exceptions.py +0 -0
  84. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/_globals.py +0 -0
  85. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/_validators.py +0 -0
  86. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/asset_catalog_omvs.py +0 -0
  87. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/collection_manager_omvs.py +0 -0
  88. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/core_omag_server_config.py +0 -0
  89. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/create_tech_guid_lists.py +0 -0
  90. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/egeria_cat_client.py +0 -0
  91. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/egeria_client.py +0 -0
  92. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/egeria_config_client.py +0 -0
  93. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/egeria_my_client.py +0 -0
  94. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/egeria_tech_client.py +0 -0
  95. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/feedback_manager_omvs.py +0 -0
  96. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/full_omag_server_config.py +0 -0
  97. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/glossary_browser_omvs.py +0 -0
  98. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/mermaid_utilities.py +0 -0
  99. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/my_profile_omvs.py +0 -0
  100. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/platform_services.py +0 -0
  101. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/project_manager_omvs.py +0 -0
  102. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/registered_info.py +0 -0
  103. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/runtime_manager_omvs.py +0 -0
  104. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/server_operations.py +0 -0
  105. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/utils.py +0 -0
  106. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/pyegeria/valid_metadata_omvs.py +0 -0
  107. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.6}/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.0.3
3
+ Version: 1.5.1.0.6
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,212 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+
6
+
7
+ Execute Glossary actions.
8
+
9
+ """
10
+ import os
11
+ import sys
12
+ import time
13
+ from datetime import datetime
14
+
15
+ import click
16
+
17
+ # from ops_config import Config, pass_config
18
+ from pyegeria import EgeriaTech, body_slimmer
19
+ from pyegeria._exceptions import (
20
+ InvalidParameterException,
21
+ PropertyServerException,
22
+ print_exception_response,
23
+ )
24
+
25
+
26
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
27
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
28
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
29
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
30
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
31
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
32
+ )
33
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
34
+ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
35
+ "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
36
+ )
37
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
38
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
39
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
40
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
41
+
42
+
43
+ @click.command("create-glossary")
44
+ @click.option("--name", help="Name of Glossary", required=True)
45
+ @click.option("--language", help="Language of Glossary", default="English")
46
+ @click.option(
47
+ "--description",
48
+ help="Description of Glossary",
49
+ default="A description goes here",
50
+ )
51
+ @click.option(
52
+ "--usage",
53
+ help="Purpose of glossary",
54
+ default="Definitions",
55
+ )
56
+ @click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use.")
57
+ @click.option(
58
+ "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
59
+ )
60
+ @click.option("--userid", default=EGERIA_USER, help="Egeria user")
61
+ @click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
62
+ @click.option("--timeout", default=60, help="Number of seconds to wait")
63
+ def create_glossary(
64
+ server: str,
65
+ url: str,
66
+ userid: str,
67
+ password: str,
68
+ timeout: int,
69
+ name: str,
70
+ language: str,
71
+ description: str,
72
+ usage: str,
73
+ ) -> None:
74
+ """Create a new Glossary"""
75
+
76
+ try:
77
+ m_client = EgeriaTech(server, url, userid, password)
78
+ token = m_client.create_egeria_bearer_token()
79
+
80
+ existing_glossary = m_client.find_glossaries(name)
81
+ if type(existing_glossary) is list:
82
+ click.echo(f"\nFound {len(existing_glossary)} existing Glossaries\n")
83
+ for glossary in existing_glossary:
84
+ click.echo(
85
+ f"\tFound glossary: {glossary['glossaryProperties']['qualifiedName']} with id of {glossary['elementHeader']['guid']}\n"
86
+ )
87
+ sys.exit(0)
88
+
89
+ glossary_guid = m_client.create_glossary(name, language, description, usage)
90
+ print(f"New glossary {name} created with id of {glossary_guid}")
91
+
92
+ except (InvalidParameterException, PropertyServerException) as e:
93
+ print_exception_response(e)
94
+ finally:
95
+ m_client.close_session()
96
+
97
+
98
+ @click.command("delete-glossary")
99
+ @click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
100
+ @click.option(
101
+ "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
102
+ )
103
+ @click.option("--userid", default=EGERIA_USER, help="Egeria user")
104
+ @click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
105
+ @click.option("--timeout", default=60, help="Number of seconds to wait")
106
+ @click.argument("glossary-guid")
107
+ def delete_glossary(server, url, userid, password, timeout, glossary_guid):
108
+ """Delete the glossary specified"""
109
+ m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
110
+ token = m_client.create_egeria_bearer_token()
111
+ try:
112
+ m_client.delete_to_do(glossary_guid)
113
+
114
+ click.echo(f"Deleted Todo item {glossary_guid}")
115
+
116
+ except (InvalidParameterException, PropertyServerException) as e:
117
+ print_exception_response(e)
118
+ finally:
119
+ m_client.close_session()
120
+
121
+
122
+ @click.command("create-term")
123
+ @click.option("--glossary-name", help="Name of Glossary", required=True)
124
+ @click.option("--term-name", help="Name of Term", required=True)
125
+ @click.option(
126
+ "--summary",
127
+ help="Summary definition",
128
+ default="Summary goes here",
129
+ )
130
+ @click.option(
131
+ "--description",
132
+ help="Full description",
133
+ default="Description goes here",
134
+ )
135
+ @click.option("--abbrev", help="Abbreviation", default=None)
136
+ @click.option("--examples", help="Example usage", default=None)
137
+ @click.option("--usage", help="Usage notes", default=None)
138
+ @click.option("--version", help="Version", default="1.0")
139
+ @click.option(
140
+ "--status",
141
+ help="Status",
142
+ type=click.Choice(
143
+ ["DRAFT", "ACTIVE", "DEPRACATED", "OBSOLETE", "OTHER"], case_sensitive=False
144
+ ),
145
+ default="DRAFT",
146
+ )
147
+ @click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use.")
148
+ @click.option(
149
+ "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
150
+ )
151
+ @click.option("--userid", default=EGERIA_USER, help="Egeria user")
152
+ @click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
153
+ @click.option("--timeout", default=60, help="Number of seconds to wait")
154
+ def create_term(
155
+ server,
156
+ url,
157
+ userid,
158
+ password,
159
+ timeout,
160
+ glossary_name,
161
+ term_name,
162
+ summary,
163
+ description,
164
+ abbrev,
165
+ examples,
166
+ usage,
167
+ version,
168
+ status,
169
+ ):
170
+ """Create a new term"""
171
+ m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
172
+ token = m_client.create_egeria_bearer_token()
173
+ try:
174
+ body = {
175
+ "class": "ReferenceableRequestBody",
176
+ "elementProperties": {
177
+ "class": "GlossaryTermProperties",
178
+ "qualifiedName": f"GlossaryTerm: {term_name} : {datetime.now().isoformat()}",
179
+ "displayName": term_name,
180
+ "summary": summary,
181
+ "description": description,
182
+ "abbreviation": abbrev,
183
+ "examples": examples,
184
+ "usage": usage,
185
+ "publishVersionIdentifier": version,
186
+ },
187
+ "initialStatus": status,
188
+ }
189
+ exists = False
190
+ glossary_info = m_client.find_glossaries(glossary_name)
191
+ if type(glossary_info) is list:
192
+ for glossary in glossary_info:
193
+ if glossary["glossaryProperties"]["displayName"] == glossary_name:
194
+ exists = True
195
+ glossary_guid = glossary["elementHeader"]["guid"]
196
+
197
+ if not exists:
198
+ click.echo(f"The glossary name {glossary_name} was not found..exiting\n")
199
+ sys.exit(0)
200
+
201
+ term_guid = m_client.create_controlled_glossary_term(
202
+ glossary_guid, body_slimmer(body)
203
+ )
204
+
205
+ click.echo(
206
+ f"Successfully created term {term_name} with GUID {term_guid}, in glossary {glossary_name}.\n"
207
+ )
208
+
209
+ except (InvalidParameterException, PropertyServerException) as e:
210
+ print_exception_response(e)
211
+ finally:
212
+ m_client.close_session()
@@ -0,0 +1,187 @@
1
+ """This creates a templates guid file from the core metadata archive"""
2
+ from rich.markdown import Markdown
3
+ from rich.prompt import Prompt
4
+ import os
5
+ import argparse
6
+ import time
7
+ import sys
8
+ from rich import box
9
+ from rich.console import Console
10
+ from rich.table import Table
11
+
12
+ from pyegeria import (
13
+ InvalidParameterException,
14
+ PropertyServerException,
15
+ UserNotAuthorizedException,
16
+ print_exception_response,
17
+ EgeriaTech,
18
+ )
19
+
20
+
21
+ console = Console()
22
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
23
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
24
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
25
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
26
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
27
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
28
+ )
29
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
30
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
31
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
32
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
33
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
34
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
35
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
36
+
37
+
38
+ def check_if_template(header: dict) -> bool:
39
+ """Check if the the template classification is set"""
40
+ classifications = header.get("classifications", None)
41
+ if classifications is None:
42
+ return False
43
+ for c in classifications:
44
+ if c["type"]["typeName"] == "Template":
45
+ return True
46
+ return False
47
+
48
+
49
+ def list_deployed_catalogs(
50
+ uc_server_name: str,
51
+ server: str,
52
+ url: str,
53
+ username: str,
54
+ password: str,
55
+ jupyter: bool = EGERIA_JUPYTER,
56
+ width: int = EGERIA_WIDTH,
57
+ ):
58
+ c_client = EgeriaTech(server, url, user_id=username, user_pwd=password)
59
+ token = c_client.create_egeria_bearer_token()
60
+
61
+ def generate_table() -> Table:
62
+ """Make a new table."""
63
+ table = Table(
64
+ caption=f"Databases found: {url} - {server} @ {time.asctime()}",
65
+ style="bold bright_white on black",
66
+ row_styles=["bold bright_white on black"],
67
+ header_style="white on dark_blue",
68
+ title_style="bold bright_white on black",
69
+ caption_style="white on black",
70
+ show_lines=True,
71
+ box=box.ROUNDED,
72
+ # title=f"Elements for Open Metadata Type: '{om_type}' ",
73
+ expand=True,
74
+ # width=500
75
+ )
76
+
77
+ table.add_column("Catalog Name/GUID", width=38, no_wrap=True)
78
+ table.add_column("Catalog Server")
79
+ table.add_column("Properties")
80
+ table.add_column("Catalog Schemas")
81
+
82
+ om_type = "DeployedDatabaseSchema"
83
+
84
+ cats = c_client.get_elements_by_classification("Anchors", "Catalog")
85
+ if type(cats) is list:
86
+ for cat in cats:
87
+ header = cat["elementHeader"]
88
+
89
+ if check_if_template(header):
90
+ continue
91
+ el_guid = header["guid"]
92
+ el_name = cat["properties"].get("name", "---")
93
+ el_id = f"{el_name}\n{el_guid}"
94
+ el_home = header["origin"]["homeMetadataCollectionName"]
95
+
96
+ el_anchors_md = ""
97
+ class_info = header["classifications"]
98
+ for class_i in class_info:
99
+ class_prop = class_i.get("classificationProperties", None)
100
+ if class_prop:
101
+ for anchor in class_prop.keys():
102
+ if anchor == "anchorGUID":
103
+ server_guid = class_prop[anchor]
104
+ el_anchors_md += f"* **{anchor}**: {class_prop[anchor]}\n"
105
+ el_anchors_out = Markdown(el_anchors_md)
106
+
107
+ el_props_md = ""
108
+ for prop in cat["properties"].keys():
109
+ el_props_md += f"* **{prop}**: {cat['properties'][prop]}\n"
110
+ el_props_out = Markdown(el_props_md)
111
+
112
+ schemas = c_client.get_elements_by_classification_with_property_value(
113
+ "Anchors", el_guid, ["anchorGUID"], "DeployedDatabaseSchema"
114
+ )
115
+ schemas_md = ""
116
+ if type(schemas) is list:
117
+ for schema in schemas:
118
+ schema_md = ""
119
+ schema_props = schema["properties"]
120
+ for key in schema_props.keys():
121
+ schema_md += f"* **{key}**: {schema_props[key]}\n"
122
+ schemas_md += schema_md
123
+ schemas_md_out = Markdown(schemas_md)
124
+
125
+ element_info = c_client.get_element_by_guid(server_guid)
126
+ element_info_md = ""
127
+ for key in element_info["properties"].keys():
128
+ element_info_md += (
129
+ f"* **{key}**: {element_info['properties'][key]}\n"
130
+ )
131
+ element_info_out = Markdown(element_info_md)
132
+
133
+ table.add_row(
134
+ el_id,
135
+ element_info_out,
136
+ el_props_out,
137
+ schemas_md_out,
138
+ )
139
+
140
+ return table
141
+ else:
142
+ print("No instances found")
143
+ sys.exit(1)
144
+
145
+ try:
146
+ console = Console(width=width, force_terminal=not jupyter)
147
+
148
+ with console.pager(styles=True):
149
+ console.print(generate_table())
150
+
151
+ except (
152
+ InvalidParameterException,
153
+ PropertyServerException,
154
+ UserNotAuthorizedException,
155
+ ) as e:
156
+ print_exception_response(e)
157
+ print("\n\nPerhaps the type name isn't known")
158
+ finally:
159
+ c_client.close_session()
160
+
161
+
162
+ def main():
163
+ parser = argparse.ArgumentParser()
164
+ parser.add_argument("--server", help="Name of the server to display status for")
165
+ parser.add_argument("--url", help="URL Platform to connect to")
166
+ parser.add_argument("--userid", help="User Id")
167
+ parser.add_argument("--password", help="Password")
168
+
169
+ args = parser.parse_args()
170
+
171
+ server = args.server if args.server is not None else EGERIA_VIEW_SERVER
172
+ url = args.url if args.url is not None else EGERIA_PLATFORM_URL
173
+ userid = args.userid if args.userid is not None else EGERIA_USER
174
+ password = args.password if args.password is not None else EGERIA_USER_PASSWORD
175
+
176
+ try:
177
+ # uc_server_name = Prompt.ask(
178
+ # "Enter the name of a server to retrieve schemas for", default="*"
179
+ # )
180
+ uc_server_name = None
181
+ list_deployed_catalogs(uc_server_name, server, url, userid, password)
182
+ except KeyboardInterrupt:
183
+ pass
184
+
185
+
186
+ if __name__ == "__main__":
187
+ main()
@@ -74,19 +74,25 @@ def list_deployed_database_schemas(
74
74
  # width=500
75
75
  )
76
76
 
77
- table.add_column("Name")
78
- table.add_column("Type")
79
- table.add_column("Created", width=23)
80
- table.add_column("Home Store")
81
- table.add_column("GUID", width=38, no_wrap=True)
82
- table.add_column("Properties")
83
- table.add_column("Tables")
77
+ table.add_column("Schema in Catalog")
78
+ table.add_column("Schema Properties")
79
+
80
+ # table.add_column("Home Store")
81
+ # table.add_column("GUID", width=38, no_wrap=True)
82
+ # table.add_column("Properties")
83
+ table.add_column("Cataloged Resource")
84
84
 
85
85
  om_type = "DeployedDatabaseSchema"
86
+
87
+ # get the guid for the database or catalog
88
+
86
89
  if db_name in (None, "*"):
87
90
  dbs = c_client.get_elements(om_type)
88
91
  else:
89
- dbs = c_client.get_elements_by_property_value(db_name, "name", om_type)
92
+ db_guid = c_client.get_guid_for_name(db_name)
93
+ dbs = c_client.get_elements_by_classification_with_property_value(
94
+ "Anchors", db_guid, ["anchorGUID"], om_type
95
+ )
90
96
 
91
97
  if type(dbs) is list:
92
98
  for element in dbs:
@@ -108,6 +114,24 @@ def list_deployed_database_schemas(
108
114
 
109
115
  el_guid = header["guid"]
110
116
 
117
+ el_classification = header["classifications"]
118
+ for c in el_classification:
119
+ if c["type"]["typeName"] == "Anchors":
120
+ el_anchor_guid = c["classificationProperties"]["anchorGUID"]
121
+ el_anchor_type_name = c["classificationProperties"][
122
+ "anchorTypeName"
123
+ ]
124
+ if el_anchor_type_name == "Catalog":
125
+ el_cat = c_client.get_element_by_guid(el_anchor_guid)
126
+ el_cat_name = el_cat["properties"].get("name", None)
127
+ if el_cat_name is None:
128
+ el_cat_name = el_cat["properties"].get(
129
+ "qualifiedName", "---"
130
+ )
131
+ el_cat_guid = el_cat["elementHeader"]["guid"]
132
+ el_schema_id = (
133
+ f"{el_name}\n{el_guid}\n\n\t\tin\n\n{el_cat_name}\n{el_cat_guid}"
134
+ )
111
135
  el_props_md = ""
112
136
  for prop in element["properties"].keys():
113
137
  el_props_md += f"* **{prop}**: {element['properties'][prop]}\n"
@@ -139,11 +163,11 @@ def list_deployed_database_schemas(
139
163
  rel_el_out = Markdown(rel_el_md)
140
164
 
141
165
  table.add_row(
142
- el_name,
143
- el_type,
144
- el_created_out,
145
- el_home,
146
- el_guid,
166
+ el_schema_id,
167
+ # el_type,
168
+ # el_created_out,
169
+ # el_home,
170
+ # el_guid,
147
171
  el_props_out,
148
172
  rel_el_out,
149
173
  )
@@ -32,6 +32,16 @@ from commands.my.list_my_profile import display_my_profile
32
32
  from commands.my.list_my_roles import display_my_roles
33
33
  from commands.my.monitor_my_todos import display_my_todos
34
34
  from commands.my.monitor_open_todos import display_todos
35
+ from commands.cat.list_deployed_database_schemas import list_deployed_database_schemas
36
+ from commands.cat.list_deployed_catalogs import list_deployed_catalogs
37
+ from commands.cat.glossary_actions import create_glossary, delete_glossary, create_term
38
+ from commands.my.todo_actions import (
39
+ mark_todo_complete,
40
+ reassign_todo,
41
+ delete_todo,
42
+ create_todo,
43
+ )
44
+
35
45
 
36
46
  from commands.ops.gov_server_actions import (
37
47
  add_catalog_target,
@@ -71,6 +81,7 @@ from commands.tech.list_related_specification import (
71
81
  from commands.tech.list_relationship_types import display_relationship_types
72
82
  from commands.tech.list_tech_templates import display_templates_spec
73
83
  from commands.tech.list_valid_metadata_values import display_metadata_values
84
+ from commands.tech.list_gov_action_processes import display_gov_processes
74
85
 
75
86
 
76
87
  @tui()
@@ -540,6 +551,23 @@ def tech_template_spec(ctx, search_string):
540
551
  )
541
552
 
542
553
 
554
+ @show.command("gov-action-processes")
555
+ @click.pass_context
556
+ @click.option("--search-string", default="*", help="Search string")
557
+ def gov_action_processes(ctx, search_string):
558
+ """Display available governance action processes."""
559
+ c = ctx.obj
560
+ display_gov_processes(
561
+ search_string,
562
+ c.view_server,
563
+ c.view_server_url,
564
+ c.userid,
565
+ c.password,
566
+ c.jupyter,
567
+ c.width,
568
+ )
569
+
570
+
543
571
  @show.command("valid-metadata-values")
544
572
  @click.pass_context
545
573
  @click.option("--property", default="projectHealth", help="Metadata property to query")
@@ -888,6 +916,42 @@ def list_archives(ctx):
888
916
  )
889
917
 
890
918
 
919
+ @show.command("list-deployed-schemas")
920
+ @click.option("--search-string", default="*", help="What database or catalog to search")
921
+ @click.pass_context
922
+ def list_deployed_schemas(search_string, ctx):
923
+ """Display a tree graph of information about an asset"""
924
+ c = ctx.obj
925
+ list_deployed_database_schemas(
926
+ search_string,
927
+ c.view_server,
928
+ c.view_server_url,
929
+ c.userid,
930
+ c.password,
931
+ None,
932
+ c.jupyter,
933
+ c.width,
934
+ )
935
+
936
+
937
+ @show.command("list-catalogs")
938
+ # @click.option("--search-string", default="*", help="What database or catalog to search")
939
+ @click.pass_context
940
+ def list_catalogs(ctx):
941
+ """Display a tree graph of information about an asset"""
942
+ c = ctx.obj
943
+ list_deployed_catalogs(
944
+ " ",
945
+ c.view_server,
946
+ c.view_server_url,
947
+ c.userid,
948
+ c.password,
949
+ None,
950
+ c.jupyter,
951
+ c.width,
952
+ )
953
+
954
+
891
955
  #
892
956
  # Catalog User: Tell
893
957
  #
@@ -900,6 +964,15 @@ def tell(ctx):
900
964
  pass
901
965
 
902
966
 
967
+ tell.add_command(create_glossary)
968
+ tell.add_command(delete_glossary)
969
+ tell.add_command(create_term)
970
+ tell.add_command(mark_todo_complete)
971
+ tell.add_command(reassign_todo)
972
+ tell.add_command(delete_todo)
973
+ tell.add_command(create_todo)
974
+
975
+
903
976
  @tell.group("survey")
904
977
  @click.pass_context
905
978
  def survey(ctx):
@@ -27,9 +27,18 @@ from commands.cat.list_cert_types import display_certifications
27
27
  from commands.cat.list_relationships import list_relationships
28
28
  from commands.cat.list_user_ids import list_user_ids
29
29
  from commands.cat.list_archives import display_archive_list
30
+ from commands.cat.list_deployed_database_schemas import list_deployed_database_schemas
31
+ from commands.cat.list_deployed_catalogs import list_deployed_catalogs
32
+ from commands.cat.glossary_actions import create_glossary, delete_glossary, create_term
30
33
 
31
34
  # from pyegeria import ServerOps
32
35
  from commands.cli.ops_config import Config
36
+ from commands.my.todo_actions import (
37
+ mark_todo_complete,
38
+ reassign_todo,
39
+ delete_todo,
40
+ create_todo,
41
+ )
33
42
 
34
43
 
35
44
  # class Config(object):
@@ -486,6 +495,42 @@ def list_archives(ctx):
486
495
  )
487
496
 
488
497
 
498
+ @show.command("list-deployed-schemas")
499
+ @click.option("--search-string", default="*", help="What database or catalog to search")
500
+ @click.pass_context
501
+ def list_deployed_schemas(search_string, ctx):
502
+ """Display a tree graph of information about an asset"""
503
+ c = ctx.obj
504
+ list_deployed_database_schemas(
505
+ search_string,
506
+ c.view_server,
507
+ c.view_server_url,
508
+ c.userid,
509
+ c.password,
510
+ None,
511
+ c.jupyter,
512
+ c.width,
513
+ )
514
+
515
+
516
+ @show.command("list-catalogs")
517
+ # @click.option("--search-string", default="*", help="What database or catalog to search")
518
+ @click.pass_context
519
+ def list_catalogs(ctx):
520
+ """Display a tree graph of information about an asset"""
521
+ c = ctx.obj
522
+ list_deployed_catalogs(
523
+ " ",
524
+ c.view_server,
525
+ c.view_server_url,
526
+ c.userid,
527
+ c.password,
528
+ None,
529
+ c.jupyter,
530
+ c.width,
531
+ )
532
+
533
+
489
534
  #
490
535
  # Tell
491
536
  #
@@ -498,6 +543,15 @@ def tell(ctx):
498
543
  pass
499
544
 
500
545
 
546
+ tell.add_command(create_glossary)
547
+ tell.add_command(delete_glossary)
548
+ tell.add_command(create_term)
549
+ tell.add_command(mark_todo_complete)
550
+ tell.add_command(reassign_todo)
551
+ tell.add_command(delete_todo)
552
+ tell.add_command(create_todo)
553
+
554
+
501
555
  @tell.group("survey")
502
556
  @click.pass_context
503
557
  def survey(ctx):