pyegeria 0.8.4.20__tar.gz → 0.8.4.22__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.
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/PKG-INFO +1 -1
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cli/egeria_ops.py +11 -4
- pyegeria-0.8.4.22/commands/ops/engine_actions.py +136 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/runtime_manager_omvs.py +0 -50
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyproject.toml +1 -1
- pyegeria-0.8.4.20/commands/ops/engine_actions.py +0 -131
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/LICENSE +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/README.md +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/README.md +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/__init__.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/get_asset_graph.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/get_collection.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/get_project_dependencies.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/get_project_structure.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/get_tech_type_elements.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/get_tech_type_template.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/list_archives.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/list_assets.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/list_cert_types.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/list_glossary.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/list_projects.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/list_relationships.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/list_tech_types.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/list_todos.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cat/list_user_ids.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cli/__init__.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cli/egeria.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cli/egeria_cat.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cli/egeria_my.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cli/egeria_tech.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/cli/ops_config.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/my/README.md +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/my/__init__.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/my/list_my_profile.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/my/list_my_roles.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/my/monitor_my_todos.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/my/monitor_open_todos.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/my/my_profile_actions.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/my/todo_actions.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/README.md +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/__init__.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/integration_daemon_actions.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/list_catalog_targets.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/load_archive.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/monitor_asset_events.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/monitor_coco_status.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/monitor_engine_activity.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/monitor_engine_activity_c.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/monitor_gov_eng_status.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/monitor_integ_daemon_status.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/monitor_platform_status.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/monitor_server_list.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/monitor_server_status.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/refresh_integration_daemon.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/ops/restart_integration_daemon.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/README.md +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/__init__.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/get_element_info.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/get_guid_info.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/get_tech_details.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/list_asset_types.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/list_elements.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/list_elements_x.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/list_registered_services.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/list_related_specification.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/list_relationship_types.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/list_tech_templates.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/list_valid_metadata_values.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/commands/tech/x_list_related_elements.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/__init__.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/_client.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/_deprecated_gov_engine.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/_exceptions.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/_globals.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/_validators.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/asset_catalog_omvs.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/automated_curation_omvs.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/classification_manager_omvs.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/collection_manager_omvs.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/core_omag_server_config.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/create_tech_guid_lists.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/egeria_cat_client.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/egeria_client.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/egeria_config_client.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/egeria_my_client.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/egeria_tech_client.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/feedback_manager_omvs.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/full_omag_server_config.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/glossary_browser_omvs.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/glossary_manager_omvs.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/mermaid_utilities.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/my_profile_omvs.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/platform_services.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/project_manager_omvs.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/registered_info.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/server_operations.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/utils.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/valid_metadata_omvs.py +0 -0
- {pyegeria-0.8.4.20 → pyegeria-0.8.4.22}/pyegeria/x_action_author_omvs.py +0 -0
@@ -42,6 +42,7 @@ from commands.ops.monitor_server_status import (
|
|
42
42
|
from commands.ops.refresh_integration_daemon import refresh_connector
|
43
43
|
from commands.ops.restart_integration_daemon import restart_connector
|
44
44
|
|
45
|
+
|
45
46
|
# class Config(object):
|
46
47
|
# def __init__(self, server: str = None, url: str = None, userid:str = None, password:str = None,
|
47
48
|
# timeout:int = 30, paging: bool = False):
|
@@ -126,7 +127,7 @@ from commands.ops.restart_integration_daemon import restart_connector
|
|
126
127
|
@click.option(
|
127
128
|
"--password",
|
128
129
|
default="secret",
|
129
|
-
envvar="
|
130
|
+
envvar="EGERIA_USER_PASSWORD",
|
130
131
|
help="Egeria user password",
|
131
132
|
)
|
132
133
|
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
@@ -377,8 +378,15 @@ def tell(ctx):
|
|
377
378
|
pass
|
378
379
|
|
379
380
|
|
380
|
-
tell.
|
381
|
-
|
381
|
+
@tell.group("servers")
|
382
|
+
@click.pass_context
|
383
|
+
def servers(ctx):
|
384
|
+
"""Perform actions on OMAG Servers"""
|
385
|
+
pass
|
386
|
+
|
387
|
+
|
388
|
+
servers.add_command(start_server)
|
389
|
+
servers.add_command(stop_server)
|
382
390
|
|
383
391
|
|
384
392
|
@tell.group("integration-daemon")
|
@@ -442,6 +450,5 @@ def repository(ctx):
|
|
442
450
|
|
443
451
|
repository.add_command(load_archive)
|
444
452
|
|
445
|
-
|
446
453
|
if __name__ == "__main__":
|
447
454
|
cli()
|
@@ -0,0 +1,136 @@
|
|
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
|
+
@click.pass_context
|
56
|
+
def stop_server(ctx, server):
|
57
|
+
"""Stop an engine-host daemon"""
|
58
|
+
c = ctx.obj
|
59
|
+
p_client = EgeriaTech(c.view_server, c.view_server_url, c.userid, c.password)
|
60
|
+
token = p_client.create_egeria_bearer_token()
|
61
|
+
try:
|
62
|
+
server_guid = p_client.get_guid_for_name(server)
|
63
|
+
|
64
|
+
p_client.shutdown_server(server_guid)
|
65
|
+
click.echo(f"Stopped server {server}")
|
66
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
67
|
+
print_exception_response(e)
|
68
|
+
finally:
|
69
|
+
p_client.close_session()
|
70
|
+
|
71
|
+
|
72
|
+
@click.command("start")
|
73
|
+
@click.option("--server", help="OMAG Server to start")
|
74
|
+
# @click.option(
|
75
|
+
# "--view-server", default=EGERIA_VIEW_SERVER, help="View Server to communicate with"
|
76
|
+
# )
|
77
|
+
# @click.option(
|
78
|
+
# "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
79
|
+
# )
|
80
|
+
# @click.option("--userid", default="garygeeke", envvar="EGERIA_USER", help="Egeria user")
|
81
|
+
# @click.option(
|
82
|
+
# "--password",
|
83
|
+
# default="secret",
|
84
|
+
# envvar="EGERIA_USER_PASSWORD",
|
85
|
+
# help="Egeria user password",
|
86
|
+
# )
|
87
|
+
def start_server(ctx, server):
|
88
|
+
"""Start or restart an engine-host from its known configuration"""
|
89
|
+
c = ctx.obj
|
90
|
+
p_client = EgeriaTech(c.view_server, c.view_server_url, c.userid, c.password)
|
91
|
+
token = p_client.create_egeria_bearer_token()
|
92
|
+
try:
|
93
|
+
server_guid = p_client.get_element_guid_by_unique_name(server, "name")
|
94
|
+
p_client.activate_server_with_stored_config(server_guid)
|
95
|
+
|
96
|
+
click.echo(f"Started server {server}")
|
97
|
+
|
98
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
99
|
+
print_exception_response(e)
|
100
|
+
finally:
|
101
|
+
p_client.close_session()
|
102
|
+
|
103
|
+
|
104
|
+
@click.command("refresh-gov-eng-config")
|
105
|
+
@click.pass_context
|
106
|
+
# @click.option(
|
107
|
+
# "--engine-host", default=EGERIA_ENGINE_HOST, help="Engine Host to refresh"
|
108
|
+
# )
|
109
|
+
# @click.option(
|
110
|
+
# "--view-server", default=EGERIA_VIEW_SERVER, help="View Server to communicate with"
|
111
|
+
# )
|
112
|
+
# @click.option(
|
113
|
+
# "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
114
|
+
# )
|
115
|
+
# @click.option("--userid", default="garygeeke", envvar="EGERIA_USER", help="Egeria user")
|
116
|
+
# @click.option(
|
117
|
+
# "--password",
|
118
|
+
# default="secret",
|
119
|
+
# envvar="EGERIA_PASSWORD",
|
120
|
+
# help="Egeria user password",
|
121
|
+
# )
|
122
|
+
def refresh_gov_eng_config(ctx):
|
123
|
+
"""Start or restart an engine-host from its known configuration"""
|
124
|
+
c = ctx.obj
|
125
|
+
p_client = EgeriaTech(c.view_server, c.view_server_url, c.userid, c.password)
|
126
|
+
token = p_client.create_egeria_bearer_token()
|
127
|
+
try:
|
128
|
+
engine_host_guid = p_client.get_guid_for_name(c.engine_host)
|
129
|
+
p_client.refresh_gov_eng_config(engine_host_guid)
|
130
|
+
|
131
|
+
click.echo(f"Refreshed server {c.engine_host}")
|
132
|
+
|
133
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
134
|
+
print_exception_response(e)
|
135
|
+
finally:
|
136
|
+
p_client.close_session()
|
@@ -1952,56 +1952,6 @@ class RuntimeManager(Client):
|
|
1952
1952
|
response = loop.run_until_complete(self._async_get_server_report(server_guid))
|
1953
1953
|
return response
|
1954
1954
|
|
1955
|
-
#
|
1956
|
-
# Activate
|
1957
|
-
#
|
1958
|
-
|
1959
|
-
async def _async_activate_with_stored_config(self, server_guid: str) -> None:
|
1960
|
-
"""Activate the Open Metadata and Governance (OMAG) server using the configuration document stored for this
|
1961
|
-
server. Async Version
|
1962
|
-
|
1963
|
-
Parameters
|
1964
|
-
----------
|
1965
|
-
server_guid: str
|
1966
|
-
Identity of the server to activate.
|
1967
|
-
|
1968
|
-
Returns
|
1969
|
-
-------
|
1970
|
-
None
|
1971
|
-
|
1972
|
-
|
1973
|
-
Raises
|
1974
|
-
------
|
1975
|
-
InvalidParameterException
|
1976
|
-
PropertyServerException
|
1977
|
-
UserNotAuthorizedException
|
1978
|
-
|
1979
|
-
"""
|
1980
|
-
pass
|
1981
|
-
|
1982
|
-
def activate_with_stored_config(self, server_guid: str) -> None:
|
1983
|
-
"""Activate the Open Metadata and Governance (OMAG) server using the configuration document stored for this
|
1984
|
-
server.
|
1985
|
-
|
1986
|
-
Parameters
|
1987
|
-
----------
|
1988
|
-
server_guid: str
|
1989
|
-
Identity of the server to activate.
|
1990
|
-
|
1991
|
-
Returns
|
1992
|
-
-------
|
1993
|
-
None
|
1994
|
-
|
1995
|
-
|
1996
|
-
Raises
|
1997
|
-
------
|
1998
|
-
InvalidParameterException
|
1999
|
-
PropertyServerException
|
2000
|
-
UserNotAuthorizedException
|
2001
|
-
|
2002
|
-
"""
|
2003
|
-
pass
|
2004
|
-
|
2005
1955
|
|
2006
1956
|
if __name__ == "__main__":
|
2007
1957
|
print("Main-Runtime Manager")
|
@@ -1,131 +0,0 @@
|
|
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()
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|