Understanding Junos YANG Modules
Juniper Networks publishes the schema for Junos devices using YANG models for the configuration and operational state data, operational commands, and Junos extensions. The following sections discuss the native Junos YANG modules.
Junos YANG Modules Overview
Juniper Networks provides YANG modules that define the configuration hierarchies,
operational commands and state data, as well as YANG extensions and types, for devices
running Junos OS and devices running Junos OS Evolved. YANG modules are specific to a device
family. Table 1
outlines the identifiers for the different device families and indicates which platforms are
in each family. Starting in Junos OS Evolved Release 23.4R2, all Junos OS Evolved platforms
use the junos device family identifier.
|
Device Family Identifier |
Junos OS Platforms |
Junos OS Evolved Platforms |
|---|---|---|
|
junos |
ACX Series |
ACX Series |
|
junos-es |
SRX Series |
– |
|
junos-ex |
EX Series (certain platforms) |
– |
|
junos-qfx |
QFX Series |
QFX Series (23.2 and earlier) |
Different platforms within the same series might be categorized under different device
families. You can verify the family for a specific device by executing the show
system information operational mode command or the
<get-system-information/> RPC on the device. The value of the
Family field in the command output or the
<os-name> element in the RPC reply indicates the device
family.
Table 2 summarizes the YANG modules that are native to Junos devices. A Junos YANG module's name and filename include the device family, and when applicable, the area of the configuration or command hierarchy to which the schema in the module belongs. The module's filename also includes a revision date.
Modules that do not require family-specific schemas and that are common to all platforms
use the junos device family for the module's name, filename, and
namespace.
|
Junos YANG Module |
Description |
Module Name |
Releases |
|---|---|---|---|
|
Configuration modules |
Define the schema for the Junos configuration hierarchy. The configuration YANG module comprises a root module (family-conf-root) that is augmented by multiple smaller modules. |
|
17.4R1 and later |
|
Operational command modules |
Represent the operational command hierarchy and the collective group of modules that define the remote procedure calls (RPCs) for operational mode commands. There are separate modules for the different areas of the command hierarchy. |
|
17.4R1 and later |
junos-state state modules |
Curated set of YANG modules for operational state data. | junos-state-area |
22.2R1 and later |
|
|
Define YANG data models for operational state. The models expose a subset of show
command data through the gNMI |
|
24.2R1 and later (Junos OS Evolved) 25.4R1 and later (Junos OS) |
|
DDL extensions module |
Contains Data Definition Language (DDL) statements for Junos devices. This module includes the |
|
17.4R1 and later |
|
ODL extensions module |
Contains Output Definition Language (ODL) statements that you can use to create and customize formatted ASCII output for RPCs executed on Junos devices. |
|
17.4R1 and later |
|
Metadata annotations extensions module |
Defines metadata annotations for configuration operations. Annotations are defined in RFC 7952, Defining and Using Metadata with YANG. |
junos-configuration-metadata |
22.2R1 and later (Junos OS Evolved) |
|
Types module |
Contains definitions for YANG types. |
|
17.4R1 and later |
To support YANG modules for different device families in different releases, the downloaded modules are organized by device family. Each module’s name, filename, and namespace reflects the device family to which the schema in the module belongs.
For information about obtaining the modules, see Download and Generate Junos YANG Modules.
For information about the module namespaces, see Understanding Junos YANG Module Namespaces and Prefixes.
Download and Generate Junos YANG Modules
You can retrieve the Junos OS and Junos OS Evolved YANG modules by:
-
Downloading the modules from the Juniper Networks website at https://www.juniper.net/support/downloads
-
Downloading the modules from the Juniper/yang GitHub repository
-
Generating the modules on a Juniper Networks device
Starting in Junos OS Evolved Release 23.4R1, we publish the Junos OS Evolved native Yang modules on the Juniper Networks download site and on GitHub. In earlier releases, you must generate the modules on the device.
Junos YANG modules are specific to a device family. As a result, the download package and GitHub repository include a separate directory for each device family’s modules. They also include a common directory for the modules that are common to all device families. Each family-specific directory uses its device family identifier as the directory name and contains the modules supported by the platforms in that family. The device family identifiers are defined in Table 1.
The YANG modules generated on a local device, by default, contain family-specific schemas.
Family-specific schemas are identical across all devices in the given device family. You can
generate modules with device-specific schemas for the configuration and operational command
modules. To emit device-specific schemas, configure the device-specific
configuration statement at the [edit system services netconf yang-modules]
hierarchy level.
Starting in Junos OS Evolved Release 23.4R1, we publish the Junos OS Evolved YANG modules on the Juniper Networks download site and on GitHub. In earlier releases, you must generate the modules on the device.
Additionally, starting in Junos OS Release 23.4R1 and Junos OS Evolved Release 23.4R1, we provide all YANG data models for a given OS and release in a single download package and GitHub repository folder. The package and repository folder include:
-
Native configuration, state, and RPC data models
-
OpenConfig configuration and state models supported by that OS
-
IETF models supported by that OS
For more information about how to download or generate the Junos OS YANG modules, see Use Juniper Networks YANG Modules.
Understanding Junos YANG Module Namespaces and Prefixes
The Junos YANG modules use a namespace that includes the device family, the module type, and an identifier that is unique to each module. The identifier differentiates the namespace of the module from that of other modules. The namespace format is:
namespace "http://yang.juniper.net/device-family/type/identifier";
Where:
device-family |
Identifier for the device family to which the schema in the module belongs, for
example, Modules with device-specific schemas and modules with family-specific schemas both use the same device family identifier in the namespace. Note:
The common modules use the |
identifier |
String that differentiates the namespace of the module from that of other modules. Junos configuration and command modules include an identifier that indicates the area
of the configuration or command hierarchy to which the schema in the module belongs.
|
type |
Type of the module. Possible values include:
|
Table 3
outlines each module’s namespace URI and prefix (as defined by the module’s
prefix statement). The prefix for each configuration YANG module reflects
the configuration statement hierarchy that is included in that module. Similarly, the prefix
for each operational command module reflects the command hierarchy area of the RPCs included
in that module. The Junos YANG extension and type modules use the junos
device family identifier in the namespace, but the modules are common to all device
families.
|
YANG Module |
Release |
Namespace URI |
Prefix |
|---|---|---|---|
|
Configuration modules |
17.4R1 and later |
http://yang.juniper.net/device-family/conf/hierarchy |
|
|
Operational command modules |
17.4R1 and later |
http://yang.juniper.net/device-family/rpc/hierarchy |
hierarchy |
junos-state state modules |
22.2R1 and later | http://yang.juniper.net/junos/state/state-area |
js-area |
|
|
24.2R1 and later |
|
|
|
DDL extensions module |
17.4R1 and later |
http://yang.juniper.net/junos/common/ddl-extensions |
|
|
ODL extensions module |
17.4R1 and later |
http://yang.juniper.net/junos/common/odl-extensions |
|
|
Metadata annotations |
22.2R1 and later |
http://yang.juniper.net/junos/jcmd |
jcmd |
|
Types module |
17.4R1 and later |
http://yang.juniper.net/junos/common/types |
|
When you configure the rfc-compliant statement at the [edit system
services netconf] hierarchy level and request configuration data in a NETCONF
session, the server sets the default namespace for the
<configuration> element to the same namespace as in the
corresponding YANG model. For example:
<rpc>
<get-config>
<source>
<running/>
</source>
</get-config>
</rpc>
<nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/25.2R1.8-EVO/junos">
<nc:data>
<configuration
xmlns="http://yang.juniper.net/junos/conf/root"
junos:commit-seconds="1763162210"
junos:commit-localtime="2025-11-14 15:16:50 PST"
junos:commit-user="admin">
...
</configuration>
</nc:data>
</nc:rpc-reply>
Change History Table
Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.
junos device family identifier instead of
junos-qfx.junos:command extension
statement in schemas emitted with extensions.