ou
Organizational unit (OU) management commands for NDCLI. OUs allow you to organize devices into logical groups and assign templates to groups of devices.
Commands
Section titled “Commands”| Command | Description |
|---|---|
ou list | List organizational units |
ou describe | Show OU details |
ou create | Create a new OU |
ou delete | Delete an OU |
ou rename | Rename an OU |
ou device-list | List devices in an OU |
ou add-device | Add a device to an OU |
ou remove-device | Remove a device from an OU |
ou template | Manage OU templates |
ou list
Section titled “ou list”List organizational units in your organization.
ndcli ou list [flags]| Flag | Type | Default | Description |
|---|---|---|---|
--name | string | Filter by name (regex pattern) | |
--status | string | all | Filter by status: all, enabled |
--created-after | string | Filter by created date | |
--created-before | string | Filter by created date | |
--sort-by | string | name | Sort field: name, device_count, created_at, updated_at |
--sort-order | string | asc | Sort order: asc, desc |
--page | int | 1 | Page number |
--per-page | int | 20 | Items per page (1-100) |
Date Filter Formats
Section titled “Date Filter Formats”--created-after and --created-before accept:
- Relative:
30m,2h,7d,2w(minutes, hours, days, weeks ago) - ISO 8601:
2024-01-15T10:30:00Z. A time with an offset, such as2024-01-15T10:30:00-03:00, is converted. A time without an offset, or a date alone, is read as UTC
From ndcli 1.40.0, a relative time is counted from the current moment whatever timezone your computer is set to. Earlier releases moved the window by the computer’s offset from UTC.
Examples
Section titled “Examples”ndcli ou list
ndcli ou list --name "prod.*"
ndcli ou list --sort-by device_count --sort-order desc
ndcli ou list --created-after 7dou describe
Section titled “ou describe”Show detailed information about an organizational unit.
ndcli ou describe [name]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
name | Yes | OU name |
Output
Section titled “Output”Shows:
- OU name and description
- Status
- Device count
- Assigned templates
- Creation and update timestamps
Examples
Section titled “Examples”ndcli ou describe productionndcli ou describe staging -f jsonou create
Section titled “ou create”Create a new organizational unit.
ndcli ou create [name] [flags]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
name | Yes | OU name |
| Flag | Type | Description |
|---|---|---|
--description | string | OU description |
Examples
Section titled “Examples”ndcli ou create production
ndcli ou create staging --description "Pre-production testing environment"ou delete
Section titled “ou delete”Delete an organizational unit.
ndcli ou delete [name]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
name | Yes | OU name to delete |
Examples
Section titled “Examples”ndcli ou delete deprecated-ouou rename
Section titled “ou rename”Rename an organizational unit.
ndcli ou rename [old-name] [new-name]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
old-name | Yes | Current OU name |
new-name | Yes | New OU name |
Examples
Section titled “Examples”ndcli ou rename test stagingou device-list
Section titled “ou device-list”List all devices assigned to an organizational unit.
ndcli ou device-list [ou]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
ou | Yes | OU name |
Examples
Section titled “Examples”ndcli ou device-list productionndcli ou device-list staging -f jsonou add-device
Section titled “ou add-device”Add a device to an organizational unit.
ndcli ou add-device [ou] [device]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
ou | Yes | OU name |
device | Yes | Device name to add |
Examples
Section titled “Examples”ndcli ou add-device production fw-datacenter-01- A device can only belong to one OU at a time
- Adding a device to an OU removes it from its previous OU
ou remove-device
Section titled “ou remove-device”Remove a device from an organizational unit.
ndcli ou remove-device [ou] [device]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
ou | Yes | OU name |
device | Yes | Device name to remove |
Examples
Section titled “Examples”ndcli ou remove-device production old-firewallou template
Section titled “ou template”Manage templates assigned to an organizational unit.
ou template list
Section titled “ou template list”List templates assigned to an OU.
ndcli ou template list [ou]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
ou | Yes | OU name |
Examples
Section titled “Examples”ndcli ou template list productionou template add
Section titled “ou template add”Add a template to an OU. Devices in the OU will receive configurations from this template.
ndcli ou template add [ou] [template]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
ou | Yes | OU name |
template | Yes | Template name to add |
Examples
Section titled “Examples”ndcli ou template add production base-firewall-configou template remove
Section titled “ou template remove”Remove a template from an OU.
ndcli ou template remove [ou] [template]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
ou | Yes | OU name |
template | Yes | Template name to remove |
Examples
Section titled “Examples”ndcli ou template remove staging deprecated-template