[Contents] [Prev] [Next] [Index] [Report an Error]

Data Format: JUNOS XML versus CLI Configuration Statements

You can format the configuration data using one of two formats: JUNOS XML or CLI configuration statements. The choice between one data format over the other is personal preference.

If you are supplying the configuration changes in the form of data files, you enclose the data filename and path within <url> tags. By default, these tags specify that the referenced data files are written in JUNOS XML. Thus, the following code declares that the data within the file is JUNOS XML:

<url>dataFile</url>

To specify that the data file be written as CLI configuration statements, you set the <url> tag's format attribute to text:

<url format=”text”>dataFile</url>

When streaming data, you specify the data format by selecting one of two tags: <config> for JUNOS XML statements and <config-text> for CLI configuration statements.

In the following example, JUNOS XML formatted configuration data is included between the <configuration> tag:

<config>
  <configuration>
    <system>
      <services>
        <ssh>
          <protocol-version>v2</protocol-version>
        </ssh>
      </services>
    </system>
  <configuration>
</config>

In this next example, the same data written formatted as CLI configuration statements and included within <configuration-text> tags:

<config-text>
  <configuration-text>
    system {
      services {
        ssh {
          protocol-version v2 ;
        }
      }
    }
  </configuration-text>
</config-text>

[Contents] [Prev] [Next] [Index] [Report an Error]