Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Commit and Display Configuration Data for Nonnative YANG Modules

You can load standardized or custom YANG modules onto devices running Junos OS to add data models that are not natively supported by Junos OS but can be supported by translation. When you extend the configuration hierarchy with new data models, you must also supply one or more translation scripts that provide the translation logic to map the nonnative configuration syntax to Junos OS. Translation scripts are enabled by default as soon as you issue the request system yang add or request system yang update command to add them to the device.

You configure nonnative data models in the candidate configuration using the syntax defined for those models. When you configure statements that correspond to third-party YANG data models, for example, OpenConfig or custom YANG data models, the following features are not supported:

  • Using configure batch or configure private mode

  • Configuring statements under the [edit groups] hierarchy

When you commit the configuration, the translation scripts translate the data for those models and commit the corresponding Junos OS configuration as a transient change in the checkout configuration.

Note:

Starting in Junos OS Release 16.1R2, XPath expression evaluations for the following YANG keywords are disabled by default during commit operations: leafref, must, and when. Prior to Junos OS Release 16.1R2, Junos OS evaluates the constraints for these keywords, which can result in longer commit times.

The candidate and active configurations contain the configuration data for nonnative YANG data models in the syntax defined by those models. However, because the translated configuration data is committed as a transient change, the candidate and active configurations do not explicitly display the translated data in the Junos OS syntax when you view the configuration by using commands such as show or show configuration.

You can explicitly display the translated data in Junos OS syntax in the candidate or active configuration by appending the | display translation-scripts filter to the show command in configuration mode or the show configuration command in operational mode. Applying the filter displays the post-inheritance configuration with the translated configuration data from all enabled translation scripts included.

Note:

You can only apply the | display translation-scripts filter to the complete Junos OS configuration. You cannot filter subsections of the configuration hierarchy.

In operational mode, issue the following command to view the committed configuration with translation scripts applied:

Similarly, in configuration mode, issue the following command to view the candidate configuration with translation scripts applied:

The output, which is truncated in this example, displays the complete post-inheritance configuration and includes the nonnative configuration data as well as the translation of that data.

Alternatively, you can view just the translated portions of the hierarchy corresponding to nonnative YANG data models by appending the translated-config keyword to the | display translation-scripts filter. In operational mode, the translated-config keyword returns the translated data for nonnative YANG data models present in the committed configuration. In configuration mode, the translated-config keyword returns the translated data for nonnative YANG data models present in the candidate configuration, which includes both committed and uncommitted configuration data.

The candidate configuration reflects the configuration data that has been configured, but not necessarily committed, on the device. In configuration mode, to display just the configuration differences in the hierarchies corresponding to nonnative YANG data models before or after translation scripts are applied, append the configured-delta or translated-delta keyword, respectively, to the show | display translation-scripts command. In both cases, the XML output displays the deleted configuration data, followed by the new configuration data.

For example, to view the uncommitted configuration changes for the nonnative data models in the syntax defined by those data models, issue the show | display translation-scripts configured-delta command in configuration mode.

To view the uncommitted configuration changes for the nonnative data models after translation into Junos OS syntax, issue the show | display translation-scripts translated-delta command in configuration mode. For example:

In configuration mode, you can better understand the transient changes that will be committed for the nonnative data models by using the various filters. To verify all Junos OS statements that will be committed as transient changes by translation scripts during the commit operation, issue the show | display translation-scripts translated-config command before committing the candidate configuration. To verify the Junos OS statements that will be committed for just the changed configuration data, issue the show | display translation-scripts translated-delta command. If you disable translation scripts for a package, the output for these commands does not include (and the device does not commit) the corresponding Junos OS configuration for those data models for which translation has been disabled.

Note:

Even though nonnative configuration data might be committed in the active configuration, it does not guarantee that the corresponding translated configuration is also committed as a transient change. If you disable translation and then commit nonnative configuration data, the nonnative data is present in the committed configuration. However, the device does not commit the corresponding Junos OS configuration statements as transient changes during the commit operation for any statements in the data models added by that package, even for those statements that were committed prior to disabling translation.

Table 1 summarizes the different filters you can apply to the committed and candidate configurations when they contain configuration data corresponding to nonnative YANG data models. The table indicates the CLI mode for each filter, and the scope and syntax of the output. By selecting different filters, you can view the entire configuration, the translated portions of the configuration, or the uncommitted configuration changes, and you can view the configuration data both before and after processing by translation scripts. In configuration mode, this enables you to better determine the Junos OS changes that will be committed for the nonnative hierarchies.

Table 1: | display translation-scripts Command

Filter

Mode

Description

Syntax and Format of Output

| display translation-scripts

Operational

Return the complete, post-inheritance committed configuration and include the translation of the nonnative data into Junos OS syntax.

YANG data model and Junos OS syntax as ASCII text

Configuration

Return the complete, post-inheritance candidate configuration and include the translation of the nonnative data into Junos OS syntax.

YANG data model and Junos OS syntax as ASCII text

| display translation-scripts translated-config

Operational

Return the translated data corresponding to all nonnative YANG data models in the committed configuration.

Junos OS ASCII text

Configuration

Return the translated data corresponding to all nonnative YANG data models in the candidate configuration.

Junos OS ASCII text

| display translation-scripts configured-delta

Configuration

Return the uncommitted changes in the candidate configuration corresponding to nonnative YANG data models in the syntax defined by that model.

YANG data model XML

| display translation-scripts translated-delta

Configuration

Return the uncommitted changes in the candidate configuration corresponding to nonnative YANG data models after translation into Junos OS syntax.

Junos OS XML

Release History Table
Release
Description
16.1R2
Starting in Junos OS Release 16.1R2, XPath expression evaluations for the following YANG keywords are disabled by default during commit operations: leafref, must, and when. Prior to Junos OS Release 16.1R2, Junos OS evaluates the constraints for these keywords, which can result in longer commit times.