NETCONF
This section describes the configuration model of NETCONF and provides examples of XML packets.
Data Model
The configuration model file matching the local command execution permission configuration is huawei-device.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
device/config-lock-info/locked |
Indicates whether to enable the local command execution permission. |
The value is of the enumerated type:
|
NA |
Configuring the Local Command Execution Permission
This section provides a sample of configuring the local command execution permission using the rpc method.
Operation |
XPATH |
---|---|
rpc |
device/config-lock-info/locked |
Data Requirement
Item |
Data |
Description |
---|---|---|
Whether to enable the local command execution permission |
true |
Disable the local command execution permission, so that users cannot run non-whitelisted commands. |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <dev:device xmlns:dev="urn:huawei:params:xml:ns:yang:huawei-device"> <dev:config-lock-info> <dev:locked>true</dev:locked> </dev:config-lock-info> </dev:device> </config> </edit-config> </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="0"> <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="0"> <rpc-error> <error-type>application</error-type> <error-tag>data-exists</error-tag> <error-severity>error</error-severity> <error-message>Request could not be completed because the relevant data model content already exists.</error-message> </rpc-error> </rpc-reply>