pyegeria 0.7.45__py3-none-any.whl → 0.8.0__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.
- examples/widgets/cat/list_cert_types.py +61 -43
- examples/widgets/cat/list_projects.py +1 -1
- examples/widgets/cli/egeria.py +18 -2
- examples/widgets/cli/egeria_tech.py +299 -98
- examples/widgets/my/my_profile_actions.py +51 -32
- examples/widgets/ops/engine_actions.py +35 -23
- examples/widgets/ops/integration_daemon_actions.py +51 -32
- examples/widgets/tech/get_element_info.py +63 -38
- examples/widgets/tech/get_guid_info.py +50 -27
- examples/widgets/tech/list_asset_types.py +33 -23
- examples/widgets/tech/list_elements.py +44 -34
- examples/widgets/tech/list_elements_x.py +69 -49
- examples/widgets/tech/list_registered_services.py +44 -24
- examples/widgets/tech/list_related_specification.py +70 -45
- examples/widgets/tech/list_relationship_types.py +50 -31
- examples/widgets/tech/list_valid_metadata_values.py +57 -28
- examples/widgets/tech/x_list_related_elements.py +54 -34
- pyegeria/Xloaded_resources_omvs.py +43 -41
- pyegeria/__init__.py +5 -1
- pyegeria/_client.py +142 -102
- pyegeria/_deprecated_gov_engine.py +218 -167
- pyegeria/action_author_omvs.py +107 -88
- pyegeria/asset_catalog_omvs.py +467 -395
- pyegeria/automated_curation_omvs.py +2 -2
- pyegeria/classification_manager_omvs.py +1920 -868
- pyegeria/collection_manager_omvs.py +1957 -1519
- pyegeria/core_omag_server_config.py +310 -192
- pyegeria/egeria_cat_client.py +88 -0
- pyegeria/egeria_config_client.py +37 -0
- pyegeria/egeria_my_client.py +47 -0
- pyegeria/egeria_ops_client.py +67 -0
- pyegeria/egeria_tech_client.py +77 -0
- pyegeria/feedback_manager_omvs.py +633 -631
- pyegeria/full_omag_server_config.py +330 -158
- pyegeria/glossary_browser_omvs.py +927 -474
- pyegeria/glossary_manager_omvs.py +1033 -543
- pyegeria/mermaid_utilities.py +1 -1
- pyegeria/my_profile_omvs.py +714 -574
- pyegeria/platform_services.py +228 -176
- pyegeria/project_manager_omvs.py +1158 -903
- pyegeria/registered_info.py +76 -74
- pyegeria/runtime_manager_omvs.py +749 -670
- pyegeria/server_operations.py +123 -85
- pyegeria/valid_metadata_omvs.py +268 -168
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/METADATA +1 -1
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/RECORD +49 -46
- examples/widgets/tech/list_gov_processes.py +0 -162
- pyegeria/tech_guids_31-08-2024 14:33.py +0 -79
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/LICENSE +0 -0
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/WHEEL +0 -0
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/entry_points.txt +0 -0
@@ -20,24 +20,32 @@ from pyegeria._exceptions import (
|
|
20
20
|
)
|
21
21
|
|
22
22
|
GERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
23
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
24
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
25
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
26
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
23
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
24
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
25
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
26
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
27
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
28
|
+
)
|
29
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
30
|
+
EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
|
31
|
+
"EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
|
32
|
+
)
|
33
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
34
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
35
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
36
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
33
37
|
|
34
38
|
|
35
|
-
@click.command(
|
36
|
-
@click.option(
|
37
|
-
|
38
|
-
|
39
|
-
@click.option(
|
40
|
-
|
39
|
+
@click.command("stop")
|
40
|
+
@click.option(
|
41
|
+
"--server", default=EGERIA_VIEW_SERVER, help="Egeria metadata store to load"
|
42
|
+
)
|
43
|
+
@click.option(
|
44
|
+
"--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
45
|
+
)
|
46
|
+
@click.option("--userid", default=EGERIA_ADMIN_USER, help="Egeria admin user")
|
47
|
+
@click.option("--password", default=EGERIA_ADMIN_PASSWORD, help="Egeria admin password")
|
48
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
41
49
|
def stop_daemon(file, server, url, userid, password, timeout):
|
42
50
|
"""Stop an engine-host daemon"""
|
43
51
|
p_client = Platform(server, url, userid, password)
|
@@ -51,14 +59,18 @@ def stop_daemon(file, server, url, userid, password, timeout):
|
|
51
59
|
p_client.close_session()
|
52
60
|
|
53
61
|
|
54
|
-
@click.command(
|
55
|
-
@click.option(
|
56
|
-
|
57
|
-
|
58
|
-
@click.option(
|
59
|
-
|
62
|
+
@click.command("start")
|
63
|
+
@click.option(
|
64
|
+
"--server", default=EGERIA_VIEW_SERVER, help="Egeria metadata store to load"
|
65
|
+
)
|
66
|
+
@click.option(
|
67
|
+
"--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
68
|
+
)
|
69
|
+
@click.option("--userid", default=EGERIA_ADMIN_USER, help="Egeria admin user")
|
70
|
+
@click.option("--password", default=EGERIA_ADMIN_PASSWORD, help="Egeria admin password")
|
71
|
+
@click.option("--timeout", default=60, help="Number of seconds to wait")
|
60
72
|
def start_daemon(file, server, url, userid, password, timeout):
|
61
|
-
"""Start or restart an engine-host from its known configuration
|
73
|
+
"""Start or restart an engine-host from its known configuration"""
|
62
74
|
p_client = Platform(server, url, userid, password)
|
63
75
|
try:
|
64
76
|
p_client.activate_server_stored_config()
|
@@ -22,79 +22,97 @@ from pyegeria._exceptions import (
|
|
22
22
|
)
|
23
23
|
|
24
24
|
|
25
|
-
@click.command(
|
26
|
-
@click.argument(
|
27
|
-
@click.argument(
|
28
|
-
@click.argument(
|
25
|
+
@click.command("add-target")
|
26
|
+
@click.argument("integration-connector")
|
27
|
+
@click.argument("metadata-element-guid")
|
28
|
+
@click.argument("catalog-target-name")
|
29
29
|
@click.pass_context
|
30
|
-
def add_catalog_target(
|
30
|
+
def add_catalog_target(
|
31
|
+
ctx,
|
32
|
+
integration_connector: str,
|
33
|
+
metadata_element_guid: str,
|
34
|
+
catalog_target_name: str,
|
35
|
+
) -> str:
|
31
36
|
"""Add catalog targets to the specified integration connector"""
|
32
37
|
try:
|
33
38
|
if integration_connector not in INTEGRATION_GUIDS.keys():
|
34
|
-
click.echo(
|
39
|
+
click.echo("Integration connector is not known")
|
35
40
|
|
36
41
|
c = ctx.obj
|
37
|
-
a_client = AutomatedCuration(
|
42
|
+
a_client = AutomatedCuration(
|
43
|
+
c.view_server, c.view_server_url, c.userid, c.password
|
44
|
+
)
|
38
45
|
token = a_client.create_egeria_bearer_token()
|
39
46
|
|
40
|
-
guid = a_client.add_catalog_target(
|
41
|
-
|
42
|
-
|
43
|
-
|
47
|
+
guid = a_client.add_catalog_target(
|
48
|
+
INTEGRATION_GUIDS[integration_connector],
|
49
|
+
metadata_element_guid,
|
50
|
+
catalog_target_name,
|
51
|
+
)
|
44
52
|
|
53
|
+
click.echo(
|
54
|
+
f"Added catalog target to {integration_connector} with a return guid of {guid}"
|
55
|
+
)
|
45
56
|
|
46
57
|
except (InvalidParameterException, PropertyServerException) as e:
|
47
58
|
print_exception_response(e)
|
48
59
|
|
49
60
|
|
50
|
-
|
51
|
-
@click.
|
52
|
-
@click.argument('relationship-guid')
|
61
|
+
@click.command("remove-target")
|
62
|
+
@click.argument("relationship-guid")
|
53
63
|
@click.pass_context
|
54
64
|
def remove_catalog_target(ctx, relationship_guid: str):
|
55
65
|
"""Remove the catalog target specified by the relationship guidr"""
|
56
66
|
try:
|
57
67
|
c = ctx.obj
|
58
|
-
a_client = AutomatedCuration(
|
68
|
+
a_client = AutomatedCuration(
|
69
|
+
c.view_server, c.view_server_url, c.userid, c.password
|
70
|
+
)
|
59
71
|
token = a_client.create_egeria_bearer_token()
|
60
72
|
|
61
73
|
a_client.remove_catalog_target(relationship_guid)
|
62
74
|
|
63
|
-
click.echo(
|
64
|
-
|
75
|
+
click.echo(
|
76
|
+
f"Removed catalog target with relationship guid of {relationship_guid}"
|
77
|
+
)
|
65
78
|
|
66
79
|
except (InvalidParameterException, PropertyServerException) as e:
|
67
80
|
print_exception_response(e)
|
68
81
|
|
69
82
|
|
70
|
-
@click.command(
|
71
|
-
@click.argument(
|
72
|
-
@click.argument(
|
83
|
+
@click.command("update-target")
|
84
|
+
@click.argument("relationship-guid")
|
85
|
+
@click.argument("catalog-target-name")
|
73
86
|
@click.pass_context
|
74
|
-
def update_catalog_target(ctx, relationship_guid: str, catalog_target_name:str):
|
75
|
-
"""Update the catalog target specified by the relationship guid
|
87
|
+
def update_catalog_target(ctx, relationship_guid: str, catalog_target_name: str):
|
88
|
+
"""Update the catalog target specified by the relationship guid"""
|
76
89
|
try:
|
77
90
|
c = ctx.obj
|
78
|
-
a_client = AutomatedCuration(
|
91
|
+
a_client = AutomatedCuration(
|
92
|
+
c.view_server, c.view_server_url, c.userid, c.password
|
93
|
+
)
|
79
94
|
token = a_client.create_egeria_bearer_token()
|
80
95
|
|
81
96
|
guid = a_client.update_catalog_target(relationship_guid, catalog_target_name)
|
82
97
|
|
83
|
-
click.echo(
|
84
|
-
|
85
|
-
|
98
|
+
click.echo(
|
99
|
+
f"Update catalog target with relationship guid of {relationship_guid} to a catalog target name of "
|
100
|
+
f"{catalog_target_name} with a return guid of {guid}"
|
101
|
+
)
|
86
102
|
|
87
103
|
except (InvalidParameterException, PropertyServerException) as e:
|
88
104
|
print_exception_response(e)
|
89
105
|
|
90
106
|
|
91
|
-
@click.command(
|
107
|
+
@click.command("stop")
|
92
108
|
@click.pass_context
|
93
109
|
def stop_server(ctx):
|
94
110
|
"""Stop an integration daemon"""
|
95
111
|
try:
|
96
112
|
c = ctx.obj
|
97
|
-
p_client = Platform(
|
113
|
+
p_client = Platform(
|
114
|
+
c.integration_daemon, c.integration_daemon_url, c.userid, c.password
|
115
|
+
)
|
98
116
|
|
99
117
|
p_client.shutdown_server()
|
100
118
|
|
@@ -103,13 +121,15 @@ def stop_server(ctx):
|
|
103
121
|
print_exception_response(e)
|
104
122
|
|
105
123
|
|
106
|
-
@click.command(
|
124
|
+
@click.command("start")
|
107
125
|
@click.pass_context
|
108
126
|
def start_server(ctx):
|
109
|
-
"""Start or restart an integration daemon from its known configuration
|
127
|
+
"""Start or restart an integration daemon from its known configuration"""
|
110
128
|
try:
|
111
129
|
c = ctx.obj
|
112
|
-
p_client = Platform(
|
130
|
+
p_client = Platform(
|
131
|
+
c.integration_daemon, c.integration_daemon_url, c.userid, c.password
|
132
|
+
)
|
113
133
|
|
114
134
|
p_client.activate_server_stored_config()
|
115
135
|
|
@@ -117,4 +137,3 @@ def start_server(ctx):
|
|
117
137
|
|
118
138
|
except (InvalidParameterException, PropertyServerException) as e:
|
119
139
|
print_exception_response(e)
|
120
|
-
|
@@ -25,66 +25,90 @@ from pyegeria import (
|
|
25
25
|
InvalidParameterException,
|
26
26
|
PropertyServerException,
|
27
27
|
UserNotAuthorizedException,
|
28
|
-
Client,
|
28
|
+
Client,
|
29
|
+
ClassificationManager,
|
29
30
|
)
|
30
31
|
|
31
32
|
|
32
33
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
33
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
34
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
35
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
36
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
42
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
43
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
44
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
45
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
46
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
47
|
+
|
48
|
+
|
49
|
+
def display_elements(
|
50
|
+
om_type: str,
|
51
|
+
server: str,
|
52
|
+
url: str,
|
53
|
+
username: str,
|
54
|
+
user_password: str,
|
55
|
+
jupyter: bool = EGERIA_JUPYTER,
|
56
|
+
width: int = EGERIA_WIDTH,
|
57
|
+
):
|
49
58
|
c = ClassificationManager(server, url, user_id=username, user_pwd=user_password)
|
50
59
|
|
51
60
|
bearer_token = c.create_egeria_bearer_token(username, user_password)
|
52
61
|
|
53
62
|
try:
|
54
|
-
console = Console(
|
63
|
+
console = Console(
|
64
|
+
width=width, force_terminal=not jupyter, style="bold white on black"
|
65
|
+
)
|
55
66
|
r = c.get_elements(om_type)
|
56
67
|
if type(r) is not list:
|
57
68
|
print(f"\n\n\tno elements found: {r}")
|
58
69
|
sys.exit(1)
|
59
70
|
|
60
|
-
tree = Tree(
|
61
|
-
|
71
|
+
tree = Tree(
|
72
|
+
f"Elements for Open Metadata Type:{om_type}\n* There are {len(r)} elements",
|
73
|
+
style="bold bright_white on black",
|
74
|
+
guide_style="bold bright_blue",
|
75
|
+
)
|
62
76
|
t = tree.add(f"Elements for {om_type}", style="bold bright_white on black")
|
63
77
|
for element in r:
|
64
|
-
header = element[
|
65
|
-
el_type = header["type"][
|
66
|
-
el_home = header[
|
67
|
-
el_create_time = header[
|
68
|
-
el_guid = header[
|
69
|
-
|
70
|
-
el_md = (
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
78
|
+
header = element["elementHeader"]
|
79
|
+
el_type = header["type"]["typeName"]
|
80
|
+
el_home = header["origin"]["homeMetadataCollectionName"]
|
81
|
+
el_create_time = header["versions"]["createTime"]
|
82
|
+
el_guid = header["guid"]
|
83
|
+
|
84
|
+
el_md = (
|
85
|
+
f"#### Element Basics\n"
|
86
|
+
f"* **Type**: {el_type}\n"
|
87
|
+
f"* **Home**: {el_home}\n"
|
88
|
+
f"* **Created**: {el_create_time}\n"
|
89
|
+
f"* **GUID**: {el_guid}\n ---\n"
|
90
|
+
)
|
91
|
+
for prop in element["properties"].keys():
|
76
92
|
el_md += f"* **{prop}**: {element['properties'][prop]}\n"
|
77
93
|
|
78
94
|
el_out = Markdown(el_md)
|
79
|
-
p = Panel.fit(
|
80
|
-
|
95
|
+
p = Panel.fit(
|
96
|
+
el_out,
|
97
|
+
title=element["properties"]["qualifiedName"],
|
98
|
+
style="bold white on black",
|
99
|
+
)
|
81
100
|
t = tree.add(p)
|
82
101
|
|
83
102
|
print(tree)
|
84
103
|
|
85
104
|
c.close_session()
|
86
105
|
|
87
|
-
except (
|
106
|
+
except (
|
107
|
+
InvalidParameterException,
|
108
|
+
PropertyServerException,
|
109
|
+
UserNotAuthorizedException,
|
110
|
+
ValueError,
|
111
|
+
) as e:
|
88
112
|
if type(e) is str:
|
89
113
|
console.print_exception()
|
90
114
|
else:
|
@@ -92,7 +116,6 @@ def display_elements(om_type: str, server: str, url: str, username: str, user_pa
|
|
92
116
|
console.print(f"\n ===> Looks like the type {om_type} isn't known...\n")
|
93
117
|
|
94
118
|
|
95
|
-
|
96
119
|
def main():
|
97
120
|
parser = argparse.ArgumentParser()
|
98
121
|
parser.add_argument("--server", help="Name of the server to display status for")
|
@@ -109,9 +132,11 @@ def main():
|
|
109
132
|
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
110
133
|
|
111
134
|
try:
|
112
|
-
om_type = Prompt.ask(
|
135
|
+
om_type = Prompt.ask(
|
136
|
+
"Enter the Open Metadata Type to find Elements for", default=None
|
137
|
+
)
|
113
138
|
display_elements(om_type, server, url, userid, user_pass)
|
114
|
-
except
|
139
|
+
except KeyboardInterrupt:
|
115
140
|
pass
|
116
141
|
|
117
142
|
|
@@ -24,49 +24,68 @@ from pyegeria import (
|
|
24
24
|
InvalidParameterException,
|
25
25
|
PropertyServerException,
|
26
26
|
UserNotAuthorizedException,
|
27
|
-
Client,
|
27
|
+
Client,
|
28
|
+
ClassificationManager,
|
28
29
|
)
|
29
30
|
|
30
31
|
|
31
32
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
32
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
33
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
34
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
35
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
33
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
34
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
35
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
36
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
37
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
38
|
+
)
|
39
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
40
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
41
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
42
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
43
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
44
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
45
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
46
|
+
|
47
|
+
|
48
|
+
def display_guid(
|
49
|
+
guid: str,
|
50
|
+
server: str,
|
51
|
+
url: str,
|
52
|
+
username: str,
|
53
|
+
user_password: str,
|
54
|
+
jupyter: bool = EGERIA_JUPYTER,
|
55
|
+
width: int = EGERIA_WIDTH,
|
56
|
+
):
|
48
57
|
c = Client(server, url, user_id=username)
|
49
|
-
url = (
|
50
|
-
|
58
|
+
url = (
|
59
|
+
f"{url}/servers/{server}/open-metadata/repository-services/users/{username}/"
|
60
|
+
f"instances/entity/{guid}"
|
61
|
+
)
|
51
62
|
# c = ClassificationManager(server, url)
|
52
63
|
|
53
64
|
bearer_token = c.create_egeria_bearer_token(username, user_password)
|
54
65
|
|
55
66
|
try:
|
56
|
-
console = Console(
|
67
|
+
console = Console(
|
68
|
+
width=width, force_terminal=not jupyter, style="bold white on black"
|
69
|
+
)
|
57
70
|
r = c.make_request("GET", url)
|
58
71
|
if r.status_code == 200:
|
59
72
|
pass
|
60
73
|
# r = c.retrieve_instance_for_guid(guid)
|
61
|
-
e = r.json()[
|
62
|
-
p = e[
|
74
|
+
e = r.json()["entity"]
|
75
|
+
p = e["properties"]["instanceProperties"]
|
63
76
|
|
64
77
|
type_name = Text(f"Type is: {e['type']['typeDefName']}")
|
65
|
-
metadataCollection = Text(
|
78
|
+
metadataCollection = Text(
|
79
|
+
f"Metadadata Collection: {e['metadataCollectionName']}"
|
80
|
+
)
|
66
81
|
created = Text(f"Created at: {e['createTime']}")
|
67
82
|
details = Text(f"Details: {json.dumps(p, indent=2)}")
|
68
83
|
|
69
|
-
tree = Tree(
|
84
|
+
tree = Tree(
|
85
|
+
f"{guid}",
|
86
|
+
style="bold bright_white on black",
|
87
|
+
guide_style="bold bright_blue",
|
88
|
+
)
|
70
89
|
|
71
90
|
tree = tree.add(type_name)
|
72
91
|
tree.add(metadataCollection)
|
@@ -76,7 +95,12 @@ def display_guid(guid: str, server: str, url: str, username: str, user_password:
|
|
76
95
|
|
77
96
|
c.close_session()
|
78
97
|
|
79
|
-
except (
|
98
|
+
except (
|
99
|
+
InvalidParameterException,
|
100
|
+
PropertyServerException,
|
101
|
+
UserNotAuthorizedException,
|
102
|
+
ValueError,
|
103
|
+
) as e:
|
80
104
|
if type(e) is str:
|
81
105
|
console.print_exception()
|
82
106
|
else:
|
@@ -84,7 +108,6 @@ def display_guid(guid: str, server: str, url: str, username: str, user_password:
|
|
84
108
|
console.print(f"\n ===> Looks like the GUID isn't known...\n")
|
85
109
|
|
86
110
|
|
87
|
-
|
88
111
|
def main():
|
89
112
|
parser = argparse.ArgumentParser()
|
90
113
|
parser.add_argument("--server", help="Name of the server to display status for")
|
@@ -103,7 +126,7 @@ def main():
|
|
103
126
|
try:
|
104
127
|
guid = Prompt.ask("Enter the GUID to retrieve", default=None)
|
105
128
|
display_guid(guid, server, url, userid, user_pass)
|
106
|
-
except
|
129
|
+
except KeyboardInterrupt:
|
107
130
|
pass
|
108
131
|
|
109
132
|
|
@@ -21,26 +21,33 @@ from pyegeria import (
|
|
21
21
|
PropertyServerException,
|
22
22
|
UserNotAuthorizedException,
|
23
23
|
print_exception_response,
|
24
|
-
RegisteredInfo
|
24
|
+
RegisteredInfo,
|
25
25
|
)
|
26
26
|
|
27
27
|
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
28
|
-
EGERIA_KAFKA_ENDPOINT = os.environ.get(
|
29
|
-
EGERIA_PLATFORM_URL = os.environ.get(
|
30
|
-
EGERIA_VIEW_SERVER = os.environ.get(
|
31
|
-
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
28
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
29
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
30
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
31
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
32
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
33
|
+
)
|
34
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
35
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
36
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
37
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
38
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
39
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
40
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
41
|
+
|
42
|
+
|
43
|
+
def display_asset_types(
|
44
|
+
server: str,
|
45
|
+
url: str,
|
46
|
+
username: str,
|
47
|
+
user_password: str,
|
48
|
+
jupyter: bool = EGERIA_JUPYTER,
|
49
|
+
width: int = EGERIA_WIDTH,
|
50
|
+
):
|
44
51
|
r_client = RegisteredInfo(server, url, username)
|
45
52
|
token = r_client.create_egeria_bearer_token(username, user_password)
|
46
53
|
asset_types = r_client.list_asset_types()
|
@@ -56,7 +63,7 @@ def display_asset_types(server: str, url: str, username: str, user_password: str
|
|
56
63
|
show_lines=True,
|
57
64
|
box=box.ROUNDED,
|
58
65
|
caption=f"Asset Types from Server '{server}' @ Platform - {url}",
|
59
|
-
expand=True
|
66
|
+
expand=True,
|
60
67
|
)
|
61
68
|
|
62
69
|
table.add_column("Name")
|
@@ -74,9 +81,7 @@ def display_asset_types(server: str, url: str, username: str, user_password: str
|
|
74
81
|
description = a_type.get("description", "none")
|
75
82
|
version = a_type.get("version", " ")
|
76
83
|
super_type = a_type.get("superType", "none")
|
77
|
-
table.add_row(
|
78
|
-
name, description, super_type, str(version)
|
79
|
-
)
|
84
|
+
table.add_row(name, description, super_type, str(version))
|
80
85
|
return table
|
81
86
|
|
82
87
|
try:
|
@@ -84,7 +89,11 @@ def display_asset_types(server: str, url: str, username: str, user_password: str
|
|
84
89
|
with console.pager(styles=True):
|
85
90
|
console.print(generate_table())
|
86
91
|
|
87
|
-
except (
|
92
|
+
except (
|
93
|
+
InvalidParameterException,
|
94
|
+
PropertyServerException,
|
95
|
+
UserNotAuthorizedException,
|
96
|
+
) as e:
|
88
97
|
print_exception_response(e)
|
89
98
|
assert e.related_http_code != "200", "Invalid parameters"
|
90
99
|
finally:
|
@@ -109,5 +118,6 @@ def main():
|
|
109
118
|
|
110
119
|
display_asset_types(server, url, userid, user_pass)
|
111
120
|
|
121
|
+
|
112
122
|
if __name__ == "__main__":
|
113
|
-
main()
|
123
|
+
main()
|