pyegeria 5.3.3.9__py3-none-any.whl → 5.3.3.10__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/.DS_Store +0 -0
- pyegeria/__init__.py +4 -2
- pyegeria/_client.py +3 -1
- pyegeria/classification_manager_omvs.py +2 -0
- pyegeria/commands/.DS_Store +0 -0
- pyegeria/commands/__pycache__/__init__.cpython-312.pyc +0 -0
- pyegeria/commands/__pycache__/server_status_widget.cpython-312-pytest-7.4.4.pyc +0 -0
- pyegeria/commands/cat/__pycache__/__init__.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/get_asset_graph.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/get_collection.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/get_project_dependencies.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/get_project_structure.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/get_tech_type_elements.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/glossary_actions.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_assets.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_cert_types.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_collections.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_deployed_catalogs.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_deployed_database_schemas.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_deployed_databases.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_glossaries.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_projects.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_servers_deployed_imp.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_tech_type_elements.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_tech_types.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_terms.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_todos.cpython-312.pyc +0 -0
- pyegeria/commands/cat/__pycache__/list_user_ids.cpython-312.pyc +0 -0
- pyegeria/commands/cat/list_terms.py +9 -8
- pyegeria/commands/cli/__pycache__/__init__.cpython-312.pyc +0 -0
- pyegeria/commands/cli/__pycache__/egeria_login_tui.cpython-312.pyc +0 -0
- pyegeria/commands/cli/__pycache__/egeria_ops.cpython-312.pyc +0 -0
- pyegeria/commands/cli/__pycache__/ops_config.cpython-312.pyc +0 -0
- pyegeria/commands/doc/.DS_Store +0 -0
- pyegeria/commands/doc/Visual Command Reference/.DS_Store +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/.DS_Store +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/.DS_Store +0 -0
- pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/.DS_Store +0 -0
- pyegeria/commands/doc/glossary/.DS_Store +0 -0
- pyegeria/commands/doc/glossary/images/.DS_Store +0 -0
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/.DS_Store +0 -0
- pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/.DS_Store +0 -0
- pyegeria/commands/my/__pycache__/__init__.cpython-312.pyc +0 -0
- pyegeria/commands/my/__pycache__/list_my_profile.cpython-312.pyc +0 -0
- pyegeria/commands/my/__pycache__/list_my_roles.cpython-312.pyc +0 -0
- pyegeria/commands/my/__pycache__/monitor_my_todos.cpython-312.pyc +0 -0
- pyegeria/commands/my/__pycache__/monitor_open_todos.cpython-312.pyc +0 -0
- pyegeria/commands/my/__pycache__/todo_actions.cpython-312.pyc +0 -0
- pyegeria/commands/my/monitor_my_todos.py +1 -1
- pyegeria/commands/my/monitor_open_todos.py +1 -1
- pyegeria/commands/ops/__pycache__/__init__.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/gov_server_actions.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/list_archives.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/list_catalog_targets.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/load_archive.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/monitor_engine_activity.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/monitor_engine_activity_c.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/monitor_gov_eng_status.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/monitor_integ_daemon_status.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/monitor_platform_status.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/monitor_server_startup.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/monitor_server_status.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/refresh_integration_daemon.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/restart_integration_daemon.cpython-312.pyc +0 -0
- pyegeria/commands/ops/__pycache__/table_integ_daemon_status.cpython-312.pyc +0 -0
- pyegeria/commands/ops/monitor_engine_activity.py +3 -2
- pyegeria/commands/ops/monitor_engine_activity_c.py +3 -3
- pyegeria/commands/ops/monitor_platform_status.py +1 -1
- pyegeria/commands/ops/monitor_server_status.py +6 -3
- pyegeria/commands/tech/__pycache__/__init__.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/get_element_info.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/get_guid_info.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/get_tech_details.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/get_tech_type_template.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/list_anchored_elements.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/list_asset_types.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/list_elements_by_property_value.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/list_elements_for_classification.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/list_gov_action_processes.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/list_registered_services.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/list_related_specification.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/list_relationship_types.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/list_relationships.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/list_tech_templates.cpython-312.pyc +0 -0
- pyegeria/commands/tech/__pycache__/list_valid_metadata_values.cpython-312.pyc +0 -0
- pyegeria/commands/tech/list_information_blueprints.py +166 -0
- pyegeria/commands/tech/list_information_supply_chains.py +145 -0
- pyegeria/egeria_client.py +5 -0
- pyegeria/egeria_tech_client.py +6 -2
- pyegeria/mermaid_utilities.py +51 -21
- pyegeria/metadata_explorer_omvs.py +0 -43
- pyegeria/solution_architect_omvs.py +642 -0
- {pyegeria-5.3.3.9.dist-info → pyegeria-5.3.3.10.dist-info}/METADATA +1 -1
- {pyegeria-5.3.3.9.dist-info → pyegeria-5.3.3.10.dist-info}/RECORD +97 -19
- {pyegeria-5.3.3.9.dist-info → pyegeria-5.3.3.10.dist-info}/entry_points.txt +1 -0
- {pyegeria-5.3.3.9.dist-info → pyegeria-5.3.3.10.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.3.9.dist-info → pyegeria-5.3.3.10.dist-info}/WHEEL +0 -0
@@ -0,0 +1,642 @@
|
|
1
|
+
"""PDX-License-Identifier: Apache-2.0
|
2
|
+
Copyright Contributors to the ODPi Egeria project.
|
3
|
+
|
4
|
+
This module provides access to the metadata-explorer OMVS module.
|
5
|
+
|
6
|
+
https://egeria-project.org/concepts/information-supply-chain
|
7
|
+
|
8
|
+
"""
|
9
|
+
|
10
|
+
import asyncio
|
11
|
+
|
12
|
+
from httpx import Response
|
13
|
+
|
14
|
+
from pyegeria import body_slimmer
|
15
|
+
from pyegeria._client import Client, max_paging_size
|
16
|
+
import sys
|
17
|
+
import os
|
18
|
+
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
|
19
|
+
|
20
|
+
NO_ELEMENTS_FOUND = "No Elements Found"
|
21
|
+
|
22
|
+
DEFAULT_BODY_SKELETON = {
|
23
|
+
'effective_time' : None,
|
24
|
+
'limitResultsByStatus' : ['ACTIVE'],
|
25
|
+
'asOfTime' : None,
|
26
|
+
'sequencingOrder' : None,
|
27
|
+
'sequencingProperty' : None,
|
28
|
+
'filter' : None
|
29
|
+
}
|
30
|
+
|
31
|
+
def query_seperator(current_string):
|
32
|
+
if current_string == "":
|
33
|
+
return "?"
|
34
|
+
else:
|
35
|
+
return "&"
|
36
|
+
|
37
|
+
|
38
|
+
"params are in the form of [(paramName, value), (param2Name, value)] if the value is not None, it will be added to the query string"
|
39
|
+
|
40
|
+
|
41
|
+
def query_string(params):
|
42
|
+
result = ""
|
43
|
+
for i in range(len(params)):
|
44
|
+
if params[i][1] is not None:
|
45
|
+
result = f"{result}{query_seperator(result)}{params[i][0]}={params[i][1]}"
|
46
|
+
return result
|
47
|
+
|
48
|
+
|
49
|
+
def base_path(client, view_server: str):
|
50
|
+
return f"{client.platform_url}/servers/{view_server}/api/open-metadata/metadata-explorer"
|
51
|
+
|
52
|
+
|
53
|
+
class SolutionArchitect(Client):
|
54
|
+
"""SolutionArchitect is a class that extends the Client class. The Solution Architect OMVS provides APIs for
|
55
|
+
searching for architectural elements such as information supply chains, solution blueprints, solution components
|
56
|
+
and component implementations.
|
57
|
+
|
58
|
+
Attributes:
|
59
|
+
|
60
|
+
view_server: str
|
61
|
+
The name of the View Server to connect to.
|
62
|
+
platform_url : str
|
63
|
+
URL of the server platform to connect to
|
64
|
+
user_id : str
|
65
|
+
The identity of the user calling the method - this sets a
|
66
|
+
default optionally used by the methods when the user
|
67
|
+
doesn't pass the user_id on a method call.
|
68
|
+
user_pwd: str
|
69
|
+
The password associated with the user_id. Defaults to None
|
70
|
+
|
71
|
+
|
72
|
+
"""
|
73
|
+
|
74
|
+
def __init__(
|
75
|
+
self,
|
76
|
+
view_server: str,
|
77
|
+
platform_url: str,
|
78
|
+
user_id: str = None,
|
79
|
+
user_pwd: str = None,
|
80
|
+
token: str = None,
|
81
|
+
):
|
82
|
+
self.view_server = view_server
|
83
|
+
self.platform_url = platform_url
|
84
|
+
self.user_id = user_id
|
85
|
+
self.user_pwd = user_pwd
|
86
|
+
self.solution_architect_command_root: str = (f"{self.platform_url}/servers/{self.view_server}"
|
87
|
+
f"/api/open-metadata/solution-architect")
|
88
|
+
Client.__init__(
|
89
|
+
self,
|
90
|
+
view_server,
|
91
|
+
platform_url,
|
92
|
+
user_id=user_id,
|
93
|
+
user_pwd=user_pwd,
|
94
|
+
token=token,
|
95
|
+
)
|
96
|
+
|
97
|
+
#
|
98
|
+
#
|
99
|
+
#
|
100
|
+
|
101
|
+
async def _async_find_information_supply_chains(self,
|
102
|
+
filter: str = "*",
|
103
|
+
starts_with: bool = True,
|
104
|
+
ends_with: bool = False,
|
105
|
+
ignore_case: bool = False,
|
106
|
+
start_from: int = 0,
|
107
|
+
page_size: int = max_paging_size,
|
108
|
+
body: dict = None,) ->list[dict] | str:
|
109
|
+
|
110
|
+
"""Retrieve the list of information supply chain metadata elements that contain the search string.
|
111
|
+
https://egeria-project.org/concepts/information-supply-chain
|
112
|
+
Async version.
|
113
|
+
|
114
|
+
Parameters
|
115
|
+
----------
|
116
|
+
filter : str
|
117
|
+
- search_filter string to search for.
|
118
|
+
starts_with : bool, [default=False], optional
|
119
|
+
Starts with the supplied string.
|
120
|
+
ends_with : bool, [default=False], optional
|
121
|
+
Ends with the supplied string
|
122
|
+
ignore_case : bool, [default=False], optional
|
123
|
+
Ignore case when searching
|
124
|
+
body: dict, optional, default = None
|
125
|
+
- additional optional specifications for the search.
|
126
|
+
|
127
|
+
Returns
|
128
|
+
-------
|
129
|
+
list[dict] | str
|
130
|
+
A list of information supply chain structures or a string if there are no elements found.
|
131
|
+
|
132
|
+
Raises
|
133
|
+
------
|
134
|
+
InvalidParameterException
|
135
|
+
one of the parameters is null or invalid or
|
136
|
+
PropertyServerException
|
137
|
+
There is a problem adding the element properties to the metadata repository or
|
138
|
+
UserNotAuthorizedException
|
139
|
+
the requesting user is not authorized to issue this request.
|
140
|
+
"""
|
141
|
+
|
142
|
+
possible_query_params = query_string(
|
143
|
+
[
|
144
|
+
("startFrom", start_from),
|
145
|
+
("pageSize", page_size),
|
146
|
+
("startsWith", starts_with),
|
147
|
+
("endsWith", ends_with),
|
148
|
+
("ignoreCase", ignore_case),
|
149
|
+
]
|
150
|
+
)
|
151
|
+
|
152
|
+
if filter is None or filter == "*":
|
153
|
+
search_filter = None
|
154
|
+
else:
|
155
|
+
search_filter = filter
|
156
|
+
|
157
|
+
if body is None:
|
158
|
+
body = {
|
159
|
+
"filter": search_filter,
|
160
|
+
}
|
161
|
+
else:
|
162
|
+
body["filter"] = search_filter
|
163
|
+
|
164
|
+
url = (
|
165
|
+
f"{self.solution_architect_command_root}/information-supply-chains/by-search-string"
|
166
|
+
f"{possible_query_params}"
|
167
|
+
)
|
168
|
+
response: Response = await self._async_make_request(
|
169
|
+
"POST", url, body_slimmer(body)
|
170
|
+
)
|
171
|
+
return response.json().get("elements", NO_ELEMENTS_FOUND)
|
172
|
+
|
173
|
+
def find_information_supply_chains(self,
|
174
|
+
filter: str = "*",
|
175
|
+
starts_with: bool = True,
|
176
|
+
ends_with: bool = False,
|
177
|
+
ignore_case: bool = False,
|
178
|
+
start_from: int = 0,
|
179
|
+
page_size: int = max_paging_size,
|
180
|
+
body: dict = None) -> list[dict] | str:
|
181
|
+
|
182
|
+
"""Retrieve the list of information supply chain metadata elements that contain the search string.
|
183
|
+
https://egeria-project.org/concepts/information-supply-chain
|
184
|
+
|
185
|
+
Parameters
|
186
|
+
----------
|
187
|
+
filter: str
|
188
|
+
- search_filterstring to search for.
|
189
|
+
starts_with : bool, [default=False], optional
|
190
|
+
Starts with the supplied string.
|
191
|
+
ends_with : bool, [default=False], optional
|
192
|
+
Ends with the supplied string
|
193
|
+
ignore_case : bool, [default=False], optional
|
194
|
+
Ignore case when searching
|
195
|
+
body: dict, optional, default = None
|
196
|
+
- additional optional specifications for the search.
|
197
|
+
|
198
|
+
Returns
|
199
|
+
-------
|
200
|
+
list[dict] | str
|
201
|
+
A list of information supply chain structures or a string if there are no elements found.
|
202
|
+
|
203
|
+
Raises
|
204
|
+
------
|
205
|
+
InvalidParameterException
|
206
|
+
one of the parameters is null or invalid or
|
207
|
+
PropertyServerException
|
208
|
+
There is a problem adding the element properties to the metadata repository or
|
209
|
+
UserNotAuthorizedException
|
210
|
+
the requesting user is not authorized to issue this request.
|
211
|
+
"""
|
212
|
+
|
213
|
+
loop = asyncio.get_event_loop()
|
214
|
+
response = loop.run_until_complete(
|
215
|
+
self._async_find_information_supply_chains(
|
216
|
+
filter,
|
217
|
+
starts_with,
|
218
|
+
ends_with,
|
219
|
+
ignore_case,
|
220
|
+
start_from,
|
221
|
+
page_size,
|
222
|
+
body,)
|
223
|
+
)
|
224
|
+
return response
|
225
|
+
|
226
|
+
|
227
|
+
def find_all_information_supply_chains(self, start_from: int = 0, page_size: int = max_paging_size) \
|
228
|
+
-> list[dict] | str:
|
229
|
+
"""Retrieve a list of all information supply chains
|
230
|
+
https://egeria-project.org/concepts/information-supply-chain
|
231
|
+
"""
|
232
|
+
|
233
|
+
return (self.find_information_supply_chains('*', start_from = start_from, page_size = page_size ))
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
async def _async_find_solution_blueprints(self,
|
238
|
+
filter: str = "*",
|
239
|
+
starts_with: bool = True,
|
240
|
+
ends_with: bool = False,
|
241
|
+
ignore_case: bool = False,
|
242
|
+
start_from: int = 0,
|
243
|
+
page_size: int = max_paging_size,
|
244
|
+
body: dict = None,) ->list[dict] | str:
|
245
|
+
|
246
|
+
"""Retrieve the solution blueprint elements that contain the search string.
|
247
|
+
https://egeria-project.org/concepts/solution-blueprint
|
248
|
+
Async version.
|
249
|
+
|
250
|
+
Parameters
|
251
|
+
----------
|
252
|
+
filter: str
|
253
|
+
- search_filterstring to search for.
|
254
|
+
starts_with : bool, [default=False], optional
|
255
|
+
Starts with the supplied string.
|
256
|
+
ends_with : bool, [default=False], optional
|
257
|
+
Ends with the supplied string
|
258
|
+
ignore_case : bool, [default=False], optional
|
259
|
+
Ignore case when searching
|
260
|
+
body: dict, optional, default = None
|
261
|
+
- additional optional specifications for the search.
|
262
|
+
|
263
|
+
Returns
|
264
|
+
-------
|
265
|
+
list[dict] | str
|
266
|
+
A list of solution blueprint structures or a string if there are no elements found.
|
267
|
+
|
268
|
+
Raises
|
269
|
+
------
|
270
|
+
InvalidParameterException
|
271
|
+
one of the parameters is null or invalid or
|
272
|
+
PropertyServerException
|
273
|
+
There is a problem adding the element properties to the metadata repository or
|
274
|
+
UserNotAuthorizedException
|
275
|
+
the requesting user is not authorized to issue this request.
|
276
|
+
"""
|
277
|
+
|
278
|
+
possible_query_params = query_string(
|
279
|
+
[
|
280
|
+
("startFrom", start_from),
|
281
|
+
("pageSize", page_size),
|
282
|
+
("startsWith", starts_with),
|
283
|
+
("endsWith", ends_with),
|
284
|
+
("ignoreCase", ignore_case),
|
285
|
+
]
|
286
|
+
)
|
287
|
+
|
288
|
+
if filter is None or filter== "*":
|
289
|
+
search_filter = None
|
290
|
+
else:
|
291
|
+
search_filter = filter
|
292
|
+
|
293
|
+
if body is None:
|
294
|
+
body = {
|
295
|
+
"filter": search_filter,
|
296
|
+
}
|
297
|
+
else:
|
298
|
+
body["filter"] = search_filter
|
299
|
+
|
300
|
+
url = (
|
301
|
+
f"{self.solution_architect_command_root}/solution-blueprints/by-search-string"
|
302
|
+
f"{possible_query_params}"
|
303
|
+
)
|
304
|
+
response: Response = await self._async_make_request(
|
305
|
+
"POST", url, body_slimmer(body)
|
306
|
+
)
|
307
|
+
return response.json().get("elements", NO_ELEMENTS_FOUND)
|
308
|
+
|
309
|
+
def find_solution_blueprints(self,
|
310
|
+
filter: str = "*",
|
311
|
+
starts_with: bool = True,
|
312
|
+
ends_with: bool = False,
|
313
|
+
ignore_case: bool = False,
|
314
|
+
start_from: int = 0,
|
315
|
+
page_size: int = max_paging_size,
|
316
|
+
body: dict = None) -> list[dict] | str:
|
317
|
+
|
318
|
+
"""Retrieve the list of solution blueprint elements that contain the search string.
|
319
|
+
https://egeria-project.org/concepts/solution-blueprint
|
320
|
+
|
321
|
+
Parameters
|
322
|
+
----------
|
323
|
+
filter: str
|
324
|
+
- search_filterstring to search for.
|
325
|
+
starts_with : bool, [default=False], optional
|
326
|
+
Starts with the supplied string.
|
327
|
+
ends_with : bool, [default=False], optional
|
328
|
+
Ends with the supplied string
|
329
|
+
ignore_case : bool, [default=False], optional
|
330
|
+
Ignore case when searching
|
331
|
+
body: dict, optional, default = None
|
332
|
+
- additional optional specifications for the search.
|
333
|
+
|
334
|
+
Returns
|
335
|
+
-------
|
336
|
+
list[dict] | str
|
337
|
+
A list of information supply chain structures or a string if there are no elements found.
|
338
|
+
|
339
|
+
Raises
|
340
|
+
------
|
341
|
+
InvalidParameterException
|
342
|
+
one of the parameters is null or invalid or
|
343
|
+
PropertyServerException
|
344
|
+
There is a problem adding the element properties to the metadata repository or
|
345
|
+
UserNotAuthorizedException
|
346
|
+
the requesting user is not authorized to issue this request.
|
347
|
+
"""
|
348
|
+
|
349
|
+
loop = asyncio.get_event_loop()
|
350
|
+
response = loop.run_until_complete(
|
351
|
+
self._async_find_solution_blueprints(
|
352
|
+
filter,
|
353
|
+
starts_with,
|
354
|
+
ends_with,
|
355
|
+
ignore_case,
|
356
|
+
start_from,
|
357
|
+
page_size,
|
358
|
+
body,)
|
359
|
+
)
|
360
|
+
return response
|
361
|
+
|
362
|
+
def find_all_solution_blueprints(self, start_from: int = 0, page_size: int = max_paging_size) \
|
363
|
+
-> list[dict] | str:
|
364
|
+
"""Retrieve a list of all solution blueprint elements
|
365
|
+
https://egeria-project.org/concepts/solution-blueprint
|
366
|
+
"""
|
367
|
+
return (self.find_solution_blueprints('*', start_from = start_from, page_size = page_size ))
|
368
|
+
|
369
|
+
|
370
|
+
async def _async_find_solution_roles(self,
|
371
|
+
filter: str = "*",
|
372
|
+
starts_with: bool = True,
|
373
|
+
ends_with: bool = False,
|
374
|
+
ignore_case: bool = False,
|
375
|
+
start_from: int = 0,
|
376
|
+
page_size: int = max_paging_size,
|
377
|
+
body: dict = None,) ->list[dict] | str:
|
378
|
+
|
379
|
+
"""Retrieve the solutio nrole elements that contain the search string.
|
380
|
+
https://egeria-project.org/concepts/actor
|
381
|
+
Async version.
|
382
|
+
|
383
|
+
Parameters
|
384
|
+
----------
|
385
|
+
filter: str
|
386
|
+
- search_filterstring to search for.
|
387
|
+
starts_with : bool, [default=False], optional
|
388
|
+
Starts with the supplied string.
|
389
|
+
ends_with : bool, [default=False], optional
|
390
|
+
Ends with the supplied string
|
391
|
+
ignore_case : bool, [default=False], optional
|
392
|
+
Ignore case when searching
|
393
|
+
body: dict, optional, default = None
|
394
|
+
- additional optional specifications for the search.
|
395
|
+
|
396
|
+
Returns
|
397
|
+
-------
|
398
|
+
list[dict] | str
|
399
|
+
A list of solution role structures or a string if there are no elements found.
|
400
|
+
|
401
|
+
Raises
|
402
|
+
------
|
403
|
+
InvalidParameterException
|
404
|
+
one of the parameters is null or invalid or
|
405
|
+
PropertyServerException
|
406
|
+
There is a problem adding the element properties to the metadata repository or
|
407
|
+
UserNotAuthorizedException
|
408
|
+
the requesting user is not authorized to issue this request.
|
409
|
+
"""
|
410
|
+
|
411
|
+
possible_query_params = query_string(
|
412
|
+
[
|
413
|
+
("startFrom", start_from),
|
414
|
+
("pageSize", page_size),
|
415
|
+
("startsWith", starts_with),
|
416
|
+
("endsWith", ends_with),
|
417
|
+
("ignoreCase", ignore_case),
|
418
|
+
]
|
419
|
+
)
|
420
|
+
|
421
|
+
if filter is None or filter== "*":
|
422
|
+
search_filter = None
|
423
|
+
else:
|
424
|
+
search_filter = filter
|
425
|
+
|
426
|
+
if body is None:
|
427
|
+
body = {
|
428
|
+
"filter": search_filter,
|
429
|
+
}
|
430
|
+
else:
|
431
|
+
body["filter"] = search_filter
|
432
|
+
|
433
|
+
url = (
|
434
|
+
f"{self.solution_architect_command_root}/solution-roles/by-search-string"
|
435
|
+
f"{possible_query_params}"
|
436
|
+
)
|
437
|
+
response: Response = await self._async_make_request(
|
438
|
+
"POST", url, body_slimmer(body)
|
439
|
+
)
|
440
|
+
return response.json().get("elements", NO_ELEMENTS_FOUND)
|
441
|
+
|
442
|
+
def find_solution_roles(self,
|
443
|
+
filter: str = "*",
|
444
|
+
starts_with: bool = True,
|
445
|
+
ends_with: bool = False,
|
446
|
+
ignore_case: bool = False,
|
447
|
+
start_from: int = 0,
|
448
|
+
page_size: int = max_paging_size,
|
449
|
+
body: dict = None) -> list[dict] | str:
|
450
|
+
|
451
|
+
"""Retrieve the list of solution role elements that contain the search string.
|
452
|
+
https://egeria-project.org/concepts/actor
|
453
|
+
|
454
|
+
Parameters
|
455
|
+
----------
|
456
|
+
filter: str
|
457
|
+
- search_filterstring to search for.
|
458
|
+
starts_with : bool, [default=False], optional
|
459
|
+
Starts with the supplied string.
|
460
|
+
ends_with : bool, [default=False], optional
|
461
|
+
Ends with the supplied string
|
462
|
+
ignore_case : bool, [default=False], optional
|
463
|
+
Ignore case when searching
|
464
|
+
body: dict, optional, default = None
|
465
|
+
- additional optional specifications for the search.
|
466
|
+
|
467
|
+
Returns
|
468
|
+
-------
|
469
|
+
list[dict] | str
|
470
|
+
A list of information supply chain structures or a string if there are no elements found.
|
471
|
+
|
472
|
+
Raises
|
473
|
+
------
|
474
|
+
InvalidParameterException
|
475
|
+
one of the parameters is null or invalid or
|
476
|
+
PropertyServerException
|
477
|
+
There is a problem adding the element properties to the metadata repository or
|
478
|
+
UserNotAuthorizedException
|
479
|
+
the requesting user is not authorized to issue this request.
|
480
|
+
"""
|
481
|
+
|
482
|
+
loop = asyncio.get_event_loop()
|
483
|
+
response = loop.run_until_complete(
|
484
|
+
self._async_find_solution_roles(
|
485
|
+
filter,
|
486
|
+
starts_with,
|
487
|
+
ends_with,
|
488
|
+
ignore_case,
|
489
|
+
start_from,
|
490
|
+
page_size,
|
491
|
+
body,)
|
492
|
+
)
|
493
|
+
return response
|
494
|
+
|
495
|
+
def find_all_solution_roles(self, start_from: int = 0, page_size: int = max_paging_size) \
|
496
|
+
-> list[dict] | str:
|
497
|
+
"""Retrieve a list of all solution blueprint elements
|
498
|
+
https://egeria-project.org/concepts/actor
|
499
|
+
"""
|
500
|
+
return (self.find_solution_roles('*', start_from = start_from, page_size = page_size ))
|
501
|
+
|
502
|
+
|
503
|
+
|
504
|
+
async def _async_find_solution_components(self,
|
505
|
+
filter: str = "*",
|
506
|
+
starts_with: bool = True,
|
507
|
+
ends_with: bool = False,
|
508
|
+
ignore_case: bool = False,
|
509
|
+
start_from: int = 0,
|
510
|
+
page_size: int = max_paging_size,
|
511
|
+
body: dict = None,) ->list[dict] | str:
|
512
|
+
|
513
|
+
"""Retrieve the solution component elements that contain the search string.
|
514
|
+
https://egeria-project.org/concepts/solution-components
|
515
|
+
Async version.
|
516
|
+
|
517
|
+
Parameters
|
518
|
+
----------
|
519
|
+
filter: str
|
520
|
+
- search_filterstring to search for.
|
521
|
+
starts_with : bool, [default=False], optional
|
522
|
+
Starts with the supplied string.
|
523
|
+
ends_with : bool, [default=False], optional
|
524
|
+
Ends with the supplied string
|
525
|
+
ignore_case : bool, [default=False], optional
|
526
|
+
Ignore case when searching
|
527
|
+
body: dict, optional, default = None
|
528
|
+
- additional optional specifications for the search.
|
529
|
+
|
530
|
+
Returns
|
531
|
+
-------
|
532
|
+
list[dict] | str
|
533
|
+
A list of solution blueprint structures or a string if there are no elements found.
|
534
|
+
|
535
|
+
Raises
|
536
|
+
------
|
537
|
+
InvalidParameterException
|
538
|
+
one of the parameters is null or invalid or
|
539
|
+
PropertyServerException
|
540
|
+
There is a problem adding the element properties to the metadata repository or
|
541
|
+
UserNotAuthorizedException
|
542
|
+
the requesting user is not authorized to issue this request.
|
543
|
+
"""
|
544
|
+
|
545
|
+
possible_query_params = query_string(
|
546
|
+
[
|
547
|
+
("startFrom", start_from),
|
548
|
+
("pageSize", page_size),
|
549
|
+
("startsWith", starts_with),
|
550
|
+
("endsWith", ends_with),
|
551
|
+
("ignoreCase", ignore_case),
|
552
|
+
]
|
553
|
+
)
|
554
|
+
|
555
|
+
if filter is None or filter== "*":
|
556
|
+
search_filter = None
|
557
|
+
else:
|
558
|
+
search_filter = filter
|
559
|
+
|
560
|
+
if body is None:
|
561
|
+
body = {
|
562
|
+
"filter": search_filter,
|
563
|
+
}
|
564
|
+
else:
|
565
|
+
body["filter"] = search_filter
|
566
|
+
|
567
|
+
url = (
|
568
|
+
f"{self.solution_architect_command_root}/solution-components/by-search-string"
|
569
|
+
f"{possible_query_params}"
|
570
|
+
)
|
571
|
+
response: Response = await self._async_make_request(
|
572
|
+
"POST", url, body_slimmer(body)
|
573
|
+
)
|
574
|
+
return response.json().get("elements", NO_ELEMENTS_FOUND)
|
575
|
+
|
576
|
+
def find_solution_components(self,
|
577
|
+
filter: str = "*",
|
578
|
+
starts_with: bool = True,
|
579
|
+
ends_with: bool = False,
|
580
|
+
ignore_case: bool = False,
|
581
|
+
start_from: int = 0,
|
582
|
+
page_size: int = max_paging_size,
|
583
|
+
body: dict = None) -> list[dict] | str:
|
584
|
+
|
585
|
+
"""Retrieve the list of solution component elements that contain the search string.
|
586
|
+
https://egeria-project.org/concepts/solution-components
|
587
|
+
|
588
|
+
Parameters
|
589
|
+
----------
|
590
|
+
filter : str
|
591
|
+
- filter string to search for.
|
592
|
+
starts_with : bool, [default=False], optional
|
593
|
+
Starts with the supplied string.
|
594
|
+
ends_with : bool, [default=False], optional
|
595
|
+
Ends with the supplied string
|
596
|
+
ignore_case : bool, [default=False], optional
|
597
|
+
Ignore case when searching
|
598
|
+
body: dict, optional, default = None
|
599
|
+
- additional optional specifications for the search.
|
600
|
+
|
601
|
+
Returns
|
602
|
+
-------
|
603
|
+
list[dict] | str
|
604
|
+
A list of information supply chain structures or a string if there are no elements found.
|
605
|
+
|
606
|
+
Raises
|
607
|
+
------
|
608
|
+
InvalidParameterException
|
609
|
+
one of the parameters is null or invalid or
|
610
|
+
PropertyServerException
|
611
|
+
There is a problem adding the element properties to the metadata repository or
|
612
|
+
UserNotAuthorizedException
|
613
|
+
the requesting user is not authorized to issue this request.
|
614
|
+
"""
|
615
|
+
|
616
|
+
loop = asyncio.get_event_loop()
|
617
|
+
response = loop.run_until_complete(
|
618
|
+
self._async_find_solution_components(
|
619
|
+
filter,
|
620
|
+
starts_with,
|
621
|
+
ends_with,
|
622
|
+
ignore_case,
|
623
|
+
start_from,
|
624
|
+
page_size,
|
625
|
+
body,)
|
626
|
+
)
|
627
|
+
return response
|
628
|
+
|
629
|
+
def find_all_solution_components(self, start_from: int = 0, page_size: int = max_paging_size) \
|
630
|
+
-> list[dict] | str:
|
631
|
+
"""Retrieve a list of all solution component elements
|
632
|
+
https://egeria-project.org/concepts/solution-components
|
633
|
+
"""
|
634
|
+
return self.find_solution_components('*', start_from = start_from, page_size = page_size )
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
if __name__ == "__main__":
|
642
|
+
print("Main-Metadata Explorer")
|