Task management commands for NDCLI. Tasks are operations sent to devices such as ping, reboot, shutdown, and configuration sync.
Task Types
| Type | Description |
|---|
PING | Check device connectivity |
SHUTDOWN | Shutdown the device |
REBOOT | Reboot the device |
RESTART | Restart the device service |
PULL | Pull configuration from device |
SYNC | Sync configuration to device |
Task Statuses
| Status | Description |
|---|
PENDING | Task created, waiting to be picked up |
SCHEDULED | Task scheduled for future execution |
IN_PROGRESS | Task currently executing |
COMPLETED | Task completed successfully |
FAILED | Task failed |
CANCELLED | Task was cancelled |
EXPIRED | Task expired before execution |
Commands
task list
List tasks in your organization.
Flags
| Flag | Type | Default | Description |
|---|
--device | string | | Filter by device name (regex) |
--status | string | | Filter by status |
--type | string | | Filter by task type |
--expired | bool | | Filter by expired status |
--created-after | string | | Filter by created date |
--created-before | string | | Filter by created date |
--sort-by | string | created_at:desc | Sort field and direction |
--page | int | 1 | Page number |
--per-page | int | 30 | Items per page (max 100) |
Date filters accept:
- Relative:
30m, 2h, 7d, 2w (minutes, hours, days, weeks ago)
- ISO 8601:
2024-01-15T10:30:00Z
Examples
ndcli task list --created-after 1h
ndcli task list --device fw-prod-01
ndcli task list --status FAILED
ndcli task list --type SYNC
ndcli task list --status PENDING --sort-by created_at:asc
task describe
Show detailed information about a specific task.
ndcli task describe [task-id]
Arguments
| Argument | Required | Description |
|---|
task-id | Yes | Task ID |
Output
Shows:
- Task ID and type
- Target device
- Status and progress
- Creation timestamp
- Completion timestamp (if completed)
- Result or error message
Examples
ndcli task describe abc123
ndcli task describe abc123 -f json
task create
Create a task for a device.
ndcli task create [device] [type]
Arguments
| Argument | Required | Description |
|---|
device | Yes | Device name |
type | Yes | Task type: PING, SHUTDOWN, REBOOT, RESTART |
Task Types
| Type | Description | Impact |
|---|
PING | Test connectivity | None - diagnostic only |
RESTART | Restart firewall service | Brief service interruption |
REBOOT | Full system reboot | Complete service interruption |
SHUTDOWN | Shutdown the device | Device goes offline |
Examples
ndcli task create fw-prod-01 PING
ndcli task create fw-staging-01 RESTART
ndcli task create fw-dev-01 REBOOT
ndcli task create decommissioned-fw SHUTDOWN
task cancel
Cancel a pending or scheduled task.
ndcli task cancel [task-id]
Arguments
| Argument | Required | Description |
|---|
task-id | Yes | Task ID to cancel |
Examples
Notes
- Only tasks with
PENDING or SCHEDULED status can be cancelled
- Tasks already
IN_PROGRESS cannot be cancelled
- Cancelled tasks have status
CANCELLED