Commit a Configuration at a Specified Time Using the Junos XML Protocol
In a Junos XML protocol session with a Junos device, a client application can schedule a
commit operation at a specified time in the future. The client executes the
<commit-configuration> operation and includes the
<at-time> element with the specified
time.
<rpc>
<commit-configuration>
<at-time>time</at-time>
</commit-configuration>
</rpc>
To indicate when to perform the commit operation, the client includes
the <at-time> element with the time specifier. Table 1 outlines the valid types of time specifiers.
| Time Specifier | Description | Example |
|---|---|---|
|
|
Commit the configuration the next time the device reboots. |
|
|
|
Commit the configuration at the specified time (hours, minutes, and, optionally, seconds). The time must be in the future but before 11:59:59 PM on the current day. Use 24-hour time for the hh value. The device interprets the time with respect to its clock and time zone settings. |
|
|
|
Commit the configuration at the specified date and time (year,
month, date, hours, minutes, and, optionally, seconds). The
specified time must be after you execute the
|
|
The specified time must be more than 1 minute later than the current time on the device.
The Junos XML protocol server immediately checks the configuration for
syntactic correctness and returns <rpc-reply>,
<commit-results>, and
<routing-engine> tag elements. If the syntax check
succeeds, the <routing-engine> element encloses the
<commit-check-success/>, <name>,
and <output> tags. The <name> tag reports
the Routing Engine on which the check succeeded, for example, re0 or re1. The
<output> element reports the time at which the commit is
scheduled.
<rpc-reply xmlns:junos="URL">
<commit-results>
<routing-engine>
<name>(re0 | re1)</name>
<commit-check-success/>
<output>commit at will be executed at timestamp</output>
</routing-engine>
</commit-results>
</rpc-reply>
If the commit check succeeds, the configuration is scheduled for
commit at the specified time. The Junos XML protocol server does not emit additional
tag elements when it performs the actual commit operation. If the configuration is
not syntactically correct, an <xnm:error> element encloses
child elements that describe the error. In the case of an error, the commit
operation is not scheduled.
The <at-time> tag element
can be combined with the <synchronize/> tag, the
<log/> tag, or both.
The following example shows how to schedule a commit operation for 10:00 PM on the current day.
