Skip to content

Commit 9b1846f

Browse files
authored
Update get tasks (#5)
* Modified get tasks to include task type. * Fixed documentation
1 parent de92720 commit 9b1846f

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

plugins/action/get_tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: GPL-3.0-or-later
55

66
# Retrieves list of tasks from Itential Platform. Supports filtering via parameters.
7-
# Returns: List of task objects with their status and details.
7+
# Returns: List of task objects with their status, details, and type.
88
# Example:
99
# - name: Get tasks by status
1010
# itential.platform.get_tasks:
@@ -33,6 +33,6 @@ def run(self, tmp=None, task_vars=None):
3333

3434
method = "GET"
3535

36-
params["include"] = "name,status"
36+
params["include"] = "name,status,type"
3737

3838
return make_request(task_vars, method, endpoint, params=params)

plugins/action/restart_adapters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ def run(self, tmp=None, task_vars=None):
5353
response = make_request(task_vars, method, endpoint)
5454
results.append(response)
5555

56-
return {"results": results} # Always return a list
56+
return {"results": results}

tests/unit/test_input_action_module.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
@pytest.mark.parametrize("action_module_class, input_args, expected_endpoint, expected_method, expected_params", [
1010
(GetJobs, {"status": "running", "name": "greg"}, "/operations-manager/jobs", "GET", {
1111
"equals[status]": "running",
12-
"equals[name]": "greg",
13-
"include": "name,status"
12+
"equals[name]": "greg"
1413
}),
1514
(GetTasks, {"status": "running", "name": "greg"}, "/operations-manager/tasks", "GET", {
1615
"equals[status]": "running",
17-
"equals[name]": "greg",
18-
"include": "name,status"
16+
"equals[name]": "greg"
1917
}),
2018
])
2119
@patch("ansible_collections.itential.core.plugins.module_utils.http.send_request")

0 commit comments

Comments
 (0)