task
Tasks are operations executed on devices — they are produced by many flows (ndcli sync apply, VPN configuration, scheduled backups, and user-initiated runs via ndcli run). The task command surface is for inspecting and cancelling them. To issue a command to one or more devices, use ndcli run.
Task Types
Section titled “Task Types”| Type | Description |
|---|---|
PING | Check device connectivity (issued by ndcli run ping) |
SHUTDOWN | Power off the device (issued by ndcli run poweroff) |
REBOOT | Reboot the device (issued by ndcli run restart) |
RESTART | Restart the NetDefense agent service (issued by ndcli run plugin-reload) |
PLUGIN_INSTALL | (Re)install the NetDefense agent plugin (issued by ndcli run plugin-install) |
PULL | Pull configuration from device |
SYNC | Sync configuration to device |
BACKUP | Run a configured backup |
CONNECT | Open a remote-access tunnel session to the device |
Task Statuses
Section titled “Task Statuses”| Status | Description |
|---|---|
PENDING | Task created and waiting for dispatch |
SCHEDULED | Task deferred via --at; activates when its time arrives |
IN_PROGRESS | Task currently executing on the device |
COMPLETED | Task completed successfully |
FAILED | Task failed |
CANCELLED | Task was cancelled before dispatch |
EXPIRED | Task expired before the device picked it up |
Commands
Section titled “Commands”| Command | Description |
|---|---|
task list | List tasks |
task describe | Show task details |
task cancel | Cancel a pending or scheduled task |
task list
Section titled “task list”List tasks in your organization.
ndcli task list [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 Filter Formats
Section titled “Date Filter Formats”Date filters accept:
- Relative:
30m,2h,7d,2w(minutes, hours, days, weeks ago) - ISO 8601:
2024-01-15T10:30:00Z
Examples
Section titled “Examples”ndcli task list
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 SCHEDULED --sort-by created_at:asctask describe
Section titled “task describe”Show detailed information about a specific task.
ndcli task describe [task-id]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
task-id | Yes | Task code (8-char base62) |
Output
Section titled “Output”Shows:
- Task code and type
- Target device
- Status and progress
- Creation, update, expiry, and (when set) scheduled timestamps
- Result or error message
Examples
Section titled “Examples”ndcli task describe abc12345ndcli task describe abc12345 -f jsontask cancel
Section titled “task cancel”Cancel a pending or scheduled task.
ndcli task cancel [task-id]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
task-id | Yes | Task code to cancel |
Examples
Section titled “Examples”ndcli task cancel abc12345- Only tasks with
PENDINGorSCHEDULEDstatus can be cancelled. - Tasks already
IN_PROGRESScannot be cancelled. - Cancelled tasks have status
CANCELLED.