- play_arrow Overview
- play_arrow Junos XML Management Protocol and Junos XML API Overview
- play_arrow Junos XML Protocol and Junos XML Tags Overview
- XML and Junos OS Overview
- XML Overview
- XML and Junos 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 Configuration Response Tag Elements in Junos XML Protocol Requests and Configuration Changes
- play_arrow Junos XML Protocol and JSON Overview
-
- play_arrow Manage Junos XML Protocol Sessions
- play_arrow Junos XML Protocol Session Overview
- play_arrow Manage Junos XML Protocol Sessions
- Satisfy the Prerequisites for Establishing a Connection to the Junos XML Protocol Server
- Configure clear-text or SSL Service for Junos XML Protocol Client Applications
- Connect to the Junos XML Protocol Server
- Start a Junos XML Protocol Session
- Authenticate with the Junos XML Protocol Server for Cleartext or SSL Connections
- Send Requests to the Junos XML Protocol Server
- Parse the Junos XML Protocol Server Response
- Parse Response Tag Elements Using a Standard API in NETCONF and Junos XML Protocol Sessions
- How Character Encoding Works on Juniper Networks Devices
- Handle an Error or Warning in Junos XML Protocol Sessions
- Halt a Request in Junos XML Protocol Sessions
- Lock, Unlock, or Create a Private Copy of the Candidate Configuration Using the Junos XML Protocol
- Terminate a Junos XML Protocol Session
- End a Junos XML Protocol Session and Close the Connection
- Sample Junos XML Protocol Session
- play_arrow Junos XML Protocol Tracing Operations
- play_arrow Junos XML Protocol Operations
- play_arrow Junos XML Protocol Processing Instructions
- play_arrow Junos XML Protocol Response Tags
- play_arrow Junos XML Element Attributes
- active
- count
- delete
- inactive
- insert
- junos:changed
- junos:changed-localtime
- junos:changed-seconds
- junos:commit-localtime
- junos:commit-seconds
- junos:commit-user
- junos:group
- junos:interface-range
- junos:key
- junos:position
- junos:total
- matching
- protect
- recurse
- rename
- replace
- replace-pattern
- start
- unprotect
- xmlns
-
- play_arrow Request Operational and Configuration Information Using the Junos XML Protocol
- play_arrow Request Operational Information Using the Junos XML Protocol
- play_arrow Request Configuration Information Using the Junos XML Protocol
- Request Configuration Data Using the Junos XML Protocol
- Specify the Source for Configuration Information Requests in a Junos XML Protocol Session
- Specify the Output Format for Configuration Data in a Junos XML Protocol Session
- Request Commit-Script-Style XML Configuration Data Using the Junos XML Protocol
- Specify the Output Format for Configuration Groups and Interface Ranges Using the Junos XML Protocol
- Request Identifier Indicators for Configuration Elements Using the Junos XML Protocol
- Request Change Indicators for Configuration Elements Using the Junos XML Protocol
- Specify the Scope of Configuration Data to Return in a Junos XML Protocol Session
- Request the Complete Configuration Using the Junos XML Protocol
- Request a Configuration Hierarchy Level or Container Object Without an Identifier Using the Junos XML Protocol
- Request All Configuration Objects of a Specific Type Using the Junos XML Protocol
- Request a Specific Number of Configuration Objects Using the Junos XML Protocol
- Request Identifiers for Configuration Objects of a Specific Type Using the Junos XML Protocol
- Request a Single Configuration Object Using the Junos XML Protocol
- Request Subsets of Configuration Objects Using Regular Expressions
- Request Multiple Configuration Elements Using the Junos XML Protocol
- Retrieve a Previous (Rollback) Configuration Using the Junos XML Protocol
- Retrieve the Rescue Configuration Using the Junos XML Protocol
- Compare the Active or Candidate Configuration to a Prior Version Using the Junos XML Protocol
- Compare Two Previous (Rollback) Configurations Using the Junos XML Protocol
- Request an XML Schema for the Configuration Hierarchy Using the Junos XML Protocol
-
- play_arrow Junos XML Protocol Utilities
- play_arrow Develop Junos XML Protocol C Client Applications
-
- play_arrow Configuration Statements and Operational Commands
Create, Modify, or Delete Configuration Elements Using the Junos XML Protocol
In a Junos XML protocol session with a device running Junos OS, in addition to replacing the entire configuration, a client application can create, modify, or delete one or more configuration elements (hierarchy levels and configuration objects) in the candidate configuration or open configuration database.
To use Junos XML tag elements to represent an element,
the application includes the tag elements representing all levels
in the configuration hierarchy from the root (represented by the <configuration>
tag element) down to the element’s
container tag element. The attributes and child tag elements that
are included depend on the operation being performed on the element.
The syntax applies both to the contents of a file and to a data stream.
In the following example, the identifier tag element is called <name>
:
<configuration> <!-- opening tag for each parent of the element --> <container-tag [operation-attribute="value"]> <name>identifier</name> <!-- if the element has an identifier --> <!-- child tag elements --> <!-- if appropriate --> </container-tag> <!-- closing tag for each parent of the element --> </configuration>
To use formatted ASCII text to represent an element,
the application includes the complete statement path, starting with
a statement that can appear directly under the [edit]
hierarchy
level. The attributes and child statements to include depend on the
operation being performed on the element. The application encloses
the set of statements in a <configuration-text>
tag element when it uploads the configuration data as a data stream.
The application omits the <configuration-text>
tag element when the configuration data is stored in and loaded
from a file.
<configuration-text> /* statements for parent levels of the element */ operation-to-perform: # if appropriate element identifier { # if the element has an identifier /* child statements */ # if appropriate for the operation } /* closing braces for parent levels of the element */ </configuration-text>
When loading formatted ASCII text, the application must include
the format="text"
attribute in the <load-configuration>
tag.
To use configuration mode commands to create, modify,
or delete an element, the application includes the commands as they
would be typed in configuration mode in the CLI. The configuration
instructions are executed in the order provided. You can specify the
complete statement path in the command, or you can use CLI navigation
commands such as edit
and up
, to move around
the configuration hierarchy.
The application encloses the set of commands in a <configuration-set>
tag element when it uploads
the configuration data as a data stream. The application omits the <configuration-set>
tag element when the configuration
data is stored in and loaded from a file.
<configuration-set> /* configuration mode commands */ </configuration-set>
When loading configuration mode set
commands, the
application must include the action="set"
and format="text"
attributes in the <load-configuration>
tag.
Starting in Junos OS Release 16.1, you can load configuration data formatted using JavaScript Object Notation (JSON) on the device. To use JSON format to represent an element, the application includes JSON objects representing all levels in the configuration hierarchy from the root down to the JSON object representing that element. The attributes and child objects to include depend on the operation being performed on the element. If the attribute value is a Boolean data type, the value is not enclosed in quotes.
The application encloses the JSON data in a <configuration-json>
tag element when it uploads the configuration data as a data stream.
The application omits the <configuration-json>
tag element when the configuration data is stored in and loaded
from a file.
<configuration-json> { "configuration" : { /* JSON objects for parent levels of the element */ "container-tag" : { "@" : { "operation-attribute" : ( "value" | boolean ) }, "object" : [ { "@" : { "operation-attribute" : ( "value" | boolean ) }, "(name | element-identifier)" : "identifier", "statement-name" : "statement-value", "@statement-name" : { "operation-attribute" : ( "value" | boolean ) }, /* additional JSON data and child objects */ } ] } /* closing braces for parent levels of the element */ } } </configuration-json>
When loading data in JSON format, the application must include
the format="json"
attribute in the <load-configuration>
tag.
For more information about the source and formatting for configuration elements, see Uploading and Formatting Configuration Data in a Junos XML Protocol Session.
For information about the operations a client application can perform on configuration elements, see the following sections:
Creating New Elements in Configuration Data Using the Junos XML Protocol
Merging Elements in Configuration Data Using the Junos XML Protocol
Replacing Elements in Configuration Data Using the Junos XML Protocol
Replacing Only Updated Elements in Configuration Data Using the Junos XML Protocol
Deleting Elements in Configuration Data Using the Junos XML Protocol
Renaming Objects In Configuration Data Using the Junos XML Protocol
Reordering Elements In Configuration Data Using the Junos XML Protocol
Protecting or Unprotecting a Configuration Object Using the Junos XML Protocol
Changing a Configuration Element’s Activation State Using the Junos XML Protocol
Replacing Patterns in Configuration Data Using the NETCONF or Junos XML Protocol