Patch File Management
This section describes the patch file management model and provides examples of XML packets.
Data Model
The configuration model file matching patch file management is huawei-system-patch.yang.
Object |
Description |
Value Range |
Remarks |
---|---|---|---|
/patch-operation/input/operations/operation/type |
Indicates the type of an operation on the patch file. |
The value is of the enumerated type:
|
N/A |
/patch-operation/input/operations/operation/operation-parameters/name |
Indicates the patch file name. |
The value is a string of 1 to 64 characters. |
N/A |
/patch-operation/input/operations/operation/operation-parameters/status-after-load |
Indicates the action taken after the patch file is loaded. |
The value is of the enumerated type:
|
N/A |
Setting the Patch File for Next Startup
This section provides a sample of setting the patch file for next startup using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-system-patch/patch-operation |
Data Requirements
Item |
Data |
Description |
---|---|---|
Patch type |
device-bin-patch-type |
- |
Type of an operation on the patch file |
startup-config |
Set the patch file for next startup. |
Patch name |
patch_shell_36592.pat |
Set the patch name. |
Request Example
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="22e80f30-81a5-11e7-a9f7-bdb31760b42e"> <patch:patch-operation xmlns:patch="urn:huawei:params:xml:ns:yang:huawei-system-patch"> <patch:patch-type>device-bin-patch-type</patch:patch-type> <patch:operations> <patch:operation> <patch:type>startup-config</patch:type> <patch:operation-parameters> <patch:name>patch_shell_36592.pat</patch:name> </patch:operation-parameters> </patch:operation> </patch:operations> </patch:patch-operation> </rpc>
Response Example
Pre-processing succeeds.
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="e5ceb2c0-8168-11e7-b741-bdb31760b42e"> <ok/> </rpc-reply>
Pre-processing fails.
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="141a5f30-2736-11e8-baf2-b8a61503722a"> <rpc-error xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-app-tag>1</error-app-tag> <error-message>Service process failed.</error-message> </rpc-error> </rpc-reply>
Loading the Patch File
This section provides a sample of loading the patch file using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-system-patch/patch-operation |
Data Requirements
Item |
Data |
Description |
---|---|---|
Patch type |
device-bin-patch-type |
- |
Type of an operation on the patch file |
load |
Load the patch file. |
Action taken after the patch file is loaded |
running |
If the type of an operation on the patch file is set to load, this field indicates the action taken after the patch file is loaded. |
Patch name |
patch_shell_36592.pat |
Specify the patch file to be loaded. |
Request Example
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="e5ceb2c0-8168-11e7-b741-bdb31760b42e"> <patch:patch-operation xmlns:patch="urn:huawei:params:xml:ns:yang:huawei-system-patch"> <patch:patch-type>device-bin-patch-type</patch:patch-type> <patch:operations> <patch:operation> <patch:type>load</patch:type> <patch:operation-parameters> <patch:status-after-load>running</patch:status-after-load> <patch:name>patch_shell_36592.pat</patch:name> </patch:operation-parameters> </patch:operation> </patch:operations> </patch:patch-operation> </rpc>
Response Example
Pre-processing succeeds.
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="e5ceb2c0-8168-11e7-b741-bdb31760b42e"> <ok/> </rpc-reply>
Pre-processing fails.
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="141a5f30-2736-11e8-baf2-b8a61503722a"> <rpc-error xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-app-tag>1</error-app-tag> <error-message>Service process failed.</error-message> </rpc-error> </rpc-reply>
Deleting the Patch File
This section provides a sample of deleting the patch file using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-system-patch/patch-operation |
Data Requirements
Item |
Data |
Description |
---|---|---|
Patch type |
device-bin-patch-type |
- |
Type of an operation on the patch file |
remove |
Delete the patch file in the current system. |
Request Example
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="fef2e3c0-81a4-11e7-8340-bdb31760b42e"> <patch:patch-operation xmlns:patch="urn:huawei:params:xml:ns:yang:huawei-system-patch"> <patch:patch-type>device-bin-patch-type</patch:patch-type> <patch:operations> <patch:operation> <patch:type>remove</patch:type> </patch:operation> </patch:operations> </patch:patch-operation> </rpc>
Response Example
Pre-processing succeeds.
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="e5ceb2c0-8168-11e7-b741-bdb31760b42e"> <ok/> </rpc-reply>
Pre-processing fails.
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="141a5f30-2736-11e8-baf2-b8a61503722a"> <rpc-error xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-app-tag>1</error-app-tag> <error-message>Service process failed.</error-message> </rpc-error> </rpc-reply>