cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
640
Views
0
Helpful
0
Replies

NETCONF - IOS XE - 16.04.01 cli-config-data throws error

vgujuluv
Cisco Employee
Cisco Employee

Hi,

I am trying to execute CLI commands using NETONF RPC in IOS XE 16.04.01. I got the schema for the NETCONF RPC from the device CLI "show netconf schema". Below is the schema specific to edit-config,

<edit-config> [0, 1] required
<target> 1 required
<candidate> [0, 1] required
<running> [0, 1] required
<startup> [0, 1] required
<url> [0, 1] required
<default-operation> [0, 1] required
<test-option> [0, 1] required
<error-option> [0, 1] required
<config> 1 required
<cli-config-data> [0, 1] required
<cmd> 1+ required
<cli-config-data-block> [0, 1] required

<cli-config-data> is seen in the schema. I tried to execute the below RPC but it throws error as <bad-element>cli-config-data</bad-element>. How to execute CLI commands using NETCONF for IOS XE?

RPC request
==========
<rpc message-id="2323" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<cli-config-data>
<cmd>hostname CSR1000V</cmd>
</cli-config-data>
</config>
</edit-config>
</rpc>

RPC reply
========
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2323">
<rpc-error>
<error-type>protocol</error-type>
<error-tag>unknown-element</error-tag>
<error-severity>error</error-severity>
<error-path>
/rpc/edit-config/config
</error-path>
<error-info>
<bad-element>cli-config-data</bad-element>
</error-info>
</rpc-error>
</rpc-reply>

0 Replies 0
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: