Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Defining the New Configuration Data

 

A client application can use one of two ways to define the new data to incorporate into the candidate configuration:

Providing Configuration Data in a File

Providing Configuration Data in a File

To provide the new configuration data in a file, a client application emits the <url> and <edit-config> tag elements in an<rpc> tag element:

Before loading the file, the client application or an administrator saves XML tag elements as the contents of the file. The file includes the tag elements representing all levels of the configuration hierarchy from the root (represented by the <configuration> tag element) down to each element to change. The notation is the same as that used to request configuration information, as described in Requesting Information. For more detailed information about the XML representation of configuration statements, see Mapping Configuration Statements to SRC XML Tag Elements.

The file named by the <url> tag element can be specified as a local file path, an FTP location, or a Hypertext Transfer Protocol (HTTP) URL:

  • A local filename can have one of the following forms:

    • /path/filename—File on a mounted file system, either on the local flash disk or on the hard disk.

    • a:filename or a:path/filename—File on the local drive. The default path is / (the root-level directory). The removable media can be in MS-DOS or UNIX (UFS) format.

  • A filename on an FTP server has the following form:

  • A filename on an HTTP server has the following form:

    http://username:password@hostname/path/filename

The default value for the path variable is the home directory for the username. To specify an absolute path, the application starts the path with the characters %2F, as in ftp://username:password@hostname/%2Fpath/filename.

The following example shows how to incorporate configuration data stored in the file /var/configs/user-accounts on the FTP server called cfg-server.mycompany.com.

Client Application

NETCONF Server

<rpc>

  <edit-config>

    <target>

      <candidate/>

    </target>

    <url>ftp://admin:AdminPwd@cfg-server.mycompany.com/var/configs/user-accounts</url>

  </edit-config>

</rpc>

]]>]]>

 

<rpc-reply xmlns=”URN” xmlns:sdx=”URL” >

  <ok/>

</rpc-reply>

]]>]]>

Providing Configuration Data as a Data Stream

Providing Configuration Data as a Data Stream

To provide configuration data as a data stream, a client application emits <rpc>, <edit-config>, and <config> tag elements. To specify the configuration elements to change, the application emits the tag elements representing all levels of the configuration hierarchy from the root (represented by the <configuration> tag element) down to each element to change. The notation is the same as that used to request configuration information, as described in Requesting Information. For more detailed information about the mappings between configuration elements and XML tag elements, see Mapping Configuration Statements to SRC XML Tag Elements.

The following example shows how to provide new configuration data for the messages system log file in a data stream:

Client Application

NETCONF Server

<rpc>

  <edit-config>

    <target>

      <candidate/>

    </target>

    <config>

      <configuration>

        <system>

          <syslog>

            <file>

              <name>messages</name>

              <contents>

                <name>any</name>

                <warning/>

              </contents>

              <contents>

                <name>authorization</name>

                <info/>

              </contents>

            </file>

          </syslog>

        </system>

      </configuration>

    </config>

  </edit-config>

</rpc>

]]>]]>

 

 

<rpc-reply xmlns=”URN” xmlns:sdx=”URL” >

  <ok/>

</rpc-reply>

]]>]]>