diff --git a/CHANGES/376.feature b/CHANGES/376.feature new file mode 100644 index 000000000..08e340b00 --- /dev/null +++ b/CHANGES/376.feature @@ -0,0 +1 @@ +Added the ability to delete tasks. diff --git a/pulpcore/cli/core/context.py b/pulpcore/cli/core/context.py index ad1d76be7..3bcba48cf 100644 --- a/pulpcore/cli/core/context.py +++ b/pulpcore/cli/core/context.py @@ -306,6 +306,7 @@ class PulpTaskContext(PulpEntityContext): HREF = "task_href" LIST_ID = "tasks_list" READ_ID = "tasks_read" + DELETE_ID = "tasks_delete" CANCEL_ID: ClassVar[str] = "tasks_cancel" resource_context: Optional[PulpEntityContext] = None diff --git a/pulpcore/cli/core/task.py b/pulpcore/cli/core/task.py index aa824624a..9200cca12 100644 --- a/pulpcore/cli/core/task.py +++ b/pulpcore/cli/core/task.py @@ -10,7 +10,7 @@ pass_entity_context, pass_pulp_context, ) -from pulpcore.cli.common.generic import href_option, list_command, pulp_option +from pulpcore.cli.common.generic import destroy_command, href_option, list_command, pulp_option from pulpcore.cli.core.context import PulpTaskContext from pulpcore.cli.core.generic import task_filter @@ -43,6 +43,7 @@ def task(ctx: click.Context, pulp_ctx: PulpContext) -> None: task.add_command(list_command(decorators=task_filter)) +task.add_command(destroy_command(decorators=[href_option, uuid_option])) @task.command()