pyegeria 0.7.43__tar.gz → 0.7.44__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.43 → pyegeria-0.7.44}/PKG-INFO +1 -1
- pyegeria-0.7.44/examples/widgets/cat/list_archives.py +162 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cli/egeria.py +11 -0
- pyegeria-0.7.44/examples/widgets/cli/egeria_cat.py +525 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyproject.toml +2 -1
- pyegeria-0.7.43/examples/widgets/cli/egeria_cat.py +0 -293
- {pyegeria-0.7.43 → pyegeria-0.7.44}/LICENSE +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/README.md +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/doc_samples/Create_Collection_Sample.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/README.md +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/__init__.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/get_asset_graph.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/get_collection.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/get_project_dependencies.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/get_project_structure.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/get_tech_type_elements.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/get_tech_type_template.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/list_assets.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/list_cert_types.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/list_glossary.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/list_projects.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/list_relationships.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/list_tech_types.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/list_todos.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cat/list_user_ids.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cli/__init__.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cli/egeria_my.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cli/egeria_ops.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cli/egeria_tech.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/cli/ops_config.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/my/README.md +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/my/__init__.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/my/list_my_profile.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/my/list_my_roles.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/my/monitor_my_todos.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/my/monitor_open_todos.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/my/my_profile_actions.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/my/todo_actions.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/README.md +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/__init__.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/engine_actions.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/integration_daemon_actions.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/list_catalog_targets.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/load_archive.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/monitor_asset_events.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/monitor_coco_status.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/monitor_engine_activity.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/monitor_engine_activity_c.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/monitor_gov_eng_status.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/monitor_integ_daemon_status.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/monitor_platform_status.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/monitor_server_list.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/monitor_server_status.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/refresh_integration_daemon.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/ops/restart_integration_daemon.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/README.md +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/__init__.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/get_element_info.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/get_guid_info.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/get_tech_details.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/list_asset_types.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/list_elements.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/list_elements_x.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/list_registered_services.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/list_related_specification.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/list_relationship_types.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/list_tech_templates.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/list_valid_metadata_values.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/examples/widgets/tech/x_list_related_elements.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/Xloaded_resources_omvs.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/__init__.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/_client.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/_deprecated_gov_engine.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/_exceptions.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/_globals.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/_validators.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/action_author_omvs.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/asset_catalog_omvs.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/automated_curation_omvs.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/classification_manager_omvs.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/collection_manager_omvs.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/core_omag_server_config.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/create_tech_guid_lists.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/feedback_manager_omvs.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/full_omag_server_config.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/glossary_browser_omvs.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/glossary_manager_omvs.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/mermaid_utilities.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/my_profile_omvs.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/platform_services.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/project_manager_omvs.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/registered_info.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/runtime_manager_omvs.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/server_operations.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/tech_guids_31-08-2024 14:33.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/utils.py +0 -0
- {pyegeria-0.7.43 → pyegeria-0.7.44}/pyegeria/valid_metadata_omvs.py +0 -0
@@ -0,0 +1,162 @@
|
|
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 archives
|
11
|
+
"""
|
12
|
+
import argparse
|
13
|
+
import json
|
14
|
+
import os
|
15
|
+
import time, datetime
|
16
|
+
|
17
|
+
from rich import box
|
18
|
+
from rich import print
|
19
|
+
from rich.console import Console
|
20
|
+
from rich.prompt import Prompt
|
21
|
+
from rich.table import Table
|
22
|
+
|
23
|
+
from pyegeria import (
|
24
|
+
InvalidParameterException,
|
25
|
+
PropertyServerException,
|
26
|
+
UserNotAuthorizedException,
|
27
|
+
print_exception_response,
|
28
|
+
)
|
29
|
+
from pyegeria import ProjectManager, ClassificationManager
|
30
|
+
|
31
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
32
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
|
33
|
+
EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
|
34
|
+
EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
|
35
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get(
|
36
|
+
"EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
|
37
|
+
)
|
38
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
|
39
|
+
EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
|
40
|
+
"EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
|
41
|
+
)
|
42
|
+
EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
|
43
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
|
44
|
+
EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
|
45
|
+
EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
|
46
|
+
EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
47
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
48
|
+
|
49
|
+
|
50
|
+
def display_archive_list(
|
51
|
+
server: str,
|
52
|
+
url: str,
|
53
|
+
username: str,
|
54
|
+
user_pass: str,
|
55
|
+
save_output: bool,
|
56
|
+
jupyter: bool = EGERIA_JUPYTER,
|
57
|
+
width: int = EGERIA_WIDTH,
|
58
|
+
):
|
59
|
+
c_client = ClassificationManager(server, url, user_id=username)
|
60
|
+
token = c_client.create_egeria_bearer_token(username, user_pass)
|
61
|
+
|
62
|
+
def generate_table() -> Table:
|
63
|
+
"""Make a new table."""
|
64
|
+
table = Table(
|
65
|
+
title=f"Project List: Egeria Archvies @ {time.asctime()}",
|
66
|
+
header_style="white on dark_blue",
|
67
|
+
show_lines=True,
|
68
|
+
box=box.ROUNDED,
|
69
|
+
caption=f"Archive list for Server '{server}' @ Platform - {url}",
|
70
|
+
expand=True,
|
71
|
+
)
|
72
|
+
|
73
|
+
table.add_column("Name")
|
74
|
+
table.add_column("Path Name")
|
75
|
+
table.add_column("Creation Date")
|
76
|
+
# table.add_column("Creator")
|
77
|
+
# table.add_column("Description")
|
78
|
+
|
79
|
+
open_metadata_type_name = None
|
80
|
+
property_value = "omarchive"
|
81
|
+
property_names = ["fileExtension"]
|
82
|
+
archives = c_client.get_elements_by_property_value(
|
83
|
+
property_value, property_names, open_metadata_type_name
|
84
|
+
)
|
85
|
+
|
86
|
+
if type(archives) != list:
|
87
|
+
raise ValueError("--> No archives found")
|
88
|
+
else:
|
89
|
+
sorted_archives = sorted(
|
90
|
+
archives, key=lambda k: k["properties"].get("name", "---")
|
91
|
+
)
|
92
|
+
|
93
|
+
for archive in sorted_archives:
|
94
|
+
name = archive["properties"].get("name", "---")
|
95
|
+
path_name = archive["properties"].get("pathName", "---")
|
96
|
+
creation_date_epoch = (
|
97
|
+
int(archive["properties"].get("storeCreateTime", 0)) / 1000
|
98
|
+
)
|
99
|
+
create_date = datetime.datetime.fromtimestamp(creation_date_epoch)
|
100
|
+
creator = "---"
|
101
|
+
description = "---"
|
102
|
+
|
103
|
+
table.add_row(
|
104
|
+
name, path_name, create_date.strftime("%Y-%m-%d %H:%M:%S")
|
105
|
+
)
|
106
|
+
|
107
|
+
return table
|
108
|
+
|
109
|
+
try:
|
110
|
+
# with Live(generate_table(), refresh_per_second=4, screen=True) as live:
|
111
|
+
# while True:
|
112
|
+
# time.sleep(2)
|
113
|
+
# live.update(generate_table())
|
114
|
+
console = Console(
|
115
|
+
record=True, width=width, force_terminal=not jupyter, soft_wrap=True
|
116
|
+
)
|
117
|
+
with console.pager():
|
118
|
+
console.print(generate_table(), soft_wrap=True)
|
119
|
+
if save_output:
|
120
|
+
console.save_html("archives.html")
|
121
|
+
|
122
|
+
except (
|
123
|
+
InvalidParameterException,
|
124
|
+
PropertyServerException,
|
125
|
+
UserNotAuthorizedException,
|
126
|
+
ValueError,
|
127
|
+
) as e:
|
128
|
+
if type(e) is str:
|
129
|
+
print(e)
|
130
|
+
else:
|
131
|
+
print_exception_response(e)
|
132
|
+
except KeyboardInterrupt:
|
133
|
+
pass
|
134
|
+
finally:
|
135
|
+
c_client.close_session()
|
136
|
+
|
137
|
+
|
138
|
+
def main():
|
139
|
+
parser = argparse.ArgumentParser()
|
140
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
141
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
142
|
+
parser.add_argument("--userid", help="User Id")
|
143
|
+
parser.add_argument("--save-output", help="Save output to file?")
|
144
|
+
parser.add_argument("--password", help="User Password")
|
145
|
+
# parser.add_argument("--sponsor", help="Name of sponsor to search")
|
146
|
+
args = parser.parse_args()
|
147
|
+
|
148
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
149
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
150
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
151
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
152
|
+
|
153
|
+
try:
|
154
|
+
save_output = args.save_output if args.save_output is not None else False
|
155
|
+
display_archive_list(server, url, userid, user_pass, save_output)
|
156
|
+
|
157
|
+
except KeyboardInterrupt:
|
158
|
+
pass
|
159
|
+
|
160
|
+
|
161
|
+
if __name__ == "__main__":
|
162
|
+
main()
|
@@ -26,6 +26,7 @@ from examples.widgets.cat.list_relationships import list_relationships
|
|
26
26
|
from examples.widgets.cat.list_tech_types import display_tech_types
|
27
27
|
from examples.widgets.cat.list_todos import display_to_dos as list_todos
|
28
28
|
from examples.widgets.cat.list_user_ids import list_user_ids
|
29
|
+
from examples.widgets.cat.list_archives import display_archive_list
|
29
30
|
from examples.widgets.cli.ops_config import Config
|
30
31
|
from examples.widgets.my.list_my_profile import display_my_profile
|
31
32
|
from examples.widgets.my.list_my_roles import display_my_roles
|
@@ -856,6 +857,16 @@ def show_todos(ctx):
|
|
856
857
|
)
|
857
858
|
|
858
859
|
|
860
|
+
@show.command("list-archives")
|
861
|
+
@click.pass_context
|
862
|
+
def list_archives(ctx):
|
863
|
+
"""Display a tree graph of information about an asset"""
|
864
|
+
c = ctx.obj
|
865
|
+
display_archive_list(
|
866
|
+
c.view_server, c.view_server_url, c.userid, c.password, None, c.jupyter, c.width
|
867
|
+
)
|
868
|
+
|
869
|
+
|
859
870
|
#
|
860
871
|
# Catalog User: Tell
|
861
872
|
#
|