request system yang add

 

Syntax

Release Information

Command introduced in Junos OS Release 16.1R1 on MX Series and T Series routers.

Command introduced in Junos OS Release 17.1R1 on EX Series and QFX Series switches and PTX Series routers.

Command introduced in Junos OS Release 17.3R1 on SRX345, SRX1500, SRX4100, SRX4200, SRX5400, SRX5600, and SRX5800 devices and vSRX instances.

proxy-xml option introduced in Junos OS Release 17.3R1 on MX Series and PTX Series routers.

Command introduced in Junos OS Release 18.1R1 on ACX Series routers.

snmp option introduced in Junos OS Release 18.3R1.

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.

Note

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.

Note

Starting in Junos OS Release 18.3R1, Junos OS does not support adding, deleting, or updating YANG packages in configuration mode with the run command.

Note

Devices that use the ephemeral configuration database will delete all ephemeral configuration data in the process of rebuilding the schema.

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-nameUser-defined identifier that represents the collection of YANG modules and scripts.
proxy-xml module [modules]List of paths for one or more new modules that provide user-defined OpenConfig mappings for the XML Proxy process to translate Junos Telemetry Interface statistics exported through gRPC into key-value pairs.
snmp List of paths for one or more YANG modules to copy to a predefined location and convert it to JSON format. Later snmpd parses this JSON file and builds its internal database. Requires the package package-name option.
translation-script [scripts]List of paths for one or more translation scripts to add to the device as part of the package.

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