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.

Commands

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

template list

List templates in your organization.

Terminal window
ndcli template list [flags]

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 Filter Formats

Date filters accept:

  • Relative: 30m, 2h, 7d, 2w (minutes, hours, days, weeks ago)
  • ISO 8601: 2024-01-15T10:30:00Z

Examples

Terminal window
ndcli template list
ndcli template list --updated-after 7d
ndcli template list --sort-by created_at:desc

template describe

Show detailed information about a template including its snippets.

Terminal window
ndcli template describe [name]

Arguments

ArgumentRequiredDescription
nameYesTemplate name

Output

Shows:

  • Template name and description
  • Creation and update timestamps
  • List of assigned snippets with their types and priorities

Examples

Terminal window
ndcli template describe base-config
ndcli template describe production-firewall -f json

template create

Create a new template.

Terminal window
ndcli template create [name] [flags]

Arguments

ArgumentRequiredDescription
nameYesTemplate name

Flags

FlagTypeDescription
--descriptionstringTemplate description

Examples

Terminal window
ndcli template create base-firewall
ndcli template create production-config \
--description "Production firewall baseline configuration"

template update

Update an existing template’s name or description.

Terminal window
ndcli template update [name] [flags]

Arguments

ArgumentRequiredDescription
nameYesCurrent template name

Flags

FlagTypeDescription
--namestringNew template name
--descriptionstringNew description

Examples

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"

template delete

Delete a template.

Terminal window
ndcli template delete [name]

Arguments

ArgumentRequiredDescription
nameYesTemplate name to delete

Examples

Terminal window
ndcli template delete deprecated-template

template add-snippet

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

Terminal window
ndcli template add-snippet [template] [snippet]

Arguments

ArgumentRequiredDescription
templateYesTemplate name
snippetYesSnippet name to add

Examples

Terminal window
ndcli template add-snippet production-config admin-users
ndcli template add-snippet production-config firewall-rules

Notes

  • 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

template remove-snippet

Remove a snippet from a template.

Terminal window
ndcli template remove-snippet [template] [snippet]

Arguments

ArgumentRequiredDescription
templateYesTemplate name
snippetYesSnippet name to remove

Examples

Terminal window
ndcli template remove-snippet staging-config old-rules

Notes

  • This only removes the snippet from the template
  • The snippet itself is not deleted and remains available