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

Requesting a Specified Number of Configuration Objects

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 following attributes are included in it:

(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>

When the application requests JUNOS XML-tagged output (the default), the JUNOScript server returns the requested objects in <configuration> and <rpc-reply> tag elements, starting with the object specified by the start attribute and running consecutively. In the opening container tag for each object, it includes two attributes:

In the following, the identifier tag element is called <name>. (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 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 Requesting Output as Formatted ASCII Text or JUNOS XML Tag Elements).

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

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