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
@@ -21,7 +21,7 @@ from ._validators import validate_search_string
21
21
 
22
22
 
23
23
  class AssetCatalog(Client):
24
- """ Set up and maintain automation services in Egeria.
24
+ """Set up and maintain automation services in Egeria.
25
25
 
26
26
  Attributes:
27
27
  server_name : str
@@ -37,60 +37,63 @@ class AssetCatalog(Client):
37
37
  """
38
38
 
39
39
  def __init__(
40
- self,
41
- server_name: str,
42
- platform_url: str,
43
- user_id: str,
44
- user_pwd: str = None,
40
+ self,
41
+ server_name: str,
42
+ platform_url: str,
43
+ user_id: str,
44
+ user_pwd: str = None,
45
+ token: str = None,
45
46
  ):
46
- Client.__init__(self, server_name, platform_url, user_id, user_pwd)
47
+ Client.__init__(self, server_name, platform_url, user_id, user_pwd, token=token)
47
48
  self.cur_command_root = f"{platform_url}/servers/"
48
49
 
49
- async def _async_create_element_from_template(self, body: dict, server: str = None) -> str:
50
- """ Create a new metadata element from a template. Async version.
51
- Parameters
52
- ----------
53
- body : str
54
- The json body used to instantiate the template.
55
- server : str, optional
56
- The name of the view server to use. If not provided, the default server name will be used.
57
-
58
- Returns
59
- -------
60
- Response
61
- The guid of the resulting element
62
-
63
- Raises
64
- ------
65
- InvalidParameterException
66
- PropertyServerException
67
- UserNotAuthorizedException
68
-
69
- Notes
70
- -----
71
- See also: https://egeria-project.org/features/templated-cataloguing/overview/
72
- The full description of the body is shown below:
73
- {
74
- "typeName" : "",
75
- "initialStatus" : "",
76
- "initialClassifications" : "",
77
- "anchorGUID" : "",
78
- "isOwnAnchor" : "",
79
- "effectiveFrom" : "",
80
- "effectiveTo" : "",
81
- "templateGUID" : "",
82
- "templateProperties" : {},
83
- "placeholderPropertyValues" : {
84
- "placeholderPropertyName1" : "placeholderPropertyValue1",
85
- "placeholderPropertyName2" : "placeholderPropertyValue2"
86
- },
87
- "parentGUID" : "",
88
- "parentRelationshipTypeName" : "",
89
- "parentRelationshipProperties" : "",
90
- "parentAtEnd1" : "",
91
- "effectiveTime" : ""
92
- }
93
- """
50
+ async def _async_create_element_from_template(
51
+ self, body: dict, server: str = None
52
+ ) -> str:
53
+ """Create a new metadata element from a template. Async version.
54
+ Parameters
55
+ ----------
56
+ body : str
57
+ The json body used to instantiate the template.
58
+ server : str, optional
59
+ The name of the view server to use. If not provided, the default server name will be used.
60
+
61
+ Returns
62
+ -------
63
+ Response
64
+ The guid of the resulting element
65
+
66
+ Raises
67
+ ------
68
+ InvalidParameterException
69
+ PropertyServerException
70
+ UserNotAuthorizedException
71
+
72
+ Notes
73
+ -----
74
+ See also: https://egeria-project.org/features/templated-cataloguing/overview/
75
+ The full description of the body is shown below:
76
+ {
77
+ "typeName" : "",
78
+ "initialStatus" : "",
79
+ "initialClassifications" : "",
80
+ "anchorGUID" : "",
81
+ "isOwnAnchor" : "",
82
+ "effectiveFrom" : "",
83
+ "effectiveTo" : "",
84
+ "templateGUID" : "",
85
+ "templateProperties" : {},
86
+ "placeholderPropertyValues" : {
87
+ "placeholderPropertyName1" : "placeholderPropertyValue1",
88
+ "placeholderPropertyName2" : "placeholderPropertyValue2"
89
+ },
90
+ "parentGUID" : "",
91
+ "parentRelationshipTypeName" : "",
92
+ "parentRelationshipProperties" : "",
93
+ "parentAtEnd1" : "",
94
+ "effectiveTime" : ""
95
+ }
96
+ """
94
97
 
95
98
  server = self.server_name if server is None else server
96
99
 
@@ -99,49 +102,49 @@ class AssetCatalog(Client):
99
102
  return response.json().get("guid", "GUID failed to be returned")
100
103
 
101
104
  def create_element_from_template(self, body: dict, server: str = None) -> str:
102
- """ Create a new metadata element from a template. Async version.
103
- Parameters
104
- ----------
105
- body : str
106
- The json body used to instantiate the template.
107
- server : str, optional
108
- The name of the view server to use. If not provided, the default server name will be used.
109
-
110
- Returns
111
- -------
112
- Response
113
- The guid of the resulting element
114
-
115
- Raises
116
- ------
117
- InvalidParameterException
118
- PropertyServerException
119
- UserNotAuthorizedException
120
-
121
- Notes
122
- -----
123
- See also: https://egeria-project.org/features/templated-cataloguing/overview/
124
- The full description of the body is shown below:
125
- {
126
- "typeName" : "",
127
- "initialStatus" : "",
128
- "initialClassifications" : "",
129
- "anchorGUID" : "",
130
- "isOwnAnchor" : "",
131
- "effectiveFrom" : "",
132
- "effectiveTo" : "",
133
- "templateGUID" : "",
134
- "templateProperties" : {},
135
- "placeholderPropertyValues" : {
136
- "placeholderPropertyName1" : "placeholderPropertyValue1",
137
- "placeholderPropertyName2" : "placeholderPropertyValue2"
138
- },
139
- "parentGUID" : "",
140
- "parentRelationshipTypeName" : "",
141
- "parentRelationshipProperties" : "",
142
- "parentAtEnd1" : "",
143
- "effectiveTime" : ""
144
- }
105
+ """Create a new metadata element from a template. Async version.
106
+ Parameters
107
+ ----------
108
+ body : str
109
+ The json body used to instantiate the template.
110
+ server : str, optional
111
+ The name of the view server to use. If not provided, the default server name will be used.
112
+
113
+ Returns
114
+ -------
115
+ Response
116
+ The guid of the resulting element
117
+
118
+ Raises
119
+ ------
120
+ InvalidParameterException
121
+ PropertyServerException
122
+ UserNotAuthorizedException
123
+
124
+ Notes
125
+ -----
126
+ See also: https://egeria-project.org/features/templated-cataloguing/overview/
127
+ The full description of the body is shown below:
128
+ {
129
+ "typeName" : "",
130
+ "initialStatus" : "",
131
+ "initialClassifications" : "",
132
+ "anchorGUID" : "",
133
+ "isOwnAnchor" : "",
134
+ "effectiveFrom" : "",
135
+ "effectiveTo" : "",
136
+ "templateGUID" : "",
137
+ "templateProperties" : {},
138
+ "placeholderPropertyValues" : {
139
+ "placeholderPropertyName1" : "placeholderPropertyValue1",
140
+ "placeholderPropertyName2" : "placeholderPropertyValue2"
141
+ },
142
+ "parentGUID" : "",
143
+ "parentRelationshipTypeName" : "",
144
+ "parentRelationshipProperties" : "",
145
+ "parentAtEnd1" : "",
146
+ "effectiveTime" : ""
147
+ }
145
148
  """
146
149
  loop = asyncio.get_event_loop()
147
150
  response = loop.run_until_complete(
@@ -149,147 +152,166 @@ class AssetCatalog(Client):
149
152
  )
150
153
  return response
151
154
 
152
- async def _async_create_kafka_server_element_from_template(self, kafka_server: str, host_name: str, port: str,
153
- server: str = None) -> str:
154
- """ Create a Kafka server element from a template. Async version.
155
+ async def _async_create_kafka_server_element_from_template(
156
+ self, kafka_server: str, host_name: str, port: str, server: str = None
157
+ ) -> str:
158
+ """Create a Kafka server element from a template. Async version.
155
159
 
156
- Parameters
157
- ----------
158
- kafka_server : str
159
- The name of the Kafka server.
160
+ Parameters
161
+ ----------
162
+ kafka_server : str
163
+ The name of the Kafka server.
160
164
 
161
- host_name : str
162
- The host name of the Kafka server.
165
+ host_name : str
166
+ The host name of the Kafka server.
163
167
 
164
- port : str
165
- The port number of the Kafka server.
168
+ port : str
169
+ The port number of the Kafka server.
166
170
 
167
- server : str, optional
168
- The name of the view server to use. Default uses the client instance.
171
+ server : str, optional
172
+ The name of the view server to use. Default uses the client instance.
169
173
 
170
- Returns
171
- -------
172
- str
173
- The GUID of the Kafka server element.
174
+ Returns
175
+ -------
176
+ str
177
+ The GUID of the Kafka server element.
174
178
  """
175
179
 
176
180
  body = {
177
- "templateGUID": TEMPLATE_GUIDS['Apache Kafka Server'],
178
- "isOwnAnchor": 'true',
181
+ "templateGUID": TEMPLATE_GUIDS["Apache Kafka Server"],
182
+ "isOwnAnchor": "true",
179
183
  "placeholderPropertyValues": {
180
184
  "serverName": kafka_server,
181
185
  "hostIdentifier": host_name,
182
- "portNumber": port
183
- }
186
+ "portNumber": port,
187
+ },
184
188
  }
185
189
  response = await self._async_create_element_from_template(body, server)
186
190
  return response
187
191
 
188
- def create_kafka_server_element_from_template(self, kafka_server: str, host_name: str, port: str,
189
- server: str = None) -> str:
190
- """ Create a Kafka server element from a template.
192
+ def create_kafka_server_element_from_template(
193
+ self, kafka_server: str, host_name: str, port: str, server: str = None
194
+ ) -> str:
195
+ """Create a Kafka server element from a template.
191
196
 
192
- Parameters
193
- ----------
194
- kafka_server : str
195
- The name of the Kafka server.
197
+ Parameters
198
+ ----------
199
+ kafka_server : str
200
+ The name of the Kafka server.
196
201
 
197
- host_name : str
198
- The host name of the Kafka server.
202
+ host_name : str
203
+ The host name of the Kafka server.
199
204
 
200
- port : str
201
- The port number of the Kafka server.
205
+ port : str
206
+ The port number of the Kafka server.
202
207
 
203
- server : str, optional
204
- The name of the view server to use. Default uses the client instance.
208
+ server : str, optional
209
+ The name of the view server to use. Default uses the client instance.
205
210
 
206
- Returns
207
- -------
208
- str
209
- The GUID of the Kafka server element.
210
- """
211
+ Returns
212
+ -------
213
+ str
214
+ The GUID of the Kafka server element.
215
+ """
211
216
  loop = asyncio.get_event_loop()
212
217
  response = loop.run_until_complete(
213
- self._async_create_kafka_server_element_from_template(kafka_server, host_name, port, server)
218
+ self._async_create_kafka_server_element_from_template(
219
+ kafka_server, host_name, port, server
220
+ )
214
221
  )
215
222
  return response
216
223
 
217
- async def _async_create_postgres_server_element_from_template(self, postgres_server: str, host_name: str, port: str,
218
- db_user: str, db_pwd: str, server: str = None) -> str:
219
- """ Create a Postgres server element from a template. Async version.
224
+ async def _async_create_postgres_server_element_from_template(
225
+ self,
226
+ postgres_server: str,
227
+ host_name: str,
228
+ port: str,
229
+ db_user: str,
230
+ db_pwd: str,
231
+ server: str = None,
232
+ ) -> str:
233
+ """Create a Postgres server element from a template. Async version.
220
234
 
221
- Parameters
222
- ----------
223
- postgres_server : str
224
- The name of the Postgres server.
235
+ Parameters
236
+ ----------
237
+ postgres_server : str
238
+ The name of the Postgres server.
225
239
 
226
- host_name : str
227
- The host name of the Postgres server.
240
+ host_name : str
241
+ The host name of the Postgres server.
228
242
 
229
- port : str
230
- The port number of the Postgres server.
243
+ port : str
244
+ The port number of the Postgres server.
231
245
 
232
- db_user: str
233
- User name to connect to the database
246
+ db_user: str
247
+ User name to connect to the database
234
248
 
235
- db_pwd: str
236
- User password to connect to the database
249
+ db_pwd: str
250
+ User password to connect to the database
237
251
 
238
- server : str, optional
239
- The name of the view server to use. Default uses the client instance.
252
+ server : str, optional
253
+ The name of the view server to use. Default uses the client instance.
240
254
 
241
- Returns
242
- -------
243
- str
244
- The GUID of the Kafka server element.
255
+ Returns
256
+ -------
257
+ str
258
+ The GUID of the Kafka server element.
245
259
  """
246
260
  body = {
247
- "templateGUID": TEMPLATE_GUIDS['PostgreSQL Server'],
248
- "isOwnAnchor": 'true',
261
+ "templateGUID": TEMPLATE_GUIDS["PostgreSQL Server"],
262
+ "isOwnAnchor": "true",
249
263
  "placeholderPropertyValues": {
250
264
  "serverName": postgres_server,
251
265
  "hostIdentifier": host_name,
252
266
  "portNumber": port,
253
267
  "databaseUserId": db_user,
254
- "databasePassword": db_pwd
255
- }
268
+ "databasePassword": db_pwd,
269
+ },
256
270
  }
257
271
  response = await self._async_create_element_from_template(body, server)
258
272
  return response
259
273
 
260
- def create_postgres_server_element_from_template(self, postgres_server: str, host_name: str, port: str,
261
- db_user: str, db_pwd: str, server: str = None) -> str:
262
- """ Create a Postgres server element from a template.
274
+ def create_postgres_server_element_from_template(
275
+ self,
276
+ postgres_server: str,
277
+ host_name: str,
278
+ port: str,
279
+ db_user: str,
280
+ db_pwd: str,
281
+ server: str = None,
282
+ ) -> str:
283
+ """Create a Postgres server element from a template.
263
284
 
264
- Parameters
265
- ----------
266
- postgres_server : str
267
- The name of the Postgres server.
285
+ Parameters
286
+ ----------
287
+ postgres_server : str
288
+ The name of the Postgres server.
268
289
 
269
- host_name : str
270
- The host name of the Postgres server.
290
+ host_name : str
291
+ The host name of the Postgres server.
271
292
 
272
- port : str
273
- The port number of the Postgres server.
293
+ port : str
294
+ The port number of the Postgres server.
274
295
 
275
- server : str, optional
276
- The name of the view server to use. Default uses the client instance.
296
+ server : str, optional
297
+ The name of the view server to use. Default uses the client instance.
277
298
 
278
- db_user: str
279
- User name to connect to the database
299
+ db_user: str
300
+ User name to connect to the database
280
301
 
281
- db_pwd: str
282
- User password to connect to the database
302
+ db_pwd: str
303
+ User password to connect to the database
283
304
 
284
- Returns
285
- -------
286
- str
287
- The GUID of the Postgres server element.
288
- """
305
+ Returns
306
+ -------
307
+ str
308
+ The GUID of the Postgres server element.
309
+ """
289
310
  loop = asyncio.get_event_loop()
290
311
  response = loop.run_until_complete(
291
- self._async_create_postgres_server_element_from_template(postgres_server, host_name,
292
- port, db_user, db_pwd, server)
312
+ self._async_create_postgres_server_element_from_template(
313
+ postgres_server, host_name, port, db_user, db_pwd, server
314
+ )
293
315
  )
294
316
  return response
295
317
 
@@ -297,11 +319,18 @@ class AssetCatalog(Client):
297
319
  # Engine Actions
298
320
  #
299
321
 
300
- async def _async_find_assets_in_domain(self, search_string: str, start_from: int = 0,
301
- page_size: int = max_paging_size, starts_with: bool = True,
302
- ends_with: bool = False, ignore_case: bool = True,
303
- server: str = None, time_out: int = 60) -> list | str:
304
- """ Retrieve the list of engine action metadata elements that contain the search string. Async Version.
322
+ async def _async_find_assets_in_domain(
323
+ self,
324
+ search_string: str,
325
+ start_from: int = 0,
326
+ page_size: int = max_paging_size,
327
+ starts_with: bool = True,
328
+ ends_with: bool = False,
329
+ ignore_case: bool = True,
330
+ server: str = None,
331
+ time_out: int = 60,
332
+ ) -> list | str:
333
+ """Retrieve the list of engine action metadata elements that contain the search string. Async Version.
305
334
  Parameters
306
335
  ----------
307
336
  search_string : str
@@ -349,21 +378,27 @@ class AssetCatalog(Client):
349
378
  ends_with_s = str(ends_with).lower()
350
379
  ignore_case_s = str(ignore_case).lower()
351
380
 
352
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/in-domain/"
353
- f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
354
- f"endWith={ends_with_s}&ignoreCase={ignore_case_s}"
355
- )
356
- body = {
357
- "filter": search_string
358
- }
381
+ url = (
382
+ f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/in-domain/"
383
+ f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
384
+ f"endWith={ends_with_s}&ignoreCase={ignore_case_s}"
385
+ )
386
+ body = {"filter": search_string}
359
387
  response = await self._async_make_request("POST", url, body, time_out=time_out)
360
388
  return response.json().get("searchMatches", "no assets found")
361
389
 
362
- def find_assets_in_domain(self, search_string: str, start_from: int = 0,
363
- page_size: int = max_paging_size, starts_with: bool = True,
364
- ends_with: bool = False, ignore_case: bool = True,
365
- server: str = None, time_out: int = 60) -> list | str:
366
- """ Retrieve the list of engine action metadata elements that contain the search string. Async Version.
390
+ def find_assets_in_domain(
391
+ self,
392
+ search_string: str,
393
+ start_from: int = 0,
394
+ page_size: int = max_paging_size,
395
+ starts_with: bool = True,
396
+ ends_with: bool = False,
397
+ ignore_case: bool = True,
398
+ server: str = None,
399
+ time_out: int = 60,
400
+ ) -> list | str:
401
+ """Retrieve the list of engine action metadata elements that contain the search string. Async Version.
367
402
  Parameters
368
403
  ----------
369
404
  search_string : str
@@ -405,79 +440,99 @@ class AssetCatalog(Client):
405
440
  """
406
441
  loop = asyncio.get_event_loop()
407
442
  response = loop.run_until_complete(
408
- self._async_find_assets_in_domain(search_string, start_from, page_size,
409
- starts_with, ends_with, ignore_case, server, time_out)
443
+ self._async_find_assets_in_domain(
444
+ search_string,
445
+ start_from,
446
+ page_size,
447
+ starts_with,
448
+ ends_with,
449
+ ignore_case,
450
+ server,
451
+ time_out,
452
+ )
410
453
  )
411
454
  return response
412
455
 
413
- async def _async_get_asset_graph(self, asset_guid: str, server: str = None, start_from: int = 0,
414
- page_size: int = max_paging_size) -> str | dict:
415
- """ Return all the elements that are anchored to an asset plus relationships between these elements and to
416
- other elements. Async Version.
417
- Parameters
418
- ----------
419
- asset_guid : str
420
- The unique identity of the asset to get the graph for.
421
-
422
- server : str, optional
423
- The name of the server. If None, will use the default server specified in the instance will be used.
424
-
425
- start_from : int, optional
426
- The index from which to start fetching the engine actions. Default is 0.
427
-
428
- page_size : int, optional
429
- The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
430
-
431
- Returns
432
- -------
433
- dict or str
434
- A dictionary of the asset graph.
456
+ async def _async_get_asset_graph(
457
+ self,
458
+ asset_guid: str,
459
+ server: str = None,
460
+ start_from: int = 0,
461
+ page_size: int = max_paging_size,
462
+ ) -> str | dict:
463
+ """Return all the elements that are anchored to an asset plus relationships between these elements and to
464
+ other elements. Async Version.
465
+ Parameters
466
+ ----------
467
+ asset_guid : str
468
+ The unique identity of the asset to get the graph for.
469
+
470
+ server : str, optional
471
+ The name of the server. If None, will use the default server specified in the instance will be used.
472
+
473
+ start_from : int, optional
474
+ The index from which to start fetching the engine actions. Default is 0.
475
+
476
+ page_size : int, optional
477
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
478
+
479
+ Returns
480
+ -------
481
+ dict or str
482
+ A dictionary of the asset graph.
483
+
484
+ Raises:
485
+ ------
486
+ InvalidParameterException
487
+ PropertyServerException
488
+ UserNotAuthorizedException
435
489
 
436
- Raises:
437
- ------
438
- InvalidParameterException
439
- PropertyServerException
440
- UserNotAuthorizedException
441
-
442
- """
490
+ """
443
491
  server = self.server_name if server is None else server
444
492
 
445
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/{asset_guid}/"
446
- f"as-graph?startFrom={start_from}&pageSize={page_size}")
493
+ url = (
494
+ f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/{asset_guid}/"
495
+ f"as-graph?startFrom={start_from}&pageSize={page_size}"
496
+ )
447
497
 
448
498
  response = await self._async_make_request("GET", url)
449
499
  return response.json().get("assetGraph", "no asset found")
450
500
 
451
- def get_asset_graph(self, asset_guid: str, server: str = None, start_from: int = 0,
452
- page_size: int = max_paging_size) -> str | dict:
453
- """ Return all the elements that are anchored to an asset plus relationships between these elements and to
454
- other elements.
455
- Parameters
456
- ----------
457
- asset_guid : str
458
- The unique identity of the asset to get the graph for.
459
-
460
- server : str, optional
461
- The name of the server. If None, will use the default server specified in the instance will be used.
462
-
463
- start_from : int, optional
464
- The index from which to start fetching the engine actions. Default is 0.
501
+ def get_asset_graph(
502
+ self,
503
+ asset_guid: str,
504
+ server: str = None,
505
+ start_from: int = 0,
506
+ page_size: int = max_paging_size,
507
+ ) -> str | dict:
508
+ """Return all the elements that are anchored to an asset plus relationships between these elements and to
509
+ other elements.
510
+ Parameters
511
+ ----------
512
+ asset_guid : str
513
+ The unique identity of the asset to get the graph for.
514
+
515
+ server : str, optional
516
+ The name of the server. If None, will use the default server specified in the instance will be used.
517
+
518
+ start_from : int, optional
519
+ The index from which to start fetching the engine actions. Default is 0.
520
+
521
+ page_size : int, optional
522
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
523
+
524
+ Returns
525
+ -------
526
+ dict or str
527
+ A dictionary of the asset graph.
528
+
529
+ Raises:
530
+ ------
531
+ InvalidParameterException
532
+ PropertyServerException
533
+ UserNotAuthorizedException
465
534
 
466
- page_size : int, optional
467
- The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
468
-
469
- Returns
470
- -------
471
- dict or str
472
- A dictionary of the asset graph.
473
-
474
- Raises:
475
- ------
476
- InvalidParameterException
477
- PropertyServerException
478
- UserNotAuthorizedException
479
-
480
- """
535
+ """
481
536
 
482
537
  loop = asyncio.get_event_loop()
483
538
  response = loop.run_until_complete(
@@ -485,183 +540,200 @@ class AssetCatalog(Client):
485
540
  )
486
541
  return response
487
542
 
488
- async def _async_get_assets_by_metadata_collection_id(self, metadata_collection_id: str, type_name: str = None,
489
- effective_time: str = None, server: str = None,
490
- start_from: int = 0,
491
- page_size: int = max_paging_size) -> str | list:
492
- """ Return a list of assets that come from the requested metadata collection. Can optionally
493
- specify an type name as a filter and an effective time. Async Version.
494
-
495
- Parameters
496
- ----------
497
- metadata_collection_id : str
498
- The unique identity of the metadata collection to return assets from.
499
-
500
- type_name: str, optional
501
- An asset type to optionally filter on. If not specified, all assets in the collection will be returned.
502
-
503
- effective_time: str, optional
504
- The effective time to filter on. If not specified, the current time is used.
505
-
506
- server : str, optional
507
- The name of the server. If None, will use the default server specified in the instance will be used.
543
+ async def _async_get_assets_by_metadata_collection_id(
544
+ self,
545
+ metadata_collection_id: str,
546
+ type_name: str = None,
547
+ effective_time: str = None,
548
+ server: str = None,
549
+ start_from: int = 0,
550
+ page_size: int = max_paging_size,
551
+ ) -> str | list:
552
+ """Return a list of assets that come from the requested metadata collection. Can optionally
553
+ specify an type name as a filter and an effective time. Async Version.
554
+
555
+ Parameters
556
+ ----------
557
+ metadata_collection_id : str
558
+ The unique identity of the metadata collection to return assets from.
559
+
560
+ type_name: str, optional
561
+ An asset type to optionally filter on. If not specified, all assets in the collection will be returned.
562
+
563
+ effective_time: str, optional
564
+ The effective time to filter on. If not specified, the current time is used.
565
+
566
+ server : str, optional
567
+ The name of the server. If None, will use the default server specified in the instance will be used.
508
568
 
509
- start_from : int, optional
510
- The index from which to start fetching the engine actions. Default is 0.
569
+ start_from : int, optional
570
+ The index from which to start fetching the engine actions. Default is 0.
511
571
 
512
- page_size : int, optional
513
- The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
572
+ page_size : int, optional
573
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
514
574
 
515
- Returns
516
- -------
517
- list or str
518
- A list of assets in a [dict].
575
+ Returns
576
+ -------
577
+ list or str
578
+ A list of assets in a [dict].
519
579
 
520
- Raises:
521
- ------
522
- InvalidParameterException
523
- PropertyServerException
524
- UserNotAuthorizedException
580
+ Raises:
581
+ ------
582
+ InvalidParameterException
583
+ PropertyServerException
584
+ UserNotAuthorizedException
525
585
 
526
- """
586
+ """
527
587
  server = self.server_name if server is None else server
528
588
 
529
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/by-metadata-collection-id/"
530
- f"{metadata_collection_id}?startFrom={start_from}&pageSize={page_size}")
589
+ url = (
590
+ f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/by-metadata-collection-id/"
591
+ f"{metadata_collection_id}?startFrom={start_from}&pageSize={page_size}"
592
+ )
531
593
 
532
- body = {
533
- "filter": type_name,
534
- "effectiveTime": effective_time
535
- }
594
+ body = {"filter": type_name, "effectiveTime": effective_time}
536
595
  body_s = body_slimmer(body)
537
596
  print(json.dumps(body_s))
538
597
  response = await self._async_make_request("POST", url, body_s)
539
598
  return response.json().get("assets", "no assets found")
540
599
 
541
- def get_assets_by_metadata_collection_id(self, metadata_collection_id: str, type_name: str = None,
542
- effective_time: str = None, server: str = None,
543
- start_from: int = 0,
544
- page_size: int = max_paging_size) -> str | list:
545
- """ Return a list of assets that come from the requested metadata collection. Can optionally
546
- specify an type name as a filter and an effective time. Async Version.
547
-
548
- Parameters
549
- ----------
550
- metadata_collection_id : str
551
- The unique identity of the metadata collection to return assets from.
552
-
553
- type_name: str, optional
554
- An asset type to optionally filter on. If not specified, all assets in the collection will be returned.
555
-
556
- effective_time: str, optional
557
- The effective time to filter on. If not specified, the current time is used.
558
-
559
- server : str, optional
560
- The name of the server. If None, will use the default server specified in the instance will be used.
600
+ def get_assets_by_metadata_collection_id(
601
+ self,
602
+ metadata_collection_id: str,
603
+ type_name: str = None,
604
+ effective_time: str = None,
605
+ server: str = None,
606
+ start_from: int = 0,
607
+ page_size: int = max_paging_size,
608
+ ) -> str | list:
609
+ """Return a list of assets that come from the requested metadata collection. Can optionally
610
+ specify an type name as a filter and an effective time. Async Version.
611
+
612
+ Parameters
613
+ ----------
614
+ metadata_collection_id : str
615
+ The unique identity of the metadata collection to return assets from.
616
+
617
+ type_name: str, optional
618
+ An asset type to optionally filter on. If not specified, all assets in the collection will be returned.
619
+
620
+ effective_time: str, optional
621
+ The effective time to filter on. If not specified, the current time is used.
622
+
623
+ server : str, optional
624
+ The name of the server. If None, will use the default server specified in the instance will be used.
561
625
 
562
- start_from : int, optional
563
- The index from which to start fetching the engine actions. Default is 0.
626
+ start_from : int, optional
627
+ The index from which to start fetching the engine actions. Default is 0.
564
628
 
565
- page_size : int, optional
566
- The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
629
+ page_size : int, optional
630
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
567
631
 
568
- Returns
569
- -------
570
- list or str
571
- A list of assets in a [dict].
632
+ Returns
633
+ -------
634
+ list or str
635
+ A list of assets in a [dict].
572
636
 
573
- Raises:
574
- ------
575
- InvalidParameterException
576
- PropertyServerException
577
- UserNotAuthorizedException
637
+ Raises:
638
+ ------
639
+ InvalidParameterException
640
+ PropertyServerException
641
+ UserNotAuthorizedException
578
642
 
579
- """
643
+ """
580
644
 
581
645
  loop = asyncio.get_event_loop()
582
646
  response = loop.run_until_complete(
583
- self._async_get_assets_by_metadata_collection_id(metadata_collection_id, type_name,
584
- effective_time, server, start_from,
585
- page_size)
647
+ self._async_get_assets_by_metadata_collection_id(
648
+ metadata_collection_id,
649
+ type_name,
650
+ effective_time,
651
+ server,
652
+ start_from,
653
+ page_size,
654
+ )
586
655
  )
587
656
  return response
588
657
 
589
658
  async def _async_get_asset_catalog_types(self, server: str = None) -> str | dict:
590
- """ Return all the elements that are anchored to an asset plus relationships between these elements and to
591
- other elements. Async Version.
592
- Parameters
593
- ----------
594
- asset_guid : str
595
- The unique identity of the asset to get the graph for.
596
-
597
- server : str, optional
598
- The name of the server. If None, will use the default server specified in the instance will be used.
599
-
600
- start_from : int, optional
601
- The index from which to start fetching the engine actions. Default is 0.
602
-
603
- page_size : int, optional
604
- The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
605
-
606
- Returns
607
- -------
608
- dict or str
609
- A dictionary of the asset graph.
610
-
611
- Raises:
612
- ------
613
- InvalidParameterException
614
- PropertyServerException
615
- UserNotAuthorizedException
616
-
617
- """
659
+ """Return all the elements that are anchored to an asset plus relationships between these elements and to
660
+ other elements. Async Version.
661
+ Parameters
662
+ ----------
663
+ asset_guid : str
664
+ The unique identity of the asset to get the graph for.
665
+
666
+ server : str, optional
667
+ The name of the server. If None, will use the default server specified in the instance will be used.
668
+
669
+ start_from : int, optional
670
+ The index from which to start fetching the engine actions. Default is 0.
671
+
672
+ page_size : int, optional
673
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
674
+
675
+ Returns
676
+ -------
677
+ dict or str
678
+ A dictionary of the asset graph.
679
+
680
+ Raises:
681
+ ------
682
+ InvalidParameterException
683
+ PropertyServerException
684
+ UserNotAuthorizedException
685
+
686
+ """
618
687
  server = self.server_name if server is None else server
619
688
 
620
689
  url = f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/types"
621
690
 
622
691
  response = await self._async_make_request("GET", url)
623
692
 
624
- return response.json().get('types', "No assets found")
693
+ return response.json().get("types", "No assets found")
625
694
 
626
695
  def get_asset_catalog_types(self, server: str = None) -> str | dict:
627
- """ Return all the elements that are anchored to an asset plus relationships between these elements and to
628
- other elements.
629
- Parameters
630
- ----------
631
- asset_guid : str
632
- The unique identity of the asset to get the graph for.
696
+ """Return all the elements that are anchored to an asset plus relationships between these elements and to
697
+ other elements.
698
+ Parameters
699
+ ----------
700
+ asset_guid : str
701
+ The unique identity of the asset to get the graph for.
633
702
 
634
- server : str, optional
635
- The name of the server. If None, will use the default server specified in the instance will be used.
703
+ server : str, optional
704
+ The name of the server. If None, will use the default server specified in the instance will be used.
636
705
 
637
- start_from : int, optional
638
- The index from which to start fetching the engine actions. Default is 0.
706
+ start_from : int, optional
707
+ The index from which to start fetching the engine actions. Default is 0.
639
708
 
640
- page_size : int, optional
641
- The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
709
+ page_size : int, optional
710
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
642
711
 
643
- Returns
644
- -------
645
- dict or str
646
- A dictionary of the asset graph.
712
+ Returns
713
+ -------
714
+ dict or str
715
+ A dictionary of the asset graph.
647
716
 
648
- Raises:
649
- ------
650
- InvalidParameterException
651
- PropertyServerException
652
- UserNotAuthorizedException
717
+ Raises:
718
+ ------
719
+ InvalidParameterException
720
+ PropertyServerException
721
+ UserNotAuthorizedException
653
722
 
654
- """
723
+ """
655
724
 
656
725
  loop = asyncio.get_event_loop()
657
- response = loop.run_until_complete(
658
- self._async_get_asset_catalog_types(server)
659
- )
726
+ response = loop.run_until_complete(self._async_get_asset_catalog_types(server))
660
727
  return response
661
728
 
662
729
 
663
730
  if __name__ == "__main__":
664
- p = AssetCatalog("active-metadata-store", "https://127.0.0.1:9443", "garygeeke", verify_flag=False)
731
+ p = AssetCatalog(
732
+ "active-metadata-store",
733
+ "https://127.0.0.1:9443",
734
+ "garygeeke",
735
+ verify_flag=False,
736
+ )
665
737
  response = p.get_assets_by_metadata_collection_id()
666
738
  out = response.json()
667
739
  print(out)