Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions BACKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Once the Egeria release with the delete fixes is published and the local quickst
2. **Other delete issues** to re-check at the same time: ISSUE-117 (Memento cascade delete), ISSUE-125 (`deleteEnumDef`) and ISSUE-132 (`cascadedDelete` field name).
Also ISSUE-147, the valid-metadata clears: re-run the ISSUE-147 sequence (setup then clear for a value, a map name and a map value on a made-up property). Expect no 400-011 error after a successful clear, and expect the map value to actually be removed.
3. Update each `PYEGERIA_ISSUES.md` entry with the result, then do the held 6.2.3 release. The owner wants outstanding issues fixed before releasing.
**The 6.2.3 release notes must list this behaviour change:** ISSUE-148. `AssetMaker.find_processes`, `get_processes_by_category`, `get_action_targets`, `get_actions_for_action_target`, `get_assigned_actions`, `get_actions_for_sponsor` and `get_actions_for_requester` now default `activity_status_list` to `None` (no filter) instead of `["IN_PROGRESS"]`. A caller that relied on getting only in-progress actions by default now also gets completed, cancelled and status-less actions (e.g. journal entries), so it should pass `["IN_PROGRESS"]` explicitly.
**Also list this API removal:** ISSUE-151. `AutomatedCuration.get_engine_actions()` is removed, because the View Server has no list-all endpoint for it (it always got a 404). Use `find_engine_actions("*")` instead.

---

Expand Down
132 changes: 130 additions & 2 deletions PYEGERIA_ISSUES.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/parameter_cleanup_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ async def _async_get_xxx_by_guid(
- **Planned**: TODO
- [ ] `get_create_csv_data_file_element_from_template(self, file_name, file_type, file_path_name, version_identifier, file_encoding='UTF-8', file_extension='csv', file_system_name=None, description=None)`
- **Planned**: TODO
- [ ] `get_engine_actions(self, start_from=0, page_size=0, output_format='JSON', report_spec='EngineAction', body=None)`
- [x] ~~`get_engine_actions(...)`~~ removed (ISSUE-151): no View Server endpoint; use `find_engine_actions("*")`
- **Planned**: TODO
- [x] `get_engine_actions_by_name(self, name, start_from=0, page_size=0, output_format='JSON', report_spec='EngineAction', body=None)`
- **Planned**: Standard Get By Name Pattern
Expand Down
56 changes: 28 additions & 28 deletions pyegeria/omvs/asset_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3781,7 +3781,7 @@ def detach_software_capability_from_asset(
async def _async_find_processes(
self,
search_string: str = "*",
activity_status_list: list[str] = [],
activity_status_list: Optional[list[str]] = None,
starts_with: bool = True,
ends_with: bool = False,
ignore_case: bool = True,
Expand Down Expand Up @@ -3814,7 +3814,7 @@ async def _async_find_processes(
----------
search_string: str, default = "*"
- search string for process properties
activity_status_list: list[str], default = []
activity_status_list: list[str], default = None (no filter: every activity status, including none)
- optional activity status list to filter by
starts_with: bool, default = True
ends_with: bool, default = False
Expand Down Expand Up @@ -3881,7 +3881,7 @@ async def _async_find_processes(
def find_processes(
self,
search_string: str = "*",
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
starts_with: bool = True,
ends_with: bool = False,
ignore_case: bool = True,
Expand Down Expand Up @@ -3914,7 +3914,7 @@ def find_processes(
----------
search_string: str, default = "*"
- the search string to use to find matching processes
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
- optional activity status list to filter by
starts_with: bool, default = True
- if True, the search string must match the start of the property value
Expand Down Expand Up @@ -3988,7 +3988,7 @@ def find_processes(
async def _async_get_processes_by_category(
self,
category: str,
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
graph_query_depth: int = 3,
start_from: int = 0,
page_size: int = 0,
Expand All @@ -4003,7 +4003,7 @@ async def _async_get_processes_by_category(
Parameters
----------
category: str
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
graph_query_depth: int, default = 3
- depth for relationship traversal
start_from: int, default = 0
Expand Down Expand Up @@ -4048,7 +4048,7 @@ async def _async_get_processes_by_category(
def get_processes_by_category(
self,
category: str,
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
graph_query_depth: int = 3,
start_from: int = 0,
page_size: int = 0,
Expand All @@ -4064,7 +4064,7 @@ def get_processes_by_category(
----------
category: str
- category name to filter by
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
- optional activity status list to filter by
graph_query_depth: int, default = 3
- depth for relationship traversal
Expand Down Expand Up @@ -4526,7 +4526,7 @@ def get_action_target(
async def _async_get_action_targets(
self,
action_guid: str,
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
graph_query_depth: int = 3,
start_from: int = 0,
page_size: int = 0,
Expand All @@ -4544,7 +4544,7 @@ async def _async_get_action_targets(
Parameters
----------
action_guid: str
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
graph_query_depth: int, default = 3
- depth for relationship traversal
body: dict | ActivityStatusRequestBody, optional
Expand Down Expand Up @@ -4577,7 +4577,7 @@ async def _async_get_action_targets(
def get_action_targets(
self,
action_guid: str,
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
graph_query_depth: int = 3,
start_from: int = 0,
page_size: int = 0,
Expand All @@ -4595,7 +4595,7 @@ def get_action_targets(
Parameters
----------
action_guid: str
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
graph_query_depth: int, default = 3
- depth for relationship traversal
start_from: int, default = 0
Expand Down Expand Up @@ -4641,7 +4641,7 @@ def get_action_targets(
async def _async_get_actions_for_action_target(
self,
metadata_element_guid: str,
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
graph_query_depth: int = 3,
start_from: int = 0,
page_size: int = 0,
Expand All @@ -4659,7 +4659,7 @@ async def _async_get_actions_for_action_target(
Parameters
----------
metadata_element_guid: str
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
graph_query_depth: int, default = 3
- depth for relationship traversal
body: dict | ActivityStatusRequestBody, optional
Expand Down Expand Up @@ -4692,7 +4692,7 @@ async def _async_get_actions_for_action_target(
def get_actions_for_action_target(
self,
metadata_element_guid: str,
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
graph_query_depth: int = 3,
start_from: int = 0,
page_size: int = 0,
Expand All @@ -4710,7 +4710,7 @@ def get_actions_for_action_target(
Parameters
----------
metadata_element_guid: str
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
graph_query_depth: int, default = 3
- depth for relationship traversal
start_from: int, default = 0
Expand Down Expand Up @@ -4925,7 +4925,7 @@ def unassign_action(
async def _async_get_assigned_actions(
self,
actor_guid: str,
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
graph_query_depth: int = 3,
start_from: int = 0,
page_size: int = 0,
Expand All @@ -4943,7 +4943,7 @@ async def _async_get_assigned_actions(
Parameters
----------
actor_guid: str
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
graph_query_depth: int, default = 3
- depth for relationship traversal
body: dict | ActivityStatusRequestBody, optional
Expand Down Expand Up @@ -4976,7 +4976,7 @@ async def _async_get_assigned_actions(
def get_assigned_actions(
self,
actor_guid: str,
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
graph_query_depth: int = 3,
start_from: int = 0,
page_size: int = 0,
Expand All @@ -4994,7 +4994,7 @@ def get_assigned_actions(
Parameters
----------
actor_guid: str
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
graph_query_depth: int, default = 3
- depth for relationship traversal
start_from: int, default = 0
Expand Down Expand Up @@ -5040,7 +5040,7 @@ def get_assigned_actions(
async def _async_get_actions_for_sponsor(
self,
metadata_element_guid: str,
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
graph_query_depth: int = 3,
start_from: int = 0,
page_size: int = 0,
Expand All @@ -5058,7 +5058,7 @@ async def _async_get_actions_for_sponsor(
Parameters
----------
metadata_element_guid: str
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
graph_query_depth: int, default = 3
- depth for relationship traversal
body: dict | ActivityStatusRequestBody, optional
Expand Down Expand Up @@ -5091,7 +5091,7 @@ async def _async_get_actions_for_sponsor(
def get_actions_for_sponsor(
self,
metadata_element_guid: str,
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
graph_query_depth: int = 3,
start_from: int = 0,
page_size: int = 0,
Expand All @@ -5109,7 +5109,7 @@ def get_actions_for_sponsor(
Parameters
----------
metadata_element_guid: str
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
graph_query_depth: int, default = 3
- depth for relationship traversal
start_from: int, default = 0
Expand Down Expand Up @@ -5155,7 +5155,7 @@ def get_actions_for_sponsor(
async def _async_get_actions_for_requester(
self,
metadata_element_guid: str,
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
graph_query_depth: int = 3,
start_from: int = 0,
page_size: int = 0,
Expand All @@ -5173,7 +5173,7 @@ async def _async_get_actions_for_requester(
Parameters
----------
metadata_element_guid: str
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
graph_query_depth: int, default = 3
- depth for relationship traversal
body: dict | ActivityStatusRequestBody, optional
Expand Down Expand Up @@ -5206,7 +5206,7 @@ async def _async_get_actions_for_requester(
def get_actions_for_requester(
self,
metadata_element_guid: str,
activity_status_list: list[str] = ["IN_PROGRESS"],
activity_status_list: Optional[list[str]] = None,
graph_query_depth: int = 3,
start_from: int = 0,
page_size: int = 0,
Expand All @@ -5224,7 +5224,7 @@ def get_actions_for_requester(
Parameters
----------
metadata_element_guid: str
activity_status_list: list[str], default = ["IN_PROGRESS"]
activity_status_list: list[str], default = None (no filter: every activity status, including none)
graph_query_depth: int, default = 3
- depth for relationship traversal
start_from: int, default = 0
Expand Down
101 changes: 3 additions & 98 deletions pyegeria/omvs/automated_curation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2625,103 +2625,6 @@ def get_active_claimed_engine_actions(
self._async_get_active_claimed_engine_actions(governance_engine_guid, start_from, page_size)
)

async def _async_get_engine_actions(
self,
start_from: int = 0,
page_size: int = 0,
output_format: str = "JSON",
report_spec: str | dict = "EngineAction",
body: Optional[dict | FilterRequestBody] = None,
**kwargs,
) -> list | str:
"""Retrieve the list of engine action metadata elements.

Async version.

Parameters
----------
start_from : int, default 0
The index from which to start fetching.
page_size : int, default 0
The maximum number to fetch in a single request.
output_format : str, default "JSON"
The desired output format (e.g., "JSON", "DICT").
report_spec : str | dict, default "EngineAction"
The report specification to use for formatting.
body : dict | FilterRequestBody, optional
The request body.
**kwargs : Any
Additional keyword arguments to pass to the request.

Returns
-------
list | str
A list of dictionaries representing the retrieved engine actions.

Raises
------
PyegeriaException
If there is an error in communication or processing.

Notes
-----
For more information see: https://egeria-project.org/concepts/engine-action
"""

url = f"{self.ref_curation_command_base}/engine-actions"
response = await self._async_get_name_request(url, _type=self.ENGINE_ACTION_LABEL,
_gen_output=self._generate_engine_action_output,
filter_string=None, start_from=start_from, page_size=page_size,
output_format=output_format, report_spec=report_spec, body=body, **kwargs)
return response

def get_engine_actions(
self,
start_from: int = 0,
page_size: int = 0,
output_format: str = "JSON",
report_spec: str | dict = "EngineAction",
body: Optional[dict | FilterRequestBody] = None,
**kwargs,
) -> list | str:
"""Retrieve the list of engine action metadata elements.

Parameters
----------
start_from : int, optional
The index to start retrieving engine actions from. If not provided, the default value will be used.
page_size : int, optional
The maximum number of engine actions to retrieve in a single request. If not provided, the default global
maximum paging size will be used.
output_format: str, default = "JSON"
- one of "DICT", "MERMAID" or "JSON"
report_spec: dict , optional, default = None
The desired output columns/fields to include.
body: dict, optional, default = None
Provides, a full request body.
**kwargs : Any
Additional keyword arguments to pass to the request.

Returns
-------
list of dict | str
A list of dictionaries representing the retrieved engine actions.
Raises:
------
PyegeriaException
Notes
-----
For more information see: https://egeria-project.org/concepts/engine-action

"""
loop = asyncio.get_event_loop()
response = loop.run_until_complete(
self._async_get_engine_actions(
start_from, page_size, output_format, report_spec, body, **kwargs
)
)
return response

async def _async_get_active_engine_actions(
self,
start_from: int = 0,
Expand Down Expand Up @@ -5350,7 +5253,9 @@ def print_engine_action_summary(self, governance_action: dict):

def print_engine_actions(self):
"""Print all the engine actions."""
governance_actions = self.get_engine_actions()
# The View Server has no list-all engine-actions endpoint (ISSUE-151); EngineAction
# is an Asset in 6.2, so the asset search is the list-all.
governance_actions = self.find_engine_actions("*")
if governance_actions is not None and isinstance(governance_actions, list):
for x in range(len(governance_actions)):
self.print_engine_action_summary(governance_actions[x])
Expand Down
Loading
Loading