pyegeria 0.3.8__py3-none-any.whl → 0.4.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 (59) hide show
  1. pyegeria/Xfeedback_manager_omvs.py +238 -0
  2. pyegeria/Xloaded_resources_omvs.py +91 -0
  3. pyegeria/__init__.py +15 -12
  4. pyegeria/_client.py +4 -6
  5. pyegeria/{gov_engine.py → _deprecated_gov_engine.py} +2 -59
  6. pyegeria/_exceptions.py +5 -6
  7. pyegeria/_globals.py +3 -1
  8. pyegeria/asset_catalog_omvs.py +672 -0
  9. pyegeria/automated_curation_omvs.py +627 -359
  10. pyegeria/collection_manager_omvs.py +187 -248
  11. pyegeria/core_guids.py +128 -0
  12. pyegeria/core_omag_server_config.py +1 -5
  13. pyegeria/full_omag_server_config.py +53 -83
  14. pyegeria/glossary_browser_omvs.py +2208 -0
  15. pyegeria/glossary_manager_omvs.py +3002 -0
  16. pyegeria/my_profile_omvs.py +2 -7
  17. pyegeria/platform_services.py +0 -3
  18. pyegeria/project_manager_omvs.py +9 -15
  19. pyegeria/registered_info.py +12 -52
  20. pyegeria/runtime_manager_omvs.py +967 -0
  21. pyegeria/server_operations.py +1 -5
  22. pyegeria/valid_metadata_omvs.py +204 -43
  23. pyegeria-0.4.0.data/scripts/Create_Collection_Sample.py +292 -0
  24. pyegeria-0.4.0.data/scripts/Create_Sustainability_Collection_Sample.py +115 -0
  25. pyegeria-0.4.0.data/scripts/get_guid_info.py +86 -0
  26. pyegeria-0.3.8.data/scripts/view_my_profile.py → pyegeria-0.4.0.data/scripts/get_my_profile.py +8 -34
  27. {pyegeria-0.3.8.data → pyegeria-0.4.0.data}/scripts/get_tech_details.py +1 -37
  28. pyegeria-0.4.0.data/scripts/get_tech_type_elements.py +137 -0
  29. pyegeria-0.4.0.data/scripts/get_tech_type_template.py +137 -0
  30. {pyegeria-0.3.8.data → pyegeria-0.4.0.data}/scripts/list_asset_types.py +3 -25
  31. pyegeria-0.4.0.data/scripts/list_assets.py +138 -0
  32. pyegeria-0.3.8.data/scripts/project_list_viewer.py → pyegeria-0.4.0.data/scripts/list_projects.py +13 -27
  33. pyegeria-0.4.0.data/scripts/list_registered_services.py +135 -0
  34. pyegeria-0.3.8.data/scripts/get_relationship_types.py → pyegeria-0.4.0.data/scripts/list_relationship_types.py +25 -43
  35. pyegeria-0.4.0.data/scripts/list_tech_templates.py +134 -0
  36. pyegeria-0.3.8.data/scripts/find_todos.py → pyegeria-0.4.0.data/scripts/list_todos.py +11 -39
  37. pyegeria-0.4.0.data/scripts/list_valid_metadata_values.py +144 -0
  38. pyegeria-0.4.0.data/scripts/view_asset_graph.py +236 -0
  39. pyegeria-0.3.8.data/scripts/multi-server_status.py → pyegeria-0.4.0.data/scripts/view_coco_status.py +17 -39
  40. pyegeria-0.3.8.data/scripts/collection_viewer.py → pyegeria-0.4.0.data/scripts/view_collection.py +12 -31
  41. pyegeria-0.3.8.data/scripts/engine_action_status.py → pyegeria-0.4.0.data/scripts/view_eng_action_status.py +17 -31
  42. pyegeria-0.3.8.data/scripts/glossary_view.py → pyegeria-0.4.0.data/scripts/view_glossary.py +2 -2
  43. pyegeria-0.3.8.data/scripts/gov_engine_status.py → pyegeria-0.4.0.data/scripts/view_gov_eng_status.py +0 -1
  44. pyegeria-0.3.8.data/scripts/integration_daemon_status.py → pyegeria-0.4.0.data/scripts/view_integ_daemon_status.py +30 -42
  45. pyegeria-0.3.8.data/scripts/my_todos.py → pyegeria-0.4.0.data/scripts/view_my_todos.py +1 -1
  46. pyegeria-0.3.8.data/scripts/open_todos.py → pyegeria-0.4.0.data/scripts/view_open_todos.py +3 -24
  47. pyegeria-0.4.0.data/scripts/view_platform_status.py +123 -0
  48. pyegeria-0.3.8.data/scripts/server_status.py → pyegeria-0.4.0.data/scripts/view_server_status.py +1 -20
  49. {pyegeria-0.3.8.dist-info → pyegeria-0.4.0.dist-info}/METADATA +5 -4
  50. pyegeria-0.4.0.dist-info/RECORD +58 -0
  51. {pyegeria-0.3.8.dist-info → pyegeria-0.4.0.dist-info}/WHEEL +1 -1
  52. pyegeria/glossary_omvs.py +0 -789
  53. pyegeria/loaded_resources_omvs.py +0 -159
  54. pyegeria-0.3.8.dist-info/RECORD +0 -42
  55. /pyegeria/{governance_author.py → action_author_omvs.py} +0 -0
  56. /pyegeria-0.3.8.data/scripts/get_tech_types.py → /pyegeria-0.4.0.data/scripts/list_tech_types.py +0 -0
  57. /pyegeria-0.3.8.data/scripts/server_status_widget.py → /pyegeria-0.4.0.data/scripts/view_server_list.py +0 -0
  58. {pyegeria-0.3.8.dist-info → pyegeria-0.4.0.dist-info}/LICENSE +0 -0
  59. {pyegeria-0.3.8.dist-info → pyegeria-0.4.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,672 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+ Asset Catalog View Service Methods - Search for assets, retrieve their properties, lineage and related glossary
6
+ information.
7
+
8
+ This file is in active development...
9
+
10
+ """
11
+ import asyncio
12
+ from datetime import datetime
13
+ import json
14
+
15
+ from httpx import Response
16
+
17
+ from pyegeria import Client, max_paging_size, body_slimmer
18
+ from pyegeria._exceptions import (
19
+ InvalidParameterException,
20
+ )
21
+ from ._validators import validate_name, validate_guid, validate_search_string
22
+
23
+
24
+ class AssetCatalog(Client):
25
+ """ Set up and maintain automation services in Egeria.
26
+
27
+ Attributes:
28
+ server_name : str
29
+ The name of the View Server to use.
30
+ platform_url : str
31
+ URL of the server platform to connect to
32
+ user_id : str
33
+ The identity of the user calling the method - this sets a default optionally used by the methods
34
+ when the user doesn't pass the user_id on a method call.
35
+ user_pwd: str
36
+ The password associated with the user_id. Defaults to None
37
+ verify_flag: bool
38
+ Flag to indicate if SSL Certificates should be verified in the HTTP requests.
39
+ Defaults to False.
40
+
41
+ """
42
+
43
+ def __init__(
44
+ self,
45
+ server_name: str,
46
+ platform_url: str,
47
+ user_id: str,
48
+ user_pwd: str = None,
49
+ verify_flag: bool = False,
50
+ ):
51
+ Client.__init__(self, server_name, platform_url, user_id, user_pwd, verify_flag)
52
+ self.cur_command_root = f"{platform_url}/servers/"
53
+
54
+
55
+ async def _async_create_element_from_template(self, body: dict, server: str = None) -> str:
56
+ """ Create a new metadata element from a template. Async version.
57
+ Parameters
58
+ ----------
59
+ body : str
60
+ The json body used to instantiate the template.
61
+ server : str, optional
62
+ The name of the view server to use. If not provided, the default server name will be used.
63
+
64
+ Returns
65
+ -------
66
+ Response
67
+ The guid of the resulting element
68
+
69
+ Raises
70
+ ------
71
+ InvalidParameterException
72
+ PropertyServerException
73
+ UserNotAuthorizedException
74
+
75
+ Notes
76
+ -----
77
+ See also: https://egeria-project.org/features/templated-cataloguing/overview/
78
+ The full description of the body is shown below:
79
+ {
80
+ "typeName" : "",
81
+ "initialStatus" : "",
82
+ "initialClassifications" : "",
83
+ "anchorGUID" : "",
84
+ "isOwnAnchor" : "",
85
+ "effectiveFrom" : "",
86
+ "effectiveTo" : "",
87
+ "templateGUID" : "",
88
+ "templateProperties" : {},
89
+ "placeholderPropertyValues" : {
90
+ "placeholderPropertyName1" : "placeholderPropertyValue1",
91
+ "placeholderPropertyName2" : "placeholderPropertyValue2"
92
+ },
93
+ "parentGUID" : "",
94
+ "parentRelationshipTypeName" : "",
95
+ "parentRelationshipProperties" : "",
96
+ "parentAtEnd1" : "",
97
+ "effectiveTime" : ""
98
+ }
99
+ """
100
+
101
+ server = self.server_name if server is None else server
102
+
103
+ url = f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-templates/new-element"
104
+ response = await self._async_make_request("POST", url, body)
105
+ return response.json().get("guid", "GUID failed to be returned")
106
+
107
+ def create_element_from_template(self, body: dict, server: str = None) -> str:
108
+ """ Create a new metadata element from a template. Async version.
109
+ Parameters
110
+ ----------
111
+ body : str
112
+ The json body used to instantiate the template.
113
+ server : str, optional
114
+ The name of the view server to use. If not provided, the default server name will be used.
115
+
116
+ Returns
117
+ -------
118
+ Response
119
+ The guid of the resulting element
120
+
121
+ Raises
122
+ ------
123
+ InvalidParameterException
124
+ PropertyServerException
125
+ UserNotAuthorizedException
126
+
127
+ Notes
128
+ -----
129
+ See also: https://egeria-project.org/features/templated-cataloguing/overview/
130
+ The full description of the body is shown below:
131
+ {
132
+ "typeName" : "",
133
+ "initialStatus" : "",
134
+ "initialClassifications" : "",
135
+ "anchorGUID" : "",
136
+ "isOwnAnchor" : "",
137
+ "effectiveFrom" : "",
138
+ "effectiveTo" : "",
139
+ "templateGUID" : "",
140
+ "templateProperties" : {},
141
+ "placeholderPropertyValues" : {
142
+ "placeholderPropertyName1" : "placeholderPropertyValue1",
143
+ "placeholderPropertyName2" : "placeholderPropertyValue2"
144
+ },
145
+ "parentGUID" : "",
146
+ "parentRelationshipTypeName" : "",
147
+ "parentRelationshipProperties" : "",
148
+ "parentAtEnd1" : "",
149
+ "effectiveTime" : ""
150
+ }
151
+ """
152
+ loop = asyncio.get_event_loop()
153
+ response = loop.run_until_complete(
154
+ self._async_create_element_from_template(body, server)
155
+ )
156
+ return response
157
+
158
+ async def _async_create_kafka_server_element_from_template(self, kafka_server: str, host_name: str, port: str,
159
+ server: str = None) -> str:
160
+ """ Create a Kafka server element from a template. Async version.
161
+
162
+ Parameters
163
+ ----------
164
+ kafka_server : str
165
+ The name of the Kafka server.
166
+
167
+ host_name : str
168
+ The host name of the Kafka server.
169
+
170
+ port : str
171
+ The port number of the Kafka server.
172
+
173
+ server : str, optional
174
+ The name of the view server to use. Default uses the client instance.
175
+
176
+ Returns
177
+ -------
178
+ str
179
+ The GUID of the Kafka server element.
180
+ """
181
+
182
+ body = {
183
+ "templateGUID": "5e1ff810-5418-43f7-b7c4-e6e062f9aff7",
184
+ "isOwnAnchor": 'true',
185
+ "placeholderPropertyValues": {
186
+ "serverName": kafka_server,
187
+ "hostIdentifier": host_name,
188
+ "portNumber": port
189
+ }
190
+ }
191
+ response = await self._async_create_element_from_template(body, server)
192
+ return response
193
+
194
+ def create_kafka_server_element_from_template(self, kafka_server: str, host_name: str, port: str,
195
+ server: str = None) -> str:
196
+ """ Create a Kafka server element from a template.
197
+
198
+ Parameters
199
+ ----------
200
+ kafka_server : str
201
+ The name of the Kafka server.
202
+
203
+ host_name : str
204
+ The host name of the Kafka server.
205
+
206
+ port : str
207
+ The port number of the Kafka server.
208
+
209
+ server : str, optional
210
+ The name of the view server to use. Default uses the client instance.
211
+
212
+ Returns
213
+ -------
214
+ str
215
+ The GUID of the Kafka server element.
216
+ """
217
+ loop = asyncio.get_event_loop()
218
+ response = loop.run_until_complete(
219
+ self._async_create_kafka_server_element_from_template(kafka_server, host_name, port, server)
220
+ )
221
+ return response
222
+
223
+ async def _async_create_postgres_server_element_from_template(self, postgres_server: str, host_name: str, port: str,
224
+ db_user: str, db_pwd: str, server: str = None) -> str:
225
+ """ Create a Postgres server element from a template. Async version.
226
+
227
+ Parameters
228
+ ----------
229
+ postgres_server : str
230
+ The name of the Postgres server.
231
+
232
+ host_name : str
233
+ The host name of the Postgres server.
234
+
235
+ port : str
236
+ The port number of the Postgres server.
237
+
238
+ db_user: str
239
+ User name to connect to the database
240
+
241
+ db_pwd: str
242
+ User password to connect to the database
243
+
244
+ server : str, optional
245
+ The name of the view server to use. Default uses the client instance.
246
+
247
+ Returns
248
+ -------
249
+ str
250
+ The GUID of the Kafka server element.
251
+ """
252
+ body = {
253
+ "templateGUID": "542134e6-b9ce-4dce-8aef-22e8daf34fdb",
254
+ "isOwnAnchor": 'true',
255
+ "placeholderPropertyValues": {
256
+ "serverName": postgres_server,
257
+ "hostIdentifier": host_name,
258
+ "portNumber": port,
259
+ "databaseUserId": db_user,
260
+ "databasePassword": db_pwd
261
+ }
262
+ }
263
+ response = await self._async_create_element_from_template(body, server)
264
+ return response
265
+
266
+ def create_postgres_server_element_from_template(self, postgres_server: str, host_name: str, port: str,
267
+ db_user: str, db_pwd: str, server: str = None) -> str:
268
+ """ Create a Postgres server element from a template.
269
+
270
+ Parameters
271
+ ----------
272
+ postgres_server : str
273
+ The name of the Postgres server.
274
+
275
+ host_name : str
276
+ The host name of the Postgres server.
277
+
278
+ port : str
279
+ The port number of the Postgres server.
280
+
281
+ server : str, optional
282
+ The name of the view server to use. Default uses the client instance.
283
+
284
+ db_user: str
285
+ User name to connect to the database
286
+
287
+ db_pwd: str
288
+ User password to connect to the database
289
+
290
+ Returns
291
+ -------
292
+ str
293
+ The GUID of the Postgres server element.
294
+ """
295
+ loop = asyncio.get_event_loop()
296
+ response = loop.run_until_complete(
297
+ self._async_create_postgres_server_element_from_template(postgres_server, host_name,
298
+ port, db_user, db_pwd, server)
299
+ )
300
+ return response
301
+
302
+ #
303
+ # Engine Actions
304
+ #
305
+
306
+ async def _async_find_assets_in_domain(self, search_string: str, start_from: int = 0,
307
+ page_size: int = max_paging_size, starts_with: bool = True,
308
+ ends_with: bool = False, ignore_case: bool = True,
309
+ server: str = None) -> list | str:
310
+ """ Retrieve the list of engine action metadata elements that contain the search string. Async Version.
311
+ Parameters
312
+ ----------
313
+ search_string : str
314
+ The string used for searching engine actions by name.
315
+
316
+ server : str, optional
317
+ The name of the server. If None, will use the default server specified in the instance will be used.
318
+
319
+ starts_with : bool, optional
320
+ Whether to search engine actions that start with the given search string. Default is False.
321
+
322
+ ends_with : bool, optional
323
+ Whether to search engine actions that end with the given search string. Default is False.
324
+
325
+ ignore_case : bool, optional
326
+ Whether to ignore case while searching engine actions. Default is False.
327
+
328
+ start_from : int, optional
329
+ The index from which to start fetching the engine actions. Default is 0.
330
+
331
+ page_size : int, optional
332
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
333
+
334
+ Returns
335
+ -------
336
+ List[dict] or str
337
+ A list of dictionaries representing the engine actions found based on the search query.
338
+ If no actions are found, returns the string "no actions".
339
+
340
+ Raises:
341
+ ------
342
+ InvalidParameterException
343
+ PropertyServerException
344
+ UserNotAuthorizedException
345
+
346
+ Notes
347
+ -----
348
+ For more information see: https://egeria-project.org/concepts/engine-action
349
+ """
350
+ server = self.server_name if server is None else server
351
+ validate_search_string(search_string)
352
+ if search_string == "*":
353
+ search_string = None
354
+ starts_with_s = str(starts_with).lower()
355
+ ends_with_s = str(ends_with).lower()
356
+ ignore_case_s = str(ignore_case).lower()
357
+
358
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/in-domain/"
359
+ f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
360
+ f"endWith={ends_with_s}&ignoreCase={ignore_case_s}"
361
+ )
362
+ body = {
363
+ "filter": search_string
364
+ }
365
+ response = await self._async_make_request("POST", url, body)
366
+ return response.json().get("searchMatches", "no assets found")
367
+
368
+ def find_assets_in_domain(self, search_string: str, start_from: int = 0,
369
+ page_size: int = max_paging_size, starts_with: bool = True,
370
+ ends_with: bool = False, ignore_case: bool = True,
371
+ server: str = None) -> list | str:
372
+ """ Retrieve the list of engine action metadata elements that contain the search string. Async Version.
373
+ Parameters
374
+ ----------
375
+ search_string : str
376
+ The string used for searching engine actions by name.
377
+
378
+ server : str, optional
379
+ The name of the server. If None, will use the default server specified in the instance will be used.
380
+
381
+ starts_with : bool, optional
382
+ Whether to search engine actions that start with the given search string. Default is False.
383
+
384
+ ends_with : bool, optional
385
+ Whether to search engine actions that end with the given search string. Default is False.
386
+
387
+ ignore_case : bool, optional
388
+ Whether to ignore case while searching engine actions. Default is False.
389
+
390
+ start_from : int, optional
391
+ The index from which to start fetching the engine actions. Default is 0.
392
+
393
+ page_size : int, optional
394
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
395
+
396
+ Returns
397
+ -------
398
+ List[dict] or str
399
+ A list of dictionaries representing the engine actions found based on the search query.
400
+ If no actions are found, returns the string "no actions".
401
+
402
+ Raises:
403
+ ------
404
+ InvalidParameterException
405
+ PropertyServerException
406
+ UserNotAuthorizedException
407
+
408
+ Notes
409
+ -----
410
+ For more information see: https://egeria-project.org/concepts/engine-action
411
+ """
412
+ loop = asyncio.get_event_loop()
413
+ response = loop.run_until_complete(
414
+ self._async_find_assets_in_domain(search_string, start_from,page_size,
415
+ starts_with, ends_with, ignore_case, server)
416
+ )
417
+ return response
418
+
419
+
420
+ async def _async_get_asset_graph(self, asset_guid:str, server: str = None, start_from: int = 0,
421
+ page_size: int = max_paging_size) -> str| dict:
422
+ """ Return all the elements that are anchored to an asset plus relationships between these elements and to
423
+ other elements. Async Version.
424
+ Parameters
425
+ ----------
426
+ asset_guid : str
427
+ The unique identity of the asset to get the graph for.
428
+
429
+ server : str, optional
430
+ The name of the server. If None, will use the default server specified in the instance will be used.
431
+
432
+ start_from : int, optional
433
+ The index from which to start fetching the engine actions. Default is 0.
434
+
435
+ page_size : int, optional
436
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
437
+
438
+ Returns
439
+ -------
440
+ dict or str
441
+ A dictionary of the asset graph.
442
+
443
+ Raises:
444
+ ------
445
+ InvalidParameterException
446
+ PropertyServerException
447
+ UserNotAuthorizedException
448
+
449
+ """
450
+ server = self.server_name if server is None else server
451
+
452
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/{asset_guid}/"
453
+ f"as-graph?startFrom={start_from}&pageSize={page_size}")
454
+
455
+ response = await self._async_make_request("GET", url)
456
+ return response.json().get("assetGraph", "no asset found")
457
+
458
+ def get_asset_graph(self, asset_guid: str, server: str = None, start_from: int = 0,
459
+ page_size: int = max_paging_size) -> str | dict:
460
+ """ Return all the elements that are anchored to an asset plus relationships between these elements and to
461
+ other elements.
462
+ Parameters
463
+ ----------
464
+ asset_guid : str
465
+ The unique identity of the asset to get the graph for.
466
+
467
+ server : str, optional
468
+ The name of the server. If None, will use the default server specified in the instance will be used.
469
+
470
+ start_from : int, optional
471
+ The index from which to start fetching the engine actions. Default is 0.
472
+
473
+ page_size : int, optional
474
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
475
+
476
+ Returns
477
+ -------
478
+ dict or str
479
+ A dictionary of the asset graph.
480
+
481
+ Raises:
482
+ ------
483
+ InvalidParameterException
484
+ PropertyServerException
485
+ UserNotAuthorizedException
486
+
487
+ """
488
+
489
+ loop = asyncio.get_event_loop()
490
+ response = loop.run_until_complete(
491
+ self._async_get_asset_graph(asset_guid, server,start_from, page_size)
492
+ )
493
+ return response
494
+
495
+ async def _async_get_assets_by_metadata_collection_id(self, metadata_collection_id:str, type_name: str = None,
496
+ effective_time: str = None, server: str = None,
497
+ start_from: int = 0, page_size: int = max_paging_size) -> str| list:
498
+ """ Return a list of assets that come from the requested metadata collection. Can optionally
499
+ specify an type name as a filter and an effective time. Async Version.
500
+
501
+ Parameters
502
+ ----------
503
+ metadata_collection_id : str
504
+ The unique identity of the metadata collection to return assets from.
505
+
506
+ type_name: str, optional
507
+ An asset type to optionally filter on. If not specified, all assets in the collection will be returned.
508
+
509
+ effective_time: str, optional
510
+ The effective time to filter on. If not specified, the current time is used.
511
+
512
+ server : str, optional
513
+ The name of the server. If None, will use the default server specified in the instance will be used.
514
+
515
+ start_from : int, optional
516
+ The index from which to start fetching the engine actions. Default is 0.
517
+
518
+ page_size : int, optional
519
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
520
+
521
+ Returns
522
+ -------
523
+ list or str
524
+ A list of assets in a [dict].
525
+
526
+ Raises:
527
+ ------
528
+ InvalidParameterException
529
+ PropertyServerException
530
+ UserNotAuthorizedException
531
+
532
+ """
533
+ server = self.server_name if server is None else server
534
+
535
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/by-metadata-collection-id/"
536
+ f"{metadata_collection_id}?startFrom={start_from}&pageSize={page_size}")
537
+
538
+ body = {
539
+ "filter": type_name,
540
+ "effectiveTime": effective_time
541
+ }
542
+ body_s = body_slimmer(body)
543
+ print(json.dumps(body_s))
544
+ response = await self._async_make_request("POST", url, body_s)
545
+ return response.json().get("assets", "no assets found")
546
+
547
+ def get_assets_by_metadata_collection_id(self, metadata_collection_id: str, type_name: str = None,
548
+ effective_time: str = None, server: str = None,
549
+ start_from: int = 0,
550
+ page_size: int = max_paging_size) -> str | list:
551
+ """ Return a list of assets that come from the requested metadata collection. Can optionally
552
+ specify an type name as a filter and an effective time. Async Version.
553
+
554
+ Parameters
555
+ ----------
556
+ metadata_collection_id : str
557
+ The unique identity of the metadata collection to return assets from.
558
+
559
+ type_name: str, optional
560
+ An asset type to optionally filter on. If not specified, all assets in the collection will be returned.
561
+
562
+ effective_time: str, optional
563
+ The effective time to filter on. If not specified, the current time is used.
564
+
565
+ server : str, optional
566
+ The name of the server. If None, will use the default server specified in the instance will be used.
567
+
568
+ start_from : int, optional
569
+ The index from which to start fetching the engine actions. Default is 0.
570
+
571
+ page_size : int, optional
572
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
573
+
574
+ Returns
575
+ -------
576
+ list or str
577
+ A list of assets in a [dict].
578
+
579
+ Raises:
580
+ ------
581
+ InvalidParameterException
582
+ PropertyServerException
583
+ UserNotAuthorizedException
584
+
585
+ """
586
+
587
+ loop = asyncio.get_event_loop()
588
+ response = loop.run_until_complete(
589
+ self._async_get_assets_by_metadata_collection_id(metadata_collection_id, type_name,
590
+ effective_time,server,start_from,
591
+ page_size)
592
+ )
593
+ return response
594
+
595
+ async def _async_get_asset_catalog_types(self, server: str = None) -> str| dict:
596
+ """ Return all the elements that are anchored to an asset plus relationships between these elements and to
597
+ other elements. Async Version.
598
+ Parameters
599
+ ----------
600
+ asset_guid : str
601
+ The unique identity of the asset to get the graph for.
602
+
603
+ server : str, optional
604
+ The name of the server. If None, will use the default server specified in the instance will be used.
605
+
606
+ start_from : int, optional
607
+ The index from which to start fetching the engine actions. Default is 0.
608
+
609
+ page_size : int, optional
610
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
611
+
612
+ Returns
613
+ -------
614
+ dict or str
615
+ A dictionary of the asset graph.
616
+
617
+ Raises:
618
+ ------
619
+ InvalidParameterException
620
+ PropertyServerException
621
+ UserNotAuthorizedException
622
+
623
+ """
624
+ server = self.server_name if server is None else server
625
+
626
+ url = f"{self.platform_url}/servers/{server}/api/open-metadata/asset-catalog/assets/types"
627
+
628
+ response = await self._async_make_request("GET", url)
629
+
630
+ return response.json().get('types',"No assets found")
631
+
632
+ def get_asset_catalog_types(self, server: str = None) -> str | dict:
633
+ """ Return all the elements that are anchored to an asset plus relationships between these elements and to
634
+ other elements.
635
+ Parameters
636
+ ----------
637
+ asset_guid : str
638
+ The unique identity of the asset to get the graph for.
639
+
640
+ server : str, optional
641
+ The name of the server. If None, will use the default server specified in the instance will be used.
642
+
643
+ start_from : int, optional
644
+ The index from which to start fetching the engine actions. Default is 0.
645
+
646
+ page_size : int, optional
647
+ The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
648
+
649
+ Returns
650
+ -------
651
+ dict or str
652
+ A dictionary of the asset graph.
653
+
654
+ Raises:
655
+ ------
656
+ InvalidParameterException
657
+ PropertyServerException
658
+ UserNotAuthorizedException
659
+
660
+ """
661
+
662
+ loop = asyncio.get_event_loop()
663
+ response = loop.run_until_complete(
664
+ self._async_get_asset_catalog_types(server)
665
+ )
666
+ return response
667
+
668
+ if __name__ == "__main__":
669
+ p = AssetCatalog("active-metadata-store", "https://127.0.0.1:9443", "garygeeke", verify_flag=False)
670
+ response = p.get_assets_by_metadata_collection_id()
671
+ out = response.json()
672
+ print(out)