[Contents] [Prev] [Next] [Index] [Report an Error]

Requesting a Hierarchy Level or Container Object Without an Identifier

To request complete information about all child configuration elements at a hierarchy level or in a container object that does not have an identifier, a client application emits a <get-configuration> tag element that encloses the tag elements representing all levels in the configuration hierarchy from the root (represented by the <configuration> tag element) down to the level’s immediate parent level. An empty tag represents the requested level. The entire request is enclosed in an <rpc> tag element.

<rpc>
<get-configuration>
<configuration>
<!- - opening tags for each parent of the level - ->
<requested-level/>
<!- - closing tags for each parent of the level - ->
</configuration>
</get-configuration>
</rpc>

When the application requests JUNOS XML-tagged output (the default), the JUNOScript server returns the requested section of the configuration in <configuration> and <rpc-reply> tag elements. For information about the attributes in the opening <configuration> tag, see Requesting Information from the Committed or Candidate Configuration.

<rpc-reply xmlns:junos="URL">
<configuration attributes>
<!- - opening tags for each parent of the level - ->
<hierarchy-level>
<!- - child tag elements of the level - ->
</hierarchy-level>
<!- - closing tags for each parent of the level - ->
</configuration>
</rpc-reply>

To specify the source of the output (candidate or active configuration) and request special formatting of the output (for example, formatted ASCII text 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 and Output Format of Configuration Information.

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 Simultaneously.

The following example shows how to request the contents of the [edit system login] hierarchy level in the candidate configuration. The output is tagged with JUNOS XML tag elements (the default).

Image t1192.gif
[Contents] [Prev] [Next] [Index] [Report an Error]