File Management and Startup (HTTPS)
This model is used to manage and start files through HTTPS.
Data Model
The data model file corresponding to the HTTPS management file is huawei-system-load.yang.
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. |
NA |
load-file/loadfile/files/file-parameters/type |
Indicates the type of a downloaded/uploaded file. |
The value is a character string.
|
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/direction |
Indicates file download or upload. |
The value is a character string:
|
NA |
load-file/loadfile/files/file-parameters/checksum/digest-algorithm |
Indicates the file authentication mode used by the controller. |
The value is an enumerated string:
|
This parameter is mandatory only when a file needs to be downloaded. |
load-file/loadfile/files/file-parameters/checksum/digest |
Indicates the verification value of the target file. |
The value is a string of 1 to 64 characters. |
This parameter is mandatory only when a file needs to be downloaded. |
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:
|
|
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:
|
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 |
load-file/loadfile/files/pre-load-actions/remove-old-cc |
Indicates the old system software package and patch to be deleted. When the space is insufficient, the log is deleted. |
Boolean type:
|
NA |
load-file/loadfile/files/pre-load-actions/remove-old-log |
Indicates the log to be deleted. |
Boolean type:
|
NA |
post-load-action/actions-to-file/name |
Indicates the name of an execution file. |
The value is a string of 5to 48 characters. |
NA |
post-load-action/actions-to-file/type |
Indicates the type of the file to be executed. |
The value is a character string.
|
NA |
post-load-action/actions-to-file/actions/enable |
Execute the file. |
Boolean type:
|
NA |
/huawei-system-load:download-guage |
Indicates the status of the device loading process. |
NA |
Including the download status, download progress, error flag, and so on. |
control-loading-action/actions-to-file/actions/status |
Indicates the operation of the device loading process. |
The value is a character string:
|
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.
Operation |
XPATH |
---|---|
rpc |
/huawei-system-load/load-file |
Data requirement
Item |
Data |
Description |
---|---|---|
File name |
test.cc |
Indicates the name of a downloaded file. |
File type |
sys-load:cc-packet |
Indicates the type of a downloaded file. |
File size |
60301028 byte |
Indicates the size of a downloaded file. |
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. |
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. |
HTTPS server authentication method |
none |
Indicates that no authentication is required. |
HTTPS 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>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: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.
Operation |
XPATH |
---|---|
rpc |
/huawei-system-load/load-file |
Data requirement
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: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>