pyegeria 1.5.1.1.36__py3-none-any.whl → 1.5.1.1.38__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.
- pyegeria/_client.py +59 -21
- pyegeria/commands/cat/glossary_actions.py +26 -2
- pyegeria/commands/cat/list_glossaries.py +4 -2
- pyegeria/commands/cat/list_servers_deployed_imp.py +158 -0
- pyegeria/commands/cat/list_terms.py +11 -8
- pyegeria/commands/cli/egeria.py +25 -2
- pyegeria/commands/cli/egeria_cat.py +23 -0
- pyegeria/commands/ops/gov_server_actions.py +5 -1
- pyegeria/commands/ops/monitor_integ_daemon_status.py +1 -1
- pyegeria/commands/ops/monitor_platform_status.py +4 -4
- pyegeria/commands/ops/monitor_server_status.py +21 -3
- pyegeria/commands/ops/refresh_integration_daemon.py +1 -1
- pyegeria/glossary_manager_omvs.py +149 -54
- pyegeria/runtime_manager_omvs.py +310 -178
- {pyegeria-1.5.1.1.36.dist-info → pyegeria-1.5.1.1.38.dist-info}/METADATA +1 -1
- {pyegeria-1.5.1.1.36.dist-info → pyegeria-1.5.1.1.38.dist-info}/RECORD +20 -19
- {pyegeria-1.5.1.1.36.dist-info → pyegeria-1.5.1.1.38.dist-info}/entry_points.txt +2 -0
- /pyegeria/commands/ops/{engine_actions.py → x_engine_actions.py} +0 -0
- {pyegeria-1.5.1.1.36.dist-info → pyegeria-1.5.1.1.38.dist-info}/LICENSE +0 -0
- {pyegeria-1.5.1.1.36.dist-info → pyegeria-1.5.1.1.38.dist-info}/WHEEL +0 -0
pyegeria/_client.py
CHANGED
@@ -654,32 +654,33 @@ class Client:
|
|
654
654
|
integration_guids[display_name] = resource_guid
|
655
655
|
# print(f"Added {display_name} integration connector with GUID {integration_guids[display_name]}")
|
656
656
|
|
657
|
-
async def
|
657
|
+
async def __async_get_guid__(
|
658
658
|
self,
|
659
659
|
guid: str = None,
|
660
|
-
|
660
|
+
display_name: str = None,
|
661
661
|
property_name: str = "qualifiedName",
|
662
|
+
qualified_name: str = None,
|
662
663
|
tech_type: str = None,
|
663
664
|
) -> str:
|
664
|
-
"""Helper function to return a server_guid - one of server_guid or
|
665
|
-
contain information. If
|
666
|
-
values, server_guid will be used.
|
667
|
-
then the
|
665
|
+
"""Helper function to return a server_guid - one of server_guid, qualified_name or display_name should
|
666
|
+
contain information. If all are None, an exception will be thrown. If all contain
|
667
|
+
values, server_guid will be used first, followed by qualified_name. If the tech_type is supplied and the
|
668
|
+
property_name is qualifiedName then the display_name will be pre-pended with the tech_type name to form a
|
669
|
+
qualifiedName.
|
668
670
|
|
669
671
|
An InvalidParameter Exception is thrown if multiple matches
|
670
672
|
are found for the given property name. If this occurs, use a qualified name for the property name.
|
671
673
|
Async version.
|
672
674
|
"""
|
675
|
+
|
673
676
|
if guid:
|
674
677
|
return guid
|
675
|
-
if name:
|
676
|
-
if (tech_type) and (property_name == "qualifiedName"):
|
677
|
-
name = f"{tech_type}:{name}"
|
678
678
|
|
679
|
+
if qualified_name:
|
679
680
|
body = {
|
680
681
|
"class": "NameRequestBody",
|
681
|
-
"name":
|
682
|
-
"namePropertyName":
|
682
|
+
"name": qualified_name,
|
683
|
+
"namePropertyName": "qualifiedName",
|
683
684
|
"forLineage": False,
|
684
685
|
"forDuplicateProcessing": False,
|
685
686
|
"effectiveTime": None,
|
@@ -689,11 +690,43 @@ class Client:
|
|
689
690
|
f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
|
690
691
|
)
|
691
692
|
|
692
|
-
|
693
|
-
|
694
|
-
|
693
|
+
result = await self._async_make_request("POST", url, body_slimmer(body))
|
694
|
+
return result.json().get("guid", "No elements found")
|
695
|
+
|
696
|
+
if (not qualified_name) and display_name:
|
697
|
+
if (tech_type) and (property_name == "qualifiedName"):
|
698
|
+
name = f"{tech_type}:{display_name}"
|
699
|
+
body = {
|
700
|
+
"class": "NameRequestBody",
|
701
|
+
"name": name,
|
702
|
+
"namePropertyName": property_name,
|
703
|
+
"forLineage": False,
|
704
|
+
"forDuplicateProcessing": False,
|
705
|
+
"effectiveTime": None,
|
706
|
+
}
|
707
|
+
url = (
|
708
|
+
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/"
|
709
|
+
f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
|
710
|
+
)
|
695
711
|
|
696
|
-
|
712
|
+
result = await self._async_make_request("POST", url, body_slimmer(body))
|
713
|
+
return result.json().get("guid", "No elements found")
|
714
|
+
else:
|
715
|
+
body = {
|
716
|
+
"class": "NameRequestBody",
|
717
|
+
"name": display_name,
|
718
|
+
"namePropertyName": property_name,
|
719
|
+
"forLineage": False,
|
720
|
+
"forDuplicateProcessing": False,
|
721
|
+
"effectiveTime": None,
|
722
|
+
}
|
723
|
+
url = (
|
724
|
+
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/"
|
725
|
+
f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
|
726
|
+
)
|
727
|
+
|
728
|
+
result = await self._async_make_request("POST", url, body_slimmer(body))
|
729
|
+
return result.json().get("guid", "No elements found")
|
697
730
|
else:
|
698
731
|
raise InvalidParameterException(
|
699
732
|
"Neither server_guid nor server_name were provided - please provide."
|
@@ -702,21 +735,26 @@ class Client:
|
|
702
735
|
def __get_guid__(
|
703
736
|
self,
|
704
737
|
guid: str = None,
|
705
|
-
|
738
|
+
display_name: str = None,
|
706
739
|
property_name: str = "qualifiedName",
|
740
|
+
qualified_name: str = None,
|
707
741
|
tech_type: str = None,
|
708
742
|
) -> str:
|
709
|
-
"""Helper function to return a server_guid - one of server_guid or
|
710
|
-
contain information. If
|
711
|
-
values, server_guid will be used.
|
712
|
-
then the
|
743
|
+
"""Helper function to return a server_guid - one of server_guid, qualified_name or display_name should
|
744
|
+
contain information. If all are None, an exception will be thrown. If all contain
|
745
|
+
values, server_guid will be used first, followed by qualified_name. If the tech_type is supplied and the
|
746
|
+
property_name is qualifiedName then the display_name will be pre-pended with the tech_type name to form a
|
747
|
+
qualifiedName.
|
713
748
|
|
714
749
|
An InvalidParameter Exception is thrown if multiple matches
|
715
750
|
are found for the given property name. If this occurs, use a qualified name for the property name.
|
751
|
+
Async version.
|
716
752
|
"""
|
717
753
|
loop = asyncio.get_event_loop()
|
718
754
|
result = loop.run_until_complete(
|
719
|
-
self.
|
755
|
+
self.__async_get_guid__(
|
756
|
+
guid, display_name, property_name, qualified_name, tech_type
|
757
|
+
)
|
720
758
|
)
|
721
759
|
return result
|
722
760
|
|
@@ -259,7 +259,7 @@ def create_term(
|
|
259
259
|
def load_terms(
|
260
260
|
glossary_name, file_name, verbose, upsert, server, url, userid, password, timeout
|
261
261
|
):
|
262
|
-
"""
|
262
|
+
"""Load terms from file into the glossary specified"""
|
263
263
|
m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
|
264
264
|
token = m_client.create_egeria_bearer_token()
|
265
265
|
try:
|
@@ -294,7 +294,7 @@ def load_terms(
|
|
294
294
|
@click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
|
295
295
|
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
296
296
|
def export_terms(glossary_guid, file_name, server, url, userid, password, timeout):
|
297
|
-
"""
|
297
|
+
"""Export the glossary specified"""
|
298
298
|
m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
|
299
299
|
token = m_client.create_egeria_bearer_token()
|
300
300
|
try:
|
@@ -308,3 +308,27 @@ def export_terms(glossary_guid, file_name, server, url, userid, password, timeou
|
|
308
308
|
print_exception_response(e)
|
309
309
|
finally:
|
310
310
|
m_client.close_session()
|
311
|
+
|
312
|
+
|
313
|
+
@click.command("delete-term")
|
314
|
+
@click.option("--term-guid", help="Unique identity of term", required=True)
|
315
|
+
@click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
|
316
|
+
@click.option(
|
317
|
+
"--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
318
|
+
)
|
319
|
+
@click.option("--userid", default=EGERIA_USER, help="Egeria user")
|
320
|
+
@click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
|
321
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
322
|
+
def delete_term(term_guid, server, url, userid, password, timeout):
|
323
|
+
"""Delete the Term specified"""
|
324
|
+
m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
|
325
|
+
token = m_client.create_egeria_bearer_token()
|
326
|
+
try:
|
327
|
+
m_client.delete_term(term_guid)
|
328
|
+
|
329
|
+
click.echo(f"Deleted term: {term_guid}")
|
330
|
+
|
331
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
332
|
+
print_exception_response(e)
|
333
|
+
finally:
|
334
|
+
m_client.close_session()
|
@@ -87,7 +87,9 @@ def display_glossaries(
|
|
87
87
|
expand=True,
|
88
88
|
)
|
89
89
|
table.add_column("Glossary Name")
|
90
|
-
table.add_column(
|
90
|
+
table.add_column(
|
91
|
+
"Qualified Name & GUID", width=38, no_wrap=True, justify="center"
|
92
|
+
)
|
91
93
|
table.add_column("Language")
|
92
94
|
table.add_column("Description")
|
93
95
|
table.add_column("Usage")
|
@@ -101,7 +103,7 @@ def display_glossaries(
|
|
101
103
|
display_name = glossary["glossaryProperties"]["displayName"]
|
102
104
|
qualified_name = glossary["glossaryProperties"]["qualifiedName"]
|
103
105
|
guid = glossary["elementHeader"]["guid"]
|
104
|
-
q_name = f"{qualified_name}\n
|
106
|
+
q_name = Text(f"{qualified_name}\n&\n{guid}", justify="center")
|
105
107
|
language = glossary["glossaryProperties"]["language"]
|
106
108
|
description = glossary["glossaryProperties"]["description"]
|
107
109
|
usage = glossary["glossaryProperties"]["usage"]
|
@@ -0,0 +1,158 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
Display by deployed implementation type.
|
7
|
+
|
8
|
+
Note: This implementation is using the runtime manager.
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
A simple server status display
|
13
|
+
"""
|
14
|
+
import argparse
|
15
|
+
import os
|
16
|
+
import sys
|
17
|
+
import time
|
18
|
+
|
19
|
+
from rich.console import Console
|
20
|
+
from rich.markdown import Markdown
|
21
|
+
from rich.prompt import Prompt
|
22
|
+
from rich.table import Table
|
23
|
+
from rich.text import Text
|
24
|
+
|
25
|
+
from pyegeria import (
|
26
|
+
InvalidParameterException,
|
27
|
+
PropertyServerException,
|
28
|
+
UserNotAuthorizedException,
|
29
|
+
print_exception_response,
|
30
|
+
RuntimeManager,
|
31
|
+
)
|
32
|
+
|
33
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
34
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
35
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
36
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
37
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
38
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
39
|
+
)
|
40
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
41
|
+
EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
|
42
|
+
"EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
|
43
|
+
)
|
44
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
45
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
46
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
47
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
48
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
49
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
50
|
+
|
51
|
+
|
52
|
+
def display_servers_by_dep_imp(
|
53
|
+
filter: str = "*",
|
54
|
+
view_server: str = EGERIA_VIEW_SERVER,
|
55
|
+
view_url: str = EGERIA_VIEW_SERVER_URL,
|
56
|
+
user: str = EGERIA_USER,
|
57
|
+
user_pass: str = EGERIA_USER_PASSWORD,
|
58
|
+
jupyter: bool = EGERIA_JUPYTER,
|
59
|
+
width: int = EGERIA_WIDTH,
|
60
|
+
):
|
61
|
+
p_client = RuntimeManager(view_server, view_url, user, user_pass)
|
62
|
+
token = p_client.create_egeria_bearer_token()
|
63
|
+
|
64
|
+
def generate_table() -> Table:
|
65
|
+
"""Make a new table."""
|
66
|
+
table = Table(
|
67
|
+
title=f"Servers by Deployed Implementation Type - {time.asctime()}",
|
68
|
+
style="bold white on black",
|
69
|
+
row_styles=["bold white on black"],
|
70
|
+
header_style="white on dark_blue",
|
71
|
+
title_style="bold white on black",
|
72
|
+
caption_style="white on black",
|
73
|
+
caption=f"Platform - '{view_url}'",
|
74
|
+
show_lines=True,
|
75
|
+
)
|
76
|
+
|
77
|
+
table.add_column("Server")
|
78
|
+
table.add_column("Deployed Impl Type")
|
79
|
+
table.add_column("Zones")
|
80
|
+
|
81
|
+
table.add_column("Description")
|
82
|
+
table.add_column("Qualified Name & GUID", no_wrap=True)
|
83
|
+
|
84
|
+
unsorted_server_list = p_client.get_servers_by_dep_impl_type(filter)
|
85
|
+
if type(unsorted_server_list) is str:
|
86
|
+
print("No matching Software Servers found?")
|
87
|
+
sys.exit(1)
|
88
|
+
server_list = sorted(
|
89
|
+
unsorted_server_list,
|
90
|
+
key=lambda x: x["properties"].get("displayName", "---").lower(),
|
91
|
+
)
|
92
|
+
|
93
|
+
for server in server_list:
|
94
|
+
display_name = server["properties"].get("displayName", "---")
|
95
|
+
qualified_name = server["properties"].get("qualifiedName", "---")
|
96
|
+
classifications = server["elementHeader"].get("classifications", None)
|
97
|
+
zones = ""
|
98
|
+
if classifications:
|
99
|
+
for clas in classifications:
|
100
|
+
if clas["classificationName"] == "AssetZoneMembership":
|
101
|
+
classification_props = clas["classificationProperties"]
|
102
|
+
zone_membership = classification_props.get(
|
103
|
+
"zoneMembership", None
|
104
|
+
)
|
105
|
+
if zone_membership:
|
106
|
+
for z in zone_membership.keys():
|
107
|
+
zones += f"{zone_membership[z]}, "
|
108
|
+
zones = zones[:-2]
|
109
|
+
|
110
|
+
impl_type = server["properties"].get("deployedImplementationType", "---")
|
111
|
+
server_guid = server["elementHeader"]["guid"]
|
112
|
+
server_desc = server["properties"].get("resourceDescription", "---")
|
113
|
+
|
114
|
+
server_id = Text(f"{qualified_name}\n&\n{server_guid}", justify="center")
|
115
|
+
|
116
|
+
table.add_row(display_name, impl_type, zones, server_desc, server_id)
|
117
|
+
|
118
|
+
return table
|
119
|
+
|
120
|
+
try:
|
121
|
+
console = Console(width=width, force_terminal=not jupyter)
|
122
|
+
|
123
|
+
with console.pager(styles=True):
|
124
|
+
console.print(generate_table())
|
125
|
+
|
126
|
+
except (
|
127
|
+
InvalidParameterException,
|
128
|
+
PropertyServerException,
|
129
|
+
UserNotAuthorizedException,
|
130
|
+
) as e:
|
131
|
+
print_exception_response(e)
|
132
|
+
except KeyboardInterrupt:
|
133
|
+
pass
|
134
|
+
finally:
|
135
|
+
p_client.close_session()
|
136
|
+
|
137
|
+
|
138
|
+
def main():
|
139
|
+
parser = argparse.ArgumentParser()
|
140
|
+
|
141
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
142
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
143
|
+
parser.add_argument("--userid", help="User Id")
|
144
|
+
parser.add_argument("--password", help="User Password")
|
145
|
+
args = parser.parse_args()
|
146
|
+
|
147
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
148
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
149
|
+
userid = args.userid if args.userid is not None else EGERIA_ADMIN_USER
|
150
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
151
|
+
filter = Prompt.ask(
|
152
|
+
"Filter deployed for deployed implementation type by search string", default="*"
|
153
|
+
)
|
154
|
+
display_servers_by_dep_imp(filter, server, url, userid, user_pass)
|
155
|
+
|
156
|
+
|
157
|
+
if __name__ == "__main__":
|
158
|
+
main()
|
@@ -88,10 +88,7 @@ def display_glossary_terms(
|
|
88
88
|
token = g_client.create_egeria_bearer_token()
|
89
89
|
if (glossary_name is not None) and (glossary_name != "*"):
|
90
90
|
glossary_guid = g_client.__get_guid__(
|
91
|
-
glossary_guid,
|
92
|
-
glossary_name,
|
93
|
-
"qualifiedName",
|
94
|
-
"Glossary",
|
91
|
+
glossary_guid, glossary_name, "qualifiedName", None, "Glossary"
|
95
92
|
)
|
96
93
|
|
97
94
|
def generate_table(search_string: str, glossary_guid: str = None) -> Table:
|
@@ -141,14 +138,20 @@ def display_glossary_terms(
|
|
141
138
|
if props == "None":
|
142
139
|
return table
|
143
140
|
|
144
|
-
display_name = Text(props["displayName"], style=style)
|
141
|
+
display_name = Text(props["displayName"], style=style, justify="center")
|
145
142
|
qualified_name = props["qualifiedName"]
|
146
143
|
term_guid = term["elementHeader"]["guid"]
|
147
|
-
q_name = Text(
|
148
|
-
|
144
|
+
q_name = Text(
|
145
|
+
f"{qualified_name}\n&\n{term_guid}", style=style, justify="center"
|
146
|
+
)
|
147
|
+
abbrev = Text(props.get("abbreviation", " "), style=style, justify="center")
|
149
148
|
summary = Text(props.get("summary", " "), style=style)
|
150
149
|
description = Text(props.get("description", " "), style=style)
|
151
|
-
version = Text(
|
150
|
+
version = Text(
|
151
|
+
props.get("publishVersionIdentifier", " "),
|
152
|
+
style=style,
|
153
|
+
justify="center",
|
154
|
+
)
|
152
155
|
|
153
156
|
classifications = term["elementHeader"]["classifications"]
|
154
157
|
glossary_guid = None
|
pyegeria/commands/cli/egeria.py
CHANGED
@@ -27,6 +27,7 @@ from pyegeria.commands.cat.list_tech_types import display_tech_types
|
|
27
27
|
from pyegeria.commands.cat.list_todos import display_to_dos as list_todos
|
28
28
|
from pyegeria.commands.cat.list_user_ids import list_user_ids
|
29
29
|
from pyegeria.commands.cat.list_archives import display_archive_list
|
30
|
+
from pyegeria.commands.cat.list_servers_deployed_imp import display_servers_by_dep_imp
|
30
31
|
from pyegeria.commands.cli.ops_config import Config
|
31
32
|
from pyegeria.commands.my.list_my_profile import display_my_profile
|
32
33
|
from pyegeria.commands.my.list_my_roles import display_my_roles
|
@@ -42,6 +43,7 @@ from pyegeria.commands.cat.glossary_actions import (
|
|
42
43
|
delete_glossary,
|
43
44
|
create_term,
|
44
45
|
load_terms,
|
46
|
+
delete_term,
|
45
47
|
export_terms,
|
46
48
|
)
|
47
49
|
from pyegeria.commands.cat.list_glossaries import display_glossaries
|
@@ -933,12 +935,32 @@ def archives(ctx):
|
|
933
935
|
)
|
934
936
|
|
935
937
|
|
938
|
+
@show.command("deployed-servers")
|
939
|
+
@click.option(
|
940
|
+
"--search-string",
|
941
|
+
default="*",
|
942
|
+
help="Filter deployed for deployed implementation type by search string",
|
943
|
+
)
|
944
|
+
@click.pass_context
|
945
|
+
def show_deployed_servers(ctx, search_string):
|
946
|
+
c = ctx.obj
|
947
|
+
display_servers_by_dep_imp(
|
948
|
+
search_string,
|
949
|
+
c.view_server,
|
950
|
+
c.view_server_url,
|
951
|
+
c.userid,
|
952
|
+
c.password,
|
953
|
+
c.jupyter,
|
954
|
+
c.width,
|
955
|
+
)
|
956
|
+
|
957
|
+
|
936
958
|
@show.command("deployed-schemas")
|
937
959
|
@click.option(
|
938
960
|
"--search_catalog", default="*", help="What database or catalog to search"
|
939
961
|
)
|
940
962
|
@click.pass_context
|
941
|
-
def deployed_schemas(
|
963
|
+
def deployed_schemas(ctx, search_catalog):
|
942
964
|
"""Display a tree graph of information about an asset"""
|
943
965
|
c = ctx.obj
|
944
966
|
list_deployed_database_schemas(
|
@@ -955,7 +977,7 @@ def deployed_schemas(search_catalog, ctx):
|
|
955
977
|
@show.command("catalogs")
|
956
978
|
@click.option("--search_server", default="*", help="Server to search for catalogs")
|
957
979
|
@click.pass_context
|
958
|
-
def catalogs(
|
980
|
+
def catalogs(ctx, search_server):
|
959
981
|
"""Display a tree graph of information about an asset"""
|
960
982
|
c = ctx.obj
|
961
983
|
list_deployed_catalogs(
|
@@ -1016,6 +1038,7 @@ tell.add_command(reassign_todo)
|
|
1016
1038
|
tell.add_command(delete_todo)
|
1017
1039
|
tell.add_command(create_todo)
|
1018
1040
|
tell.add_command(load_terms)
|
1041
|
+
tell.add_command(delete_term)
|
1019
1042
|
tell.add_command(export_terms)
|
1020
1043
|
|
1021
1044
|
|
@@ -22,9 +22,11 @@ from pyegeria.commands.cat.glossary_actions import (
|
|
22
22
|
create_glossary,
|
23
23
|
delete_glossary,
|
24
24
|
create_term,
|
25
|
+
delete_term,
|
25
26
|
load_terms,
|
26
27
|
export_terms,
|
27
28
|
)
|
29
|
+
from pyegeria.commands.cat.list_servers_deployed_imp import display_servers_by_dep_imp
|
28
30
|
from pyegeria.commands.cat.list_glossaries import display_glossaries
|
29
31
|
from pyegeria.commands.cat.list_archives import display_archive_list
|
30
32
|
from pyegeria.commands.cat.list_assets import display_assets
|
@@ -516,6 +518,26 @@ def list_archives(ctx):
|
|
516
518
|
)
|
517
519
|
|
518
520
|
|
521
|
+
@show.command("deployed-servers")
|
522
|
+
@click.option(
|
523
|
+
"--search-string",
|
524
|
+
default="*",
|
525
|
+
help="Filter deployed for deployed implementation type by search string",
|
526
|
+
)
|
527
|
+
@click.pass_context
|
528
|
+
def show_deployed_servers(ctx, search_string):
|
529
|
+
c = ctx.obj
|
530
|
+
display_servers_by_dep_imp(
|
531
|
+
search_string,
|
532
|
+
c.view_server,
|
533
|
+
c.view_server_url,
|
534
|
+
c.userid,
|
535
|
+
c.password,
|
536
|
+
c.jupyter,
|
537
|
+
c.width,
|
538
|
+
)
|
539
|
+
|
540
|
+
|
519
541
|
@show.command("deployed-schemas")
|
520
542
|
@click.option("--catalog", default="*", help="What database or catalog to search")
|
521
543
|
@click.pass_context
|
@@ -596,6 +618,7 @@ tell.add_command(mark_todo_complete)
|
|
596
618
|
tell.add_command(reassign_todo)
|
597
619
|
tell.add_command(delete_todo)
|
598
620
|
tell.add_command(create_todo)
|
621
|
+
tell.add_command(delete_term)
|
599
622
|
tell.add_command(load_terms)
|
600
623
|
tell.add_command(export_terms)
|
601
624
|
|
@@ -104,9 +104,13 @@ def update_catalog_target(ctx, relationship_guid: str, catalog_target_name: str)
|
|
104
104
|
print_exception_response(e)
|
105
105
|
|
106
106
|
|
107
|
+
#
|
108
|
+
# This method will be updated based on forthcoming changes on the Egeria server side
|
109
|
+
#
|
107
110
|
@click.command("refresh")
|
111
|
+
@click.option("-engine-host-guid", help="GUID of engine host to refresh.")
|
108
112
|
@click.pass_context
|
109
|
-
def refresh_gov_eng_config(ctx):
|
113
|
+
def refresh_gov_eng_config(ctx, engine_host_guid: str):
|
110
114
|
"""Start or restart an engine-host from its known configuration"""
|
111
115
|
c = ctx.obj
|
112
116
|
p_client = EgeriaTech(c.view_server, c.view_server_url, c.userid, c.password)
|
@@ -64,11 +64,11 @@ def display_status(
|
|
64
64
|
header_style="white on dark_blue",
|
65
65
|
title_style="bold white on black",
|
66
66
|
caption_style="white on black",
|
67
|
-
caption=f"Status of Platforms - '{
|
67
|
+
caption=f"Status of Platforms - '{view_url}'",
|
68
68
|
show_lines=True,
|
69
69
|
# expand=True
|
70
70
|
)
|
71
|
-
table.add_column("Platform Name")
|
71
|
+
table.add_column("Platform Name & GUID")
|
72
72
|
# table.add_column("Platform GUID")
|
73
73
|
table.add_column("Platform URL")
|
74
74
|
table.add_column("Platform Origin")
|
@@ -98,7 +98,7 @@ def display_status(
|
|
98
98
|
platform_url = platform_report.get("platformURLRoot", " ")
|
99
99
|
platform_origin = platform_report.get("platformOrigin", " ")
|
100
100
|
platform_started = platform_report.get("platformStartTime", " ")
|
101
|
-
|
101
|
+
platform_id = f"{platform_name}\n\n\t\t&\n\n{platform_guid}"
|
102
102
|
servers = platform_report.get("omagservers", None)
|
103
103
|
|
104
104
|
if servers is not None:
|
@@ -120,7 +120,7 @@ def display_status(
|
|
120
120
|
# server_list = server_list + serv
|
121
121
|
|
122
122
|
table.add_row(
|
123
|
-
|
123
|
+
platform_id,
|
124
124
|
platform_url,
|
125
125
|
platform_origin,
|
126
126
|
platform_desc,
|
@@ -70,12 +70,14 @@ def display_status(
|
|
70
70
|
title_style="bold white on black",
|
71
71
|
caption_style="white on black",
|
72
72
|
caption=f"Server Status from Platform - '{url}'",
|
73
|
-
|
73
|
+
show_lines=True,
|
74
74
|
)
|
75
75
|
|
76
76
|
table.add_column("Known Server")
|
77
77
|
table.add_column("Status")
|
78
78
|
if extended:
|
79
|
+
table.add_column("GUID", no_wrap=True)
|
80
|
+
table.add_column("Qualified Name")
|
79
81
|
table.add_column("Description")
|
80
82
|
table.add_column("Server Type")
|
81
83
|
table.add_column("Last Started")
|
@@ -102,15 +104,31 @@ def display_status(
|
|
102
104
|
server_status = p_server.get("serverActiveStatus", "UNKNOWN")
|
103
105
|
if server_status in ("RUNNING", "STARTING"):
|
104
106
|
status = "Active"
|
105
|
-
elif server_status in ("INACTIVE", "STOPPING"):
|
107
|
+
elif server_status in ("INACTIVE", "STOPPING", "UNKNOWN"):
|
106
108
|
status = "Inactive"
|
107
109
|
else:
|
108
110
|
status = "UNKNOWN"
|
109
111
|
|
110
112
|
if extended:
|
113
|
+
#
|
114
|
+
# get the qualified name and guid from get_server_by_name?
|
115
|
+
#
|
116
|
+
server_info = p_client.get_servers_by_name(server_name)
|
117
|
+
if type(server_info) is str:
|
118
|
+
guid = "---"
|
119
|
+
qualified_name = "---"
|
120
|
+
else:
|
121
|
+
guid = ""
|
122
|
+
qualified_name = ""
|
123
|
+
for i in server_info:
|
124
|
+
guid += f"{i["elementHeader"]["guid"]} "
|
125
|
+
qualified_name += f"{i["properties"]["qualifiedName"]} "
|
126
|
+
|
111
127
|
table.add_row(
|
112
128
|
server_name,
|
113
129
|
"[red]Inactive" if status == "Inactive" else "[green]Active",
|
130
|
+
guid,
|
131
|
+
qualified_name,
|
114
132
|
server_desc,
|
115
133
|
server_type,
|
116
134
|
last_start_time,
|
@@ -144,7 +162,7 @@ def display_status(
|
|
144
162
|
|
145
163
|
def main():
|
146
164
|
parser = argparse.ArgumentParser()
|
147
|
-
parser.add_argument("--extended", help="Extended Information?")
|
165
|
+
parser.add_argument("--extended", default = True, help="Extended Information?")
|
148
166
|
parser.add_argument("--server", help="Name of the server to display status for")
|
149
167
|
parser.add_argument("--url", help="URL Platform to connect to")
|
150
168
|
parser.add_argument("--userid", help="User Id")
|
@@ -47,7 +47,7 @@ def refresh_connector(
|
|
47
47
|
server = "integration-daemon" if server is None else server
|
48
48
|
|
49
49
|
s_client.refresh_integration_connectors(
|
50
|
-
connector_name=connector, server_guid=None,
|
50
|
+
connector_name=connector, server_guid=None, display_name=server
|
51
51
|
)
|
52
52
|
|
53
53
|
print(f"\n===> Integration Daemon '{server}' refreshed {statement}.")
|