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

NETCONF YANG API Reference

AR100, AR120, AR160, AR1200, AR2200, AR3200, and AR3600 V300R003

NETCONF YANG API Reference
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).
Download Management and Device Upgrade

Download Management and Device Upgrade

Data Model

The data model file matching the device basic information is huawei-system-load.yang.

Table 3-2068 Data model

Object

Description

huawei-system-load:load-file/files:name

Indicates the file name. The value is a string of 1 to 128 case-sensitive characters without spaces.

huawei-system-load:load-file/files/file-parameters/type

Indicates the file type. The value is of the enumerated type:

  • cc-packet
  • patch
  • initial-cfg
  • certification
  • license
  • lxc-container-ova-pkg
  • lxc-container-delta-ova-pkg
  • voice-log-file
  • log-file
  • portal-install-script
  • portal-html
  • android-cfg
  • nginx-cfg
  • device-diagnosis-info

huawei-system-load:load-file/files/file-parameters/size

Indicates the file size. The value is an integer that ranges from 1 to 4294967296, in bytes.

huawei-system-load:load-file/files/file-parameters/checksum/digest-algorithm

Indicates the checksum calculation method. The value is of the enumerated type:

  • md5
  • sha256

huawei-system-load:load-file/files/file-parameters/checksum/digest

Indicates the checksum value. The value is a string of 32 characters for md5 and a string of 64 characters for sha256.

huawei-system-load:load-file/files/file-parameters/signature-check

Indicates the digital signature verification. The value is of the Boolean type:

  • true
  • false

huawei-system-load:load-file/files/direction

Indicates the file transfer direction. The value is of the enumeration type:

  • download
  • upload

This object mainly involves the download function.

huawei-system-load:load-file/files/file-load-peers/file-location/fileserver-address

Indicates the IP address of the file server. The value is in dotted decimal notation.

huawei-system-load:load-file/files/file-load-peers/file-location/file-directory

Indicates the file directory. The value is a string of 1 to 128 case-insensitive characters without spaces. The directory name cannot contain the following characters: ~ * / \ : ' ".

huawei-system-load:load-file/files/https/authentication-method

Indicates the HTTPS authentication mode. The value is of the enumerated type and is tls-ssl.

huawei-system-load:load-file/files/https/ca-authentication-method

Indicates the HTTPS certificate authentication mode. The value is of the enumerated type and is bidirection.

huawei-system-load:load-file/files/https/port

Indicates the HTTPS port number. The value is an integer that ranges from 1025 to 51200. The default value is 443.

huawei-system-load:load-file/files/sftp/username

Indicates the SFTP user name. The value is a string of 1 to 64 case-sensitive characters without spaces.

huawei-system-load:load-file/files/sftp/password

Indicates the SFTP password. The value is a string of 1 to 64 case-sensitive characters without spaces.

huawei-system-load:load-file/files/sftp/port

Indicates the SFTP port number. The value is an integer that ranges from 1 to 65535. The default value is the standard port number 22 of SFTP.

huawei-system-load:load-file/files/pre-load-actions/slice-download-enable

Enables fragmented download. The value is of the Boolean type:

  • true
  • false

huawei-system-load:load-file/files/pre-load-actions/remove-old-cc

Deletes the original system software package. The value is of the Boolean type:

  • true
  • false

huawei-system-load:load-file/files/post-load-actions/enabled

Loads the download file. The value is of the Boolean type:

  • true
  • false

huawei-system-load:load-file/files/post-load-actions/reboot2new

Restarts the device. The value is of the Boolean type:

  • true
  • false
NOTE:

If the file fails to be downloaded or loaded, the device does not restart when the value is true.

huawei-system-load:download-guage/files/filename

Checks the file download progress. The value is a string of 1 to 128 case-sensitive characters without spaces.

Downloading the System Software Package Using HTTPS for Device Upgrade

This section provides a sample of downloading the system software package using HTTPS for device upgrade.

NOTE:
  • The system software package can be downloaded only on the flash memory and Micro SD card, but not on the USB flash drive.
  • To download the system software package, you need to ensure that the space is sufficient. If the space is insufficient, the system automatically deletes files according to the sequence of the cc files, patch files, and configuration files. After the files are deleted, the system checks whether the space is sufficient. If the space is sufficient, the system stops deleting the files. If the space is insufficient, the system continues to delete the files. When the files are deleted, the system clears the files in the recycle bin simultaneously.
Data Requirements
Table 3-2069 Downloading the system software package using HTTPS for device upgrade

Item

Data

Description

File name

ar160.cc

Use HTTPS to download the file ar160.cc. The file type is cc-packet and the file size is 153571200 bytes. Use sha256 to calculate the checksum. The IP address of the file server is 189.189.34.9, the file directory is /cc, and the server port number is 18020. Use HTTPS bidirectional authentication. Disable fragmented download and do not delete the original system software package. After the download is complete, load the downloaded system software package and restart the device to upgrade the device.

File type

cc-packet

File size, in bytes

153571200

Checksum calculation method

sha256

Checksum value

070a977434821fc83b7394c62fa68be2c9180c3c81a2eef6ccf47de0d82155ae

Digital signature verification

false

Direction (download/upload)

download

IP address of the file server

189.189.34.9

File directory

/cc/

HTTPS authentication mode

tls-ssl

HTTPS certificate authentication mode

bidirection

HTTPS port number

18020

Whether fragmented download is enabled

false

Whether the original system software package is deleted

false

Whether the downloaded file is loaded

true

Whether the device is restarted after the download is complete

true

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="27d43ba05690411c91c27a0e4cf8a012">
 <load-file xmlns="urn:huawei:params:xml:ns:yang:huawei-system-load">
  <loadfile>
   <files>
    <name>ar160.cc</name>
    <file-parameters>
     <type>cc-packet</type>
     <size>153571200</size>
     <checksum>
      <digest-algorithm>sha256</digest-algorithm>
      <digest>070a977434821fc83b7394c62fa68be2c9180c3c81a2eef6ccf47de0d82155ae</digest>
     </checksum>
     <signature-check>false</signature-check>
    </file-parameters>
    <direction>download</direction>
    <file-load-peers>
     <file-location>
      <fileserver-address>189.189.34.9</fileserver-address>
      <file-directory>/cc/</file-directory>
     </file-location>
    </file-load-peers>
    <https>
     <authentication-method>tls-ssl</authentication-method>
     <ca-authentication-method>bidirection</ca-authentication-method>
     <port>18020</port>
    </https>
    <pre-load-actions>
     <slice-download-enable>false</slice-download-enable>
     <remove-old-cc>false</remove-old-cc>
    </pre-load-actions>
    <post-load-actions>
     <enabled>true</enabled>
     <reboot2new>true</reboot2new>
    </post-load-actions>
   </files>
  </loadfile>
 </load-file>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="27d43ba05690411c91c27a0e4cf8a012">
 <ok/>
</rpc-reply>  

Downloading the System Software Package Using SFTP for Device Upgrade

This section provides a sample of downloading the system software package using SFTP for device upgrade.

Data Requirements
Table 3-2070 Downloading the system software package using SFTP for device upgrade

Item

Data

Description

File name

ar160.cc

Use SFTP to download the file ar160.cc. The file type is cc-packet and the file size is 153571200 bytes. Use sha256 to calculate the checksum. The IP address of the file server is 189.189.34.9, the file directory is /cc, and the server port number is 22. The user name and password are huawei and huawei123, respectively. Disable fragmented download and do not delete the original system software package. After the download is complete, load the downloaded system software package and restart the device to upgrade the device.

File type

cc-packet

File size, in bytes

153571200

Checksum calculation method

sha256

Checksum value

070a977434821fc83b7394c62fa68be2c9180c3c81a2eef6ccf47de0d82155ae

Digital signature verification

false

Direction (download/upload)

download

IP address of the file server

189.189.34.9

File directory

/cc/

SFTP user name

huawei

SFTP password

huawei123

SFTP port number

22

Whether fragmented download is enabled

false

Whether the original system software package is deleted

false

Whether the downloaded file is loaded

true

Whether the device is restarted after the download is complete

true

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="27d43ba05690411c91c27a0e4cf8a012">
 <load-file xmlns="urn:huawei:params:xml:ns:yang:huawei-system-load">
  <loadfile>
   <files>
    <name>ar160.cc</name>
    <file-parameters>
     <type>cc-packet</type>
     <size>153571200</size>
     <checksum>
      <digest-algorithm>sha256</digest-algorithm>
      <digest>070a977434821fc83b7394c62fa68be2c9180c3c81a2eef6ccf47de0d82155ae</digest>
     </checksum>
     <signature-check>false</signature-check>
    </file-parameters>
    <direction>download</direction>
    <file-load-peers>
     <file-location>
      <fileserver-address>189.189.34.9</fileserver-address>
      <file-directory>/cc/</file-directory>
    </file-location>
    <vpn-options>
      <default-vpn-param>true</default-vpn-param>
    </vpn-options>
    </file-load-peers>
    <sftp>
     <username>huawei</username>
     <password>huawei123</password>
     <port>22</port>
    </sftp>
    <pre-load-actions>
     <slice-download-enable>false</slice-download-enable>
     <remove-old-cc>false</remove-old-cc>
    </pre-load-actions>
    <post-load-actions>
     <enabled>true</enabled>
     <reboot2new>true</reboot2new>
    </post-load-actions>
   </files>
  </loadfile>
 </load-file>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="27d43ba05690411c91c27a0e4cf8a012">
 <ok/>
</rpc-reply>

Checking the File Download Progress

This section provides a sample of checking the file download progress.

Table 3-2071 Checking the file download progress

Operation

XPATH

get:default

huawei-system-load/download-guage

Data Requirements
Table 3-2072 Checking the file download progress

Item

Data

Description

File name

ar160.cc

Check the download progress of the file ar160.cc, in percentage. If the file is being downloaded, the ongoing download progress in percentage is returned. If the file is downloaded successfully, the word "success" is returned. If the download fails, the word "fail" and the corresponding error code are returned. The error codes are as follows:

  • 01: The system software package fails to be configured as the startup file.
  • 03: The file name suffix is inconsistent with the file type.
  • 05: The network is unreachable (the file server fails or is unreachable).
  • 06: The storage space is insufficient.
  • 09: The downloaded file fails to be checked.
  • 13: The checksum value fails to be calculated (the checksum of the entire file cannot be calculated).
  • 14: The checksum value fails to be verified (the calculated checksum value of the entire file is incorrect).
  • 15: The number of times a single fragment is checked (including download failures) exceeds the upper limit of 5.

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="d161206925b04d58877400c0cbf9f155"> 
 <get> 
  <filter type="subtree"> 
 <download-guage xmlns="urn:huawei:params:xml:ns:yang:huawei-system-load"> 
    <files> 
     <filename>ar160.cc</filename> 
    </files> 
 </download-guage> 
 </filter> 
 </get> 
</rpc>
Response Example

Sample of download in progress response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="d161206925b04d58877400c0cbf9f155"> 
 <data> 
  <download-guage xmlns="urn:huawei:params:xml:ns:yang:huawei-system-load"> 
 <files> 
    <filename>ar160.cc</filename> 
    <file-directory>flash:/</file-directory> 
    <direction>download</direction> 
    <filetype>initial-cfg</filetype> 
    <status>ongoing</status> 
    <percentage>99</percentage> 
 </files> 
  </download-guage> 
 </data> 
</rpc-reply>

Sample of download failure response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="d161206925b04d58877400c0cbf9f155"> 
 <data> 
  <download-guage xmlns="urn:huawei:params:xml:ns:yang:huawei-system-load"> 
 <files> 
    <filename>ar160.cc</filename> 
    <file-directory>flash:/</file-directory> 
    <direction>download</direction> 
    <filetype>initial-cfg</filetype> 
    <status>fail</status> 
    <error-tag>14</error-tag> 
 </files> 
  </download-guage> 
 </data> 
</rpc-reply>

Sample of download success response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="d161206925b04d58877400c0cbf9f155"> 
 <data> 
  <download-guage xmlns="urn:huawei:params:xml:ns:yang:huawei-system-load"> 
 <files> 
    <filename>ar160.cc</filename> 
    <file-directory>flash:/</file-directory> 
    <direction>download</direction> 
    <filetype>cc-packet</filetype> 
    <status>success</status> 
 </files> 
  </download-guage> 
 </data> 
</rpc-reply> 
Translation
Download
Updated: 2019-03-06

Document ID: EDOC1100022096

Views: 8598

Downloads: 69

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