- 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
Use Custom YANG RPCs on Devices Running Junos OS
You can add YANG data models that define custom RPCs on supported devices running Junos OS. Creating custom RPCs enables you to precisely define the input parameters and operations and the output fields and formatting for your specific operational tasks on those devices.
To add an RPC to a device running Junos OS, download the YANG
module that defines the RPC, along with any required action scripts
to the device, and add the files to a new or existing YANG package
by issuing the request system yang add
or request
system yang update
operational command. For detailed information
about adding YANG modules to devices running Junos OS, see Manage YANG Packages, Modules, and Scripts on Junos Devices.
Starting in Junos OS Release 17.3R1, when you load custom YANG data models onto the device, you do not need to explicitly load any required Junos OS extension modules. In earlier releases, you must load the Junos OS extension modules for any packages that use the modules.
After you add the modules and action scripts to the device,
you can execute the RPC either locally, provided that the RPC definition
includes the junos:command
statement, or
remotely. To execute an RPC in the Junos OS CLI, issue the command
defined by the RPC’s junos:command
statement. To execute an RPC remotely, use the RPC name in an RPC
request operation.
Consider the following YANG module and RPC definition:
module sw-info { namespace "http://yang.juniper.net/examples/rpc-cli"; prefix rpc-cli; import junos-extension { prefix junos; } rpc get-sw-info { description "Show software information"; junos:command "show sw-info" { junos:action-execute { junos:script "sw-info.py"; } } input { leaf routing-engine { type string; description "Routing engine for which to display information"; } ... } output { ... } } }
Starting in Junos OS Release 17.3, the action-execute
statement is a substatement to command
. In earlier releases, the action-execute
and command
statements are placed at
the same level, and the command
statement
is optional.
To execute this RPC in the Junos OS CLI, issue the show sw-info
command defined by the junos:command
statement, and include any required or optional input parameters.
For example:
user@host> show sw-info routing-engine re0
To execute this RPC remotely, send an RPC request that uses the RPC name for the request tag, and include any required or optional input parameters.
<rpc> <get-sw-info> <routing-engine>re0</routing-engine> </get-sw-info> </rpc>
When you execute a custom RPC, the device invokes the action
script that is defined in the junos:script
statement, which in this example is the sw-info.py script. An RPC’s action script should emit any necessary XML
elements for that RPC’s output.
When you execute an RPC in the Junos OS CLI by issuing the command
defined by the junos:command
statement,
the device displays the RPC output, if there is any, using the CLI
formatting defined by the RPC. If the RPC does not define CLI formatting,
the device does not display any output for that RPC in the CLI. However,
you can still display the RPC’s XML output in the CLI by appending | display xml
to the command.
user@host> show sw-info routing-engine re0 | display xml
When you execute an RPC remotely, the RPC output defaults
to XML. However, you can specify a different output format by including
the format
attribute in the opening request
tag of the RPC. To display CLI formatting, provided that the RPC defines
this format, set the format
attribute to text
or ascii
. To display
the output in JavaScript Object Notation (JSON), set the format
attribute to json
. For example:
<rpc> <get-sw-info format="text"> <routing-engine>re0</routing-engine> </get-sw-info> </rpc>
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.