To request information from the active configuration—the one most recently committed on the routing platform—a client application includes the database="committed" attribute in the <get-configuration/> tag or opening <get-configuration> tag:
<rpc>
<get-configuration database="committed"/>
<!- - OR - ->
<get-configuration database="committed">
<!- - tag elements for the configuration elements to return - ->
</get-configuration>
</rpc>
To request information from the candidate configuration, the application either includes the database="candidate" attribute or omits the attribute completely (information from the candidate configuration is the default):
<rpc>
<get-configuration/>
<!- - OR - ->
<get-configuration>
<!- - tag elements for the configuration elements to return - ->
</get-configuration>
</rpc>
For information about the tag elements to enclose in the <get-configuration> tag element, see Specifying the Scope of Configuration Information to Return.
The JUNOScript server encloses its response in the <rpc-reply> tag element and either the <configuration> tag element (for JUNOS XML-tagged output) or <configuration-text> tag element (for formatted ASCII output).
When returning information from the active configuration as JUNOS XML tag elements, the JUNOScript server includes attributes in the opening <configuration> tag that indicate when the configuration was committed (they appear on multiple lines here only for legibility):
<rpc-reply xmlns:junos="URL">
<configuration junos:commit-seconds="seconds" \
junos:commit-localtime="YYYY-MM-DD hh:mm:ss TZ" \
junos:commit-user="username">
<!- - JUNOS XML tag elements representing configuration elements - ->
</configuration>
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.
When returning information from the candidate configuration as JUNOS XML tag elements, the JUNOScript server includes attributes in the opening <configuration> tag that indicate when the configuration last changed (they appear on multiple lines here only for legibility):
<rpc-reply xmlns:junos="URL">
<configuration junos:changed-seconds="seconds" \
junos:changed-localtime="YYYY-MM-DD hh:mm:ss TZ">
<!- - JUNOS XML tag elements representing configuration elements - ->
</configuration>
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.
The database attribute in the application’s request can be combined with one or more of the following other attributes in the <get-configuration/> tag or opening <get-configuration> tag:
The application can also include the database attribute after requesting an indicator for identifiers (as described in Requesting an Indicator for Identifiers).
The following example shows how to request the entire committed configuration. In actual output, the JUNOS-version variable is replaced by a value such as 9.4R1 for the initial version of JUNOS Release 9.4.
