NetEngine AR V300R019 NETCONF YANG API Reference
Image Download Management
Data Model
The data model file matching basic device information is huawei-system-load.yang.
Object |
Description |
---|---|
huawei-system-load:load-file |
Indicates that the operation request (creating, deleting, and modifying) object is file download configuration. It is only used to contain sub-objects, but does not have any data meaning. |
huawei-system-load:load-file/files:name |
Indicates a 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 a file type. The value is of the enumerated type:
|
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 and can be md5 or sha256. |
huawei-system-load:load-file/files/file-parameters/checksum/digest |
Indicates the checksum value. The value is a character string. In MD5 mode, the value is a string of 32 characters. In SHA256 mode, the value is a string of 64 characters. |
huawei-system-load:load-file/files/file-parameters/signature-check |
Indicates digital signature verification. The value is of the Boolean type and can be true or false. |
huawei-system-load:load-file/files/direction |
Indicates the file transfer direction. The value is of the enumerated type and can be download or upload. This object involves the download function. |
huawei-system-load:load-file/files/file-load-peers/file-location/fileserver-address |
Indicates the IP address of a file server. NOTE:
In V300R019C10 and later version: This object indicates the address of the Agile Controller with which the device registers when the value is set to agile-controller. |
huawei-system-load:load-file/files/file-load-peers/file-location/file-directory |
Indicates the file path. The value is a string of 1 to 128 case-insensitive characters without spaces. Characters ~, *, /, \, :, ', " cannot be used in the directory name. |
huawei-system-load:load-file/files/file-load-peers/client-options/file-directory |
Indicates the drive for storing the downloaded application image file. The value is a lower-case character string and can be vhdd0, hdd0, hdd1, or flash. If the value is flash, the file path is /mnt/flash/virtual-environment/packages/. NOTE:
Before configuring this parameter, ensure that the file type is vm-image. |
huawei-system-load:load-file/files/https/authentication-method |
Indicates the HTTPS authentication mode. The value is of the enumerated type. The options are as follows:
|
huawei-system-load:load-file/files/https/ca-authentication-method |
Indicates the HTTPS certificate authentication mode. The value is of the enumerated type. Currently, the value can only be bidirection, indicating bidirectional authentication. |
huawei-system-load:load-file/files/https/port |
Indicates an 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/pre-load-actions/slice-download-enable |
Enables fragment download. The value is of the Boolean type and can be true or false. |
huawei-system-load:load-file/files/pre-load-actions/remove-old-cc |
Indicates whether to delete the old system software package. The value is of the Boolean type and can be true or false. |
huawei-system-load:load-file/files/post-load-actions/enabled |
Indicates whether to load the downloaded file. The value is of the Boolean type and can be true or false. |
huawei-system-load:load-file/files/post-load-actions/reboot2new |
Indicates whether to restart the device. The value is of the Boolean type and can be true or false. NOTE:
If a file fails to be downloaded or loaded, the value is true, and the device is not restarted. |
huawei-system-load:download-guage/files/filename |
Indicates the file name for which the download progress is queried. The value is a string of 1 to 128 case-sensitive characters without spaces. |
huawei-system-load:operate-download/operate-type |
Indicates the file download operation type. Currently, the value can only be cancel download. |
huawei-system-load:operate-download/operate-type/files/path |
Indicates the path of the file whose download is canceled. The value is a string of 1 to 256 characters without spaces. |
huawei-system-load:operate-download/operate-type/files/name |
Indicates the name of the file whose download is canceled. The value is a string of 1 to 256 case-sensitive characters without spaces. |
huawei-system-load:operate-download/operate-type/files/file-type |
Indicates the type of the file whose download is canceled. Currently, only the vm-image type is supported. |
Downloading an Image File Using HTTPS
This section provides a sample of downloading an image file using HTTPS.
Data Requirements
Item |
Data |
Description |
---|---|---|
File name |
ar1610n.ova |
Use HTTPS to download a file ar1610n.ova with the file type vm-image and file size 153571200 bytes, and calculate the checksum in SHA256 mode. Configure the file server IP address 192.168.1.20, file path /flash, and server port number 8081. Use bidirectional HTTPS authentication. Disable fragment download and delete the old image file. After the image file has been downloaded, this file will not be loaded, and the device will not be restarted. |
File type |
vm-image |
|
File size, in bytes. |
153571200 |
|
Checksum calculation method |
sha256 |
|
Checksum value |
73f05d63d070fbce24f13a03debf8502868d61a10c4309eff519f573f1c95bb0 |
|
Digital signature verification |
false |
|
Direction (download/upload) |
download |
|
File server IP address |
192.168.1.20 |
|
File path |
/flash |
|
HTTPS authentication mode |
tls-ssl |
|
HTTPS certificate authentication mode |
bidirection |
|
HTTPS port number |
8081 |
|
Whether to enable fragment download |
false |
|
Whether to delete the old system software package |
true |
|
Whether to load the downloaded file |
false |
|
Whether to restart the device after file download |
false |
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>ar1610n.ova</name> <file-parameters> <type>vm-image</type> <size>153571200</size> <checksum> <digest-algorithm>sha256</digest-algorithm> <digest>73f05d63d070fbce24f13a03debf8502868d61a10c4309eff519f573f1c95bb0</digest> </checksum> <signature-check>false</signature-check> </file-parameters> <direction>download</direction> <file-load-peers> <file-location> <fileserver-address>192.168.1.20</fileserver-address> <file-directory>/</file-directory> </file-location> <client-options> <file-directory>flash</file-directory> </client-options> </file-load-peers> <https> <authentication-method>tls-ssl</authentication-method> <ca-authentication-method>bidirection</ca-authentication-method> <port>8081</port> </https> <pre-load-actions> <slice-download-enable>false</slice-download-enable> <remove-old-cc>true</remove-old-cc> </pre-load-actions> <post-load-actions> <enabled>false</enabled> <reboot2new>false</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>
Querying the Image File Download Progress
This section provides a sample of querying the image file download progress.
Operation |
XPATH |
---|---|
get |
huawei-system-load:download-guage/files/filename |
Data Requirements
Item |
Data |
Description |
---|---|---|
File name for which the download progress is queried |
test.ova |
Query the download status of the file test.ova. NOTE:
|
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>test.ova</filename> </files> </download-guage> </filter> </get> </rpc>
Response Example
- Sample of ongoing file download
<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>test2.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 failed file download
<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>test2.cc</filename> <file-directory>flash:/</file-directory> <direction>download</direction> <filetype>initial-cfg</filetype> <status>fail</status> </files> </download-guage> </data> </rpc-reply>
- Sample of successful file download
<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>test2.cc</filename> <file-directory>flash:/</file-directory> <direction>download</direction> <filetype>cc-packet</filetype> <status>success</status> </files> </download-guage> </data> </rpc-reply>
Canceling File Download
This section provides a sample of canceling file download.
Operation |
XPATH |
---|---|
edit-config:default |
huawei-system-load:operate-download/operate-type huawei-system-load:operate-download/operate-type/files |
Data Requirements
Item |
Data |
Description |
---|---|---|
File name |
test.ova |
Cancel file download. |
File path |
/mnt/vhdd0/virtual-environment/packages/ |
|
File type |
vm-image |
Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="27d43ba05690411c91c27a0e4cf8a012"> <operate-download xmlns="urn:huawei:params:xml:ns:yang:huawei-system-load"> <operate-type>cancel download</operate-type> <files> <name>test.ova</name> <path>/mnt/vhdd0/virtual-environment/packages/</path> <filetype>vm-image</filetype> </files> </operate-download> </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>