pyegeria 0.5.9.1__tar.gz → 0.5.9.3__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 (80) hide show
  1. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/PKG-INFO +1 -1
  2. pyegeria-0.5.9.3/examples/widgets/cli/egeria.py +660 -0
  3. pyegeria-0.5.9.1/examples/widgets/cli/egeria_my.py → pyegeria-0.5.9.3/examples/widgets/cli/egeria_per.py +15 -2
  4. pyegeria-0.5.9.3/examples/widgets/personal/list_my_profile.py +134 -0
  5. pyegeria-0.5.9.1/examples/widgets/personal/list_my_profile.py → pyegeria-0.5.9.3/examples/widgets/personal/list_my_roles.py +2 -2
  6. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyproject.toml +3 -2
  7. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/LICENSE +0 -0
  8. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/README.md +0 -0
  9. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/doc_samples/Create_Collection_Sample.py +0 -0
  10. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
  11. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/catalog_user/README.md +0 -0
  12. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/catalog_user/__init__.py +0 -0
  13. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/catalog_user/get_asset_graph.py +0 -0
  14. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/catalog_user/get_collection.py +0 -0
  15. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/catalog_user/get_tech_type_elements.py +0 -0
  16. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/catalog_user/get_tech_type_template.py +0 -0
  17. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/catalog_user/list_assets.py +0 -0
  18. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/catalog_user/list_glossary.py +0 -0
  19. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/catalog_user/list_projects.py +0 -0
  20. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/catalog_user/list_tech_types.py +0 -0
  21. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/catalog_user/list_todos.py +0 -0
  22. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/cli/__init__.py +0 -0
  23. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/cli/egeria_cat.py +0 -0
  24. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/cli/egeria_ops.py +0 -0
  25. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/cli/egeria_tech.py +0 -0
  26. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/cli/ops_config.py +0 -0
  27. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/README.md +0 -0
  28. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/__init__.py +0 -0
  29. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/engine_actions.py +0 -0
  30. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/integration_daemon_actions.py +0 -0
  31. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/list_catalog_targets.py +0 -0
  32. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/load_archive.py +0 -0
  33. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/monitor_asset_events.py +0 -0
  34. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/monitor_coco_status.py +0 -0
  35. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/monitor_engine_activity.py +0 -0
  36. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/monitor_gov_eng_status.py +0 -0
  37. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/monitor_integ_daemon_status.py +0 -0
  38. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/monitor_platform_status.py +0 -0
  39. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/monitor_server_list.py +0 -0
  40. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/monitor_server_status.py +0 -0
  41. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/refresh_integration_daemon.py +0 -0
  42. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/operational/restart_integration_daemon.py +0 -0
  43. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/personal/README.md +0 -0
  44. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/personal/__init__.py +0 -0
  45. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/personal/monitor_my_todos.py +0 -0
  46. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/personal/monitor_open_todos.py +0 -0
  47. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/tech/README.md +0 -0
  48. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/tech/__init__.py +0 -0
  49. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/tech/get_guid_info.py +0 -0
  50. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/tech/get_tech_details.py +0 -0
  51. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/tech/list_asset_types.py +0 -0
  52. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/tech/list_registered_services.py +0 -0
  53. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/tech/list_relationship_types.py +0 -0
  54. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/tech/list_tech_templates.py +0 -0
  55. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/examples/widgets/tech/list_valid_metadata_values.py +0 -0
  56. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/Xfeedback_manager_omvs.py +0 -0
  57. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/Xloaded_resources_omvs.py +0 -0
  58. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/__init__.py +0 -0
  59. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/_client.py +0 -0
  60. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/_deprecated_gov_engine.py +0 -0
  61. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/_exceptions.py +0 -0
  62. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/_globals.py +0 -0
  63. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/_validators.py +0 -0
  64. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/action_author_omvs.py +0 -0
  65. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/asset_catalog_omvs.py +0 -0
  66. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/automated_curation_omvs.py +0 -0
  67. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/collection_manager_omvs.py +0 -0
  68. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/core_omag_server_config.py +0 -0
  69. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/create_tech_guid_lists.py +0 -0
  70. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/full_omag_server_config.py +0 -0
  71. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/glossary_browser_omvs.py +0 -0
  72. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/glossary_manager_omvs.py +0 -0
  73. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/my_profile_omvs.py +0 -0
  74. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/platform_services.py +0 -0
  75. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/project_manager_omvs.py +0 -0
  76. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/registered_info.py +0 -0
  77. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/runtime_manager_omvs.py +0 -0
  78. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/server_operations.py +0 -0
  79. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/utils.py +0 -0
  80. {pyegeria-0.5.9.1 → pyegeria-0.5.9.3}/pyegeria/valid_metadata_omvs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 0.5.9.1
3
+ Version: 0.5.9.3
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,660 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ SPDX-License-Identifier: Apache-2.0
4
+ Copyright Contributors to the ODPi Egeria project.
5
+
6
+
7
+ A command line interface for Egeria Users - all commands
8
+
9
+ This is an emerging capability based on the **click** package. Feedback welcome!
10
+
11
+ """
12
+ import click
13
+ from trogon import tui
14
+
15
+ from examples.widgets.cli.ops_config import Config
16
+
17
+ from examples.widgets.personal.monitor_open_todos import display_todos
18
+ from examples.widgets.personal.monitor_my_todos import display_my_todos
19
+ from examples.widgets.personal.list_my_profile import display_my_profile
20
+ from examples.widgets.personal.list_my_roles import display_my_roles
21
+
22
+ from examples.widgets.catalog_user.list_tech_types import display_tech_types
23
+
24
+ from examples.widgets.tech.get_guid_info import display_guid
25
+ from examples.widgets.tech.get_tech_details import tech_details_viewer
26
+ from examples.widgets.tech.list_asset_types import display_asset_types
27
+ from examples.widgets.tech.list_registered_services import display_registered_svcs
28
+ from examples.widgets.tech.list_relationship_types import display_relationship_types
29
+ from examples.widgets.tech.list_tech_templates import display_templates_spec
30
+ from examples.widgets.tech.list_valid_metadata_values import display_metadata_values
31
+ from examples.widgets.catalog_user.get_tech_type_template import template_viewer
32
+
33
+
34
+ from examples.widgets.catalog_user.get_asset_graph import asset_viewer
35
+ from examples.widgets.catalog_user.get_collection import collection_viewer
36
+ from examples.widgets.catalog_user.get_tech_type_elements import tech_viewer
37
+ from examples.widgets.catalog_user.get_tech_type_template import template_viewer
38
+ from examples.widgets.catalog_user.list_assets import display_assets
39
+ from examples.widgets.catalog_user.list_glossary import display_glossary_terms
40
+ from examples.widgets.catalog_user.list_tech_types import display_tech_types
41
+ from examples.widgets.catalog_user.list_projects import display_project_list
42
+ from examples.widgets.catalog_user.list_todos import display_to_dos
43
+
44
+ from examples.widgets.operational.engine_actions import start_server as start_engine_host, \
45
+ stop_server as stop_engine_host
46
+ from examples.widgets.operational.integration_daemon_actions import (add_catalog_target, remove_catalog_target,
47
+ update_catalog_target, stop_server, start_server)
48
+ from examples.widgets.operational.list_catalog_targets import display_catalog_targets
49
+ from examples.widgets.operational.load_archive import load_archive
50
+ from examples.widgets.operational.monitor_engine_activity import display_engine_activity
51
+ from examples.widgets.operational.monitor_gov_eng_status import display_gov_eng_status
52
+ from examples.widgets.operational.monitor_integ_daemon_status import display_integration_daemon_status
53
+ from examples.widgets.operational.monitor_platform_status import display_status as p_display_status
54
+ from examples.widgets.operational.monitor_server_list import display_status as display_list
55
+ from examples.widgets.operational.monitor_server_status import display_status as s_display_status
56
+ from examples.widgets.operational.refresh_integration_daemon import refresh_connector
57
+ from examples.widgets.operational.restart_integration_daemon import restart_connector
58
+
59
+
60
+
61
+ # class Config(object):
62
+ # def __init__(self, server: str = None, url: str = None, userid:str = None, password:str = None,
63
+ # timeout:int = 30, paging: bool = False):
64
+ # self.server = server
65
+ # self.url = url
66
+ # self.userid = userid
67
+ # self.password = password
68
+ # self.timeout = timeout
69
+ # self.paging = paging
70
+ #
71
+ #
72
+ # pass_config = click.make_pass_decorator(Config)
73
+
74
+ @tui()
75
+ # @tui('menu', 'menu', 'A textual command line interface')
76
+ @click.version_option("0.0.1", prog_name="egeria_ops")
77
+
78
+ @click.group()
79
+ @click.option('--server', default='active-metadata-store', envvar='EGERIA_METADATA_STORE',
80
+ help='Egeria metadata store to work with')
81
+ @click.option('--url', default='https://localhost:9443', envvar='EGERIA_PLATFORM_URL',
82
+ help='URL of Egeria metadata store platform to connect to')
83
+ @click.option('--integration-daemon', default='integration-daemon', envvar='EGERIA_INTEGRATION_DAEMON',
84
+ help='Egeria integration daemon to work with')
85
+ @click.option('--integration_daemon_url', default='https://localhost:9443', envvar='EGERIA_INTEGRATION_DAEMON_URL',
86
+ help='URL of Egeria integration daemon platform to connect to')
87
+ @click.option('--view_server', default='view-server', envvar='EGERIA_VIEW_SERVER',
88
+ help='Egeria view server to work with')
89
+ @click.option('--view_server_url', default='https://localhost:9443', envvar='EGERIA_VIEW_SERVER_URL',
90
+ help='URL of Egeria view server platform to connect to')
91
+ @click.option('--engine_host', default='engine-host', envvar='EGERIA_ENGINE_HOST',
92
+ help='Egeria engine host to work with')
93
+ @click.option('--engine_host_url', default='https://localhost:9443', envvar='EGERIA_ENGINE_HOST_URL',
94
+ help='URL of Egeria engine host platform to connect to')
95
+ @click.option('--admin_user', default='garygeeke', envvar='EGERIA_ADMIN_USER', help='Egeria admin user')
96
+ @click.option('--admin_user_password', default='secret', envvar='EGERIA_ADMIN_PASSWORD',
97
+ help='Egeria admin password')
98
+ @click.option('--userid', default='garygeeke', envvar='EGERIA_USER', help='Egeria user')
99
+ @click.option('--password', default='secret', envvar='EGERIA_PASSWORD',
100
+ help='Egeria user password')
101
+ @click.option('--timeout', default=60, help='Number of seconds to wait')
102
+ @click.option('--verbose', is_flag=True, default=False, help='Enable verbose mode')
103
+ @click.option('--paging', is_flag=True, default=False, help='Enable paging snapshots vs live updates')
104
+ @click.option('--jupyter', is_flag=True, default=False, envvar='EGERIA_JUPYTER',
105
+ help='Enable for rendering in a Jupyter terminal')
106
+ @click.option('--width', default=200, envvar='EGERIA_WIDTH', help='Screen width, in characters, to use')
107
+ @click.pass_context
108
+ def cli(ctx, server, url, view_server, view_server_url, integration_daemon, integration_daemon_url,
109
+ engine_host, engine_host_url, admin_user, admin_user_password, userid, password, timeout, paging,
110
+ verbose, jupyter, width):
111
+ """An Egeria Command Line interface for Operations """
112
+ ctx.obj = Config(server, url, view_server, view_server_url, integration_daemon,
113
+ integration_daemon_url, engine_host, engine_host_url,
114
+ admin_user, admin_user_password, userid, password,
115
+ timeout, paging, verbose, jupyter, width)
116
+ ctx.max_content_width = 200
117
+ ctx.ensure_object(Config)
118
+ if verbose:
119
+ click.echo(f"we are in verbose mode - server is {server}")
120
+
121
+ #
122
+ # Personal: Show
123
+ #
124
+ @cli.group('personal')
125
+ @click.pass_context
126
+ def personal(ctx):
127
+ "Work with my information"
128
+ pass
129
+
130
+
131
+
132
+ @personal.group("show")
133
+ @click.pass_context
134
+ def show(ctx):
135
+ """Display an Egeria Object"""
136
+ pass
137
+
138
+
139
+ @show.command('my-profile')
140
+ @click.pass_context
141
+ def show_my_profile(ctx):
142
+ """Display my profiles
143
+
144
+ Usage: show my-profile
145
+
146
+ """
147
+ c = ctx.obj
148
+ display_my_profile( c.view_server, c.view_server_url,
149
+ c.userid, c.password, c.jupyter, c.width)
150
+
151
+ @show.command('my-roles')
152
+ @click.pass_context
153
+ def show_my_roles(ctx):
154
+ """Display my profiles
155
+
156
+ Usage: show my-profile
157
+
158
+ """
159
+ c = ctx.obj
160
+ display_my_roles( c.view_server, c.view_server_url,
161
+ c.userid, c.password, c.jupyter, c.width)
162
+
163
+
164
+ @show.command('my-to-dos')
165
+ @click.pass_context
166
+ def show_my_todos(ctx):
167
+ """Show my To-Dos
168
+
169
+ Usage: show my-to-dos
170
+
171
+ """
172
+ c = ctx.obj
173
+ display_my_todos(c.view_server, c.view_server_url,
174
+ c.userid, c.password, c.jupyter, c.width)
175
+
176
+
177
+ @show.command('open-to-dos')
178
+ @click.pass_context
179
+ def show_open_todos(ctx):
180
+ """Display a live status view of Egeria servers for the specified Egeria platform
181
+
182
+ Usage: show tech-details <tech-name>
183
+
184
+ tech-name is a valid technology name (see 'show tech-types')
185
+ """
186
+ c = ctx.obj
187
+ display_todos( c.view_server, c.view_server_url, c.userid, c.password, c.jupyter, c.width)
188
+
189
+ #
190
+ # Personal: Tell
191
+ #
192
+
193
+ @personal.group('tell')
194
+ @click.pass_context
195
+ def tell(ctx):
196
+ """Perform actions an Egeria Objects"""
197
+ pass
198
+
199
+ #
200
+ # Technical User: Show
201
+ #
202
+ @cli.group("technical")
203
+ @click.pass_context
204
+ def technical(ctx):
205
+ """Commands for Technical Users"""
206
+ pass
207
+
208
+
209
+ @technical.group("show")
210
+ @click.pass_context
211
+ def show(ctx):
212
+ """Display an Egeria Object"""
213
+ pass
214
+
215
+
216
+ @show.command('guid-info')
217
+ @click.argument('guid', nargs=1)
218
+ @click.pass_context
219
+ def show_guid_infos(ctx, guid):
220
+ """Display a live status view of known platforms
221
+
222
+ Usage: show guid-info <a guid>
223
+
224
+ """
225
+ c = ctx.obj
226
+ display_guid(guid, c.server, c.url,
227
+ c.user_id, c.password, c.jupyter, c.width)
228
+
229
+
230
+ @show.command('tech-types')
231
+ @click.option('--search-string', default='*', help='Tech type to search for')
232
+ @click.pass_context
233
+ def show_tech_types(ctx, search_string):
234
+ """List deployed technology types
235
+
236
+ Usage: show tech-types <optional search-string>
237
+
238
+ All tech-types will be returned if no search-string is specified.
239
+
240
+ """
241
+
242
+
243
+ c = ctx.obj
244
+ display_tech_types(search_string, c.view_server, c.view_server_url,
245
+ c.userid, c.password)
246
+
247
+
248
+ @show.command('tech-details')
249
+ @click.argument('tech-name')
250
+ @click.pass_context
251
+ def show_tech_details(ctx, tech_name):
252
+ """Display a live status view of Egeria servers for the specified Egeria platform
253
+
254
+ Usage: show tech-details <tech-name>
255
+
256
+ tech-name is a valid technology name (see 'show tech-types')
257
+ """
258
+ c = ctx.obj
259
+ tech_details_viewer(tech_name, c.view_server, c.view_server_url, c.userid, c.password, c.jupyter, c.width)
260
+
261
+
262
+ @show.command("asset-types")
263
+ @click.pass_context
264
+ def show_asset_types(ctx):
265
+ """Display engine-host status information"""
266
+ c = ctx.obj
267
+ display_asset_types(c.view_server, c.view_server_url,
268
+ c.userid, c.password,
269
+ c.jupyter, c.width)
270
+
271
+
272
+ @show.command('registered-services')
273
+ @click.option('--services',
274
+ type=click.Choice(['all', 'access-services', 'common-services', 'engine-services',
275
+ 'governance-services', 'integration-services', 'view-services'],
276
+ case_sensitive=False), default='all', help='Which service group to display')
277
+ @click.pass_context
278
+ def show_registered_services(ctx, services):
279
+ """Show information about a registered services"""
280
+ c = ctx.obj
281
+ display_registered_svcs(services, c.view_server, c.view_server_url,
282
+ c.userid, c.password, c.jupyter, c.width)
283
+
284
+
285
+ @show.command('relationship-types')
286
+ @click.option('--rel-type', default='AssetOwner', help='Relationship type to get information about')
287
+ @click.pass_context
288
+ def show_relationship_types(ctx, rel_type):
289
+ """Show information about the specified relationship type"""
290
+ c = ctx.obj
291
+ display_relationship_types(rel_type, c.view_server, c.view_server_url,
292
+
293
+ c.userid, c.password, False, c.jupyter, c.width)
294
+
295
+
296
+ @show.command("tech-templates")
297
+ @click.pass_context
298
+ @click.option('--search-string', default='*', help='Technology type to get information about')
299
+ def tech_templates(ctx, search_string):
300
+ """Display template information about the specified technology."""
301
+ c = ctx.obj
302
+ template_viewer(search_string, c.view_server, c.view_server_url,
303
+ c.userid, c.password, c.jupyter, c.width)
304
+
305
+ @show.command("tech-template-spec")
306
+ @click.pass_context
307
+ @click.option('--search-string', default='*', help='Technology type to get information about')
308
+ def tech_template_spec(ctx, search_string):
309
+ """Display template specification information about the specified technology."""
310
+ c = ctx.obj
311
+ display_templates_spec(search_string, c.view_server, c.view_server_url,
312
+ c.userid, c.password, c.jupyter, c.width)
313
+
314
+
315
+ @show.command("valid-metadata-values")
316
+ @click.pass_context
317
+ @click.option('--property', default='projectHealth', help='Metadata property to query')
318
+ @click.option('--type-name', default='Project', help='Metadata type to query')
319
+ def valid_metadata_values(ctx, property, type_name):
320
+ """Display the valid metadata values for a property and type"""
321
+ c = ctx.obj
322
+ display_metadata_values(property, type_name, c.view_server, c.view_server_url,
323
+ c.userid, c.password, False, c.jupyter, c.width)
324
+
325
+
326
+ #
327
+ # Technical Users: Tell
328
+ #
329
+
330
+ @technical.group('tell')
331
+ @click.pass_context
332
+ def tell(ctx):
333
+ """Perform actions an Egeria Objects"""
334
+ pass
335
+
336
+
337
+
338
+ #
339
+ # Catalog User: Show
340
+ #
341
+
342
+ @cli.group('catalog_user')
343
+ @click.pass_context
344
+ def catalog_user(ctx):
345
+ """Commands for the more technical user"""
346
+ pass
347
+ @catalog_user.group("show")
348
+ @click.pass_context
349
+ def show(ctx):
350
+ """Display an Egeria Object"""
351
+ pass
352
+
353
+
354
+ @show.command('tech-types')
355
+ @click.option('--tech_type', default='*', help='Tech type to search for')
356
+ @click.pass_context
357
+ def show_tech_types(ctx, tech_type):
358
+ """List deployed technology types"""
359
+ c = ctx.obj
360
+ display_tech_types(tech_type, c.view_server, c.view_server_url,
361
+ c.userid, c.password)
362
+
363
+
364
+ @show.command('tech-type-elements')
365
+ @click.option('--tech_type', default='PostgreSQL Server', help='Specific tech type to get elements for')
366
+ @click.pass_context
367
+ def show_tech_type_elements(ctx, tech_type):
368
+ """List technology type elements"""
369
+ c = ctx.obj
370
+ tech_viewer(tech_type, c.view_server, c.view_server_url,
371
+ c.userid, c.password)
372
+
373
+
374
+ @show.command('tech-type-templates')
375
+ @click.option('--tech-type', default='PostgreSQL Server', help='Specific tech type to get elements for')
376
+ @click.pass_context
377
+ def show_tech_type_templates(ctx, tech_type):
378
+ """List technology type templates"""
379
+ c = ctx.obj
380
+ template_viewer(tech_type, c.view_server, c.view_server_url, c.userid,
381
+ c.password, c.jupyter, c.width)
382
+
383
+
384
+ @show.command('assets')
385
+ @click.argument('search-string')
386
+ @click.pass_context
387
+ def show_assets(ctx, search_string):
388
+ """Find and display assets
389
+
390
+ Usage: show assets <search-string>
391
+
392
+ search-string must be greater than four characters.
393
+ """
394
+ c = ctx.obj
395
+ display_assets(search_string, c.view_server, c.view_server_url, c.userid,
396
+ c.password, 60,c.jupyter, c.width)
397
+
398
+
399
+ @show.command('glossary-terms')
400
+ @click.option('--search-string', default='*',
401
+ help='List glossary terms similar to search string - minimum of 4 characters')
402
+ @click.option('--glossary_guid', default=None, help='Optionally restrict search to glossary with the specified guid')
403
+ @click.pass_context
404
+ def show_terms(ctx, search_string, glossary_guid):
405
+ """Find and display glossary terms"""
406
+ c = ctx.obj
407
+ display_glossary_terms(search_string, glossary_guid, c.view_server, c.view_server_url, c.userid,
408
+ c.password, c.jupyter, c.width)
409
+
410
+
411
+ @show.command('asset-graph')
412
+ @click.argument('asset_guid', nargs=1)
413
+ @click.pass_context
414
+ def show_asset_graph(ctx, asset_guid):
415
+ """Display a tree graph of information about an asset
416
+
417
+ Usage: show asset-graph <asset-guid>
418
+
419
+ asset-guid must be a valid asset guid. These can be found through other commands such as 'show tech-type-elements'
420
+
421
+ """
422
+ c = ctx.obj
423
+ asset_viewer(asset_guid, c.view_server, c.view_server_url, c.userid,
424
+ c.password, c.jupyter, c.width)
425
+
426
+
427
+ @show.command('collection')
428
+ @click.option('--root_collection', default='Root Sustainability Collection',
429
+ help='View of tree of collections from a given root')
430
+ @click.pass_context
431
+ def show_asset_graph(ctx, root_collection):
432
+ """Display a tree graph of information about an asset """
433
+ c = ctx.obj
434
+ collection_viewer(root_collection, c.view_server, c.view_server_url, c.userid,
435
+ c.password, c.jupyter, c.width)
436
+
437
+
438
+ @show.command('projects')
439
+ @click.option('--search-string', default='*',
440
+ help='List Projects by Search String')
441
+ @click.pass_context
442
+ def show_projects(ctx, search_string):
443
+ """Display a list of Egeria projects """
444
+ c = ctx.obj
445
+ display_project_list(search_string, c.view_server, c.view_server_url, c.userid,
446
+ c.password, False,c.jupyter, c.width)
447
+
448
+
449
+ @show.command('to-dos')
450
+ @click.option('--search-string', default='*',
451
+ help='View the list of To-Do items')
452
+ @click.pass_context
453
+ def show_todos(ctx, search_string):
454
+ """Display a tree graph of information about an asset """
455
+ c = ctx.obj
456
+ display_to_dos(search_string, c.view_server, c.view_server_url, c.userid,
457
+ c.password, c.jupyter, c.width)
458
+
459
+ #
460
+ # Catalog User: Tell
461
+ #
462
+
463
+ @catalog_user.group('tell')
464
+ @click.pass_context
465
+ def tell(ctx):
466
+ """Perform actions an Egeria Objects"""
467
+ pass
468
+
469
+
470
+ @tell.group('survey')
471
+ @click.pass_context
472
+ def survey(ctx):
473
+ """Refresh the specified integration connector or ALL connectors if not specified"""
474
+ c = ctx.obj
475
+ pass
476
+
477
+
478
+ @survey.command('survey_uc_server')
479
+ @click.pass_context
480
+ @click.option('--uc_endpoint', default='https://localhost:8080',
481
+ help="Endpoint of the Unity Catalog Server to Survey")
482
+ def survey_uc_server(ctx, uc_endpoint):
483
+ """Survey the Unity Catalog server at the given endpoint"""
484
+ c = ctx.obj
485
+ pass
486
+ # restart_connector(connector, c.integration_daemon, c.integration_daemon_url,
487
+ # c.userid, c.password)
488
+
489
+ #
490
+ # Operations: Show
491
+ #
492
+
493
+ @cli.group('operations')
494
+ @click.pass_context
495
+ def operations(ctx):
496
+ """ Commands to understand and manage operations"""
497
+ pass
498
+
499
+ @operations.group("show")
500
+ @click.pass_context
501
+ def show(ctx):
502
+ """Display an Egeria Object"""
503
+ pass
504
+
505
+
506
+ @show.group('platforms')
507
+ @click.pass_context
508
+ def show_platform(ctx):
509
+ """Group of commands to show information about Egeria platforms"""
510
+ pass
511
+
512
+
513
+ @show_platform.command('status')
514
+ @click.pass_context
515
+ def show_platform_status(ctx):
516
+ """Display a live status view of known platforms"""
517
+ c = ctx.obj
518
+ p_display_status(c.view_server, c.view_server_url,
519
+ c.admin_user, c.admin_user_password)
520
+
521
+
522
+ @show.group("servers")
523
+ @click.pass_context
524
+ def show_server(ctx):
525
+ """Group of commands to show information about Egeria servers"""
526
+ pass
527
+
528
+
529
+ @show_server.command('status')
530
+ @click.option('--full', is_flag=True, default=False, help='If True, full server descriptions will be shown')
531
+ @click.pass_context
532
+ def show_server_status(ctx, full):
533
+ """Display a live status view of Egeria servers for the specified Egeria platform"""
534
+ c = ctx.obj
535
+ if full:
536
+ display_list(c.metadata_store, c.metadata_store_url, c.admin_user, c.admin_user_password, c.jupyter, c.width)
537
+ else:
538
+ s_display_status(c.metadata_store, c.metadata_store_url, c.admin_user, c.admin_user_password, c.jupyter,
539
+ c.width)
540
+
541
+
542
+ @show.group("engines")
543
+ @click.pass_context
544
+ def engine_host(ctx):
545
+ """Group of commands to show information about Egeria engines"""
546
+ pass
547
+
548
+
549
+ @engine_host.command("status")
550
+ @click.option('--list', is_flag=True, default=False, help='If True, a paged list will be shown')
551
+ @click.pass_context
552
+ def gov_eng_status(ctx, list):
553
+ """Display engine-host status information"""
554
+ c = ctx.obj
555
+ display_gov_eng_status(c.engine_host, c.engine_host_url,
556
+ c.userid, c.password,
557
+ list, c.jupyter, c.width)
558
+
559
+
560
+ @engine_host.command('activity')
561
+ @click.option('--list', is_flag=True, default=False, help='If True, a paged list will be shown')
562
+ @click.pass_context
563
+ def eng_activity_status(ctx, list):
564
+ """Show Governance Activity in engine-host"""
565
+ c = ctx.obj
566
+ display_engine_activity(c.view_server, c.view_server_url,
567
+ c.admin_user, c.admin_user_password,
568
+ list, c.jupyter, c.width)
569
+
570
+
571
+ @show.group('integrations')
572
+ @click.pass_context
573
+ def integrations(ctx):
574
+ """Group of commands to show information about Egeria integrations"""
575
+ pass
576
+
577
+
578
+ @integrations.command("status")
579
+ @click.option('--list', is_flag=True, default=False, help='If True, a paged list will be shown')
580
+ @click.pass_context
581
+ def integrations_status(ctx, list):
582
+ """Display integration-daemon status information"""
583
+ c = ctx.obj
584
+ display_integration_daemon_status(c.integration_daemon, c.integration_daemon_url,
585
+ c.view_server, c.view_server_url,
586
+ c.userid, c.password, list, c.jupyter, c.width)
587
+
588
+
589
+ @integrations.command("targets")
590
+ @click.pass_context
591
+ @click.argument('connector', nargs=1)
592
+ def integrations_status(ctx, connector):
593
+ """Display Catalog Targets for a connector"""
594
+ c = ctx.obj
595
+ display_catalog_targets(connector, c.view_server, c.view_server_url,
596
+ c.userid, c.password, c.jupyter, c.width)
597
+
598
+
599
+ #
600
+ # Operations: Tell
601
+ #
602
+
603
+ @operations.group('tell')
604
+ @click.pass_context
605
+ def tell(ctx):
606
+ """Perform actions an Egeria Objects"""
607
+ pass
608
+
609
+
610
+ @tell.group('integration-daemon')
611
+ @click.pass_context
612
+ def integration_daemon(ctx):
613
+ """Group of commands to an integration-daemon"""
614
+ pass
615
+
616
+
617
+ @integration_daemon.command('refresh')
618
+ @click.pass_context
619
+ @click.option('--connector', default='all', help="Name of connector to refresh or 'all' to refresh all")
620
+ def refresh_connectors(ctx, connector):
621
+ """Refresh the specified integration connector or ALL connectors if not specified"""
622
+ c = ctx.obj
623
+ refresh_connector(connector, c.integration_daemon, c.integration_daemon_url,
624
+ c.userid, c.password)
625
+
626
+
627
+ @integration_daemon.command('restart')
628
+ @click.pass_context
629
+ @click.option('--connector', default='all', help="Name of connector to restart or 'all' to restart all")
630
+ def restart_connectors(ctx, connector):
631
+ """Restart the specified integration connector or ALL connectors if not specified"""
632
+ c = ctx.obj
633
+ restart_connector(connector, c.integration_daemon, c.integration_daemon_url,
634
+ c.userid, c.password)
635
+
636
+
637
+ integration_daemon.add_command(add_catalog_target)
638
+ integration_daemon.add_command(remove_catalog_target)
639
+ integration_daemon.add_command(update_catalog_target)
640
+ integration_daemon.add_command(stop_server)
641
+ integration_daemon.add_command(start_server)
642
+
643
+
644
+ @tell.group('engine-host')
645
+ @click.pass_context
646
+ def engine_host(ctx):
647
+ """Group of commands to an engine-host"""
648
+ pass
649
+
650
+
651
+ engine_host.add_command(start_engine_host)
652
+ engine_host.add_command(stop_engine_host)
653
+
654
+ tell.add_command(load_archive)
655
+
656
+
657
+
658
+
659
+ if __name__ == '__main__':
660
+ cli()
@@ -16,7 +16,8 @@ from examples.widgets.cli.ops_config import Config
16
16
 
17
17
  from examples.widgets.personal.monitor_open_todos import display_todos
18
18
  from examples.widgets.personal.monitor_my_todos import display_my_todos
19
- from examples.widgets.personal.list_my_profile import display_my_profiles
19
+ from examples.widgets.personal.list_my_profile import display_my_profile
20
+ from examples.widgets.personal.list_my_roles import display_my_roles
20
21
 
21
22
 
22
23
 
@@ -97,7 +98,19 @@ def show_my_profile(ctx):
97
98
 
98
99
  """
99
100
  c = ctx.obj
100
- display_my_profiles( c.view_server, c.view_server_url,
101
+ display_my_profile( c.view_server, c.view_server_url,
102
+ c.userid, c.password, c.jupyter, c.width)
103
+
104
+ @show.command('my-roles')
105
+ @click.pass_context
106
+ def show_my_roles(ctx):
107
+ """Display my profiles
108
+
109
+ Usage: show my-profile
110
+
111
+ """
112
+ c = ctx.obj
113
+ display_my_roles( c.view_server, c.view_server_url,
101
114
  c.userid, c.password, c.jupyter, c.width)
102
115
 
103
116
 
@@ -0,0 +1,134 @@
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 my profile
10
+ """
11
+ import os
12
+ import argparse
13
+ import time
14
+ import sys
15
+
16
+ from rich import box, print
17
+ from rich.console import Console
18
+ from rich.table import Table
19
+ from rich.tree import Tree
20
+ from rich.panel import Panel
21
+ from rich.markdown import Markdown
22
+
23
+ from pyegeria import (
24
+ InvalidParameterException,
25
+ PropertyServerException,
26
+ UserNotAuthorizedException,
27
+ print_exception_response,
28
+ )
29
+ from pyegeria.my_profile_omvs import MyProfile
30
+
31
+ disable_ssl_warnings = True
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('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
37
+ EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
38
+ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get('EGERIA_INTEGRATION_DAEMON_URL', 'https://localhost:9443')
39
+ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
40
+ EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
41
+ EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
42
+ EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
43
+ EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
44
+ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
45
+
46
+ def display_my_profile(server: str, url: str, username: str, user_pass:str,
47
+ jupyter:bool=EGERIA_JUPYTER, width:int = EGERIA_WIDTH):
48
+
49
+ try:
50
+ m_client = MyProfile(server, url, user_id=username, user_pwd=user_pass)
51
+ token = m_client.create_egeria_bearer_token(username, user_pass)
52
+ my_profiles = m_client.get_my_profile()
53
+ if type(my_profiles) is str:
54
+ print(f"No profiles found for {username}")
55
+ sys.exit(1)
56
+
57
+ console = Console(width=width, force_terminal=not jupyter, soft_wrap=True)
58
+
59
+ profile_props = my_profiles.get('profileProperties','---')
60
+ name = profile_props["fullName"]
61
+ tree = Tree(Panel(f"Profile of {name}",title = "Personal Profile"),
62
+ expanded=True,style="bright_white on black", guide_style="bold bright_blue")
63
+
64
+ profile_props_md = f"\n* GUID: {my_profiles["elementHeader"]["guid"]}\n"
65
+ if type(profile_props) is dict:
66
+ for key in profile_props.keys():
67
+ if type(profile_props[key]) is str:
68
+ profile_props_md += f"* {key}: {profile_props[key]}\n"
69
+ elif type(profile_props[key]) is dict:
70
+ p_md = '\n* Additional Details:\n'
71
+ for k in profile_props[key].keys():
72
+ p_md += f"\t* {k}: {profile_props[key][k]}\n"
73
+ profile_props_md += p_md
74
+ t1 = tree.add(Panel(Markdown(profile_props_md),title="Profile Properties"))
75
+
76
+
77
+ id_list_md=""
78
+ for identities in my_profiles["userIdentities"]:
79
+ id_list_md += f"* {identities['userIdentity']['properties']['userId']}\n"
80
+ t2 = tree.add(Panel(Markdown(id_list_md), title="Identities"))
81
+
82
+ contact_methods = my_profiles['contactMethods']
83
+ for method in contact_methods:
84
+ contact = method['properties']
85
+ contact_methods_md = ""
86
+ for key in contact.keys():
87
+ contact_methods_md += f"* {key}: {contact[key]}\n"
88
+ t3 = tree.add(Panel(Markdown(contact_methods_md), title="Contact Methods"))
89
+
90
+ my_roles = my_profiles["roles"]
91
+ table = Table(
92
+ title = f" Roles of {name}",
93
+ show_lines= True,
94
+ box=box.ROUNDED,
95
+ expand= True,
96
+ )
97
+ table.add_column("Role Type")
98
+ table.add_column("Role")
99
+ table.add_column("Role GUID")
100
+ for a_role in my_roles:
101
+ my_role_props = a_role["properties"]
102
+ role_type = my_role_props["typeName"]
103
+ role = my_role_props.get("title"," ")
104
+ role_guid = a_role["elementHeader"]["guid"]
105
+ table.add_row(
106
+ role_type, role, role_guid
107
+ )
108
+ t4 = tree.add(Panel(table, title="Roles" ),expanded=True)
109
+
110
+ print(tree)
111
+
112
+ except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
113
+ print_exception_response(e)
114
+ finally:
115
+ m_client.close_session()
116
+
117
+ def main():
118
+ parser = argparse.ArgumentParser()
119
+ parser.add_argument("--server", help="Name of the server to display status for")
120
+ parser.add_argument("--url", help="URL Platform to connect to")
121
+ parser.add_argument("--userid", help="User Id")
122
+ parser.add_argument("--password", help="User Password")
123
+
124
+ args = parser.parse_args()
125
+
126
+ server = args.server if args.server is not None else EGERIA_VIEW_SERVER
127
+ url = args.url if args.url is not None else EGERIA_PLATFORM_URL
128
+ userid = args.userid if args.userid is not None else EGERIA_USER
129
+ user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
130
+
131
+ display_my_profile(server, url, userid, user_pass)
132
+
133
+ if __name__ == "__main__":
134
+ main()
@@ -40,7 +40,7 @@ EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
40
40
  EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
41
41
  EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
42
42
 
43
- def display_my_profiles(server: str, url: str, username: str, user_pass:str,
43
+ def display_my_roles(server: str, url: str, username: str, user_pass:str,
44
44
  jupyter:bool=EGERIA_JUPYTER, width:int = EGERIA_WIDTH):
45
45
 
46
46
  m_client = MyProfile(server, url, user_id=username, user_pwd=user_pass)
@@ -128,7 +128,7 @@ def main():
128
128
  userid = args.userid if args.userid is not None else EGERIA_USER
129
129
  user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
130
130
 
131
- display_my_profiles(server, url, userid, user_pass)
131
+ display_my_roles(server, url, userid, user_pass)
132
132
 
133
133
  if __name__ == "__main__":
134
134
  main()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyegeria"
3
- version = "0.5.9.1"
3
+ version = "0.5.9.3"
4
4
  license = 'Apache 2.0'
5
5
  authors = ["Dan Wolfson <dan.wolfson@pdr-associates.com>"]
6
6
  readme = "README.md"
@@ -87,7 +87,8 @@ pytest = "^8.2.2"
87
87
  # egeria_cat_menu = "examples.widgets.cli.egeria_cat:menu"
88
88
  egeria_tech = "examples.widgets.cli.egeria_cat:cli"
89
89
  # egeria_tech_menu = "examples.widgets.cli.egeria_cat:menu"
90
- egeria_my = "examples.widgets.cli.egeria_my:cli"
90
+ egeria_per = "examples.widgets.cli.egeria_per:cli"
91
+ egeria = "examples.widgets.cli.egeria:cli"
91
92
 
92
93
  get_guid_info = "examples.widgets.tech.get_guid_info:main"
93
94
  get_tech_details = "examples.widgets.tech.get_tech_details:main"
File without changes
File without changes
File without changes