pyegeria 0.5.5.17__py3-none-any.whl → 0.5.5.19__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.
- examples/widgets/catalog_user/list_assets.py +32 -26
- examples/widgets/catalog_user/view_asset_graph.py +29 -22
- examples/widgets/catalog_user/view_collection.py +23 -11
- examples/widgets/catalog_user/view_glossary.py +20 -28
- examples/widgets/developer/get_guid_info.py +23 -10
- examples/widgets/developer/get_tech_details.py +19 -7
- examples/widgets/developer/list_asset_types.py +20 -7
- examples/widgets/developer/list_registered_services.py +15 -6
- examples/widgets/developer/list_relationship_types.py +19 -7
- examples/widgets/developer/list_tech_templates.py +19 -12
- examples/widgets/developer/list_tech_types.py +22 -30
- examples/widgets/developer/list_valid_metadata_values.py +23 -34
- examples/widgets/operational/get_tech_type_elements.py +20 -6
- examples/widgets/operational/get_tech_type_template.py +20 -7
- examples/widgets/operational/view_asset_events.py +14 -2
- examples/widgets/operational/view_eng_action_status.py +23 -9
- examples/widgets/operational/view_gov_eng_status.py +20 -7
- examples/widgets/operational/view_integ_daemon_status.py +22 -9
- examples/widgets/operational/view_platform_status.py +21 -6
- examples/widgets/operational/view_server_list.py +21 -7
- examples/widgets/operational/view_server_status.py +21 -9
- examples/widgets/personal_organizer/get_my_profile.py +27 -13
- examples/widgets/personal_organizer/list_projects.py +22 -7
- examples/widgets/personal_organizer/list_todos.py +21 -7
- examples/widgets/personal_organizer/view_my_todos.py +23 -24
- examples/widgets/personal_organizer/view_open_todos.py +25 -10
- {pyegeria-0.5.5.17.dist-info → pyegeria-0.5.5.19.dist-info}/METADATA +1 -1
- {pyegeria-0.5.5.17.dist-info → pyegeria-0.5.5.19.dist-info}/RECORD +31 -31
- {pyegeria-0.5.5.17.dist-info → pyegeria-0.5.5.19.dist-info}/LICENSE +0 -0
- {pyegeria-0.5.5.17.dist-info → pyegeria-0.5.5.19.dist-info}/WHEEL +0 -0
- {pyegeria-0.5.5.17.dist-info → pyegeria-0.5.5.19.dist-info}/entry_points.txt +0 -0
@@ -8,10 +8,16 @@ Unit tests for the Utils helper functions using the Pytest framework.
|
|
8
8
|
|
9
9
|
A simple display for glossary terms
|
10
10
|
"""
|
11
|
-
|
12
|
-
import time
|
13
|
-
import json
|
14
11
|
import argparse
|
12
|
+
import os
|
13
|
+
import time
|
14
|
+
|
15
|
+
from rich import box
|
16
|
+
from rich.console import Console
|
17
|
+
from rich.prompt import Prompt
|
18
|
+
# import pyegeria.X_asset_catalog_omvs
|
19
|
+
from rich.table import Table
|
20
|
+
|
15
21
|
from pyegeria import (
|
16
22
|
InvalidParameterException,
|
17
23
|
PropertyServerException,
|
@@ -19,25 +25,23 @@ from pyegeria import (
|
|
19
25
|
print_exception_response,
|
20
26
|
AssetCatalog
|
21
27
|
)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
28
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
29
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
30
|
+
EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
|
31
|
+
EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
|
32
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
|
33
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
|
34
|
+
EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
35
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
36
|
+
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
37
|
+
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
30
38
|
|
31
|
-
|
32
|
-
from pyegeria.server_operations import ServerOps
|
33
|
-
from pyegeria._deprecated_gov_engine import GovEng
|
34
|
-
from pyegeria.glossary_browser_omvs import GlossaryBrowser
|
35
39
|
disable_ssl_warnings = True
|
36
40
|
|
37
|
-
def display_assets(search_string: str, guid: str, server: str, url: str, username: str):
|
41
|
+
def display_assets(search_string: str, guid: str, server: str, url: str, username: str, user_password: str):
|
38
42
|
|
39
43
|
g_client = AssetCatalog(server, url, username)
|
40
|
-
token = g_client.create_egeria_bearer_token(username,
|
44
|
+
token = g_client.create_egeria_bearer_token(username, user_password)
|
41
45
|
|
42
46
|
|
43
47
|
def generate_table(search_string:str = 'Enter Your Tech Type') -> Table:
|
@@ -96,8 +100,9 @@ def display_assets(search_string: str, guid: str, server: str, url: str, usernam
|
|
96
100
|
|
97
101
|
|
98
102
|
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
|
99
|
-
|
100
|
-
|
103
|
+
console.print_exception()
|
104
|
+
|
105
|
+
|
101
106
|
|
102
107
|
def main():
|
103
108
|
sus_guid = "f9b78b26-6025-43fa-9299-a905cc6d1575"
|
@@ -105,18 +110,19 @@ def main():
|
|
105
110
|
parser.add_argument("--server", help="Name of the server to display status for")
|
106
111
|
parser.add_argument("--url", help="URL Platform to connect to")
|
107
112
|
parser.add_argument("--userid", help="User Id")
|
113
|
+
parser.add_argument("--password", help="User Password")
|
114
|
+
|
108
115
|
parser.add_argument("--guid", help="GUID of glossary to search")
|
109
|
-
parser.add_argument("--sustainability", help="Set True for Sustainability Glossary")
|
110
116
|
args = parser.parse_args()
|
111
117
|
|
112
|
-
server = args.server if args.server is not None else
|
113
|
-
url = args.url if args.url is not None else
|
114
|
-
userid = args.userid if args.userid is not None else
|
118
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
119
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
120
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
121
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
115
122
|
guid = args.guid if args.guid is not None else None
|
116
|
-
guid = sus_guid if args.sustainability else None
|
117
123
|
|
118
|
-
search_string = Prompt.ask("Enter a search string:", default="
|
119
|
-
display_assets(search_string, guid,server, url, userid)
|
124
|
+
search_string = Prompt.ask("Enter a search string:", default="")
|
125
|
+
display_assets(search_string, guid,server, url, userid, user_pass)
|
120
126
|
|
121
127
|
if __name__ == "__main__":
|
122
128
|
main()
|
@@ -5,29 +5,34 @@ Copyright Contributors to the ODPi Egeria project.
|
|
5
5
|
|
6
6
|
Display the status of cataloged platforms and servers.
|
7
7
|
"""
|
8
|
-
import sys
|
9
|
-
import time
|
10
8
|
import argparse
|
9
|
+
import os
|
10
|
+
import sys
|
11
11
|
|
12
|
-
from rich import
|
12
|
+
from rich import print
|
13
|
+
from rich.console import Console
|
14
|
+
from rich.markdown import Markdown
|
13
15
|
from rich.panel import Panel
|
16
|
+
from rich.prompt import Prompt
|
17
|
+
from rich.tree import Tree
|
14
18
|
|
15
19
|
from pyegeria import (
|
16
20
|
InvalidParameterException,
|
17
21
|
PropertyServerException,
|
18
22
|
UserNotAuthorizedException,
|
19
|
-
print_exception_response,
|
20
23
|
AssetCatalog
|
21
24
|
)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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_INTEGRATION_DAEMON_URL = os.environ.get('EGERIA_INTEGRATION_DAEMON_URL', 'https://localhost:9443')
|
32
|
+
EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
33
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
34
|
+
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
35
|
+
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
31
36
|
|
32
37
|
disable_ssl_warnings = True
|
33
38
|
console = Console(width=200)
|
@@ -35,7 +40,7 @@ console = Console(width=200)
|
|
35
40
|
|
36
41
|
guid_list = []
|
37
42
|
|
38
|
-
def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str):
|
43
|
+
def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, user_pass:str):
|
39
44
|
|
40
45
|
def build_classifications(classification: dict) -> Markdown:
|
41
46
|
|
@@ -89,7 +94,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str):
|
|
89
94
|
a_client = AssetCatalog(server_name, platform_url,
|
90
95
|
user_id=user)
|
91
96
|
|
92
|
-
token = a_client.create_egeria_bearer_token(user,
|
97
|
+
token = a_client.create_egeria_bearer_token(user, user_pass)
|
93
98
|
# asset_info = a_client.find_assets_in_domain(asset_name)
|
94
99
|
# if type(asset_info) is str:
|
95
100
|
# print("\n No Assets Found - Exiting\n")
|
@@ -229,8 +234,8 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str):
|
|
229
234
|
PropertyServerException,
|
230
235
|
UserNotAuthorizedException
|
231
236
|
) as e:
|
232
|
-
|
233
|
-
|
237
|
+
console.print_exception()
|
238
|
+
console.print("\n\n ======> Most likely the GUID you provided is either incorrect or not an asset\n[red bold]")
|
234
239
|
|
235
240
|
def main():
|
236
241
|
parser = argparse.ArgumentParser()
|
@@ -238,14 +243,16 @@ def main():
|
|
238
243
|
parser.add_argument("--server", help="Name of the server to display status for")
|
239
244
|
parser.add_argument("--url", help="URL Platform to connect to")
|
240
245
|
parser.add_argument("--userid", help="User Id")
|
246
|
+
parser.add_argument("--password", help="User Password")
|
241
247
|
args = parser.parse_args()
|
242
248
|
|
243
|
-
server = args.server if args.server is not None else
|
244
|
-
url = args.url if args.url is not None else
|
245
|
-
userid = args.userid if args.userid is not None else
|
249
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
250
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
251
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
252
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
246
253
|
|
247
|
-
asset_guid = Prompt.ask("Enter the Asset GUID to view:", default="
|
248
|
-
asset_viewer(asset_guid,server, url, userid)
|
254
|
+
asset_guid = Prompt.ask("Enter the Asset GUID to view:", default="")
|
255
|
+
asset_viewer(asset_guid,server, url, userid, user_pass)
|
249
256
|
|
250
257
|
if __name__ == "__main__":
|
251
258
|
main()
|
@@ -8,7 +8,7 @@ A simple viewer for collections - provide the root and we display the hierarchy
|
|
8
8
|
"""
|
9
9
|
|
10
10
|
import argparse
|
11
|
-
|
11
|
+
import os
|
12
12
|
from rich import print
|
13
13
|
from rich.panel import Panel
|
14
14
|
from rich.prompt import Prompt
|
@@ -21,16 +21,25 @@ from pyegeria._exceptions import (
|
|
21
21
|
)
|
22
22
|
|
23
23
|
disable_ssl_warnings = True
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
25
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
26
|
+
EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
|
27
|
+
EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
|
28
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
|
29
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
|
30
|
+
EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
31
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
32
|
+
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
33
|
+
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
34
|
+
|
35
|
+
|
36
|
+
def collection_viewer(root: str, server_name: str, platform_url: str, user: str, user_password: str):
|
27
37
|
""" A simple collection viewer"""
|
28
38
|
def walk_collection_hierarchy(collection_client: CollectionManager, root_collection_name: str, tree: Tree) -> None:
|
29
39
|
"""Recursively build a Tree with collection contents."""
|
30
40
|
members = collection_client.get_member_list(root_collection_name)
|
31
41
|
if members:
|
32
42
|
for member in members:
|
33
|
-
|
34
43
|
style = ""
|
35
44
|
text_collection_name = Text(f"[bold white] Name: {member['name']}", "")
|
36
45
|
text_qualified_name = Text(f"* QualifiedName: {member['qualifiedName']}""yellow")
|
@@ -45,13 +54,14 @@ def collection_viewer(root: str, server_name: str, platform_url: str, user: str)
|
|
45
54
|
if type(children) is list:
|
46
55
|
branch = tt.add(f"[bold magenta]Members", style=style, guide_style=style)
|
47
56
|
walk_collection_hierarchy(collection_client, member['qualifiedName'], branch),
|
48
|
-
|
57
|
+
else:
|
58
|
+
tt = tree.add(f"[bold magenta]No collections match {root_collection_name}", style="bold red")
|
49
59
|
try:
|
50
60
|
tree = Tree(f"[bold bright green]{root}", guide_style="bold bright_blue")
|
51
61
|
c_client = CollectionManager(server_name, platform_url,
|
52
62
|
user_id=user)
|
53
63
|
|
54
|
-
token = c_client.create_egeria_bearer_token(user,
|
64
|
+
token = c_client.create_egeria_bearer_token(user, user_password)
|
55
65
|
walk_collection_hierarchy(c_client, root, tree)
|
56
66
|
print(tree)
|
57
67
|
|
@@ -69,14 +79,16 @@ def main():
|
|
69
79
|
parser.add_argument("--server", help="Name of the server to display status for")
|
70
80
|
parser.add_argument("--url", help="URL Platform to connect to")
|
71
81
|
parser.add_argument("--userid", help="User Id")
|
82
|
+
parser.add_argument("--password", help="User Password")
|
72
83
|
args = parser.parse_args()
|
73
84
|
|
74
|
-
server = args.server if args.server is not None else
|
75
|
-
url = args.url if args.url is not None else
|
76
|
-
userid = args.userid if args.userid is not None else
|
85
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
86
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
87
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
88
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
77
89
|
|
78
90
|
root_collection = Prompt.ask("Enter the Root Collection to start from:", default="Digital Products Root")
|
79
|
-
collection_viewer(root_collection, server, url, userid)
|
91
|
+
collection_viewer(root_collection, server, url, userid, user_pass)
|
80
92
|
|
81
93
|
if __name__ == "__main__":
|
82
94
|
main()
|
@@ -8,7 +8,7 @@ Unit tests for the Utils helper functions using the Pytest framework.
|
|
8
8
|
|
9
9
|
A simple display for glossary terms
|
10
10
|
"""
|
11
|
-
|
11
|
+
import os
|
12
12
|
import time
|
13
13
|
import json
|
14
14
|
import argparse
|
@@ -32,31 +32,22 @@ from pyegeria._deprecated_gov_engine import GovEng
|
|
32
32
|
from pyegeria.glossary_browser_omvs import GlossaryBrowser
|
33
33
|
disable_ssl_warnings = True
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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 = ""
|
35
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
36
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
37
|
+
EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
|
38
|
+
EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
|
39
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
|
40
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
|
41
|
+
EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
42
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
43
|
+
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
44
|
+
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
54
45
|
|
55
46
|
|
56
|
-
def display_glossary_terms(search_string: str, guid: str
|
47
|
+
def display_glossary_terms(search_string: str, guid: str, server: str, url: str, username: str, user_password: str):
|
57
48
|
|
58
49
|
g_client = GlossaryBrowser(server, url)
|
59
|
-
token = g_client.create_egeria_bearer_token(username,
|
50
|
+
token = g_client.create_egeria_bearer_token(username, user_password)
|
60
51
|
|
61
52
|
|
62
53
|
def generate_table(search_string:str = '*') -> Table:
|
@@ -112,8 +103,7 @@ def display_glossary_terms(search_string: str, guid: str=None, server: str = goo
|
|
112
103
|
|
113
104
|
|
114
105
|
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
|
115
|
-
|
116
|
-
assert e.related_http_code != "200", "Invalid parameters"
|
106
|
+
console.print_exception()
|
117
107
|
|
118
108
|
def main():
|
119
109
|
sus_guid = "f9b78b26-6025-43fa-9299-a905cc6d1575"
|
@@ -121,18 +111,20 @@ def main():
|
|
121
111
|
parser.add_argument("--server", help="Name of the server to display status for")
|
122
112
|
parser.add_argument("--url", help="URL Platform to connect to")
|
123
113
|
parser.add_argument("--userid", help="User Id")
|
114
|
+
parser.add_argument("--password", help="User Password")
|
124
115
|
parser.add_argument("--guid", help="GUID of glossary to search")
|
125
116
|
parser.add_argument("--sustainability", help="Set True for Sustainability Glossary")
|
126
117
|
args = parser.parse_args()
|
127
118
|
|
128
|
-
server = args.server if args.server is not None else
|
129
|
-
url = args.url if args.url is not None else
|
130
|
-
userid = args.userid if args.userid is not None else
|
119
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
120
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
121
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
122
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
131
123
|
guid = args.guid if args.guid is not None else None
|
132
124
|
guid = sus_guid if args.sustainability else None
|
133
125
|
|
134
126
|
search_string = Prompt.ask("Enter the term you are searching for:", default="*")
|
135
|
-
display_glossary_terms(search_string, guid,server, url, userid)
|
127
|
+
display_glossary_terms(search_string, guid,server, url, userid, user_pass)
|
136
128
|
|
137
129
|
if __name__ == "__main__":
|
138
130
|
main()
|
@@ -9,7 +9,7 @@ Unit tests for the Utils helper functions using the Pytest framework.
|
|
9
9
|
|
10
10
|
A simple display for glossary terms
|
11
11
|
"""
|
12
|
-
|
12
|
+
import os
|
13
13
|
import argparse
|
14
14
|
import json
|
15
15
|
|
@@ -26,9 +26,19 @@ from pyegeria import (
|
|
26
26
|
print_exception_response,
|
27
27
|
Client
|
28
28
|
)
|
29
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
30
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
31
|
+
EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
|
32
|
+
EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
|
33
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
|
34
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
|
35
|
+
EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
36
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
37
|
+
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
38
|
+
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
29
39
|
|
30
40
|
|
31
|
-
def display_guid(guid: str, server: str, url: str, username: str):
|
41
|
+
def display_guid(guid: str, server: str, url: str, username: str, user_password: str):
|
32
42
|
|
33
43
|
c = Client(server, url, user_id=username)
|
34
44
|
url = (f"{url}/servers/{server}/open-metadata/repository-services/users/{username}/"
|
@@ -38,6 +48,8 @@ def display_guid(guid: str, server: str, url: str, username: str):
|
|
38
48
|
try:
|
39
49
|
console = Console(width = 180)
|
40
50
|
r = c.make_request("GET", url)
|
51
|
+
if r.status_code == 200:
|
52
|
+
pass
|
41
53
|
e = r.json()['entity']
|
42
54
|
p = e['properties']['instanceProperties']
|
43
55
|
|
@@ -58,10 +70,10 @@ def display_guid(guid: str, server: str, url: str, username: str):
|
|
58
70
|
|
59
71
|
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException, ValueError) as e:
|
60
72
|
if type(e) is str:
|
61
|
-
|
73
|
+
console.print_exception()
|
62
74
|
else:
|
63
|
-
console.print(f"\n Looks like the GUID isn't
|
64
|
-
|
75
|
+
console.print(f"\n Looks like the GUID isn't known...detailed message follows\n")
|
76
|
+
console.print_exception()
|
65
77
|
|
66
78
|
def main():
|
67
79
|
|
@@ -69,17 +81,18 @@ def main():
|
|
69
81
|
parser.add_argument("--server", help="Name of the server to display status for")
|
70
82
|
parser.add_argument("--url", help="URL Platform to connect to")
|
71
83
|
parser.add_argument("--userid", help="User Id")
|
84
|
+
parser.add_argument("--password", help="User Password")
|
72
85
|
|
73
86
|
# parser.add_argument("--sponsor", help="Name of sponsor to search")
|
74
87
|
args = parser.parse_args()
|
75
88
|
|
76
|
-
server = args.server if args.server is not None else
|
77
|
-
url = args.url if args.url is not None else
|
78
|
-
userid = args.userid if args.userid is not None else
|
79
|
-
|
89
|
+
server = args.server if args.server is not None else EGERIA_METADATA_STORE
|
90
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
91
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
92
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
80
93
|
guid = Prompt.ask("Enter the GUID to retrieve:", default=None)
|
81
94
|
|
82
|
-
display_guid(guid, server, url, userid)
|
95
|
+
display_guid(guid, server, url, userid, user_pass)
|
83
96
|
|
84
97
|
if __name__ == "__main__":
|
85
98
|
main()
|
@@ -6,7 +6,7 @@ Copyright Contributors to the ODPi Egeria project.
|
|
6
6
|
A simple viewer for collections - provide the root and we display the hierarchy
|
7
7
|
|
8
8
|
"""
|
9
|
-
|
9
|
+
import os
|
10
10
|
import argparse
|
11
11
|
import asyncio
|
12
12
|
import nest_asyncio
|
@@ -22,12 +22,22 @@ from pyegeria import (UserNotAuthorizedException, PropertyServerException,
|
|
22
22
|
from pyegeria._exceptions import (
|
23
23
|
print_exception_response,
|
24
24
|
)
|
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')
|
25
35
|
|
26
36
|
nest_asyncio.apply()
|
27
37
|
console = Console()
|
28
38
|
disable_ssl_warnings = True
|
29
39
|
|
30
|
-
def tech_viewer(tech: str, server_name:str, platform_url:str, user:str):
|
40
|
+
def tech_viewer(tech: str, server_name:str, platform_url:str, user:str, user_password:str):
|
31
41
|
|
32
42
|
def view_tech_details(a_client: AutomatedCuration, root_collection_name: str, tree: Tree) -> Tree:
|
33
43
|
l2: Tree = None
|
@@ -76,7 +86,7 @@ def tech_viewer(tech: str, server_name:str, platform_url:str, user:str):
|
|
76
86
|
a_client = AutomatedCuration(server_name, platform_url,
|
77
87
|
user_id=user)
|
78
88
|
|
79
|
-
token = a_client.create_egeria_bearer_token(user,
|
89
|
+
token = a_client.create_egeria_bearer_token(user, user_password)
|
80
90
|
view_tech_details(a_client,tech,tree)
|
81
91
|
print(tree)
|
82
92
|
|
@@ -94,14 +104,16 @@ def main():
|
|
94
104
|
parser.add_argument("--server", help="Name of the server to display status for")
|
95
105
|
parser.add_argument("--url", help="URL Platform to connect to")
|
96
106
|
parser.add_argument("--userid", help="User Id")
|
107
|
+
parser.add_argument("--password", help="User Password")
|
97
108
|
args = parser.parse_args()
|
98
109
|
|
99
|
-
server = args.server if args.server is not None else
|
100
|
-
url = args.url if args.url is not None else
|
101
|
-
userid = args.userid if args.userid is not None else
|
110
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
111
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
112
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
113
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
102
114
|
|
103
115
|
tech = Prompt.ask("Enter the Technology to start from:", default="PostgreSQL Server")
|
104
|
-
tech_viewer(tech,server, url, userid)
|
116
|
+
tech_viewer(tech,server, url, userid, user_pass)
|
105
117
|
|
106
118
|
if __name__ == "__main__":
|
107
119
|
main()
|
@@ -8,7 +8,7 @@ Unit tests for the Utils helper functions using the Pytest framework.
|
|
8
8
|
|
9
9
|
A simple display for my profile
|
10
10
|
"""
|
11
|
-
|
11
|
+
import os
|
12
12
|
import argparse
|
13
13
|
import time
|
14
14
|
|
@@ -24,10 +24,21 @@ from pyegeria import (
|
|
24
24
|
RegisteredInfo
|
25
25
|
)
|
26
26
|
|
27
|
+
EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
28
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
29
|
+
EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
|
30
|
+
EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
|
31
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
|
32
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
|
33
|
+
EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
34
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
35
|
+
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
36
|
+
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
37
|
+
|
27
38
|
|
28
|
-
def display_asset_types(server: str, url: str, username: str):
|
39
|
+
def display_asset_types(server: str, url: str, username: str, user_password: str):
|
29
40
|
r_client = RegisteredInfo(server, url, username)
|
30
|
-
token = r_client.create_egeria_bearer_token(username,
|
41
|
+
token = r_client.create_egeria_bearer_token(username, user_password)
|
31
42
|
asset_types = r_client.list_asset_types()
|
32
43
|
|
33
44
|
def generate_table() -> Table:
|
@@ -79,16 +90,18 @@ def main():
|
|
79
90
|
parser.add_argument("--server", help="Name of the server to display status for")
|
80
91
|
parser.add_argument("--url", help="URL Platform to connect to")
|
81
92
|
parser.add_argument("--userid", help="User Id")
|
93
|
+
parser.add_argument("--password", help="User Password")
|
82
94
|
|
83
95
|
args = parser.parse_args()
|
84
96
|
|
85
|
-
server = args.server if args.server is not None else
|
86
|
-
url = args.url if args.url is not None else
|
87
|
-
userid = args.userid if args.userid is not None else
|
97
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
98
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
99
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
100
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
88
101
|
# guid = args.guid if args.guid is not None else None
|
89
102
|
guid = None
|
90
103
|
|
91
|
-
display_asset_types(server, url, userid)
|
104
|
+
display_asset_types(server, url, userid, user_pass)
|
92
105
|
|
93
106
|
if __name__ == "__main__":
|
94
107
|
main()
|
@@ -10,7 +10,7 @@ A simple widget to retrieve the registered services.
|
|
10
10
|
import argparse
|
11
11
|
import sys
|
12
12
|
import time
|
13
|
-
|
13
|
+
import os
|
14
14
|
from rich import box
|
15
15
|
from rich.console import Console
|
16
16
|
from rich.prompt import Prompt
|
@@ -22,7 +22,16 @@ from pyegeria import (
|
|
22
22
|
UserNotAuthorizedException,
|
23
23
|
RegisteredInfo,
|
24
24
|
)
|
25
|
-
|
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')
|
26
35
|
|
27
36
|
def display_registered_svcs(service: str, server: str , url: str,
|
28
37
|
username: str, password: str ):
|
@@ -125,10 +134,10 @@ def main():
|
|
125
134
|
|
126
135
|
args = parser.parse_args()
|
127
136
|
|
128
|
-
server = args.server if args.server is not None else
|
129
|
-
url = args.url if args.url is not None else
|
130
|
-
userid = args.userid if args.userid is not None else
|
131
|
-
password = args.password if args.password is not None else
|
137
|
+
server = args.server if args.server is not None else EGERIA_METADATA_STORE
|
138
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
139
|
+
userid = args.userid if args.userid is not None else EGERIA_ADMIN_USER
|
140
|
+
password = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
132
141
|
|
133
142
|
svc_kind = Prompt.ask("Enter the service type you are searching for:", default="all")
|
134
143
|
|