Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
 

Related Documentation

 

Requesting Operational Information Using NETCONF

Within a NETCONF session, to request information about the current status of a device running Junos OS, 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 OS release, see “Mapping Between Operational Tag Elements, Perl Methods, and CLI Commands” and “Summary of Operational Request Tag Elements” in the Junos XML API Operational Reference.

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 client application can specify the formatting of the information returned by the NETCONF server. By setting an optional attribute in the opening operational request tag, a client application can specify the format of the response as either XML-tagged format, which is the default, or formatted ASCII text.

If the client application requests the output in formatted ASCII text, the NETCONF server encloses its response in an <output> tag element, which is enclosed in an <rpc-reply> tag element.

<rpc-reply xmlns="URN" xmlns:junos="URL"><output>operational-response</output></rpc-reply>]]>]]>

If the client application requests the output in XML-tagged format, the NETCONF server encloses its response in the specific response tag element that corresponds to 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>
]]>]]>

For XML-tagged format, 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 OS running on the NETCONF server device.

category specifies the DTD.

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

 

Related Documentation

 

Published: 2013-07-26

 

Related Documentation

 

Published: 2013-07-26