pyegeria 0.8.4.18__py3-none-any.whl → 0.8.4.19__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 (75) hide show
  1. {examples/widgets → commands}/cli/egeria.py +43 -43
  2. {examples/widgets → commands}/cli/egeria_cat.py +16 -16
  3. commands/cli/egeria_my.py +269 -0
  4. {examples/widgets → commands}/cli/egeria_ops.py +22 -23
  5. {examples/widgets → commands}/cli/egeria_tech.py +13 -13
  6. commands/ops/engine_actions.py +131 -0
  7. {examples/widgets → commands}/ops/integration_daemon_actions.py +33 -33
  8. commands/ops/refresh_integration_daemon.py +85 -0
  9. commands/ops/restart_integration_daemon.py +86 -0
  10. pyegeria/runtime_manager_omvs.py +951 -263
  11. {pyegeria-0.8.4.18.dist-info → pyegeria-0.8.4.19.dist-info}/METADATA +1 -1
  12. pyegeria-0.8.4.19.dist-info/RECORD +99 -0
  13. pyegeria-0.8.4.19.dist-info/entry_points.txt +60 -0
  14. examples/widgets/cli/egeria_my.py +0 -161
  15. examples/widgets/ops/engine_actions.py +0 -83
  16. examples/widgets/ops/refresh_integration_daemon.py +0 -73
  17. examples/widgets/ops/restart_integration_daemon.py +0 -73
  18. pyegeria-0.8.4.18.dist-info/RECORD +0 -99
  19. pyegeria-0.8.4.18.dist-info/entry_points.txt +0 -60
  20. {examples/widgets → commands}/cat/README.md +0 -0
  21. {examples/widgets → commands}/cat/__init__.py +0 -0
  22. {examples/widgets → commands}/cat/get_asset_graph.py +0 -0
  23. {examples/widgets → commands}/cat/get_collection.py +0 -0
  24. {examples/widgets → commands}/cat/get_project_dependencies.py +0 -0
  25. {examples/widgets → commands}/cat/get_project_structure.py +0 -0
  26. {examples/widgets → commands}/cat/get_tech_type_elements.py +0 -0
  27. {examples/widgets → commands}/cat/get_tech_type_template.py +0 -0
  28. {examples/widgets → commands}/cat/list_archives.py +0 -0
  29. {examples/widgets → commands}/cat/list_assets.py +0 -0
  30. {examples/widgets → commands}/cat/list_cert_types.py +0 -0
  31. {examples/widgets → commands}/cat/list_glossary.py +0 -0
  32. {examples/widgets → commands}/cat/list_projects.py +0 -0
  33. {examples/widgets → commands}/cat/list_relationships.py +0 -0
  34. {examples/widgets → commands}/cat/list_tech_types.py +0 -0
  35. {examples/widgets → commands}/cat/list_todos.py +0 -0
  36. {examples/widgets → commands}/cat/list_user_ids.py +0 -0
  37. {examples/widgets → commands}/cli/__init__.py +0 -0
  38. {examples/widgets → commands}/cli/ops_config.py +0 -0
  39. {examples/widgets → commands}/my/README.md +0 -0
  40. {examples/widgets → commands}/my/__init__.py +0 -0
  41. {examples/widgets → commands}/my/list_my_profile.py +0 -0
  42. {examples/widgets → commands}/my/list_my_roles.py +0 -0
  43. {examples/widgets → commands}/my/monitor_my_todos.py +0 -0
  44. {examples/widgets → commands}/my/monitor_open_todos.py +0 -0
  45. {examples/widgets → commands}/my/my_profile_actions.py +0 -0
  46. {examples/widgets → commands}/my/todo_actions.py +0 -0
  47. {examples/widgets → commands}/ops/README.md +0 -0
  48. {examples/widgets → commands}/ops/__init__.py +0 -0
  49. {examples/widgets → commands}/ops/list_catalog_targets.py +0 -0
  50. {examples/widgets → commands}/ops/load_archive.py +0 -0
  51. {examples/widgets → commands}/ops/monitor_asset_events.py +0 -0
  52. {examples/widgets → commands}/ops/monitor_coco_status.py +0 -0
  53. {examples/widgets → commands}/ops/monitor_engine_activity.py +0 -0
  54. {examples/widgets → commands}/ops/monitor_engine_activity_c.py +0 -0
  55. {examples/widgets → commands}/ops/monitor_gov_eng_status.py +0 -0
  56. {examples/widgets → commands}/ops/monitor_integ_daemon_status.py +0 -0
  57. {examples/widgets → commands}/ops/monitor_platform_status.py +0 -0
  58. {examples/widgets → commands}/ops/monitor_server_list.py +0 -0
  59. {examples/widgets → commands}/ops/monitor_server_status.py +0 -0
  60. {examples/widgets → commands}/tech/README.md +0 -0
  61. {examples/widgets → commands}/tech/__init__.py +0 -0
  62. {examples/widgets → commands}/tech/get_element_info.py +0 -0
  63. {examples/widgets → commands}/tech/get_guid_info.py +0 -0
  64. {examples/widgets → commands}/tech/get_tech_details.py +0 -0
  65. {examples/widgets → commands}/tech/list_asset_types.py +0 -0
  66. {examples/widgets → commands}/tech/list_elements.py +0 -0
  67. {examples/widgets → commands}/tech/list_elements_x.py +0 -0
  68. {examples/widgets → commands}/tech/list_registered_services.py +0 -0
  69. {examples/widgets → commands}/tech/list_related_specification.py +0 -0
  70. {examples/widgets → commands}/tech/list_relationship_types.py +0 -0
  71. {examples/widgets → commands}/tech/list_tech_templates.py +0 -0
  72. {examples/widgets → commands}/tech/list_valid_metadata_values.py +0 -0
  73. {examples/widgets → commands}/tech/x_list_related_elements.py +0 -0
  74. {pyegeria-0.8.4.18.dist-info → pyegeria-0.8.4.19.dist-info}/LICENSE +0 -0
  75. {pyegeria-0.8.4.18.dist-info → pyegeria-0.8.4.19.dist-info}/WHEEL +0 -0
@@ -12,66 +12,66 @@ This is an emerging capability based on the **click** package. Feedback welcome!
12
12
  import click
13
13
  from trogon import tui
14
14
 
15
- from examples.widgets.cat.get_asset_graph import asset_viewer
16
- from examples.widgets.cat.get_collection import collection_viewer
17
- from examples.widgets.cat.get_project_dependencies import project_dependency_viewer
18
- from examples.widgets.cat.get_project_structure import project_structure_viewer
19
- from examples.widgets.cat.get_tech_type_elements import tech_viewer
20
- from examples.widgets.cat.get_tech_type_template import template_viewer
21
- from examples.widgets.cat.list_assets import display_assets
22
- from examples.widgets.cat.list_cert_types import display_certifications
23
- from examples.widgets.cat.list_glossary import display_glossary_terms
24
- from examples.widgets.cat.list_projects import display_project_list
25
- from examples.widgets.cat.list_relationships import list_relationships
26
- from examples.widgets.cat.list_tech_types import display_tech_types
27
- from examples.widgets.cat.list_todos import display_to_dos as list_todos
28
- from examples.widgets.cat.list_user_ids import list_user_ids
29
- from examples.widgets.cat.list_archives import display_archive_list
30
- from examples.widgets.cli.ops_config import Config
31
- from examples.widgets.my.list_my_profile import display_my_profile
32
- from examples.widgets.my.list_my_roles import display_my_roles
33
- from examples.widgets.my.monitor_my_todos import display_my_todos
34
- from examples.widgets.my.monitor_open_todos import display_todos
35
- from examples.widgets.ops.engine_actions import (
15
+ from commands.cat.get_asset_graph import asset_viewer
16
+ from commands.cat.get_collection import collection_viewer
17
+ from commands.cat.get_project_dependencies import project_dependency_viewer
18
+ from commands.cat.get_project_structure import project_structure_viewer
19
+ from commands.cat.get_tech_type_elements import tech_viewer
20
+ from commands.cat.get_tech_type_template import template_viewer
21
+ from commands.cat.list_assets import display_assets
22
+ from commands.cat.list_cert_types import display_certifications
23
+ from commands.cat.list_glossary import display_glossary_terms
24
+ from commands.cat.list_projects import display_project_list
25
+ from commands.cat.list_relationships import list_relationships
26
+ from commands.cat.list_tech_types import display_tech_types
27
+ from commands.cat.list_todos import display_to_dos as list_todos
28
+ from commands.cat.list_user_ids import list_user_ids
29
+ from commands.cat.list_archives import display_archive_list
30
+ from commands.cli.ops_config import Config
31
+ from commands.my.list_my_profile import display_my_profile
32
+ from commands.my.list_my_roles import display_my_roles
33
+ from commands.my.monitor_my_todos import display_my_todos
34
+ from commands.my.monitor_open_todos import display_todos
35
+ from commands.ops.engine_actions import (
36
36
  start_daemon as start_engine_host,
37
37
  stop_daemon as stop_engine_host,
38
38
  )
39
- from examples.widgets.ops.integration_daemon_actions import (
39
+ from commands.ops.integration_daemon_actions import (
40
40
  add_catalog_target,
41
41
  remove_catalog_target,
42
42
  update_catalog_target,
43
43
  stop_server,
44
44
  start_server,
45
45
  )
46
- from examples.widgets.ops.list_catalog_targets import display_catalog_targets
47
- from examples.widgets.ops.load_archive import load_archive
48
- from examples.widgets.ops.monitor_engine_activity import display_engine_activity
49
- from examples.widgets.ops.monitor_engine_activity_c import display_engine_activity_c
50
- from examples.widgets.ops.monitor_gov_eng_status import display_gov_eng_status
51
- from examples.widgets.ops.monitor_integ_daemon_status import (
46
+ from commands.ops.list_catalog_targets import display_catalog_targets
47
+ from commands.ops.load_archive import load_archive
48
+ from commands.ops.monitor_engine_activity import display_engine_activity
49
+ from commands.ops.monitor_engine_activity_c import display_engine_activity_c
50
+ from commands.ops.monitor_gov_eng_status import display_gov_eng_status
51
+ from commands.ops.monitor_integ_daemon_status import (
52
52
  display_integration_daemon_status,
53
53
  )
54
- from examples.widgets.ops.monitor_platform_status import (
54
+ from commands.ops.monitor_platform_status import (
55
55
  display_status as p_display_status,
56
56
  )
57
- from examples.widgets.ops.monitor_server_list import display_status as display_list
58
- from examples.widgets.ops.monitor_server_status import (
57
+ from commands.ops.monitor_server_list import display_status as display_list
58
+ from commands.ops.monitor_server_status import (
59
59
  display_status as s_display_status,
60
60
  )
61
- from examples.widgets.ops.refresh_integration_daemon import refresh_connector
62
- from examples.widgets.ops.restart_integration_daemon import restart_connector
63
- from examples.widgets.tech.get_element_info import display_elements
64
- from examples.widgets.tech.get_guid_info import display_guid
65
- from examples.widgets.tech.get_tech_details import tech_details_viewer
66
- from examples.widgets.tech.list_asset_types import display_asset_types
67
- from examples.widgets.tech.list_elements import list_elements
68
- from examples.widgets.tech.list_registered_services import display_registered_svcs
69
- from examples.widgets.tech.list_related_specification import (
61
+ from commands.ops.refresh_integration_daemon import refresh_connector
62
+ from commands.ops.restart_integration_daemon import restart_connector
63
+ from commands.tech.get_element_info import display_elements
64
+ from commands.tech.get_guid_info import display_guid
65
+ from commands.tech.get_tech_details import tech_details_viewer
66
+ from commands.tech.list_asset_types import display_asset_types
67
+ from commands.tech.list_elements import list_elements
68
+ from commands.tech.list_registered_services import display_registered_svcs
69
+ from commands.tech.list_related_specification import (
70
70
  display_related_specification,
71
71
  )
72
- from examples.widgets.tech.list_relationship_types import display_relationship_types
73
- from examples.widgets.tech.list_tech_templates import display_templates_spec
74
- from examples.widgets.tech.list_valid_metadata_values import display_metadata_values
72
+ from commands.tech.list_relationship_types import display_relationship_types
73
+ from commands.tech.list_tech_templates import display_templates_spec
74
+ from commands.tech.list_valid_metadata_values import display_metadata_values
75
75
 
76
76
 
77
77
  @tui()
@@ -12,24 +12,24 @@ This is an emerging capability based on the **click** package. Feedback welcome!
12
12
  import click
13
13
  from trogon import tui
14
14
 
15
- from examples.widgets.cat.get_asset_graph import asset_viewer
16
- from examples.widgets.cat.get_collection import collection_viewer
17
- from examples.widgets.cat.get_tech_type_elements import tech_viewer
18
- from examples.widgets.cat.get_tech_type_template import template_viewer
19
- from examples.widgets.cat.list_assets import display_assets
20
- from examples.widgets.cat.list_glossary import display_glossary_terms
21
- from examples.widgets.cat.list_tech_types import display_tech_types
22
- from examples.widgets.cat.list_projects import display_project_list
23
- from examples.widgets.cat.list_todos import display_to_dos as list_todos
24
- from examples.widgets.cat.get_project_structure import project_structure_viewer
25
- from examples.widgets.cat.get_project_dependencies import project_dependency_viewer
26
- from examples.widgets.cat.list_cert_types import display_certifications
27
- from examples.widgets.cat.list_relationships import list_relationships
28
- from examples.widgets.cat.list_user_ids import list_user_ids
29
- from examples.widgets.cat.list_archives import display_archive_list
15
+ from commands.cat.get_asset_graph import asset_viewer
16
+ from commands.cat.get_collection import collection_viewer
17
+ from commands.cat.get_tech_type_elements import tech_viewer
18
+ from commands.cat.get_tech_type_template import template_viewer
19
+ from commands.cat.list_assets import display_assets
20
+ from commands.cat.list_glossary import display_glossary_terms
21
+ from commands.cat.list_tech_types import display_tech_types
22
+ from commands.cat.list_projects import display_project_list
23
+ from commands.cat.list_todos import display_to_dos as list_todos
24
+ from commands.cat.get_project_structure import project_structure_viewer
25
+ from commands.cat.get_project_dependencies import project_dependency_viewer
26
+ from commands.cat.list_cert_types import display_certifications
27
+ from commands.cat.list_relationships import list_relationships
28
+ from commands.cat.list_user_ids import list_user_ids
29
+ from commands.cat.list_archives import display_archive_list
30
30
 
31
31
  # from pyegeria import ServerOps
32
- from examples.widgets.cli.ops_config import Config
32
+ from commands.cli.ops_config import Config
33
33
 
34
34
 
35
35
  # class Config(object):
@@ -0,0 +1,269 @@
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 - of individual relevance
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 commands.cli.ops_config import Config
16
+
17
+ from commands.my.monitor_open_todos import display_todos
18
+ from commands.my.monitor_my_todos import display_my_todos
19
+ from commands.my.list_my_profile import display_my_profile
20
+ from commands.my.list_my_roles import display_my_roles
21
+ from commands.my.todo_actions import (
22
+ create_todo,
23
+ delete_todo,
24
+ change_todo_status,
25
+ mark_todo_complete,
26
+ reassign_todo,
27
+ )
28
+
29
+
30
+ # class Config(object):
31
+ # def __init__(self, server: str = None, url: str = None, userid:str = None, password:str = None,
32
+ # timeout:int = 30, paging: bool = False):
33
+ # self.server = server
34
+ # self.url = url
35
+ # self.userid = userid
36
+ # self.password = password
37
+ # self.timeout = timeout
38
+ # self.paging = paging
39
+ #
40
+ #
41
+ # pass_config = click.make_pass_decorator(Config)
42
+
43
+
44
+ @tui()
45
+ # @tui('menu', 'menu', 'A textual command line interface')
46
+ @click.version_option("0.0.1", prog_name="egeria_ops")
47
+ @click.group()
48
+ @click.option(
49
+ "--server",
50
+ default="active-metadata-store",
51
+ envvar="EGERIA_METADATA_STORE",
52
+ help="Egeria metadata store to work with",
53
+ )
54
+ @click.option(
55
+ "--url",
56
+ default="https://localhost:9443",
57
+ envvar="EGERIA_PLATFORM_URL",
58
+ help="URL of Egeria metadata store platform to connect to",
59
+ )
60
+ @click.option(
61
+ "--integration-daemon",
62
+ default="integration-daemon",
63
+ envvar="EGERIA_INTEGRATION_DAEMON",
64
+ help="Egeria integration daemon to work with",
65
+ )
66
+ @click.option(
67
+ "--integration_daemon_url",
68
+ default="https://localhost:9443",
69
+ envvar="EGERIA_INTEGRATION_DAEMON_URL",
70
+ help="URL of Egeria integration daemon platform to connect to",
71
+ )
72
+ @click.option(
73
+ "--view_server",
74
+ default="view-server",
75
+ envvar="EGERIA_VIEW_SERVER",
76
+ help="Egeria view server to work with",
77
+ )
78
+ @click.option(
79
+ "--view_server_url",
80
+ default="https://localhost:9443",
81
+ envvar="EGERIA_VIEW_SERVER_URL",
82
+ help="URL of Egeria view server platform to connect to",
83
+ )
84
+ @click.option(
85
+ "--engine_host",
86
+ default="engine-host",
87
+ envvar="EGERIA_ENGINE_HOST",
88
+ help="Egeria engine host to work with",
89
+ )
90
+ @click.option(
91
+ "--engine_host_url",
92
+ default="https://localhost:9443",
93
+ envvar="EGERIA_ENGINE_HOST_URL",
94
+ help="URL of Egeria engine host platform to connect to",
95
+ )
96
+ @click.option(
97
+ "--admin_user",
98
+ default="garygeeke",
99
+ envvar="EGERIA_ADMIN_USER",
100
+ help="Egeria admin user",
101
+ )
102
+ @click.option(
103
+ "--admin_user_password",
104
+ default="secret",
105
+ envvar="EGERIA_ADMIN_PASSWORD",
106
+ help="Egeria admin password",
107
+ )
108
+ @click.option(
109
+ "--userid", default="erinoverview", envvar="EGERIA_USER", help="Egeria user"
110
+ )
111
+ @click.option(
112
+ "--password",
113
+ default="secret",
114
+ envvar="EGERIA_PASSWORD",
115
+ help="Egeria user password",
116
+ )
117
+ @click.option("--timeout", default=60, help="Number of seconds to wait")
118
+ @click.option("--verbose", is_flag=True, default=False, help="Enable verbose mode")
119
+ @click.option(
120
+ "--paging",
121
+ is_flag=True,
122
+ default=False,
123
+ help="Enable paging snapshots vs live updates",
124
+ )
125
+ @click.option(
126
+ "--jupyter",
127
+ is_flag=True,
128
+ default=False,
129
+ envvar="EGERIA_JUPYTER",
130
+ help="Enable for rendering in a Jupyter terminal",
131
+ )
132
+ @click.option(
133
+ "--width",
134
+ default=200,
135
+ envvar="EGERIA_WIDTH",
136
+ help="Screen width, in characters, to use",
137
+ )
138
+ @click.pass_context
139
+ def cli(
140
+ ctx,
141
+ server,
142
+ url,
143
+ view_server,
144
+ view_server_url,
145
+ integration_daemon,
146
+ integration_daemon_url,
147
+ engine_host,
148
+ engine_host_url,
149
+ admin_user,
150
+ admin_user_password,
151
+ userid,
152
+ password,
153
+ timeout,
154
+ paging,
155
+ verbose,
156
+ jupyter,
157
+ width,
158
+ ):
159
+ """An Egeria Command Line interface for Operations"""
160
+ ctx.obj = Config(
161
+ server,
162
+ url,
163
+ view_server,
164
+ view_server_url,
165
+ integration_daemon,
166
+ integration_daemon_url,
167
+ engine_host,
168
+ engine_host_url,
169
+ admin_user,
170
+ admin_user_password,
171
+ userid,
172
+ password,
173
+ timeout,
174
+ paging,
175
+ verbose,
176
+ jupyter,
177
+ width,
178
+ )
179
+ ctx.max_content_width = 200
180
+ ctx.ensure_object(Config)
181
+ if verbose:
182
+ click.echo(f"we are in verbose mode - server is {server}")
183
+
184
+
185
+ @cli.group("show")
186
+ @click.pass_context
187
+ def show(ctx):
188
+ """Display an Egeria Object"""
189
+ pass
190
+
191
+
192
+ @show.command("my-profile")
193
+ @click.pass_context
194
+ def show_my_profile(ctx):
195
+ """Display my profiles
196
+
197
+ Usage: show my-profile
198
+
199
+ """
200
+ c = ctx.obj
201
+ display_my_profile(
202
+ c.view_server, c.view_server_url, c.userid, c.password, c.jupyter, c.width
203
+ )
204
+
205
+
206
+ @show.command("my-roles")
207
+ @click.pass_context
208
+ def show_my_roles(ctx):
209
+ """Display my profiles
210
+
211
+ Usage: show my-profile
212
+
213
+ """
214
+ c = ctx.obj
215
+ display_my_roles(
216
+ c.view_server, c.view_server_url, c.userid, c.password, c.jupyter, c.width
217
+ )
218
+
219
+
220
+ @show.command("my-to-dos")
221
+ @click.pass_context
222
+ def show_my_todos(ctx):
223
+ """Show my To-Dos
224
+
225
+ Usage: show my-to-dos
226
+
227
+ """
228
+ c = ctx.obj
229
+ display_my_todos(
230
+ c.view_server, c.view_server_url, c.userid, c.password, c.jupyter, c.width
231
+ )
232
+
233
+
234
+ @show.command("open-to-dos")
235
+ @click.pass_context
236
+ def show_open_todos(ctx):
237
+ """Display a live status view of Egeria servers for the specified Egeria platform
238
+
239
+ Usage: show tech-details <tech-name>
240
+
241
+ tech-name is a valid technology name (see 'show tech-types')
242
+ """
243
+ c = ctx.obj
244
+ display_todos(
245
+ c.view_server, c.view_server_url, c.userid, c.password, c.jupyter, c.width
246
+ )
247
+
248
+
249
+ #
250
+ # Tell
251
+ #
252
+
253
+
254
+ @cli.group("tell")
255
+ @click.pass_context
256
+ def tell(ctx):
257
+ """Perform actions an Egeria Objects"""
258
+ pass
259
+
260
+
261
+ tell.add_command(create_todo)
262
+ tell.add_command(delete_todo)
263
+ tell.add_command(change_todo_status)
264
+ tell.add_command(mark_todo_complete)
265
+ tell.add_command(reassign_todo)
266
+
267
+
268
+ if __name__ == "__main__":
269
+ cli()
@@ -13,36 +13,34 @@ import click
13
13
  from trogon import tui
14
14
 
15
15
  # from pyegeria import ServerOps
16
- from examples.widgets.cli.ops_config import Config
17
- from examples.widgets.ops.engine_actions import (
18
- start_daemon as start_engine_host,
19
- stop_daemon as stop_engine_host,
16
+ from commands.cli.ops_config import Config
17
+ from commands.ops.engine_actions import (
18
+ start_server,
19
+ stop_server,
20
+ refresh_gov_eng_config,
20
21
  )
21
- from examples.widgets.ops.integration_daemon_actions import (
22
+ from commands.ops.integration_daemon_actions import (
22
23
  add_catalog_target,
23
24
  remove_catalog_target,
24
25
  update_catalog_target,
25
- stop_server,
26
- start_server,
27
26
  )
28
- from examples.widgets.ops.list_catalog_targets import display_catalog_targets
29
- from examples.widgets.ops.load_archive import load_archive
30
- from examples.widgets.ops.monitor_engine_activity import display_engine_activity
31
- from examples.widgets.ops.monitor_engine_activity_c import display_engine_activity_c
32
- from examples.widgets.ops.monitor_gov_eng_status import display_gov_eng_status
33
- from examples.widgets.ops.monitor_integ_daemon_status import (
27
+ from commands.ops.list_catalog_targets import display_catalog_targets
28
+ from commands.ops.load_archive import load_archive
29
+ from commands.ops.monitor_engine_activity import display_engine_activity
30
+ from commands.ops.monitor_engine_activity_c import display_engine_activity_c
31
+ from commands.ops.monitor_gov_eng_status import display_gov_eng_status
32
+ from commands.ops.monitor_integ_daemon_status import (
34
33
  display_integration_daemon_status,
35
34
  )
36
- from examples.widgets.ops.monitor_platform_status import (
35
+ from commands.ops.monitor_platform_status import (
37
36
  display_status as p_display_status,
38
37
  )
39
- from examples.widgets.ops.monitor_server_list import display_status as display_list
40
- from examples.widgets.ops.monitor_server_status import (
38
+ from commands.ops.monitor_server_list import display_status as display_list
39
+ from commands.ops.monitor_server_status import (
41
40
  display_status as s_display_status,
42
41
  )
43
- from examples.widgets.ops.refresh_integration_daemon import refresh_connector
44
- from examples.widgets.ops.restart_integration_daemon import restart_connector
45
-
42
+ from commands.ops.refresh_integration_daemon import refresh_connector
43
+ from commands.ops.restart_integration_daemon import restart_connector
46
44
 
47
45
  # class Config(object):
48
46
  # def __init__(self, server: str = None, url: str = None, userid:str = None, password:str = None,
@@ -379,6 +377,10 @@ def tell(ctx):
379
377
  pass
380
378
 
381
379
 
380
+ tell.add_command(start_server)
381
+ tell.add_command(stop_server)
382
+
383
+
382
384
  @tell.group("integration-daemon")
383
385
  @click.pass_context
384
386
  def integration_daemon(ctx):
@@ -419,8 +421,6 @@ def restart_connectors(ctx, connector):
419
421
  integration_daemon.add_command(add_catalog_target)
420
422
  integration_daemon.add_command(remove_catalog_target)
421
423
  integration_daemon.add_command(update_catalog_target)
422
- integration_daemon.add_command(stop_server)
423
- integration_daemon.add_command(start_server)
424
424
 
425
425
 
426
426
  @tell.group("engine-host")
@@ -430,8 +430,7 @@ def engine_host(ctx):
430
430
  pass
431
431
 
432
432
 
433
- engine_host.add_command(start_engine_host)
434
- engine_host.add_command(stop_engine_host)
433
+ engine_host.add_command(refresh_gov_eng_config)
435
434
 
436
435
 
437
436
  @tell.group("repository")
@@ -12,19 +12,19 @@ This is an emerging capability based on the **click** package. Feedback welcome!
12
12
  import click
13
13
  from trogon import tui
14
14
 
15
- from examples.widgets.cat.list_tech_types import display_tech_types
16
- from examples.widgets.cli.ops_config import Config
17
- from examples.widgets.tech.get_guid_info import display_guid
18
- from examples.widgets.tech.get_tech_details import tech_details_viewer
19
- from examples.widgets.tech.list_asset_types import display_asset_types
20
- from examples.widgets.tech.list_registered_services import display_registered_svcs
21
- from examples.widgets.tech.list_relationship_types import display_relationship_types
22
- from examples.widgets.tech.list_tech_templates import display_templates_spec
23
- from examples.widgets.tech.list_valid_metadata_values import display_metadata_values
24
- from examples.widgets.cat.get_tech_type_template import template_viewer
25
- from examples.widgets.tech.list_elements import list_elements
26
- from examples.widgets.tech.get_element_info import display_elements
27
- from examples.widgets.tech.list_related_specification import (
15
+ from commands.cat.list_tech_types import display_tech_types
16
+ from commands.cli.ops_config import Config
17
+ from commands.tech.get_guid_info import display_guid
18
+ from commands.tech.get_tech_details import tech_details_viewer
19
+ from commands.tech.list_asset_types import display_asset_types
20
+ from commands.tech.list_registered_services import display_registered_svcs
21
+ from commands.tech.list_relationship_types import display_relationship_types
22
+ from commands.tech.list_tech_templates import display_templates_spec
23
+ from commands.tech.list_valid_metadata_values import display_metadata_values
24
+ from commands.cat.get_tech_type_template import template_viewer
25
+ from commands.tech.list_elements import list_elements
26
+ from commands.tech.get_element_info import display_elements
27
+ from commands.tech.list_related_specification import (
28
28
  display_related_specification,
29
29
  )
30
30
 
@@ -0,0 +1,131 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+
6
+
7
+ Execute engine actions.
8
+
9
+ """
10
+ import os
11
+
12
+ import click
13
+
14
+ from commands.ops.monitor_engine_activity import EGERIA_ENGINE_HOST
15
+
16
+ # from ops_config import Config, pass_config
17
+ from pyegeria import EgeriaTech
18
+ from pyegeria._exceptions import (
19
+ InvalidParameterException,
20
+ PropertyServerException,
21
+ print_exception_response,
22
+ )
23
+
24
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
25
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
26
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
27
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
28
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
29
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
30
+ )
31
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
32
+ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
33
+ "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
34
+ )
35
+
36
+ EGERIA_USER = os.environ.get("EGERIA_USER", "garygeeke")
37
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
38
+
39
+
40
+ @click.command("stop")
41
+ @click.option("--server", help="OMAG Server to stop")
42
+ @click.option(
43
+ "--view-server", default=EGERIA_VIEW_SERVER, help="View Server to communicate with"
44
+ )
45
+ @click.option(
46
+ "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
47
+ )
48
+ @click.option("--userid", default="garygeeke", envvar="EGERIA_USER", help="Egeria user")
49
+ @click.option(
50
+ "--password",
51
+ default="secret",
52
+ envvar="EGERIA_PASSWORD",
53
+ help="Egeria user password",
54
+ )
55
+ def stop_server(view_server, server, url, userid, password):
56
+ """Stop an engine-host daemon"""
57
+ p_client = EgeriaTech(view_server, url, userid, password)
58
+ token = p_client.create_egeria_bearer_token()
59
+ try:
60
+ server_guid = p_client.get_guid_for_name(server)
61
+
62
+ p_client.shutdown_server(server_guid)
63
+ click.echo(f"Stopped server {server}")
64
+ except (InvalidParameterException, PropertyServerException) as e:
65
+ print_exception_response(e)
66
+ finally:
67
+ p_client.close_session()
68
+
69
+
70
+ @click.command("start")
71
+ @click.option("--server", help="OMAG Server to start")
72
+ @click.option(
73
+ "--view-server", default=EGERIA_VIEW_SERVER, help="View Server to communicate with"
74
+ )
75
+ @click.option(
76
+ "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
77
+ )
78
+ @click.option("--userid", default="garygeeke", envvar="EGERIA_USER", help="Egeria user")
79
+ @click.option(
80
+ "--password",
81
+ default="secret",
82
+ envvar="EGERIA_PASSWORD",
83
+ help="Egeria user password",
84
+ )
85
+ def start_server(view_server, server, url, userid, password):
86
+ """Start or restart an engine-host from its known configuration"""
87
+ p_client = EgeriaTech(view_server, url, userid, password)
88
+ token = p_client.create_egeria_bearer_token()
89
+ try:
90
+ server_guid = p_client.get_guid_for_name(server)
91
+ p_client.activate_server_with_stored_config(server_guid)
92
+
93
+ click.echo(f"Started server {server}")
94
+
95
+ except (InvalidParameterException, PropertyServerException) as e:
96
+ print_exception_response(e)
97
+ finally:
98
+ p_client.close_session()
99
+
100
+
101
+ @click.command("refresh-gov-eng-config")
102
+ @click.option(
103
+ "--engine-host", default=EGERIA_ENGINE_HOST, help="Engine Host to refresh"
104
+ )
105
+ @click.option(
106
+ "--view-server", default=EGERIA_VIEW_SERVER, help="View Server to communicate with"
107
+ )
108
+ @click.option(
109
+ "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
110
+ )
111
+ @click.option("--userid", default="garygeeke", envvar="EGERIA_USER", help="Egeria user")
112
+ @click.option(
113
+ "--password",
114
+ default="secret",
115
+ envvar="EGERIA_PASSWORD",
116
+ help="Egeria user password",
117
+ )
118
+ def refresh_gov_eng_config(engine_host, view_server, url, userid, password):
119
+ """Start or restart an engine-host from its known configuration"""
120
+ p_client = EgeriaTech(view_server, url, userid, password)
121
+ token = p_client.create_egeria_bearer_token()
122
+ try:
123
+ engine_host_guid = p_client.get_guid_for_name(engine_host)
124
+ p_client.refresh_gov_eng_config(engine_host_guid)
125
+
126
+ click.echo(f"Refreshed server {engine_host}")
127
+
128
+ except (InvalidParameterException, PropertyServerException) as e:
129
+ print_exception_response(e)
130
+ finally:
131
+ p_client.close_session()