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

Requesting Operational Information

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, the <get-chassis-inventory> tag element requests the same information as the show chassis hardware command, and the <get-system-inventory> tag element requests the same information as the show software information 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 NETCONF 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="URN" xmlns:junos="URL">
    <operational-response xmlns="URL-for-DTD">
        <!- - 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 NETCONF server machine.

category specifies the DTD.

The JUNOS XML API Operational Reference includes the text of the JUNOS XML DTDs for operational responses.


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