- 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
Change a Configuration Element’s Activation State Simultaneously with Other Changes Using the Junos XML Protocol
In a Junos XML protocol session with a device
running Junos OS, a client application can deactivate or reactivate
an element at the same time it performs other operations on it (except
deletion), by combining the appropriate attributes or operators with
the inactive
or active
attribute or operator. For basic information about activating or
deactivating an element, see Changing
a Configuration Element’s Activation State Using the Junos XML
Protocol.
To define the element to deactivate or activate, a client application
includes the basic tag elements or configuration statements for its
parent levels, as described in Creating,
Modifying, or Deleting Configuration Elements Using the Junos XML
Protocol. When using Junos XML tag elements to represent
the element, the application includes the inactive="inactive"
or active="active"
attribute along with
the other appropriate attributes in the <load-configuration>
tag. When using formatted ASCII text, the application combines the inactive
or active
operator
with the other operator.
For instructions, see the following sections:
Replacing an Element and Setting Its Activation State
To replace (completely reconfigure) an element and simultaneously deactivate or activate it, a client application includes the tag elements or statements that represent all of the element’s characteristics (for complete information about the syntax for defining elements, see Replacing Elements in Configuration Data Using the Junos XML Protocol). The client application uses the attributes and operators discussed in the following examples to indicate which element is being replaced and activated or deactivated.
Using Junos XML Tag Elements for the Replacement Element
If using Junos XML tag elements to represent the element,
a client application includes the action="replace"
attribute in the <load-configuration>
tag element:
<rpc> <!-- For a file --> <load-configuration action="replace" url="file"/> <!-- For a data stream --> <load-configuration action="replace"> <!-- Junos XML tag elements --> </load-configuration> </rpc>
In the opening tag for the replacement element, the application
includes two attributes—the replace="replace"
attribute and either the inactive="inactive"
or active="active"
attribute. It includes
tag elements for all children being defined for the element. In the
following, the identifier tag element is called <name>
:
<configuration> <!-- opening tag for each parent of the element --> <element replace="replace" (inactive="inactive" | active="active")> <name>identifier</name> <!-- if element has an identifier --> <!-- tag elements for each child of the element --> </element> <!-- closing tag for each parent of the element --> </configuration>
Using Formatted ASCII Text for the Replacement Element
If using formatted ASCII text to represent the element,
a client application includes the action="replace"
and format="text"
attributes in the <load-configuration>
tag:
<rpc> <!-- For a file --> <load-configuration action="replace" format="text" url="file"/> <!-- For a data stream --> <load-configuration action="replace" format="text"> <!-- formatted ASCII configuration statements --> </load-configuration> </rpc>
The application places the inactive:
or active:
operator on the line above
the new element and the replace:
operator
directly before the new element. It includes all child statements
that it is defining for all children of the element:
<configuration-text> /* statements for parent levels */ /* For an object with an identifier */ (inactive | active): replace: object identifier { /* Child configuration statements */ } /* For a hierarchy level or object without an identifier */ (inactive | active): replace: element { /* Child configuration statements */ } /* closing braces for parent levels */ </configuration-text>
Reordering an Element and Setting Its Activation State
To reorder an element in an ordered list and simultaneously
deactivate or activate it, the application combines the insert
attribute and identifier attribute for the reference
element with the inactive
or active
attribute. In the following, the identifier
tag element for the moving element is called <name>
. The opening tag appears on two lines for legibility only:
<configuration> <!-- opening tag for each parent of the set --> <ordered-set insert="( before | after )" reference-identifier="value" (inactive="inactive" | active="active")> <name>identifier-for-moving-object</name> </ordered-set> <!-- closing tag for each parent of the set --> </configuration>
The reordering operation is not available when formatted ASCII text is used to represent the configuration data.
For complete information about reordering elements, see Reordering Elements In Configuration Data Using the Junos XML Protocol.
Renaming an Object and Setting Its Activation State
To rename an object (change the value of one or more of its
identifiers) and simultaneously deactivate or activate it, the application
combines the rename
attribute and identifier
attribute for the new name with the inactive
or active
attribute.
If the object has one identifier (here called <name>
), the syntax is as follows (the opening tag
appears on two lines for legibility only):
<configuration> <!-- opening tag for each parent of the object --> <object rename="rename" name="new-name" \ (inactive="inactive" | active="active")> <name>current-name</name> </object> <!-- closing tag for each parent of the object --> </configuration>
If the object has multiple identifiers and only one is changing, the syntax is as follows (the opening tag appears on multiple lines for legibility only):
<configuration> <!-- opening tag for each parent of the object --> <object rename="rename" changing-identifier="new-name" \ unchanging-identifier="current-name" \ (inactive="inactive" | active="active")> <changing-identifier>current-name</changing-identifier> <unchanging-identifier>current-name</unchanging-identifier> </object> <!-- closing tag for each parent of the object --> </configuration>
The renaming operation is not available when formatted ASCII text is used to represent the configuration data.
For complete information about renaming elements, see Renaming Objects In Configuration Data Using the Junos XML Protocol.
Example: Replacing an Object and Deactivating It
The following example shows how to replace the information at
the [edit protocols bgp]
hierarchy level in the
candidate configuration for the group called G3
, and also
deactivate the group so that it is not used in the actual configuration
when the candidate is committed:

The following example shows how to use formatted ASCII text to make the same changes:
