- 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 Subsets of Configuration Objects Using Regular Expressions
In a Junos XML protocol session with a device running Junos
OS, to request information about only those instances of a configuration
object type that have a specified set of characters in their identifier
names, a client application includes the matching
attribute with a regular expression that matches the identifier
name. For example, the application can request information about just
the SONET/SDH interfaces at the [edit interfaces]
hierarchy
level by specifying the characters so- at the start of the regular
expression.
Using the matching
attribute
enables the application to represent the objects to return in a form
similar to the XML Path Language (XPath) representation, which is
described in XML Path Language (XPath) Version 1.0, available from the World Wide Web Consortium (W3C) at http://www.w3.org/TR/xpath . In an XPath representation, an object and its parent levels are
an ordered series of tag element names separated by forward slashes.
The angle brackets around tag element names are omitted, and the opening
tag is used to represent the entire tag element. For example, the
following XPath:
configuration/system/radius-server/name
is equivalent to the following tagged representation:
<configuration> <system> <radius-server> <name/> </radius-server> </system> </configuration>
The application includes the matching
attribute in the empty tag that represents a parent level for the
object type. As with all requests for configuration information, the
client emits a <get-configuration>
tag
element that encloses the tag elements representing all levels of
the configuration hierarchy from the root (represented by the <configuration>
tag element) down to the level at
which the matching
attribute is included.
The entire request is enclosed in an <rpc>
tag element:
<rpc> <get-configuration> <configuration> <!-- opening tags for each parent of the level --> <level matching="matching-expression"/> <!-- closing tags for each parent of the level --> </configuration> </get-configuration> </rpc>
In the value for the matching
attribute,
each level in the XPath-like representation can be either a full level
name or a regular expression that matches the identifier name of one
or more instances of an object type:
object-type[name='regular-expression']"
The regular expression uses the notation defined in POSIX Standard 1003.2 for extended (modern) UNIX regular expressions. Explaining regular expression syntax is beyond the scope of this document, but Table 1 specifies which character or characters are matched by some of the regular expression operators that can be used in the expression. In the descriptions, the term term refers to either a single alphanumeric character or a set of characters enclosed in square brackets, parentheses, or braces.
The matching
attribute is not
case-sensitive.
Operator | Matches |
---|---|
| One instance of any character except the space. |
| Zero or more instances of the immediately preceding term. |
| One or more instances of the immediately preceding term. |
| Zero or one instance of the immediately preceding term. |
| One of the terms that appear on either side of the pipe operator. |
| The start of a line, when the caret appears outside square brackets. One instance of any character that does not follow it within square brackets, when the caret is the first character inside square brackets. |
| The end of a line. |
| One instance of one of the enclosed alphanumeric characters.
To indicate a range of characters, use a hyphen (-) to separate the
beginning and ending characters of the range. For example, |
| One instance of the evaluated value of the enclosed term. Parentheses are used to indicate the order of evaluation in the regular expression. |
When the application requests Junos XML-tagged output
(the default), the Junos XML protocol server returns the requested
object in <configuration>
and <rpc-reply>
tag elements. 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 parent level --> <parent-level> <first-matching-object> <!-- child tag elements for the first object --> </first-matching-object> <second-matching-object> <!-- child tag elements for the second object --> </second-matching-object> <!-- additional instances of the object --> </parent-level> <!-- closing tags for each parent of the object type --> </configuration> </rpc-reply>
The application can combine one or more of the count
, start
, and recurse
attributes along with the matching
attribute, to limit the set of possible matches to a specific range
of objects, to request only identifiers, or both. For more information
about those attributes, see Requesting
a Specific Number of Configuration Objects Using the Junos XML Protocol and Requesting Identifiers for Configuration
Objects of a Specific Type Using the Junos XML Protocol.
To specify the source of the output (candidate or active configuration)
and request special formatting of the output (for example, formatted
ASCII or JSON or an indicator for identifiers), 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 and Specifying the
Output Format for Configuration Data in a Junos XML Protocol Session.
The application can request additional configuration elements
of the same or other types in the same <get-configuration>
tag element by including the appropriate tag elements. For more
information, see Requesting Multiple Configuration
Elements Using the Junos XML Protocol.
The following example shows how to request just the identifier
for the first two SONET/SDH interfaces configured at the [edit interfaces]
hierarchy level.
