Skip to content

template

Template management commands for NDCLI. Templates are collections of snippets that define firewall configurations. Templates are assigned to OUs, and all devices in that OU receive the template’s configuration.

CommandDescription
template listList templates
template describeShow template details
template createCreate a new template
template updateUpdate a template
template deleteDelete a template
template add-snippetAdd a snippet to a template
template remove-snippetRemove a snippet from a template

List templates in your organization.

Terminal window
ndcli template list [flags]
FlagTypeDefaultDescription
--created-afterstringFilter by created date
--created-beforestringFilter by created date
--updated-afterstringFilter by updated date
--updated-beforestringFilter by updated date
--sort-bystringname:ascSort field and direction
--pageint1Page number
--per-pageint30Items per page

Date filters accept:

  • Relative: 30m, 2h, 7d, 2w (minutes, hours, days, weeks ago)
  • ISO 8601: 2024-01-15T10:30:00Z
Terminal window
ndcli template list
ndcli template list --updated-after 7d
ndcli template list --sort-by created_at:desc

Show detailed information about a template including its snippets.

Terminal window
ndcli template describe [name]
ArgumentRequiredDescription
nameYesTemplate name

Shows:

  • Template name and description
  • Creation and update timestamps
  • List of assigned snippets with their types and priorities
Terminal window
ndcli template describe base-config
ndcli template describe production-firewall -f json

Create a new template.

Terminal window
ndcli template create [name] [flags]
ArgumentRequiredDescription
nameYesTemplate name
FlagTypeDescription
--descriptionstringTemplate description
Terminal window
ndcli template create base-firewall
ndcli template create production-config \
--description "Production firewall baseline configuration"

Update an existing template’s name or description.

Terminal window
ndcli template update [name] [flags]
ArgumentRequiredDescription
nameYesCurrent template name
FlagTypeDescription
--namestringNew template name
--descriptionstringNew description
Terminal window
ndcli template update base-config --description "Updated baseline"
ndcli template update old-name --name new-name
ndcli template update legacy-config \
--name modern-config \
--description "Modernized firewall configuration"

Delete a template.

Terminal window
ndcli template delete [name]
ArgumentRequiredDescription
nameYesTemplate name to delete
Terminal window
ndcli template delete deprecated-template

Add a snippet to a template. Snippets are configuration blocks that make up the template.

Terminal window
ndcli template add-snippet [template] [snippet]
ArgumentRequiredDescription
templateYesTemplate name
snippetYesSnippet name to add
Terminal window
ndcli template add-snippet production-config admin-users
ndcli template add-snippet production-config firewall-rules
  • The snippet must exist before adding it to a template
  • A snippet can be added to multiple templates
  • Snippet order is determined by snippet priority

Remove a snippet from a template.

Terminal window
ndcli template remove-snippet [template] [snippet]
ArgumentRequiredDescription
templateYesTemplate name
snippetYesSnippet name to remove
Terminal window
ndcli template remove-snippet staging-config old-rules
  • This only removes the snippet from the template
  • The snippet itself is not deleted and remains available

Attach a software policy to a template. During sync, NetDefense will reconcile the device’s installed packages against every software policy attached to the templates that match it.

Terminal window
ndcli template add-software [template] [software-policy]
ArgumentRequiredDescription
templateYesTemplate name
software-policyYesSoftware policy name to attach
Terminal window
ndcli template add-software network-monitoring monitoring-tools

Detach a software policy from a template. Already-installed packages stay on the device unless they’re also covered by another policy’s absent list.

Terminal window
ndcli template remove-software [template] [software-policy]
Terminal window
ndcli template remove-software network-monitoring monitoring-tools