At some hierarchy levels, the same kind of configuration object can occur multiple times. Each instance of the object has a unique identifier to distinguish it from the other instances. In the CLI notation, the parent statement for such an object consists of a keyword and identifier of the following form:
keyword identifier {
… configuration statements for individual characteristics …
}
keyword is a fixed string that indicates the type of object being defined, and identifier is the unique name for this instance of the type. In the JUNOS XML API, the tag element corresponding to the keyword is a container tag element for child tag elements that represent the object’s characteristics. The container tag element’s name generally matches the keyword string.
The JUNOS XML API differs from the CLI in its treatment of the identifier. Because the JUNOS XML API does not allow container tag elements to contain both other tag elements and untagged character data such as an identifier name, the identifier must be enclosed in a tag element of its own. Most frequently, identifier tag elements for configuration objects are called <name>. Some objects have multiple identifiers, which usually have names other than <name>. To verify the name of each identifier tag element for a configuration object, consult the entry for the object in the JUNOS XML API Configuration Reference.
![]() |
Note: The JUNOS software reserves the prefix junos- for the identifiers of configuration groups defined within the junos-defaults configuration group. User-defined identifiers cannot start with the string junos-. |
Identifier tag elements also constitute an exception to the general XML convention that tag elements at the same level of hierarchy can appear in any order; the identifier tag element always occurs first within the container tag element.
The configuration for most objects that have identifiers includes additional leaf statements, which represent other characteristics of the object. For example, each Border Gateway Protocol (BGP) group configured at the [edit protocols bgp group] hierarchy level has an associated name (the identifier) and can have leaf statements for other characteristics such as type, peer autonomous system (AS) number, and neighbor address. For information about the JUNOS XML mapping for leaf statements, see Mapping for Single-Value and Fixed-Form Leaf Statements, Mapping for Leaf Statements with Multiple Values, and Mapping for Multiple Options on One or More Lines.
The following example shows the JUNOS XML tag elements for configuration statements that define two BGP groups called G1 and G2. Notice that the JUNOS XML <name> tag element that encloses the identifier of each group (and the identifier of the neighbor within a group) does not have a counterpart in the CLI statements. For complete information about changing routing platform configuration, see Changing Configuration Information.
