Is your feature request related to a problem? Please describe.
Currently, in the controller module, command execution is limited to a single device at a time through the Command model and the existing asynchronous launch_command task. While this works well for individual device management, it becomes inefficient for operational scenarios where administrators need to run the same command across dozens or hundreds of devices, such as checking uptime, verifying interface status, or collecting diagnostics across an organization, device group, or location.
At the moment, there is no backend abstraction for grouping command executions under a single operation, tracking the overall execution state of a batch, or associating individual command executions with a parent operation. This makes large-scale command execution difficult to manage, monitor, and extend through admin views or APIs.
Describe the solution I would implement
I would like to introduce a backend foundation for mass command execution by adding a new MassCommand model and execution pipeline that builds on top of the existing single-command workflow.
-
Introduce an abstract AbstractMassCommand model (and concrete MassCommand) to represent a batch command operation and support device targeting using filters such as:
- all devices
- organization
- device group
- location
- manual device selection
-
Store command metadata such as:
- command type
- command input
- execution status (idle, processing, success, failed)
-
On creation of a MassCommand, schedule a new asynchronous Celery task launch_mass_command using transaction.on_commit. The batch task will:
- create individual Command objects for each device
- reuse the existing launch_command execution pipeline for actual device execution
- Aggregate execution progress at the MassCommand level based on the status of child commands.
-
Add a new WebSocket endpoint to listen to real-time status updates for mass command execution, allowing the frontend to receive and display command progress and final execution states such as success or failure.
Is your feature request related to a problem? Please describe.
Currently, in the controller module, command execution is limited to a single device at a time through the
Commandmodel and the existing asynchronouslaunch_command task. While this works well for individual device management, it becomes inefficient for operational scenarios where administrators need to run the same command across dozens or hundreds of devices, such as checking uptime, verifying interface status, or collecting diagnostics across an organization, device group, or location.At the moment, there is no backend abstraction for grouping command executions under a single operation, tracking the overall execution state of a batch, or associating individual command executions with a parent operation. This makes large-scale command execution difficult to manage, monitor, and extend through admin views or APIs.
Describe the solution I would implement
I would like to introduce a backend foundation for mass command execution by adding a new
MassCommandmodel and execution pipeline that builds on top of the existing single-command workflow.Introduce an abstract AbstractMassCommand model (and concrete MassCommand) to represent a batch command operation and support device targeting using filters such as:
Store command metadata such as:
On creation of a MassCommand, schedule a new asynchronous Celery task
launch_mass_commandusingtransaction.on_commit. The batch task will:Add a new WebSocket endpoint to listen to real-time status updates for mass command execution, allowing the frontend to receive and display command progress and final execution states such as success or failure.