pyegeria 0.7.16__tar.gz → 0.7.17__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.16 → pyegeria-0.7.17}/PKG-INFO +1 -1
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cli/egeria.py +5 -7
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cli/egeria_tech.py +5 -7
- pyegeria-0.7.17/examples/widgets/tech/list_related_specification.py +144 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyproject.toml +2 -2
- {pyegeria-0.7.16 → pyegeria-0.7.17}/LICENSE +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/README.md +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/doc_samples/Create_Collection_Sample.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/README.md +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/__init__.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/get_asset_graph.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/get_collection.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/get_project_structure.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/get_tech_type_elements.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/get_tech_type_template.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/list_assets.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/list_cert_types.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/list_glossary.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/list_projects.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/list_relationships.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/list_tech_types.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cat/list_todos.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cli/__init__.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cli/egeria_cat.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cli/egeria_my.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cli/egeria_ops.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/cli/ops_config.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/my/README.md +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/my/__init__.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/my/list_my_profile.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/my/list_my_roles.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/my/monitor_my_todos.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/my/monitor_open_todos.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/my/my_profile_actions.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/README.md +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/__init__.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/engine_actions.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/integration_daemon_actions.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/list_catalog_targets.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/load_archive.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/monitor_asset_events.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/monitor_coco_status.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/monitor_engine_activity.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/monitor_gov_eng_status.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/monitor_integ_daemon_status.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/monitor_platform_status.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/monitor_server_list.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/monitor_server_status.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/refresh_integration_daemon.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/ops/restart_integration_daemon.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/tech/README.md +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/tech/__init__.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/tech/get_guid_info.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/tech/get_tech_details.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/tech/list_asset_types.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/tech/list_elements.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/tech/list_registered_services.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/tech/list_relationship_types.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/tech/list_tech_templates.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/examples/widgets/tech/list_valid_metadata_values.py +0 -0
- /pyegeria-0.7.16/examples/widgets/tech/list_related_elements.py → /pyegeria-0.7.17/examples/widgets/tech/x_list_related_elements.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/Xloaded_resources_omvs.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/__init__.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/_client.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/_deprecated_gov_engine.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/_exceptions.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/_globals.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/_validators.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/action_author_omvs.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/asset_catalog_omvs.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/automated_curation_omvs.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/classification_manager_omvs.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/collection_manager_omvs.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/core_omag_server_config.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/create_tech_guid_lists.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/feedback_manager_omvs.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/full_omag_server_config.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/glossary_browser_omvs.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/glossary_manager_omvs.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/my_profile_omvs.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/platform_services.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/project_manager_omvs.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/registered_info.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/runtime_manager_omvs.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/server_operations.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/utils.py +0 -0
- {pyegeria-0.7.16 → pyegeria-0.7.17}/pyegeria/valid_metadata_omvs.py +0 -0
@@ -52,7 +52,7 @@ from examples.widgets.tech.list_relationship_types import display_relationship_t
|
|
52
52
|
from examples.widgets.tech.list_tech_templates import display_templates_spec
|
53
53
|
from examples.widgets.tech.list_valid_metadata_values import display_metadata_values
|
54
54
|
from examples.widgets.tech.list_elements import list_elements
|
55
|
-
from examples.widgets.tech.
|
55
|
+
from examples.widgets.tech.list_related_specification import display_related_specification
|
56
56
|
|
57
57
|
|
58
58
|
@tui()
|
@@ -277,15 +277,13 @@ def show_registered_services(ctx, services):
|
|
277
277
|
display_registered_svcs(services, c.view_server, c.view_server_url,
|
278
278
|
c.userid, c.password, c.jupyter, c.width)
|
279
279
|
|
280
|
-
@show.command('related-
|
280
|
+
@show.command('related-specifications')
|
281
281
|
@click.pass_context
|
282
282
|
@click.argument('element-guid')
|
283
|
-
|
284
|
-
|
285
|
-
@click.option('--om_type', default = None, help="Optional Open Metadata Type to filter by.")
|
286
|
-
def show_related_elements(ctx, element_guid, rel_type, om_type):
|
283
|
+
def show_related_specifications(ctx, element_guid):
|
284
|
+
"""List specifications related to the given Element"""
|
287
285
|
c = ctx.obj
|
288
|
-
|
286
|
+
display_related_specification(element_guid, c.view_server, c.view_server_url,
|
289
287
|
c.userid, c.password, c.jupyter, c.width)
|
290
288
|
|
291
289
|
|
@@ -23,7 +23,7 @@ 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
25
|
from examples.widgets.tech.list_elements import list_elements
|
26
|
-
from examples.widgets.tech.
|
26
|
+
from examples.widgets.tech.list_related_specification import display_related_specification
|
27
27
|
|
28
28
|
|
29
29
|
|
@@ -217,15 +217,13 @@ def get_element_info(ctx, om_type):
|
|
217
217
|
list_elements(om_type, c.view_server, c.view_server_url,
|
218
218
|
c.userid, c.password, c.jupyter, c.width)
|
219
219
|
|
220
|
-
@show.command('related-
|
220
|
+
@show.command('related-specifications')
|
221
221
|
@click.pass_context
|
222
222
|
@click.argument('element-guid')
|
223
|
-
|
224
|
-
|
225
|
-
@click.option('--om_type', default = None, help="Optional Open Metadata Type to filter by.")
|
226
|
-
def show_related_elements(ctx, element_guid, rel_type, om_type):
|
223
|
+
def show_related_specifications(ctx, element_guid):
|
224
|
+
"""List specifications related to the given Element"""
|
227
225
|
c = ctx.obj
|
228
|
-
|
226
|
+
display_related_specification(element_guid,c.view_server, c.view_server_url,
|
229
227
|
c.userid, c.password, c.jupyter, c.width)
|
230
228
|
|
231
229
|
#
|
@@ -0,0 +1,144 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
List elements related to given element guid by the specified relationship type. Optionally filter by a specified
|
7
|
+
open metadata type.
|
8
|
+
|
9
|
+
"""
|
10
|
+
import argparse
|
11
|
+
import os
|
12
|
+
import sys
|
13
|
+
import time
|
14
|
+
|
15
|
+
from rich import box
|
16
|
+
from rich.console import Console
|
17
|
+
from rich.markdown import Markdown
|
18
|
+
from rich.prompt import Prompt
|
19
|
+
from rich.table import Table
|
20
|
+
|
21
|
+
from pyegeria import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException,
|
22
|
+
print_exception_response, ClassificationManager)
|
23
|
+
|
24
|
+
console = Console()
|
25
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
26
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
27
|
+
EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
|
28
|
+
EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
|
29
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
|
30
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
|
31
|
+
EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
32
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
33
|
+
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
34
|
+
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
35
|
+
EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
|
36
|
+
EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
|
37
|
+
|
38
|
+
|
39
|
+
def display_related_specification(element_guid: str, server: str, url: str, username: str, password: str,
|
40
|
+
jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
|
41
|
+
c_client = ClassificationManager(server, url, user_id=username, user_pwd=password)
|
42
|
+
token = c_client.create_egeria_bearer_token()
|
43
|
+
rel_el = c_client.get_related_elements(element_guid, 'SpecificationPropertyAssignment', None)
|
44
|
+
|
45
|
+
if type(rel_el) is str:
|
46
|
+
print(f"\n\nWas not able list related specifications for {element_guid}\n\n")
|
47
|
+
sys.exit(0)
|
48
|
+
|
49
|
+
related_elements: dict = {}
|
50
|
+
|
51
|
+
def generate_table() -> Table:
|
52
|
+
"""Make a new table."""
|
53
|
+
table = Table(title=f"Specifications related to: {element_guid} @ {time.asctime()}",
|
54
|
+
style="bold bright_white on black", row_styles=["bold bright_white on black"],
|
55
|
+
header_style="white on dark_blue", title_style="bold bright_white on black", caption_style="white on black",
|
56
|
+
show_lines=True, box=box.ROUNDED, caption=f"Elements from Server '{server}' @ Platform - {url}",
|
57
|
+
expand=True, # width=500
|
58
|
+
)
|
59
|
+
|
60
|
+
table.add_column("Name", justify='center', style="bold bright_white")
|
61
|
+
table.add_column("Specification", justify='center', style="bold bright_white")
|
62
|
+
|
63
|
+
for element in rel_el:
|
64
|
+
relationship_props = element["relationshipProperties"]['propertyType']
|
65
|
+
related_elements[relationship_props] = []
|
66
|
+
|
67
|
+
for element in rel_el:
|
68
|
+
relationship_props = element["relationshipProperties"]['propertyType']
|
69
|
+
|
70
|
+
rel_element = element['relatedElement']
|
71
|
+
el = rel_element["properties"]
|
72
|
+
re: dict = {}
|
73
|
+
|
74
|
+
re['case'] = el.get("isCaseSensitive", '---')
|
75
|
+
re['name'] = el.get("preferredValue", '---')
|
76
|
+
re['description'] = el.get("description", '---')
|
77
|
+
add = el.get("additionalProperties", '---')
|
78
|
+
if type(add) is str:
|
79
|
+
re['additional'] = add
|
80
|
+
else:
|
81
|
+
add_md = ""
|
82
|
+
for k in add.keys():
|
83
|
+
add_md += f"* {k}: {add[k]}\n"
|
84
|
+
re['additional'] = Markdown(add_md)
|
85
|
+
|
86
|
+
related_elements[relationship_props].append(re)
|
87
|
+
|
88
|
+
for kind in related_elements.keys():
|
89
|
+
|
90
|
+
spec_table = Table(expand=False, show_lines=True)
|
91
|
+
spec_table.add_column('Name')
|
92
|
+
spec_table.add_column('Case Sensitive?')
|
93
|
+
spec_table.add_column('Description')
|
94
|
+
spec_table.add_column('Additional Properties')
|
95
|
+
|
96
|
+
for spec_row in related_elements[kind]:
|
97
|
+
name = spec_row['name']
|
98
|
+
case = spec_row['case']
|
99
|
+
desc = spec_row['description']
|
100
|
+
additional_props = spec_row['additional']
|
101
|
+
spec_table.add_row(name, case, desc, additional_props)
|
102
|
+
|
103
|
+
table.add_row(kind, spec_table)
|
104
|
+
|
105
|
+
return table
|
106
|
+
|
107
|
+
try:
|
108
|
+
console = Console(width=width, force_terminal=not jupyter)
|
109
|
+
|
110
|
+
with console.pager(styles=True):
|
111
|
+
console.print(generate_table())
|
112
|
+
|
113
|
+
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
|
114
|
+
print_exception_response(e)
|
115
|
+
assert e.related_http_code != "200", "Invalid parameters"
|
116
|
+
finally:
|
117
|
+
c_client.close_session()
|
118
|
+
|
119
|
+
|
120
|
+
def main():
|
121
|
+
parser = argparse.ArgumentParser()
|
122
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
123
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
124
|
+
parser.add_argument("--userid", help="User Id")
|
125
|
+
parser.add_argument("--password", help="Password")
|
126
|
+
|
127
|
+
args = parser.parse_args()
|
128
|
+
|
129
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
130
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
131
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
132
|
+
password = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
133
|
+
guid = None
|
134
|
+
|
135
|
+
try:
|
136
|
+
element_guid = Prompt.ask("Enter an Element GUID find relationships for")
|
137
|
+
|
138
|
+
display_related_specification(element_guid, server, url, userid, password)
|
139
|
+
except(KeyboardInterrupt):
|
140
|
+
pass
|
141
|
+
|
142
|
+
|
143
|
+
if __name__ == "__main__":
|
144
|
+
main()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "pyegeria"
|
3
|
-
version = "0.7.
|
3
|
+
version = "0.7.17"
|
4
4
|
license = 'Apache 2.0'
|
5
5
|
authors = ["Dan Wolfson <dan.wolfson@pdr-associates.com>"]
|
6
6
|
readme = "README.md"
|
@@ -100,6 +100,6 @@ pytest = "^8.2.2"
|
|
100
100
|
list_tech_templates = "examples.widgets.tech.list_tech_templates:main"
|
101
101
|
get_element_info = "examples.widgets.tech.get_element_info:main"
|
102
102
|
list_elements = "examples.widgets.tech.list_elements:main"
|
103
|
-
|
103
|
+
list_related_specification = "examples.widgets.tech.list_related_specification:main"
|
104
104
|
|
105
105
|
list_valid_metadata_values = "examples.widgets.tech.list_valid_metadata_values:main"
|
File without changes
|
File without changes
|
File without changes
|
{pyegeria-0.7.16 → pyegeria-0.7.17}/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
|
File without changes
|
File without changes
|
File without changes
|