- 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 Manage Configurations Using the Junos XML Protocol
- play_arrow Change the Configuration Using the Junos XML Protocol
- Request Configuration Changes Using the Junos XML Protocol
- Upload and Format Configuration Data in a Junos XML Protocol Session
- Upload Configuration Data as a File Using the Junos XML Protocol
- Upload Configuration Data as a Data Stream Using the Junos XML Protocol
- Define the Format of Configuration Data to Upload in a Junos XML Protocol Session
- Specify the Scope of Configuration Data to Upload in a Junos XML Protocol Session
- Replace the Configuration Using the Junos XML Protocol
- Create, Modify, or Delete Configuration Elements Using the Junos XML Protocol
- Create New Elements in Configuration Data Using the Junos XML Protocol
- Merge Elements in Configuration Data Using the Junos XML Protocol
- Replace Elements in Configuration Data Using the Junos XML Protocol
- Replace Only Updated Elements in Configuration Data Using the Junos XML Protocol
- Delete Elements in Configuration Data Using the Junos XML Protocol
- Rename Objects In Configuration Data Using the Junos XML Protocol
- Reorder Elements In Configuration Data Using the Junos XML Protocol
- Protect or Unprotect a Configuration Object Using the Junos XML Protocol
- Change a Configuration Element’s Activation State Using the Junos XML Protocol
- Change a Configuration Element’s Activation State Simultaneously with Other Changes Using the Junos XML Protocol
- Replace Patterns in Configuration Data Using the NETCONF or Junos XML Protocol
- play_arrow Commit the Configuration on a Device Using the Junos XML Protocol
- Verify Configuration Syntax Using the Junos XML Protocol
- Commit the Candidate Configuration Using the Junos XML Protocol
- Commit a Private Copy of the Configuration Using the Junos XML Protocol
- Commit a Configuration at a Specified Time Using the Junos XML Protocol
- Commit the Candidate Configuration Only After Confirmation Using the Junos XML Protocol
- Commit and Synchronize a Configuration on Redundant Control Planes Using the Junos XML Protocol
- Log a Message About a Commit Operation Using the Junos XML Protocol
- View the Configuration Revision Identifier for Determining Synchronization Status of Devices with NMS
- 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
-
- play_arrow Junos XML Protocol Utilities
- play_arrow Develop Junos XML Protocol C Client Applications
-
- play_arrow Configuration Statements and Operational Commands
Request a Specific Number of Configuration Objects Using the Junos XML Protocol
In a Junos XML protocol session with a device running
Junos OS, to request information about a specific number of configuration
objects of a specific type, a client application emits the <get-configuration>
tag element and encloses the
tag elements that represent all levels of the configuration hierarchy
from the root (represented by the <configuration>
tag element) down to the immediate parent level for the object type.
An empty tag represents the requested object type, and the tag includes
the following attributes:
count
specifies the number of objects to returnstart
specifies the index number of the first object to return (1 for the first object, 2 for the second, and so on)
If the application is requesting only the first object
in the hierarchy, it includes the count="1"
attribute and omits the start
attribute.
The application encloses the entire request in an <rpc>
tag element.
<rpc> <get-configuration> <configuration> <!-- opening tags for each parent of the object --> <object-type count="count" start="index"/> <!-- closing tags for each parent of the object --> </configuration> </get-configuration> </rpc>
The count
and start
attributes are not supported when requesting
configuration data in JSON format.
The Junos XML protocol server returns the requested objects
starting with the object specified by the start
attribute and running consecutively. When the application requests
Junos XML-tagged output (the default), the Junos XML protocol server
returns the requested objects in <configuration>
and <rpc-reply>
tag elements, starting
with the object specified by the start
attribute
and running consecutively.
For each object, the server includes two attributes:
junos:position
, to specify the object’s numerical indexjunos:total
, to report the total number of such objects that exist in the hierarchy
In the following example Junos XML output, the identifier
tag element is called <name>
. For information
about the attributes in the opening <configuration>
tag, see Specifying the Source for Configuration
Information Requests in a Junos XML Protocol Session.
<rpc-reply xmlns:junos="URL"> <configuration attributes> <!-- opening tags for each parent of the object type --> <first-object junos:position="index1" junos:total="total"> <name>identifier-for-first-object</name> <!-- other child tag elements of the first object --> </first-object> <second-object junos:position="index2" junos:total="total"> <name>identifier-for-second-object</name> <!-- other child tag elements of the second object --> </second-object> <!-- additional objects --> <!-- closing tags for each parent of the object type --> </configuration> </rpc-reply>
The junos:position
and junos:total
attributes do not appear if the client
requests formatted ASCII output by including the format="text"
attribute in the <get-configuration>
tag element (as described in Specifying
the Output Format for Configuration Data in a Junos XML Protocol Session).
To specify the source of the output (candidate or active configuration),
the application can include attributes in the opening <get-configuration>
tag, its opening <junoscript>
tag, or both. For more information,
see Specifying the Source for Configuration
Information Requests in a Junos XML Protocol Session.
The application can also request additional configuration elements
of the same or other types by including the appropriate tag elements
in the same <get-configuration>
tag
element. For more information, see Requesting
Multiple Configuration Elements Using the Junos XML Protocol.
The following example shows how to request the third and fourth
Junos user accounts at the [edit system login]
hierarchy level. The output is from the candidate configuration
and is tagged with Junos XML tag elements (the default).
