HPE Networking Data Center Director CLI Utility Commands

A few examples of apstra-cli commands. The complete list is available in apstra-cli.

cli-commands execute

You can now use a new ApstraDC Director CLI command cli-commands execute to create and execute lists of show commands across multiple devices. This feature helps you troubleshoot and collect data for your devices. You can define the command sets once and then run them against specific devices or device roles, such as leaf, spine, or access switches within your data center. You can see the command output on your screen, and this output is automatically saved as a compressed tar.gz file for later analysis.

This enhancement reduces the time needed to perform routine device queries, and it also provides a consistent method for collecting diagnostic information across your network infrastructure. The compressed output format makes it simple to share diagnostic data with support teams or archive operational snapshots. the role-based targeting eliminates the need for you to specify individual device identifiers for common troubleshooting scenarios.

You can use this command at the apstra-cli> prompt of your Apstra server.

This command has the following options:

Command-line interface help menu for the cli-commands execute command in apstra-cli tool. Lists options including blueprint ID, role, specific system, command list file, output format, output directory, and help.

Here's an example of the command with some of the specified options:

Command-line interface displaying execution of apstra-cli command with parameters for blueprint evpn-virtual, role Leaf, and output saved in text format to /mytmp. Command execution status is success.

Specify the IP address of the Apstra DC Director server:

Terminal showing Juniper Apstra CLI commands for managing network infrastructure, including container execution and version display.

The results output is archived in the /mytmp directory:

Terminal showing logs archived to /mytmp/Downloads/clidemo/DC1 - SE Demo-2025-07-23.tar.gzHere are some of the output logs:

File explorer showing the clidemo folder on macOS. Highlighted file: 525400AA7238_Leaf3_10.28.173.17.log, 13 KB. Folder contains log files, a subfolder, and a compressed archive. Sorted by Date Modified. Sidebar shows locations like Recents and Documents.

Here are the results of the show version command for Leaf3:

CLI output showing system info for a Juniper device: hostname leaf, model ex1214, JUNOS OS software versions, including kernel, libraries, routing, and telemetry components.

Here are some of the commands you have saved in your egg.csv file:

Text editor showing a file named egg.csv in Downloads folder. The file contains two lines: show version and show interface terse. Tab labeled Audit Table is visible.

scenario change-device-password

To comply with security requirements and best practices you may need to change root passwords and local user passwords on device system agents on a regular basis. You can change passwords on all devices in a blueprint by running a single command. Instead of entering a specific system ID you would enter all.

Use the following command to change all devices at once:

scenario change-device-password --blueprint <bp_id> --system all --old-password <old_password> --new-password <new_password>

Use the following command to change a specific device:

scenario change-device-password --blueprint <bp_id> --system <sys_id> --old-password <old_password> --new-password <new_password>

scenario change-device-password is a collection of the following eleven tasks:

  • Check old password by ssh connection

  • State creation of configlet for password

  • Commit blueprint

  • Check new password by ssh connection

  • Change system agent password

  • Check system agent status

  • Update device pristine config
  • State deletion of configlet used for password change

  • Commit blueprint

  • Check new password by ssh connection

  • Check system agent status

scenario change-root-password

This command applies to Juniper, Arista and SONiC devices. Cisco devices are not supported. Use the following command to change all device root passwords at once:

scenario change-root-password --all --old-password <password> --new-password <password>

Use the following command to change a specific device root password:

scenario change-root-password --system <system> --old-password <password> --new-password <password>

config-syntax-check (Juniper only)

Command Syntax for Datacenter blueprints:

blueprint --blueprint <bp_id> config-syntax-check --system <sys_id> --username <device_username> --password <device_password>

Command Syntax for Freeform blueprints:

blueprint --blueprint <bp_id> freeform-system config-syntax-check --system <sys_id> --username <device_username> --password <device_password>

With the config-syntax-check command, you can verify configuration syntax on your Juniper devices before committing your blueprint. This check is useful when working with configlets in Datacenter blueprints and when working with config templates in Freeform blueprints.

This command works only with hierarchical configuration to verify whether configuration syntax is correct. It doesn't work for set commands.