pyegeria 0.5.8.13__tar.gz → 0.5.8.16__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 (75) hide show
  1. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/PKG-INFO +1 -1
  2. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/cli/egeria_ops.py +72 -54
  3. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/cli/ops_config.py +3 -1
  4. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/list_catalog_targets.py +20 -15
  5. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/monitor_asset_events.py +2 -1
  6. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/monitor_engine_activity.py +12 -7
  7. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/monitor_gov_eng_status.py +19 -17
  8. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/monitor_integ_daemon_status.py +21 -16
  9. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/monitor_platform_status.py +25 -22
  10. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/monitor_server_list.py +20 -25
  11. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/monitor_server_status.py +11 -9
  12. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyproject.toml +1 -1
  13. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/LICENSE +0 -0
  14. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/README.md +0 -0
  15. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/doc_samples/Create_Collection_Sample.py +0 -0
  16. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
  17. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/catalog_user/README.md +0 -0
  18. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/catalog_user/__init__.py +0 -0
  19. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/catalog_user/get_asset_graph.py +0 -0
  20. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/catalog_user/get_collection.py +0 -0
  21. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/catalog_user/get_tech_type_elements.py +0 -0
  22. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/catalog_user/get_tech_type_template.py +0 -0
  23. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/catalog_user/list_assets.py +0 -0
  24. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/catalog_user/list_glossary.py +0 -0
  25. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/cli/__init__.py +0 -0
  26. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/developer/README.md +0 -0
  27. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/developer/__init__.py +0 -0
  28. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/developer/get_guid_info.py +0 -0
  29. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/developer/get_tech_details.py +0 -0
  30. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/developer/list_asset_types.py +0 -0
  31. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/developer/list_registered_services.py +0 -0
  32. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/developer/list_relationship_types.py +0 -0
  33. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/developer/list_tech_templates.py +0 -0
  34. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/developer/list_tech_types.py +0 -0
  35. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/developer/list_valid_metadata_values.py +0 -0
  36. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/README.md +0 -0
  37. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/__init__.py +0 -0
  38. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/engine_actions.py +0 -0
  39. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/integration_daemon_actions.py +0 -0
  40. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/load_archive.py +0 -0
  41. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/monitor_coco_status.py +0 -0
  42. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/refresh_integration_daemon.py +0 -0
  43. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/operational/restart_integration_daemon.py +0 -0
  44. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/personal_organizer/README.md +0 -0
  45. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/personal_organizer/__init__.py +0 -0
  46. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/personal_organizer/list_my_profile.py +0 -0
  47. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/personal_organizer/list_projects.py +0 -0
  48. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/personal_organizer/list_todos.py +0 -0
  49. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/personal_organizer/monitor_my_todos.py +0 -0
  50. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/examples/widgets/personal_organizer/monitor_open_todos.py +0 -0
  51. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/Xfeedback_manager_omvs.py +0 -0
  52. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/Xloaded_resources_omvs.py +0 -0
  53. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/__init__.py +0 -0
  54. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/_client.py +0 -0
  55. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/_deprecated_gov_engine.py +0 -0
  56. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/_exceptions.py +0 -0
  57. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/_globals.py +0 -0
  58. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/_validators.py +0 -0
  59. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/action_author_omvs.py +0 -0
  60. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/asset_catalog_omvs.py +0 -0
  61. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/automated_curation_omvs.py +0 -0
  62. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/collection_manager_omvs.py +0 -0
  63. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/core_omag_server_config.py +0 -0
  64. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/create_tech_guid_lists.py +0 -0
  65. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/full_omag_server_config.py +0 -0
  66. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/glossary_browser_omvs.py +0 -0
  67. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/glossary_manager_omvs.py +0 -0
  68. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/my_profile_omvs.py +0 -0
  69. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/platform_services.py +0 -0
  70. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/project_manager_omvs.py +0 -0
  71. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/registered_info.py +0 -0
  72. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/runtime_manager_omvs.py +0 -0
  73. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/server_operations.py +0 -0
  74. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/pyegeria/utils.py +0 -0
  75. {pyegeria-0.5.8.13 → pyegeria-0.5.8.16}/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.8.13
3
+ Version: 0.5.8.16
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -11,20 +11,22 @@ This is an emerging capability based on the **click** package. Feedback welcome!
11
11
  """
12
12
  import click
13
13
  from trogon import tui
14
+
14
15
  # from pyegeria import ServerOps
15
16
  from examples.widgets.cli.ops_config import Config
17
+ from examples.widgets.operational.integration_daemon_actions import (add_catalog_target, remove_catalog_target,
18
+ update_catalog_target, stop_server, start_server)
19
+ from examples.widgets.operational.list_catalog_targets import display_catalog_targets
20
+ from examples.widgets.operational.monitor_engine_activity import display_engine_activity
16
21
  from examples.widgets.operational.monitor_gov_eng_status import display_gov_eng_status
17
- from examples.widgets.operational.monitor_server_status import display_status as s_display_status
18
- from examples.widgets.operational.monitor_server_list import display_status as display_list
19
22
  from examples.widgets.operational.monitor_integ_daemon_status import display_integration_daemon_status
20
23
  from examples.widgets.operational.monitor_platform_status import display_status as p_display_status
21
- from examples.widgets.operational.monitor_engine_activity import display_engine_activity
24
+ from examples.widgets.operational.monitor_server_list import display_status as display_list
25
+ from examples.widgets.operational.monitor_server_status import display_status as s_display_status
22
26
  from examples.widgets.operational.refresh_integration_daemon import refresh_connector
23
27
  from examples.widgets.operational.restart_integration_daemon import restart_connector
24
- from examples.widgets.operational.integration_daemon_actions import (add_catalog_target,remove_catalog_target,
25
- update_catalog_target, stop_server, start_server)
26
28
 
27
- from examples.widgets.operational.list_catalog_targets import display_catalog_targets
29
+
28
30
  # class Config(object):
29
31
  # def __init__(self, server: str = None, url: str = None, userid:str = None, password:str = None,
30
32
  # timeout:int = 30, paging: bool = False):
@@ -42,39 +44,43 @@ from examples.widgets.operational.list_catalog_targets import display_catalog_ta
42
44
  @tui()
43
45
  @click.version_option("0.0.1", prog_name="egeria_ops")
44
46
  @click.group()
45
- @click.option('--server', default = 'active-metadata-store', envvar = 'EGERIA_METADATA_STORE',
47
+ @click.option('--server', default='active-metadata-store', envvar='EGERIA_METADATA_STORE',
46
48
  help='Egeria metadata store to work with')
47
- @click.option('--url', default = 'https://localhost:9443', envvar= 'EGERIA_PLATFORM_URL',
49
+ @click.option('--url', default='https://localhost:9443', envvar='EGERIA_PLATFORM_URL',
48
50
  help='URL of Egeria metadata store platform to connect to')
49
- @click.option('--integration-daemon', default = 'integration-daemon', envvar = 'EGERIA_INTEGRATION_DAEMON',
51
+ @click.option('--integration-daemon', default='integration-daemon', envvar='EGERIA_INTEGRATION_DAEMON',
50
52
  help='Egeria integration daemon to work with')
51
- @click.option('--integration_daemon_url', default = 'https://localhost:9443', envvar= 'EGERIA_INTEGRATION_DAEMON_URL',
53
+ @click.option('--integration_daemon_url', default='https://localhost:9443', envvar='EGERIA_INTEGRATION_DAEMON_URL',
52
54
  help='URL of Egeria integration daemon platform to connect to')
53
- @click.option('--view_server', default = 'view-server', envvar = 'EGERIA_VIEW_SERVER',
55
+ @click.option('--view_server', default='view-server', envvar='EGERIA_VIEW_SERVER',
54
56
  help='Egeria view server to work with')
55
- @click.option('--view_server_url', default = 'https://localhost:9443', envvar= 'EGERIA_VIEW_SERVER_URL',
57
+ @click.option('--view_server_url', default='https://localhost:9443', envvar='EGERIA_VIEW_SERVER_URL',
56
58
  help='URL of Egeria view server platform to connect to')
57
- @click.option('--engine_host', default = 'engine-host', envvar = 'EGERIA_ENGINE_HOST',
59
+ @click.option('--engine_host', default='engine-host', envvar='EGERIA_ENGINE_HOST',
58
60
  help='Egeria engine host to work with')
59
- @click.option('--engine_host_url', default = 'https://localhost:9443', envvar= 'EGERIA_ENGINE_HOST_URL',
61
+ @click.option('--engine_host_url', default='https://localhost:9443', envvar='EGERIA_ENGINE_HOST_URL',
60
62
  help='URL of Egeria engine host platform to connect to')
61
- @click.option('--admin_user', default = 'garygeeke', envvar = 'EGERIA_ADMIN_USER', help='Egeria admin user')
62
- @click.option('--admin_user_password', default = 'secret', envvar = 'EGERIA_ADMIN_PASSWORD',
63
+ @click.option('--admin_user', default='garygeeke', envvar='EGERIA_ADMIN_USER', help='Egeria admin user')
64
+ @click.option('--admin_user_password', default='secret', envvar='EGERIA_ADMIN_PASSWORD',
63
65
  help='Egeria admin password')
64
- @click.option('--userid', default = 'garygeeke', envvar = 'EGERIA_USER', help='Egeria user')
65
- @click.option('--password', default = 'secret', envvar = 'EGERIA_PASSWORD',
66
+ @click.option('--userid', default='garygeeke', envvar='EGERIA_USER', help='Egeria user')
67
+ @click.option('--password', default='secret', envvar='EGERIA_PASSWORD',
66
68
  help='Egeria user password')
67
- @click.option('--timeout', default = 60, help = 'Number of seconds to wait')
68
- @click.option('--verbose', is_flag = True, default = False, help = 'Enable verbose mode')
69
- @click.option('--paging', is_flag = True, default = False, help = 'Enable paging snapshots vs live updates')
69
+ @click.option('--timeout', default=60, help='Number of seconds to wait')
70
+ @click.option('--verbose', is_flag=True, default=False, help='Enable verbose mode')
71
+ @click.option('--paging', is_flag=True, default=False, help='Enable paging snapshots vs live updates')
72
+ @click.option('--jupyter', is_flag=True, default=False, envvar='EGERIA_JUPYTER',
73
+ help='Enable for rendering in a Jupyter terminal')
74
+ @click.option('--width', default=200, envvar='EGERIA_WIDTH', help='Screen width, in characters, to use')
70
75
  @click.pass_context
71
76
  def cli(ctx, server, url, view_server, view_server_url, integration_daemon, integration_daemon_url,
72
- engine_host, engine_host_url, admin_user, admin_user_password, userid, password, timeout, paging, verbose):
77
+ engine_host, engine_host_url, admin_user, admin_user_password, userid, password, timeout, paging,
78
+ verbose, jupyter, width):
73
79
  """An Egeria Command Line interface for Operations """
74
80
  ctx.obj = Config(server, url, view_server, view_server_url, integration_daemon,
75
81
  integration_daemon_url, engine_host, engine_host_url,
76
- admin_user, admin_user_password,userid, password,
77
- timeout, paging, verbose)
82
+ admin_user, admin_user_password, userid, password,
83
+ timeout, paging, verbose, jupyter, width)
78
84
  ctx.max_content_width = 200
79
85
  ctx.ensure_object(Config)
80
86
  if verbose:
@@ -87,19 +93,21 @@ def show(ctx):
87
93
  """Display an Egeria Object"""
88
94
  pass
89
95
 
96
+
90
97
  @show.group('platforms')
91
98
  @click.pass_context
92
99
  def show_platform(ctx):
93
100
  """Group of commands to show information about Egeria platforms"""
94
101
  pass
95
102
 
103
+
96
104
  @show_platform.command('status')
97
105
  @click.pass_context
98
106
  def show_platform_status(ctx):
99
107
  """Display a live status view of known platforms"""
100
108
  c = ctx.obj
101
- p_display_status(c.view_server,c.view_server_url,
102
- c.admin_user,c.admin_user_password)
109
+ p_display_status(c.view_server, c.view_server_url,
110
+ c.admin_user, c.admin_user_password)
103
111
 
104
112
 
105
113
  @show.group("servers")
@@ -108,16 +116,19 @@ def show_server(ctx):
108
116
  """Group of commands to show information about Egeria servers"""
109
117
  pass
110
118
 
119
+
111
120
  @show_server.command('status')
112
- @click.option('--full', is_flag=True, default = False, help='If True, full server descriptions will be shown')
121
+ @click.option('--full', is_flag=True, default=False, help='If True, full server descriptions will be shown')
113
122
  @click.pass_context
114
123
  def show_server_status(ctx, full):
115
124
  """Display a live status view of Egeria servers for the specified Egeria platform"""
116
125
  c = ctx.obj
117
126
  if full:
118
- display_list(c.metadata_store, c.metadata_store_url, c.admin_user,c.admin_user_password)
127
+ display_list(c.metadata_store, c.metadata_store_url, c.admin_user, c.admin_user_password, c.jupyter, c.width)
119
128
  else:
120
- s_display_status(c.metadata_store, c.metadata_store_url, c.admin_user,c.admin_user_password)
129
+ s_display_status(c.metadata_store, c.metadata_store_url, c.admin_user, c.admin_user_password, c.jupyter,
130
+ c.width)
131
+
121
132
 
122
133
  @show.group("engines")
123
134
  @click.pass_context
@@ -125,25 +136,27 @@ def engine_host(ctx):
125
136
  """Group of commands to show information about Egeria engines"""
126
137
  pass
127
138
 
139
+
128
140
  @engine_host.command("status")
129
- @click.option('--list', is_flag=True, default = False, help='If True, a paged list will be shown')
141
+ @click.option('--list', is_flag=True, default=False, help='If True, a paged list will be shown')
130
142
  @click.pass_context
131
- def gov_eng_status(ctx,list):
143
+ def gov_eng_status(ctx, list):
132
144
  """Display engine-host status information"""
133
145
  c = ctx.obj
134
146
  display_gov_eng_status(c.engine_host, c.engine_host_url,
135
- c.userid, c.password,
136
- list)
147
+ c.userid, c.password,
148
+ list, c.jupyter, c.width)
149
+
137
150
 
138
151
  @engine_host.command('activity')
139
- @click.option('--list', is_flag=True, default = False, help='If True, a paged list will be shown')
152
+ @click.option('--list', is_flag=True, default=False, help='If True, a paged list will be shown')
140
153
  @click.pass_context
141
- def eng_activity_status(ctx,list):
154
+ def eng_activity_status(ctx, list):
142
155
  """Show Governance Activity in engine-host"""
143
156
  c = ctx.obj
144
157
  display_engine_activity(c.view_server, c.view_server_url,
145
- c.userid, c.password,
146
- list)
158
+ c.userid, c.password,
159
+ list, c.jupyter, c.width)
147
160
 
148
161
 
149
162
  @show.group('integrations')
@@ -152,24 +165,27 @@ def integrations(ctx):
152
165
  """Group of commands to show information about Egeria integrations"""
153
166
  pass
154
167
 
168
+
155
169
  @integrations.command("status")
156
- @click.option('--list', is_flag=True, default = False, help='If True, a paged list will be shown')
170
+ @click.option('--list', is_flag=True, default=False, help='If True, a paged list will be shown')
157
171
  @click.pass_context
158
- def integrations_status(ctx,list):
172
+ def integrations_status(ctx, list):
159
173
  """Display integration-daemon status information"""
160
174
  c = ctx.obj
161
175
  display_integration_daemon_status(c.integration_daemon, c.integration_daemon_url,
162
- c.view_server, c.view_server_url,
163
- c.userid, c.password, list)
176
+ c.view_server, c.view_server_url,
177
+ c.userid, c.password, list, c.jupyter, c.width)
178
+
164
179
 
165
180
  @integrations.command("targets")
166
181
  @click.pass_context
167
- @click.argument('connector',nargs=1)
168
- def integrations_status(ctx,connector):
182
+ @click.argument('connector', nargs=1)
183
+ def integrations_status(ctx, connector):
169
184
  """Display Catalog Targets for a connector"""
170
185
  c = ctx.obj
171
186
  display_catalog_targets(connector, c.view_server, c.view_server_url,
172
- c.userid, c.password)
187
+ c.userid, c.password, c.jupyter, c.width)
188
+
173
189
 
174
190
  #
175
191
  # Tell
@@ -181,29 +197,32 @@ def tell(ctx):
181
197
  """Perform actions an Egeria Objects"""
182
198
  pass
183
199
 
200
+
184
201
  @tell.group('integration_daemon')
185
202
  @click.pass_context
186
203
  def integration_daemon(ctx):
187
204
  """Group of commands to an integration-daemon"""
188
205
  pass
189
206
 
207
+
190
208
  @integration_daemon.command('refresh')
191
209
  @click.pass_context
192
- @click.option('--connector', default = 'all', help="Name of connector to refresh or 'all' to refresh all")
193
- def refresh_connectors(ctx,connector):
210
+ @click.option('--connector', default='all', help="Name of connector to refresh or 'all' to refresh all")
211
+ def refresh_connectors(ctx, connector):
194
212
  """Refresh the specified integration connector or ALL connectors if not specified"""
195
213
  c = ctx.obj
196
- refresh_connector(connector,c.integration_daemon, c.integration_daemon_url,
197
- c.userid, c.password)
214
+ refresh_connector(connector, c.integration_daemon, c.integration_daemon_url,
215
+ c.userid, c.password)
216
+
198
217
 
199
218
  @integration_daemon.command('restart')
200
219
  @click.pass_context
201
- @click.option('--connector', default = 'all', help="Name of connector to restart or 'all' to restart all")
202
- def restart_connectors(ctx,connector):
220
+ @click.option('--connector', default='all', help="Name of connector to restart or 'all' to restart all")
221
+ def restart_connectors(ctx, connector):
203
222
  """Restart the specified integration connector or ALL connectors if not specified"""
204
223
  c = ctx.obj
205
- restart_connector(connector,c.integration_daemon, c.integration_daemon_url,
206
- c.userid, c.password)
224
+ restart_connector(connector, c.integration_daemon, c.integration_daemon_url,
225
+ c.userid, c.password)
207
226
 
208
227
 
209
228
  integration_daemon.add_command(add_catalog_target)
@@ -212,6 +231,5 @@ integration_daemon.add_command(update_catalog_target)
212
231
  integration_daemon.add_command(stop_server)
213
232
  integration_daemon.add_command(start_server)
214
233
 
215
-
216
234
  if __name__ == '__main__':
217
- cli()
235
+ cli()
@@ -8,7 +8,7 @@ class Config(object):
8
8
  engine_host: str = 'engine-host', engine_host_url: str = 'https://localhost:9443',
9
9
  admin_user: str = 'garygeeke', admin_user_password: str = 'secret',
10
10
  userid: str = None, password: str = None,
11
- timeout: int = 30, paging: bool = False, verbose: bool = False):
11
+ timeout: int = 30, paging: bool = False, verbose: bool = False, jupyter: bool = False, width:int = 200):
12
12
  self.metadata_store = server
13
13
  self.metadata_store_url = url
14
14
  self.view_server = view_server
@@ -24,6 +24,8 @@ class Config(object):
24
24
  self.timeout = timeout
25
25
  self.paging = paging
26
26
  self.verbose = verbose
27
+ self.jupyter = jupyter
28
+ self.width = width
27
29
 
28
30
 
29
31
  pass_config = click.make_pass_decorator(Config)
@@ -8,15 +8,15 @@ Unit tests for the Utils helper functions using the Pytest framework.
8
8
 
9
9
  List catalog targets
10
10
  """
11
- import os
12
11
  import argparse
12
+ import os
13
13
  import time
14
14
 
15
15
  from rich import box
16
16
  from rich.console import Console
17
- from rich.table import Table
18
- from rich.prompt import Prompt
19
17
  from rich.markdown import Markdown
18
+ from rich.prompt import Prompt
19
+ from rich.table import Table
20
20
 
21
21
  from pyegeria import (
22
22
  InvalidParameterException,
@@ -37,11 +37,12 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
37
37
  EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
38
38
  EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
39
39
  EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
40
+ EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
41
+ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
40
42
 
41
43
 
42
- def display_catalog_targets(connector:str, server: str, url: str, username: str, user_password: str):
43
-
44
-
44
+ def display_catalog_targets(connector: str, server: str, url: str, username: str, user_password: str,
45
+ jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
45
46
  def generate_table() -> Table:
46
47
  """Make a new table."""
47
48
  table = Table(
@@ -65,27 +66,26 @@ def display_catalog_targets(connector:str, server: str, url: str, username: str,
65
66
  table.add_column("Operational Instructions", max_width=15)
66
67
  # table.add_column("Delete Method")
67
68
 
68
-
69
69
  if type(cat_targets) is list:
70
70
  for target in cat_targets:
71
- target_name = target.get('catalogTargetName','---')
71
+ target_name = target.get('catalogTargetName', '---')
72
72
  target_source = target.get('metadataSourceQualifiedName', '---')
73
- target_rel = target.get('relationshipGUID','---')
73
+ target_rel = target.get('relationshipGUID', '---')
74
74
  target_sync = target.get('permittedSynchronization')
75
- target_delete = target.get('deleteMethod','---')
75
+ target_delete = target.get('deleteMethod', '---')
76
76
  op_instruct = f"* {target_sync}\n* {target_delete}"
77
77
  op_instruct_out = Markdown(op_instruct)
78
78
  # target_guid = target['catalogTargetElement']['guid']
79
79
  connector_unique = target['catalogTargetElement']['uniqueName']
80
80
 
81
- config_props = target.get('configurationProperties','---')
81
+ config_props = target.get('configurationProperties', '---')
82
82
  if type(config_props) is dict:
83
83
  config_props_md = ''
84
84
  for prop in config_props:
85
85
  config_props_md += f"* {prop}: {config_props[prop]}\n"
86
86
  config_props_out = Markdown(config_props_md)
87
87
 
88
- template_props = target.get('templateProperties','---')
88
+ template_props = target.get('templateProperties', '---')
89
89
  if type(template_props) is dict:
90
90
  template_props_md = ''
91
91
  for prop in template_props:
@@ -106,7 +106,7 @@ def display_catalog_targets(connector:str, server: str, url: str, username: str,
106
106
 
107
107
  connector_guid = INTEGRATION_GUIDS[connector]
108
108
  cat_targets = a_client.get_catalog_targets(connector_guid)
109
- console = Console(force_terminal=False, width=250)
109
+ console = Console(force_terminal=not jupyter, width=width)
110
110
  with console.pager(styles=True):
111
111
  console.print(generate_table())
112
112
 
@@ -124,6 +124,8 @@ def main():
124
124
  parser.add_argument("--url", help="URL Platform to connect to")
125
125
  parser.add_argument("--userid", help="User Id")
126
126
  parser.add_argument("--password", help="User Password")
127
+ parser.add_argument("--jupyter", help="Enable for Jupyter terminal compatibility")
128
+ parser.add_argument("--width", help="Screen width, in characters, to use")
127
129
 
128
130
  args = parser.parse_args()
129
131
 
@@ -131,13 +133,16 @@ def main():
131
133
  url = args.url if args.url is not None else EGERIA_PLATFORM_URL
132
134
  userid = args.userid if args.userid is not None else EGERIA_USER
133
135
  user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
136
+ jupyter = args.jupyter if args.jupyter is not None else EGERIA_JUPYTER
137
+ width = args.width if args.width is not None else EGERIA_WIDTH
134
138
 
135
139
  try:
136
140
  connector = Prompt.ask("Enter the Integration Connector to list catalog targets for")
137
- display_catalog_targets(connector, server, url, userid, user_pass)
141
+ display_catalog_targets(connector, server, url, userid, user_pass, jupyter)
138
142
 
139
143
  except KeyboardInterrupt:
140
144
  pass
141
145
 
146
+
142
147
  if __name__ == "__main__":
143
- main()
148
+ main()
@@ -27,7 +27,8 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
27
27
  EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
28
28
  EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
29
29
  EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
30
-
30
+ EGERIA_JUPYTER = os.environ.get('EGERIA_JUPYTER', False)
31
+ EGERIA_WIDTH = os.environ.get('EGERIA_WIDTH', 200)
31
32
 
32
33
  def main(ep: str = EGERIA_KAFKA_ENDPOINT):
33
34
 
@@ -14,11 +14,11 @@ import json
14
14
  import os
15
15
  import sys
16
16
  import time
17
- from rich import box
18
17
 
18
+ from rich import box
19
+ from rich.console import Console
19
20
  from rich.live import Live
20
21
  from rich.table import Table
21
- from rich.console import Console
22
22
 
23
23
  from pyegeria import AutomatedCuration
24
24
  from pyegeria import (
@@ -39,11 +39,14 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
39
39
  EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
40
40
  EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
41
41
  EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
42
+ EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
43
+ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
42
44
 
43
45
  disable_ssl_warnings = True
44
46
 
45
47
 
46
- def display_engine_activity(server: str, url: str, user: str, user_pass:str, paging: bool):
48
+ def display_engine_activity(server: str, url: str, user: str, user_pass: str, paging: bool,
49
+ jupyter: bool = EGERIA_JUPYTER, width=EGERIA_WIDTH):
47
50
  g_client = AutomatedCuration(server, url, user, user_pwd=user_pass)
48
51
 
49
52
  def generate_table() -> Table:
@@ -99,7 +102,7 @@ def display_engine_activity(server: str, url: str, user: str, user_pass:str, pag
99
102
  else:
100
103
  action_status = f"[red]{action['actionStatus']}"
101
104
 
102
- target= action.get("actionTargetElements", "Empty")
105
+ target = action.get("actionTargetElements", "Empty")
103
106
  if type(target) is list:
104
107
  target_element = json.dumps(target[0]["targetElement"]["elementProperties"]["propertiesAsStrings"])
105
108
  else:
@@ -109,7 +112,7 @@ def display_engine_activity(server: str, url: str, user: str, user_pass:str, pag
109
112
  completion_message = action.get("completionMessage", " ")
110
113
 
111
114
  table.add_row(
112
- requested_time, start_time, action_guid,engine_name, request_type,
115
+ requested_time, start_time, action_guid, engine_name, request_type,
113
116
  action_status, target_element, completion_time, process_name, completion_message
114
117
  )
115
118
  else:
@@ -120,7 +123,7 @@ def display_engine_activity(server: str, url: str, user: str, user_pass:str, pag
120
123
 
121
124
  try:
122
125
  if paging is True:
123
- console = Console()
126
+ console = Console(width=width, force_terminal=not jupyter)
124
127
  with console.pager():
125
128
  console.print(generate_table())
126
129
  else:
@@ -153,6 +156,7 @@ def main_live():
153
156
 
154
157
  display_engine_activity(server=server, url=url, user=userid, user_pass=user_pass, paging=False)
155
158
 
159
+
156
160
  def main_paging():
157
161
  parser = argparse.ArgumentParser()
158
162
  parser.add_argument("--server", help="Name of the server to display status for")
@@ -169,8 +173,9 @@ def main_paging():
169
173
 
170
174
  display_engine_activity(server=server, url=url, user=userid, user_pass=user_pass, paging=True)
171
175
 
176
+
172
177
  if __name__ == "__main__":
173
178
  main_live()
174
179
 
175
180
  if __name__ == "__main_paging__":
176
- main_paging()
181
+ main_paging()
@@ -8,11 +8,15 @@ Unit tests for the Utils helper functions using the Pytest framework.
8
8
 
9
9
  A simple status display for Governance Actions
10
10
  """
11
+ import argparse
12
+ import json
11
13
  import os
12
14
  import time
13
- import json
14
- import argparse
15
15
 
16
+ from rich import box
17
+ from rich.console import Console
18
+ from rich.live import Live
19
+ from rich.table import Table
16
20
 
17
21
  from pyegeria import (
18
22
  InvalidParameterException,
@@ -20,13 +24,8 @@ from pyegeria import (
20
24
  UserNotAuthorizedException,
21
25
  print_exception_response,
22
26
  )
23
- from rich.table import Table
24
- from rich.live import Live
25
- from rich import box
26
- from rich.console import Console
27
-
28
-
29
27
  from pyegeria.server_operations import ServerOps
28
+
30
29
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
31
30
  EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
32
31
  EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
@@ -38,12 +37,15 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
38
37
  EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
39
38
  EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
40
39
  EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
40
+ EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
41
+ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
41
42
 
42
- disable_ssl_warnings = True
43
43
 
44
+ disable_ssl_warnings = True
44
45
 
45
46
 
46
- def display_gov_eng_status(server: str , url: str, username: str, user_pass:str, paging:bool):
47
+ def display_gov_eng_status(server: str, url: str, username: str, user_pass: str, paging: bool,
48
+ jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
47
49
  server_name = server
48
50
  s_client = ServerOps(server_name, url, username, user_pass)
49
51
 
@@ -74,16 +76,17 @@ def display_gov_eng_status(server: str , url: str, username: str, user_pass:str,
74
76
  eng_type = engine["governanceEngineTypeName"]
75
77
 
76
78
  eng_desc = engine["governanceEngineDescription"]
77
- eng_req_type = json.dumps(engine["governanceRequestTypes"], indent = 2)
79
+ eng_req_type = json.dumps(engine["governanceRequestTypes"], indent=2)
78
80
  status = engine["governanceEngineStatus"]
79
81
  if status in ("RUNNING"):
80
82
  eng_status = f"[green]{status}"
81
83
  elif status in ("FAILED"):
82
84
  eng_status = f"[red]{status}"
83
- else: eng_status = f"[yellow]{status}"
85
+ else:
86
+ eng_status = f"[yellow]{status}"
84
87
 
85
88
  table.add_row(
86
- gov_eng, eng_type, eng_desc, eng_status,eng_req_type
89
+ gov_eng, eng_type, eng_desc, eng_status, eng_req_type
87
90
  )
88
91
 
89
92
  table.caption = f"Server {server_name} running on {url}"
@@ -91,7 +94,7 @@ def display_gov_eng_status(server: str , url: str, username: str, user_pass:str,
91
94
 
92
95
  try:
93
96
  if paging is True:
94
- console = Console()
97
+ console = Console(width=width, force_terminal=not jupyter)
95
98
  with console.pager():
96
99
  console.print(generate_table())
97
100
  else:
@@ -124,6 +127,7 @@ def main_live():
124
127
  user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
125
128
  display_gov_eng_status(server=server, url=url, username=userid, user_pass=user_pass, paging=False)
126
129
 
130
+
127
131
  def main_paging():
128
132
  parser = argparse.ArgumentParser()
129
133
  parser.add_argument("--server", help="Name of the server to display status for")
@@ -139,10 +143,8 @@ def main_paging():
139
143
  display_gov_eng_status(server=server, url=url, username=userid, user_pass=user_pass, paging=True)
140
144
 
141
145
 
142
-
143
146
  if __name__ == "__main__":
144
147
  main_live()
145
148
 
146
-
147
149
  if __name__ == "__main_paging__":
148
- main_paging()
150
+ main_paging()
@@ -8,10 +8,9 @@ A simple status display for the Integration Daemon.
8
8
 
9
9
 
10
10
  """
11
- import os
12
11
  import argparse
12
+ import os
13
13
  import time
14
- from datetime import datetime
15
14
 
16
15
  from rich import box
17
16
  from rich.console import Console
@@ -25,6 +24,7 @@ from pyegeria._exceptions import (
25
24
  UserNotAuthorizedException,
26
25
  print_exception_response,
27
26
  )
27
+
28
28
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
29
29
  EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
30
30
  EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
@@ -36,12 +36,16 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
36
36
  EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
37
37
  EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
38
38
  EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
39
+ EGERIA_JUPYTER = os.environ.get('EGERIA_JUPYTER', False)
40
+ EGERIA_WIDTH = os.environ.get('EGERIA_WIDTH', 200)
39
41
 
40
42
  disable_ssl_warnings = True
41
43
 
42
44
 
43
45
  def display_integration_daemon_status(integ_server: str, integ_url: str,
44
- view_server:str, view_url: str, user: str, user_pass:str, paging: bool):
46
+ view_server: str, view_url: str, user: str, user_pass: str, paging: bool,
47
+ jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH
48
+ ):
45
49
  s_client = ServerOps(integ_server, integ_url, user)
46
50
  a_client = AutomatedCuration(view_server, view_url, user, user_pass)
47
51
  token = a_client.create_egeria_bearer_token()
@@ -50,8 +54,8 @@ def display_integration_daemon_status(integ_server: str, integ_url: str,
50
54
  """Make a new table."""
51
55
  table = Table(
52
56
  title=f"Integration Daemon Status @ {time.asctime()}",
53
- style = "bold white on black",
54
- row_styles = ["bold white on black"],
57
+ style="bold white on black",
58
+ row_styles=["bold white on black"],
55
59
  header_style="white on dark_blue",
56
60
  title_style="bold white on black",
57
61
  caption_style="white on black",
@@ -60,20 +64,20 @@ def display_integration_daemon_status(integ_server: str, integ_url: str,
60
64
  caption=f"Integration Daemon Status for Server '{integ_server}' @ Platform - {integ_url}",
61
65
  expand=True
62
66
  )
63
- table.add_column("Connector Name", min_width = 15)
67
+ table.add_column("Connector Name", min_width=15)
64
68
  table.add_column("Status", max_width=6)
65
69
 
66
- table.add_column("Last Refresh Time", min_width = 12)
70
+ table.add_column("Last Refresh Time", min_width=12)
67
71
  table.add_column("Min Refresh (mins)", max_width=6)
68
72
  table.add_column("Target Element", min_width=20)
69
- table.add_column("Exception Message",min_width=10)
73
+ table.add_column("Exception Message", min_width=10)
70
74
 
71
75
  daemon_status = s_client.get_integration_daemon_status()
72
76
  connector_reports = daemon_status["integrationConnectorReports"]
73
77
  for connector in connector_reports:
74
78
  connector_name = connector.get("connectorName", "---")
75
79
  connector_status = connector.get("connectorStatus", "---")
76
- connector_guid = connector.get("connectorGUID","---")
80
+ connector_guid = connector.get("connectorGUID", "---")
77
81
  last_refresh_time = connector.get("lastRefreshTime", "---")[:-10]
78
82
  refresh_interval = str(connector.get("minMinutesBetweenRefresh", "---"))
79
83
  exception_msg = " "
@@ -92,7 +96,7 @@ def display_integration_daemon_status(integ_server: str, integ_url: str,
92
96
  t_unique_name = target["catalogTargetElement"]["uniqueName"]
93
97
  t_rel_guid = target["relationshipGUID"]
94
98
  # targets_m += f"* Target Name: __{t_name}__\n* Sync: {t_sync}\n* Unique Name: {t_unique_name}\n\n"
95
- tgt_tab.add_row(t_name,t_unique_name, t_rel_guid)
99
+ tgt_tab.add_row(t_name, t_unique_name, t_rel_guid)
96
100
  # targets_md = Markdown(targets_m)
97
101
  else:
98
102
  targets_md = False
@@ -118,7 +122,7 @@ def display_integration_daemon_status(integ_server: str, integ_url: str,
118
122
 
119
123
  try:
120
124
  if paging is True:
121
- console = Console()
125
+ console = Console(width=width, force_terminal=not jupyter)
122
126
  with console.pager():
123
127
  console.print(generate_table())
124
128
  else:
@@ -156,8 +160,9 @@ def main_live():
156
160
  userid = args.userid if args.userid is not None else EGERIA_USER
157
161
  user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
158
162
  display_integration_daemon_status(integ_server=integ_server, integ_url=integ_url,
159
- view_server = view_server, view_url = view_url,
160
- user=userid, user_pass = user_pass, paging = False)
163
+ view_server=view_server, view_url=view_url,
164
+ user=userid, user_pass=user_pass, paging=False)
165
+
161
166
 
162
167
  def main_paging():
163
168
  parser = argparse.ArgumentParser()
@@ -176,12 +181,12 @@ def main_paging():
176
181
  userid = args.userid if args.userid is not None else EGERIA_USER
177
182
  user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
178
183
  display_integration_daemon_status(integ_server=integ_server, integ_url=integ_url,
179
- view_server = view_server, view_url = view_url,
180
- user=userid, user_pass = user_pass, paging = True)
184
+ view_server=view_server, view_url=view_url,
185
+ user=userid, user_pass=user_pass, paging=True)
181
186
 
182
187
 
183
188
  if __name__ == "__main__":
184
189
  main_live()
185
190
 
186
191
  if __name__ == "__main_paging__":
187
- main_paging()
192
+ main_paging()
@@ -6,21 +6,21 @@ Copyright Contributors to the ODPi Egeria project.
6
6
  Display the status of cataloged platforms and servers.
7
7
  """
8
8
 
9
- import time
10
9
  import argparse
11
10
  import os
11
+ import time
12
+
13
+ from rich.console import Console
14
+ from rich.live import Live
15
+ from rich.table import Table
12
16
 
17
+ from pyegeria import RuntimeManager
13
18
  from pyegeria._exceptions import (
14
19
  InvalidParameterException,
15
20
  PropertyServerException,
16
21
  UserNotAuthorizedException,
17
22
  print_exception_response,
18
23
  )
19
- from rich.table import Table
20
- from rich.live import Live
21
- from rich.console import Console
22
-
23
- from pyegeria import RuntimeManager
24
24
 
25
25
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
26
26
  EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
@@ -33,13 +33,18 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
33
33
  EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
34
34
  EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
35
35
  EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
36
+ EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
37
+ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
36
38
 
37
39
  disable_ssl_warnings = True
38
40
  console = Console(width=200)
39
41
 
40
- def display_status(server: str, url: str, username: str, user_pass:str):
42
+
43
+ def display_status(server: str, url: str, username: str, user_pass: str, jupyter: bool = EGERIA_JUPYTER,
44
+ width: int = EGERIA_WIDTH):
41
45
  r_client = RuntimeManager(server, url, username)
42
46
  token = r_client.create_egeria_bearer_token(username, user_pass)
47
+
43
48
  def generate_table() -> Table:
44
49
  """Make a new table."""
45
50
  table = Table(
@@ -63,9 +68,9 @@ def display_status(server: str, url: str, username: str, user_pass:str):
63
68
 
64
69
  server_types = {
65
70
  "Metadata Access Store": "Store",
66
- "View Server" : "View",
67
- "Engine Host Server" : "EngineHost",
68
- "Integration Daemon" : "Integration"
71
+ "View Server": "View",
72
+ "Engine Host Server": "EngineHost",
73
+ "Integration Daemon": "Integration"
69
74
  }
70
75
 
71
76
  platform_list = r_client.get_platforms_by_type()
@@ -76,18 +81,18 @@ def display_status(server: str, url: str, username: str, user_pass:str):
76
81
  server_list = ""
77
82
  try:
78
83
  platform_report = r_client.get_platform_report(platform_guid)
79
- platform_url = platform_report.get('platformURLRoot'," ")
80
- platform_origin = platform_report.get("platformOrigin"," ")
81
- platform_started = platform_report.get("platformStartTime"," ")
84
+ platform_url = platform_report.get('platformURLRoot', " ")
85
+ platform_origin = platform_report.get("platformOrigin", " ")
86
+ platform_started = platform_report.get("platformStartTime", " ")
82
87
 
83
- servers = platform_report.get("omagservers",None)
88
+ servers = platform_report.get("omagservers", None)
84
89
 
85
90
  if servers is not None:
86
91
  for server in servers:
87
- server_name = server.get("serverName"," ")
88
- server_type = server.get("serverType"," ")
89
- server_status = server.get("serverActiveStatus","UNKNOWN")
90
- if server_status in("RUNNING", "STARTING"):
92
+ server_name = server.get("serverName", " ")
93
+ server_type = server.get("serverType", " ")
94
+ server_status = server.get("serverActiveStatus", "UNKNOWN")
95
+ if server_status in ("RUNNING", "STARTING"):
91
96
  status_flag = "[bright green]"
92
97
  elif server_status in ("INACTIVE", "STOPPING"):
93
98
  status_flag = "[bright red]"
@@ -99,17 +104,15 @@ def display_status(server: str, url: str, username: str, user_pass:str):
99
104
  server_list = server_list + serv
100
105
 
101
106
  table.add_row(platform_name, platform_url, platform_origin, platform_desc,
102
- platform_started, server_list, style = "bold white on black")
107
+ platform_started, server_list, style="bold white on black")
103
108
  except (Exception) as e:
104
109
  # console.print_exception(e)
105
110
  platform_url = " "
106
111
  platform_origin = " "
107
112
  platform_started = " "
108
113
 
109
-
110
114
  return table
111
115
 
112
-
113
116
  try:
114
117
  with Live(generate_table(), refresh_per_second=4, screen=True) as live:
115
118
  while True:
@@ -142,4 +145,4 @@ def main():
142
145
 
143
146
 
144
147
  if __name__ == "__main__":
145
- main()
148
+ main()
@@ -8,21 +8,17 @@ Unit tests for the Utils helper functions using the Pytest framework.
8
8
 
9
9
  A simple server status display
10
10
  """
11
+ import argparse
11
12
  import os
12
13
  import time
13
- import argparse
14
14
 
15
- from pyegeria._exceptions import (
16
- InvalidParameterException,
17
- PropertyServerException,
18
- UserNotAuthorizedException,
19
- print_exception_response,
20
- )
21
- from rich.table import Table
22
15
  from rich.live import Live
16
+ from rich.table import Table
23
17
 
24
- from pyegeria.server_operations import ServerOps
18
+ from pyegeria._exceptions import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException,
19
+ print_exception_response, )
25
20
  from pyegeria.core_omag_server_config import CoreServerConfig
21
+ from pyegeria.server_operations import ServerOps
26
22
 
27
23
  disable_ssl_warnings = True
28
24
 
@@ -37,24 +33,23 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
37
33
  EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
38
34
  EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
39
35
  EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
36
+ EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
37
+ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
40
38
 
41
- def display_status(server: str, url: str, username: str, user_pass:str):
39
+
40
+ def display_status(server: str, url: str, username: str, user_pass: str, jupyter: bool = EGERIA_JUPYTER,
41
+ width: int = EGERIA_WIDTH):
42
42
  p_client = ServerOps(server, url, username)
43
43
  c_client = CoreServerConfig(server, url, username, user_pass)
44
44
 
45
45
  def generate_table() -> Table:
46
46
  """Make a new table."""
47
- table = Table(
48
- title=f"Server Status for Platform - {time.asctime()}",
49
- style="bold white on black",
50
- row_styles=["bold white on black"],
51
- header_style="white on dark_blue",
52
- title_style="bold white on black",
53
- caption_style="white on black",
54
- caption=f"Server Status for Platform - '{url}'",
55
- show_lines=True,
56
- # expand=True
57
- )
47
+ table = Table(title=f"Server Status for Platform - {time.asctime()}", style="bold white on black",
48
+ row_styles=["bold white on black"], header_style="white on dark_blue",
49
+ title_style="bold white on black",
50
+ caption_style="white on black", caption=f"Server Status for Platform - '{url}'", show_lines=True,
51
+ # expand=True
52
+ )
58
53
 
59
54
  table.add_column("Known Server")
60
55
  table.add_column("Status")
@@ -73,9 +68,8 @@ def display_status(server: str, url: str, username: str, user_pass:str):
73
68
  server_type = c_client.get_server_type_classification(server)["serverTypeName"]
74
69
  description = c_client.get_basic_server_properties(server).get("localServerDescription", " ")
75
70
 
76
- table.add_row(server,
77
- "[red]Inactive" if status == "Inactive" else "[green]Active",
78
- server_type, description)
71
+ table.add_row(server, "[red]Inactive" if status == "Inactive" else "[green]Active", server_type,
72
+ description)
79
73
 
80
74
  return table
81
75
 
@@ -110,5 +104,6 @@ def main():
110
104
 
111
105
  display_status(server, url, userid, user_pass)
112
106
 
107
+
113
108
  if __name__ == "__main__":
114
- main()
109
+ main()
@@ -8,9 +8,12 @@ Unit tests for the Utils helper functions using the Pytest framework.
8
8
 
9
9
  A simple server status display
10
10
  """
11
+ import argparse
11
12
  import os
12
13
  import time
13
- import argparse
14
+
15
+ from rich.live import Live
16
+ from rich.table import Table
14
17
 
15
18
  from pyegeria import (
16
19
  InvalidParameterException,
@@ -19,8 +22,6 @@ from pyegeria import (
19
22
  print_exception_response,
20
23
  ServerOps
21
24
  )
22
- from rich.table import Table
23
- from rich.live import Live
24
25
 
25
26
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
26
27
  EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
@@ -33,8 +34,12 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
33
34
  EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
34
35
  EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
35
36
  EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
37
+ EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
38
+ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
36
39
 
37
- def display_status(server: str, url: str , username: str , user_pass:str):
40
+
41
+ def display_status(server: str, url: str, username: str, user_pass: str, jupyter: bool = EGERIA_JUPYTER,
42
+ width: int = EGERIA_WIDTH):
38
43
  p_client = ServerOps(server, url, username, user_pass)
39
44
 
40
45
  def generate_table() -> Table:
@@ -75,10 +80,6 @@ def display_status(server: str, url: str , username: str , user_pass:str):
75
80
  while True:
76
81
  time.sleep(2)
77
82
  live.update(generate_table())
78
- # services = p_client.get_server_status(server)['serverStatus']['services']
79
- # for service in services:
80
- # service_name = service['serviceName']
81
- # service_status = service['serviceStatus']
82
83
 
83
84
  except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
84
85
  print_exception_response(e)
@@ -103,5 +104,6 @@ def main():
103
104
 
104
105
  display_status(server, url, userid, user_pass)
105
106
 
107
+
106
108
  if __name__ == "__main__":
107
- main()
109
+ main()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyegeria"
3
- version = "0.5.8.13"
3
+ version = "0.5.8.16"
4
4
  license = 'Apache 2.0'
5
5
  authors = ["Dan Wolfson <dan.wolfson@pdr-associates.com>"]
6
6
  readme = "README.md"
File without changes
File without changes