No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S600-E V200R011C10 NETCONF YANG API Reference

This document describes the NETCONF API functions supported by the switch, including the data model and samples.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Downloading a File Using FTP

Downloading a File Using FTP

This model uses FTP to instruct a switch to download files (system software package and patch file) from a file server.

Data Model

The data model file matching FTP-based file download on a switch is huawei-system-load.yang.

Table 2-41  Data model of FTP-based file download on a switch

Object

Description

Value Remarks

load-file/loadfile/files/name

Indicates the name of the file to be downloaded.

The value is a string of 1 to 64 characters.

N/A

load-file/loadfile/files/file-parameters/type

Indicates the type of the file to be downloaded.

The value is of the enumerated type.

During file download, the value can be:
  • cc-packet: system software package
  • patch: patch file

N/A

load-file/loadfile/files/file-parameters/size

Indicates the size of the file to be downloaded.

The value is an integer, in bytes.

The value needs to be set only before file download.

load-file/loadfile/files/file-parameters/checksum/digest-algorithm

Indicates the file check algorithm.

The value is of the enumerated type:
  • md5
  • sha1
  • sha256

N/A

load-file/loadfile/files/file-parameters/checksum/digest

Indicates the file check code.

The value is a string of 1 to 64 characters.

N/A

load-file/loadfile/files/direction

Indicates the file to be downloaded.

The value is of the enumerated type:
  • download: file download

FTP can only be used to download files.

load-file/loadfile/files/file-parameters/file-load-peers/file-location/fileserver-address

Indicates the IP address of the file server.

The value is a string of 1 to 64 characters.

N/A

load-file/loadfile/files/file-parameters/file-load-peers/file-location/file-directory

Indicates the directory on the file server.

The value is a string of 1 to 128 characters.

N/A

load-file/loadfile/files/https/username

Indicates the user name used to log in to the file server.

The value is a character string.

The value must contain no less than 6 characters.

load-file/loadfile/files/https/password

Indicates the password used to log in to the file server.

The value is a character string.

The value must contain no less than 6 characters.

load-file/loadfile/files/ftp/port

Indicates the port number of the file server.

The value is an integer that ranges from 0 to 65535.

The port number of the FTP server is 21.

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 2-42  Downloading a file from a file server to a switch

Operation

XPATH

rpc

/huawei-system-load/load-file

Data Requirements

Table 2-43  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

cc-packet

Specify the type of the file to be downloaded.

File size

60301028 bytes

Specify the size of the file to be downloaded.

Check code algorithm

md5

Specify the check code algorithm.

Check code

31688

Specify the check code used for file check.

File processing mode

download

Download the file.

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.

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>cc-packet</sys-load:type> 
     <sys-load:size>60301028</sys-load:size> 
     <sys-load:checksum> 
      <sys-load:digest-algorithm>md5</sys-load:digest-algorithm>
      <sys-load:digest>31688</sys-load:digest> 
     </sys-load:checksum> 
    </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: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>
Translation
Download
Updated: 2019-09-23

Document ID: EDOC1000178028

Views: 4910

Downloads: 0

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next