# Config Commands

## nv config apply

In Cumulus Linux 5.8 and earlier, the `nv config apply` command applies the current pending configuration. This command does not save the configuration; the configuration does not persist after a reboot. To save the startup configuration automatically when you run `nv config apply` without having to run the `nv config save` command, run the `nv set system config auto-save enable on` command.

In Cumulus Linux 5.9 and later, auto save is `on` by default; the `nv config apply` command automatically saves the configuration and the configuration persists after a reboot.

You can specify the following options with the `nv config apply` command:

- `--y` or `--assume-yes` automatically replies yes to all prompts.
- `--assume-no` automatically replies no to all prompts.
- `--confirm` applies the configuration change, but you must confirm the applied configuration. If you do not confirm within ten minutes, the configuration rolls back automatically. You can change the default time with the `apply --confirm <time>` command. For example, `nv config apply --confirm 60` requires you to confirm within one hour.
- `--confirm-status` shows the amount of time left before the automatic rollback.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv config apply --y

## nv config apply <revision>

Applies a specific configuration revision.

In Cumulus Linux 5.8 and earlier, the `nv config apply <revision>` command applies the configuration for the revision. This command does not save the configuration; the configuration does not persist after a reboot. To save the revision automatically when you run `nv config apply <revision>` without having to run the `nv config save` command, run the `nv set system config auto-save enable on` command.

In Cumulus Linux 5.9 and later, auto save is `on` by default; the `nv config apply <revision>` command automatically saves the configuration for the revision and the configuration persists after a reboot. You can specify the following options with this command:

- `--y` or `--assume-yes` automatically replies yes to all prompts.
- `--assume-no` automatically replies no to all prompts.
- `--confirm` applies the configuration change, but you must confirm the applied configuration. If you do not confirm within ten minutes, the configuration rolls back automatically. You can change the default time with the `apply --confirm <time>` command. For example, `nv config apply --confirm 60` requires you to confirm within one hour.
- `--confirm-status` shows the amount of time left before the automatic rollback.

### Command Syntax

Syntax | Description
--- | ---
`<revision>` | The configuration revision you want to apply instead of the current pending configuration. You can specify `applied`, `startup`, `empty`, or a revision number.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv config apply 5 --y

## nv config attach <revision-id></h>

Attaches the configuration to a revision.

### Command Syntax

Syntax | Description
--- | ---
`<revision-id>` | The revision ID.

### Version History

Introduced in Cumulus Linux 5.12.0

### Example

    cumulus@switch:~$ nv config attach 27
    attached [rev_id: 27]

## nv config delete <revision-id>

Deletes a revision.

### Command Syntax

Syntax | Description
--- | ---
`<revision-id>` | The revision ID.

### Version History

Introduced in Cumulus Linux 5.12.0

### Example

    cumulus@switch:~$ nv config delete 4

## nv config detach

Detaches the configuration from the current pending configuration. When you run this command, NVUE discards all configuration changes between the last `nv config apply` command and the `nv config detach` command.”

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv config detach

## nv config diff <revision-base> <revision-target>

Shows the differences between configurations, such as the startup configuration and the applied configuration, or the applied configuration and a specific configuration revision.

### Command Syntax

Syntax | Description
--- | ---
`<revision-base>` | The base configuration revision you want to compare against. You can specify applied, startup, or a specific configuration revision number.
`<revision-target>` | The target configuration revision you want to compare against. You can specify applied, startup, or a specific configuration revision number.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv config diff 1 2

## nv config find

Finds a portion of the applied configuration according to the search string you provide.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv config find stp
    - set:
        bridge:
          domain:
            br_default:
              stp:
                mode: pvrst
                vlan:
                  '10':
                    bridge-priority: 4096
                    forward-delay: 4
                    hello-time: 4
                    max-age: 6
                  '20':
                    bridge-priority: 61440
                    forward-delay: 4
                    hello-time: 4
                    max-age: 6

## nv config history

Shows the `apply` history for the current configuration revision.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv config history

## nv config history <revision>

Shows the `apply` history for a specific configuration revision.

### Command Syntax

Syntax | Description
--- | ---
`<revision>` | The revision whose `apply` history you want to show.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv config history 5

## nv config patch <file>

Updates the pending configuration with an NVUE configuration file in YAML format.

In Cumulus Linux 5.13 and later, you can specify a text file containing `nv set` and `nv unset` commands instead of a yaml file.

### Command Syntax

Syntax | Description
--- | ---
`<file>` | The file you want to use to update the pending configuration.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv config patch myconfig.yaml

## nv config replace <nvue-file>

Replaces the pending configuration with the specified YAML configuration file.

In Cumulus Linux 5.13 and later, you can specify a text file containing `nv set` and `nv unset` commands instead of a yaml file.

### Command Syntax

Syntax | Description
--- | ---
`<nvue-file>` | The file you want to use to update the pending configuration.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv config replace myconfig.yaml

## nv config revision

Shows the configuration revisions on the switch.

### Version History

Introduced in Cumulus Linux 5.5.0

### Example

    cumulus@switch:~$ nv config revision
    Rev ID                State              Apply ID                          Apply Date           Type      User     Reason         Message
    --------------------  -----------------  --------------------------------  -------------------  --------  -------  -------------  -------------------------------
    1                     applied_and_saved  rev_1_apply_1                     2024-04-26 11:24:50  CLI       root     Config update  Password sync for user: cumulus
    2                     applied_and_saved  rev_2_apply_2                     2024-04-26 16:06:14  CLI       cumulus  Config update  Config update by cumulus
    3                     applied_and_saved  rev_3_apply_1                     2024-04-26 16:17:21  CLI       cumulus  Config update  Config update by cumulus
    4                     applied_and_saved  rev_4_apply_1                     2024-04-26 16:34:04  CLI       cumulus  Config update  Config update by cumulus

## nv config save

Overwrites the startup configuration with the applied configuration by writing to the `/etc/nvue.d/startup.yaml` file. The configuration persists after a reboot.

In Cumulus Linux 5.9 and later, auto save is enabled by default; NVUE saves the configuration to the `/etc/nvue.d/startup.yaml` file automatically. Run this command to save the applied configuration if NVUE auto save if disabled.

In Cumulus Linux 5.8 and earlier, auto save is disabled by default.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv config save

## nv config show

Shows the currently applied configuration in YAML format.

- To show the configuration on the switch in YAML format and include all default options, run the `nv config show --all` command.
- To show the configuration for a specific revision, run the `nv config show -r <rev-id>` command.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv config show
     header:
        model: VX
        nvue-api-version: nvue_v1
        rev-id: 1.0
        version: Cumulus Linux 5.7.0
    - set:
        bridge:
          domain:
            br_default:
              vlan:
                '10':
                  vni:
                    '10': {}
                '20':
                  vni:
                    '20': {}
                '30':
                  vni:
                    '30': {}
        evpn:
          enable: on
        interface:
          bond1:
            bond:
              member:
                swp1: {}
              mlag:
                id: 1
            bridge:
              domain:
                br_default:
                  access: 10
          bond1-3:
            bond:
              lacp-bypass: on
              mlag:
                enable: on
            link:
              mtu: 9000
            type: bond
    ...

## nv config translate revision <revision-id>

Translates an NVUE configuration revision into NVUE commands. The revision ID must be either an integer or a named revision (such as startup or applied).

If the revision is not readable, is in an invalid format, or includes invalid parameters, NVUE returns an error message and prompts you to correct the issue before proceeding.

### Command Syntax

Syntax | Description
--- | ---
`<revision-id>` | The revision ID.

### Version History

Introduced in Cumulus Linux 5.12.0

### Example

    cumulus@switch:~$ nv config translate revision 10

## nv config translate filename <filename>

Translates an NVUE configuration yaml file into NVUE commands. The configuration file must be located on the switch and must include the full path to the file containing the configuration you want to translate. The file must be in YAML format and must be accessible with proper read permissions.

If the yaml file is not readable, is in an invalid format, or includes invalid parameters, NVUE returns an error message and prompts you to correct the issue before proceeding.

### Command Syntax

Syntax | Description
--- | ---
`<filename>` | The yaml file you want to translate.

### Version History

Introduced in Cumulus Linux 5.12.0

### Example

    cumulus@switch:~$ nv config translate filename /home/cumulus/backup.yaml