Commit a Private Copy of the Configuration Using the Junos XML Protocol
In a Junos XML protocol session with a device running
Junos OS, to commit a private copy of the configuration so that it
becomes the active configuration on the routing, switching, or security
platform, a client application encloses the empty <commit-configuration/>
tag in an <rpc>
tag element (just
as for the candidate configuration).
<rpc> <commit-configuration/> </rpc>
The Junos XML protocol server creates a copy of the current
candidate configuration, merges in the changes made to the private
copy of the configuration, and then commits the combined candidate
to make it the active configuration on the device. The server reports
the results of the commit operation in <rpc-reply>
and <commit-results>
tag elements.
If the private copy does not include any changes, the
server emits the opening <commit-results>
tag and closing </commit-results>
tags
with nothing between.
<rpc-reply xmlns:junos="URL"> <commit-results> </commit-results> </rpc-reply>
If the private copy includes changes and the commit operation
succeeds, the server emits the <load-success/>
tag when it merges the changes in the private copy into the candidate
configuration. The <routing-engine>
element
encloses the <commit-success/>
tag and
the <name> element, which reports the name of the Routing Engine
on which the commit operation succeeded (re0 on devices that use a
single Routing Engine, and either re0 or re1 on devices that can have
two Routing Engines).
<rpc-reply xmlns:junos="URL"> <commit-results> <load-success/> <routing-engine> <name>(re0 | re1)</name> <commit-success/> </routing-engine> </commit-results> </rpc-reply>
If the private copy includes changes that conflict with the
regular candidate configuration, the commit fails. The <load-error-count>
tag element reports the number
of errors and an <xnm:error>
tag element
encloses tag elements that describe the error.
There are restrictions on committing a private copy. For example, the commit fails if the regular candidate configuration is locked by another user or application, or if it includes uncommitted changes made since the private copy was created. For more information, see the CLI User Guide.
Most of the variants of the commit operation are available for a private copy.
Scheduling the commit for a later time, as described in Committing a Configuration at a Specified Time Using the Junos XML Protocol.
Synchronizing the configuration on both Routing Engines, as described in Committing and Synchronizing a Configuration on Redundant Control Planes Using the Junos XML Protocol.
Logging a commit-time message, as described in Logging a Message About a Commit Operation Using the Junos XML Protocol.
The confirmed-commit operation is not available for a private copy. For information about using that operation for the regular candidate configuration, see Committing the Candidate Configuration Only After Confirmation Using the Junos XML Protocol.