< Home

Downloading a File from a File Server to a Switch

This section provides a sample of downloading a file from a file server to a switch.

Table 1 Downloading a file from a file server to a switch

Operation

XPATH

rpc

/huawei-system-load/load-file

Data Requirements

Table 2 Setting the data for downloading a file from a file server to a switch

Item

Data

Description

File name

test.cc

Specify the name of the file to be downloaded.

File type

sys-load:cc-packet

Specify the type of the file to be downloaded.

File size

60301028 byte

Specify the size of the file to be downloaded.

Authentication mode

sha256

Set the file authentication mode used by the controller.

Verification value of the target file

ff0fd0701a5ab80ee406816be4f8ea4d61c798a7ed503ece6e25f0b569b73369

Set the verification value of the file to be downloaded.

IP address of the FTP server

192.168.1.5

Specify the IP address of the file server.

File directory on the server

/

Specify the file directory on the file server.

User name used to log in to the FTP server

Huawei123

Specify the user name used to log in to the FTP server.

Password used to log in to the FTP server

Root@123

Specify the password used to log in to the FTP server.

Port number of the FTP server

21

Specify the FTP port number on the file server.

Delete the patch of the old system software package.

true

Enable the function of deleting the patch of the old system software package on the device.

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4ca12ea1-83f4-11e7-bed7-a8e51040f545">
 <sys-load:load-file xmlns:sys-load="urn:huawei:params:xml:ns:yang:huawei-system-load"> 
  <sys-load:loadfile> 
   <sys-load:files> 
    <sys-load:name>test.cc</sys-load:name> 
    <sys-load:file-parameters> 
     <sys-load:type>sys-load:cc-packet</sys-load:type> 
     <sys-load:size>60301028</sys-load:size> 
     <sys-load:checksum>
       <sys-load:digest-algorithm>sha256</sys-load:digest-algorithm>
       <sys-load:digest>ff0fd0701a5ab80ee406816be4f8ea4d61c798a7ed503ece6e25f0b569b73369</sys-load:digest>
    </sys-load:file-parameters> 
    <sys-load:direction>download</sys-load:direction>
    <sys-load:file-load-peers> 
     <sys-load:file-location> 
      <sys-load:fileserver-address>192.168.1.5</sys-load:fileserver-address> 
      <sys-load:file-directory>/</sys-load:file-directory> 
     </sys-load:file-location> 
    </sys-load:file-load-peers> 
    <sys-load:ftp> 
     <sys-load:username>Huawei123</sys-load:username>
     <sys-load:password>Root@123</sys-load:password>
     <sys-load:port>21</sys-load:port> 
    </sys-load:ftp> 
    <sys-load:pre-load-actions>
          <sys-load:remove-old-cc>true</sys-load:remove-old-cc>
    </sys-load:pre-load-actions>
   </sys-load:files> 
  </sys-load:loadfile> 
 </sys-load:load-file> 
</rpc>

Response Example

Sample of successful response

<?xml version="1.0" encoding="UTF-8"?> 
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1001"> 
  <ok/> 
</rpc-reply>

Sample of failed response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-message>parse rpc config error.</error-message>
  </rpc-error>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic