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

Delivery Mechanism: Data Files Versus Streaming Data

When formatting your configuration data output, you can choose to stream your configuration changes within your session or reference data files that include the desired configuration changes. Each method has advantages and disadvantages. Streaming data allows you to send your configuration change data in line, using your NETCONF connection. This is useful when the router is behind a firewall and you cannot establish another connection to upload a data file. With text files you can keep the edit configuration commands simple; with data files, there is no need to include the possibly complex configuration data stream.

To reference configuration data as a file, a client application emits the file location between <url> tag elements within the <rpc> and the <edit-config> tag elements.

<rpc>
    <edit-config>
        <target>
            <candidate/>
        </target>
        <url>
            <!- - location and name of file containing configuration data - ->
        </url>

    </edit-config>
</rpc>
]]>]]>

The data within these files can be formatted as either JUNOS XML or CLI configuration statements. When the configuration data is formatted as CLI configuration statements, you set the <url> format attribute to text.

<rpc>
    <edit-config>
        ...
      <url format=”text”>
        <!- - location and name of file containing configuration data - ->
      </url>
    </edit-config>
</rpc>

The configuration file can be placed locally or as a network resource:

Before loading the file, the client application or an administrator saves JUNOS 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 JUNOS XML representation of JUNOS configuration statements, see Mapping Configuration Statements to JUNOS XML Tag Elements.

The following example shows how to incorporate configuration data stored in the file /var/tmp/configFile on the FTP server called ftp.myco.com:

Client ApplicationNETCONF Server
<rpc message-id=”messageID”>
    
    <edit-config>
        <target>
            <candidate/>
        </target>
        <url>
            ftp://admin:AdminPwd@ftp.myco.com/
%F2var/tmp/configFile </url> </edit-config> </rpc> ]]>]]>
    
<rpc-reply xmlns=”URN” xmlns:junos=”URL”>
    
    
    
    

  
<ok/> </rpc-reply> ]]>]]>

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

<rpc>
    <edit-config>
        <target>
            <candidate/>
        </target>
        <config> or <config-text>
            <configuration> or <configuration-text>
                <!- - configuration changes - ->
            </configuration> or </configuration-text>
        </config> or </config-text>
           </edit-config>
</rpc>
]]>]]>

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

Client ApplicationNETCONF Server
<rpc message-id=”messageID”>
    
    <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:junos=”URL”>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
<ok/> 
    
</rpc-reply>
    
]]>]]>

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