Apply

The apply command allows you to stage configuration changes by allowing proposed changes to be held in memory, separate from active configuration until they are applied.

This may be considered from a user perspective like this:

"When I am adding users and realize that groups are missing, I can take a pause and add the groups without having to discard my work so far."

or

"When I am in the process of creating a new firewall zone but there is required service missing, I can go off and add the service and come back without losing changes."

You can choose to apply changes in the following manner:

  • Isolated changes that are specific to sections of configuration.

  • Across all configurations.

Parameters

When no parameters are provided, the command applies the changes in the current item context. For example, if the current context is user consoleuser, any changes to the consoleuseruser are saved. If the apply command is used outside of an item context, this results in an error.

apply all – When the ‘all’ parameter is added, the command applies all changes to all items that have been changed in this session.

Syntax

apply [all]

example

Apply changes to a single item

These commands change a user. Then the apply command is used while still in the “user myuser” item context so only changes to this user are applied:

config: user myuser
config(user myuser): password secret123 description "This is my user"
config(user myuser): apply

Apply all Changes

These commands add a new group and then change a port setting. At the end, the apply all command saves both the group and port items.

config: add group mygroup

config: group mygroup

config(group mygroup): access_rights

config(group mygroup access_rights): add pmshell

config(group mygroup access_rights): up

config(group mygroup): ports

config(group mygroup ports): add port01

config(group mygroup ports): top

config: port port01

config(port port01): label "Port for my group"

config(port port01): top

config: apply all

Apply Changes to Specific Sections of Configuration

From within a specific section of hierarchy the following example applies any changes made specifically within the user’s configuration section.

config users johnsmith

apply

Apply changes from a different section in the hierarchy

For example, if changes have been made in

config users johnsmith

but the user has moved elsewhere in the hierarchy, the command:

apply users johnsmith

applies any changes made specifically within the user’s configuration section.

Alternatively, a user might choose to apply all changes in the user list using the following command:

apply users

Using apply across all configurations

apply

apply all