To request information about the current status of a routing platform, a client application emits the specific tag element from the JUNOS XML API that returns the desired information. For example, the <get-interface-information> tag element corresponds to the show interfaces command, and the <get-chassis-inventory> tag element requests the same information as the show chassis hardware command.
For complete information about the operational request tag elements available in the current JUNOS software release, see the chapters in the JUNOS XML API Operational Reference that are titled “Mapping Between Operational Tag Elements, Perl Methods, and CLI Commands” and “Summary of Operational Request Tag Elements.”
The application encloses the request tag element in an <rpc> tag element. The syntax depends on whether the corresponding CLI command has any options:
<rpc>
<!- - If the command does not have options - ->
<operational-request/>
<!- - If the command has options - ->
<operational-request>
<!- - tag elements representing the options - ->
</operational-request>
</rpc>
The JUNOScript server encloses its response in a specific tag element that matches the request tag element, enclosed in an <rpc-reply> tag element:
<rpc-reply xmlns:junos="URL">
<operational-response xmlns="URL-for-DTD">
<!- - JUNOS XML tag elements for the requested information - ->
</operational-response>
</rpc-reply>
The opening tag for each operational response includes the xmlns attribute to define the XML namespace for the enclosed tag elements that do not have a prefix (such as junos:) in their names. The namespace indicates which JUNOS XML document type definition (DTD) defines the set of tag elements in the response. The JUNOS XML API defines separate DTDs for operational responses from different software modules. For instance, the DTD for interface information is called junos-interface.dtd and the DTD for chassis information is called junos-chassis.dtd. The division into separate DTDs and XML namespaces means that a tag element with the same name can have distinct functions depending on which DTD it is defined in.
The namespace is a URL of the following form:
- http://xml.juniper.net/junos/release-code/junos-category
release-code is the standard string that represents the release of the JUNOS software running on the JUNOScript server machine.
category specifies the DTD.
The JUNOS XML API Operational Reference includes the text of the JUNOS XML DTDs for operational responses.
If the JUNOS XML API does not define a response tag element for the type of output requested by a client application, the JUNOScript server encloses its response in an <output> tag element. The tag element’s contents are usually one or more lines of formatted ASCII output like that displayed by the CLI on the computer screen
For a reference page for the <output> tag element, see the JUNOS XML API Operational Reference.
![]() |
Note: The content and formatting of data within an <output> tag element are subject to change, so client applications must not depend on them. Future versions of the JUNOS XML API will define specific response tag elements (instead of <output> tag elements) for more commands. Client applications that rely on the content of <output> tag elements will not be able to interpret the output from future versions of the JUNOS XML API. |