Table of Contents

About This Guide
Junos Documentation and Release Notes
Objectives
Audience
Supported Platforms
Using the Indexes
Documentation Conventions
Documentation Feedback
Requesting Technical Support
Overview
Introduction to the NETCONF XML Management Protocol and Junos XML API
NETCONF XML Management Protocol and Junos XML API Overview
XML Overview
Junos XML and NETCONF XML Management Protocol Tag Elements
Document Type Definition
Advantages of Using the NETCONF XML Managment Protocol and Junos XML API
Overview of a NETCONF XML Management Protocol Session
Using NETCONF XML Management Protocol and Junos XML Tag Elements
XML and NETCONF XML Management Protocol Conventions Overview
Request and Response Tag Elements
Child Tag Elements of a Request Tag Element
Child Tag Elements of a Response Tag Element
Spaces, Newline Characters, and Other White Space
XML Comments
Predefined Entity References
Mapping Commands to Junos XML Tag Elements
Mapping for Command Options with Variable Values
Mapping for Fixed-Form Command Options
Mapping Configuration Statements to Junos XML Tag Elements
Mapping for Hierarchy Levels and Container Statements
Mapping for Objects That Have an Identifier
Mapping for Single-Value and Fixed-Form Leaf Statements
Mapping for Leaf Statements with Multiple Values
Mapping for Multiple Options on One or More Lines
Mapping for Comments About Configuration Statements
Using the Same Configuration Tag Elements in Requests and Responses
Using the NETCONF XML Management Protocol
Controlling the NETCONF Session
Client Application’s Role in a NETCONF Session
Establishing a NETCONF Session
Generating Well-Formed XML Documents
Prerequisites for Establishing an SSH Connection
Establishing an SSH Connection
SSH Software Is Installed on the Configuration Management Server
Client Application Can Log In on Devices Running Junos OS
Junos Login Account Has Public/Private Key Pair or Password
Creating a Text-Based Password
Creating a Public/Private Key Pair
Client Application Can Access the Keys or Password
NETCONF Service over SSH Is Enabled
Establishing an Outbound SSH Connection
Configuring the Device Running Junos OS for Outbound SSH
Installing SSH Software on the Client
Receiving and Managing the Outbound SSH Initiation Sequence on the Client
Enabling NETCONF Service over SSH
Connecting to the NETCONF Server
Starting the NETCONF Session
Exchanging <hello> Tag Elements
Verifying Compatibility
Exchanging Information with the NETCONF Server
Sending a Request to the NETCONF Server
Request Classes
Operational Requests
Configuration Information Requests
Configuration Change Requests
Including Attributes in the Opening <rpc> Tag
Parsing the NETCONF Server Response
NETCONF Server Response Classes
Operational Responses
Configuration Information Responses
Configuration Change Responses
Using a Standard API to Parse Response Tag Elements
Handling an Error or Warning
Locking and Unlocking the Candidate Configuration
Locking the Candidate Configuration
Unlocking the Candidate Configuration
Terminating Another NETCONF Session
Ending a NETCONF Session and Closing the Connection
Displaying CLI Output as XML Tag Elements
Example of a NETCONF Session
Exchanging Initialization Tag Elements
Sending an Operational Request
Locking the Configuration
Changing the Configuration
Committing the Configuration
Unlocking the Configuration
Closing the NETCONF Session
Requesting Information
Overview of the Request Procedure
Requesting Operational Information
Parsing the <output> Tag Element
Requesting Configuration Information
Requesting Information from the Committed or Candidate Configuration
Specifying the Scope of Configuration Information to Return
Requesting the Complete Configuration
Requesting a Hierarchy Level or Container Object Without an Identifier
Requesting All Configuration Objects of a Specified Type
Requesting Identifiers for Configuration Objects of a Specified Type
Requesting One Configuration Object
Requesting Specific Child Tags for a Configuration Object
Requesting Multiple Configuration Elements Simultaneously
Requesting an XML Schema for the Configuration Hierarchy
Creating the junos.xsd File
Example: Requesting an XML Schema
Requesting a Previous (Rollback) Configuration
Comparing Two Previous (Rollback) Configurations
Requesting the Rescue Configuration
Changing Configuration Information
Editing the Candidate Configuration
Formatting the Configuration Data
Delivery Mechanism: Data Files Versus Streaming Data
Referencing Configuration Data Files
Streaming Configuration Data
Data Format: Junos XML versus CLI Configuration Statements
Setting the Edit Configuration Mode
Specifying the merge Data Mode
Specifying the replace Data Mode
Specifying the no-change Data Mode
Handling Errors
Replacing the Candidate Configuration
Using <copy-config>
Using <edit-config>
Rolling Back a Configuration
Deleting the Candidate Configuration
Changing Individual Configuration Elements
Merging Configuration Elements
Replacing Configuration Elements
Creating New Configuration Elements
Deleting Configuration Elements
Deleting a Hierarchy Level or Container Object
Deleting a Configuration Object That Has an Identifier
Deleting a Single-Value or Fixed-Form Option from a Configuration Object
Deleting Values from a Multivalue Option of a Configuration Object
Committing Configurations
Verifying a Configuration Before Committing It
Committing a Configuration
Committing the Candidate Configuration
Committing the Candidate Configuration Only After Confirmation
Summary of NETCONF Tag Elements
]]>]]>
<close-session/>
<commit>
<copy-config>
<data>
<delete-config>
<discard-changes/>
<edit-config>
<error-info>
<get-config>
<hello>
<kill-session>
<lock>
<ok/>
<rpc>
<rpc-error>
<rpc-reply>
<target>
<unlock>
<validate>
Summary of Attributes in Junos XML Tags
junos:changed-localtime
junos:changed-seconds
junos:commit-localtime
junos:commit-seconds
junos:commit-user
operation
xmlns
Writing NETCONF Client Applications
Writing NETCONF Perl Client Applications
Overview of the NETCONF::Netconf::Manager Perl Module and Sample Scripts
Download the NET::Netconf Module and Sample Scripts
Tutorial: Writing Perl Client Applications
Import Perl Modules and Declare Constants
Connect to the NETCONF Server
Satisfy Protocol Prerequisites
Group Requests
Obtain and Record Parameters Required by the NET::Netconf::Manager Object
Example: Collect Parameters Interactively
Obtain Application-Specific Parameters
Establishing the Connection
Submitting a Request to the NETCONF Server
Providing Method Options or Attributes
Submitting a Request
Example: Get an Inventory of Hardware Components
Example: Edit Configuration Statements
Handling Error Conditions
Locking the Configuration
Reading In the Configuration Data
Editing the Configuration Data
Committing the Configuration
Parsing and Formatting the Response from the NETCONF Server
Parsing and Formatting an Operational Response
Closing the Connection to the NETCONF Server
Index
Index
Index of Statements and Commands