pyegeria 0.3.2__py3-none-any.whl → 0.3.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyegeria/__init__.py +1 -1
- pyegeria/automated_curation_omvs.py +78 -56
- pyegeria/core_omag_server_config.py +14 -21
- pyegeria/exceptions.py +382 -0
- pyegeria/full_omag_server_config.py +0 -1
- pyegeria/glossary_omvs.py +14 -2
- pyegeria/gov_engine.py +1 -8
- pyegeria/governance_author.py +2 -0
- pyegeria/my_profile_omvs.py +1 -1
- pyegeria/platform_services.py +2 -39
- pyegeria/registered_info.py +46 -9
- pyegeria/server_operations.py +2 -2
- pyegeria-0.3.4.data/scripts/engine_action_status.py +145 -0
- pyegeria-0.3.4.data/scripts/find_todos.py +152 -0
- pyegeria-0.3.4.data/scripts/glossary_view.py +135 -0
- pyegeria-0.3.4.data/scripts/gov_engine_status.py +120 -0
- pyegeria-0.3.4.data/scripts/integration_daemon_status.py +130 -0
- pyegeria-0.3.4.data/scripts/list_asset_types.py +114 -0
- pyegeria-0.3.4.data/scripts/multi-server_status.py +123 -0
- pyegeria-0.3.4.data/scripts/my_todos.py +162 -0
- pyegeria-0.3.4.data/scripts/open_todos.py +140 -0
- pyegeria-0.3.4.data/scripts/server_status.py +105 -0
- pyegeria-0.3.4.data/scripts/server_status_widget.py +93 -0
- pyegeria-0.3.4.data/scripts/view_my_profile.py +140 -0
- {pyegeria-0.3.2.dist-info → pyegeria-0.3.4.dist-info}/METADATA +1 -1
- pyegeria-0.3.4.dist-info/RECORD +34 -0
- pyegeria-0.3.2.dist-info/RECORD +0 -21
- {pyegeria-0.3.2.dist-info → pyegeria-0.3.4.dist-info}/LICENSE +0 -0
- {pyegeria-0.3.2.dist-info → pyegeria-0.3.4.dist-info}/WHEEL +0 -0
- {pyegeria-0.3.2.dist-info → pyegeria-0.3.4.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,93 @@
|
|
1
|
+
#!python
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
Unit tests for the Utils helper functions using the Pytest framework.
|
7
|
+
|
8
|
+
|
9
|
+
A simple server status display
|
10
|
+
"""
|
11
|
+
|
12
|
+
import time
|
13
|
+
import argparse
|
14
|
+
|
15
|
+
from pyegeria._exceptions import (
|
16
|
+
InvalidParameterException,
|
17
|
+
PropertyServerException,
|
18
|
+
UserNotAuthorizedException,
|
19
|
+
print_exception_response,
|
20
|
+
)
|
21
|
+
from rich.table import Table
|
22
|
+
from rich.live import Live
|
23
|
+
|
24
|
+
from pyegeria.server_operations import ServerOps
|
25
|
+
from pyegeria.core_omag_server_config import CoreServerConfig
|
26
|
+
|
27
|
+
disable_ssl_warnings = True
|
28
|
+
|
29
|
+
def display_status(server: str, url: str, username: str):
|
30
|
+
p_client = ServerOps(server, url, username)
|
31
|
+
c_client = CoreServerConfig(server, url, username)
|
32
|
+
|
33
|
+
def generate_table() -> Table:
|
34
|
+
"""Make a new table."""
|
35
|
+
table = Table(
|
36
|
+
title=f"Server Status for Platform - {time.asctime()}",
|
37
|
+
# style = "black on grey66",
|
38
|
+
header_style="white on dark_blue",
|
39
|
+
caption=f"Server Status for Platform - '{url}'",
|
40
|
+
show_lines=True,
|
41
|
+
# expand=True
|
42
|
+
)
|
43
|
+
|
44
|
+
table.add_column("Known Server")
|
45
|
+
table.add_column("Status")
|
46
|
+
table.add_column("Server Type")
|
47
|
+
table.add_column("Server Description")
|
48
|
+
known_server_list = p_client.get_known_servers()
|
49
|
+
active_server_list = p_client.get_active_server_list()
|
50
|
+
if len(known_server_list) == 0:
|
51
|
+
return table
|
52
|
+
|
53
|
+
for server in known_server_list:
|
54
|
+
if server in active_server_list:
|
55
|
+
status = "Active"
|
56
|
+
else:
|
57
|
+
status = "Inactive"
|
58
|
+
server_type = c_client.get_server_type_classification(server)["serverTypeName"]
|
59
|
+
description = c_client.get_basic_server_properties(server).get("localServerDescription", " ")
|
60
|
+
|
61
|
+
table.add_row(server,
|
62
|
+
"[red]Inactive" if status == "Inactive" else "[green]Active",
|
63
|
+
server_type, description)
|
64
|
+
|
65
|
+
return table
|
66
|
+
|
67
|
+
try:
|
68
|
+
with Live(generate_table(), refresh_per_second=4, screen=True) as live:
|
69
|
+
while True:
|
70
|
+
time.sleep(2)
|
71
|
+
live.update(generate_table())
|
72
|
+
|
73
|
+
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
|
74
|
+
print_exception_response(e)
|
75
|
+
assert e.related_http_code != "200", "Invalid parameters"
|
76
|
+
|
77
|
+
finally:
|
78
|
+
p_client.close_session()
|
79
|
+
c_client.close_session()
|
80
|
+
|
81
|
+
|
82
|
+
if __name__ == "__main__":
|
83
|
+
parser = argparse.ArgumentParser()
|
84
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
85
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
86
|
+
parser.add_argument("--userid", help="User Id")
|
87
|
+
args = parser.parse_args()
|
88
|
+
|
89
|
+
server = args.server if args.server is not None else "active-metadata-store"
|
90
|
+
url = args.url if args.url is not None else "https://localhost:9443"
|
91
|
+
userid = args.userid if args.userid is not None else 'garygeeke'
|
92
|
+
|
93
|
+
display_status(server, url, userid)
|
@@ -0,0 +1,140 @@
|
|
1
|
+
#!python
|
2
|
+
"""
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
4
|
+
Copyright Contributors to the ODPi Egeria project.
|
5
|
+
|
6
|
+
Unit tests for the Utils helper functions using the Pytest framework.
|
7
|
+
|
8
|
+
|
9
|
+
A simple display for my profile
|
10
|
+
"""
|
11
|
+
|
12
|
+
import time
|
13
|
+
import json
|
14
|
+
import argparse
|
15
|
+
from pyegeria import (
|
16
|
+
InvalidParameterException,
|
17
|
+
PropertyServerException,
|
18
|
+
UserNotAuthorizedException,
|
19
|
+
print_exception_response,
|
20
|
+
)
|
21
|
+
from rich.table import Table
|
22
|
+
from rich.live import Live
|
23
|
+
from rich import box
|
24
|
+
from rich.prompt import Prompt
|
25
|
+
from rich.tree import Tree
|
26
|
+
from rich import print
|
27
|
+
from rich.console import Console
|
28
|
+
from pyegeria.my_profile_omvs import MyProfile
|
29
|
+
|
30
|
+
from pyegeria.server_operations import ServerOps
|
31
|
+
from pyegeria.gov_engine import GovEng
|
32
|
+
from pyegeria.glossary_omvs import GlossaryBrowser
|
33
|
+
disable_ssl_warnings = True
|
34
|
+
|
35
|
+
good_platform1_url = "https://127.0.0.1:9443"
|
36
|
+
good_platform2_url = "https://egeria.pdr-associates.com:7443"
|
37
|
+
bad_platform1_url = "https://localhost:9443"
|
38
|
+
|
39
|
+
# good_platform1_url = "https://127.0.0.1:30080"
|
40
|
+
# good_platform2_url = "https://127.0.0.1:30081"
|
41
|
+
# bad_platform1_url = "https://localhost:9443"
|
42
|
+
|
43
|
+
good_user_1 = "garygeeke"
|
44
|
+
good_user_2 = "erinoverview"
|
45
|
+
bad_user_1 = "eviledna"
|
46
|
+
bad_user_2 = ""
|
47
|
+
|
48
|
+
good_server_1 = "active-metadata-store"
|
49
|
+
good_server_2 = "simple-metadata-store"
|
50
|
+
good_server_3 = "view-server"
|
51
|
+
good_server_4 = "engine-host"
|
52
|
+
bad_server_1 = "coco"
|
53
|
+
bad_server_2 = ""
|
54
|
+
|
55
|
+
|
56
|
+
def display_my_profiles(server: str = good_server_3, url: str = good_platform1_url, username: str = good_user_2):
|
57
|
+
|
58
|
+
m_client = MyProfile(server, url, user_id=username)
|
59
|
+
token = m_client.create_egeria_bearer_token(username, "secret")
|
60
|
+
my_profiles = m_client.get_my_profile()
|
61
|
+
|
62
|
+
def generate_table() -> Table:
|
63
|
+
"""Make a new table."""
|
64
|
+
table = Table(
|
65
|
+
title=f"My Profile Information {good_platform1_url} @ {time.asctime()}",
|
66
|
+
# style = "black on grey66",
|
67
|
+
header_style="white on dark_blue",
|
68
|
+
show_lines=True,
|
69
|
+
box=box.ROUNDED,
|
70
|
+
caption=f"My Profile from Server '{server}' @ Platform - {url}",
|
71
|
+
expand=True
|
72
|
+
)
|
73
|
+
|
74
|
+
table.add_column("Name")
|
75
|
+
table.add_column("Job Title")
|
76
|
+
table.add_column("userId")
|
77
|
+
table.add_column("myGUID")
|
78
|
+
table.add_column("Role Type")
|
79
|
+
table.add_column("Role")
|
80
|
+
table.add_column("Role GUID")
|
81
|
+
|
82
|
+
if len(my_profiles) == 0:
|
83
|
+
name = " "
|
84
|
+
job_title = " "
|
85
|
+
user_id = " "
|
86
|
+
my_guid = " "
|
87
|
+
role_type = " "
|
88
|
+
role = " "
|
89
|
+
role_guid = " "
|
90
|
+
else:
|
91
|
+
name = my_profiles["profileProperties"]["fullName"]
|
92
|
+
job_title = my_profiles["profileProperties"]["jobTitle"]
|
93
|
+
id_list=" "
|
94
|
+
for identities in my_profiles["userIdentities"]:
|
95
|
+
id_list = f"{identities['userIdentity']['properties']['userId']} {id_list}"
|
96
|
+
|
97
|
+
my_guid = my_profiles["elementHeader"]["guid"]
|
98
|
+
|
99
|
+
my_roles = my_profiles["roles"]
|
100
|
+
for a_role in my_roles:
|
101
|
+
my_role_props = a_role["properties"]
|
102
|
+
role_type = my_role_props["typeName"]
|
103
|
+
role = my_role_props.get("title"," ")
|
104
|
+
role_guid = a_role["elementHeader"]["guid"]
|
105
|
+
table.add_row(
|
106
|
+
name, job_title, str(id_list), my_guid, role_type, role, role_guid
|
107
|
+
)
|
108
|
+
|
109
|
+
m_client.close_session()
|
110
|
+
return table
|
111
|
+
|
112
|
+
try:
|
113
|
+
# with Live(generate_table(), refresh_per_second=4, screen=True) as live:
|
114
|
+
# while True:
|
115
|
+
# time.sleep(2)
|
116
|
+
# live.update(generate_table())
|
117
|
+
console = Console()
|
118
|
+
with console.pager():
|
119
|
+
console.print(generate_table())
|
120
|
+
|
121
|
+
|
122
|
+
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
|
123
|
+
print_exception_response(e)
|
124
|
+
assert e.related_http_code != "200", "Invalid parameters"
|
125
|
+
|
126
|
+
if __name__ == "__main__":
|
127
|
+
parser = argparse.ArgumentParser()
|
128
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
129
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
130
|
+
parser.add_argument("--userid", help="User Id")
|
131
|
+
|
132
|
+
args = parser.parse_args()
|
133
|
+
|
134
|
+
server = args.server if args.server is not None else "view-server"
|
135
|
+
url = args.url if args.url is not None else "https://localhost:9443"
|
136
|
+
userid = args.userid if args.userid is not None else 'erinoverview'
|
137
|
+
# guid = args.guid if args.guid is not None else None
|
138
|
+
guid = None
|
139
|
+
|
140
|
+
display_my_profiles(server, url, userid)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
pyegeria/__init__.py,sha256=nFxyrkDWbTS469tfDQPp13BYvE-y9aX80OqB9dH_bb0,1612
|
2
|
+
pyegeria/_client.py,sha256=8-8r1-_fACDEGgmfJdkeODlPmftcdiKwb-bmrSA3ac4,23606
|
3
|
+
pyegeria/_exceptions.py,sha256=LImJPHy7MVgoH17LfqEL4ytLKcOhV7oCe66wZiDBzec,18399
|
4
|
+
pyegeria/_globals.py,sha256=WgJ6O7_ACiAG8CUUHT_AbGgahLhO0APU8Y4rCwv9DRw,558
|
5
|
+
pyegeria/_validators.py,sha256=DQuMsATRGxGSBtOrVtXlCgWXGhj6Nh-uqPtCsrUGLxk,12703
|
6
|
+
pyegeria/automated_curation_omvs.py,sha256=4Ukqe1eMJpUoEx-joJtRj-pyYq_ryVSaHOebYpe_6lo,100106
|
7
|
+
pyegeria/core_omag_server_config.py,sha256=vP6Ane5bK3Iq92q2MiSWhtxtXFT2KC5xrKKvbTGnAWs,93138
|
8
|
+
pyegeria/exceptions.py,sha256=LImJPHy7MVgoH17LfqEL4ytLKcOhV7oCe66wZiDBzec,18399
|
9
|
+
pyegeria/full_omag_server_config.py,sha256=sVBeG40Hp6ZG7dsz2BZqzO3bluPeu-j0fGTuinQ-SsY,46146
|
10
|
+
pyegeria/glossary_omvs.py,sha256=KcKRMNgm53suqbFLqsnThln5-zzAEJ8OseexiJ8BSsk,36500
|
11
|
+
pyegeria/gov_engine.py,sha256=3SBSZlbUTVG4x8OhlEIqipe8mB8_KEYOacHmxk7loSM,19697
|
12
|
+
pyegeria/governance_author.py,sha256=m0wsfmyO-VxRDaPpACeIDw8eVAFu3RVbo45RPCUel9M,6340
|
13
|
+
pyegeria/my_profile_omvs.py,sha256=gLIHiG0cO5fJKLK7EtVHtoC43WrABqDIJvdh91s_KDY,42441
|
14
|
+
pyegeria/platform_services.py,sha256=_povbV9ezjKv9TE-QE0iceuyI8aHqzJS_am1jjLlvHs,41955
|
15
|
+
pyegeria/registered_info.py,sha256=H7mgH83JKtMeDZ1vVOWoFM9iARD38Rnb6igvfEM46AA,8775
|
16
|
+
pyegeria/server_operations.py,sha256=iMBfIgPGqFM1TkABqFFJDt8tVUSY2qwSrRURrmWuma0,16323
|
17
|
+
pyegeria/utils.py,sha256=H0mew9IRcbsEi-pZfaT9HGuPO9CMOwnhOgIltyNvqTY,5240
|
18
|
+
pyegeria-0.3.4.data/scripts/engine_action_status.py,sha256=v0GaYkh7ee8LXwDlZlbGTVkZCiooWkEMscHIUwIhPjs,5192
|
19
|
+
pyegeria-0.3.4.data/scripts/find_todos.py,sha256=A75s7cwtXVukMCbVYFlbJoDYFg1A8fHU3dCTK2s6JtM,5171
|
20
|
+
pyegeria-0.3.4.data/scripts/glossary_view.py,sha256=tZvdX9Sc7Q2rL9oiEjRIFFt-saqwMs8PQ3BCgp-v710,4594
|
21
|
+
pyegeria-0.3.4.data/scripts/gov_engine_status.py,sha256=ZTVbhrvGsfzmN4j9Xz95rEMTjqTNvKi9Ojvy43Z5sI8,4000
|
22
|
+
pyegeria-0.3.4.data/scripts/integration_daemon_status.py,sha256=9XRQKdjmYqwfxwNoo4EUhX8vrplR0etS-5Yq89lXGMw,4575
|
23
|
+
pyegeria-0.3.4.data/scripts/list_asset_types.py,sha256=4PwaJXKgF4_bQhc3s3OOpppJRFIPHqIBqHDLlkfGjOU,3564
|
24
|
+
pyegeria-0.3.4.data/scripts/multi-server_status.py,sha256=px-2tw62GtncXAFXeRbDLNH8j7L956j6r1VbH1o1u6Y,3726
|
25
|
+
pyegeria-0.3.4.data/scripts/my_todos.py,sha256=wzGKekUAT-DfzE-R8O1_byvh0trB_FMd0YvdNkTw10Q,5660
|
26
|
+
pyegeria-0.3.4.data/scripts/open_todos.py,sha256=f02BXZ-LgqjUOe5QiK1SKA9RDSH9m6-u_x0HTCQAD8E,4649
|
27
|
+
pyegeria-0.3.4.data/scripts/server_status.py,sha256=BgBLjYeMDN41zk9ADyPWZFBaQX0TqiCZ9pjesnByUhM,3346
|
28
|
+
pyegeria-0.3.4.data/scripts/server_status_widget.py,sha256=tyx1I7olr6e5kJF22ou9rqsztrRDdrPCq5uVa3hhPBU,3088
|
29
|
+
pyegeria-0.3.4.data/scripts/view_my_profile.py,sha256=MW4mxAPUYKun0uAiBOjzAvfP7GiBvVzGtTmVPVCSxbo,4585
|
30
|
+
pyegeria-0.3.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
31
|
+
pyegeria-0.3.4.dist-info/METADATA,sha256=uS39__Scn2bgScZbrbfq7eERjuNpkcboIvBff6A2dgU,2398
|
32
|
+
pyegeria-0.3.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
33
|
+
pyegeria-0.3.4.dist-info/top_level.txt,sha256=tHowU8jow7WJGmbr4QdIk7gJWdslRgbWBiF2lMeduLQ,9
|
34
|
+
pyegeria-0.3.4.dist-info/RECORD,,
|
pyegeria-0.3.2.dist-info/RECORD
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
pyegeria/__init__.py,sha256=8QttPtk6AHJb-yr47koLZNmSk1vPbjbEnbH3qRDMzj4,1601
|
2
|
-
pyegeria/_client.py,sha256=8-8r1-_fACDEGgmfJdkeODlPmftcdiKwb-bmrSA3ac4,23606
|
3
|
-
pyegeria/_exceptions.py,sha256=LImJPHy7MVgoH17LfqEL4ytLKcOhV7oCe66wZiDBzec,18399
|
4
|
-
pyegeria/_globals.py,sha256=WgJ6O7_ACiAG8CUUHT_AbGgahLhO0APU8Y4rCwv9DRw,558
|
5
|
-
pyegeria/_validators.py,sha256=DQuMsATRGxGSBtOrVtXlCgWXGhj6Nh-uqPtCsrUGLxk,12703
|
6
|
-
pyegeria/automated_curation_omvs.py,sha256=zloY-pZ5q7SN-UoUahK7P7WVCOIRcA7e3-e8kkylbPU,99125
|
7
|
-
pyegeria/core_omag_server_config.py,sha256=aJ40w6Hg8Zh6SOcZKI-S1GisCxgKN3CktNeETxBwnHg,93697
|
8
|
-
pyegeria/full_omag_server_config.py,sha256=37YdmoMVHOlt-QyzVnjLUezAN_fZ-nO2ifMICqPghVo,46147
|
9
|
-
pyegeria/glossary_omvs.py,sha256=pfU-AKzVJDDu4brRZyayWXNP-SacgHXkAThblntm-eg,35897
|
10
|
-
pyegeria/gov_engine.py,sha256=97M0qtLrJjF91nelOsRhQINw9bePRgLn1d_xe_OO_xY,19930
|
11
|
-
pyegeria/governance_author.py,sha256=Pzg5OkxTTav9BDc56uYwD6QMlLu1lVnawZ5wWbE5c-Y,6272
|
12
|
-
pyegeria/my_profile_omvs.py,sha256=S5gX5HUy-XIqWWFqiGxqUpzw8HCG7GP5QwSq3FhqHwo,42436
|
13
|
-
pyegeria/platform_services.py,sha256=rsFPJfspWQZuHDi425YQck2fM8Qn-pTS_MpE8F-kpkg,43011
|
14
|
-
pyegeria/registered_info.py,sha256=vffGbrb4nD3_mp6MfAan8pC82vRJTRHKGTbF0Giy1PM,7502
|
15
|
-
pyegeria/server_operations.py,sha256=C37Go_EWqaBTJ8WOwNpAjiRC-1xCBdwEfrqH46CB8no,16273
|
16
|
-
pyegeria/utils.py,sha256=H0mew9IRcbsEi-pZfaT9HGuPO9CMOwnhOgIltyNvqTY,5240
|
17
|
-
pyegeria-0.3.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
18
|
-
pyegeria-0.3.2.dist-info/METADATA,sha256=T7jC4ThzWbnQxBTklGB-RksqlgJ3FQnTiS4nztIi4qs,2398
|
19
|
-
pyegeria-0.3.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
20
|
-
pyegeria-0.3.2.dist-info/top_level.txt,sha256=tHowU8jow7WJGmbr4QdIk7gJWdslRgbWBiF2lMeduLQ,9
|
21
|
-
pyegeria-0.3.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|