pyegeria 5.4.0.28__py3-none-any.whl → 5.5.3.3__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.

Potentially problematic release.


This version of pyegeria might be problematic. Click here for more details.

Files changed (433) hide show
  1. commands/__init__.py +24 -0
  2. commands/cat/Dr-Egeria_md-orig.py +2 -2
  3. commands/cat/collection_actions.py +197 -0
  4. commands/cat/dr_egeria_command_help.py +137 -38
  5. commands/cat/dr_egeria_jupyter.py +7 -7
  6. commands/cat/dr_egeria_md.py +10 -267
  7. commands/cat/exp_list_glossaries.py +11 -14
  8. commands/cat/get_asset_graph.py +37 -267
  9. commands/cat/{get_collection.py → get_collection_tree.py} +10 -18
  10. commands/cat/get_project_dependencies.py +14 -14
  11. commands/cat/get_project_structure.py +15 -14
  12. commands/cat/get_tech_type_elements.py +16 -116
  13. commands/cat/glossary_actions.py +145 -298
  14. commands/cat/list_assets.py +3 -11
  15. commands/cat/list_cert_types.py +17 -63
  16. commands/cat/list_collections.py +17 -139
  17. commands/cat/list_deployed_catalogs.py +15 -27
  18. commands/cat/list_deployed_database_schemas.py +27 -43
  19. commands/cat/list_deployed_databases.py +16 -31
  20. commands/cat/list_deployed_servers.py +35 -54
  21. commands/cat/list_glossaries.py +18 -17
  22. commands/cat/list_projects.py +10 -12
  23. commands/cat/list_tech_type_elements.py +21 -37
  24. commands/cat/list_tech_types.py +13 -25
  25. commands/cat/list_terms.py +38 -79
  26. commands/cat/list_todos.py +4 -11
  27. commands/cat/list_user_ids.py +3 -10
  28. commands/cat/my_reports.py +559 -0
  29. commands/cat/run_report.py +394 -0
  30. commands/cat/{list_format_set.py → run_report_orig.py} +136 -44
  31. commands/cli/egeria.py +182 -219
  32. commands/cli/egeria_cat.py +32 -59
  33. commands/cli/egeria_my.py +13 -0
  34. commands/cli/egeria_ops.py +69 -74
  35. commands/cli/egeria_tech.py +17 -93
  36. commands/{cat → deprecated}/list_data_designer.py +2 -4
  37. commands/{cat → deprecated}/list_data_structures_full.py +3 -6
  38. commands/deprecated/old_get_asset_graph.py +315 -0
  39. commands/my/__init__.py +0 -2
  40. commands/my/list_my_profile.py +27 -34
  41. commands/my/list_my_roles.py +1 -7
  42. commands/my/monitor_my_todos.py +1 -7
  43. commands/my/monitor_open_todos.py +6 -7
  44. commands/my/todo_actions.py +4 -5
  45. commands/ops/__init__.py +0 -2
  46. commands/ops/gov_server_actions.py +17 -21
  47. commands/ops/list_archives.py +17 -38
  48. commands/ops/list_catalog_targets.py +33 -40
  49. commands/ops/load_archive.py +14 -11
  50. commands/ops/{monitor_engine_activity_c.py → monitor_active_engine_activity.py} +51 -82
  51. commands/ops/{monitor_integ_daemon_status.py → monitor_daemon_status.py} +35 -55
  52. commands/ops/monitor_engine_activity.py +79 -77
  53. commands/ops/{monitor_gov_eng_status.py → monitor_engine_status.py} +10 -7
  54. commands/ops/monitor_platform_status.py +38 -50
  55. commands/ops/monitor_server_startup.py +6 -11
  56. commands/ops/monitor_server_status.py +7 -11
  57. commands/ops/orig_monitor_server_list.py +8 -8
  58. commands/ops/orig_monitor_server_status.py +1 -5
  59. commands/ops/refresh_integration_daemon.py +5 -5
  60. commands/ops/restart_integration_daemon.py +5 -5
  61. commands/ops/table_integ_daemon_status.py +6 -6
  62. commands/ops/x_engine_actions.py +7 -7
  63. commands/tech/__init__.py +0 -2
  64. commands/tech/{generic_actions.py → element_actions.py} +6 -11
  65. commands/tech/get_element_info.py +20 -29
  66. commands/tech/get_guid_info.py +23 -42
  67. commands/tech/get_tech_details.py +20 -35
  68. commands/tech/get_tech_type_template.py +28 -39
  69. commands/tech/list_all_om_type_elements.py +24 -30
  70. commands/tech/list_all_om_type_elements_x.py +22 -28
  71. commands/tech/list_all_related_elements.py +19 -28
  72. commands/tech/list_anchored_elements.py +22 -30
  73. commands/tech/list_asset_types.py +19 -24
  74. commands/tech/list_elements_by_classification_by_property_value.py +26 -32
  75. commands/tech/list_elements_by_property_value.py +19 -25
  76. commands/tech/list_elements_by_property_value_x.py +20 -28
  77. commands/tech/list_elements_for_classification.py +28 -41
  78. commands/tech/list_gov_action_processes.py +16 -27
  79. commands/tech/list_information_supply_chains.py +22 -30
  80. commands/tech/list_registered_services.py +14 -26
  81. commands/tech/list_related_elements_with_prop_value.py +15 -25
  82. commands/tech/list_related_specification.py +1 -4
  83. commands/tech/list_relationship_types.py +15 -25
  84. commands/tech/list_relationships.py +20 -36
  85. commands/tech/list_solution_blueprints.py +28 -33
  86. commands/tech/list_solution_components.py +23 -29
  87. commands/tech/list_solution_roles.py +21 -32
  88. commands/tech/list_tech_templates.py +51 -54
  89. commands/tech/list_valid_metadata_values.py +5 -9
  90. commands/tech/table_tech_templates.py +2 -6
  91. commands/tech/x_list_related_elements.py +1 -4
  92. examples/GeoSpatial Products Example.py +524 -0
  93. examples/Jupyter Notebooks/P-egeria-server-config.ipynb +2137 -0
  94. examples/Jupyter Notebooks/README.md +2 -0
  95. examples/Jupyter Notebooks/common/P-environment-check.ipynb +115 -0
  96. examples/Jupyter Notebooks/common/__init__.py +14 -0
  97. examples/Jupyter Notebooks/common/common-functions.ipynb +4694 -0
  98. examples/Jupyter Notebooks/common/environment-check.ipynb +52 -0
  99. examples/Jupyter Notebooks/common/globals.ipynb +184 -0
  100. examples/Jupyter Notebooks/common/globals.py +154 -0
  101. examples/Jupyter Notebooks/common/orig_globals.py +152 -0
  102. examples/format_sets/all_format_sets.json +910 -0
  103. examples/format_sets/custom_format_sets.json +268 -0
  104. examples/format_sets/subset_format_sets.json +187 -0
  105. examples/format_sets_save_load_example.py +291 -0
  106. examples/jacquard_data_sets.py +129 -0
  107. examples/output_formats_example.py +193 -0
  108. examples/test_jacquard_data_sets.py +54 -0
  109. examples/test_jacquard_data_sets_scenarios.py +94 -0
  110. md_processing/__init__.py +33 -24
  111. md_processing/command_dispatcher.py +33 -0
  112. md_processing/command_mapping.py +221 -0
  113. md_processing/data/commands/commands_data_designer.json +537 -0
  114. md_processing/data/commands/commands_external_reference.json +733 -0
  115. md_processing/data/commands/commands_feedback.json +155 -0
  116. md_processing/data/commands/commands_general.json +204 -0
  117. md_processing/data/commands/commands_glossary.json +218 -0
  118. md_processing/data/commands/commands_governance.json +3678 -0
  119. md_processing/data/commands/commands_product_manager.json +865 -0
  120. md_processing/data/commands/commands_project.json +642 -0
  121. md_processing/data/commands/commands_solution_architect.json +366 -0
  122. md_processing/data/commands.json +6489 -30060
  123. md_processing/data/{commands-working.json → commands_working.json} +9304 -13513
  124. md_processing/data/gened_report_specs.py +6584 -0
  125. md_processing/data/generated_format_sets.json +6533 -0
  126. md_processing/data/generated_format_sets_old.json +4137 -0
  127. md_processing/data/generated_format_sets_old.py +45 -0
  128. md_processing/dr_egeria.py +182 -0
  129. md_processing/md_commands/data_designer_commands.py +195 -583
  130. md_processing/md_commands/ext_ref_commands.py +530 -0
  131. md_processing/md_commands/feedback_commands.py +726 -0
  132. md_processing/md_commands/glossary_commands.py +106 -490
  133. md_processing/md_commands/governance_officer_commands.py +129 -18
  134. md_processing/md_commands/product_manager_commands.py +362 -115
  135. md_processing/md_commands/project_commands.py +351 -134
  136. md_processing/md_commands/solution_architect_commands.py +276 -232
  137. md_processing/md_commands/view_commands.py +295 -0
  138. md_processing/md_processing_utils/common_md_proc_utils.py +258 -166
  139. md_processing/md_processing_utils/common_md_utils.py +138 -43
  140. md_processing/md_processing_utils/determine_width.py +103 -0
  141. md_processing/md_processing_utils/extraction_utils.py +100 -39
  142. md_processing/md_processing_utils/gen_report_specs.py +643 -0
  143. md_processing/md_processing_utils/generate_dr_help.py +61 -33
  144. md_processing/md_processing_utils/generate_md_cmd_templates.py +20 -19
  145. md_processing/md_processing_utils/generate_md_templates.py +3 -12
  146. md_processing/md_processing_utils/md_processing_constants.py +1053 -72
  147. pyegeria/__init__.py +203 -158
  148. pyegeria/core/__init__.py +40 -0
  149. pyegeria/core/_base_platform_client.py +574 -0
  150. pyegeria/core/_base_server_client.py +573 -0
  151. pyegeria/{_exceptions_new.py → core/_exceptions.py} +62 -30
  152. pyegeria/{_globals.py → core/_globals.py} +14 -3
  153. pyegeria/core/_server_client.py +6073 -0
  154. pyegeria/{_validators.py → core/_validators.py} +7 -8
  155. pyegeria/core/config.py +654 -0
  156. pyegeria/{create_tech_guid_lists.py → core/create_tech_guid_lists.py} +0 -1
  157. pyegeria/core/load_config.py +37 -0
  158. pyegeria/{logging_configuration.py → core/logging_configuration.py} +1 -1
  159. pyegeria/core/mcp_adapter.py +144 -0
  160. pyegeria/core/mcp_server.py +212 -0
  161. pyegeria/core/utils.py +405 -0
  162. pyegeria/{_client.py → deprecated/_client.py} +24 -25
  163. pyegeria/{_deprecated_gov_engine.py → deprecated/_deprecated_gov_engine.py} +16 -16
  164. pyegeria/{classification_manager_omvs.py → deprecated/classification_manager_omvs.py} +1987 -1877
  165. pyegeria/{output_formatter.py → deprecated/output_formatter_with_machine_keys.py} +298 -45
  166. pyegeria/{runtime_manager_omvs.py → deprecated/runtime_manager_omvs.py} +155 -171
  167. pyegeria/{valid_metadata_omvs.py → deprecated/valid_metadata_omvs.py} +93 -93
  168. pyegeria/{x_action_author_omvs.py → deprecated/x_action_author_omvs.py} +2 -3
  169. pyegeria/egeria_cat_client.py +26 -70
  170. pyegeria/egeria_client.py +130 -93
  171. pyegeria/egeria_config_client.py +40 -46
  172. pyegeria/egeria_tech_client.py +141 -54
  173. pyegeria/models/__init__.py +150 -0
  174. pyegeria/{models.py → models/models.py} +156 -20
  175. pyegeria/omvs/__init__.py +84 -0
  176. pyegeria/omvs/action_author.py +342 -0
  177. pyegeria/omvs/actor_manager.py +5980 -0
  178. pyegeria/omvs/asset_catalog.py +842 -0
  179. pyegeria/omvs/asset_maker.py +2736 -0
  180. pyegeria/omvs/automated_curation.py +4403 -0
  181. pyegeria/omvs/classification_manager.py +11213 -0
  182. pyegeria/{collection_manager.py → omvs/collection_manager.py} +1334 -1160
  183. pyegeria/omvs/community_matters_omvs.py +468 -0
  184. pyegeria/{core_omag_server_config.py → omvs/core_omag_server_config.py} +157 -157
  185. pyegeria/{data_designer.py → omvs/data_designer.py} +1115 -660
  186. pyegeria/omvs/data_discovery.py +869 -0
  187. pyegeria/omvs/data_engineer.py +372 -0
  188. pyegeria/omvs/digital_business.py +1133 -0
  189. pyegeria/omvs/external_links.py +1752 -0
  190. pyegeria/omvs/feedback_manager.py +834 -0
  191. pyegeria/{full_omag_server_config.py → omvs/full_omag_server_config.py} +73 -69
  192. pyegeria/{glossary_manager.py → omvs/glossary_manager.py} +857 -519
  193. pyegeria/{governance_officer.py → omvs/governance_officer.py} +964 -468
  194. pyegeria/omvs/lineage_linker.py +314 -0
  195. pyegeria/omvs/location_arena.py +1525 -0
  196. pyegeria/omvs/metadata_expert.py +668 -0
  197. pyegeria/omvs/metadata_explorer_omvs.py +2943 -0
  198. pyegeria/omvs/my_profile.py +1042 -0
  199. pyegeria/omvs/notification_manager.py +358 -0
  200. pyegeria/omvs/people_organizer.py +394 -0
  201. pyegeria/{platform_services.py → omvs/platform_services.py} +113 -193
  202. pyegeria/omvs/product_manager.py +1825 -0
  203. pyegeria/omvs/project_manager.py +1907 -0
  204. pyegeria/omvs/reference_data.py +1140 -0
  205. pyegeria/omvs/registered_info.py +334 -0
  206. pyegeria/omvs/runtime_manager.py +2817 -0
  207. pyegeria/omvs/schema_maker.py +446 -0
  208. pyegeria/{server_operations.py → omvs/server_operations.py} +27 -26
  209. pyegeria/{solution_architect_omvs.py → omvs/solution_architect.py} +1886 -1505
  210. pyegeria/omvs/specification_properties.py +37 -0
  211. pyegeria/omvs/subject_area.py +1042 -0
  212. pyegeria/omvs/template_manager_omvs.py +236 -0
  213. pyegeria/omvs/time_keeper.py +1761 -0
  214. pyegeria/omvs/valid_metadata.py +3221 -0
  215. pyegeria/omvs/valid_metadata_lists.py +37 -0
  216. pyegeria/omvs/valid_type_lists.py +37 -0
  217. pyegeria/view/__init__.py +28 -0
  218. pyegeria/{_output_format_models.py → view/_output_format_models.py} +160 -24
  219. pyegeria/view/_output_formats.py +14 -0
  220. pyegeria/view/base_report_formats.py +2719 -0
  221. pyegeria/view/dr_egeria_reports.py +56 -0
  222. pyegeria/view/format_set_executor.py +397 -0
  223. pyegeria/{md_processing_utils.py → view/md_processing_utils.py} +5 -5
  224. pyegeria/{mermaid_utilities.py → view/mermaid_utilities.py} +2 -154
  225. pyegeria/view/output_formatter.py +1297 -0
  226. pyegeria-5.5.3.3.dist-info/METADATA +218 -0
  227. pyegeria-5.5.3.3.dist-info/RECORD +241 -0
  228. {pyegeria-5.4.0.28.dist-info → pyegeria-5.5.3.3.dist-info}/WHEEL +2 -1
  229. pyegeria-5.5.3.3.dist-info/entry_points.txt +103 -0
  230. pyegeria-5.5.3.3.dist-info/top_level.txt +4 -0
  231. commands/cat/.DS_Store +0 -0
  232. commands/cat/.env +0 -8
  233. commands/cat/README.md +0 -16
  234. commands/cat/debug_log +0 -1126
  235. commands/cat/debug_log.2025-08-18_11-34-38_088636.zip +0 -0
  236. commands/cat/list_categories.py +0 -192
  237. commands/cat/logs/pyegeria.log +0 -4
  238. commands/cli/debug_log +0 -0
  239. commands/cli/debug_log.log +0 -0
  240. commands/cli/txt_custom_v2.tcss +0 -19
  241. commands/my/README.md +0 -17
  242. commands/ops/README.md +0 -24
  243. commands/ops/logs/pyegeria.log +0 -0
  244. commands/ops/monitor_asset_events.py +0 -108
  245. commands/tech/README.md +0 -24
  246. md_processing/.DS_Store +0 -0
  247. md_processing/dr-egeria-outbox/Collections-2025-08-12-13-30-37.md +0 -163
  248. md_processing/dr-egeria-outbox/Collections-2025-08-12-13-35-58.md +0 -474
  249. md_processing/dr_egeria_inbox/Derive-Dr-Gov-Defs.md +0 -8
  250. md_processing/dr_egeria_inbox/Dr.Egeria Templates.md +0 -873
  251. md_processing/dr_egeria_inbox/arch_test.md +0 -57
  252. md_processing/dr_egeria_inbox/archive/dr_egeria_intro.md +0 -254
  253. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_more_terms.md +0 -696
  254. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part1.md +0 -254
  255. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part2.md +0 -298
  256. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part3.md +0 -608
  257. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part4.md +0 -94
  258. md_processing/dr_egeria_inbox/archive/freddie_intro.md +0 -284
  259. md_processing/dr_egeria_inbox/archive/freddie_intro_orig.md +0 -275
  260. md_processing/dr_egeria_inbox/archive/test-term.md +0 -110
  261. md_processing/dr_egeria_inbox/cat_test.md +0 -100
  262. md_processing/dr_egeria_inbox/collections.md +0 -39
  263. md_processing/dr_egeria_inbox/data_designer_debug.log +0 -6
  264. md_processing/dr_egeria_inbox/data_designer_out.md +0 -60
  265. md_processing/dr_egeria_inbox/data_designer_search_test.md +0 -11
  266. md_processing/dr_egeria_inbox/data_field.md +0 -54
  267. md_processing/dr_egeria_inbox/data_spec.md +0 -77
  268. md_processing/dr_egeria_inbox/data_spec_test.md +0 -2406
  269. md_processing/dr_egeria_inbox/data_test.md +0 -179
  270. md_processing/dr_egeria_inbox/data_test2.md +0 -429
  271. md_processing/dr_egeria_inbox/data_test3.md +0 -462
  272. md_processing/dr_egeria_inbox/dr_egeria_data_designer_1.md +0 -124
  273. md_processing/dr_egeria_inbox/dr_egeria_intro_categories.md +0 -168
  274. md_processing/dr_egeria_inbox/dr_egeria_intro_part1.md +0 -280
  275. md_processing/dr_egeria_inbox/dr_egeria_intro_part2.md +0 -318
  276. md_processing/dr_egeria_inbox/dr_egeria_intro_part3.md +0 -1073
  277. md_processing/dr_egeria_inbox/dr_egeria_isc1.md +0 -44
  278. md_processing/dr_egeria_inbox/generated_help_report.md +0 -9
  279. md_processing/dr_egeria_inbox/glossary_creation_experiment.ipynb +0 -341
  280. md_processing/dr_egeria_inbox/glossary_list.md +0 -5
  281. md_processing/dr_egeria_inbox/glossary_search_test.md +0 -40
  282. md_processing/dr_egeria_inbox/glossary_test1.md +0 -324
  283. md_processing/dr_egeria_inbox/gov_def.md +0 -482
  284. md_processing/dr_egeria_inbox/gov_def2.md +0 -447
  285. md_processing/dr_egeria_inbox/img.png +0 -0
  286. md_processing/dr_egeria_inbox/product.md +0 -211
  287. md_processing/dr_egeria_inbox/rel.md +0 -8
  288. md_processing/dr_egeria_inbox/sb.md +0 -119
  289. md_processing/dr_egeria_inbox/solution-components.md +0 -136
  290. md_processing/dr_egeria_inbox/solution_blueprints.md +0 -118
  291. md_processing/dr_egeria_inbox/synonym_test.md +0 -42
  292. md_processing/dr_egeria_inbox/t2.md +0 -268
  293. md_processing/dr_egeria_outbox/.obsidian/app.json +0 -1
  294. md_processing/dr_egeria_outbox/.obsidian/appearance.json +0 -1
  295. md_processing/dr_egeria_outbox/.obsidian/community-plugins.json +0 -6
  296. md_processing/dr_egeria_outbox/.obsidian/core-plugins.json +0 -31
  297. md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/data.json +0 -10
  298. md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/main.js +0 -4459
  299. md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/manifest.json +0 -10
  300. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/data.json +0 -3
  301. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/main.js +0 -153
  302. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/manifest.json +0 -11
  303. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/styles.css +0 -1
  304. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/main.js +0 -500
  305. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/manifest.json +0 -12
  306. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/styles.css +0 -1
  307. md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/main.js +0 -37
  308. md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/manifest.json +0 -11
  309. md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/styles.css +0 -220
  310. md_processing/dr_egeria_outbox/.obsidian/types.json +0 -28
  311. md_processing/dr_egeria_outbox/.obsidian/workspace.json +0 -220
  312. md_processing/dr_egeria_outbox/Untitled.canvas +0 -1
  313. md_processing/dr_egeria_outbox/friday/processed-2025-08-22 21:22-dr_egeria_intro_part1.md +0 -312
  314. md_processing/dr_egeria_outbox/friday/processed-2025-08-22 21:23-dr_egeria_intro_part1.md +0 -265
  315. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:06-dr_egeria_intro_part1.md +0 -230
  316. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:30-dr_egeria_intro_part1.md +0 -296
  317. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:31-dr_egeria_intro_part1.md +0 -253
  318. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 16:08-dr_egeria_intro_part2.md +0 -343
  319. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 16:12-dr_egeria_intro_part2.md +0 -343
  320. md_processing/dr_egeria_outbox/monday/processed-2025-08-19 07:05-product.md +0 -426
  321. md_processing/dr_egeria_outbox/monday/processed-2025-08-19 07:56-product.md +0 -212
  322. md_processing/dr_egeria_outbox/monday/processed-2025-08-19 09:43-product.md +0 -201
  323. md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 14:55-product.md +0 -77
  324. md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 15:05-product.md +0 -75
  325. md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 15:11-product.md +0 -74
  326. md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 20:40-collections.md +0 -49
  327. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 15:00-Derive-Dr-Gov-Defs.md +0 -719
  328. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:13-Derive-Dr-Gov-Defs.md +0 -41
  329. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:14-Derive-Dr-Gov-Defs.md +0 -33
  330. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:50-Derive-Dr-Gov-Defs.md +0 -192
  331. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 22:08-gov_def2.md +0 -486
  332. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 22:10-gov_def2.md +0 -486
  333. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 08:53-gov_def2.md +0 -486
  334. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 08:54-gov_def2.md +0 -486
  335. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:03-gov_def2.md +0 -486
  336. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:06-gov_def2.md +0 -486
  337. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:10-gov_def2.md +0 -486
  338. md_processing/dr_egeria_outbox/tuesday/processed-2025-07-16 19:15-gov_def2.md +0 -527
  339. md_processing/dr_egeria_outbox/tuesday/processed-2025-07-17 12:08-gov_def2.md +0 -527
  340. md_processing/dr_egeria_outbox/tuesday/processed-2025-07-17 14:27-gov_def2.md +0 -485
  341. md_processing/dr_egeria_outbox/tuesday/processed-2025-08-19 10:55-product.md +0 -209
  342. md_processing/family_docs/Data Designer/Create_Data_Class.md +0 -164
  343. md_processing/family_docs/Data Designer/Create_Data_Dictionary.md +0 -30
  344. md_processing/family_docs/Data Designer/Create_Data_Field.md +0 -162
  345. md_processing/family_docs/Data Designer/Create_Data_Specification.md +0 -36
  346. md_processing/family_docs/Data Designer/Create_Data_Structure.md +0 -38
  347. md_processing/family_docs/Data Designer/View_Data_Classes.md +0 -78
  348. md_processing/family_docs/Data Designer/View_Data_Dictionaries.md +0 -78
  349. md_processing/family_docs/Data Designer/View_Data_Fields.md +0 -78
  350. md_processing/family_docs/Data Designer/View_Data_Specifications.md +0 -78
  351. md_processing/family_docs/Data Designer/View_Data_Structures.md +0 -78
  352. md_processing/family_docs/Data Designer.md +0 -842
  353. md_processing/family_docs/Digital Product Manager/Add_Member->Collection.md +0 -42
  354. md_processing/family_docs/Digital Product Manager/Attach_Collection->Resource.md +0 -36
  355. md_processing/family_docs/Digital Product Manager/Create_Agreement.md +0 -96
  356. md_processing/family_docs/Digital Product Manager/Create_Data_Sharing_Agreement.md +0 -72
  357. md_processing/family_docs/Digital Product Manager/Create_DigitalSubscription.md +0 -102
  358. md_processing/family_docs/Digital Product Manager/Create_Digital_Product.md +0 -134
  359. md_processing/family_docs/Digital Product Manager/Link_Agreement_Items.md +0 -60
  360. md_processing/family_docs/Digital Product Manager/Link_Contracts.md +0 -26
  361. md_processing/family_docs/Digital Product Manager/Link_Digital_Product_-_Digital_Product.md +0 -30
  362. md_processing/family_docs/Digital Product Manager/Link_Subscribers.md +0 -48
  363. md_processing/family_docs/Digital Product Manager.md +0 -668
  364. md_processing/family_docs/Glossary/Attach_Category_Parent.md +0 -18
  365. md_processing/family_docs/Glossary/Attach_Term-Term_Relationship.md +0 -26
  366. md_processing/family_docs/Glossary/Create_Category.md +0 -38
  367. md_processing/family_docs/Glossary/Create_Glossary.md +0 -42
  368. md_processing/family_docs/Glossary/Create_Term.md +0 -70
  369. md_processing/family_docs/Glossary.md +0 -206
  370. md_processing/family_docs/Governance Officer/Create_Business_Imperative.md +0 -106
  371. md_processing/family_docs/Governance Officer/Create_Certification_Type.md +0 -112
  372. md_processing/family_docs/Governance Officer/Create_Governance_Approach.md +0 -114
  373. md_processing/family_docs/Governance Officer/Create_Governance_Obligation.md +0 -114
  374. md_processing/family_docs/Governance Officer/Create_Governance_Principle.md +0 -114
  375. md_processing/family_docs/Governance Officer/Create_Governance_Procedure.md +0 -128
  376. md_processing/family_docs/Governance Officer/Create_Governance_Process.md +0 -122
  377. md_processing/family_docs/Governance Officer/Create_Governance_Processing_Purpose.md +0 -106
  378. md_processing/family_docs/Governance Officer/Create_Governance_Responsibility.md +0 -122
  379. md_processing/family_docs/Governance Officer/Create_Governance_Rule.md +0 -122
  380. md_processing/family_docs/Governance Officer/Create_Governance_Strategy.md +0 -106
  381. md_processing/family_docs/Governance Officer/Create_License_Type.md +0 -112
  382. md_processing/family_docs/Governance Officer/Create_Naming_Standard_Rule.md +0 -122
  383. md_processing/family_docs/Governance Officer/Create_Regulation_Article.md +0 -106
  384. md_processing/family_docs/Governance Officer/Create_Regulation_Definition.md +0 -118
  385. md_processing/family_docs/Governance Officer/Create_Security_Access_Control.md +0 -114
  386. md_processing/family_docs/Governance Officer/Create_Security_Group.md +0 -120
  387. md_processing/family_docs/Governance Officer/Create_Service_Level_Objectives.md +0 -122
  388. md_processing/family_docs/Governance Officer/Create_Threat_Definition.md +0 -106
  389. md_processing/family_docs/Governance Officer/Link_Governance_Controls.md +0 -32
  390. md_processing/family_docs/Governance Officer/Link_Governance_Drivers.md +0 -32
  391. md_processing/family_docs/Governance Officer/Link_Governance_Policies.md +0 -32
  392. md_processing/family_docs/Governance Officer/View_Governance_Definitions.md +0 -82
  393. md_processing/family_docs/Governance Officer.md +0 -2412
  394. md_processing/family_docs/Solution Architect/Create_Information_Supply_Chain.md +0 -70
  395. md_processing/family_docs/Solution Architect/Create_Solution_Blueprint.md +0 -44
  396. md_processing/family_docs/Solution Architect/Create_Solution_Component.md +0 -96
  397. md_processing/family_docs/Solution Architect/Create_Solution_Role.md +0 -66
  398. md_processing/family_docs/Solution Architect/Link_Information_Supply_Chain_Peers.md +0 -32
  399. md_processing/family_docs/Solution Architect/Link_Solution_Component_Peers.md +0 -32
  400. md_processing/family_docs/Solution Architect/View_Information_Supply_Chains.md +0 -32
  401. md_processing/family_docs/Solution Architect/View_Solution_Blueprints.md +0 -32
  402. md_processing/family_docs/Solution Architect/View_Solution_Components.md +0 -32
  403. md_processing/family_docs/Solution Architect/View_Solution_Roles.md +0 -32
  404. md_processing/family_docs/Solution Architect.md +0 -490
  405. md_processing/md_processing_utils/debug_log +0 -574
  406. md_processing/md_processing_utils/debug_log.log +0 -0
  407. md_processing/md_processing_utils/dr-egeria-help-2025-07-17T17:22:09.md +0 -2065
  408. md_processing/md_processing_utils/generated_help_terms.md +0 -842
  409. pyegeria/.DS_Store +0 -0
  410. pyegeria/README.md +0 -35
  411. pyegeria/_client_new.py +0 -1102
  412. pyegeria/_output_formats.py +0 -730
  413. pyegeria/asset_catalog_omvs.py +0 -864
  414. pyegeria/automated_curation_omvs.py +0 -3765
  415. pyegeria/config.py +0 -523
  416. pyegeria/egeria_my_client.py +0 -91
  417. pyegeria/feedback_manager_omvs.py +0 -4573
  418. pyegeria/load_config_orig.py +0 -218
  419. pyegeria/md_processing_helpers.py +0 -58
  420. pyegeria/md_processing_utils_orig.py +0 -1103
  421. pyegeria/metadata_explorer_omvs.py +0 -2326
  422. pyegeria/my_profile_omvs.py +0 -1022
  423. pyegeria/project_manager.py +0 -1591
  424. pyegeria/registered_info.py +0 -167
  425. pyegeria/template_manager_omvs.py +0 -1414
  426. pyegeria/utils.py +0 -256
  427. pyegeria-5.4.0.28.dist-info/METADATA +0 -77
  428. pyegeria-5.4.0.28.dist-info/RECORD +0 -343
  429. pyegeria-5.4.0.28.dist-info/entry_points.txt +0 -105
  430. /commands/cat/debug_log.log → /pyegeria/deprecated/__init__.py +0 -0
  431. /pyegeria/{_exceptions.py → deprecated/_exceptions.py} +0 -0
  432. /pyegeria/{collection_models.py → models/collection_models.py} +0 -0
  433. {pyegeria-5.4.0.28.dist-info → pyegeria-5.5.3.3.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,2736 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+ This module provides access to the Asset Maker OMVS module.
6
+ The Asset Maker OMVS provides APIs for supporting the creation and editing of assets.
7
+
8
+ """
9
+
10
+ import asyncio
11
+ from typing import Any, Optional
12
+ from pyegeria.core._server_client import ServerClient
13
+ from pyegeria.core._globals import max_paging_size, NO_ELEMENTS_FOUND, NO_GUID_RETURNED
14
+ from pyegeria.core.config import settings as app_settings
15
+ from pyegeria.models import (
16
+ GetRequestBody,
17
+ SearchStringRequestBody,
18
+ FilterRequestBody,
19
+ NewElementRequestBody,
20
+ ReferenceableProperties,
21
+ TemplateRequestBody,
22
+ UpdateElementRequestBody,
23
+ DeleteElementRequestBody,
24
+ NewRelationshipRequestBody,
25
+ UpdateRelationshipRequestBody,
26
+ DeleteRelationshipRequestBody,
27
+ ContentStatusSearchString,
28
+ ContentStatusFilterRequestBody,
29
+ ActivityStatusSearchString,
30
+ ActivityStatusFilterRequestBody,
31
+ ActivityStatusRequestBody,
32
+ ActionRequestBody,
33
+ DeploymentStatusSearchString,
34
+ DeploymentStatusFilterRequestBody,
35
+ )
36
+ from pyegeria.core.utils import dynamic_catch
37
+
38
+ EGERIA_LOCAL_QUALIFIER = app_settings.User_Profile.egeria_local_qualifier
39
+
40
+
41
+ class AssetProperties(ReferenceableProperties):
42
+ """Properties for Asset elements"""
43
+ pass
44
+
45
+
46
+ class CatalogTargetProperties(ReferenceableProperties):
47
+ """Properties for Catalog Target relationships"""
48
+ catalogTargetName: str | None = None
49
+ metadataSourceQualifiedName: str | None = None
50
+ templates: dict | None = None
51
+ configurationProperties: dict | None = None
52
+
53
+
54
+ class AssetMaker(ServerClient):
55
+ """AssetMaker is a class that extends the ServerClient class. The Asset Maker OMVS provides APIs for
56
+ supporting the creation and editing of assets.
57
+
58
+ Attributes:
59
+
60
+ view_server: str
61
+ The name of the View Server to connect to.
62
+ platform_url : str
63
+ URL of the server platform to connect to
64
+ user_id : str
65
+ The identity of the user calling the method - this sets a
66
+ default optionally used by the methods when the user
67
+ doesn't pass the user_id on a method call.
68
+ user_pwd: str
69
+ The password associated with the user_id. Defaults to None
70
+
71
+ """
72
+
73
+ def __init__(
74
+ self,
75
+ view_server: str,
76
+ platform_url: str,
77
+ user_id: str | None = None,
78
+ user_pwd: str | None = None,
79
+ token: str | None = None,
80
+ ):
81
+ self.view_server = view_server
82
+ self.platform_url = platform_url
83
+ self.user_id = user_id
84
+ self.user_pwd = user_pwd
85
+
86
+ ServerClient.__init__(
87
+ self, view_server, platform_url, user_id=user_id, user_pwd=user_pwd, token=token
88
+ )
89
+ self.asset_command_root = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/asset-maker"
90
+ self.curation_command_root = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/automated-curation"
91
+
92
+ #
93
+ # Asset Management Methods
94
+ #
95
+
96
+ @dynamic_catch
97
+ async def _async_create_asset(self, asset_type: list[str]=None, body: dict | NewElementRequestBody | None = None) -> str:
98
+ """Create an asset. Async version.
99
+
100
+ Parameters
101
+ ----------
102
+ asset_type: [str], optional
103
+ The type of asset to create. If not provided, a generic asset type will be used.
104
+ body: dict | NewElementRequestBody, optional
105
+ A dict or NewElementRequestBody representing the details of the asset to create.
106
+
107
+ Returns
108
+ -------
109
+ str - the guid of the created asset
110
+
111
+ Raises
112
+ ------
113
+ PyegeriaException
114
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
115
+ Egeria errors.
116
+ ValidationError
117
+ Pydantic validation errors are raised if the body does not conform to the NewElementRequestBody.
118
+
119
+ Notes
120
+ -----
121
+ See: https://egeria-project.org/concepts/asset
122
+
123
+ Sample body:
124
+ {
125
+ "class" : "NewElementRequestBody",
126
+ "anchorGUID" : "add guid here",
127
+ "isOwnAnchor": false,
128
+ "parentGUID": "add guid here",
129
+ "parentRelationshipTypeName": "add type name here",
130
+ "parentRelationshipProperties": {
131
+ "class": "RelationshipElementProperties",
132
+ "propertyValueMap" : {
133
+ "description" : {
134
+ "class": "PrimitiveTypePropertyValue",
135
+ "typeName": "string",
136
+ "primitiveValue" : "New description"
137
+ }
138
+ }
139
+ },
140
+ "parentAtEnd1": false,
141
+ "properties": {
142
+ "class" : "AssetProperties",
143
+ "typeName" : "enter the type of the element",
144
+ "qualifiedName": "add unique name here",
145
+ "displayName": "add short name here",
146
+ "description": "add description here",
147
+ "additionalProperties": {
148
+ "property1" : "propertyValue1",
149
+ "property2" : "propertyValue2"
150
+ },
151
+ "extendedProperties": {
152
+ "property1" : "propertyValue1",
153
+ "property2" : "propertyValue2"
154
+ },
155
+ "effectiveFrom": "2024-01-01T00:00:00.000+00:00",
156
+ "effectiveTo": "2024-12-31T23:59:59.999+00:00"
157
+ },
158
+ "externalSourceGUID": "add guid here",
159
+ "externalSourceName": "add qualified name here",
160
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
161
+ "forLineage" : false,
162
+ "forDuplicateProcessing" : false
163
+ }
164
+ """
165
+ return await super()._async_create_asset(asset_type, body)
166
+
167
+ @dynamic_catch
168
+ def create_asset(self, asset_type:list[str]=None, body: dict | NewElementRequestBody | None = None) -> str:
169
+ """Create an asset.
170
+
171
+ Parameters
172
+ ----------
173
+ asset_type: [str], optional
174
+ The type of asset to create. If not provided, a generic asset type will be used.
175
+ body: dict | NewElementRequestBody, optional
176
+ A dict or NewElementRequestBody representing the details of the asset to create.
177
+
178
+ Returns
179
+ -------
180
+ str - the guid of the created asset
181
+
182
+ Raises
183
+ ------
184
+ PyegeriaException
185
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
186
+ Egeria errors.
187
+ ValidationError
188
+ Pydantic validation errors are raised if the body does not conform to the NewElementRequestBody.
189
+
190
+ Notes
191
+ -----
192
+ See: https://egeria-project.org/concepts/asset
193
+
194
+ Sample body:
195
+ {
196
+ "class" : "NewElementRequestBody",
197
+ "anchorGUID" : "add guid here",
198
+ "isOwnAnchor": false,
199
+ "parentGUID": "add guid here",
200
+ "parentRelationshipTypeName": "add type name here",
201
+ "parentRelationshipProperties": {
202
+ "class": "RelationshipElementProperties",
203
+ "propertyValueMap" : {
204
+ "description" : {
205
+ "class": "PrimitiveTypePropertyValue",
206
+ "typeName": "string",
207
+ "primitiveValue" : "New description"
208
+ }
209
+ }
210
+ },
211
+ "parentAtEnd1": false,
212
+ "properties": {
213
+ "class" : "AssetProperties",
214
+ "typeName" : "enter the type of the element",
215
+ "qualifiedName": "add unique name here",
216
+ "displayName": "add short name here",
217
+ "description": "add description here",
218
+ "additionalProperties": {
219
+ "property1" : "propertyValue1",
220
+ "property2" : "propertyValue2"
221
+ },
222
+ "extendedProperties": {
223
+ "property1" : "propertyValue1",
224
+ "property2" : "propertyValue2"
225
+ },
226
+ "effectiveFrom": "2024-01-01T00:00:00.000+00:00",
227
+ "effectiveTo": "2024-12-31T23:59:59.999+00:00"
228
+ },
229
+ "externalSourceGUID": "add guid here",
230
+ "externalSourceName": "add qualified name here",
231
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
232
+ "forLineage" : false,
233
+ "forDuplicateProcessing" : false
234
+ }
235
+ """
236
+ return super().create_asset(asset_type, body)
237
+
238
+ @dynamic_catch
239
+ async def _async_create_asset_from_template(
240
+ self, body: dict | TemplateRequestBody | None = None
241
+ ) -> str:
242
+ """Create a new metadata element to represent an asset using an existing metadata element as a template.
243
+ The template defines additional classifications and relationships that should be added to the new element.
244
+ Async version.
245
+
246
+ Parameters
247
+ ----------
248
+ body: dict | TemplateRequestBody
249
+ A dict or TemplateRequestBody representing the template details.
250
+
251
+ Returns
252
+ -------
253
+ str - the guid of the created asset
254
+
255
+ Raises
256
+ ------
257
+ PyegeriaException
258
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
259
+ Egeria errors.
260
+ ValidationError
261
+ Pydantic validation errors are raised if the body does not conform to the TemplateRequestBody.
262
+
263
+ Notes
264
+ -----
265
+ Sample body:
266
+ {
267
+ "class" : "TemplateRequestBody",
268
+ "anchorGUID" : "add guid here",
269
+ "isOwnAnchor": false,
270
+ "parentGUID": "add guid here",
271
+ "parentRelationshipTypeName": "add type name here",
272
+ "parentRelationshipProperties": {
273
+ "class": "RelationshipElementProperties",
274
+ "propertyValueMap" : {
275
+ "description" : {
276
+ "class": "PrimitiveTypePropertyValue",
277
+ "typeName": "string",
278
+ "primitiveValue" : "New description"
279
+ }
280
+ }
281
+ },
282
+ "parentAtEnd1": false,
283
+ "templateGUID": "add guid here",
284
+ "replacementProperties": {
285
+ "class": "ElementProperties",
286
+ "propertyValueMap" : {
287
+ "description" : {
288
+ "class": "PrimitiveTypePropertyValue",
289
+ "typeName": "string",
290
+ "primitiveValue" : "New description"
291
+ }
292
+ }
293
+ },
294
+ "placeholderPropertyValues": {
295
+ "placeholder1" : "propertyValue1",
296
+ "placeholder2" : "propertyValue2"
297
+ },
298
+ "externalSourceGUID": "add guid here",
299
+ "externalSourceName": "add qualified name here",
300
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
301
+ "forLineage" : false,
302
+ "forDuplicateProcessing" : false
303
+ }
304
+ """
305
+ return await super()._async_create_asset_from_template(body)
306
+
307
+ @dynamic_catch
308
+ def create_asset_from_template(self, body: dict | TemplateRequestBody | None = None) -> str:
309
+ """Create a new metadata element to represent an asset using an existing metadata element as a template.
310
+ The template defines additional classifications and relationships that should be added to the new element.
311
+
312
+ Parameters
313
+ ----------
314
+ body: dict | TemplateRequestBody
315
+ A dict or TemplateRequestBody representing the template details.
316
+
317
+ Returns
318
+ -------
319
+ str - the guid of the created asset
320
+
321
+ Raises
322
+ ------
323
+ PyegeriaException
324
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
325
+ Egeria errors.
326
+ ValidationError
327
+ Pydantic validation errors are raised if the body does not conform to the TemplateRequestBody.
328
+
329
+ Notes
330
+ -----
331
+ Sample body:
332
+ {
333
+ "class" : "TemplateRequestBody",
334
+ "anchorGUID" : "add guid here",
335
+ "isOwnAnchor": false,
336
+ "parentGUID": "add guid here",
337
+ "parentRelationshipTypeName": "add type name here",
338
+ "parentRelationshipProperties": {
339
+ "class": "RelationshipElementProperties",
340
+ "propertyValueMap" : {
341
+ "description" : {
342
+ "class": "PrimitiveTypePropertyValue",
343
+ "typeName": "string",
344
+ "primitiveValue" : "New description"
345
+ }
346
+ }
347
+ },
348
+ "parentAtEnd1": false,
349
+ "templateGUID": "add guid here",
350
+ "replacementProperties": {
351
+ "class": "ElementProperties",
352
+ "propertyValueMap" : {
353
+ "description" : {
354
+ "class": "PrimitiveTypePropertyValue",
355
+ "typeName": "string",
356
+ "primitiveValue" : "New description"
357
+ }
358
+ }
359
+ },
360
+ "placeholderPropertyValues": {
361
+ "placeholder1" : "propertyValue1",
362
+ "placeholder2" : "propertyValue2"
363
+ },
364
+ "externalSourceGUID": "add guid here",
365
+ "externalSourceName": "add qualified name here",
366
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
367
+ "forLineage" : false,
368
+ "forDuplicateProcessing" : false
369
+ }
370
+ """
371
+ return super().create_asset_from_template(body)
372
+
373
+ @dynamic_catch
374
+ async def _async_update_asset(
375
+ self, asset_guid: str, body: dict | UpdateElementRequestBody | None = None
376
+ ) -> None:
377
+ """Update the properties of an asset. Async version.
378
+
379
+ Parameters
380
+ ----------
381
+ asset_guid: str
382
+ Unique identifier of the asset to update.
383
+ body: dict | UpdateElementRequestBody
384
+ A dict or UpdateElementRequestBody with the properties to update.
385
+
386
+ Returns
387
+ -------
388
+ None
389
+
390
+ Raises
391
+ ------
392
+ PyegeriaException
393
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
394
+ Egeria errors.
395
+ ValidationError
396
+ Pydantic validation errors are raised if the body does not conform to the UpdateElementRequestBody.
397
+
398
+ Notes
399
+ -----
400
+ Sample body:
401
+ {
402
+ "class" : "UpdateElementRequestBody",
403
+ "properties": {
404
+ "class" : "AssetProperties",
405
+ "typeName" : "enter the type of the element",
406
+ "qualifiedName": "add unique name here",
407
+ "displayName": "add short name here",
408
+ "description": "add description here",
409
+ "additionalProperties": {
410
+ "property1" : "propertyValue1",
411
+ "property2" : "propertyValue2"
412
+ },
413
+ "extendedProperties": {
414
+ "property1" : "propertyValue1",
415
+ "property2" : "propertyValue2"
416
+ }
417
+ },
418
+ "externalSourceGUID": "add guid here",
419
+ "externalSourceName": "add qualified name here",
420
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
421
+ "forLineage" : false,
422
+ "forDuplicateProcessing" : false
423
+ }
424
+ """
425
+ await super()._async_update_asset(asset_guid, body)
426
+
427
+ @dynamic_catch
428
+ def update_asset(
429
+ self, asset_guid: str, body: dict | UpdateElementRequestBody | None = None
430
+ ) -> None:
431
+ """Update the properties of an asset.
432
+
433
+ Parameters
434
+ ----------
435
+ asset_guid: str
436
+ Unique identifier of the asset to update.
437
+ body: dict | UpdateElementRequestBody
438
+ A dict or UpdateElementRequestBody with the properties to update.
439
+
440
+ Returns
441
+ -------
442
+ None
443
+
444
+ Raises
445
+ ------
446
+ PyegeriaException
447
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
448
+ Egeria errors.
449
+ ValidationError
450
+ Pydantic validation errors are raised if the body does not conform to the UpdateElementRequestBody.
451
+
452
+ Notes
453
+ -----
454
+ Sample body:
455
+ {
456
+ "class" : "UpdateElementRequestBody",
457
+ "properties": {
458
+ "class" : "AssetProperties",
459
+ "typeName" : "enter the type of the element",
460
+ "qualifiedName": "add unique name here",
461
+ "displayName": "add short name here",
462
+ "description": "add description here",
463
+ "additionalProperties": {
464
+ "property1" : "propertyValue1",
465
+ "property2" : "propertyValue2"
466
+ },
467
+ "extendedProperties": {
468
+ "property1" : "propertyValue1",
469
+ "property2" : "propertyValue2"
470
+ }
471
+ },
472
+ "externalSourceGUID": "add guid here",
473
+ "externalSourceName": "add qualified name here",
474
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
475
+ "forLineage" : false,
476
+ "forDuplicateProcessing" : false
477
+ }
478
+ """
479
+ super().update_asset(asset_guid, body)
480
+
481
+ @dynamic_catch
482
+ async def _async_delete_asset(
483
+ self, asset_guid: str, body: dict | DeleteElementRequestBody | None = None
484
+ ) -> None:
485
+ """Delete an asset. Async version.
486
+
487
+ Parameters
488
+ ----------
489
+ asset_guid: str
490
+ Unique identifier of the asset to delete.
491
+ body: dict | DeleteElementRequestBody, optional
492
+ Additional parameters for the delete operation.
493
+
494
+ Returns
495
+ -------
496
+ None
497
+
498
+ Raises
499
+ ------
500
+ PyegeriaException
501
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
502
+ Egeria errors.
503
+
504
+ Notes
505
+ -----
506
+ Sample body:
507
+ {
508
+ "class" : "DeleteElementRequestBody",
509
+ "externalSourceGUID": "add guid here",
510
+ "externalSourceName": "add qualified name here",
511
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
512
+ "forLineage" : false,
513
+ "forDuplicateProcessing" : false
514
+ }
515
+ """
516
+ await super()._async_delete_asset(asset_guid, body)
517
+
518
+ @dynamic_catch
519
+ def delete_asset(
520
+ self, asset_guid: str, body: dict | DeleteElementRequestBody | None = None
521
+ ) -> None:
522
+ """Delete an asset.
523
+
524
+ Parameters
525
+ ----------
526
+ asset_guid: str
527
+ Unique identifier of the asset to delete.
528
+ body: dict | DeleteElementRequestBody, optional
529
+ Additional parameters for the delete operation.
530
+
531
+ Returns
532
+ -------
533
+ None
534
+
535
+ Raises
536
+ ------
537
+ PyegeriaException
538
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
539
+ Egeria errors.
540
+
541
+ Notes
542
+ -----
543
+ Sample body:
544
+ {
545
+ "class" : "DeleteElementRequestBody",
546
+ "externalSourceGUID": "add guid here",
547
+ "externalSourceName": "add qualified name here",
548
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
549
+ "forLineage" : false,
550
+ "forDuplicateProcessing" : false
551
+ }
552
+ """
553
+ super().delete_asset(asset_guid, body)
554
+
555
+ @dynamic_catch
556
+ async def _async_get_assets_by_name(
557
+ self,
558
+ filter_string: str,
559
+ body: dict | FilterRequestBody | None = None,
560
+ start_from: int = 0,
561
+ page_size: int = 0,
562
+ output_format: str = "DICT",
563
+ report_spec: dict | str | None = None,
564
+ ) -> list | dict | str:
565
+ """Returns the list of assets with a particular name. Async version.
566
+
567
+ Parameters
568
+ ----------
569
+ filter_string: str
570
+ String to find in the asset properties.
571
+ body: dict | FilterRequestBody, optional
572
+ Additional filter parameters.
573
+ start_from: int, optional
574
+ Index of the first result to return. Default is 0.
575
+ page_size: int, optional
576
+ Maximum number of results to return. Default is None (server default).
577
+ output_format: str, optional
578
+ Format of the output. Default is "DICT".
579
+ report_spec: dict | str, optional
580
+ Specification for report formatting.
581
+
582
+ Returns
583
+ -------
584
+ list | dict | str
585
+ List of matching assets in the specified format.
586
+
587
+ Raises
588
+ ------
589
+ PyegeriaException
590
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
591
+ Egeria errors.
592
+
593
+ Notes
594
+ -----
595
+ Sample body:
596
+ {
597
+ "class" : "FilterRequestBody",
598
+ "filter" : "Add name here",
599
+ "startFrom" : 0,
600
+ "pageSize": 10,
601
+ "metadataElementTypeName": "GovernanceActionType",
602
+ "metadataElementSubtypeNames": [],
603
+ "skipRelationships": [],
604
+ "includeOnlyRelationships": [],
605
+ "relationshipsPageSize": 100,
606
+ "skipClassifiedElements": [],
607
+ "includeOnlyClassifiedElements": [],
608
+ "graphQueryDepth" : 10,
609
+ "asOfTime" : "2024-01-01T00:00:00.000+00:00",
610
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
611
+ "forLineage" : false,
612
+ "forDuplicateProcessing" : false,
613
+ "limitResultsByStatus" : ["ACTIVE"],
614
+ "sequencingOrder" : "PROPERTY_ASCENDING",
615
+ "sequencingProperty" : "qualifiedName"
616
+ }
617
+ """
618
+ url = f"{self.asset_command_root}/assets/by-name"
619
+ return await self._async_get_name_request(
620
+ url,
621
+ _type="Asset",
622
+ _gen_output=self._generate_referenceable_output,
623
+ filter_string=filter_string,
624
+ start_from=start_from,
625
+ page_size=page_size,
626
+ output_format=output_format,
627
+ report_spec=report_spec,
628
+ body=body,
629
+ )
630
+
631
+ @dynamic_catch
632
+ def get_assets_by_name(
633
+ self,
634
+ filter_string: str,
635
+ body: dict | FilterRequestBody | None = None,
636
+ start_from: int = 0,
637
+ page_size: int = 0,
638
+ output_format: str = "DICT",
639
+ report_spec: dict | str | None = None,
640
+ ) -> list | dict | str:
641
+ """Returns the list of assets with a particular name.
642
+
643
+ Parameters
644
+ ----------
645
+ filter_string: str
646
+ String to find in the asset properties.
647
+ body: dict | FilterRequestBody, optional
648
+ Additional filter parameters.
649
+ start_from: int, optional
650
+ Index of the first result to return. Default is 0.
651
+ page_size: int, optional
652
+ Maximum number of results to return. Default is None (server default).
653
+ output_format: str, optional
654
+ Format of the output. Default is "DICT".
655
+ report_spec: dict | str, optional
656
+ Specification for report formatting.
657
+
658
+ Returns
659
+ -------
660
+ list | dict | str
661
+ List of matching assets in the specified format.
662
+
663
+ Raises
664
+ ------
665
+ PyegeriaException
666
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
667
+ Egeria errors.
668
+
669
+ Notes
670
+ -----
671
+ Sample body:
672
+ {
673
+ "class" : "FilterRequestBody",
674
+ "filter" : "Add name here",
675
+ "startFrom" : 0,
676
+ "pageSize": 10,
677
+ "metadataElementTypeName": "GovernanceActionType",
678
+ "metadataElementSubtypeNames": [],
679
+ "skipRelationships": [],
680
+ "includeOnlyRelationships": [],
681
+ "relationshipsPageSize": 100,
682
+ "skipClassifiedElements": [],
683
+ "includeOnlyClassifiedElements": [],
684
+ "graphQueryDepth" : 10,
685
+ "asOfTime" : "2024-01-01T00:00:00.000+00:00",
686
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
687
+ "forLineage" : false,
688
+ "forDuplicateProcessing" : false,
689
+ "limitResultsByStatus" : ["ACTIVE"],
690
+ "sequencingOrder" : "PROPERTY_ASCENDING",
691
+ "sequencingProperty" : "qualifiedName"
692
+ }
693
+ """
694
+ loop = asyncio.get_event_loop()
695
+ return loop.run_until_complete(
696
+ self._async_get_assets_by_name(
697
+ filter_string, body, start_from, page_size, output_format, report_spec
698
+ )
699
+ )
700
+
701
+ @dynamic_catch
702
+ async def _async_find_assets(self, search_string: str = "*", starts_with: bool = False, ends_with: bool = False,
703
+ ignore_case: bool = True, anchor_domain: Optional[str] = None, metadata_element_type: Optional[str] = None,
704
+ metadata_element_subtypes: Optional[list[str]] = None, skip_relationships: Optional[list[str]] = None,
705
+ include_only_relationships: Optional[list[str]] = None,
706
+ skip_classified_elements: Optional[list[str]] = None,
707
+ include_only_classified_elements: Optional[list[str]] = None, graph_query_depth: int = 3,
708
+ governance_zone_filter: Optional[list[str]] = None, as_of_time: Optional[str] = None,
709
+ effective_time: Optional[str] = None, relationship_page_size: int = 0,
710
+ limit_results_by_status: Optional[list[str]] = None, sequencing_order: Optional[str] = None,
711
+ sequencing_property: Optional[str] = None, output_format: str = "DICT",
712
+ report_spec: dict | str | None = None, start_from: int = 0,
713
+ page_size: int = 0, property_names: Optional[list[str]] = None,
714
+ body: dict | SearchStringRequestBody | None = None) -> list | dict | str:
715
+ """Retrieve the list of asset metadata elements that contain the search string. Async version.
716
+
717
+ Parameters
718
+ ----------
719
+ search_string: str, optional
720
+ String to search for in asset properties. Default is "*".
721
+ starts_with: bool, optional
722
+ Whether to match only at the start. Default is False.
723
+ ends_with: bool, optional
724
+ Whether to match only at the end. Default is False.
725
+ ignore_case: bool, optional
726
+ Whether to ignore case in matching. Default is True.
727
+ start_from: int, optional
728
+ Index of the first result to return. Default is 0.
729
+ page_size: int, optional
730
+ Maximum number of results to return. Default is None (server default).
731
+ output_format: str, optional
732
+ Format of the output. Default is "DICT".
733
+ report_spec: dict | str, optional
734
+ Specification for report formatting.
735
+ body: dict | SearchStringRequestBody, optional
736
+ Additional search parameters.
737
+
738
+ Returns
739
+ -------
740
+ list | dict | str
741
+ List of matching assets in the specified format.
742
+
743
+ Raises
744
+ ------
745
+ PyegeriaException
746
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
747
+ Egeria errors.
748
+
749
+ Notes
750
+ -----
751
+ Sample body:
752
+ {
753
+ "class" : "SearchStringRequestBody",
754
+ "searchString": "xxx",
755
+ "metadataElementTypeName": "GovernanceActionType",
756
+ "metadataElementSubtypeNames": [],
757
+ "skipRelationships": [],
758
+ "includeOnlyRelationships": [],
759
+ "relationshipsPageSize": 100,
760
+ "skipClassifiedElements": [],
761
+ "includeOnlyClassifiedElements": [],
762
+ "graphQueryDepth" : 10,
763
+ "startsWith" : false,
764
+ "endsWith" : false,
765
+ "ignoreCase" : true,
766
+ "startFrom" : 0,
767
+ "pageSize": 0,
768
+ "asOfTime" : "2024-01-01T00:00:00.000+00:00",
769
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
770
+ "forLineage" : false,
771
+ "forDuplicateProcessing" : false,
772
+ "limitResultsByStatus" : ["ACTIVE"],
773
+ "sequencingOrder" : "PROPERTY_ASCENDING",
774
+ "sequencingProperty" : "qualifiedName"
775
+ }
776
+ """
777
+ return await super()._async_find_assets(search_string=search_string, starts_with=starts_with,
778
+ ends_with=ends_with, ignore_case=ignore_case,
779
+ anchor_domain=anchor_domain,
780
+ metadata_element_type=metadata_element_type,
781
+ metadata_element_subtypes=metadata_element_subtypes,
782
+ skip_relationships=skip_relationships,
783
+ include_only_relationships=include_only_relationships,
784
+ skip_classified_elements=skip_classified_elements,
785
+ include_only_classified_elements=include_only_classified_elements,
786
+ graph_query_depth=graph_query_depth,
787
+ governance_zone_filter=governance_zone_filter, as_of_time=as_of_time,
788
+ effective_time=effective_time,
789
+ relationship_page_size=relationship_page_size,
790
+ limit_results_by_status=limit_results_by_status,
791
+ sequencing_order=sequencing_order,
792
+ sequencing_property=sequencing_property, output_format=output_format,
793
+ report_spec=report_spec, start_from=start_from, page_size=page_size,
794
+ body=body)
795
+
796
+ @dynamic_catch
797
+ def find_assets(self, search_string: str = "*", starts_with: bool = False, ends_with: bool = False,
798
+ ignore_case: bool = True, anchor_domain: Optional[str] = None, metadata_element_type: Optional[str] = None,
799
+ metadata_element_subtypes: Optional[list[str]] = None, skip_relationships: Optional[list[str]] = None,
800
+ include_only_relationships: Optional[list[str]] = None, skip_classified_elements: Optional[list[str]] = None,
801
+ include_only_classified_elements: Optional[list[str]] = None, graph_query_depth: int = 3,
802
+ governance_zone_filter: Optional[list[str]] = None, as_of_time: Optional[str] = None, effective_time: Optional[str] = None,
803
+ relationship_page_size: int = 0, limit_results_by_status: Optional[list[str]] = None,
804
+ sequencing_order: Optional[str] = None, sequencing_property: Optional[str] = None, output_format: str = "DICT",
805
+ report_spec: dict | str | None = None, start_from: int = 0, page_size: int = 0,
806
+ property_names: Optional[list[str]] = None, body: dict | SearchStringRequestBody | None = None) -> list | dict | str:
807
+ """Retrieve the list of asset metadata elements that contain the search string.
808
+
809
+ Parameters
810
+ ----------
811
+ search_string: str, optional
812
+ String to search for in asset properties. Default is "*".
813
+ starts_with: bool, optional
814
+ Whether to match only at the start. Default is False.
815
+ ends_with: bool, optional
816
+ Whether to match only at the end. Default is False.
817
+ ignore_case: bool, optional
818
+ Whether to ignore case in matching. Default is True.
819
+ start_from: int, optional
820
+ Index of the first result to return. Default is 0.
821
+ page_size: int, optional
822
+ Maximum number of results to return. Default is None (server default).
823
+ output_format: str, optional
824
+ Format of the output. Default is "DICT".
825
+ report_spec: dict | str, optional
826
+ Specification for report formatting.
827
+ body: dict | SearchStringRequestBody, optional
828
+ Additional search parameters.
829
+
830
+ Returns
831
+ -------
832
+ list | dict | str
833
+ List of matching assets in the specified format.
834
+
835
+ Raises
836
+ ------
837
+ PyegeriaException
838
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
839
+ Egeria errors.
840
+
841
+ Notes
842
+ -----
843
+ Sample body:
844
+ {
845
+ "class" : "SearchStringRequestBody",
846
+ "searchString": "xxx",
847
+ "metadataElementTypeName": "GovernanceActionType",
848
+ "metadataElementSubtypeNames": [],
849
+ "skipRelationships": [],
850
+ "includeOnlyRelationships": [],
851
+ "relationshipsPageSize": 100,
852
+ "skipClassifiedElements": [],
853
+ "includeOnlyClassifiedElements": [],
854
+ "graphQueryDepth" : 10,
855
+ "startsWith" : false,
856
+ "endsWith" : false,
857
+ "ignoreCase" : true,
858
+ "startFrom" : 0,
859
+ "pageSize": 0,
860
+ "asOfTime" : "2024-01-01T00:00:00.000+00:00",
861
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
862
+ "forLineage" : false,
863
+ "forDuplicateProcessing" : false,
864
+ "limitResultsByStatus" : ["ACTIVE"],
865
+ "sequencingOrder" : "PROPERTY_ASCENDING",
866
+ "sequencingProperty" : "qualifiedName"
867
+ }
868
+ """
869
+ return super().find_assets(search_string=search_string, starts_with=starts_with, ends_with=ends_with,
870
+ ignore_case=ignore_case, anchor_domain=anchor_domain,
871
+ metadata_element_type=metadata_element_type,
872
+ metadata_element_subtypes=metadata_element_subtypes,
873
+ skip_relationships=skip_relationships,
874
+ include_only_relationships=include_only_relationships,
875
+ skip_classified_elements=skip_classified_elements,
876
+ include_only_classified_elements=include_only_classified_elements,
877
+ graph_query_depth=graph_query_depth, governance_zone_filter=governance_zone_filter,
878
+ as_of_time=as_of_time, effective_time=effective_time,
879
+ relationship_page_size=relationship_page_size,
880
+ limit_results_by_status=limit_results_by_status, sequencing_order=sequencing_order,
881
+ sequencing_property=sequencing_property, output_format=output_format,
882
+ report_spec=report_spec, start_from=start_from, page_size=page_size, body=body)
883
+
884
+ @dynamic_catch
885
+ async def _async_get_asset_by_guid(
886
+ self,
887
+ asset_guid: str,
888
+ body: dict | GetRequestBody | None = None,
889
+ output_format: str = "DICT",
890
+ report_spec: dict | str | None = None,
891
+ ) -> dict | str:
892
+ """Return the properties of a specific asset. Async version.
893
+
894
+ Parameters
895
+ ----------
896
+ asset_guid: str
897
+ Unique identifier of the asset.
898
+ body: dict | GetRequestBody, optional
899
+ Additional parameters for the request.
900
+ output_format: str, optional
901
+ Format of the output. Default is "DICT".
902
+ report_spec: dict | str, optional
903
+ Specification for report formatting.
904
+
905
+ Returns
906
+ -------
907
+ dict | str
908
+ Properties of the asset in the specified format.
909
+
910
+ Raises
911
+ ------
912
+ PyegeriaException
913
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
914
+ Egeria errors.
915
+
916
+ Notes
917
+ -----
918
+ Sample body:
919
+ {
920
+ "class" : "GetRequestBody",
921
+ "metadataElementTypeName": "",
922
+ "metadataElementSubtypeNames": [],
923
+ "skipRelationships": [],
924
+ "includeOnlyRelationships": [],
925
+ "relationshipsPageSize": 100,
926
+ "skipClassifiedElements": [],
927
+ "includeOnlyClassifiedElements": [],
928
+ "graphQueryDepth" : 10,
929
+ "asOfTime" : "2024-01-01T00:00:00.000+00:00",
930
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
931
+ "forLineage" : false,
932
+ "forDuplicateProcessing" : false
933
+ }
934
+ """
935
+ url = f"{self.asset_command_root}/assets/{asset_guid}/retrieve"
936
+ return await self._async_get_guid_request(
937
+ url,
938
+ _type="Asset",
939
+ _gen_output=self._generate_referenceable_output,
940
+ output_format=output_format,
941
+ report_spec=report_spec,
942
+ body=body,
943
+ )
944
+
945
+ @dynamic_catch
946
+ def get_asset_by_guid(
947
+ self,
948
+ asset_guid: str,
949
+ body: dict | GetRequestBody | None = None,
950
+ output_format: str = "DICT",
951
+ report_spec: dict | str | None = None,
952
+ ) -> dict | str:
953
+ """Return the properties of a specific asset.
954
+
955
+ Parameters
956
+ ----------
957
+ asset_guid: str
958
+ Unique identifier of the asset.
959
+ body: dict | GetRequestBody, optional
960
+ Additional parameters for the request.
961
+ output_format: str, optional
962
+ Format of the output. Default is "DICT".
963
+ report_spec: dict | str, optional
964
+ Specification for report formatting.
965
+
966
+ Returns
967
+ -------
968
+ dict | str
969
+ Properties of the asset in the specified format.
970
+
971
+ Raises
972
+ ------
973
+ PyegeriaException
974
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
975
+ Egeria errors.
976
+
977
+ Notes
978
+ -----
979
+ Sample body:
980
+ {
981
+ "class" : "GetRequestBody",
982
+ "metadataElementTypeName": "",
983
+ "metadataElementSubtypeNames": [],
984
+ "skipRelationships": [],
985
+ "includeOnlyRelationships": [],
986
+ "relationshipsPageSize": 100,
987
+ "skipClassifiedElements": [],
988
+ "includeOnlyClassifiedElements": [],
989
+ "graphQueryDepth" : 10,
990
+ "asOfTime" : "2024-01-01T00:00:00.000+00:00",
991
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
992
+ "forLineage" : false,
993
+ "forDuplicateProcessing" : false
994
+ }
995
+ """
996
+ loop = asyncio.get_event_loop()
997
+ return loop.run_until_complete(
998
+ self._async_get_asset_by_guid(asset_guid, body, output_format, report_spec)
999
+ )
1000
+
1001
+ #
1002
+ # Catalog Target Management Methods
1003
+ #
1004
+
1005
+ @dynamic_catch
1006
+ async def _async_add_catalog_target(
1007
+ self,
1008
+ integration_connector_guid: str,
1009
+ metadata_element_guid: str,
1010
+ body: dict | NewRelationshipRequestBody | None = None,
1011
+ ) -> str:
1012
+ """Add a catalog target to an integration connector. Async version.
1013
+
1014
+ Parameters
1015
+ ----------
1016
+ integration_connector_guid: str
1017
+ Unique identifier of the integration connector.
1018
+ metadata_element_guid: str
1019
+ Unique identifier of the metadata element to be cataloged.
1020
+ body: dict | NewRelationshipRequestBody, optional
1021
+ Properties for the catalog target relationship.
1022
+
1023
+ Returns
1024
+ -------
1025
+ str
1026
+ GUID of the created catalog target relationship.
1027
+
1028
+ Raises
1029
+ ------
1030
+ PyegeriaException
1031
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
1032
+ Egeria errors.
1033
+
1034
+ Notes
1035
+ -----
1036
+ See: https://egeria-project.org/concepts/integration-connector/
1037
+
1038
+ Sample body:
1039
+ {
1040
+ "class" : "NewRelationshipRequestBody",
1041
+ "externalSourceGUID": "add guid here",
1042
+ "externalSourceName": "add qualified name here",
1043
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
1044
+ "forLineage" : false,
1045
+ "forDuplicateProcessing" : false,
1046
+ "properties": {
1047
+ "class": "CatalogTargetProperties",
1048
+ "catalogTargetName" : "Freddy",
1049
+ "metadataSourceQualifiedName" : "",
1050
+ "templates" : {
1051
+ "templateName1" : "template1GUID",
1052
+ "templateName2" : "template2GUID"
1053
+ },
1054
+ "configurationProperties" : {
1055
+ "propertyName1" : "propertyValue1",
1056
+ "propertyName2" : "propertyValue2"
1057
+ },
1058
+ "effectiveFrom": "2024-01-01T00:00:00.000+00:00",
1059
+ "effectiveTo": "2024-12-31T23:59:59.999+00:00"
1060
+ }
1061
+ }
1062
+ """
1063
+ url = f"{self.curation_command_root}/integration-connectors/{integration_connector_guid}/catalog-targets/{metadata_element_guid}"
1064
+ await self._async_new_relationship_request(url, ["CatalogTargetProperties"], body)
1065
+ return "Relationship created" # The base method doesn't return a GUID for relationships
1066
+
1067
+ @dynamic_catch
1068
+ def add_catalog_target(
1069
+ self,
1070
+ integration_connector_guid: str,
1071
+ metadata_element_guid: str,
1072
+ body: dict | NewRelationshipRequestBody | None = None,
1073
+ ) -> str:
1074
+ """Add a catalog target to an integration connector.
1075
+
1076
+ Parameters
1077
+ ----------
1078
+ integration_connector_guid: str
1079
+ Unique identifier of the integration connector.
1080
+ metadata_element_guid: str
1081
+ Unique identifier of the metadata element to be cataloged.
1082
+ body: dict | NewRelationshipRequestBody, optional
1083
+ Properties for the catalog target relationship.
1084
+
1085
+ Returns
1086
+ -------
1087
+ str
1088
+ GUID of the created catalog target relationship.
1089
+
1090
+ Raises
1091
+ ------
1092
+ PyegeriaException
1093
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
1094
+ Egeria errors.
1095
+
1096
+ Notes
1097
+ -----
1098
+ See: https://egeria-project.org/concepts/integration-connector/
1099
+
1100
+ Sample body:
1101
+ {
1102
+ "class" : "NewRelationshipRequestBody",
1103
+ "externalSourceGUID": "add guid here",
1104
+ "externalSourceName": "add qualified name here",
1105
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
1106
+ "forLineage" : false,
1107
+ "forDuplicateProcessing" : false,
1108
+ "properties": {
1109
+ "class": "CatalogTargetProperties",
1110
+ "catalogTargetName" : "Freddy",
1111
+ "metadataSourceQualifiedName" : "",
1112
+ "templates" : {
1113
+ "templateName1" : "template1GUID",
1114
+ "templateName2" : "template2GUID"
1115
+ },
1116
+ "configurationProperties" : {
1117
+ "propertyName1" : "propertyValue1",
1118
+ "propertyName2" : "propertyValue2"
1119
+ },
1120
+ "effectiveFrom": "2024-01-01T00:00:00.000+00:00",
1121
+ "effectiveTo": "2024-12-31T23:59:59.999+00:00"
1122
+ }
1123
+ }
1124
+ """
1125
+ loop = asyncio.get_event_loop()
1126
+ return loop.run_until_complete(
1127
+ self._async_add_catalog_target(
1128
+ integration_connector_guid, metadata_element_guid, body
1129
+ )
1130
+ )
1131
+
1132
+ @dynamic_catch
1133
+ async def _async_update_catalog_target(
1134
+ self,
1135
+ relationship_guid: str,
1136
+ body: dict | UpdateRelationshipRequestBody | None = None,
1137
+ ) -> None:
1138
+ """Update a catalog target for an integration connector. Async version.
1139
+
1140
+ Parameters
1141
+ ----------
1142
+ relationship_guid: str
1143
+ Unique identifier of the catalog target relationship.
1144
+ body: dict | UpdateRelationshipRequestBody
1145
+ Updated properties for the catalog target.
1146
+
1147
+ Returns
1148
+ -------
1149
+ None
1150
+
1151
+ Raises
1152
+ ------
1153
+ PyegeriaException
1154
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
1155
+ Egeria errors.
1156
+
1157
+ Notes
1158
+ -----
1159
+ See: https://egeria-project.org/concepts/integration-connector/
1160
+
1161
+ Sample body:
1162
+ {
1163
+ "class" : "UpdateRelationshipRequestBody",
1164
+ "properties" : {
1165
+ "class": "CatalogTargetProperties",
1166
+ "catalogTargetName" : "Freddy",
1167
+ "metadataSourceQualifiedName" : "",
1168
+ "templates" : {
1169
+ "templateName1" : "template1GUID",
1170
+ "templateName2" : "template2GUID"
1171
+ },
1172
+ "configurationProperties" : {
1173
+ "propertyName1" : "propertyValue1",
1174
+ "propertyName2" : "propertyValue2"
1175
+ }
1176
+ },
1177
+ "mergeUpdate": true,
1178
+ "externalSourceGUID": "add guid here",
1179
+ "externalSourceName": "add qualified name here",
1180
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
1181
+ "forLineage" : false,
1182
+ "forDuplicateProcessing" : false
1183
+ }
1184
+ """
1185
+ url = f"{self.curation_command_root}/catalog-targets/{relationship_guid}/update"
1186
+ await self._async_update_relationship_request(url, ["CatalogTargetProperties"], body)
1187
+
1188
+ @dynamic_catch
1189
+ def update_catalog_target(
1190
+ self,
1191
+ relationship_guid: str,
1192
+ body: dict | UpdateRelationshipRequestBody | None = None,
1193
+ ) -> None:
1194
+ """Update a catalog target for an integration connector.
1195
+
1196
+ Parameters
1197
+ ----------
1198
+ relationship_guid: str
1199
+ Unique identifier of the catalog target relationship.
1200
+ body: dict | UpdateRelationshipRequestBody
1201
+ Updated properties for the catalog target.
1202
+
1203
+ Returns
1204
+ -------
1205
+ None
1206
+
1207
+ Raises
1208
+ ------
1209
+ PyegeriaException
1210
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
1211
+ Egeria errors.
1212
+
1213
+ Notes
1214
+ -----
1215
+ See: https://egeria-project.org/concepts/integration-connector/
1216
+
1217
+ Sample body:
1218
+ {
1219
+ "class" : "UpdateRelationshipRequestBody",
1220
+ "properties" : {
1221
+ "class": "CatalogTargetProperties",
1222
+ "catalogTargetName" : "Freddy",
1223
+ "metadataSourceQualifiedName" : "",
1224
+ "templates" : {
1225
+ "templateName1" : "template1GUID",
1226
+ "templateName2" : "template2GUID"
1227
+ },
1228
+ "configurationProperties" : {
1229
+ "propertyName1" : "propertyValue1",
1230
+ "propertyName2" : "propertyValue2"
1231
+ }
1232
+ },
1233
+ "mergeUpdate": true,
1234
+ "externalSourceGUID": "add guid here",
1235
+ "externalSourceName": "add qualified name here",
1236
+ "effectiveTime" : "2024-01-01T00:00:00.000+00:00",
1237
+ "forLineage" : false,
1238
+ "forDuplicateProcessing" : false
1239
+ }
1240
+ """
1241
+ loop = asyncio.get_event_loop()
1242
+ loop.run_until_complete(
1243
+ self._async_update_catalog_target(relationship_guid, body)
1244
+ )
1245
+
1246
+ @dynamic_catch
1247
+ async def _async_get_catalog_target(
1248
+ self,
1249
+ relationship_guid: str,
1250
+ output_format: str = "DICT",
1251
+ report_spec: dict | str | None = None,
1252
+ ) -> dict | str:
1253
+ """Retrieve a specific catalog target associated with an integration connector. Async version.
1254
+
1255
+ Parameters
1256
+ ----------
1257
+ relationship_guid: str
1258
+ Unique identifier of the catalog target relationship.
1259
+ output_format: str, optional
1260
+ Format of the output. Default is "DICT".
1261
+ report_spec: dict | str, optional
1262
+ Specification for report formatting.
1263
+
1264
+ Returns
1265
+ -------
1266
+ dict | str
1267
+ Properties of the catalog target in the specified format.
1268
+
1269
+ Raises
1270
+ ------
1271
+ PyegeriaException
1272
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
1273
+ Egeria errors.
1274
+
1275
+ Notes
1276
+ -----
1277
+ See: https://egeria-project.org/concepts/integration-connector/
1278
+ """
1279
+ url = f"{self.curation_command_root}/catalog-targets/{relationship_guid}"
1280
+ return await self._async_get_guid_request(
1281
+ url,
1282
+ _type="CatalogTarget",
1283
+ _gen_output=self._generate_referenceable_output,
1284
+ output_format=output_format,
1285
+ report_spec=report_spec,
1286
+ )
1287
+
1288
+ @dynamic_catch
1289
+ def get_catalog_target(
1290
+ self,
1291
+ relationship_guid: str,
1292
+ output_format: str = "DICT",
1293
+ report_spec: dict | str | None = None,
1294
+ ) -> dict | str:
1295
+ """Retrieve a specific catalog target associated with an integration connector.
1296
+
1297
+ Parameters
1298
+ ----------
1299
+ relationship_guid: str
1300
+ Unique identifier of the catalog target relationship.
1301
+ output_format: str, optional
1302
+ Format of the output. Default is "DICT".
1303
+ report_spec: dict | str, optional
1304
+ Specification for report formatting.
1305
+
1306
+ Returns
1307
+ -------
1308
+ dict | str
1309
+ Properties of the catalog target in the specified format.
1310
+
1311
+ Raises
1312
+ ------
1313
+ PyegeriaException
1314
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
1315
+ Egeria errors.
1316
+
1317
+ Notes
1318
+ -----
1319
+ See: https://egeria-project.org/concepts/integration-connector/
1320
+ """
1321
+ loop = asyncio.get_event_loop()
1322
+ return loop.run_until_complete(
1323
+ self._async_get_catalog_target(relationship_guid, output_format, report_spec)
1324
+ )
1325
+
1326
+ @dynamic_catch
1327
+ async def _async_get_catalog_targets(
1328
+ self,
1329
+ integration_connector_guid: str,
1330
+ start_from: int = 0,
1331
+ page_size: int = 0,
1332
+ output_format: str = "DICT",
1333
+ report_spec: dict | str | None = None,
1334
+ ) -> list | dict | str:
1335
+ """Retrieve the details of the metadata elements identified as catalog targets with an integration connector.
1336
+ Async version.
1337
+
1338
+ Parameters
1339
+ ----------
1340
+ integration_connector_guid: str
1341
+ Unique identifier of the integration connector.
1342
+ start_from: int, optional
1343
+ Index of the first result to return. Default is 0.
1344
+ page_size: int, optional
1345
+ Maximum number of results to return. Default is None (server default).
1346
+ output_format: str, optional
1347
+ Format of the output. Default is "DICT".
1348
+ report_spec: dict | str, optional
1349
+ Specification for report formatting.
1350
+
1351
+ Returns
1352
+ -------
1353
+ list | dict | str
1354
+ List of catalog targets in the specified format.
1355
+
1356
+ Raises
1357
+ ------
1358
+ PyegeriaException
1359
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
1360
+ Egeria errors.
1361
+
1362
+ Notes
1363
+ -----
1364
+ See: https://egeria-project.org/concepts/integration-connector/
1365
+ """
1366
+ url = (
1367
+ f"{self.curation_command_root}/integration-connectors/{integration_connector_guid}/"
1368
+ f"catalog-targets"
1369
+ )
1370
+ return await self._async_get_results_body_request(
1371
+ url,
1372
+ _type="CatalogTarget",
1373
+ _gen_output=self._generate_referenceable_output,
1374
+ start_from=start_from,
1375
+ page_size=page_size,
1376
+ output_format=output_format,
1377
+ report_spec=report_spec,
1378
+ )
1379
+
1380
+ @dynamic_catch
1381
+ def get_catalog_targets(
1382
+ self,
1383
+ integration_connector_guid: str,
1384
+ start_from: int = 0,
1385
+ page_size: int = 0,
1386
+ output_format: str = "DICT",
1387
+ report_spec: dict | str | None = None,
1388
+ ) -> list | dict | str:
1389
+ """Retrieve the details of the metadata elements identified as catalog targets with an integration connector.
1390
+
1391
+ Parameters
1392
+ ----------
1393
+ integration_connector_guid: str
1394
+ Unique identifier of the integration connector.
1395
+ start_from: int, optional
1396
+ Index of the first result to return. Default is 0.
1397
+ page_size: int, optional
1398
+ Maximum number of results to return. Default is None (server default).
1399
+ output_format: str, optional
1400
+ Format of the output. Default is "DICT".
1401
+ report_spec: dict | str, optional
1402
+ Specification for report formatting.
1403
+
1404
+ Returns
1405
+ -------
1406
+ list | dict | str
1407
+ List of catalog targets in the specified format.
1408
+
1409
+ Raises
1410
+ ------
1411
+ PyegeriaException
1412
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
1413
+ Egeria errors.
1414
+
1415
+ Notes
1416
+ -----
1417
+ See: https://egeria-project.org/concepts/integration-connector/
1418
+ """
1419
+ loop = asyncio.get_event_loop()
1420
+ return loop.run_until_complete(
1421
+ self._async_get_catalog_targets(
1422
+ integration_connector_guid, start_from, page_size, output_format, report_spec
1423
+ )
1424
+ )
1425
+
1426
+ @dynamic_catch
1427
+ async def _async_remove_catalog_target(
1428
+ self,
1429
+ relationship_guid: str,
1430
+ body: dict | DeleteRelationshipRequestBody | None = None,
1431
+ ) -> None:
1432
+ """Unregister a catalog target from the integration connector. Async version.
1433
+
1434
+ Parameters
1435
+ ----------
1436
+ relationship_guid: str
1437
+ Unique identifier of the catalog target relationship to remove.
1438
+ body: dict | DeleteRelationshipRequestBody, optional
1439
+ Additional parameters for the delete operation.
1440
+
1441
+ Returns
1442
+ -------
1443
+ None
1444
+
1445
+ Raises
1446
+ ------
1447
+ PyegeriaException
1448
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
1449
+ Egeria errors.
1450
+
1451
+ Notes
1452
+ -----
1453
+ See: https://egeria-project.org/concepts/integration-connector/
1454
+ """
1455
+ url = f"{self.curation_command_root}/catalog-targets/{relationship_guid}/remove"
1456
+ await self._async_delete_relationship_request(url, body)
1457
+
1458
+ @dynamic_catch
1459
+ def remove_catalog_target(
1460
+ self,
1461
+ relationship_guid: str,
1462
+ body: dict | DeleteRelationshipRequestBody | None = None,
1463
+ ) -> None:
1464
+ """Unregister a catalog target from the integration connector.
1465
+
1466
+ Parameters
1467
+ ----------
1468
+ relationship_guid: str
1469
+ Unique identifier of the catalog target relationship to remove.
1470
+ body: dict | DeleteRelationshipRequestBody, optional
1471
+ Additional parameters for the delete operation.
1472
+
1473
+ Returns
1474
+ -------
1475
+ None
1476
+
1477
+ Raises
1478
+ ------
1479
+ PyegeriaException
1480
+ One of the pyegeria exceptions will be raised if there are issues in communications, message format, or
1481
+ Egeria errors.
1482
+
1483
+ Notes
1484
+ -----
1485
+ See: https://egeria-project.org/concepts/integration-connector/
1486
+ """
1487
+ loop = asyncio.get_event_loop()
1488
+ loop.run_until_complete(
1489
+ self._async_remove_catalog_target(relationship_guid, body)
1490
+ )
1491
+
1492
+ #
1493
+ # Data Asset Methods
1494
+ #
1495
+
1496
+ @dynamic_catch
1497
+ async def _async_find_data_assets(
1498
+ self,
1499
+ search_string: str = "*",
1500
+ content_status: str = "ACTIVE",
1501
+ starts_with: bool = False,
1502
+ ends_with: bool = False,
1503
+ ignore_case: bool = True,
1504
+ start_from: int = 0,
1505
+ page_size: int = 0,
1506
+ output_format: str = "JSON",
1507
+ report_spec: str | dict = None,
1508
+ body: Optional[dict | ContentStatusSearchString] = None,
1509
+ ) -> list | str:
1510
+ """
1511
+ Returns the list of data assets matching the search string and optional content status. Async version.
1512
+
1513
+ Parameters
1514
+ ----------
1515
+ search_string: str, default = "*"
1516
+ - the search string to use to find matching data assets
1517
+ content_status: str, default = "ACTIVE"
1518
+ - optional content status to filter by (e.g., ACTIVE)
1519
+ starts_with: bool, default = False
1520
+ - if True, the search string must match the start of the property value
1521
+ ends_with: bool, default = False
1522
+ - if True, the search string must match the end of the property value
1523
+ ignore_case: bool, default = True
1524
+ - if True, the search is case-insensitive
1525
+ start_from: int, default = 0
1526
+ - the starting point in the results list
1527
+ page_size: int, default = 0
1528
+ - the maximum number of results to return
1529
+ output_format: str, default = "JSON"
1530
+ - the format of the output (JSON, DICT, etc.)
1531
+ report_spec: str | dict, optional
1532
+ - the report specification to use for the output
1533
+ body: dict | ContentStatusSearchString, optional
1534
+ - the request body to use for the request. If specified, this takes precedence over other parameters.
1535
+
1536
+ Returns
1537
+ -------
1538
+ list | str
1539
+ - a list of data assets or a string message if no assets are found
1540
+
1541
+ Note:
1542
+ -----
1543
+ Sample body:
1544
+ {
1545
+ "class" : "ContentStatusSearchString",
1546
+ "searchString" : "xxx",
1547
+ "contentStatus" : "ACTIVE",
1548
+ "startsWith" : false,
1549
+ "endsWith" : false,
1550
+ "ignoreCase" : true,
1551
+ "startFrom" : 0,
1552
+ "pageSize": 0
1553
+ }
1554
+ """
1555
+ url = f"{self.asset_command_root}/data-assets/by-search-string"
1556
+
1557
+ if isinstance(body, ContentStatusSearchString):
1558
+ validated_body = body
1559
+ elif isinstance(body, dict):
1560
+ validated_body = self._content_status_search_request_adapter.validate_python(body)
1561
+ else:
1562
+ search_string = None if search_string == "*" else search_string
1563
+ body_dict = {
1564
+ "class": "ContentStatusSearchString",
1565
+ "searchString": search_string,
1566
+ "contentStatus": content_status,
1567
+ "startsWith": starts_with,
1568
+ "endsWith": ends_with,
1569
+ "ignoreCase": ignore_case,
1570
+ "startFrom": start_from,
1571
+ "pageSize": page_size,
1572
+ }
1573
+ validated_body = ContentStatusSearchString.model_validate(body_dict)
1574
+
1575
+ json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
1576
+ response = await self._async_make_request("POST", url, json_body)
1577
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
1578
+
1579
+ if type(elements) is str or len(elements) == 0:
1580
+ return NO_ELEMENTS_FOUND
1581
+
1582
+ if output_format.upper() != "JSON":
1583
+ return self._generate_referenceable_output(
1584
+ elements, search_string, "DataAsset", output_format, report_spec
1585
+ )
1586
+ return elements
1587
+
1588
+ @dynamic_catch
1589
+ def find_data_assets(
1590
+ self,
1591
+ search_string: str = "*",
1592
+ content_status: str = "ACTIVE",
1593
+ starts_with: bool = False,
1594
+ ends_with: bool = False,
1595
+ ignore_case: bool = True,
1596
+ start_from: int = 0,
1597
+ page_size: int = 0,
1598
+ output_format: str = "JSON",
1599
+ report_spec: str | dict = None,
1600
+ body: Optional[dict | ContentStatusSearchString] = None,
1601
+ ) -> list | str:
1602
+ """
1603
+ Returns the list of data assets matching the search string and optional content status. Sync version.
1604
+ """
1605
+ loop = asyncio.get_event_loop()
1606
+ return loop.run_until_complete(
1607
+ self._async_find_data_assets(
1608
+ search_string,
1609
+ content_status,
1610
+ starts_with,
1611
+ ends_with,
1612
+ ignore_case,
1613
+ start_from,
1614
+ page_size,
1615
+ output_format,
1616
+ report_spec,
1617
+ body,
1618
+ )
1619
+ )
1620
+
1621
+ @dynamic_catch
1622
+ async def _async_get_data_assets_by_category(
1623
+ self,
1624
+ category: str,
1625
+ content_status: str = "ACTIVE",
1626
+ start_from: int = 0,
1627
+ page_size: int = 0,
1628
+ output_format: str = "JSON",
1629
+ report_spec: str | dict = None,
1630
+ body: Optional[dict | ContentStatusFilterRequestBody] = None,
1631
+ ) -> list | str:
1632
+ """
1633
+ Returns the list of data assets matching the category and optional content status. Async version.
1634
+
1635
+ Parameters
1636
+ ----------
1637
+ category: str
1638
+ - the category to filter by
1639
+ content_status: str, default = "ACTIVE"
1640
+ - optional content status to filter by
1641
+ start_from: int, default = 0
1642
+ - starting point in the results
1643
+ page_size: int, default = 0
1644
+ - maximum results per page
1645
+ output_format: str, default = "JSON"
1646
+ - format of the output
1647
+ report_spec: str | dict, optional
1648
+ - report specification
1649
+ body: dict | ContentStatusFilterRequestBody, optional
1650
+ - the request body
1651
+
1652
+ Returns
1653
+ -------
1654
+ list | str
1655
+ - a list of data assets
1656
+
1657
+ Note:
1658
+ -----
1659
+ Sample body:
1660
+ {
1661
+ "class" : "ContentStatusFilterRequestBody",
1662
+ "filter" : "xxx",
1663
+ "contentStatus" : "ACTIVE",
1664
+ "startFrom" : 0,
1665
+ "pageSize": 0
1666
+ }
1667
+ """
1668
+ url = f"{self.asset_command_root}/data-assets/by-category"
1669
+
1670
+ if isinstance(body, ContentStatusFilterRequestBody):
1671
+ validated_body = body
1672
+ elif isinstance(body, dict):
1673
+ validated_body = self._content_status_filter_request_adapter.validate_python(body)
1674
+ else:
1675
+ body_dict = {
1676
+ "class": "ContentStatusFilterRequestBody",
1677
+ "filter": category,
1678
+ "contentStatus": content_status,
1679
+ "startFrom": start_from,
1680
+ "pageSize": page_size,
1681
+ }
1682
+ validated_body = ContentStatusFilterRequestBody.model_validate(body_dict)
1683
+
1684
+ json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
1685
+ response = await self._async_make_request("POST", url, json_body)
1686
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
1687
+
1688
+ if type(elements) is str or len(elements) == 0:
1689
+ return NO_ELEMENTS_FOUND
1690
+
1691
+ if output_format.upper() != "JSON":
1692
+ return self._generate_referenceable_output(
1693
+ elements, category, "DataAsset", output_format, report_spec
1694
+ )
1695
+ return elements
1696
+
1697
+ @dynamic_catch
1698
+ def get_data_assets_by_category(
1699
+ self,
1700
+ category: str,
1701
+ content_status: str = "ACTIVE",
1702
+ start_from: int = 0,
1703
+ page_size: int = 0,
1704
+ output_format: str = "JSON",
1705
+ report_spec: str | dict = None,
1706
+ body: Optional[dict | ContentStatusFilterRequestBody] = None,
1707
+ ) -> list | str:
1708
+ """
1709
+ Returns the list of data assets matching the category and optional content status. Sync version.
1710
+ """
1711
+ loop = asyncio.get_event_loop()
1712
+ return loop.run_until_complete(
1713
+ self._async_get_data_assets_by_category(
1714
+ category, content_status, start_from, page_size, output_format, report_spec, body
1715
+ )
1716
+ )
1717
+
1718
+ #
1719
+ # Infrastructure Methods
1720
+ #
1721
+
1722
+ @dynamic_catch
1723
+ async def _async_find_infrastructure(
1724
+ self,
1725
+ search_string: str = "*",
1726
+ deployment_status: str = "ACTIVE",
1727
+ starts_with: bool = False,
1728
+ ends_with: bool = False,
1729
+ ignore_case: bool = True,
1730
+ start_from: int = 0,
1731
+ page_size: int = 0,
1732
+ output_format: str = "JSON",
1733
+ report_spec: str | dict = None,
1734
+ body: Optional[dict | DeploymentStatusSearchString] = None,
1735
+ ) -> list | str:
1736
+ """
1737
+ Returns the list of infrastructure assets matching the search string and optional deployment status. Async version.
1738
+
1739
+ Parameters
1740
+ ----------
1741
+ search_string: str, default = "*"
1742
+ - the search string to use to find matching infrastructure assets
1743
+ deployment_status: str, default = "ACTIVE"
1744
+ - optional deployment status to filter by
1745
+ starts_with: bool, default = False
1746
+ - if True, the search string must match the start of the property value
1747
+ ends_with: bool, default = False
1748
+ - if True, the search string must match the end of the property value
1749
+ ignore_case: bool, default = True
1750
+ - if True, the search is case-insensitive
1751
+ start_from: int, default = 0
1752
+ - the starting point in the results list
1753
+ page_size: int, default = 0
1754
+ - the maximum number of results to return
1755
+ output_format: str, default = "JSON"
1756
+ - the format of the output
1757
+ report_spec: str | dict, optional
1758
+ - the report specification
1759
+ body: dict | DeploymentStatusSearchString, optional
1760
+ - the request body
1761
+
1762
+ Returns
1763
+ -------
1764
+ list | str
1765
+ - a list of infrastructure assets
1766
+
1767
+ Note:
1768
+ -----
1769
+ Sample body:
1770
+ {
1771
+ "class" : "DeploymentStatusSearchString",
1772
+ "searchString" : "xxx",
1773
+ "deploymentStatus" : "ACTIVE",
1774
+ "startsWith" : false,
1775
+ "endsWith" : false,
1776
+ "ignoreCase" : true,
1777
+ "startFrom" : 0,
1778
+ "pageSize": 0
1779
+ }
1780
+ """
1781
+ url = f"{self.asset_command_root}/infrastructure-assets/by-search-string"
1782
+
1783
+ if isinstance(body, DeploymentStatusSearchString):
1784
+ validated_body = body
1785
+ elif isinstance(body, dict):
1786
+ validated_body = self._deployment_status_search_request_adapter.validate_python(body)
1787
+ else:
1788
+ search_string = None if search_string == "*" else search_string
1789
+ body_dict = {
1790
+ "class": "DeploymentStatusSearchString",
1791
+ "searchString": search_string,
1792
+ "deploymentStatus": deployment_status,
1793
+ "startsWith": starts_with,
1794
+ "endsWith": ends_with,
1795
+ "ignoreCase": ignore_case,
1796
+ "startFrom": start_from,
1797
+ "pageSize": page_size,
1798
+ }
1799
+ validated_body = DeploymentStatusSearchString.model_validate(body_dict)
1800
+
1801
+ json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
1802
+ response = await self._async_make_request("POST", url, json_body)
1803
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
1804
+
1805
+ if type(elements) is str or len(elements) == 0:
1806
+ return NO_ELEMENTS_FOUND
1807
+
1808
+ if output_format.upper() != "JSON":
1809
+ return self._generate_referenceable_output(
1810
+ elements, search_string, "Infrastructure", output_format, report_spec
1811
+ )
1812
+ return elements
1813
+
1814
+ @dynamic_catch
1815
+ def find_infrastructure(
1816
+ self,
1817
+ search_string: str = "*",
1818
+ deployment_status: str = "ACTIVE",
1819
+ starts_with: bool = False,
1820
+ ends_with: bool = False,
1821
+ ignore_case: bool = True,
1822
+ start_from: int = 0,
1823
+ page_size: int = 0,
1824
+ output_format: str = "JSON",
1825
+ report_spec: str | dict = None,
1826
+ body: Optional[dict | DeploymentStatusSearchString] = None,
1827
+ ) -> list | str:
1828
+ """
1829
+ Returns the list of infrastructure assets matching the search string and optional deployment status. Sync version.
1830
+ """
1831
+ loop = asyncio.get_event_loop()
1832
+ return loop.run_until_complete(
1833
+ self._async_find_infrastructure(
1834
+ search_string,
1835
+ deployment_status,
1836
+ starts_with,
1837
+ ends_with,
1838
+ ignore_case,
1839
+ start_from,
1840
+ page_size,
1841
+ output_format,
1842
+ report_spec,
1843
+ body,
1844
+ )
1845
+ )
1846
+
1847
+ @dynamic_catch
1848
+ async def _async_get_infrastructure_by_category(
1849
+ self,
1850
+ category: str,
1851
+ deployment_status: str = "ACTIVE",
1852
+ start_from: int = 0,
1853
+ page_size: int = 0,
1854
+ output_format: str = "JSON",
1855
+ report_spec: str | dict = None,
1856
+ body: Optional[dict | DeploymentStatusFilterRequestBody] = None,
1857
+ ) -> list | str:
1858
+ """
1859
+ Returns the list of infrastructure assets matching the category and optional deployment status. Async version.
1860
+
1861
+ Parameters
1862
+ ----------
1863
+ category: str
1864
+ - the category to filter by
1865
+ deployment_status: str, default = "ACTIVE"
1866
+ - optional deployment status to filter by
1867
+ start_from: int, default = 0
1868
+ - starting point in the results
1869
+ page_size: int, default = 0
1870
+ - maximum results per page
1871
+ output_format: str, default = "JSON"
1872
+ - format of the output
1873
+ report_spec: str | dict, optional
1874
+ - report specification
1875
+ body: dict | DeploymentStatusFilterRequestBody, optional
1876
+ - the request body
1877
+
1878
+ Returns
1879
+ -------
1880
+ list | str
1881
+ - a list of infrastructure assets
1882
+
1883
+ Note:
1884
+ -----
1885
+ Sample body:
1886
+ {
1887
+ "class" : "DeploymentStatusFilterRequestBody",
1888
+ "filter" : "xxx",
1889
+ "deploymentStatus" : "ACTIVE",
1890
+ "startFrom" : 0,
1891
+ "pageSize": 0
1892
+ }
1893
+ """
1894
+ url = f"{self.asset_command_root}/infrastructure-assets/by-category"
1895
+
1896
+ if isinstance(body, DeploymentStatusFilterRequestBody):
1897
+ validated_body = body
1898
+ elif isinstance(body, dict):
1899
+ validated_body = self._deployment_status_filter_request_adapter.validate_python(body)
1900
+ else:
1901
+ body_dict = {
1902
+ "class": "DeploymentStatusFilterRequestBody",
1903
+ "filter": category,
1904
+ "deploymentStatus": deployment_status,
1905
+ "startFrom": start_from,
1906
+ "pageSize": page_size,
1907
+ }
1908
+ validated_body = DeploymentStatusFilterRequestBody.model_validate(body_dict)
1909
+
1910
+ json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
1911
+ response = await self._async_make_request("POST", url, json_body)
1912
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
1913
+
1914
+ if type(elements) is str or len(elements) == 0:
1915
+ return NO_ELEMENTS_FOUND
1916
+
1917
+ if output_format.upper() != "JSON":
1918
+ return self._generate_referenceable_output(
1919
+ elements, category, "Infrastructure", output_format, report_spec
1920
+ )
1921
+ return elements
1922
+
1923
+ @dynamic_catch
1924
+ def get_infrastructure_by_category(
1925
+ self,
1926
+ category: str,
1927
+ deployment_status: str = "ACTIVE",
1928
+ start_from: int = 0,
1929
+ page_size: int = 0,
1930
+ output_format: str = "JSON",
1931
+ report_spec: str | dict = None,
1932
+ body: Optional[dict | DeploymentStatusFilterRequestBody] = None,
1933
+ ) -> list | str:
1934
+ """
1935
+ Returns the list of infrastructure assets matching the category and optional deployment status. Sync version.
1936
+ """
1937
+ loop = asyncio.get_event_loop()
1938
+ return loop.run_until_complete(
1939
+ self._async_get_infrastructure_by_category(
1940
+ category, deployment_status, start_from, page_size, output_format, report_spec, body
1941
+ )
1942
+ )
1943
+
1944
+ #
1945
+ # Process Methods
1946
+ #
1947
+
1948
+ @dynamic_catch
1949
+ async def _async_find_processes(
1950
+ self,
1951
+ search_string: str = "*",
1952
+ activity_status: str = "IN_PROGRESS",
1953
+ starts_with: bool = False,
1954
+ ends_with: bool = False,
1955
+ ignore_case: bool = True,
1956
+ start_from: int = 0,
1957
+ page_size: int = 0,
1958
+ output_format: str = "JSON",
1959
+ report_spec: str | dict = None,
1960
+ body: Optional[dict | ActivityStatusSearchString] = None,
1961
+ ) -> list | str:
1962
+ """
1963
+ Retrieve the processes that match the search string and activity status. Async version.
1964
+
1965
+ Parameters
1966
+ ----------
1967
+ search_string: str, default = "*"
1968
+ - search string for process properties
1969
+ activity_status: str, default = "IN_PROGRESS"
1970
+ - activity status to filter by
1971
+ starts_with: bool, default = False
1972
+ ends_with: bool, default = False
1973
+ ignore_case: bool, default = True
1974
+ start_from: int, default = 0
1975
+ page_size: int, default = 0
1976
+ output_format: str, default = "JSON"
1977
+ report_spec: str | dict, optional
1978
+ body: dict | ActivityStatusSearchString, optional
1979
+
1980
+ Returns
1981
+ -------
1982
+ list | str
1983
+ - list of processes
1984
+
1985
+ Note:
1986
+ -----
1987
+ Sample body:
1988
+ {
1989
+ "class" : "ActivityStatusSearchString",
1990
+ "searchString" : "xxx",
1991
+ "activityStatus" : "IN_PROGRESS",
1992
+ "startsWith" : false,
1993
+ "endsWith" : false,
1994
+ "ignoreCase" : true,
1995
+ "startFrom" : 0,
1996
+ "pageSize": 0
1997
+ }
1998
+ """
1999
+ url = f"{self.asset_command_root}/processes/find-by-search-string"
2000
+
2001
+ if isinstance(body, ActivityStatusSearchString):
2002
+ validated_body = body
2003
+ elif isinstance(body, dict):
2004
+ validated_body = self._activity_status_search_request_adapter.validate_python(body)
2005
+ else:
2006
+ search_string = None if search_string == "*" else search_string
2007
+ body_dict = {
2008
+ "class": "ActivityStatusSearchString",
2009
+ "searchString": search_string,
2010
+ "activityStatus": activity_status,
2011
+ "startsWith": starts_with,
2012
+ "endsWith": ends_with,
2013
+ "ignoreCase": ignore_case,
2014
+ "startFrom": start_from,
2015
+ "pageSize": page_size,
2016
+ }
2017
+ validated_body = ActivityStatusSearchString.model_validate(body_dict)
2018
+
2019
+ json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
2020
+ response = await self._async_make_request("POST", url, json_body)
2021
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
2022
+
2023
+ if type(elements) is str or len(elements) == 0:
2024
+ return NO_ELEMENTS_FOUND
2025
+
2026
+ if output_format.upper() != "JSON":
2027
+ return self._generate_referenceable_output(
2028
+ elements, search_string, "Process", output_format, report_spec
2029
+ )
2030
+ return elements
2031
+
2032
+ @dynamic_catch
2033
+ def find_processes(
2034
+ self,
2035
+ search_string: str = "*",
2036
+ activity_status: str = "IN_PROGRESS",
2037
+ starts_with: bool = False,
2038
+ ends_with: bool = False,
2039
+ ignore_case: bool = True,
2040
+ start_from: int = 0,
2041
+ page_size: int = 0,
2042
+ output_format: str = "JSON",
2043
+ report_spec: str | dict = None,
2044
+ body: Optional[dict | ActivityStatusSearchString] = None,
2045
+ ) -> list | str:
2046
+ """
2047
+ Retrieve the processes that match the search string and activity status. Sync version.
2048
+ """
2049
+ loop = asyncio.get_event_loop()
2050
+ return loop.run_until_complete(
2051
+ self._async_find_processes(
2052
+ search_string,
2053
+ activity_status,
2054
+ starts_with,
2055
+ ends_with,
2056
+ ignore_case,
2057
+ start_from,
2058
+ page_size,
2059
+ output_format,
2060
+ report_spec,
2061
+ body,
2062
+ )
2063
+ )
2064
+
2065
+ @dynamic_catch
2066
+ async def _async_get_processes_by_category(
2067
+ self,
2068
+ category: str,
2069
+ activity_status: str = "IN_PROGRESS",
2070
+ start_from: int = 0,
2071
+ page_size: int = 0,
2072
+ output_format: str = "JSON",
2073
+ report_spec: str | dict = None,
2074
+ body: Optional[dict | ActivityStatusFilterRequestBody] = None,
2075
+ ) -> list | str:
2076
+ """
2077
+ Retrieve the processes that match the category name and status. Async version.
2078
+
2079
+ Parameters
2080
+ ----------
2081
+ category: str
2082
+ activity_status: str, default = "IN_PROGRESS"
2083
+ start_from: int, default = 0
2084
+ page_size: int, default = 0
2085
+ output_format: str, default = "JSON"
2086
+ report_spec: str | dict, optional
2087
+ body: dict | ActivityStatusFilterRequestBody, optional
2088
+
2089
+ Returns
2090
+ -------
2091
+ list | str
2092
+ - list of processes
2093
+
2094
+ Note:
2095
+ -----
2096
+ Sample body:
2097
+ {
2098
+ "class" : "ActivityStatusFilterRequestBody",
2099
+ "filter" : "xxx",
2100
+ "activityStatus" : "IN_PROGRESS",
2101
+ "startFrom" : 0,
2102
+ "pageSize": 0
2103
+ }
2104
+ """
2105
+ url = f"{self.asset_command_root}/processes/by-category"
2106
+
2107
+ if isinstance(body, ActivityStatusFilterRequestBody):
2108
+ validated_body = body
2109
+ elif isinstance(body, dict):
2110
+ validated_body = self._activity_status_filter_request_adapter.validate_python(body)
2111
+ else:
2112
+ body_dict = {
2113
+ "class": "ActivityStatusFilterRequestBody",
2114
+ "filter": category,
2115
+ "activityStatus": activity_status,
2116
+ "startFrom": start_from,
2117
+ "pageSize": page_size,
2118
+ }
2119
+ validated_body = ActivityStatusFilterRequestBody.model_validate(body_dict)
2120
+
2121
+ json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
2122
+ response = await self._async_make_request("POST", url, json_body)
2123
+ elements = response.json().get("elements", NO_ELEMENTS_FOUND)
2124
+
2125
+ if type(elements) is str or len(elements) == 0:
2126
+ return NO_ELEMENTS_FOUND
2127
+
2128
+ if output_format.upper() != "JSON":
2129
+ return self._generate_referenceable_output(
2130
+ elements, category, "Process", output_format, report_spec
2131
+ )
2132
+ return elements
2133
+
2134
+ @dynamic_catch
2135
+ def get_processes_by_category(
2136
+ self,
2137
+ category: str,
2138
+ activity_status: str = "IN_PROGRESS",
2139
+ start_from: int = 0,
2140
+ page_size: int = 0,
2141
+ output_format: str = "JSON",
2142
+ report_spec: str | dict = None,
2143
+ body: Optional[dict | ActivityStatusFilterRequestBody] = None,
2144
+ ) -> list | str:
2145
+ """
2146
+ Retrieve the processes that match the category name and status. Sync version.
2147
+ """
2148
+ loop = asyncio.get_event_loop()
2149
+ return loop.run_until_complete(
2150
+ self._async_get_processes_by_category(
2151
+ category, activity_status, start_from, page_size, output_format, report_spec, body
2152
+ )
2153
+ )
2154
+
2155
+ #
2156
+ # Action Methods
2157
+ #
2158
+
2159
+ @dynamic_catch
2160
+ async def _async_create_action(
2161
+ self, body: dict | ActionRequestBody
2162
+ ) -> str:
2163
+ """
2164
+ Create a new action and link it to the supplied actor and targets (if applicable). Async version.
2165
+
2166
+ Parameters
2167
+ ----------
2168
+ body: dict | ActionRequestBody
2169
+ - properties of the action
2170
+
2171
+ Returns
2172
+ -------
2173
+ str
2174
+ - unique identifier of the action
2175
+
2176
+ Note:
2177
+ -----
2178
+ Sample body:
2179
+ {
2180
+ "class" : "ActionRequestBody",
2181
+ "properties": {
2182
+ "class": "ActionProperties",
2183
+ "qualifiedName": "...",
2184
+ "displayName": "..."
2185
+ }
2186
+ }
2187
+ """
2188
+ url = f"{self.asset_command_root}/actions"
2189
+
2190
+ if isinstance(body, ActionRequestBody):
2191
+ validated_body = body
2192
+ else:
2193
+ validated_body = self._action_request_adapter.validate_python(body)
2194
+
2195
+ json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
2196
+ response = await self._async_make_request("POST", url, json_body)
2197
+ return response.json().get("guid", NO_GUID_RETURNED)
2198
+
2199
+ @dynamic_catch
2200
+ def create_action(self, body: dict | ActionRequestBody) -> str:
2201
+ """
2202
+ Create a new action and link it to the supplied actor and targets (if applicable). Sync version.
2203
+ """
2204
+ loop = asyncio.get_event_loop()
2205
+ return loop.run_until_complete(self._async_create_action(body))
2206
+
2207
+ @dynamic_catch
2208
+ async def _async_add_action_target(
2209
+ self,
2210
+ action_guid: str,
2211
+ metadata_element_guid: str,
2212
+ body: dict | NewRelationshipRequestBody | None = None,
2213
+ ) -> str:
2214
+ """
2215
+ Add an element to an action's workload. Async version.
2216
+
2217
+ Parameters
2218
+ ----------
2219
+ action_guid: str
2220
+ - unique identifier of the action
2221
+ metadata_element_guid: str
2222
+ - unique identifier of the metadata element that is a target
2223
+ body: dict | NewRelationshipRequestBody, optional
2224
+
2225
+ Returns
2226
+ -------
2227
+ str
2228
+ - unique identifier of the relationship
2229
+
2230
+ Note:
2231
+ -----
2232
+ Sample body:
2233
+ {
2234
+ "class" : "NewRelationshipRequestBody",
2235
+ "properties" : {
2236
+ "class": "ActionTargetProperties",
2237
+ "activityStatus" : "IN_PROGRESS",
2238
+ "actionTargetName" : "add label here"
2239
+ }
2240
+ }
2241
+ """
2242
+ url = f"{self.asset_command_root}/actions/{action_guid}/action-targets/{metadata_element_guid}/attach"
2243
+
2244
+ if isinstance(body, NewRelationshipRequestBody):
2245
+ validated_body = body
2246
+ elif isinstance(body, dict):
2247
+ validated_body = self._new_relationship_request_adapter.validate_python(body)
2248
+ else:
2249
+ validated_body = NewRelationshipRequestBody(class_="NewRelationshipRequestBody")
2250
+
2251
+ json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
2252
+ response = await self._async_make_request("POST", url, json_body)
2253
+ return response.json().get("guid", NO_GUID_RETURNED)
2254
+
2255
+ @dynamic_catch
2256
+ def add_action_target(
2257
+ self,
2258
+ action_guid: str,
2259
+ metadata_element_guid: str,
2260
+ body: dict | NewRelationshipRequestBody | None = None,
2261
+ ) -> str:
2262
+ """
2263
+ Add an element to an action's workload. Sync version.
2264
+ """
2265
+ loop = asyncio.get_event_loop()
2266
+ return loop.run_until_complete(
2267
+ self._async_add_action_target(action_guid, metadata_element_guid, body)
2268
+ )
2269
+
2270
+ @dynamic_catch
2271
+ async def _async_update_action_target_properties(
2272
+ self,
2273
+ action_target_guid: str,
2274
+ body: dict | UpdateRelationshipRequestBody,
2275
+ ) -> None:
2276
+ """
2277
+ Update the properties associated with an Action Target for an action. Async version.
2278
+
2279
+ Parameters
2280
+ ----------
2281
+ action_target_guid: str
2282
+ - unique identifier of the action target relationship
2283
+ body: dict | UpdateRelationshipRequestBody
2284
+
2285
+ Returns
2286
+ -------
2287
+ None
2288
+ """
2289
+ url = f"{self.asset_command_root}/actions/action-targets/{action_target_guid}/update"
2290
+
2291
+ if isinstance(body, UpdateRelationshipRequestBody):
2292
+ validated_body = body
2293
+ else:
2294
+ validated_body = self._update_relationship_request_adapter.validate_python(body)
2295
+
2296
+ json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
2297
+ await self._async_make_request("POST", url, json_body)
2298
+
2299
+ @dynamic_catch
2300
+ def update_action_target_properties(
2301
+ self,
2302
+ action_target_guid: str,
2303
+ body: dict | UpdateRelationshipRequestBody,
2304
+ ) -> None:
2305
+ """
2306
+ Update the properties associated with an Action Target for an action. Sync version.
2307
+ """
2308
+ loop = asyncio.get_event_loop()
2309
+ loop.run_until_complete(
2310
+ self._async_update_action_target_properties(action_target_guid, body)
2311
+ )
2312
+
2313
+ @dynamic_catch
2314
+ async def _async_get_action_target(
2315
+ self,
2316
+ action_target_guid: str,
2317
+ body: dict | GetRequestBody | None = None,
2318
+ output_format: str = "JSON",
2319
+ report_spec: str | dict = None,
2320
+ ) -> list | dict | str:
2321
+ """
2322
+ Retrieve a specific action target associated with an action. Async version.
2323
+
2324
+ Parameters
2325
+ ----------
2326
+ action_target_guid: str
2327
+ body: dict | GetRequestBody, optional
2328
+ output_format: str, default = "JSON"
2329
+ report_spec: str | dict, optional
2330
+
2331
+ Returns
2332
+ -------
2333
+ list | dict | str
2334
+ """
2335
+ url = f"{self.asset_command_root}/actions/action-targets/{action_target_guid}/retrieve"
2336
+
2337
+ return await self._async_get_guid_request(
2338
+ url,
2339
+ _type="ActionTarget",
2340
+ _gen_output=self._generate_referenceable_output,
2341
+ output_format=output_format,
2342
+ report_spec=report_spec,
2343
+ body=body,
2344
+ )
2345
+
2346
+ @dynamic_catch
2347
+ def get_action_target(
2348
+ self,
2349
+ action_target_guid: str,
2350
+ body: dict | GetRequestBody | None = None,
2351
+ output_format: str = "JSON",
2352
+ report_spec: str | dict = None,
2353
+ ) -> list | dict | str:
2354
+ """
2355
+ Retrieve a specific action target associated with an action. Sync version.
2356
+ """
2357
+ loop = asyncio.get_event_loop()
2358
+ return loop.run_until_complete(
2359
+ self._async_get_action_target(action_target_guid, body, output_format, report_spec)
2360
+ )
2361
+
2362
+ @dynamic_catch
2363
+ async def _async_get_action_targets(
2364
+ self,
2365
+ action_guid: str,
2366
+ activity_status: str = "IN_PROGRESS",
2367
+ body: dict | ActivityStatusRequestBody | None = None,
2368
+ output_format: str = "JSON",
2369
+ report_spec: str | dict = None,
2370
+ ) -> list | dict | str:
2371
+ """
2372
+ Return a list of elements that are target elements for an action. Async version.
2373
+
2374
+ Parameters
2375
+ ----------
2376
+ action_guid: str
2377
+ activity_status: str, default = "IN_PROGRESS"
2378
+ body: dict | ActivityStatusRequestBody, optional
2379
+ output_format: str, default = "JSON"
2380
+ report_spec: str | dict, optional
2381
+
2382
+ Returns
2383
+ -------
2384
+ list | dict | str
2385
+ """
2386
+ url = f"{self.asset_command_root}/actions/{action_guid}/action-targets"
2387
+
2388
+ if isinstance(body, ActivityStatusRequestBody):
2389
+ validated_body = body
2390
+ elif isinstance(body, dict):
2391
+ validated_body = self._activity_status_request_adapter.validate_python(body)
2392
+ else:
2393
+ body_dict = {
2394
+ "class": "ActivityStatusRequestBody",
2395
+ "activityStatus": activity_status,
2396
+ }
2397
+ validated_body = ActivityStatusRequestBody.model_validate(body_dict)
2398
+
2399
+ return await self._async_get_results_body_request(
2400
+ url,
2401
+ _type="ActionTarget",
2402
+ _gen_output=self._generate_referenceable_output,
2403
+ output_format=output_format,
2404
+ report_spec=report_spec,
2405
+ body=validated_body,
2406
+ )
2407
+
2408
+ @dynamic_catch
2409
+ def get_action_targets(
2410
+ self,
2411
+ action_guid: str,
2412
+ activity_status: str = "IN_PROGRESS",
2413
+ body: dict | ActivityStatusRequestBody | None = None,
2414
+ output_format: str = "JSON",
2415
+ report_spec: str | dict = None,
2416
+ ) -> list | dict | str:
2417
+ """
2418
+ Return a list of elements that are target elements for an action. Sync version.
2419
+ """
2420
+ loop = asyncio.get_event_loop()
2421
+ return loop.run_until_complete(
2422
+ self._async_get_action_targets(action_guid, activity_status, body, output_format, report_spec)
2423
+ )
2424
+
2425
+ @dynamic_catch
2426
+ async def _async_get_actions_for_action_target(
2427
+ self,
2428
+ metadata_element_guid: str,
2429
+ activity_status: str = "IN_PROGRESS",
2430
+ body: dict | ActivityStatusRequestBody | None = None,
2431
+ output_format: str = "JSON",
2432
+ report_spec: str | dict = None,
2433
+ ) -> list | dict | str:
2434
+ """
2435
+ Retrieve the "Actions" that are chained off of an action target element. Async version.
2436
+
2437
+ Parameters
2438
+ ----------
2439
+ metadata_element_guid: str
2440
+ activity_status: str, default = "IN_PROGRESS"
2441
+ body: dict | ActivityStatusRequestBody, optional
2442
+ output_format: str, default = "JSON"
2443
+ report_spec: str | dict, optional
2444
+
2445
+ Returns
2446
+ -------
2447
+ list | dict | str
2448
+ """
2449
+ url = f"{self.asset_command_root}/elements/{metadata_element_guid}/action-targets/actions"
2450
+
2451
+ if isinstance(body, ActivityStatusRequestBody):
2452
+ validated_body = body
2453
+ elif isinstance(body, dict):
2454
+ validated_body = self._activity_status_request_adapter.validate_python(body)
2455
+ else:
2456
+ body_dict = {
2457
+ "class": "ActivityStatusRequestBody",
2458
+ "activityStatus": activity_status,
2459
+ }
2460
+ validated_body = ActivityStatusRequestBody.model_validate(body_dict)
2461
+
2462
+ return await self._async_get_results_body_request(
2463
+ url,
2464
+ _type="Action",
2465
+ _gen_output=self._generate_referenceable_output,
2466
+ output_format=output_format,
2467
+ report_spec=report_spec,
2468
+ body=validated_body,
2469
+ )
2470
+
2471
+ @dynamic_catch
2472
+ def get_actions_for_action_target(
2473
+ self,
2474
+ metadata_element_guid: str,
2475
+ activity_status: str = "IN_PROGRESS",
2476
+ body: dict | ActivityStatusRequestBody | None = None,
2477
+ output_format: str = "JSON",
2478
+ report_spec: str | dict = None,
2479
+ ) -> list | dict | str:
2480
+ """
2481
+ Retrieve the "Actions" that are chained off of an action target element. Sync version.
2482
+ """
2483
+ loop = asyncio.get_event_loop()
2484
+ return loop.run_until_complete(
2485
+ self._async_get_actions_for_action_target(
2486
+ metadata_element_guid, activity_status, body, output_format, report_spec
2487
+ )
2488
+ )
2489
+
2490
+ @dynamic_catch
2491
+ async def _async_assign_action(
2492
+ self,
2493
+ action_guid: str,
2494
+ actor_guid: str,
2495
+ body: Optional[dict | NewRelationshipRequestBody] = None,
2496
+ ) -> None:
2497
+ """
2498
+ Assign an action to an actor. Request body is optional. Async version.
2499
+
2500
+ Parameters
2501
+ ----------
2502
+ action_guid: str
2503
+ - unique identifier of the action
2504
+ actor_guid: str
2505
+ - actor to assign the action to
2506
+ body: dict | NewRelationshipRequestBody, optional
2507
+ - request body
2508
+ """
2509
+ url = f"{self.asset_command_root}/actions/{action_guid}/assign/{actor_guid}"
2510
+
2511
+ await self._async_new_relationship_request(url, prop=["AssignmentScopeProperties"], body=body)
2512
+
2513
+ @dynamic_catch
2514
+ def assign_action(
2515
+ self,
2516
+ action_guid: str,
2517
+ actor_guid: str,
2518
+ body: Optional[dict | NewRelationshipRequestBody] = None,
2519
+ ) -> None:
2520
+ """
2521
+ Assign an action to an actor. Sync version.
2522
+ """
2523
+ loop = asyncio.get_event_loop()
2524
+ loop.run_until_complete(self._async_assign_action(action_guid, actor_guid, body))
2525
+
2526
+ @dynamic_catch
2527
+ async def _async_reassign_action(
2528
+ self,
2529
+ action_guid: str,
2530
+ actor_guid: str,
2531
+ body: Optional[dict | NewRelationshipRequestBody] = None,
2532
+ ) -> None:
2533
+ """
2534
+ Assign an action to a new actor. This will unassign all other actors previously assigned to the action. Async version.
2535
+
2536
+ Parameters
2537
+ ----------
2538
+ action_guid: str
2539
+ actor_guid: str
2540
+ body: dict | NewRelationshipRequestBody, optional
2541
+ """
2542
+ url = f"{self.asset_command_root}/actions/{action_guid}/reassign/{actor_guid}"
2543
+
2544
+ await self._async_new_relationship_request(url, prop=["AssignmentScopeProperties"], body=body)
2545
+
2546
+ @dynamic_catch
2547
+ def reassign_action(
2548
+ self,
2549
+ action_guid: str,
2550
+ actor_guid: str,
2551
+ body: Optional[dict | NewRelationshipRequestBody] = None,
2552
+ ) -> None:
2553
+ """
2554
+ Assign an action to a new actor. Sync version.
2555
+ """
2556
+ loop = asyncio.get_event_loop()
2557
+ loop.run_until_complete(self._async_reassign_action(action_guid, actor_guid, body))
2558
+
2559
+ @dynamic_catch
2560
+ async def _async_unassign_action(
2561
+ self,
2562
+ action_guid: str,
2563
+ actor_guid: str,
2564
+ body: Optional[dict | DeleteRelationshipRequestBody] = None,
2565
+ ) -> None:
2566
+ """
2567
+ Remove an action from an actor. Async version.
2568
+
2569
+ Parameters
2570
+ ----------
2571
+ action_guid: str
2572
+ actor_guid: str
2573
+ body: dict | DeleteRelationshipRequestBody, optional
2574
+ """
2575
+ url = f"{self.asset_command_root}/actions/{action_guid}/reassign/{actor_guid}"
2576
+
2577
+ await self._async_delete_relationship_request(url, body)
2578
+
2579
+ @dynamic_catch
2580
+ def unassign_action(
2581
+ self,
2582
+ action_guid: str,
2583
+ actor_guid: str,
2584
+ body: Optional[dict | DeleteRelationshipRequestBody] = None,
2585
+ ) -> None:
2586
+ """
2587
+ Remove an action from an actor. Sync version.
2588
+ """
2589
+ loop = asyncio.get_event_loop()
2590
+ loop.run_until_complete(self._async_unassign_action(action_guid, actor_guid, body))
2591
+
2592
+ @dynamic_catch
2593
+ async def _async_get_assigned_actions(
2594
+ self,
2595
+ actor_guid: str,
2596
+ activity_status: str = "IN_PROGRESS",
2597
+ body: dict | ActivityStatusRequestBody | None = None,
2598
+ output_format: str = "JSON",
2599
+ report_spec: str | dict = None,
2600
+ ) -> list | dict | str:
2601
+ """
2602
+ Retrieve the actions for a particular actor. Async version.
2603
+
2604
+ Parameters
2605
+ ----------
2606
+ actor_guid: str
2607
+ activity_status: str, default = "IN_PROGRESS"
2608
+ body: dict | ActivityStatusRequestBody, optional
2609
+ output_format: str, default = "JSON"
2610
+ report_spec: str | dict, optional
2611
+
2612
+ Returns
2613
+ -------
2614
+ list | dict | str
2615
+ """
2616
+ url = f"{self.asset_command_root}/actors/{actor_guid}/assigned/actions"
2617
+
2618
+ if isinstance(body, ActivityStatusRequestBody):
2619
+ validated_body = body
2620
+ elif isinstance(body, dict):
2621
+ validated_body = self._activity_status_request_adapter.validate_python(body)
2622
+ else:
2623
+ body_dict = {
2624
+ "class": "ActivityStatusRequestBody",
2625
+ "activityStatus": activity_status,
2626
+ }
2627
+ validated_body = ActivityStatusRequestBody.model_validate(body_dict)
2628
+
2629
+ return await self._async_get_results_body_request(
2630
+ url,
2631
+ _type="Action",
2632
+ _gen_output=self._generate_referenceable_output,
2633
+ output_format=output_format,
2634
+ report_spec=report_spec,
2635
+ body=validated_body,
2636
+ )
2637
+
2638
+ @dynamic_catch
2639
+ def get_assigned_actions(
2640
+ self,
2641
+ actor_guid: str,
2642
+ activity_status: str = "IN_PROGRESS",
2643
+ body: dict | ActivityStatusRequestBody | None = None,
2644
+ output_format: str = "JSON",
2645
+ report_spec: str | dict = None,
2646
+ ) -> list | dict | str:
2647
+ """
2648
+ Retrieve the actions for a particular actor. Sync version.
2649
+ """
2650
+ loop = asyncio.get_event_loop()
2651
+ return loop.run_until_complete(
2652
+ self._async_get_assigned_actions(actor_guid, activity_status, body, output_format, report_spec)
2653
+ )
2654
+
2655
+ @dynamic_catch
2656
+ async def _async_get_actions_for_sponsor(
2657
+ self,
2658
+ metadata_element_guid: str,
2659
+ activity_status: str = "IN_PROGRESS",
2660
+ body: dict | ActivityStatusRequestBody | None = None,
2661
+ output_format: str = "JSON",
2662
+ report_spec: str | dict = None,
2663
+ ) -> list | dict | str:
2664
+ """
2665
+ Retrieve the "Actions" that are chained off of a sponsor's element. Async version.
2666
+
2667
+ Parameters
2668
+ ----------
2669
+ metadata_element_guid: str
2670
+ activity_status: str, default = "IN_PROGRESS"
2671
+ body: dict | ActivityStatusRequestBody, optional
2672
+ output_format: str, default = "JSON"
2673
+ report_spec: str | dict, optional
2674
+
2675
+ Returns
2676
+ -------
2677
+ list | dict | str
2678
+ """
2679
+ url = f"{self.asset_command_root}/elements/{metadata_element_guid}/sponsored/actions"
2680
+
2681
+ if isinstance(body, ActivityStatusRequestBody):
2682
+ validated_body = body
2683
+ elif isinstance(body, dict):
2684
+ validated_body = self._activity_status_request_adapter.validate_python(body)
2685
+ else:
2686
+ body_dict = {
2687
+ "class": "ActivityStatusRequestBody",
2688
+ "activityStatus": activity_status,
2689
+ }
2690
+ validated_body = ActivityStatusRequestBody.model_validate(body_dict)
2691
+
2692
+ return await self._async_get_results_body_request(
2693
+ url,
2694
+ _type="Action",
2695
+ _gen_output=self._generate_referenceable_output,
2696
+ output_format=output_format,
2697
+ report_spec=report_spec,
2698
+ body=validated_body,
2699
+ )
2700
+
2701
+ @dynamic_catch
2702
+ def get_actions_for_sponsor(
2703
+ self,
2704
+ metadata_element_guid: str,
2705
+ activity_status: str = "IN_PROGRESS",
2706
+ body: dict | ActivityStatusRequestBody | None = None,
2707
+ output_format: str = "JSON",
2708
+ report_spec: str | dict = None,
2709
+ ) -> list | dict | str:
2710
+ """
2711
+ Retrieve the "Actions" that are chained off of a sponsor's element. Sync version.
2712
+ """
2713
+ loop = asyncio.get_event_loop()
2714
+ return loop.run_until_complete(
2715
+ self._async_get_actions_for_sponsor(
2716
+ metadata_element_guid, activity_status, body, output_format, report_spec
2717
+ )
2718
+ )
2719
+
2720
+ def _generate_referenceable_output(
2721
+ self,
2722
+ elements: list | dict,
2723
+ filter_string : str | None,
2724
+ element_type_name: str | None,
2725
+ output_format: str = "DICT",
2726
+ report_spec: dict | str | None = None,
2727
+ ):
2728
+ """Helper to generate output for referenceable elements."""
2729
+ from pyegeria.view.output_formatter import generate_output
2730
+ return generate_output(
2731
+ elements,
2732
+ filter=filter_string,
2733
+ element_type_name=element_type_name,
2734
+ output_format=output_format,
2735
+ report_spec=report_spec,
2736
+ )