Skip to content

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.

TypeDescription
PINGCheck device connectivity (issued by ndcli run ping)
SHUTDOWNPower off the device (issued by ndcli run poweroff)
REBOOTReboot the device (issued by ndcli run restart)
RESTARTRestart the NetDefense agent service (issued by ndcli run plugin-reload)
PLUGIN_INSTALL(Re)install the NetDefense agent plugin (issued by ndcli run plugin-install)
PULLPull configuration from device
SYNCSync configuration to device
BACKUPRun a configured backup
CONNECTOpen a remote-access tunnel session to the device
StatusDescription
PENDINGTask created and waiting for dispatch
SCHEDULEDTask deferred via --at; activates when its time arrives
IN_PROGRESSTask currently executing on the device
COMPLETEDTask completed successfully
FAILEDTask failed
CANCELLEDTask was cancelled before dispatch
EXPIREDTask expired before the device picked it up
CommandDescription
task listList tasks
task describeShow task details
task cancelCancel a pending or scheduled task

List tasks in your organization.

Terminal window
ndcli task list [flags]
FlagTypeDefaultDescription
--devicestringFilter by device name (regex)
--statusstringFilter by status
--typestringFilter by task type
--expiredboolFilter by expired status
--created-afterstringFilter by created date
--created-beforestringFilter by created date
--sort-bystringcreated_at:descSort field and direction
--pageint1Page number
--per-pageint30Items per page (max 100)

Date filters accept:

  • Relative: 30m, 2h, 7d, 2w (minutes, hours, days, weeks ago)
  • ISO 8601: 2024-01-15T10:30:00Z
Terminal window
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:asc

Show detailed information about a specific task.

Terminal window
ndcli task describe [task-id]
ArgumentRequiredDescription
task-idYesTask code (8-char base62)

Shows:

  • Task code and type
  • Target device
  • Status and progress
  • Creation, update, expiry, and (when set) scheduled timestamps
  • Result or error message
Terminal window
ndcli task describe abc12345
ndcli task describe abc12345 -f json

Cancel a pending or scheduled task.

Terminal window
ndcli task cancel [task-id]
ArgumentRequiredDescription
task-idYesTask code to cancel
Terminal window
ndcli task cancel abc12345
  • Only tasks with PENDING or SCHEDULED status can be cancelled.
  • Tasks already IN_PROGRESS cannot be cancelled.
  • Cancelled tasks have status CANCELLED.