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

Requesting Information from the Committed or Candidate Configuration

To request information from the candidate configuration, a client application includes the <source> tag element and <candidate/> tag in <rpc> and <get-config> tag elements:

<rpc>
    <get-config>
        <source>
            <candidate/>
        </source>
        <filter>
            <!- - tag elements representing the configuration elements to return - ->
        </filter>
    </get-config>
</rpc>
]]>]]>

To request information from the active configuration—the one most recently committed on the routing platform—a client application includes the <source> tag element and <running/> tag in <rpc> and <get-config> tag elements:

<rpc>
    <get-config>
        <source>
            <running/>
        </source>
        <filter>
            <!- - tag elements representing the configuration elements to return - ->
        </filter>
    </get-config>
</rpc>
]]>]]>

Note: If requesting the entire configuration, the application omits the <filter> tag element. For information about the <filter> tag element, see Specifying the Scope of Configuration Information to Return.

The NETCONF server encloses its reply in <configuration>, <data>, and <rpc-reply> tag elements. In the opening <configuration> tag, it includes the xmlns attribute to specify the namespace for the enclosed tag elements.

When returning information from the candidate configuration, the NETCONF server also includes attributes that indicate when the configuration last changed (they appear on multiple lines here only for legibility):

<rpc-reply xmlns="URN" xmlns:junos="URL">
    <data>
        <configuration xmlns="URL" junos:changed-seconds="seconds" \
                junos:changed-localtime="YYYY-MM-DD hh:mm:ss TZ">
            <!- - JUNOS XML tag elements representing the configuration - ->
        </configuration>
    </data>
</rpc-reply>
]]>]]>

junos:changed-localtime represents the time of the last change as the date and time in the router’s local time zone.

junos:changed-seconds represents the time of the last change as the number of seconds since midnight on 1 January 1970.

When returning information from the active configuration, the NETCONF server also includes attributes that indicate when the configuration was committed (they appear on multiple lines here only for legibility):

<rpc-reply xmlns="URN" xmlns:junos="URL">
    <data>
        <configuration xmlns="URL" junos:commit-seconds="seconds" \
                junos:commit-localtime="YYYY-MM-DD hh:mm:ss TZ" \
                junos:commit-user="username">
            <!- - JUNOS XML tag elements representing the configuration - ->
        </configuration>
    </data>
</rpc-reply>
]]>]]>

junos:commit-localtime represents the commit time as the date and time in the router’s local time zone.

junos:commit-seconds represents the commit time as the number of seconds since midnight on 1 January 1970.

junos:commit-user specifies the JUNOS username of the user who requested the commit operation.


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