Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Related Documentation


    Comparing the Active or Candidate Configuration to a Prior Version Using the Junos XML Protocol

    In the CLI, when you want to compare the active or candidate configuration to a previously committed configuration, you use the compare command. In operational mode, you compare the active configuration to a prior version using the show configuration | compare rollback rollback-number command. In configuration mode, you compare the candidate configuration to a previously committed configuration using the show | compare rollback rollback-number command.

    The compare rollback rollback-number command compares the selected configuration with a previously committed configuration and displays the differences between the two. The rollback-number for the most recently saved configuration is 0, and the oldest saved configuration is 49.

    In a Junos XML protocol session with a device running Junos OS, to request that the server display the differences between the active or candidate configuration and a previously committed configuration, a client application includes the compare and rollback attributes in the <get-configuration/> tag or opening <get-configuration> tag. It encloses the request in an <rpc> tag element:

    <get-configuration compare="rollback" rollback="[0-49]" format="text"/>

    <!-- OR -->

    <get-configuration compare="rollback" rollback="[0-49]" format="text">
    <!-- tag elements for the configuration elements to return -->

    The client application can include the database attribute to specify whether to compare the active or candidate configuration to the previously committed configuration. If the database attribute is omitted, the candidate configuration is used. If the rollback="rollback-number" attribute is not included, rollback configuration number 0 is used for comparison.

    By default, the <get-configuration> operation returns Junos XML-tagged output. However, when the compare attribute is included, the <get-configuration> operation returns the output formatted as ASCII text even if the you omit the format="text" attribute or try to specify a different format.

    The comparison output is enclosed in the <configuration-information> and <configuration-output> tags. The output uses the following conventions to specify the differences between configurations:

    • Statements that are only in the active or candidate configuration are prefixed with a plus sign (+).
    • Statements that are only in the comparison file are prefixed with a minus sign (–).
    • Statements that are unchanged are prefixed with a single blank space ( ).

    Related Documentation


    Modified: 2016-11-03