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 V200R012C00 NETCONF YANG API Reference

This document describes the NETCONF YANG 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/Uploading Files Using HTTPS

Downloading/Uploading Files Using HTTPS

Data Model

The data model file matching HTTPS-based file download or upload is huawei-system-load.yang.

NOTE:

Only the stand-alone devices that do not join any stack support this feature.

Table 2-42  Data model of HTTPS-based file download/upload on a switch

Object

Description

Value Remarks

load-file/loadfile/files/name

Indicates the name of a downloaded/uploaded file.

The value is a string of 1 to 64 characters.

The file name cannot contain the file name extension.

NA

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

Indicates the type of a downloaded/uploaded file.

The value is a character string.

During file download, the value can be:
  • cc-packet: software package
  • patch: patch file
During file upload, the value can be:
  • cpu-utilization-diagnosis: file recording CPU usage
  • mem-utilization-diagnosis: file recording memory usage
  • reboot-diagnosis: file recording restart information of a switch

NA

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

Indicates the size of a downloaded file.

The value is an integer, in bytes.

This value needs to be set only during file download.

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

Indicates the file check algorithm.

The value is a character string:
  • md5
  • sha1
  • sha256

NA

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

Indicates the file check code.

The value is a string of 1 to 64 characters.

NA

load-file/loadfile/files/direction

Indicates file download or upload.

The value is a character string:
  • download: file download
  • upload: file upload

NA

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

Indicates the IP address of a file server.

The value is a string of 1 to 64 characters.

NA

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

Indicates the directory of a file server.

The value is a string of 1 to 128 characters.

NA

load-file/loadfile/files/https/authentication-method

Indicates HTTPS authentication.

The value is a character string:
  • account: An account is used for authentication.
  • tls-ssl: tls-ssl is used for authentication.
  • account-and-ca: An account and tls-ssl are used for authentication.
  • none: No authentication is performed.
  • If the value is account or account-and-ca, both the https/username and https/password objects need to be delivered.
  • If the value is tls-ssl or account-and-ca, the ca-authentication-method object needs to be configured.

load-file/loadfile/files/https/username

Indicates the user name of a file server.

The value is a character string.

NA

load-file/loadfile/files/https/password

Indicates the password of a file server.

The value is a character string.

NA

load-file/loadfile/files/https/ca-authentication-method

Indicates the authentication method of a file server.

The value is a character string:
  • bidirection: bidirectional authentication
  • unidirection: unidirectional authentication

NA

load-file/loadfile/files/https/port

Indicates the port number of a file server.

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

NA

Downloading Files from a File Server to a Switch

This section describes the packets sent when files are downloaded from a file server to a switch.

Table 2-43  Downloading files from a file server to a switch

Operation

XPATH

rpc

/huawei-system-load/load-file

Data requirement

Table 2-44  Data required during file download from a file server to a switch

Item

Data

Description

File name

test.cc

Indicates the name of a downloaded file.

File type

cc-packet

Indicates the type of a downloaded file.

File size

60301028 byte

Indicates the size of a downloaded file.

Check code algorithm

md5

Indicates the check code algorithm.

Check code

31688

Indicates the check code used to check a file.

File processing mode

download

Indicates file download.

SFTP server address

192.168.1.5

Indicates the IP address of a file server.

File server directory

/

Indicates the file directory of a file server.

SFTP server authentication method

none

Indicates that no authentication is required.

SFTP server port number

18020

Indicates the port number of a file server.

Request example

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="d05b09cf-309f-11e7-bc35-c5664306265c">
 <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:https> 
     <sys-load:authentication-method>none</sys-load:authentication-method>
     <sys-load:port>18020</sys-load:port> 
    </sys-load:https> 
   </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>

Uploading Files from a Switch to a File Server

This section describes the packets sent when files are uploaded from a switch to a file server.

Table 2-45  Uploading files from a switch to a file server

Operation

XPATH

rpc

/huawei-system-load/load-file

Data requirement

Table 2-46  Uploading files from a switch to a file server

Item

Data

Description

File name

2017_04_24_12_13_55_slot_1_0_cpu_diag.txt.gz

Indicates the name of an uploaded file.

File type

cpu-utilization-diagnosis

Indicates the type of an uploaded file.

Check code algorithm

md5

Indicates the check code algorithm.

Check code

2

Indicates the check code used to check a file.

File processing mode

upload

Indicates file upload.

SFTP server address

192.168.1.5

Indicates the IP address of a file server.

File server directory

/

Indicates the file directory of a file server.

SFTP server authentication method

none

Indicates that no authentication is required.

SFTP server port number

18020

Indicates the port number of a file server.

Request example

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="d05b09cf-309f-11e7-bc35-c5664306265c">
 <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>2017_04_24_12_13_55_slot_1_0_cpu_diag</sys-load:name>
    <sys-load:file-parameters>
     <sys-load:type>cpu-utilization-diagnosis</sys-load:type>
     <sys-load:checksum>
      <sys-load:digest-algorithm>md5</sys-load:digest-algorithm>
      <sys-load:digest>2</sys-load:digest>
     </sys-load:checksum>
    </sys-load:file-parameters>
    <sys-load:direction>upload</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:https>
     <sys-load:authentication-method>none</sys-load:authentication-method>
     <sys-load:port>18020</sys-load:port>
    </sys-load:https>
   </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>

Notification sent for a file upload failure

<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<eventTime>2017-01-04T15:56:43Z</eventTime>
  <load-result xmlns="urn:huawei:params:xml:ns:yang:huawei-system-load">
    <name>2017_04_24_12_13_55_slot_1_10_cpu_diag.txt.gz</name>
    <direction>upload</direction>
    <type>cpu-utilization-diagnosis</type>
    <result>fail</result>
    <error-tag>1</error-tag>
    <sub-error-tag>65539</sub-error-tag>
    <directory>/</directory>
  </load-result>
</notification>
Translation
Download
Updated: 2018-09-01

Document ID: EDOC1100037962

Views: 6368

Downloads: 8

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