- play_arrow Overview
- play_arrow NETCONF XML Management Protocol Overview
- play_arrow NETCONF and Junos XML Tags Overview
- XML and Junos OS Overview
- XML Overview
- XML and NETCONF XML Management Protocol Conventions Overview
- Map Junos OS Commands and Command Output to Junos XML Tag Elements
- Map Configuration Statements to Junos XML Tag Elements
- Using NETCONF Configuration Response Tag Elements in NETCONF Requests and Configuration Changes
-
- play_arrow Manage NETCONF Sessions
- play_arrow NETCONF Session Overview
- play_arrow Manage NETCONF Sessions
- Establish an SSH Connection for a NETCONF Session
- NETCONF Sessions over Transport Layer Security (TLS)
- NETCONF and Shell Sessions over Enhanced Outbound HTTPS
- NETCONF Sessions over Outbound HTTPS
- NETCONF Call Home Sessions
- NETCONF Sessions
- Sample NETCONF Session
- How Character Encoding Works on Juniper Networks Devices
- Configure RFC-Compliant NETCONF Sessions
- NETCONF Monitoring
- NETCONF Event Notifications
- play_arrow NETCONF Tracing Operations
- play_arrow NETCONF Protocol Operations and Attributes
- play_arrow NETCONF Request and Response Tags
- play_arrow Junos XML Protocol Elements Supported in NETCONF Sessions
- <abort/>
- <abort-acknowledgement/>
- <checksum-information>
- <close-configuration/>
- <commit-configuration>
- <commit-results>
- <commit-revision-information>
- <database-status>
- <database-status-information>
- <end-session/>
- <get-checksum-information>
- <get-configuration>
- <load-configuration>
- <load-configuration-results>
- <lock-configuration/>
- <open-configuration>
- <reason>
- <request-end-session/>
- <routing-engine>
- <unlock-configuration/>
- <xnm:error>
- <xnm:warning>
- play_arrow Junos XML Protocol Element Attributes Supported in NETCONF Sessions
-
- play_arrow Manage Configurations Using NETCONF
- play_arrow Change the Configuration Using NETCONF
- Edit the Configuration Using NETCONF
- Upload and Format Configuration Data in a NETCONF Session
- Set the Edit Configuration Mode in a NETCONF Session
- Handle Errors While Editing the Candidate Configuration in a NETCONF Session
- Replace the Candidate Configuration Using NETCONF
- Roll Back Uncommitted Changes in the Candidate Configuration Using NETCONF
- Delete the Configuration Using NETCONF
- Change Individual Configuration Elements Using NETCONF
- Merge Configuration Elements Using NETCONF
- Create Configuration Elements Using NETCONF
- Delete Configuration Elements Using NETCONF
- Replace Configuration Elements Using NETCONF
- Replace Patterns in Configuration Data Using the NETCONF or Junos XML Protocol
- play_arrow Commit the Configuration Using NETCONF
- play_arrow Ephemeral Configuration Database
- Understanding the Ephemeral Configuration Database
- Unsupported Configuration Statements in the Ephemeral Configuration Database
- Enable and Configure Instances of the Ephemeral Configuration Database
- Commit and Synchronize Ephemeral Configuration Data Using the NETCONF or Junos XML Protocol
- Managing Ephemeral Configuration Database Space
- Example: Configure the Ephemeral Configuration Database Using NETCONF
-
- play_arrow Request Operational and Configuration Information Using NETCONF
- play_arrow Request Operational Information Using NETCONF
- play_arrow Request Configuration Information Using NETCONF
- Request the Committed Configuration and Device State Using NETCONF
- Request Configuration Data Using NETCONF
- Specify the Source for Configuration Information Requests Using NETCONF
- Specify the Scope of Configuration Information to Return in a NETCONF Response
- Request the Complete Configuration Using NETCONF
- Request a Configuration Hierarchy Level or Container Object Without an Identifier Using NETCONF
- Request All Configuration Objects of a Specified Type Using NETCONF
- Request Identifiers for Configuration Objects of a Specified Type Using NETCONF
- Request A Specific Configuration Object Using NETCONF
- Request Specific Child Tags for a Configuration Object Using NETCONF
- Request Multiple Configuration Elements Simultaneously Using NETCONF
- Retrieve a Previous (Rollback) Configuration Using NETCONF
- Compare Two Previous (Rollback) Configurations Using NETCONF
- Retrieve the Rescue Configuration Using NETCONF
- Request an XML Schema for the Configuration Hierarchy Using NETCONF
-
- play_arrow NETCONF Utilities
- play_arrow NETCONF Perl Client
- play_arrow Develop NETCONF Perl Client Applications
- Write NETCONF Perl Client Applications
- Import Perl Modules and Declare Constants in NETCONF Perl Client Applications
- Connect to the NETCONF Server in Perl Client Applications
- Collect Parameters Interactively in NETCONF Perl Client Applications
- Submit a Request to the NETCONF Server in Perl Client Applications
- Example: Request an Inventory of Hardware Components Using a NETCONF Perl Client Application
- Example: Change the Configuration Using a NETCONF Perl Client Application
- Parse the NETCONF Server Response in Perl Client Applications
- Close the Connection to the NETCONF Server in Perl Client Applications
-
- play_arrow OpenDaylight Integration
- play_arrow Configure OpenDaylight Integration
-
- play_arrow Configuration Statements and Operational Commands
Create Translation Scripts for YANG Configuration Models
You can load YANG modules on Junos devices to add data models that are not natively supported by the OS but can be supported by translation. When you extend the configuration hierarchy with nonnative YANG data models, you must also supply one or more translation scripts that provide the logic to map the nonnative configuration syntax to the corresponding Junos OS syntax.
Translation scripts perform two main functions:
Convert the configuration data corresponding to the nonnative YANG data models into Junos OS syntax
Add the translated configuration data as a transient change in the checkout configuration during the commit operation
Translation scripts can be written in either Python or SLAX and are similar to commit scripts in structure. For information about creating SLAX and Python scripts that generate transient changes in the configuration, see the Automation Scripting User Guide.
You use the request system yang add
or request system yang
update
commands to add YANG modules and their associated translation
scripts to a new or existing YANG package on the device. After you add the modules
and translation scripts to the device, you can configure the statements and
hierarchies in the data model added by those modules. When you load and commit the
configuration data, the device calls the script to perform the translation and
generate the transient configuration change.
This topic discusses the general structure for translation scripts. The specific translation logic required in the actual script depends on the custom hierarchies added to the schema and is beyond the scope of this topic.
To create the framework for translation scripts that are used on Junos devices:
On the device, perform the following tasks before adding the translation script to a YANG package:
If the translation script is written in Python, enable the device to execute unsigned Python scripts by configuring the
language python
orlanguage python3
statement, as appropriate for the Junos OS release.content_copy zoom_out_map[edit] user@host# set system scripts language (python | python3)
Note:Starting in Junos OS Release 20.2R1 and Junos OS Evolved Release 22.3R1, the device uses Python 3 to execute YANG action and translation scripts. In earlier releases, Junos OS only uses Python 2.7 to execute these scripts, and Junos OS Evolved uses Python 2.7 by default to execute the scripts.
Download the script to the device, and optionally validate the syntax.
content_copy zoom_out_mapuser@host> request system yang validate translation-script script
Before you can use translation scripts on a device, you must add the scripts and
associated modules to a new or existing YANG package by issuing the request
system yang add
or request system yang update
command.
After the modules and scripts are added, the translation scripts are automatically
invoked when you commit configuration data in the corresponding data 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
orconfigure private
modeConfiguring statements under the
[edit groups]
hierarchy
The active and candidate configurations contain the configuration data for the
nonnative YANG data models in the syntax defined by those models. However, because
the translated configuration data is committed as a transient change, the active and
candidate configurations do not explicitly display the translated data in the Junos
OS syntax when you issue the show
or show
configuration
commands. To apply YANG translation scripts when you view
the configuration, use the | display translation-scripts
filter.
To view the complete post-inheritance configuration with the translated data
(transient changes) explicitly included, append the | display
translation-scripts
filter to the show configuration
command in operational mode or the show
command in configuration
mode. To view just the nonnative configuration data after translation, use the
| display translation-scripts translated-config
filter.
In configuration mode, to display just the changes to the configuration data
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 more information about the | display translation-scripts
filter,
see Commit and Display Configuration Data for Nonnative YANG Modules.
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.