pyegeria 0.8.4.39__tar.gz → 0.8.4.41__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/PKG-INFO +1 -1
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cli/egeria_tech.py +61 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/load_archive.py +5 -1
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/list_elements.py +34 -4
- pyegeria-0.8.4.41/commands/tech/list_elements_for_classification.py +174 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/list_elements_x.py +12 -8
- pyegeria-0.8.4.41/commands/tech/list_related_elements.py +176 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/feedback_manager_omvs.py +1 -1
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/runtime_manager_omvs.py +8 -6
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyproject.toml +2 -2
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/LICENSE +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/README.md +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/README.md +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/__init__.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/get_asset_graph.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/get_collection.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/get_project_dependencies.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/get_project_structure.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/get_tech_type_elements.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/get_tech_type_template.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/list_archives.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/list_assets.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/list_cert_types.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/list_glossary.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/list_projects.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/list_relationships.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/list_tech_types.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/list_todos.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cat/list_user_ids.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cli/__init__.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cli/egeria.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cli/egeria_cat.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cli/egeria_my.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cli/egeria_ops.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/cli/ops_config.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/my/README.md +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/my/__init__.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/my/list_my_profile.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/my/list_my_roles.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/my/monitor_my_todos.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/my/monitor_open_todos.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/my/todo_actions.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/README.md +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/__init__.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/engine_actions.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/gov_server_actions.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/list_catalog_targets.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/monitor_asset_events.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/monitor_engine_activity.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/monitor_engine_activity_c.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/monitor_gov_eng_status.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/monitor_integ_daemon_status.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/monitor_platform_status.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/monitor_server_status.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/orig_monitor_server_list.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/orig_monitor_server_status.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/refresh_integration_daemon.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/ops/restart_integration_daemon.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/README.md +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/__init__.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/get_element_info.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/get_guid_info.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/get_tech_details.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/list_asset_types.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/list_registered_services.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/list_related_specification.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/list_relationship_types.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/list_tech_templates.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/list_valid_metadata_values.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/commands/tech/x_list_related_elements.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/__init__.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/_client.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/_deprecated_gov_engine.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/_exceptions.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/_globals.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/_validators.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/asset_catalog_omvs.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/automated_curation_omvs.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/classification_manager_omvs.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/collection_manager_omvs.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/core_omag_server_config.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/create_tech_guid_lists.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/egeria_cat_client.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/egeria_client.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/egeria_config_client.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/egeria_my_client.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/egeria_tech_client.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/full_omag_server_config.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/glossary_browser_omvs.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/glossary_manager_omvs.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/mermaid_utilities.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/my_profile_omvs.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/platform_services.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/project_manager_omvs.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/registered_info.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/server_operations.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/utils.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/valid_metadata_omvs.py +0 -0
- {pyegeria-0.8.4.39 → pyegeria-0.8.4.41}/pyegeria/x_action_author_omvs.py +0 -0
@@ -27,6 +27,8 @@ from commands.tech.get_element_info import display_elements
|
|
27
27
|
from commands.tech.list_related_specification import (
|
28
28
|
display_related_specification,
|
29
29
|
)
|
30
|
+
from commands.tech.list_related_elements import list_related_elements
|
31
|
+
from commands.tech.list_elements_for_classification import list_classified_elements
|
30
32
|
|
31
33
|
|
32
34
|
# from pyegeria import ServerOps
|
@@ -330,6 +332,65 @@ def show_relationship_types(ctx, rel_type):
|
|
330
332
|
)
|
331
333
|
|
332
334
|
|
335
|
+
@show.command("elements-by-classification")
|
336
|
+
@click.option(
|
337
|
+
"--om-type",
|
338
|
+
default="Project",
|
339
|
+
help="Open Metadata type to filter by",
|
340
|
+
)
|
341
|
+
@click.option(
|
342
|
+
"--classification",
|
343
|
+
default="GovernanceProject",
|
344
|
+
help="Classification to filter byt",
|
345
|
+
)
|
346
|
+
@click.pass_context
|
347
|
+
def show_elements_by_classification(ctx, om_type, classification):
|
348
|
+
"""Show information about the specified relationship type"""
|
349
|
+
c = ctx.obj
|
350
|
+
list_classified_elements(
|
351
|
+
om_type,
|
352
|
+
classification,
|
353
|
+
c.view_server,
|
354
|
+
c.view_server_url,
|
355
|
+
c.userid,
|
356
|
+
c.password,
|
357
|
+
c.jupyter,
|
358
|
+
c.width,
|
359
|
+
)
|
360
|
+
|
361
|
+
|
362
|
+
@show.command("related-elements")
|
363
|
+
@click.option(
|
364
|
+
"--element-guid",
|
365
|
+
help="GUID of the Element to navigate from.",
|
366
|
+
)
|
367
|
+
@click.option(
|
368
|
+
"--om-type",
|
369
|
+
default="Project",
|
370
|
+
help="Open metadata type to filter by.",
|
371
|
+
)
|
372
|
+
@click.option(
|
373
|
+
"--rel-type",
|
374
|
+
default="Certification",
|
375
|
+
help="Relationship type to follow.",
|
376
|
+
)
|
377
|
+
@click.pass_context
|
378
|
+
def show_relationship_types(ctx, element_guid, om_type, rel_type):
|
379
|
+
"""Show information about the specified relationship type"""
|
380
|
+
c = ctx.obj
|
381
|
+
list_related_elements(
|
382
|
+
element_guid,
|
383
|
+
om_type,
|
384
|
+
rel_type,
|
385
|
+
c.view_server,
|
386
|
+
c.view_server_url,
|
387
|
+
c.userid,
|
388
|
+
c.password,
|
389
|
+
c.jupyter,
|
390
|
+
c.width,
|
391
|
+
)
|
392
|
+
|
393
|
+
|
333
394
|
@show.command("tech-templates")
|
334
395
|
@click.pass_context
|
335
396
|
@click.option(
|
@@ -50,7 +50,7 @@ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
|
50
50
|
)
|
51
51
|
@click.option("--userid", default=EGERIA_USER, help="Egeria admin user")
|
52
52
|
@click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria admin password")
|
53
|
-
@click.option("--timeout", default=
|
53
|
+
@click.option("--timeout", default=120, help="Number of seconds to wait")
|
54
54
|
def load_archive(file, server, view_server, url, userid, password, timeout):
|
55
55
|
"""Load an Open Metadata Archive"""
|
56
56
|
|
@@ -65,6 +65,10 @@ def load_archive(file, server, view_server, url, userid, password, timeout):
|
|
65
65
|
click.echo(f"Loaded archive: {file}")
|
66
66
|
|
67
67
|
except (InvalidParameterException, PropertyServerException) as e:
|
68
|
+
print(
|
69
|
+
f"Perhaps there was a timeout? If so, the command will complete despite the exception\n"
|
70
|
+
f"===> You can check by rerunning the command in a few minutes"
|
71
|
+
)
|
68
72
|
print_exception_response(e)
|
69
73
|
|
70
74
|
|
@@ -14,7 +14,7 @@ from pyegeria import (
|
|
14
14
|
PropertyServerException,
|
15
15
|
UserNotAuthorizedException,
|
16
16
|
print_exception_response,
|
17
|
-
|
17
|
+
EgeriaTech,
|
18
18
|
)
|
19
19
|
|
20
20
|
|
@@ -44,8 +44,15 @@ def list_elements(
|
|
44
44
|
jupyter: bool = EGERIA_JUPYTER,
|
45
45
|
width: int = EGERIA_WIDTH,
|
46
46
|
):
|
47
|
-
c_client =
|
47
|
+
c_client = EgeriaTech(server, url, user_id=username, user_pwd=password)
|
48
48
|
token = c_client.create_egeria_bearer_token()
|
49
|
+
|
50
|
+
om_typedef = c_client.get_typedef_by_name(om_type)
|
51
|
+
if type(om_typedef) is str:
|
52
|
+
print(
|
53
|
+
f"The type name '{om_type}' is not known to the Egeria platform at {url} - {server}"
|
54
|
+
)
|
55
|
+
sys.exit(1)
|
49
56
|
elements = c_client.get_elements(om_type)
|
50
57
|
|
51
58
|
def generate_table() -> Table:
|
@@ -70,6 +77,7 @@ def list_elements(
|
|
70
77
|
table.add_column("Home Store")
|
71
78
|
table.add_column("GUID", width=38, no_wrap=True)
|
72
79
|
table.add_column("Properties")
|
80
|
+
table.add_column("Classifications")
|
73
81
|
|
74
82
|
if type(elements) is list:
|
75
83
|
for element in elements:
|
@@ -79,14 +87,36 @@ def list_elements(
|
|
79
87
|
el_home = header["origin"]["homeMetadataCollectionName"]
|
80
88
|
el_create_time = header["versions"]["createTime"][:-10]
|
81
89
|
el_guid = header["guid"]
|
90
|
+
el_class = header.get("classifications", "---")
|
82
91
|
|
83
92
|
el_props_md = ""
|
84
93
|
for prop in element["properties"].keys():
|
85
94
|
el_props_md += f"* **{prop}**: {element['properties'][prop]}\n"
|
86
|
-
|
87
95
|
el_props_out = Markdown(el_props_md)
|
96
|
+
|
97
|
+
c_md = ""
|
98
|
+
if type(el_class) is list:
|
99
|
+
for classification in el_class:
|
100
|
+
classification_name = classification.get(
|
101
|
+
"classificationName", "---"
|
102
|
+
)
|
103
|
+
c_md = f"* **{classification_name}**\n"
|
104
|
+
class_props = classification.get(
|
105
|
+
"classificationProperties", "---"
|
106
|
+
)
|
107
|
+
if type(class_props) is dict:
|
108
|
+
for prop in class_props.keys():
|
109
|
+
c_md += f" * **{prop}**: {class_props[prop]}\n"
|
110
|
+
c_md_out = Markdown(c_md)
|
111
|
+
|
88
112
|
table.add_row(
|
89
|
-
el_q_name,
|
113
|
+
el_q_name,
|
114
|
+
el_type,
|
115
|
+
el_create_time,
|
116
|
+
el_home,
|
117
|
+
el_guid,
|
118
|
+
el_props_out,
|
119
|
+
c_md_out,
|
90
120
|
)
|
91
121
|
|
92
122
|
return table
|
@@ -0,0 +1,174 @@
|
|
1
|
+
"""This creates a templates guid file from the core metadata archive"""
|
2
|
+
from jedi import Project
|
3
|
+
from rich.markdown import Markdown
|
4
|
+
from rich.prompt import Prompt
|
5
|
+
import os
|
6
|
+
import argparse
|
7
|
+
import time
|
8
|
+
import sys
|
9
|
+
from rich import box
|
10
|
+
from rich.console import Console
|
11
|
+
from rich.table import Table
|
12
|
+
|
13
|
+
from pyegeria import (
|
14
|
+
InvalidParameterException,
|
15
|
+
PropertyServerException,
|
16
|
+
UserNotAuthorizedException,
|
17
|
+
print_exception_response,
|
18
|
+
EgeriaTech,
|
19
|
+
)
|
20
|
+
from tests.test_classification_manager_omvs import element_guid
|
21
|
+
|
22
|
+
console = Console()
|
23
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
24
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
25
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
26
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
27
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
28
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
29
|
+
)
|
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 list_classified_elements(
|
40
|
+
om_type: str,
|
41
|
+
classification: str,
|
42
|
+
server: str,
|
43
|
+
url: str,
|
44
|
+
username: str,
|
45
|
+
password: str,
|
46
|
+
jupyter: bool = EGERIA_JUPYTER,
|
47
|
+
width: int = EGERIA_WIDTH,
|
48
|
+
):
|
49
|
+
c_client = EgeriaTech(server, url, user_id=username, user_pwd=password)
|
50
|
+
token = c_client.create_egeria_bearer_token()
|
51
|
+
|
52
|
+
om_typedef = c_client.get_typedef_by_name(om_type)
|
53
|
+
if type(om_typedef) is str:
|
54
|
+
print(
|
55
|
+
f"The type name '{om_type}' is not known to the Egeria platform at {url} - {server}"
|
56
|
+
)
|
57
|
+
sys.exit(1)
|
58
|
+
|
59
|
+
elements = c_client.get_elements_by_classification(classification, om_type)
|
60
|
+
|
61
|
+
def generate_table() -> Table:
|
62
|
+
"""Make a new table."""
|
63
|
+
table = Table(
|
64
|
+
caption=f"Metadata Elements for: {url} - {server} @ {time.asctime()}",
|
65
|
+
style="bold bright_white on black",
|
66
|
+
row_styles=["bold bright_white on black"],
|
67
|
+
header_style="white on dark_blue",
|
68
|
+
title_style="bold bright_white on black",
|
69
|
+
caption_style="white on black",
|
70
|
+
show_lines=True,
|
71
|
+
box=box.ROUNDED,
|
72
|
+
title=f"Elements for Open Metadata Type: '{om_type}' ",
|
73
|
+
expand=True,
|
74
|
+
# width=500
|
75
|
+
)
|
76
|
+
|
77
|
+
table.add_column("Qualified Name")
|
78
|
+
table.add_column("Type")
|
79
|
+
table.add_column("Created")
|
80
|
+
table.add_column("Home Store")
|
81
|
+
table.add_column("GUID", width=38, no_wrap=True)
|
82
|
+
table.add_column("Properties")
|
83
|
+
table.add_column("Classifications")
|
84
|
+
|
85
|
+
if type(elements) is list:
|
86
|
+
for element in elements:
|
87
|
+
header = element["elementHeader"]
|
88
|
+
el_q_name = element["properties"].get("qualifiedName", "---")
|
89
|
+
el_type = header["type"]["typeName"]
|
90
|
+
el_home = header["origin"]["homeMetadataCollectionName"]
|
91
|
+
el_create_time = header["versions"]["createTime"][:-10]
|
92
|
+
el_guid = header["guid"]
|
93
|
+
el_class = header.get("classifications", "---")
|
94
|
+
|
95
|
+
el_props_md = ""
|
96
|
+
for prop in element["properties"].keys():
|
97
|
+
el_props_md += f"* **{prop}**: {element['properties'][prop]}\n"
|
98
|
+
el_props_out = Markdown(el_props_md)
|
99
|
+
|
100
|
+
c_md = ""
|
101
|
+
if type(el_class) is list:
|
102
|
+
for classification in el_class:
|
103
|
+
classification_name = classification.get(
|
104
|
+
"classificationName", "---"
|
105
|
+
)
|
106
|
+
c_md = f"* **{classification_name}**\n"
|
107
|
+
class_props = classification.get(
|
108
|
+
"classificationProperties", "---"
|
109
|
+
)
|
110
|
+
if type(class_props) is dict:
|
111
|
+
for prop in class_props.keys():
|
112
|
+
c_md += f" * **{prop}**: {class_props[prop]}\n"
|
113
|
+
c_md_out = Markdown(c_md)
|
114
|
+
|
115
|
+
table.add_row(
|
116
|
+
el_q_name,
|
117
|
+
el_type,
|
118
|
+
el_create_time,
|
119
|
+
el_home,
|
120
|
+
el_guid,
|
121
|
+
el_props_out,
|
122
|
+
c_md_out,
|
123
|
+
)
|
124
|
+
|
125
|
+
return table
|
126
|
+
else:
|
127
|
+
print("No instances found")
|
128
|
+
sys.exit(1)
|
129
|
+
|
130
|
+
try:
|
131
|
+
console = Console(width=width, force_terminal=not jupyter)
|
132
|
+
|
133
|
+
with console.pager(styles=True):
|
134
|
+
console.print(generate_table())
|
135
|
+
|
136
|
+
except (
|
137
|
+
InvalidParameterException,
|
138
|
+
PropertyServerException,
|
139
|
+
UserNotAuthorizedException,
|
140
|
+
) as e:
|
141
|
+
print_exception_response(e)
|
142
|
+
print("\n\nPerhaps the type name isn't known")
|
143
|
+
finally:
|
144
|
+
c_client.close_session()
|
145
|
+
|
146
|
+
|
147
|
+
def main():
|
148
|
+
parser = argparse.ArgumentParser()
|
149
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
150
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
151
|
+
parser.add_argument("--userid", help="User Id")
|
152
|
+
parser.add_argument("--password", help="Password")
|
153
|
+
|
154
|
+
args = parser.parse_args()
|
155
|
+
|
156
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
157
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
158
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
159
|
+
password = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
160
|
+
|
161
|
+
try:
|
162
|
+
om_type = Prompt.ask(
|
163
|
+
"Enter the Open Metadata Type to find elements of:", default="Project"
|
164
|
+
)
|
165
|
+
classification = Prompt.ask("Enter the classification to filter by: ")
|
166
|
+
list_classifiedd_elements(
|
167
|
+
om_type, classification, server, url, userid, password
|
168
|
+
)
|
169
|
+
except KeyboardInterrupt:
|
170
|
+
pass
|
171
|
+
|
172
|
+
|
173
|
+
if __name__ == "__main__":
|
174
|
+
main()
|
@@ -14,8 +14,9 @@ from pyegeria import (
|
|
14
14
|
PropertyServerException,
|
15
15
|
UserNotAuthorizedException,
|
16
16
|
print_exception_response,
|
17
|
-
ClassificationManager,
|
18
|
-
FeedbackManager,
|
17
|
+
# ClassificationManager,
|
18
|
+
# FeedbackManager,
|
19
|
+
EgeriaTech,
|
19
20
|
)
|
20
21
|
|
21
22
|
|
@@ -45,12 +46,15 @@ def list_elements_x(
|
|
45
46
|
jupyter: bool = EGERIA_JUPYTER,
|
46
47
|
width: int = EGERIA_WIDTH,
|
47
48
|
):
|
48
|
-
c_client =
|
49
|
+
c_client = EgeriaTech(server, url, user_id=username, user_pwd=password)
|
49
50
|
token = c_client.create_egeria_bearer_token()
|
50
|
-
f_client = FeedbackManager(
|
51
|
-
server, url, user_id=username, user_pwd=password, token=token
|
52
|
-
)
|
53
51
|
|
52
|
+
om_typedef = c_client.get_typedef_by_name(om_type)
|
53
|
+
if type(om_typedef) is str:
|
54
|
+
print(
|
55
|
+
f"The type name '{om_type}' is not known to the Egeria platform at {url} - {server}"
|
56
|
+
)
|
57
|
+
sys.exit(1)
|
54
58
|
elements = c_client.get_elements(om_type)
|
55
59
|
|
56
60
|
def generate_table() -> Table:
|
@@ -93,7 +97,7 @@ def list_elements_x(
|
|
93
97
|
|
94
98
|
el_props_out = Markdown(el_props_md)
|
95
99
|
|
96
|
-
tags =
|
100
|
+
tags = c_client.get_attached_tags(el_guid)
|
97
101
|
tags_md = "Tags:\n"
|
98
102
|
if type(tags) is list:
|
99
103
|
for tag in tags:
|
@@ -106,7 +110,7 @@ def list_elements_x(
|
|
106
110
|
else:
|
107
111
|
tags_md = "---"
|
108
112
|
|
109
|
-
likes =
|
113
|
+
likes = c_client.get_attached_likes(el_guid)
|
110
114
|
likes_md = "Likes:\b"
|
111
115
|
if type(likes) is list:
|
112
116
|
for like in likes:
|
@@ -0,0 +1,176 @@
|
|
1
|
+
"""This creates a templates guid file from the core metadata archive"""
|
2
|
+
from jedi import Project
|
3
|
+
from rich.markdown import Markdown
|
4
|
+
from rich.prompt import Prompt
|
5
|
+
import os
|
6
|
+
import argparse
|
7
|
+
import time
|
8
|
+
import sys
|
9
|
+
from rich import box
|
10
|
+
from rich.console import Console
|
11
|
+
from rich.table import Table
|
12
|
+
|
13
|
+
from pyegeria import (
|
14
|
+
InvalidParameterException,
|
15
|
+
PropertyServerException,
|
16
|
+
UserNotAuthorizedException,
|
17
|
+
print_exception_response,
|
18
|
+
EgeriaTech,
|
19
|
+
)
|
20
|
+
from tests.test_classification_manager_omvs import element_guid
|
21
|
+
|
22
|
+
console = Console()
|
23
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
24
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
25
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
26
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
27
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
28
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
29
|
+
)
|
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 list_related_elements(
|
40
|
+
element_guid: str,
|
41
|
+
om_type: str,
|
42
|
+
relationship_type: str,
|
43
|
+
server: str,
|
44
|
+
url: str,
|
45
|
+
username: str,
|
46
|
+
password: str,
|
47
|
+
jupyter: bool = EGERIA_JUPYTER,
|
48
|
+
width: int = EGERIA_WIDTH,
|
49
|
+
):
|
50
|
+
c_client = EgeriaTech(server, url, user_id=username, user_pwd=password)
|
51
|
+
token = c_client.create_egeria_bearer_token()
|
52
|
+
|
53
|
+
om_typedef = c_client.get_typedef_by_name(om_type)
|
54
|
+
if type(om_typedef) is str:
|
55
|
+
print(
|
56
|
+
f"The type name '{om_type}' is not known to the Egeria platform at {url} - {server}"
|
57
|
+
)
|
58
|
+
sys.exit(1)
|
59
|
+
|
60
|
+
elements = c_client.get_related_elements(element_guid, relationship_type, om_type)
|
61
|
+
|
62
|
+
def generate_table() -> Table:
|
63
|
+
"""Make a new table."""
|
64
|
+
table = Table(
|
65
|
+
caption=f"Metadata Elements for: {url} - {server} @ {time.asctime()}",
|
66
|
+
style="bold bright_white on black",
|
67
|
+
row_styles=["bold bright_white on black"],
|
68
|
+
header_style="white on dark_blue",
|
69
|
+
title_style="bold bright_white on black",
|
70
|
+
caption_style="white on black",
|
71
|
+
show_lines=True,
|
72
|
+
box=box.ROUNDED,
|
73
|
+
title=f"Elements for Open Metadata Type: '{om_type}' ",
|
74
|
+
expand=True,
|
75
|
+
# width=500
|
76
|
+
)
|
77
|
+
|
78
|
+
table.add_column("Qualified Name")
|
79
|
+
table.add_column("Type")
|
80
|
+
table.add_column("Created")
|
81
|
+
table.add_column("Home Store")
|
82
|
+
table.add_column("GUID", width=38, no_wrap=True)
|
83
|
+
table.add_column("Properties")
|
84
|
+
table.add_column("Classifications")
|
85
|
+
|
86
|
+
if type(elements) is list:
|
87
|
+
for element in elements:
|
88
|
+
header = element["elementHeader"]
|
89
|
+
el_q_name = element["properties"].get("qualifiedName", "---")
|
90
|
+
el_type = header["type"]["typeName"]
|
91
|
+
el_home = header["origin"]["homeMetadataCollectionName"]
|
92
|
+
el_create_time = header["versions"]["createTime"][:-10]
|
93
|
+
el_guid = header["guid"]
|
94
|
+
el_class = header.get("classifications", "---")
|
95
|
+
|
96
|
+
el_props_md = ""
|
97
|
+
for prop in element["properties"].keys():
|
98
|
+
el_props_md += f"* **{prop}**: {element['properties'][prop]}\n"
|
99
|
+
el_props_out = Markdown(el_props_md)
|
100
|
+
|
101
|
+
c_md = ""
|
102
|
+
if type(el_class) is list:
|
103
|
+
for classification in el_class:
|
104
|
+
classification_name = classification.get(
|
105
|
+
"classificationName", "---"
|
106
|
+
)
|
107
|
+
c_md = f"* **{classification_name}**\n"
|
108
|
+
class_props = classification.get(
|
109
|
+
"classificationProperties", "---"
|
110
|
+
)
|
111
|
+
if type(class_props) is dict:
|
112
|
+
for prop in class_props.keys():
|
113
|
+
c_md += f" * **{prop}**: {class_props[prop]}\n"
|
114
|
+
c_md_out = Markdown(c_md)
|
115
|
+
|
116
|
+
table.add_row(
|
117
|
+
el_q_name,
|
118
|
+
el_type,
|
119
|
+
el_create_time,
|
120
|
+
el_home,
|
121
|
+
el_guid,
|
122
|
+
el_props_out,
|
123
|
+
c_md_out,
|
124
|
+
)
|
125
|
+
|
126
|
+
return table
|
127
|
+
else:
|
128
|
+
print("No instances found")
|
129
|
+
sys.exit(1)
|
130
|
+
|
131
|
+
try:
|
132
|
+
console = Console(width=width, force_terminal=not jupyter)
|
133
|
+
|
134
|
+
with console.pager(styles=True):
|
135
|
+
console.print(generate_table())
|
136
|
+
|
137
|
+
except (
|
138
|
+
InvalidParameterException,
|
139
|
+
PropertyServerException,
|
140
|
+
UserNotAuthorizedException,
|
141
|
+
) as e:
|
142
|
+
print_exception_response(e)
|
143
|
+
print("\n\nPerhaps the type name isn't known")
|
144
|
+
finally:
|
145
|
+
c_client.close_session()
|
146
|
+
|
147
|
+
|
148
|
+
def main():
|
149
|
+
parser = argparse.ArgumentParser()
|
150
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
151
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
152
|
+
parser.add_argument("--userid", help="User Id")
|
153
|
+
parser.add_argument("--password", help="Password")
|
154
|
+
|
155
|
+
args = parser.parse_args()
|
156
|
+
|
157
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
158
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
159
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
160
|
+
password = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
161
|
+
|
162
|
+
try:
|
163
|
+
element_guid = Prompt.ask("Guid of base element")
|
164
|
+
om_type = Prompt.ask(
|
165
|
+
"Enter the Open Metadata Type to find elements of:", default="Project"
|
166
|
+
)
|
167
|
+
relationship_type = Prompt.ask("Enter the relationship type to follow: ")
|
168
|
+
list_related_elements(
|
169
|
+
element_guid, om_type, relationship_type, server, url, userid, password
|
170
|
+
)
|
171
|
+
except KeyboardInterrupt:
|
172
|
+
pass
|
173
|
+
|
174
|
+
|
175
|
+
if __name__ == "__main__":
|
176
|
+
main()
|
@@ -83,7 +83,7 @@ def element_response(response: dict, element_type: str, detailed_response: bool)
|
|
83
83
|
|
84
84
|
|
85
85
|
def elements_response(response: dict, element_type: str, detailed_response: bool):
|
86
|
-
print(response)
|
86
|
+
# print(response)
|
87
87
|
if detailed_response:
|
88
88
|
return response
|
89
89
|
elif not element_type in response:
|
@@ -1096,7 +1096,7 @@ class RuntimeManager(Client):
|
|
1096
1096
|
archive_file: str,
|
1097
1097
|
server_guid: str = None,
|
1098
1098
|
server_name: str = None,
|
1099
|
-
time_out: int =
|
1099
|
+
time_out: int = 120,
|
1100
1100
|
) -> None:
|
1101
1101
|
"""Add a new open metadata archive to running OMAG Server's repository.
|
1102
1102
|
An open metadata archive contains metadata types and instances. This operation loads an open metadata archive
|
@@ -1141,7 +1141,7 @@ class RuntimeManager(Client):
|
|
1141
1141
|
archive_file: str,
|
1142
1142
|
server_guid: str = None,
|
1143
1143
|
server_name: str = None,
|
1144
|
-
time_out: int =
|
1144
|
+
time_out: int = 120,
|
1145
1145
|
) -> None:
|
1146
1146
|
"""Add a new open metadata archive to running OMAG Server's repository.
|
1147
1147
|
An open metadata archive contains metadata types and instances. This operation loads an open metadata archive
|
@@ -1247,7 +1247,7 @@ class RuntimeManager(Client):
|
|
1247
1247
|
return
|
1248
1248
|
|
1249
1249
|
async def _async_activate_server_with_stored_config(
|
1250
|
-
self, server_guid: str = None, server_name: str = None
|
1250
|
+
self, server_guid: str = None, server_name: str = None, timeout: int = 120
|
1251
1251
|
) -> None:
|
1252
1252
|
"""Activate the named OMAG server using the appropriate configuration document found in the
|
1253
1253
|
configuration store. Async version.
|
@@ -1275,11 +1275,11 @@ class RuntimeManager(Client):
|
|
1275
1275
|
server_guid = self.__get_guid__(server_guid, server_name)
|
1276
1276
|
url = f"{self.runtime_command_root}/omag-servers/{server_guid}/instance"
|
1277
1277
|
|
1278
|
-
await self._async_make_request("POST", url)
|
1278
|
+
await self._async_make_request("POST", url, time_out=timeout)
|
1279
1279
|
return
|
1280
1280
|
|
1281
1281
|
def activate_server_with_stored_config(
|
1282
|
-
self, server_guid: str = None, server_name: str = None
|
1282
|
+
self, server_guid: str = None, server_name: str = None, timeout: int = 120
|
1283
1283
|
) -> None:
|
1284
1284
|
"""Activate the named OMAG server using the appropriate configuration document found in the
|
1285
1285
|
configuration store.
|
@@ -1306,7 +1306,9 @@ class RuntimeManager(Client):
|
|
1306
1306
|
"""
|
1307
1307
|
loop = asyncio.get_event_loop()
|
1308
1308
|
loop.run_until_complete(
|
1309
|
-
self._async_activate_server_with_stored_config(
|
1309
|
+
self._async_activate_server_with_stored_config(
|
1310
|
+
server_guid, server_name, timeout
|
1311
|
+
)
|
1310
1312
|
)
|
1311
1313
|
return
|
1312
1314
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "pyegeria"
|
3
|
-
version = "0.8.4.
|
3
|
+
version = "0.8.4.41"
|
4
4
|
license = 'Apache 2.0'
|
5
5
|
authors = ["Dan Wolfson <dan.wolfson@pdr-associates.com>"]
|
6
6
|
readme = "README.md"
|
@@ -102,7 +102,7 @@ pytest = "^8.2.2"
|
|
102
102
|
|
103
103
|
hey_egeria_ops = "commands.cli.egeria_ops:cli"
|
104
104
|
hey_egeria_cat = "commands.cli.egeria_cat:cli"
|
105
|
-
hey_egeria_tech = "commands.cli.
|
105
|
+
hey_egeria_tech = "commands.cli.egeria_tech:cli"
|
106
106
|
hey_egeria_my = "commands.cli.egeria_my:cli"
|
107
107
|
hey_egeria = "commands.cli.egeria:cli"
|
108
108
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|