pyegeria 5.4.0.26__py3-none-any.whl → 5.4.0.28__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.
- commands/cat/debug_log +868 -7794
- commands/cat/debug_log.2025-08-18_11-34-38_088636.zip +0 -0
- commands/cat/list_collections.py +1 -1
- commands/cat/list_format_set.py +6 -8
- commands/cli/egeria.py +2 -2
- commands/cli/egeria_cat.py +3 -2
- commands/ops/load_archive.py +2 -2
- md_processing/data/commands.json +7 -7
- md_processing/dr_egeria_inbox/dr_egeria_intro_part1.md +7 -7
- md_processing/dr_egeria_inbox/dr_egeria_intro_part2.md +36 -31
- md_processing/dr_egeria_outbox/friday/processed-2025-08-22 21:22-dr_egeria_intro_part1.md +312 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-22 21:23-dr_egeria_intro_part1.md +265 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:06-dr_egeria_intro_part1.md +230 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:30-dr_egeria_intro_part1.md +296 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:31-dr_egeria_intro_part1.md +253 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-23 16:08-dr_egeria_intro_part2.md +343 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-23 16:12-dr_egeria_intro_part2.md +343 -0
- md_processing/md_commands/glossary_commands.py +888 -951
- md_processing/md_commands/product_manager_commands.py +8 -270
- md_processing/md_commands/project_commands.py +1 -1
- md_processing/md_processing_utils/common_md_proc_utils.py +138 -64
- md_processing/md_processing_utils/common_md_utils.py +2 -1
- pyegeria/__init__.py +2 -3
- pyegeria/_client_new.py +4 -3
- pyegeria/_output_formats.py +5 -3
- pyegeria/collection_manager.py +32 -29
- pyegeria/{load_config.py → config.py} +7 -2
- pyegeria/data_designer.py +154 -194
- pyegeria/egeria_cat_client.py +46 -28
- pyegeria/egeria_client.py +71 -72
- pyegeria/egeria_config_client.py +37 -7
- pyegeria/egeria_my_client.py +45 -10
- pyegeria/egeria_tech_client.py +68 -57
- pyegeria/glossary_manager.py +495 -124
- pyegeria/governance_officer.py +2 -2
- pyegeria/logging_configuration.py +1 -4
- pyegeria/models.py +1 -1
- pyegeria/project_manager.py +359 -511
- pyegeria/utils.py +1 -3
- {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/METADATA +1 -1
- {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/RECORD +44 -38
- md_processing/md_processing_utils/solution_architect_log.log +0 -0
- pyegeria/glossary_browser.py +0 -1259
- {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/LICENSE +0 -0
- {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/WHEEL +0 -0
- {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/entry_points.txt +0 -0
pyegeria/egeria_cat_client.py
CHANGED
@@ -8,39 +8,29 @@ AssetCatalog, CollectionManager, GlossaryManager, and ProjectManager.
|
|
8
8
|
"""
|
9
9
|
from pyegeria.egeria_my_client import EgeriaMy
|
10
10
|
from pyegeria.asset_catalog_omvs import AssetCatalog
|
11
|
-
from pyegeria.collection_manager import CollectionManager
|
11
|
+
# from pyegeria.collection_manager import CollectionManager
|
12
12
|
from pyegeria.glossary_manager import GlossaryManager
|
13
13
|
from pyegeria.project_manager import ProjectManager
|
14
14
|
|
15
15
|
|
16
|
-
class EgeriaCat
|
17
|
-
AssetCatalog,
|
18
|
-
CollectionManager,
|
19
|
-
EgeriaMy,
|
20
|
-
GlossaryManager,
|
21
|
-
# GovernanceAuthor,
|
22
|
-
# PeopleOrganizer,
|
23
|
-
ProjectManager,
|
24
|
-
):
|
16
|
+
class EgeriaCat:
|
25
17
|
"""
|
26
|
-
|
18
|
+
Catalog-oriented client using composition of AssetCatalog, EgeriaMy, GlossaryManager, and ProjectManager.
|
27
19
|
|
28
20
|
Attributes:
|
29
|
-
|
30
|
-
|
31
|
-
Name of the server to use.
|
21
|
+
view_server: str
|
22
|
+
Name of the view server to use.
|
32
23
|
platform_url : str
|
33
24
|
URL of the server platform to connect to
|
34
25
|
user_id : str
|
35
|
-
The identity of the user calling the method
|
36
|
-
when the user doesn't pass the user_id on a method call.
|
26
|
+
The identity of the user calling the method.
|
37
27
|
user_pwd: str
|
38
28
|
The password associated with the user_id. Defaults to None
|
39
29
|
token: str
|
40
30
|
An optional bearer token
|
41
31
|
|
42
32
|
Methods:
|
43
|
-
|
33
|
+
Methods are provided by composed sub-clients via delegation.
|
44
34
|
"""
|
45
35
|
|
46
36
|
def __init__(
|
@@ -56,19 +46,47 @@ class EgeriaCat(
|
|
56
46
|
self.user_id = user_id
|
57
47
|
self.user_pwd = user_pwd
|
58
48
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
)
|
63
|
-
|
49
|
+
# Compose sub-clients
|
50
|
+
self._asset_catalog = AssetCatalog(view_server, platform_url, user_id, user_pwd, token)
|
51
|
+
self._my = EgeriaMy(view_server, platform_url, user_id, user_pwd, token)
|
52
|
+
self._glossary = GlossaryManager(view_server, platform_url, user_id, user_pwd, token)
|
53
|
+
self._projects = ProjectManager(view_server, platform_url, user_id, user_pwd, token)
|
54
|
+
self._subclients = [
|
55
|
+
self._asset_catalog,
|
56
|
+
self._my,
|
57
|
+
self._glossary,
|
58
|
+
self._projects,
|
59
|
+
]
|
60
|
+
|
61
|
+
def __getattr__(self, name):
|
62
|
+
for sub in self._subclients:
|
63
|
+
if hasattr(sub, name):
|
64
|
+
return getattr(sub, name)
|
65
|
+
raise AttributeError(f"{self.__class__.__name__!s} object has no attribute {name!r}")
|
66
|
+
|
67
|
+
def create_egeria_bearer_token(self, user_id: str = None, user_pwd: str = None):
|
68
|
+
token_val = None
|
69
|
+
for sub in self._subclients:
|
70
|
+
token_val = sub.create_egeria_bearer_token(user_id, user_pwd)
|
71
|
+
return token_val
|
72
|
+
|
73
|
+
def set_bearer_token(self, token: str) -> None:
|
74
|
+
for sub in self._subclients:
|
75
|
+
sub.set_bearer_token(token)
|
64
76
|
|
65
|
-
|
66
|
-
|
67
|
-
|
77
|
+
def get_token(self) -> str:
|
78
|
+
for sub in self._subclients:
|
79
|
+
if hasattr(sub, "get_token"):
|
80
|
+
return sub.get_token()
|
81
|
+
return None
|
68
82
|
|
69
|
-
|
70
|
-
|
71
|
-
|
83
|
+
def close_session(self) -> None:
|
84
|
+
for sub in self._subclients:
|
85
|
+
if hasattr(sub, "close_session"):
|
86
|
+
try:
|
87
|
+
sub.close_session()
|
88
|
+
except Exception:
|
89
|
+
pass
|
72
90
|
|
73
91
|
|
74
92
|
if __name__ == "__main__":
|
pyegeria/egeria_client.py
CHANGED
@@ -13,9 +13,8 @@ for all use cases..using the more role based clients is often appropriate:
|
|
13
13
|
"""
|
14
14
|
# from pyegeria.x_action_author_omvs import ActionAuthor
|
15
15
|
from pyegeria.asset_catalog_omvs import AssetCatalog
|
16
|
-
from pyegeria.collection_manager import CollectionManager
|
16
|
+
# from pyegeria.collection_manager import CollectionManager
|
17
17
|
from pyegeria.glossary_manager import GlossaryManager
|
18
|
-
from pyegeria.governance_officer import GovernanceOfficer
|
19
18
|
from pyegeria.project_manager import ProjectManager
|
20
19
|
from pyegeria.automated_curation_omvs import AutomatedCuration
|
21
20
|
from pyegeria.classification_manager_omvs import ClassificationManager
|
@@ -35,37 +34,13 @@ from pyegeria.governance_officer import GovernanceOfficer
|
|
35
34
|
# from pyegeria.md_processing_utils import render_markdown
|
36
35
|
|
37
36
|
|
38
|
-
class Egeria
|
39
|
-
AssetCatalog,
|
40
|
-
CollectionManager,
|
41
|
-
MyProfile,
|
42
|
-
FeedbackManager,
|
43
|
-
GlossaryManager,
|
44
|
-
# GovernanceAuthor,
|
45
|
-
# PeopleOrganizer,
|
46
|
-
ProjectManager,
|
47
|
-
RuntimeManager,
|
48
|
-
ServerOps,
|
49
|
-
FullServerConfig,
|
50
|
-
# ActionAuthor,
|
51
|
-
AutomatedCuration,
|
52
|
-
ClassificationManager,
|
53
|
-
RegisteredInfo,
|
54
|
-
TemplateManager,
|
55
|
-
ValidMetadataManager,
|
56
|
-
MetadataExplorer,
|
57
|
-
SolutionArchitect,
|
58
|
-
EgeriaConfig,
|
59
|
-
DataDesigner,
|
60
|
-
GovernanceOfficer
|
61
|
-
):
|
37
|
+
class Egeria:
|
62
38
|
"""
|
63
|
-
|
39
|
+
Overall Egeria client that composes all functional pyegeria clients and delegates calls to them.
|
64
40
|
|
65
41
|
Attributes:
|
66
|
-
|
67
42
|
view_server: str
|
68
|
-
|
43
|
+
Name of the view server to use.
|
69
44
|
platform_url : str
|
70
45
|
URL of the server platform to connect to
|
71
46
|
user_id : str
|
@@ -77,7 +52,7 @@ class Egeria(
|
|
77
52
|
An optional bearer token
|
78
53
|
|
79
54
|
Methods:
|
80
|
-
|
55
|
+
Methods are provided by composed sub-clients via delegation.
|
81
56
|
"""
|
82
57
|
|
83
58
|
def __init__(
|
@@ -88,51 +63,75 @@ class Egeria(
|
|
88
63
|
user_pwd: str = None,
|
89
64
|
token: str = None,
|
90
65
|
):
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
)
|
66
|
+
# Compose major umbrella and service clients
|
67
|
+
self._asset_catalog = AssetCatalog(view_server, platform_url, user_id, user_pwd, token)
|
68
|
+
self._my_profile = MyProfile(view_server, platform_url, user_id, user_pwd, token)
|
69
|
+
self._feedback = FeedbackManager(view_server, platform_url, user_id, user_pwd, token)
|
70
|
+
self._glossary = GlossaryManager(view_server, platform_url, user_id, user_pwd, token)
|
71
|
+
self._projects = ProjectManager(view_server, platform_url, user_id, user_pwd, token)
|
72
|
+
self._runtime = RuntimeManager(view_server, platform_url, user_id, user_pwd, token)
|
73
|
+
self._server_ops = ServerOps(view_server, platform_url, user_id, user_pwd)
|
74
|
+
self._full_server_config = FullServerConfig(view_server, platform_url, user_id, user_pwd)
|
75
|
+
self._auto_curate = AutomatedCuration(view_server, platform_url, user_id, user_pwd, token)
|
76
|
+
self._class_mgr = ClassificationManager(view_server, platform_url, user_id, user_pwd, token)
|
77
|
+
self._reg_info = RegisteredInfo(view_server, platform_url, user_id, user_pwd, token)
|
78
|
+
self._templates = TemplateManager(view_server, platform_url, user_id, user_pwd, token)
|
79
|
+
self._valid = ValidMetadataManager(view_server, platform_url, user_id, user_pwd, token)
|
80
|
+
self._explorer = MetadataExplorer(view_server, platform_url, user_id, user_pwd, token)
|
81
|
+
self._sol_arch = SolutionArchitect(view_server, platform_url, user_id, user_pwd, token)
|
82
|
+
self._config = EgeriaConfig(view_server, platform_url, user_id, user_pwd)
|
83
|
+
self._designer = DataDesigner(view_server, platform_url, user_id, user_pwd, token)
|
84
|
+
self._gov_officer = GovernanceOfficer(view_server, platform_url, user_id, user_pwd, token)
|
95
85
|
|
96
|
-
|
97
|
-
|
98
|
-
self,
|
99
|
-
|
86
|
+
self._subclients = [
|
87
|
+
self._asset_catalog,
|
88
|
+
self._my_profile,
|
89
|
+
self._feedback,
|
90
|
+
self._glossary,
|
91
|
+
self._projects,
|
92
|
+
self._runtime,
|
93
|
+
self._server_ops,
|
94
|
+
self._full_server_config,
|
95
|
+
self._auto_curate,
|
96
|
+
self._class_mgr,
|
97
|
+
self._reg_info,
|
98
|
+
self._templates,
|
99
|
+
self._valid,
|
100
|
+
self._explorer,
|
101
|
+
self._sol_arch,
|
102
|
+
self._config,
|
103
|
+
self._designer,
|
104
|
+
self._gov_officer,
|
105
|
+
]
|
100
106
|
|
101
|
-
|
102
|
-
|
103
|
-
|
107
|
+
def __getattr__(self, name):
|
108
|
+
for sub in self._subclients:
|
109
|
+
if hasattr(sub, name):
|
110
|
+
return getattr(sub, name)
|
111
|
+
raise AttributeError(f"{self.__class__.__name__!s} object has no attribute {name!r}")
|
104
112
|
|
105
|
-
|
106
|
-
|
107
|
-
|
113
|
+
def create_egeria_bearer_token(self, user_id: str = None, user_pwd: str = None):
|
114
|
+
token_val = None
|
115
|
+
for sub in self._subclients:
|
116
|
+
if hasattr(sub, "create_egeria_bearer_token"):
|
117
|
+
token_val = sub.create_egeria_bearer_token(user_id, user_pwd)
|
118
|
+
return token_val
|
108
119
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
120
|
+
def set_bearer_token(self, token: str) -> None:
|
121
|
+
for sub in self._subclients:
|
122
|
+
if hasattr(sub, "set_bearer_token"):
|
123
|
+
sub.set_bearer_token(token)
|
113
124
|
|
114
|
-
|
125
|
+
def get_token(self) -> str:
|
126
|
+
for sub in self._subclients:
|
127
|
+
if hasattr(sub, "get_token"):
|
128
|
+
return sub.get_token()
|
129
|
+
return None
|
115
130
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
RegisteredInfo.__init__(
|
124
|
-
self, view_server, platform_url, user_id, user_pwd, token
|
125
|
-
)
|
126
|
-
ValidMetadataManager.__init__(
|
127
|
-
self, view_server, platform_url, user_id, user_pwd, token
|
128
|
-
)
|
129
|
-
SolutionArchitect.__init__(
|
130
|
-
self, view_server, platform_url, user_id, user_pwd, token
|
131
|
-
)
|
132
|
-
DataDesigner.__init__(
|
133
|
-
self, view_server, platform_url, user_id, user_pwd, token
|
134
|
-
)
|
135
|
-
GovernanceOfficer.__init__(
|
136
|
-
self, view_server, platform_url, user_id, user_pwd, token
|
137
|
-
)
|
138
|
-
print(Egeria.mro())
|
131
|
+
def close_session(self) -> None:
|
132
|
+
for sub in self._subclients:
|
133
|
+
if hasattr(sub, "close_session"):
|
134
|
+
try:
|
135
|
+
sub.close_session()
|
136
|
+
except Exception:
|
137
|
+
pass
|
pyegeria/egeria_config_client.py
CHANGED
@@ -10,14 +10,13 @@ from pyegeria.full_omag_server_config import FullServerConfig
|
|
10
10
|
from pyegeria.server_operations import ServerOps
|
11
11
|
|
12
12
|
|
13
|
-
class EgeriaConfig
|
13
|
+
class EgeriaConfig:
|
14
14
|
"""
|
15
|
-
Client for configuring the Egeria Platform and Servers
|
15
|
+
Client for configuring the Egeria Platform and Servers using composition.
|
16
16
|
|
17
17
|
Attributes:
|
18
|
-
|
19
18
|
server_name: str
|
20
|
-
|
19
|
+
Name of the server to use.
|
21
20
|
platform_url : str
|
22
21
|
URL of the server platform to connect to
|
23
22
|
user_id : str
|
@@ -27,7 +26,7 @@ class EgeriaConfig(FullServerConfig, ServerOps):
|
|
27
26
|
The password associated with the user_id. Defaults to None
|
28
27
|
|
29
28
|
Methods:
|
30
|
-
|
29
|
+
Methods are provided by composed sub-clients via delegation.
|
31
30
|
"""
|
32
31
|
|
33
32
|
def __init__(
|
@@ -38,8 +37,39 @@ class EgeriaConfig(FullServerConfig, ServerOps):
|
|
38
37
|
self.user_id = user_id
|
39
38
|
self.user_pwd = user_pwd
|
40
39
|
|
41
|
-
FullServerConfig
|
42
|
-
ServerOps
|
40
|
+
self._config = FullServerConfig(server_name, platform_url, user_id, user_pwd)
|
41
|
+
self._ops = ServerOps(server_name, platform_url, user_id, user_pwd)
|
42
|
+
self._subclients = [self._config, self._ops]
|
43
|
+
|
44
|
+
def __getattr__(self, name):
|
45
|
+
for sub in self._subclients:
|
46
|
+
if hasattr(sub, name):
|
47
|
+
return getattr(sub, name)
|
48
|
+
raise AttributeError(f"{self.__class__.__name__!s} object has no attribute {name!r}")
|
49
|
+
|
50
|
+
def create_egeria_bearer_token(self, user_id: str = None, user_pwd: str = None):
|
51
|
+
token_val = None
|
52
|
+
for sub in self._subclients:
|
53
|
+
token_val = sub.create_egeria_bearer_token(user_id, user_pwd)
|
54
|
+
return token_val
|
55
|
+
|
56
|
+
def set_bearer_token(self, token: str) -> None:
|
57
|
+
for sub in self._subclients:
|
58
|
+
sub.set_bearer_token(token)
|
59
|
+
|
60
|
+
def get_token(self) -> str:
|
61
|
+
for sub in self._subclients:
|
62
|
+
if hasattr(sub, "get_token"):
|
63
|
+
return sub.get_token()
|
64
|
+
return None
|
65
|
+
|
66
|
+
def close_session(self) -> None:
|
67
|
+
for sub in self._subclients:
|
68
|
+
if hasattr(sub, "close_session"):
|
69
|
+
try:
|
70
|
+
sub.close_session()
|
71
|
+
except Exception:
|
72
|
+
pass
|
43
73
|
|
44
74
|
|
45
75
|
if __name__ == "__main__":
|
pyegeria/egeria_my_client.py
CHANGED
@@ -12,14 +12,13 @@ from pyegeria.utils import body_slimmer
|
|
12
12
|
from pyegeria._exceptions import InvalidParameterException
|
13
13
|
|
14
14
|
|
15
|
-
class EgeriaMy
|
15
|
+
class EgeriaMy:
|
16
16
|
"""
|
17
|
-
Client to issue Runtime status requests.
|
17
|
+
Client to issue Runtime status requests using composition of MyProfile and FeedbackManager.
|
18
18
|
|
19
19
|
Attributes:
|
20
|
-
|
21
20
|
view_server: str
|
22
|
-
|
21
|
+
Name of the view server to use.
|
23
22
|
platform_url : str
|
24
23
|
URL of the server platform to connect to
|
25
24
|
user_id : str
|
@@ -27,10 +26,11 @@ class EgeriaMy(MyProfile, FeedbackManager):
|
|
27
26
|
when the user doesn't pass the user_id on a method call.
|
28
27
|
user_pwd: str
|
29
28
|
The password associated with the user_id. Defaults to None
|
30
|
-
|
29
|
+
token: str, optional
|
30
|
+
Bearer token used for authentication.
|
31
31
|
|
32
32
|
Methods:
|
33
|
-
|
33
|
+
Methods are provided by composed sub-clients (MyProfile, FeedbackManager) via delegation.
|
34
34
|
"""
|
35
35
|
|
36
36
|
def __init__(
|
@@ -46,10 +46,45 @@ class EgeriaMy(MyProfile, FeedbackManager):
|
|
46
46
|
self.user_id = user_id
|
47
47
|
self.user_pwd = user_pwd
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
# Compose sub-clients
|
50
|
+
self._my_profile = MyProfile(view_server, platform_url, user_id, user_pwd, token)
|
51
|
+
self._feedback = FeedbackManager(view_server, platform_url, user_id, user_pwd, token)
|
52
|
+
# Keep an ordered list for delegation lookups and bulk operations
|
53
|
+
self._subclients = [self._my_profile, self._feedback]
|
54
|
+
|
55
|
+
# Delegation: route unknown attributes to first sub-client that has it
|
56
|
+
def __getattr__(self, name):
|
57
|
+
for sub in self._subclients:
|
58
|
+
if hasattr(sub, name):
|
59
|
+
return getattr(sub, name)
|
60
|
+
raise AttributeError(f"{self.__class__.__name__!s} object has no attribute {name!r}")
|
61
|
+
|
62
|
+
# Token management across subclients
|
63
|
+
def create_egeria_bearer_token(self, user_id: str = None, user_pwd: str = None):
|
64
|
+
token_val = None
|
65
|
+
for sub in self._subclients:
|
66
|
+
token_val = sub.create_egeria_bearer_token(user_id, user_pwd)
|
67
|
+
return token_val
|
68
|
+
|
69
|
+
def set_bearer_token(self, token: str) -> None:
|
70
|
+
for sub in self._subclients:
|
71
|
+
sub.set_bearer_token(token)
|
72
|
+
|
73
|
+
def get_token(self) -> str:
|
74
|
+
# Return token from the first sub-client that provides it
|
75
|
+
for sub in self._subclients:
|
76
|
+
if hasattr(sub, "get_token"):
|
77
|
+
return sub.get_token()
|
78
|
+
return None
|
79
|
+
|
80
|
+
def close_session(self) -> None:
|
81
|
+
for sub in self._subclients:
|
82
|
+
if hasattr(sub, "close_session"):
|
83
|
+
try:
|
84
|
+
sub.close_session()
|
85
|
+
except Exception:
|
86
|
+
# Best-effort close; ignore individual errors
|
87
|
+
pass
|
53
88
|
|
54
89
|
|
55
90
|
if __name__ == "__main__":
|
pyegeria/egeria_tech_client.py
CHANGED
@@ -19,41 +19,24 @@ from pyegeria.governance_officer import GovernanceOfficer
|
|
19
19
|
from pyegeria.collection_manager import CollectionManager
|
20
20
|
|
21
21
|
|
22
|
-
class EgeriaTech
|
23
|
-
# ActionAuthor,
|
24
|
-
AutomatedCuration,
|
25
|
-
EgeriaCat,
|
26
|
-
ClassificationManager,
|
27
|
-
RegisteredInfo,
|
28
|
-
RuntimeManager,
|
29
|
-
ValidMetadataManager,
|
30
|
-
MetadataExplorer,
|
31
|
-
SolutionArchitect,
|
32
|
-
DataDesigner,
|
33
|
-
TemplateManager,
|
34
|
-
GovernanceOfficer,
|
35
|
-
CollectionManager
|
36
|
-
):
|
22
|
+
class EgeriaTech:
|
37
23
|
"""
|
38
|
-
Client for technical Egeria users.
|
24
|
+
Client for technical Egeria users using composition.
|
39
25
|
|
40
26
|
Attributes:
|
41
|
-
|
42
27
|
view_server: str
|
43
|
-
|
28
|
+
Name of the view server to use.
|
44
29
|
platform_url : str
|
45
30
|
URL of the server platform to connect to
|
46
31
|
user_id : str
|
47
|
-
The identity of the user calling the method
|
48
|
-
when the user doesn't pass the user_id on a method call.
|
32
|
+
The identity of the user calling the method.
|
49
33
|
user_pwd: str
|
50
34
|
The password associated with the user_id. Defaults to None
|
51
35
|
token: str, optional
|
52
36
|
Bearer token
|
53
37
|
|
54
38
|
Methods:
|
55
|
-
|
56
|
-
ClassificationManager, RegisteredInfo, ValidMetadataManager
|
39
|
+
Methods are provided by composed sub-clients via delegation.
|
57
40
|
"""
|
58
41
|
|
59
42
|
def __init__(
|
@@ -64,41 +47,69 @@ class EgeriaTech(
|
|
64
47
|
user_pwd: str = None,
|
65
48
|
token: str = None,
|
66
49
|
):
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
)
|
75
|
-
|
76
|
-
|
77
|
-
)
|
78
|
-
|
79
|
-
|
80
|
-
)
|
81
|
-
|
82
|
-
|
83
|
-
)
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
self,
|
89
|
-
|
90
|
-
|
91
|
-
self,
|
92
|
-
|
93
|
-
|
94
|
-
self,
|
95
|
-
|
96
|
-
|
97
|
-
self,
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
50
|
+
self.view_server = view_server
|
51
|
+
self.platform_url = platform_url
|
52
|
+
self.user_id = user_id
|
53
|
+
self.user_pwd = user_pwd
|
54
|
+
|
55
|
+
# Compose sub-clients
|
56
|
+
self._auto_curate = AutomatedCuration(view_server, platform_url, user_id, user_pwd, token)
|
57
|
+
self._cat = EgeriaCat(view_server, platform_url, user_id, user_pwd, token)
|
58
|
+
self._class_mgr = ClassificationManager(view_server, platform_url, user_id, user_pwd, token)
|
59
|
+
self._reg_info = RegisteredInfo(view_server, platform_url, user_id, user_pwd, token)
|
60
|
+
self._runtime = RuntimeManager(view_server, platform_url, user_id, user_pwd, token)
|
61
|
+
self._valid = ValidMetadataManager(view_server, platform_url, user_id, user_pwd, token)
|
62
|
+
self._explorer = MetadataExplorer(view_server, platform_url, user_id, user_pwd, token)
|
63
|
+
self._sol_arch = SolutionArchitect(view_server, platform_url, user_id, user_pwd, token)
|
64
|
+
self._designer = DataDesigner(view_server, platform_url, user_id, user_pwd, token)
|
65
|
+
self._templates = TemplateManager(view_server, platform_url, user_id, user_pwd, token)
|
66
|
+
self._gov_officer = GovernanceOfficer(view_server, platform_url, user_id, user_pwd, token)
|
67
|
+
self._collections = CollectionManager(view_server, platform_url, user_id, user_pwd, token)
|
68
|
+
|
69
|
+
self._subclients = [
|
70
|
+
self._auto_curate,
|
71
|
+
self._cat,
|
72
|
+
self._class_mgr,
|
73
|
+
self._reg_info,
|
74
|
+
self._runtime,
|
75
|
+
self._valid,
|
76
|
+
self._explorer,
|
77
|
+
self._sol_arch,
|
78
|
+
self._designer,
|
79
|
+
self._templates,
|
80
|
+
self._gov_officer,
|
81
|
+
self._collections,
|
82
|
+
]
|
83
|
+
|
84
|
+
def __getattr__(self, name):
|
85
|
+
for sub in self._subclients:
|
86
|
+
if hasattr(sub, name):
|
87
|
+
return getattr(sub, name)
|
88
|
+
raise AttributeError(f"{self.__class__.__name__!s} object has no attribute {name!r}")
|
89
|
+
|
90
|
+
def create_egeria_bearer_token(self, user_id: str = None, user_pwd: str = None):
|
91
|
+
token_val = None
|
92
|
+
for sub in self._subclients:
|
93
|
+
token_val = sub.create_egeria_bearer_token(user_id, user_pwd)
|
94
|
+
return token_val
|
95
|
+
|
96
|
+
def set_bearer_token(self, token: str) -> None:
|
97
|
+
for sub in self._subclients:
|
98
|
+
sub.set_bearer_token(token)
|
99
|
+
|
100
|
+
def get_token(self) -> str:
|
101
|
+
for sub in self._subclients:
|
102
|
+
if hasattr(sub, "get_token"):
|
103
|
+
return sub.get_token()
|
104
|
+
return None
|
105
|
+
|
106
|
+
def close_session(self) -> None:
|
107
|
+
for sub in self._subclients:
|
108
|
+
if hasattr(sub, "close_session"):
|
109
|
+
try:
|
110
|
+
sub.close_session()
|
111
|
+
except Exception:
|
112
|
+
pass
|
102
113
|
|
103
114
|
if __name__ == "__main__":
|
104
115
|
print("Main-Tech Client")
|