pyegeria 0.7.45__py3-none-any.whl → 0.8.0__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/cat/list_cert_types.py +61 -43
- examples/widgets/cat/list_projects.py +1 -1
- examples/widgets/cli/egeria.py +18 -2
- examples/widgets/cli/egeria_tech.py +299 -98
- examples/widgets/my/my_profile_actions.py +51 -32
- examples/widgets/ops/engine_actions.py +35 -23
- examples/widgets/ops/integration_daemon_actions.py +51 -32
- examples/widgets/tech/get_element_info.py +63 -38
- examples/widgets/tech/get_guid_info.py +50 -27
- examples/widgets/tech/list_asset_types.py +33 -23
- examples/widgets/tech/list_elements.py +44 -34
- examples/widgets/tech/list_elements_x.py +69 -49
- examples/widgets/tech/list_registered_services.py +44 -24
- examples/widgets/tech/list_related_specification.py +70 -45
- examples/widgets/tech/list_relationship_types.py +50 -31
- examples/widgets/tech/list_valid_metadata_values.py +57 -28
- examples/widgets/tech/x_list_related_elements.py +54 -34
- pyegeria/Xloaded_resources_omvs.py +43 -41
- pyegeria/__init__.py +5 -1
- pyegeria/_client.py +142 -102
- pyegeria/_deprecated_gov_engine.py +218 -167
- pyegeria/action_author_omvs.py +107 -88
- pyegeria/asset_catalog_omvs.py +467 -395
- pyegeria/automated_curation_omvs.py +2 -2
- pyegeria/classification_manager_omvs.py +1920 -868
- pyegeria/collection_manager_omvs.py +1957 -1519
- pyegeria/core_omag_server_config.py +310 -192
- pyegeria/egeria_cat_client.py +88 -0
- pyegeria/egeria_config_client.py +37 -0
- pyegeria/egeria_my_client.py +47 -0
- pyegeria/egeria_ops_client.py +67 -0
- pyegeria/egeria_tech_client.py +77 -0
- pyegeria/feedback_manager_omvs.py +633 -631
- pyegeria/full_omag_server_config.py +330 -158
- pyegeria/glossary_browser_omvs.py +927 -474
- pyegeria/glossary_manager_omvs.py +1033 -543
- pyegeria/mermaid_utilities.py +1 -1
- pyegeria/my_profile_omvs.py +714 -574
- pyegeria/platform_services.py +228 -176
- pyegeria/project_manager_omvs.py +1158 -903
- pyegeria/registered_info.py +76 -74
- pyegeria/runtime_manager_omvs.py +749 -670
- pyegeria/server_operations.py +123 -85
- pyegeria/valid_metadata_omvs.py +268 -168
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/METADATA +1 -1
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/RECORD +49 -46
- examples/widgets/tech/list_gov_processes.py +0 -162
- pyegeria/tech_guids_31-08-2024 14:33.py +0 -79
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/LICENSE +0 -0
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/WHEEL +0 -0
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/entry_points.txt +0 -0
@@ -14,7 +14,7 @@ from ._globals import enable_ssl_check
|
|
14
14
|
|
15
15
|
|
16
16
|
def body_slimmer(body: dict) -> dict:
|
17
|
-
"""
|
17
|
+
"""body_slimmer is a little function to remove unused keys from a dict
|
18
18
|
|
19
19
|
Parameters
|
20
20
|
----------
|
@@ -31,44 +31,44 @@ def body_slimmer(body: dict) -> dict:
|
|
31
31
|
|
32
32
|
class GovEng(Client):
|
33
33
|
"""
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
34
|
+
Client to initiate and manage governance actions and processes.
|
35
|
+
|
36
|
+
Attributes:
|
37
|
+
server_name: str
|
38
|
+
Name of the server to use.
|
39
|
+
platform_url : str
|
40
|
+
URL of the server platform to connect to
|
41
|
+
user_id : str
|
42
|
+
The identity of the user calling the method - this sets a default optionally used by the methods
|
43
|
+
when the user doesn't pass the user_id on a method call.
|
44
|
+
user_pwd: str = None
|
45
|
+
The password associated with the user
|
46
|
+
verify_flag: bool = enable_ssl_check
|
47
|
+
Set true for SSL verification to be enabled, false for disabled. Default behaviour set by the
|
48
|
+
enable_ssl_check attribute from _globals.py
|
49
|
+
|
50
|
+
"""
|
51
51
|
|
52
52
|
def __init__(
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
self,
|
54
|
+
server_name: str,
|
55
|
+
platform_url: str,
|
56
|
+
user_id: str,
|
57
|
+
user_pwd: str = None,
|
58
|
+
verify_flag: bool = enable_ssl_check,
|
59
59
|
):
|
60
60
|
self.admin_command_root: str
|
61
|
-
Client.__init__(self, server_name, platform_url, user_id,
|
62
|
-
user_pwd, verify_flag)
|
61
|
+
Client.__init__(self, server_name, platform_url, user_id, user_pwd)
|
63
62
|
self.engine_command_root = (
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
63
|
+
self.platform_url
|
64
|
+
+ "/servers/"
|
65
|
+
+ server_name
|
66
|
+
+ "/open-metadata/framework-services/governance-engine/open-governance-service/users/"
|
67
|
+
+ user_id
|
68
68
|
)
|
69
69
|
|
70
70
|
def get_engine_actions(self, start_from: int = 0, page_size: int = 0) -> [dict]:
|
71
|
-
"""
|
71
|
+
"""Get engine actions associated deployed on the server.
|
72
72
|
|
73
73
|
Args:
|
74
74
|
start_from (int, optional): The index to start retrieving processes from. Defaults to 0.
|
@@ -85,15 +85,20 @@ class GovEng(Client):
|
|
85
85
|
Pagination of 0 defaults to server default.
|
86
86
|
|
87
87
|
"""
|
88
|
-
url = (
|
89
|
-
|
88
|
+
url = (
|
89
|
+
self.engine_command_root
|
90
|
+
+ "/engine-actions?startFrom="
|
91
|
+
+ str(start_from)
|
92
|
+
+ "&pageSize="
|
93
|
+
+ str(page_size)
|
94
|
+
)
|
90
95
|
response = self.make_request("GET", url)
|
91
96
|
|
92
|
-
governance_elements = response.json().get(
|
97
|
+
governance_elements = response.json().get("elements")
|
93
98
|
return governance_elements
|
94
99
|
|
95
100
|
def get_engine_action(self, engine_action_guid: str) -> str:
|
96
|
-
"""
|
101
|
+
"""Return the governance action associated with the supplied guid
|
97
102
|
|
98
103
|
Parameters
|
99
104
|
----------
|
@@ -113,11 +118,13 @@ class GovEng(Client):
|
|
113
118
|
url = self.engine_command_root + "/engine-actions/" + engine_action_guid
|
114
119
|
response = self.make_request("GET", url)
|
115
120
|
|
116
|
-
governance_element = response.json().get(
|
121
|
+
governance_element = response.json().get("element")
|
117
122
|
return governance_element
|
118
123
|
|
119
|
-
def get_active_engine_actions(
|
120
|
-
|
124
|
+
def get_active_engine_actions(
|
125
|
+
self, start_from: int = 0, page_size: int = 0
|
126
|
+
) -> [str]:
|
127
|
+
"""Get active governance actions associated on the server.
|
121
128
|
|
122
129
|
Args:
|
123
130
|
start_from (int, optional): The index to start retrieving processes from. Defaults to 0.
|
@@ -133,15 +140,22 @@ class GovEng(Client):
|
|
133
140
|
Note:
|
134
141
|
Pagination of 0 defaults to server default.
|
135
142
|
"""
|
136
|
-
url = (
|
137
|
-
|
143
|
+
url = (
|
144
|
+
self.engine_command_root
|
145
|
+
+ "/engine-actions/active?startFrom="
|
146
|
+
+ str(start_from)
|
147
|
+
+ "&pageSize="
|
148
|
+
+ str(page_size)
|
149
|
+
)
|
138
150
|
|
139
151
|
response = self.make_request("GET", url)
|
140
|
-
governance_elements = response.json().get(
|
152
|
+
governance_elements = response.json().get("elements")
|
141
153
|
return governance_elements
|
142
|
-
|
143
|
-
def get_engine_actions_by_name(
|
144
|
-
|
154
|
+
|
155
|
+
def get_engine_actions_by_name(
|
156
|
+
self, name: str, start_from: int = 0, page_size: int = 0
|
157
|
+
) -> str:
|
158
|
+
"""Retrieve engine actions matching the name string.
|
145
159
|
Args:
|
146
160
|
name (str): The qualified name or display name of the governance action to get.
|
147
161
|
start_from (int, optional): The index to start retrieving processes from. Defaults to 0.
|
@@ -158,19 +172,23 @@ class GovEng(Client):
|
|
158
172
|
Pagination of 0 defaults to server default.
|
159
173
|
|
160
174
|
"""
|
161
|
-
url = (
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
"
|
166
|
-
|
175
|
+
url = (
|
176
|
+
self.engine_command_root
|
177
|
+
+ "/engine-actions/by-name?startFrom="
|
178
|
+
+ str(start_from)
|
179
|
+
+ "&pageSize="
|
180
|
+
+ str(page_size)
|
181
|
+
)
|
182
|
+
body = {"class": "NameRequestBody", "name": name}
|
167
183
|
response = self.make_request("POST", url, body)
|
168
184
|
|
169
|
-
governance_elements = response.json().get(
|
185
|
+
governance_elements = response.json().get("elements")
|
170
186
|
return governance_elements
|
171
187
|
|
172
|
-
def find_engine_actions(
|
173
|
-
|
188
|
+
def find_engine_actions(
|
189
|
+
self, search_string: str, start_from: int = 0, page_size: int = 0
|
190
|
+
) -> [str]:
|
191
|
+
"""Search for engine actions matching the search string.
|
174
192
|
|
175
193
|
Args:
|
176
194
|
search_string (str): The search string to query for.
|
@@ -186,45 +204,53 @@ class GovEng(Client):
|
|
186
204
|
|
187
205
|
Note:
|
188
206
|
Pagination of 0 defaults to server default.
|
189
|
-
|
190
|
-
url = (
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
"
|
195
|
-
|
207
|
+
"""
|
208
|
+
url = (
|
209
|
+
self.engine_command_root
|
210
|
+
+ "/engine-actions/by-search-string?startFrom="
|
211
|
+
+ str(start_from)
|
212
|
+
+ "&pageSize="
|
213
|
+
+ str(page_size)
|
214
|
+
)
|
215
|
+
body = {"class": "SearchStringRequestBody", "searchString": search_string}
|
196
216
|
response = self.make_request("POST", url, body)
|
197
217
|
|
198
|
-
governance_elements = response.json().get(
|
218
|
+
governance_elements = response.json().get("elements")
|
199
219
|
return governance_elements
|
200
220
|
|
201
221
|
def get_governance_action_process_by_guid(self, gov_process_guid: str) -> str:
|
202
222
|
"""
|
203
|
-
|
223
|
+
Retrieves information about a governance action process based on its GUID.
|
204
224
|
|
205
|
-
|
206
|
-
|
225
|
+
Args:
|
226
|
+
gov_process_guid (str): The GUID (Globally Unique Identifier) of the governance action process.
|
207
227
|
|
208
|
-
|
209
|
-
|
228
|
+
Returns:
|
229
|
+
str: The JSON representation of the governance action process element.
|
210
230
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
231
|
+
Raises:
|
232
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
233
|
+
this exception is raised with details from the response content.
|
234
|
+
PropertyServerException: If the API response indicates a server side error.
|
235
|
+
UserNotAuthorizedException:
|
216
236
|
|
217
|
-
|
218
|
-
|
219
|
-
|
237
|
+
Note:
|
238
|
+
This method assumes that the provided GUID is valid and corresponds to an existing
|
239
|
+
governance action process in the system.
|
220
240
|
|
221
|
-
|
222
|
-
url =
|
241
|
+
"""
|
242
|
+
url = (
|
243
|
+
self.engine_command_root
|
244
|
+
+ "/governance-action-processes/"
|
245
|
+
+ gov_process_guid
|
246
|
+
)
|
223
247
|
response = self.make_request("GET", url)
|
224
|
-
governance_element = response.json().get(
|
248
|
+
governance_element = response.json().get("element")
|
225
249
|
return governance_element
|
226
250
|
|
227
|
-
def get_governance_action_processes_by_name(
|
251
|
+
def get_governance_action_processes_by_name(
|
252
|
+
self, name: str, start_from: int = 0, page_size: int = 0
|
253
|
+
) -> [str]:
|
228
254
|
"""
|
229
255
|
Retrieves governance action processes based on their name only (no wildcards).
|
230
256
|
|
@@ -244,18 +270,22 @@ class GovEng(Client):
|
|
244
270
|
Pagination of 0 defaults to server default.
|
245
271
|
|
246
272
|
"""
|
247
|
-
url = (
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
"
|
252
|
-
|
273
|
+
url = (
|
274
|
+
self.engine_command_root
|
275
|
+
+ "/governance-action-processes/by-name?startFrom="
|
276
|
+
+ str(start_from)
|
277
|
+
+ "&pageSize="
|
278
|
+
+ str(page_size)
|
279
|
+
)
|
280
|
+
body = {"class": "NameRequestBody", "name": name}
|
253
281
|
response = self.make_request("POST", url, body)
|
254
|
-
governance_elements = response.json().get(
|
282
|
+
governance_elements = response.json().get("elements")
|
255
283
|
return governance_elements
|
256
|
-
|
257
|
-
def find_governance_action_processes(
|
258
|
-
|
284
|
+
|
285
|
+
def find_governance_action_processes(
|
286
|
+
self, search_string: str, start_from: int = 0, page_size: int = 0
|
287
|
+
) -> [str]:
|
288
|
+
"""Return governance action processes that match the search string (with regex).
|
259
289
|
|
260
290
|
Args:
|
261
291
|
search_string (str): The search string to query for.
|
@@ -273,21 +303,30 @@ class GovEng(Client):
|
|
273
303
|
Pagination of 0 defaults to server default.
|
274
304
|
|
275
305
|
"""
|
276
|
-
url = (
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
"
|
281
|
-
|
306
|
+
url = (
|
307
|
+
self.engine_command_root
|
308
|
+
+ "/governance-action-processes/by-search-string?startFrom="
|
309
|
+
+ str(start_from)
|
310
|
+
+ "&pageSize="
|
311
|
+
+ str(page_size)
|
312
|
+
)
|
313
|
+
body = {"class": "SearchStringRequestBody", "searchString": search_string}
|
282
314
|
response = self.make_request("POST", url, body)
|
283
315
|
|
284
|
-
governance_elements = response.json().get(
|
316
|
+
governance_elements = response.json().get("elements")
|
285
317
|
return governance_elements
|
286
|
-
|
287
|
-
def initiate_governance_action_process(
|
288
|
-
|
289
|
-
|
290
|
-
|
318
|
+
|
319
|
+
def initiate_governance_action_process(
|
320
|
+
self,
|
321
|
+
qualified_name: str,
|
322
|
+
request_source_guids: [str],
|
323
|
+
action_targets: [str],
|
324
|
+
start_time: datetime,
|
325
|
+
request_parameters: dict,
|
326
|
+
orig_service_name: str,
|
327
|
+
orig_engine_name: str,
|
328
|
+
) -> str:
|
329
|
+
"""initiate_gov_action_process
|
291
330
|
|
292
331
|
This method starts a governance action process using the supplied parameters.
|
293
332
|
|
@@ -321,80 +360,92 @@ class GovEng(Client):
|
|
321
360
|
"""
|
322
361
|
url = self.engine_command_root + "/governance-action-processes/initiate"
|
323
362
|
body = {
|
324
|
-
"class":
|
325
|
-
"processQualifiedName":
|
326
|
-
"requestSourceGUIDs":
|
327
|
-
"actionTargets":
|
328
|
-
"startTime":
|
329
|
-
"requestParameters":
|
330
|
-
"originatorServiceName":
|
331
|
-
"originatorEngineName":
|
363
|
+
"class": "GovernanceActionProcessRequestBody",
|
364
|
+
"processQualifiedName": qualified_name,
|
365
|
+
"requestSourceGUIDs": request_source_guids,
|
366
|
+
"actionTargets": action_targets,
|
367
|
+
"startTime": int(start_time.timestamp() * 1000),
|
368
|
+
"requestParameters": request_parameters,
|
369
|
+
"originatorServiceName": orig_service_name,
|
370
|
+
"originatorEngineName": orig_engine_name,
|
332
371
|
}
|
333
372
|
new_body = body_slimmer(body)
|
334
373
|
response = self.make_request("POST", url, new_body)
|
335
374
|
|
336
|
-
return response.json().get(
|
337
|
-
|
338
|
-
def initiate_engine_action(
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
375
|
+
return response.json().get("guid")
|
376
|
+
|
377
|
+
def initiate_engine_action(
|
378
|
+
self,
|
379
|
+
qualified_name: str,
|
380
|
+
domain_identifier: int,
|
381
|
+
display_name: str,
|
382
|
+
description: str,
|
383
|
+
request_source_guids: str,
|
384
|
+
action_targets: str,
|
385
|
+
received_guards: [str],
|
386
|
+
start_time: datetime,
|
387
|
+
gov_engine_name: str,
|
388
|
+
request_type: str,
|
389
|
+
request_parameters: dict,
|
390
|
+
process_name: str,
|
391
|
+
request_src_name: str = None,
|
392
|
+
originator_svc_name: str = None,
|
393
|
+
originator_eng_name: str = None,
|
394
|
+
) -> str:
|
344
395
|
"""
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
url = self.engine_command_root + (
|
378
|
-
|
396
|
+
Initiates an engine action with the specified parameters.
|
397
|
+
|
398
|
+
Args:
|
399
|
+
qualified_name (str): The qualified name of the governance action.
|
400
|
+
domain_identifier (int): The domain identifier for the governance action.
|
401
|
+
display_name (str): The display name of the governance action.
|
402
|
+
description (str): The description of the governance action.
|
403
|
+
request_source_guids (str): GUIDs of the sources initiating the request.
|
404
|
+
action_targets (str): Targets of the governance action.
|
405
|
+
received_guards (List[str]): List of guards received for the action.
|
406
|
+
start_time (datetime): The start time for the governance action.
|
407
|
+
gov_engine_name (str): The name of the governance engine associated with the action.
|
408
|
+
request_type (str): The type of the governance action request.
|
409
|
+
request_parameters (dict): Additional parameters for the governance action.
|
410
|
+
process_name (str): The name of the associated governance action process.
|
411
|
+
request_src_name (str, optional): The name of the request source. Defaults to None.
|
412
|
+
originator_svc_name (str, optional): The name of the originator service. Defaults to None.
|
413
|
+
originator_eng_name (str, optional): The name of the originator engine. Defaults to None.
|
414
|
+
|
415
|
+
Returns:
|
416
|
+
str: The GUID (Globally Unique Identifier) of the initiated governance action.
|
417
|
+
|
418
|
+
Raises:
|
419
|
+
InvalidParameterException: If the API response indicates an error (non-200 status code),
|
420
|
+
this exception is raised with details from the response content.
|
421
|
+
|
422
|
+
Note:
|
423
|
+
The `start_time` parameter should be a `datetime` object representing the start
|
424
|
+
time of the governance action.
|
425
|
+
|
426
|
+
|
427
|
+
"""
|
428
|
+
url = self.engine_command_root + (
|
429
|
+
"/governance-engines/" + gov_engine_name + "/engine-actions/initiate"
|
430
|
+
)
|
379
431
|
|
380
432
|
body = {
|
381
|
-
"class":
|
382
|
-
"qualifiedName":
|
383
|
-
"domainIdentifier":
|
384
|
-
"displayName":
|
385
|
-
"description":
|
386
|
-
"requestSourceGUIDs":
|
387
|
-
"actionTargets":
|
388
|
-
"receivedGuards":
|
389
|
-
"startTime":
|
390
|
-
"requestType":
|
391
|
-
"requestParameters":
|
392
|
-
"process_name":
|
393
|
-
"requestSourceName":
|
394
|
-
"originatorServiceName":
|
395
|
-
"originatorEngineName":
|
433
|
+
"class": "GovernanceActionRequestBody",
|
434
|
+
"qualifiedName": qualified_name + str(int(start_time.timestamp())),
|
435
|
+
"domainIdentifier": domain_identifier,
|
436
|
+
"displayName": display_name,
|
437
|
+
"description": description,
|
438
|
+
"requestSourceGUIDs": request_source_guids,
|
439
|
+
"actionTargets": action_targets,
|
440
|
+
"receivedGuards": received_guards,
|
441
|
+
"startTime": int(start_time.timestamp() * 1000),
|
442
|
+
"requestType": request_type,
|
443
|
+
"requestParameters": request_parameters,
|
444
|
+
"process_name": process_name,
|
445
|
+
"requestSourceName": request_src_name,
|
446
|
+
"originatorServiceName": originator_svc_name,
|
447
|
+
"originatorEngineName": originator_eng_name,
|
396
448
|
}
|
397
449
|
new_body = body_slimmer(body)
|
398
450
|
response = self.make_request("POST", url, new_body)
|
399
|
-
return response.json().get(
|
400
|
-
|
451
|
+
return response.json().get("guid")
|