request system yang add
Syntax
request system yang add package package-name module [modules] <action-script [scripts]> <translation-script [scripts]> <deviation-module [modules]> <proxy-xml> <snmp>
Description
Define a new YANG package with the modules, deviation modules, and scripts that are added to the device as part of the package, and merge the data models defined in the modules with the Junos OS schema. When you add a custom YANG data model to the device, you must also add at least one translation script or one action script, which provides the mapping between the new data model and Junos OS. To add multiple modules or scripts, include a space-delimited list of absolute or relative file paths enclosed in brackets.
To install OpenConfig modules that are packaged as a compressed
tar file, use the request system software add
command.
OpenConfig modules and scripts that are installed using the request
system software add
command are always associated with the package
identifier openconfig
.
When you create a new package, the device stores copies of the module and script files in a new location. The device also stores copies of the action script and translation script files under the /var/db/scripts/action and /var/db/scripts/translation directories, respectively. Junos OS validates the syntax of the modules and scripts, rebuilds its schema to include the new data models, and then validates the active configuration against this schema. Newly added RPCs and configuration hierarchies are immediately available for use.
Devices that use the ephemeral configuration database will delete all ephemeral configuration data in the process of rebuilding the schema.
To prevent CLI-related or configuration database errors, we recommend that you do not perform any CLI operations, change the configuration, or terminate the operation while a device is in the process of adding, updating, or deleting a YANG package and modifying the schema.
Starting in Junos OS Release 18.3R1, adding, deleting,
or updating YANG packages in configuration mode with the run
command is not supported.
Options
action-script [scripts] | List of paths for one or more action scripts to add to the device as part of the package. |
module [modules] | List of paths for one or more YANG modules to add to the device as part of the package. The device merges the data models defined in the modules with the Junos OS schema. |
deviation-module [modules] | (Optional) List of paths for one or more modules that define deviation statements that should be applied to modules in the package. |
package package-name | User-defined identifier that represents the collection of YANG modules and scripts. |
proxy-xml |
(Optional) Specify that |
snmp |
(Optional) Specify that |
translation-script [scripts] | List of paths for one or more translation scripts to add to the device as part of a package. YANG modules that define configuration data models require one or more translation scripts to map the nonnative configuration syntax to the corresponding Junos OS syntax. |
Required Privilege Level
maintenance
Sample Output
request system yang add
user@host> request system yang add package p1 module [yang/if.yang yang/if-aggregate.yang yang/if-show.yang] deviation-module yang/deviation/if-devs.yang translation-script translation/if.slax action-script action/if-show.py YANG modules validation : START YANG modules validation : SUCCESS Scripts syntax validation : START script check succeeds Scripts syntax validation : SUCCESS Scripts syntax validation : START Scripts syntax validation : SUCCESS TLV generation: START TLV generation: SUCCESS Building schema and reloading /config/juniper.conf.gz ... Activating /config/juniper.conf.gz ... mgd: commit complete Restarting mgd ... WARNING: cli has been replaced by an updated version: CLI release 16.1R1 built by builder on 2016–03–30 13:46:11 UTC Restart cli using the new version ? [yes,no] (yes) yes Restarting cli ... user@host>
Release Information
Command introduced in Junos OS Release 16.1R1.
proxy-xml
option introduced in Junos OS Release 17.3R1
on MX Series and PTX Series routers.
snmp
option introduced in Junos OS Release 18.3R1.