Commit

Replace the
body
element in the
cmd
parameter with the XML element for the corresponding commit operation.
Use the API Browser to find different options available for use with force and partial commits.
  1. Use one of the following requests to commit a configuration:
    • Commit
      — Commit candidate changes to the firewall.
    https://
    <firewall>
    /api/?type=commit&cmd=<commit></commit>
    • Force Commit
    https://
    <firewall>
    /api/?type=commit&cmd=<commit><force></force></commit>
    • Partial commit while excluding shared objects and device and network configuration
    https://
    <firewall>
    /api/?type=commit&action=partial&cmd=<commit><partial><device-and-network>excluded</device-and-network><shared-object>excluded</shared-object></partial></commit>
    • Partial commit admin-level changes
      — To commit admin-level changes on a firewall, include the administrator name in the request.
    https://
    <firewall>
    /api/?&type=commit&action=partial&cmd=<commit><partial><admin><member>$admin-name</member></admin></partial></commit>
    • Partial commit admin-level changes on a firewall or Panorama while excluding shared objects
      —Include the administrator name in the request. Replace the $admin-name Replace
    https://
    <firewall>
    /api/?&type=commit&action=partial&cmd=<commit><partial><device-and-network>excluded</device-and-network><shared-object>excluded</shared-object><admin><member>socadmin</member></admin></partial></commit>
  2. Confirm that the XML response indicates that there were no changes to commit or that the changes are queued for commit:
    • No pending changes to commit:
      <response status="success" code="19">   <msg>There are no changes to commit.</msg> </response>
    • Pending changes:
      <response status="success" code="19"> <result> <msg> <line>Commit job enqueued with jobid 4</line> </msg> <job>4</job> </result> </response>
  3. Query the status of the job using the job ID:
    https://
    <firewall>
    /api/?type=op&cmd=<show><jobs><id>4</id></jobs></show>
  4. Confirm that the XML response details state the Configuration was committed successfully:
    <response status="success"> <result> <job> <tenq>2011/10/20 20:41:44</tenq> <id>4</id> <type>Commit</type> <status>FIN</status> <stoppable>no</stoppable> <result>OK</result> <tfin>20:42:22</tfin> <progress>20:42:22</progress> <details> <line>Configuration committed successfully</line> </details> <warnings /> </job> </result> </response>

Recommended For You