Understanding the YANG Module for Junos OS Extensions

 

The Junos OS extensions YANG module contains YANG extensions for devices running Junos OS. These extensions include the must and must-message statements, which identify configuration hierarchy constraints that contain special keywords. The module also contains statements that you can include in custom RPCs to define a CLI command for the RPC and to specify details about the action script to invoke when the RPC is executed.

Note

Starting in Junos OS Release 17.4, Junos OS YANG modules use a new naming convention for the module’s name, filename, and namespace. The module’s name and filename include the device family and Junos OS release, and the filename also includes a revision date.

Table 1 outlines the statements in the extensions module and provides a brief description of each statement.

Table 1: Statements in the junos-extension Module

Statement Keyword

Argument Description

action-execute

Define the actions taken when you execute a custom RPC. Use the script substatement to define the RPC’s action script.

Starting in Junos OS Release 17.3, the action-execute statement is a substatement to command.

command

String defining the operational command that is used to execute the corresponding RPC in the Junos OS CLI.

Starting in Junos OS Release 17.3, the command statement includes the substatement action-execute, which defines the actions taken when you execute the RPC.

must

String that identifies a constraint on the configuration data.

Whereas the argument for the YANG must statement is a string containing an XPath expression, the argument for the junos:must extension statement is a string containing special Junos OS syntax required for the expression of the configuration statement path. This might include special keywords such as any, all, and unique.

must-message

String that defines the warning message that is emitted when the constraint defined by the corresponding junos:must statement evaluates to false.

pattern-message

String that defines the error message emitted when the constraint defined by the corresponding posix-pattern statement evaluates to false.

posix-pattern

Restrict the values accepted for nodes of type string to those that match the POSIX regular expression defined in this string.

script

String specifying the name of the action script that serves as an RPC’s handler and that gets invoked when you execute the RPC. This is a substatement of the action-execute statement.

Release History Table
Release
Description
Starting in Junos OS Release 17.4, Junos OS YANG modules use a new naming convention for the module’s name, filename, and namespace.