pyegeria 0.7.45.1__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.
Files changed (47) hide show
  1. examples/widgets/cat/list_cert_types.py +61 -43
  2. examples/widgets/cat/list_projects.py +1 -1
  3. examples/widgets/my/my_profile_actions.py +51 -32
  4. examples/widgets/ops/engine_actions.py +35 -23
  5. examples/widgets/ops/integration_daemon_actions.py +51 -32
  6. examples/widgets/tech/get_element_info.py +63 -38
  7. examples/widgets/tech/get_guid_info.py +50 -27
  8. examples/widgets/tech/list_asset_types.py +33 -23
  9. examples/widgets/tech/list_elements.py +44 -34
  10. examples/widgets/tech/list_elements_x.py +69 -49
  11. examples/widgets/tech/list_registered_services.py +44 -24
  12. examples/widgets/tech/list_related_specification.py +70 -45
  13. examples/widgets/tech/list_relationship_types.py +50 -31
  14. examples/widgets/tech/list_valid_metadata_values.py +57 -28
  15. examples/widgets/tech/x_list_related_elements.py +54 -34
  16. pyegeria/Xloaded_resources_omvs.py +43 -41
  17. pyegeria/__init__.py +5 -1
  18. pyegeria/_client.py +142 -102
  19. pyegeria/_deprecated_gov_engine.py +218 -167
  20. pyegeria/action_author_omvs.py +107 -88
  21. pyegeria/asset_catalog_omvs.py +467 -395
  22. pyegeria/automated_curation_omvs.py +2 -2
  23. pyegeria/classification_manager_omvs.py +3 -9
  24. pyegeria/collection_manager_omvs.py +1957 -1519
  25. pyegeria/core_omag_server_config.py +310 -192
  26. pyegeria/egeria_cat_client.py +88 -0
  27. pyegeria/egeria_config_client.py +37 -0
  28. pyegeria/egeria_my_client.py +47 -0
  29. pyegeria/egeria_ops_client.py +67 -0
  30. pyegeria/egeria_tech_client.py +77 -0
  31. pyegeria/feedback_manager_omvs.py +633 -631
  32. pyegeria/full_omag_server_config.py +330 -158
  33. pyegeria/glossary_browser_omvs.py +927 -474
  34. pyegeria/glossary_manager_omvs.py +1033 -543
  35. pyegeria/my_profile_omvs.py +714 -574
  36. pyegeria/platform_services.py +228 -176
  37. pyegeria/project_manager_omvs.py +1158 -903
  38. pyegeria/registered_info.py +76 -74
  39. pyegeria/runtime_manager_omvs.py +749 -670
  40. pyegeria/server_operations.py +123 -85
  41. pyegeria/valid_metadata_omvs.py +268 -168
  42. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/METADATA +1 -1
  43. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/RECORD +46 -42
  44. pyegeria/tech_guids_31-08-2024 14:33.py +0 -79
  45. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/LICENSE +0 -0
  46. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/WHEEL +0 -0
  47. {pyegeria-0.7.45.1.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
- """ body_slimmer is a little function to remove unused keys from a dict
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
- 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
- """
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
- 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,
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
- self.platform_url
65
- + "/servers/" + server_name
66
- + "/open-metadata/framework-services/governance-engine/open-governance-service/users/"
67
- + user_id
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
- """ Get engine actions associated deployed on the server.
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 = (self.engine_command_root + "/engine-actions?startFrom=" +
89
- str(start_from) + "&pageSize=" + str(page_size))
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('elements')
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
- """ Return the governance action associated with the supplied guid
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('element')
121
+ governance_element = response.json().get("element")
117
122
  return governance_element
118
123
 
119
- def get_active_engine_actions(self, start_from: int = 0, page_size: int = 0) -> [str]:
120
- """ Get active governance actions associated on the server.
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 = (self.engine_command_root + "/engine-actions/active?startFrom=" +
137
- str(start_from) + "&pageSize=" + str(page_size))
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('elements')
152
+ governance_elements = response.json().get("elements")
141
153
  return governance_elements
142
-
143
- def get_engine_actions_by_name(self, name: str, start_from: int = 0, page_size: int = 0) -> str:
144
- """ Retrieve engine actions matching the name string.
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 = (self.engine_command_root + "/engine-actions/by-name?startFrom=" +
162
- str(start_from) + "&pageSize=" + str(page_size))
163
- body = {
164
- "class": "NameRequestBody",
165
- "name": name
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('elements')
185
+ governance_elements = response.json().get("elements")
170
186
  return governance_elements
171
187
 
172
- def find_engine_actions(self, search_string: str, start_from: int = 0, page_size: int = 0) -> [str]:
173
- """ Search for engine actions matching the search string.
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 = (self.engine_command_root + "/engine-actions/by-search-string?startFrom=" +
191
- str(start_from) + "&pageSize=" + str(page_size))
192
- body = {
193
- "class": "SearchStringRequestBody",
194
- "searchString": search_string
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('elements')
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
- Retrieves information about a governance action process based on its GUID.
223
+ Retrieves information about a governance action process based on its GUID.
204
224
 
205
- Args:
206
- gov_process_guid (str): The GUID (Globally Unique Identifier) of the governance action process.
225
+ Args:
226
+ gov_process_guid (str): The GUID (Globally Unique Identifier) of the governance action process.
207
227
 
208
- Returns:
209
- str: The JSON representation of the governance action process element.
228
+ Returns:
229
+ str: The JSON representation of the governance action process element.
210
230
 
211
- Raises:
212
- InvalidParameterException: If the API response indicates an error (non-200 status code),
213
- this exception is raised with details from the response content.
214
- PropertyServerException: If the API response indicates a server side error.
215
- UserNotAuthorizedException:
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
- Note:
218
- This method assumes that the provided GUID is valid and corresponds to an existing
219
- governance action process in the system.
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 = self.engine_command_root + "/governance-action-processes/" + gov_process_guid
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('element')
248
+ governance_element = response.json().get("element")
225
249
  return governance_element
226
250
 
227
- def get_governance_action_processes_by_name(self, name: str, start_from: int = 0, page_size: int = 0) -> [str]:
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 = (self.engine_command_root + "/governance-action-processes/by-name?startFrom=" + str(start_from)
248
- + "&pageSize=" + str(page_size))
249
- body = {
250
- "class": "NameRequestBody",
251
- "name": name
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('elements')
282
+ governance_elements = response.json().get("elements")
255
283
  return governance_elements
256
-
257
- def find_governance_action_processes(self, search_string: str, start_from: int = 0, page_size: int = 0) -> [str]:
258
- """ Return governance action processes that match the search string (with regex).
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 = (self.engine_command_root + "/governance-action-processes/by-search-string?startFrom=" + str(start_from)
277
- + "&pageSize=" + str(page_size))
278
- body = {
279
- "class": "SearchStringRequestBody",
280
- "searchString": search_string
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('elements')
316
+ governance_elements = response.json().get("elements")
285
317
  return governance_elements
286
-
287
- def initiate_governance_action_process(self, qualified_name: str, request_source_guids: [str],
288
- action_targets: [str], start_time: datetime, request_parameters: dict,
289
- orig_service_name: str, orig_engine_name: str) -> str:
290
- """ initiate_gov_action_process
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": "GovernanceActionProcessRequestBody",
325
- "processQualifiedName": qualified_name,
326
- "requestSourceGUIDs": request_source_guids,
327
- "actionTargets": action_targets,
328
- "startTime": int(start_time.timestamp() * 1000),
329
- "requestParameters": request_parameters,
330
- "originatorServiceName": orig_service_name,
331
- "originatorEngineName": orig_engine_name
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('guid')
337
-
338
- def initiate_engine_action(self, qualified_name: str, domain_identifier: int, display_name: str,
339
- description: str, request_source_guids: str, action_targets: str,
340
- received_guards: [str], start_time: datetime, gov_engine_name: str,
341
- request_type: str, request_parameters: dict, process_name: str,
342
- request_src_name: str = None, originator_svc_name: str = None,
343
- originator_eng_name: str = None) -> str:
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
- Initiates an engine action with the specified parameters.
346
-
347
- Args:
348
- qualified_name (str): The qualified name of the governance action.
349
- domain_identifier (int): The domain identifier for the governance action.
350
- display_name (str): The display name of the governance action.
351
- description (str): The description of the governance action.
352
- request_source_guids (str): GUIDs of the sources initiating the request.
353
- action_targets (str): Targets of the governance action.
354
- received_guards (List[str]): List of guards received for the action.
355
- start_time (datetime): The start time for the governance action.
356
- gov_engine_name (str): The name of the governance engine associated with the action.
357
- request_type (str): The type of the governance action request.
358
- request_parameters (dict): Additional parameters for the governance action.
359
- process_name (str): The name of the associated governance action process.
360
- request_src_name (str, optional): The name of the request source. Defaults to None.
361
- originator_svc_name (str, optional): The name of the originator service. Defaults to None.
362
- originator_eng_name (str, optional): The name of the originator engine. Defaults to None.
363
-
364
- Returns:
365
- str: The GUID (Globally Unique Identifier) of the initiated governance action.
366
-
367
- Raises:
368
- InvalidParameterException: If the API response indicates an error (non-200 status code),
369
- this exception is raised with details from the response content.
370
-
371
- Note:
372
- The `start_time` parameter should be a `datetime` object representing the start
373
- time of the governance action.
374
-
375
-
376
- """
377
- url = self.engine_command_root + ("/governance-engines/" + gov_engine_name +
378
- "/engine-actions/initiate")
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": "GovernanceActionRequestBody",
382
- "qualifiedName": qualified_name + str(int(start_time.timestamp())),
383
- "domainIdentifier": domain_identifier,
384
- "displayName": display_name,
385
- "description": description,
386
- "requestSourceGUIDs": request_source_guids,
387
- "actionTargets": action_targets,
388
- "receivedGuards": received_guards,
389
- "startTime": int(start_time.timestamp()*1000),
390
- "requestType": request_type,
391
- "requestParameters": request_parameters,
392
- "process_name": process_name,
393
- "requestSourceName": request_src_name,
394
- "originatorServiceName": originator_svc_name,
395
- "originatorEngineName": originator_eng_name
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('guid')
400
-
451
+ return response.json().get("guid")