pyegeria 0.7.5__tar.gz → 0.7.7__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.7.5 → pyegeria-0.7.7}/PKG-INFO +1 -1
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cli/egeria.py +21 -1
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cli/egeria_tech.py +22 -0
- pyegeria-0.7.7/examples/widgets/tech/get_element_info.py +121 -0
- pyegeria-0.7.7/examples/widgets/tech/list_elements.py +127 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyproject.toml +7 -5
- {pyegeria-0.7.5 → pyegeria-0.7.7}/LICENSE +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/README.md +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/doc_samples/Create_Collection_Sample.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/README.md +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/__init__.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/get_asset_graph.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/get_collection.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/get_project_structure.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/get_tech_type_elements.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/get_tech_type_template.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/list_assets.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/list_cert_types.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/list_glossary.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/list_projects.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/list_tech_types.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cat/list_todos.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cli/__init__.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cli/egeria_cat.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cli/egeria_my.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cli/egeria_ops.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/cli/ops_config.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/my/README.md +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/my/__init__.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/my/list_my_profile.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/my/list_my_roles.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/my/monitor_my_todos.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/my/monitor_open_todos.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/my/my_profile_actions.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/README.md +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/__init__.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/engine_actions.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/integration_daemon_actions.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/list_catalog_targets.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/load_archive.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/monitor_asset_events.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/monitor_coco_status.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/monitor_engine_activity.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/monitor_gov_eng_status.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/monitor_integ_daemon_status.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/monitor_platform_status.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/monitor_server_list.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/monitor_server_status.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/refresh_integration_daemon.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/ops/restart_integration_daemon.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/tech/README.md +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/tech/__init__.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/tech/get_guid_info.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/tech/get_tech_details.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/tech/list_asset_types.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/tech/list_registered_services.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/tech/list_relationship_types.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/tech/list_tech_templates.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/examples/widgets/tech/list_valid_metadata_values.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/Xloaded_resources_omvs.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/__init__.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/_client.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/_deprecated_gov_engine.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/_exceptions.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/_globals.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/_validators.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/action_author_omvs.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/asset_catalog_omvs.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/automated_curation_omvs.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/classification_manager_omvs.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/collection_manager_omvs.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/core_omag_server_config.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/create_tech_guid_lists.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/feedback_manager_omvs.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/full_omag_server_config.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/glossary_browser_omvs.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/glossary_manager_omvs.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/my_profile_omvs.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/platform_services.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/project_manager_omvs.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/registered_info.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/runtime_manager_omvs.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/server_operations.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/utils.py +0 -0
- {pyegeria-0.7.5 → pyegeria-0.7.7}/pyegeria/valid_metadata_omvs.py +0 -0
@@ -50,7 +50,8 @@ from examples.widgets.tech.list_registered_services import display_registered_sv
|
|
50
50
|
from examples.widgets.tech.list_relationship_types import display_relationship_types
|
51
51
|
from examples.widgets.tech.list_tech_templates import display_templates_spec
|
52
52
|
from examples.widgets.tech.list_valid_metadata_values import display_metadata_values
|
53
|
-
|
53
|
+
from examples.widgets.tech.get_element_info import display_elements
|
54
|
+
from examples.widgets.tech.list_elements import list_elements
|
54
55
|
|
55
56
|
@tui()
|
56
57
|
# @tui('menu', 'menu', 'A textual command line interface')
|
@@ -195,6 +196,25 @@ def show(ctx):
|
|
195
196
|
"""Display an Egeria Object"""
|
196
197
|
pass
|
197
198
|
|
199
|
+
@show.command("get-element-info")
|
200
|
+
@click.pass_context
|
201
|
+
@click.option('--om_type', default='Project', help='Metadata type to query')
|
202
|
+
def get_element_info(ctx, om_type):
|
203
|
+
"""Display the valid metadata values for a property and type"""
|
204
|
+
c = ctx.obj
|
205
|
+
display_elements(om_type, c.view_server, c.view_server_url,
|
206
|
+
c.userid, c.password, c.jupyter, c.width)
|
207
|
+
|
208
|
+
@show.command("list-elements")
|
209
|
+
@click.pass_context
|
210
|
+
@click.option('--om_type', default='Project', help='Metadata type to query')
|
211
|
+
def get_element_info(ctx, om_type):
|
212
|
+
"""Display the valid metadata values for a property and type"""
|
213
|
+
c = ctx.obj
|
214
|
+
list_elements(om_type, c.view_server, c.view_server_url,
|
215
|
+
c.userid, c.password, c.jupyter, c.width)
|
216
|
+
|
217
|
+
|
198
218
|
|
199
219
|
@show.command('guid-info')
|
200
220
|
@click.argument('guid', nargs=1)
|
@@ -22,6 +22,9 @@ from examples.widgets.tech.list_relationship_types import display_relationship_t
|
|
22
22
|
from examples.widgets.tech.list_tech_templates import display_templates_spec
|
23
23
|
from examples.widgets.tech.list_valid_metadata_values import display_metadata_values
|
24
24
|
from examples.widgets.cat.get_tech_type_template import template_viewer
|
25
|
+
from examples.widgets.tech.get_element_info import display_elements
|
26
|
+
from examples.widgets.tech.list_elements import list_elements
|
27
|
+
|
25
28
|
|
26
29
|
|
27
30
|
# from pyegeria import ServerOps
|
@@ -204,6 +207,25 @@ def valid_metadata_values(ctx, property, type_name):
|
|
204
207
|
display_metadata_values(property, type_name, c.view_server, c.view_server_url,
|
205
208
|
c.userid, c.password, False, c.jupyter, c.width)
|
206
209
|
|
210
|
+
@show.command("get-element-info")
|
211
|
+
@click.pass_context
|
212
|
+
@click.option('--om_type', default='Project', help='Metadata type to query')
|
213
|
+
def get_element_info(ctx, om_type):
|
214
|
+
"""Display the valid metadata values for a property and type"""
|
215
|
+
c = ctx.obj
|
216
|
+
display_elements(om_type, c.view_server, c.view_server_url,
|
217
|
+
c.userid, c.password, c.jupyter, c.width)
|
218
|
+
|
219
|
+
@show.command("list-elements")
|
220
|
+
@click.pass_context
|
221
|
+
@click.option('--om_type', default='Project', help='Metadata type to query')
|
222
|
+
def get_element_info(ctx, om_type):
|
223
|
+
"""Display the valid metadata values for a property and type"""
|
224
|
+
c = ctx.obj
|
225
|
+
list_elements(om_type, c.view_server, c.view_server_url,
|
226
|
+
c.userid, c.password, c.jupyter, c.width)
|
227
|
+
|
228
|
+
|
207
229
|
|
208
230
|
#
|
209
231
|
# Tell
|
@@ -0,0 +1,121 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-Lic
|
4
|
+
ense-Identifier: Apache-2.0
|
5
|
+
Copyright Contributors to the ODPi Egeria project.
|
6
|
+
|
7
|
+
Unit tests for the Utils helper functions using the Pytest framework.
|
8
|
+
|
9
|
+
|
10
|
+
A simple display for glossary terms
|
11
|
+
"""
|
12
|
+
import argparse
|
13
|
+
import json
|
14
|
+
import os
|
15
|
+
import sys
|
16
|
+
|
17
|
+
from rich import print, box
|
18
|
+
from rich.console import Console
|
19
|
+
from rich.markdown import Markdown
|
20
|
+
from rich.panel import Panel
|
21
|
+
|
22
|
+
from rich.prompt import Prompt
|
23
|
+
from rich.text import Text
|
24
|
+
from rich.tree import Tree
|
25
|
+
|
26
|
+
from pyegeria import (
|
27
|
+
InvalidParameterException,
|
28
|
+
PropertyServerException,
|
29
|
+
UserNotAuthorizedException,
|
30
|
+
Client, ClassificationManager
|
31
|
+
)
|
32
|
+
|
33
|
+
|
34
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
35
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
36
|
+
EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
|
37
|
+
EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
|
38
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
|
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_elements(om_type: str, server: str, url: str, username: str, user_password: str,
|
49
|
+
jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH
|
50
|
+
):
|
51
|
+
c = ClassificationManager(server, url, user_id=username, user_pwd=user_password)
|
52
|
+
|
53
|
+
bearer_token = c.create_egeria_bearer_token(username, user_password)
|
54
|
+
|
55
|
+
try:
|
56
|
+
console = Console(width=width, force_terminal=not jupyter, style="bold white on black")
|
57
|
+
r = c.get_elements(om_type)
|
58
|
+
if type(r) is not list:
|
59
|
+
print(f"\n\n\tno elements found: {r}")
|
60
|
+
sys.exit(1)
|
61
|
+
|
62
|
+
tree = Tree(f"Elements for Open Metadata Type:{om_type}\n* There are {len(r)} elements", style="bold bright_white on black",
|
63
|
+
guide_style="bold bright_blue")
|
64
|
+
t = tree.add(f"Elements for {om_type}", style="bold bright_white on black")
|
65
|
+
for element in r:
|
66
|
+
header = element['elementHeader']
|
67
|
+
el_type = header["type"]['typeName']
|
68
|
+
el_home = header['origin']['homeMetadataCollectionName']
|
69
|
+
el_create_time = header['versions']['createTime']
|
70
|
+
el_guid = header['guid']
|
71
|
+
|
72
|
+
el_md = (f"#### Element Basics\n"
|
73
|
+
f"* **Type**: {el_type}\n"
|
74
|
+
f"* **Home**: {el_home}\n"
|
75
|
+
f"* **Created**: {el_create_time}\n"
|
76
|
+
f"* **GUID**: {el_guid}\n ---\n")
|
77
|
+
for prop in element['properties'].keys():
|
78
|
+
el_md += f"* **{prop}**: {element['properties'][prop]}\n"
|
79
|
+
|
80
|
+
el_out = Markdown(el_md)
|
81
|
+
p = Panel.fit(el_out, title=element['properties']['qualifiedName'],
|
82
|
+
style = "bold white on black")
|
83
|
+
t = tree.add(p)
|
84
|
+
|
85
|
+
print(tree)
|
86
|
+
|
87
|
+
c.close_session()
|
88
|
+
|
89
|
+
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException, ValueError) as e:
|
90
|
+
if type(e) is str:
|
91
|
+
console.print_exception()
|
92
|
+
else:
|
93
|
+
# console.print_exception(show_locals=True)
|
94
|
+
console.print(f"\n ===> Looks like the type {om_type} isn't known...\n")
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
def main():
|
99
|
+
parser = argparse.ArgumentParser()
|
100
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
101
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
102
|
+
parser.add_argument("--userid", help="User Id")
|
103
|
+
parser.add_argument("--password", help="User Password")
|
104
|
+
|
105
|
+
# parser.add_argument("--sponsor", help="Name of sponsor to search")
|
106
|
+
args = parser.parse_args()
|
107
|
+
|
108
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
109
|
+
url = args.url if args.url is not None else EGERIA_VIEW_SERVER_URL
|
110
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
111
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
112
|
+
|
113
|
+
try:
|
114
|
+
om_type = Prompt.ask("Enter the Open Metadata Type to find Elements for", default=None)
|
115
|
+
display_elements(om_type, server, url, userid, user_pass)
|
116
|
+
except (KeyboardInterrupt):
|
117
|
+
pass
|
118
|
+
|
119
|
+
|
120
|
+
if __name__ == "__main__":
|
121
|
+
main()
|
@@ -0,0 +1,127 @@
|
|
1
|
+
"""This creates a templates guid file from the core metadata archive"""
|
2
|
+
from rich.markdown import Markdown
|
3
|
+
from rich.prompt import Prompt
|
4
|
+
import os
|
5
|
+
import argparse
|
6
|
+
import time
|
7
|
+
import sys
|
8
|
+
from rich import box
|
9
|
+
from rich.console import Console
|
10
|
+
from rich.table import Table
|
11
|
+
|
12
|
+
from pyegeria import (
|
13
|
+
InvalidParameterException,
|
14
|
+
PropertyServerException,
|
15
|
+
UserNotAuthorizedException,
|
16
|
+
print_exception_response,
|
17
|
+
ClassificationManager
|
18
|
+
)
|
19
|
+
|
20
|
+
|
21
|
+
console = Console()
|
22
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
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('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
|
27
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
|
28
|
+
EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
29
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
30
|
+
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
31
|
+
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
32
|
+
EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
|
33
|
+
EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
def list_elements(om_type:str, server: str,
|
38
|
+
url: str, username: str, password: str, jupyter:bool=EGERIA_JUPYTER, width:int = EGERIA_WIDTH
|
39
|
+
):
|
40
|
+
|
41
|
+
c_client = ClassificationManager(server, url, user_id=username, user_pwd=password)
|
42
|
+
token = c_client.create_egeria_bearer_token()
|
43
|
+
elements = c_client.get_elements(om_type)
|
44
|
+
|
45
|
+
def generate_table() -> Table:
|
46
|
+
"""Make a new table."""
|
47
|
+
table = Table(
|
48
|
+
caption=f"Metadata Elements for: {url} - {server} @ {time.asctime()}",
|
49
|
+
style="bold bright_white on black",
|
50
|
+
row_styles=["bold bright_white on black"],
|
51
|
+
header_style="white on dark_blue",
|
52
|
+
title_style="bold bright_white on black",
|
53
|
+
caption_style="white on black",
|
54
|
+
show_lines=True,
|
55
|
+
box=box.ROUNDED,
|
56
|
+
title=f"Elements for Open Metadata Type: '{om_type}' ",
|
57
|
+
expand=True,
|
58
|
+
# width=500
|
59
|
+
)
|
60
|
+
|
61
|
+
table.add_column("Qualified Name")
|
62
|
+
table.add_column("Created")
|
63
|
+
table.add_column("Home Store")
|
64
|
+
table.add_column("GUID", width = 38,no_wrap=True)
|
65
|
+
table.add_column("Properties")
|
66
|
+
|
67
|
+
|
68
|
+
if type(elements) is list:
|
69
|
+
for element in elements:
|
70
|
+
header = element['elementHeader']
|
71
|
+
el_q_name = element['properties']['qualifiedName']
|
72
|
+
el_type = header["type"]['typeName']
|
73
|
+
el_home = header['origin']['homeMetadataCollectionName']
|
74
|
+
el_create_time = header['versions']['createTime'][:-10]
|
75
|
+
el_guid = header['guid']
|
76
|
+
|
77
|
+
el_props_md = ""
|
78
|
+
for prop in element['properties'].keys():
|
79
|
+
el_props_md += f"* **{prop}**: {element['properties'][prop]}\n"
|
80
|
+
|
81
|
+
el_props_out = Markdown(el_props_md)
|
82
|
+
table.add_row(el_q_name, el_create_time, el_home, el_guid, el_props_out)
|
83
|
+
|
84
|
+
return table
|
85
|
+
else:
|
86
|
+
print("Unknown Open Metadata type")
|
87
|
+
sys.exit(1)
|
88
|
+
|
89
|
+
try:
|
90
|
+
console = Console(width=width, force_terminal=not jupyter)
|
91
|
+
|
92
|
+
with console.pager(styles=True):
|
93
|
+
console.print(generate_table())
|
94
|
+
|
95
|
+
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
|
96
|
+
print_exception_response(e)
|
97
|
+
assert e.related_http_code != "200", "Invalid parameters"
|
98
|
+
finally:
|
99
|
+
c_client.close_session()
|
100
|
+
|
101
|
+
|
102
|
+
def main():
|
103
|
+
parser = argparse.ArgumentParser()
|
104
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
105
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
106
|
+
parser.add_argument("--userid", help="User Id")
|
107
|
+
parser.add_argument("--password", help="Password")
|
108
|
+
|
109
|
+
args = parser.parse_args()
|
110
|
+
|
111
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
112
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
113
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
114
|
+
password = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
115
|
+
|
116
|
+
try:
|
117
|
+
om_type = Prompt.ask("Enter the Open Metadata Type to find elements of:", default="GlossaryTerm")
|
118
|
+
list_elements(om_type, server, url, userid, password)
|
119
|
+
except(KeyboardInterrupt):
|
120
|
+
pass
|
121
|
+
|
122
|
+
|
123
|
+
if __name__ == "__main__":
|
124
|
+
main()
|
125
|
+
|
126
|
+
|
127
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "pyegeria"
|
3
|
-
version = "0.7.
|
3
|
+
version = "0.7.7"
|
4
4
|
license = 'Apache 2.0'
|
5
5
|
authors = ["Dan Wolfson <dan.wolfson@pdr-associates.com>"]
|
6
6
|
readme = "README.md"
|
@@ -86,13 +86,13 @@ pytest = "^8.2.2"
|
|
86
86
|
monitor_open_todos = "examples.widgets.my.monitor_open_todos:main"
|
87
87
|
monitor_my_todos = "examples.widgets.my.monitor_my_todos:main"
|
88
88
|
|
89
|
-
|
89
|
+
hey_egeria_ops = "examples.widgets.cli.egeria_ops:cli"
|
90
90
|
# egeria_ops_menu = "examples.widgets.cli.egeria_ops:menu"
|
91
|
-
|
91
|
+
hey_egeria_cat = "examples.widgets.cli.egeria_cat:cli"
|
92
92
|
# egeria_cat_menu = "examples.widgets.cli.egeria_cat:menu"
|
93
|
-
|
93
|
+
hey_egeria_tech = "examples.widgets.cli.egeria_cat:cli"
|
94
94
|
# egeria_tech_menu = "examples.widgets.cli.egeria_cat:menu"
|
95
|
-
|
95
|
+
hey_egeria_per = "examples.widgets.cli.egeria_per:cli"
|
96
96
|
hey_egeria = "examples.widgets.cli.egeria:cli"
|
97
97
|
|
98
98
|
get_guid_info = "examples.widgets.tech.get_guid_info:main"
|
@@ -101,5 +101,7 @@ pytest = "^8.2.2"
|
|
101
101
|
list_registered_services = "examples.widgets.tech.list_registered_services:main"
|
102
102
|
list_relationship_types = "examples.widgets.tech.list_relationship_types:main"
|
103
103
|
list_tech_templates = "examples.widgets.tech.list_tech_templates:main"
|
104
|
+
get_element_info = "examples.widgets.tech.get_element_info:main"
|
105
|
+
list_elements = "examples.widgets.tech.list_elements:main"
|
104
106
|
|
105
107
|
list_valid_metadata_values = "examples.widgets.tech.list_valid_metadata_values:main"
|
File without changes
|
File without changes
|
File without changes
|
{pyegeria-0.7.5 → pyegeria-0.7.7}/examples/doc_samples/Create_Sustainability_Collection_Sample.py
RENAMED
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
|