Plug-in Management
This section describes the plug-in management model and provides examples of XML packets.
Data Model
The configuration model file matching plug-in management is huawei-system-patch.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-system-patch:module-operation/input/operations/operation/name |
Indicates a plug-in name. |
The plug-in must already exist on the device. |
NA |
/huawei-system-patch:module-operation/input/operations/operation/type |
Indicates the plug-in installation/uninstallation mode. |
The value is of the enumerated type:
|
NA |
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-system-patch:module-status/modules |
Checks information about the plug-in currently installed on the device. |
NA |
This object only supports the get operation. |
/huawei-system-patch:next-startup-module-status/modules |
Checks information about the plug-in to be installed at the next startup. |
NA |
This object only supports the get operation. |
Object |
Description |
---|---|
/huawei-system-patch:module-status/modules/name |
Type of the plug-in currently installed on the device. |
/huawei-system-patch:module-status/modules/version |
Version of the plug-in currently installed on the device. |
/huawei-system-patch:module-status/modules/install-time |
Time when the plug-in was installed on the device. |
/huawei-system-patch:module-status/modules/file-name |
Name of the plug-in currently installed on the device. |
/huawei-system-patch:next-startup-module-status/modules/file-name |
Name of the plug-in to be installed at the next startup. |
Installing/Uninstalling a Plug-in
This section provides a sample of installing or uninstalling a plug-in using the rpc method.
Operation |
XPATH |
---|---|
rpc |
|
Installing a Plug-in
Data requirements
Item |
Data |
Description |
---|---|---|
Plug-in name |
s12700e-v200r020C00weakea.mod |
- |
Plug-in installation mode |
install-module |
Installs a plug-in and makes it take effect immediately. |
Request example
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<patch:module-operation xmlns:patch="urn:huawei:params:xml:ns:yang:huawei-system-patch">
<patch:operations>
<patch:operation>
<patch:name>s12700e-v200r020C00weakea.mod</patch:name>
<patch:type>install-module</patch:type>
</patch:operation>
</patch:operations>
</patch:module-operation>
</rpc>
Response example
# Sample of successful response
##### Ok Reply or Operation Successful ##### <?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <ok/> </rpc-reply>
# Sample of failed response
##### Error Reply or Operation Failed ##### <?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <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-path/> <error-message>Service process failed.</error-message> </rpc-error> </rpc-reply>
Uninstalling a Plug-in
Data requirements
Item |
Data |
Description |
---|---|---|
Plug-in name |
s12700e-v200r020C00weakea.mod |
- |
Plug-in uninstallation mode |
uninstall-module |
Uninstalls the plug-in currently installed on the device. |
Request example
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4">
<patch:module-operation xmlns:patch="urn:huawei:params:xml:ns:yang:huawei-system-patch">
<patch:operations>
<patch:operation>
<patch:name>s12700e-v200r020C00weakea.mod</patch:name>
<patch:type>uninstall-module</patch:type>
</patch:operation>
</patch:operations>
</patch:module-operation>
</rpc>
Response example
# Sample of successful response
##### Ok Reply or Operation Successful ##### <?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"> <ok/> </rpc-reply>
# Sample of failed response
##### Error Reply or Operation Failed #####
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4">
<rpc-error>
<error-path>/huawei-system-patch:module-operation/operations/operation[name='s12700e-v200r020C00weakea.mod']/type</error-path>
<error-message>Failed to resolve identityref "huawei-system-patch:uninstall-moduletest".</error-message>
</rpc-error>
</rpc-reply>
Checking Plug-in Information on the Device
This section provides samples of checking plug-in information on the device using the get method.
Checking Information About the Plug-in Currently Installed on the Device
Operation |
XPATH |
---|---|
get |
/huawei-system-patch:module-status/modules |
Request example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get> <filter type="subtree"> <patch:module-status xmlns:patch="urn:huawei:params:xml:ns:yang:huawei-system-patch"/> </filter> </get> </rpc>
Plug-in information returned by the device
##### Ok Reply or Operation Successful #####
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
<data>
<module-status xmlns="urn:huawei:params:xml:ns:yang:huawei-system-patch">
<modules>
<name>WeakEA</name>
<version>SPH</version>
<install-time>2020-07-16T17:42:47+08:00</install-time>
<file-name>s12700e-v200r020C00weakea.mod</file-name>
</modules>
</module-status>
</data>
</rpc-reply>
Checking Information About the Plug-in to Be Installed at the Next Startup
Operation |
XPATH |
---|---|
get |
/huawei-system-patch:next-startup-module-status |
Request example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get> <filter type="subtree"> <patch:next-startup-module-status xmlns:patch="urn:huawei:params:xml:ns:yang:huawei-system-patch"/> </filter> </get> </rpc>
Plug-in information returned by the device
##### Ok Reply or Operation Successful ##### <?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3"> <data> <next-startup-module-status xmlns="urn:huawei:params:xml:ns:yang:huawei-system-patch"> <modules> <file-name>flash:/$_install_mod/s12700e-v200r020C00weakea.mod</file-name> </modules> </next-startup-module-status> </data> </rpc-reply>