pyegeria 1.5.1.1.60__py3-none-any.whl → 5.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. pyegeria/__init__.py +2 -0
  2. pyegeria/_client.py +7 -2
  3. pyegeria/asset_catalog_omvs.py +34 -0
  4. pyegeria/classification_manager_omvs.py +2 -3
  5. pyegeria/collection_manager_omvs.py +92 -45
  6. pyegeria/commands/README.md +2 -1
  7. pyegeria/commands/cat/__init__.py +1 -5
  8. pyegeria/commands/cat/exp_list_glossaries.py +156 -0
  9. pyegeria/commands/cat/get_collection.py +23 -14
  10. pyegeria/commands/cat/get_tech_type_elements.py +1 -1
  11. pyegeria/commands/cat/glossary_actions.py +28 -8
  12. pyegeria/commands/cat/list_assets.py +8 -17
  13. pyegeria/commands/cat/list_cert_types.py +1 -1
  14. pyegeria/commands/cat/list_collections.py +162 -0
  15. pyegeria/commands/cat/list_deployed_catalogs.py +6 -3
  16. pyegeria/commands/cat/list_deployed_database_schemas.py +8 -13
  17. pyegeria/commands/cat/list_deployed_databases.py +3 -3
  18. pyegeria/commands/cat/list_tech_type_elements.py +190 -0
  19. pyegeria/commands/cat/list_tech_types.py +36 -24
  20. pyegeria/commands/cat/list_terms.py +7 -2
  21. pyegeria/commands/cli/egeria.py +120 -129
  22. pyegeria/commands/cli/egeria_cat.py +63 -52
  23. pyegeria/commands/cli/egeria_login_tui.py +313 -0
  24. pyegeria/commands/cli/egeria_my.py +25 -33
  25. pyegeria/commands/cli/egeria_ops.py +38 -40
  26. pyegeria/commands/cli/egeria_tech.py +55 -41
  27. pyegeria/commands/cli/ops_config.py +3 -1
  28. pyegeria/commands/cli/txt_custom_v2.tcss +19 -0
  29. pyegeria/commands/doc/README.md +145 -0
  30. pyegeria/commands/doc/Visual Command Reference/README.md +511 -0
  31. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/asset-graph 2024-11-20 at 15.56.42.png +0 -0
  32. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/assets-in-domain 2024-11-20 at 15.49.55@2x.png +0 -0
  33. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/elements-of-type 2024-11-20 at 16.01.35.png +0 -0
  34. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/tech-type-elements 2024-11-20 at 16.05.05.png +0 -0
  35. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png +0 -0
  36. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs-2024-11-20 at 16.17.43@2x.png +0 -0
  37. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-11-25 at 20.14.50@2x.png +0 -0
  38. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-12-17 at 15.48.38@2x.png +0 -0
  39. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-11-25 at 20.21.25@2x.png +0 -0
  40. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-12-17 at 15.52.16@2x.png +0 -0
  41. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed_databases 2024-12-16 at 16.40.31@2x.png +0 -0
  42. pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-glossaries 2024-11-25 at 20.30.02.png +0 -0
  43. pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-terms 2024-11-25 at 20.32.11.png +0 -0
  44. pyegeria/commands/doc/Visual Command Reference/cat/show/info/asset-types 2024-11-25 at 20.34.19@2x.png +0 -0
  45. pyegeria/commands/doc/Visual Command Reference/cat/show/info/certification-types 2024-11-25 at 20.37.07.png +0 -0
  46. pyegeria/commands/doc/Visual Command Reference/cat/show/info/collection-graph 2024-12-12 at 11.33.18@2x.png +0 -0
  47. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-collections 2024-12-10 at 14.25.51@2x.png +0 -0
  48. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-todos 2024-12-12 at 11.46.30@2x.png +0 -0
  49. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-user-ids 2024-12-12 at 11.51.09@2x.png +0 -0
  50. pyegeria/commands/doc/Visual Command Reference/cat/show/info/tech-types 2024-12-12 at 11.37.20@2x.png +0 -0
  51. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_dependencies 2024-12-14 at 16.24.39@2x.png +0 -0
  52. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_structure 2024-12-14 at 16.21.35@2x.png +0 -0
  53. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/projects 2024-12-14 at 16.18.10@2x.png +0 -0
  54. pyegeria/commands/doc/Visual Command Reference/hey_egeria tui 2024-12-16 at 16.58.22@2x.png +0 -0
  55. pyegeria/commands/doc/Visual Command Reference/my/show/my_profile 2024-12-14 at 16.29.27@2x.png +0 -0
  56. pyegeria/commands/doc/Visual Command Reference/my/show/my_roles 2024-12-14 at 16.32.10@2x.png +0 -0
  57. pyegeria/commands/doc/Visual Command Reference/my/show/my_todos 2024-12-15 at 16.24.13@2x.png +0 -0
  58. pyegeria/commands/doc/Visual Command Reference/my/show/open_todos 2024-12-14 at 16.36.12@2x.png +0 -0
  59. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/list_engine_activity compressed 2024-12-15 at 16.48.48@2x.png +0 -0
  60. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity 2024-12-15 at 16.32.55@2x.png +0 -0
  61. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity compressed 2024-12-15 at 16.38.29@2x.png +0 -0
  62. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_status 2024-12-15 at 16.51.26.jpeg +0 -0
  63. pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_daemon_status 2024-12-15 at 16.57.12@2x.png +0 -0
  64. pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_targets 2024-12-15 at 17.02.19@2x.png +0 -0
  65. pyegeria/commands/doc/Visual Command Reference/ops/show/platforms/monitor_platform_status 2024-12-15 at 19.53.18@2x.png +0 -0
  66. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status 2024-12-15 at 19.59.39@2x.png +0 -0
  67. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status full 2024-12-15 at 20.01.57@2x.png +0 -0
  68. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_startup_servers 2024-12-15 at 19.56.07@2x.png +0 -0
  69. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_anchored_elements 2024-12-15 at 21.25.41@2x.png +0 -0
  70. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_elements_of_om_type 2024-12-16 at 14.39.59@2x.png +0 -0
  71. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/info_for_guid 2024-12-16 at 11.35.29@2x.png +0 -0
  72. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type 2024-12-16 at 14.24.18@2x.png +0 -0
  73. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type extended 2024-12-16 at 14.28.46@2x.png +0 -0
  74. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_of_om_type_by_classification 2024-12-16 at 14.35.26@2x.png +0 -0
  75. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/related_elements 2024-12-16 at 14.55.01@2x.png +0 -0
  76. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/show_related_specifications 2024-12-16 at 15.04.55@2x.png +0 -0
  77. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/asset_types 2024-12-16 at 15.10.16@2x.png +0 -0
  78. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/detailed_governance_action_processes 2024-12-16 at 15.16.26@2x.png +0 -0
  79. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/governance_action_processes 2024-12-16 at 15.13.01@2x.png +0 -0
  80. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/registered_services 2024-12-16 at 16.44.54@2x.png +0 -0
  81. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-16 at 16.20.34@2x.png +0 -0
  82. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-19 at 10.51.54@2x.png +0 -0
  83. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/valid_metadata_values 2024-12-16 at 15.31.56@2x.png +0 -0
  84. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_tech_type_template_specs 2024-12-16 at 16.03.22@2x.png +0 -0
  85. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_technology_types 2024-12-16 at 15.39.20@2x.png +0 -0
  86. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_details 2024-12-16 at 15.37.21@2x.png +0 -0
  87. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_templates 2024-12-16 at 16.11.48@2x.png +0 -0
  88. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/{hey_egeria: overview.md → README.md } +9 -1
  89. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/CleanShot 2024-11-18 at 21.32.03@2x.png +0 -0
  90. pyegeria/commands/my/monitor_my_todos.py +17 -5
  91. pyegeria/commands/my/monitor_open_todos.py +1 -1
  92. pyegeria/commands/my/todo_actions.py +7 -14
  93. pyegeria/commands/ops/monitor_asset_events.py +27 -22
  94. pyegeria/commands/ops/monitor_engine_activity_c.py +1 -1
  95. pyegeria/commands/ops/monitor_gov_eng_status.py +31 -4
  96. pyegeria/commands/ops/monitor_integ_daemon_status.py +17 -14
  97. pyegeria/commands/ops/monitor_platform_status.py +15 -3
  98. pyegeria/commands/ops/monitor_server_status.py +1 -1
  99. pyegeria/commands/ops/orig_monitor_server_status.py +36 -21
  100. pyegeria/commands/ops/refresh_integration_daemon.py +1 -1
  101. pyegeria/commands/ops/restart_integration_daemon.py +1 -1
  102. pyegeria/commands/ops/x_engine_actions.py +2 -59
  103. pyegeria/commands/tech/get_tech_details.py +79 -42
  104. pyegeria/commands/tech/get_tech_type_template.py +69 -53
  105. pyegeria/commands/tech/{list_element_graph.py → list_anchored_elements.py} +20 -17
  106. pyegeria/commands/tech/list_elements_x.py +7 -4
  107. pyegeria/commands/tech/list_registered_services.py +1 -1
  108. pyegeria/commands/tech/list_relationship_types.py +19 -21
  109. pyegeria/commands/tech/list_relationships.py +7 -3
  110. pyegeria/commands/tech/table_tech_templates.py +3 -1
  111. pyegeria/core_omag_server_config.py +36 -0
  112. pyegeria/create_tech_guid_lists.py +2 -2
  113. pyegeria/egeria_client.py +2 -0
  114. pyegeria/egeria_tech_client.py +5 -0
  115. pyegeria/glossary_manager_omvs.py +101 -7
  116. pyegeria/metadata_explorer_omvs.py +2371 -0
  117. pyegeria/server_operations.py +4 -4
  118. pyegeria/template_manager_omvs.py +1 -3
  119. pyegeria/valid_metadata_omvs.py +1 -1
  120. {pyegeria-1.5.1.1.60.dist-info → pyegeria-5.2.dist-info}/METADATA +7 -9
  121. pyegeria-5.2.dist-info/RECORD +232 -0
  122. {pyegeria-1.5.1.1.60.dist-info → pyegeria-5.2.dist-info}/entry_points.txt +4 -1
  123. pyegeria/commands/doc/command-overview.md +0 -99
  124. pyegeria-1.5.1.1.60.dist-info/RECORD +0 -167
  125. {pyegeria-1.5.1.1.60.dist-info → pyegeria-5.2.dist-info}/LICENSE +0 -0
  126. {pyegeria-1.5.1.1.60.dist-info → pyegeria-5.2.dist-info}/WHEEL +0 -0
@@ -9,6 +9,8 @@ A command line interface for Egeria Catalog User functions
9
9
  This is an emerging capability based on the **click** package. Feedback welcome!
10
10
 
11
11
  """
12
+ import os
13
+
12
14
  import click
13
15
  from trogon import tui
14
16
 
@@ -17,6 +19,7 @@ from pyegeria.commands.cat.get_collection import collection_viewer
17
19
  from pyegeria.commands.cat.get_project_dependencies import project_dependency_viewer
18
20
  from pyegeria.commands.cat.get_project_structure import project_structure_viewer
19
21
  from pyegeria.commands.cat.get_tech_type_elements import tech_viewer
22
+ from pyegeria.commands.cat.list_tech_type_elements import list_tech_elements
20
23
  from pyegeria.commands.cat.glossary_actions import (
21
24
  create_glossary,
22
25
  delete_glossary,
@@ -39,8 +42,9 @@ from pyegeria.commands.cat.list_projects import display_project_list
39
42
  from pyegeria.commands.cat.list_tech_types import display_tech_types
40
43
  from pyegeria.commands.cat.list_todos import display_to_dos as list_todos
41
44
  from pyegeria.commands.cat.list_user_ids import list_user_ids
45
+ from pyegeria.commands.cat.list_collections import display_collections
46
+
42
47
 
43
- # from pyegeria import ServerOps
44
48
  from pyegeria.commands.cli.ops_config import Config
45
49
  from pyegeria.commands.my.todo_actions import (
46
50
  mark_todo_complete,
@@ -51,20 +55,6 @@ from pyegeria.commands.my.todo_actions import (
51
55
  from pyegeria.commands.tech.list_asset_types import display_asset_types
52
56
 
53
57
 
54
- # class Config(object):
55
- # def __init__(self, server: str = None, url: str = None, userid:str = None, password:str = None,
56
- # timeout:int = 30, paging: bool = False):
57
- # self.server = server
58
- # self.url = url
59
- # self.userid = userid
60
- # self.password = password
61
- # self.timeout = timeout
62
- # self.paging = paging
63
- #
64
- #
65
- # pass_config = click.make_pass_decorator(Config)
66
-
67
-
68
58
  # @tui
69
59
  # @tui('menu','menu','A textual command line interface')
70
60
  @tui()
@@ -72,87 +62,82 @@ from pyegeria.commands.tech.list_asset_types import display_asset_types
72
62
  @click.group()
73
63
  @click.option(
74
64
  "--server",
75
- default="active-metadata-store",
76
- envvar="EGERIA_METADATA_STORE",
65
+ default=os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store"),
77
66
  help="Egeria metadata store to work with",
78
67
  )
79
68
  @click.option(
80
69
  "--url",
81
- default="https://localhost:9443",
82
- envvar="EGERIA_PLATFORM_URL",
70
+ default=os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443"),
83
71
  help="URL of Egeria metadata store platform to connect to",
84
72
  )
85
73
  @click.option(
86
74
  "--integration_daemon",
87
- default="integration-daemon",
88
- envvar="EGERIA_INTEGRATION_DAEMON",
75
+ default=os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon"),
89
76
  help="Egeria integration daemon to work with",
90
77
  )
91
78
  @click.option(
92
79
  "--integration_daemon_url",
93
- default="https://localhost:9443",
94
- envvar="EGERIA_INTEGRATION_DAEMON_URL",
80
+ default=os.environ.get("EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"),
95
81
  help="URL of Egeria integration daemon platform to connect to",
96
82
  )
97
83
  @click.option(
98
84
  "--view_server",
99
- default="view-server",
100
- envvar="EGERIA_VIEW_SERVER",
85
+ default=os.environ.get("EGERIA_VIEW_SERVER", "view-server"),
101
86
  help="Egeria view server to work with",
102
87
  )
103
88
  @click.option(
104
89
  "--view_server_url",
105
- default="https://localhost:9443",
106
- envvar="EGERIA_VIEW_SERVER_URL",
90
+ default=os.environ.get("EGERIA_VIEW_SERVER_URL", "https://localhost:9443"),
107
91
  help="URL of Egeria view server platform to connect to",
108
92
  )
109
93
  @click.option(
110
94
  "--engine_host",
111
- default="engine-host",
112
- envvar="EGERIA_ENGINE_HOST",
95
+ default=os.environ.get("EGERIA_ENGINE_HOST", "engine-host"),
113
96
  help="Egeria engine host to work with",
114
97
  )
115
98
  @click.option(
116
99
  "--engine_host_url",
117
- default="https://localhost:9443",
118
- envvar="EGERIA_ENGINE_HOST_URL",
100
+ default=os.environ.get("EGERIA_ENGINE_HOST_URL", "https://localhost:9443"),
119
101
  help="URL of Egeria engine host platform to connect to",
120
102
  )
121
103
  @click.option(
122
104
  "--admin_user",
123
- default="garygeeke",
124
- envvar="EGERIA_ADMIN_USER",
105
+ default=os.environ.get("EGERIA_ADMIN_USER", "garygeeke"),
125
106
  help="Egeria admin user",
126
107
  )
127
108
  @click.option(
128
109
  "--admin_user_password",
129
- default="secret",
130
- envvar="EGERIA_ADMIN_PASSWORD",
110
+ default=os.environ.get("EGERIA_ADMIN_PASSWORD", "secret"),
131
111
  help="Egeria admin password",
132
112
  )
133
113
  @click.option(
134
- "--userid", default="erinoverview", envvar="EGERIA_USER", help="Egeria user"
114
+ "--userid",
115
+ default=os.environ.get("EGERIA_USER", "peterprofile"),
116
+ help="Egeria user",
135
117
  )
136
118
  @click.option(
137
119
  "--password",
138
- default="secret",
139
- envvar="EGERIA_PASSWORD",
120
+ default=os.environ.get("EGERIA_USER_PASSWORD", "secret"),
140
121
  help="Egeria user password",
141
122
  )
142
123
  @click.option("--timeout", default=60, help="Number of seconds to wait")
143
124
  @click.option(
144
125
  "--jupyter",
145
126
  is_flag=True,
146
- default=False,
147
- envvar="EGERIA_JUPYTER",
127
+ default=os.environ.get("EGERIA_JUPYTER", "False"),
148
128
  help="Enable for rendering in a Jupyter terminal",
149
129
  )
150
130
  @click.option(
151
131
  "--width",
152
- default=200,
153
- envvar="EGERIA_WIDTH",
132
+ default=os.environ.get("EGERIA_WIDTH", 200),
133
+ type=int,
154
134
  help="Screen width, in characters, to use",
155
135
  )
136
+ @click.option(
137
+ "--home_glossary_guid",
138
+ default=os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None),
139
+ help="Glossary guid to use as the home glossary",
140
+ )
156
141
  @click.pass_context
157
142
  def cli(
158
143
  ctx,
@@ -171,6 +156,7 @@ def cli(
171
156
  timeout,
172
157
  jupyter,
173
158
  width,
159
+ home_glossary_guid,
174
160
  ):
175
161
  """An Egeria Command Line interface for Operations"""
176
162
  ctx.obj = Config(
@@ -189,8 +175,9 @@ def cli(
189
175
  timeout,
190
176
  jupyter,
191
177
  width,
178
+ home_glossary_guid,
192
179
  )
193
- ctx.max_content_width = 200
180
+ ctx.max_content_width = 250
194
181
  ctx.ensure_object(Config)
195
182
 
196
183
 
@@ -218,6 +205,17 @@ def show_tech_types(ctx, tech_type):
218
205
  )
219
206
 
220
207
 
208
+ @info.command("collections")
209
+ @click.option("--collection", default="*", help="Collection to search for")
210
+ @click.pass_context
211
+ def show_collections(ctx, collection):
212
+ """List Collections"""
213
+ c = ctx.obj
214
+ display_collections(
215
+ collection, c.view_server, c.view_server_url, c.userid, c.password
216
+ )
217
+
218
+
221
219
  @show.group("assets")
222
220
  @click.pass_context
223
221
  def asset_group(ctx):
@@ -232,6 +230,21 @@ def asset_group(ctx):
232
230
  help="Specific tech type to get elements for",
233
231
  )
234
232
  @click.pass_context
233
+ def list_tech_type_elements(ctx, tech_type):
234
+ """List technology type elements"""
235
+ c = ctx.obj
236
+ list_tech_elements(
237
+ tech_type, c.view_server, c.view_server_url, c.userid, c.password
238
+ )
239
+
240
+
241
+ @asset_group.command("elements-of-tech-type")
242
+ @click.option(
243
+ "--tech_type",
244
+ default="PostgreSQL Server",
245
+ help="Specific tech type to get elements for",
246
+ )
247
+ @click.pass_context
235
248
  def show_tech_type_elements(ctx, tech_type):
236
249
  """List technology type elements"""
237
250
  c = ctx.obj
@@ -299,7 +312,7 @@ def glossary_group(ctx):
299
312
  )
300
313
  @click.option(
301
314
  "--glossary-guid",
302
- default=None,
315
+ default=os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None),
303
316
  help="Optionally restrict search to glossary with the specified guid",
304
317
  )
305
318
  @click.option(
@@ -328,7 +341,7 @@ def show_terms(ctx, search_string, glossary_guid, glossary_name):
328
341
  @click.option("--search_string", default="*", help="Name to search for glossaries")
329
342
  @click.pass_context
330
343
  def glossaries(ctx, search_string):
331
- """Display information about a collection"""
344
+ """Display a list of glossaries"""
332
345
  c = ctx.obj
333
346
  display_glossaries(
334
347
  search_string,
@@ -344,12 +357,12 @@ def glossaries(ctx, search_string):
344
357
  @info.command("collection")
345
358
  @click.option(
346
359
  "--root_collection",
347
- default="Root Sustainability Collection",
360
+ default="Digital Product Root",
348
361
  help="View of tree of collections from a given root",
349
362
  )
350
363
  @click.pass_context
351
- def show_asset_graph(ctx, root_collection):
352
- """Display a tree graph of information about an asset"""
364
+ def show_collection(ctx, root_collection):
365
+ """Display a collection"""
353
366
  c = ctx.obj
354
367
  collection_viewer(
355
368
  root_collection,
@@ -391,9 +404,7 @@ def show_projects(ctx, search_string):
391
404
  @click.option("--search-string", default="CertificationType", help="")
392
405
  @click.pass_context
393
406
  def show_certification_types(ctx, search_string):
394
- """Show certification types
395
- - generally stay with the default.
396
- """
407
+ """Show certification types"""
397
408
  c = ctx.obj
398
409
  display_certifications(
399
410
  search_string,
@@ -465,7 +476,7 @@ def show_project_dependencies(ctx, project):
465
476
  )
466
477
  @click.pass_context
467
478
  def show_todos(ctx, search_string, status):
468
- """Display a tree graph of information about an asset"""
479
+ """Display a list of To Dos"""
469
480
  c = ctx.obj
470
481
  list_todos(
471
482
  search_string,
@@ -0,0 +1,313 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+ A form exemplar for Egeria users to enter data into templates using Textual open source framework
6
+
7
+ Peter Coldicott
8
+ """
9
+
10
+ import os
11
+ from os import system
12
+ import click
13
+ from textual.reactive import Reactive
14
+
15
+ from textual.app import App, ComposeResult
16
+ from textual.containers import (
17
+ Container,
18
+ Vertical,
19
+ HorizontalScroll,
20
+ VerticalScroll,
21
+ ScrollableContainer,
22
+ )
23
+ from textual import on, work
24
+ from textual.screen import ModalScreen, Screen
25
+ from textual.widgets import (
26
+ Input,
27
+ Static,
28
+ Button,
29
+ RichLog,
30
+ Label,
31
+ Tree,
32
+ Footer,
33
+ DataTable,
34
+ Header,
35
+ )
36
+
37
+ from typing import Any
38
+
39
+
40
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
41
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
42
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
43
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
44
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
45
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
46
+ )
47
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
48
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
49
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
50
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
51
+
52
+ disable_ssl_warnings = True
53
+
54
+ TITLE = "User Access"
55
+
56
+
57
+ class UserInfo(Screen):
58
+ """A screen to request user access info - required
59
+ If no information is supplied the access defaults to a set of
60
+ demo/test values:
61
+ User: erinoverview
62
+ Password: Secret
63
+ Platform URL: https://localhost:9443
64
+ View Server Name: view-server"""
65
+
66
+ BINDINGS = [("d", "toggle_dark", "Toggle dark mode")]
67
+
68
+ def __init__(self) -> None:
69
+ """Initialize the UserInfo Screen variables"""
70
+ self.app.dark = True
71
+ self.user = ""
72
+ self.password = ""
73
+ self.platformu = ""
74
+ self.view_server = ""
75
+ self.tech_type = ""
76
+ super().__init__()
77
+
78
+ def compose(self) -> ComposeResult:
79
+ self.log("In UserInfo - Compose ")
80
+ with VerticalScroll(id="user-container"):
81
+ yield Label("Username: ", classes="uprompt")
82
+ yield Input("", id="username", classes="uinput")
83
+ with VerticalScroll(id="pwd-container"):
84
+ yield Label("Password: ", classes="uprompt")
85
+ yield Input("", id="password", classes="uinput")
86
+ with VerticalScroll(id="platform-container"):
87
+ yield Label("Platform URL: ", classes="uprompt")
88
+ yield Input("", id="platform_url", classes="uinput")
89
+ with VerticalScroll(id="view-server-container"):
90
+ yield Label("View Server Name: ", classes="uprompt")
91
+ yield Input("", id="view_server", classes="uinput")
92
+ with HorizontalScroll(id="button-container"):
93
+ yield Button("Cancel", "warning", id="cancel")
94
+ yield Button("Submit", "primary", id="submit")
95
+ yield RichLog()
96
+ yield Footer()
97
+
98
+ def action_toggle_dark(self) -> None:
99
+ """An action to toggle dark mode."""
100
+
101
+ self.app.dark = not self.app.dark
102
+
103
+ def on_input_changed(self, event: Input.Changed) -> None:
104
+ """Detect input changed events and capture input value"""
105
+
106
+ try:
107
+ ivalue = str(event.value)
108
+ except ValueError:
109
+ return
110
+ else:
111
+ if event.input.id == "username":
112
+ self.user = ivalue
113
+ elif event.input.id == "password":
114
+ self.password = ivalue
115
+ elif event.input.id == "platform_url":
116
+ self.platformu = ivalue
117
+ elif event.input.id == "view_server":
118
+ self.view_server = ivalue
119
+ return
120
+
121
+ @on(Button.Pressed, "#submit")
122
+ async def on_submit(self) -> []:
123
+ """This processes the user input."""
124
+
125
+ global EGERIA_USER
126
+ global EGERIA_USER_PASSWORD
127
+ global EGERIA_PLATFORM_URL
128
+ global EGERIA_VIEW_SERVER
129
+
130
+ result = [" meow", "woof", "neigh", "hoot"]
131
+
132
+ if self.user:
133
+ result[0] = self.user
134
+ else:
135
+ result[0] = "erinoverview"
136
+ if self.password:
137
+ result[1] = self.password
138
+ else:
139
+ result[1] = "secret"
140
+ if self.platformu:
141
+ result[2] = self.platformu
142
+ else:
143
+ result[2] = "https://localhost:9443"
144
+ if self.view_server:
145
+ result[3] = self.view_server
146
+ else:
147
+ result[3] = "view-server"
148
+
149
+ # Also store the input in global variables
150
+
151
+ EGERIA_USER = result[0]
152
+ EGERIA_USER_PASSWORD = result[1]
153
+ EGERIA_PLATFORM_URL = result[2]
154
+ EGERIA_VIEW_SERVER = result[3]
155
+
156
+ await self.action_dismiss(result)
157
+
158
+ @on(Button.Pressed, "#cancel")
159
+ def on_cancel(self) -> None:
160
+ self.action_dismiss()
161
+
162
+
163
+ class ExitScreen(ModalScreen):
164
+ """App exit screen."""
165
+
166
+ DEFAULT_CSS = """
167
+ ExitScreen {
168
+ align: center middle;
169
+ }
170
+
171
+ ExitScreen > Container {
172
+ width: auto;
173
+ height: auto;
174
+ }
175
+ """
176
+
177
+ BINDINGS = [("d", "toggle_dark", "Toggle dark mode")]
178
+
179
+ def __init__(self) -> None:
180
+ """Initialize the UserInfo Screen variables"""
181
+ super().__init__()
182
+
183
+ def action_toggle_dark(self) -> None:
184
+ """An action to toggle dark mode."""
185
+ self.app.dark = not self.app.dark
186
+
187
+ def compose(self) -> ComposeResult:
188
+ with Container():
189
+ yield Label("Are you sure you want to quit?")
190
+ yield Button("No", id="no", variant="error")
191
+ yield Button("Yes", id="yes", variant="success")
192
+ yield Footer()
193
+ yield RichLog()
194
+
195
+ @on(Button.Pressed, "#no")
196
+ def on_no(self) -> None:
197
+ """No the user pressed the exit button in error"""
198
+ self.action_dismiss()
199
+
200
+ @on(Button.Pressed, "#yes")
201
+ def on_yes(self) -> None:
202
+ """Yes the user wants to quit the app"""
203
+ self.app.exit()
204
+
205
+
206
+ class Egeria_login(App):
207
+ """main app class"""
208
+
209
+ CSS_PATH = "txt_custom_v2.tcss"
210
+
211
+ BINDINGS = [("d", "toggle_dark", "Toggle dark mode")]
212
+
213
+ def __init__(self, *args, **kwargs) -> None:
214
+ super().__init__(*args, **kwargs)
215
+ dark = Reactive(True, compute=False)
216
+ self.app.dark = False
217
+ self.template: Any = None
218
+
219
+ def compose(self) -> ComposeResult:
220
+ """Compose the main display"""
221
+
222
+ yield Label(f"User: {EGERIA_USER}, password: {EGERIA_USER_PASSWORD}")
223
+ yield Label(
224
+ f"Platform: {EGERIA_PLATFORM_URL}, View Server: {EGERIA_VIEW_SERVER}"
225
+ )
226
+ yield Button("Finish", "success", id="finish")
227
+ yield RichLog()
228
+ yield Footer()
229
+
230
+ def on_button_pressed(self, event: Button.Pressed) -> (str, str, str, str):
231
+ """Yes the user wants to quit the app"""
232
+
233
+ self.exit(
234
+ (
235
+ EGERIA_USER,
236
+ EGERIA_USER_PASSWORD,
237
+ EGERIA_PLATFORM_URL,
238
+ EGERIA_VIEW_SERVER,
239
+ ),
240
+ 200,
241
+ "Finished",
242
+ )
243
+
244
+ def action_toggle_dark(self) -> None:
245
+ """An action to toggle dark and light mode."""
246
+ self.app.dark = not self.app.dark
247
+
248
+ async def on_mount(self) -> None:
249
+ """Main Program flow control start routine
250
+ Pushes the user info popup with an associated call back routine"""
251
+
252
+ global EGERIA_USER
253
+ global EGERIA_USER_PASSWORD
254
+ global EGERIA_PLATFORM_URL
255
+ global EGERIA_VIEW_SERVER
256
+
257
+ system("clear")
258
+ # Display User Info Screen
259
+ self.install_screen(UserInfo(), name="userinfo")
260
+ await self.push_screen(UserInfo(), self.input_userinfo_callback)
261
+
262
+ async def input_userinfo_callback(self, user_input) -> (str, str, str, str):
263
+ """Prompt for user id and password, callback routine
264
+ This routine is invoked when user input is completed
265
+ """
266
+
267
+ global EGERIA_USER
268
+ global EGERIA_USER_PASSWORD
269
+ global EGERIA_PLATFORM_URL
270
+ global EGERIA_VIEW_SERVER
271
+ global TECH_NAME
272
+
273
+ if user_input[0] != None:
274
+ EGERIA_USER = user_input[0]
275
+ else:
276
+ EGERIA_USER = "erinoverview"
277
+ if user_input[1] != None:
278
+ EGERIA_USER_PASSWORD = user_input[1]
279
+ else:
280
+ EGERIA_USER_PASSWORD = "secret"
281
+ if user_input[2] != None:
282
+ EGERIA_PLATFORM_URL = user_input[2]
283
+ else:
284
+ EGERIA_PLATFORM_URL = "https://localhost:9443"
285
+ if user_input[3] != None:
286
+ EGERIA_VIEW_SERVER = user_input[3]
287
+ else:
288
+ EGERIA_VIEW_SERVER = "view-server"
289
+
290
+ return (
291
+ EGERIA_USER,
292
+ EGERIA_USER_PASSWORD,
293
+ EGERIA_PLATFORM_URL,
294
+ EGERIA_VIEW_SERVER,
295
+ )
296
+
297
+
298
+ # @click.command("egeria-login")
299
+ # @click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use.")
300
+ # @click.option(
301
+ # "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
302
+ # )
303
+ # @click.option("--userid", default=EGERIA_USER, help="Egeria user")
304
+ # @click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
305
+ def login(userid: str, password: str, server: str, url: str) -> None:
306
+ app = Egeria_login()
307
+ app.run()
308
+ return "peterprofile"
309
+
310
+
311
+ if __name__ == "__main__":
312
+ app = Egeria_login()
313
+ app.run()