12-18-2017 05:15 PM - edited 03-01-2019 06:19 PM
I have a problem with NETCONF get-config operation to Nexus 7000 with OS version 7.3(1)D1(1).
Sent message has xmlns attribute in rpc tag.
<?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <get-config> <source> <running/> </source> </get-config> </rpc>
However, the result says that rpc is a bad element for missing namespaces attribute.
<?xml version="1.0" encoding="utf-8"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <rpc-error> <error-type>rpc</error-type> <error-tag>missing-attribute</error-tag> <error-severity>error</error-severity> <error-message>Wrong document: namespaces not specified</error-message> <error-info> <bad-element>rpc</bad-element> </error-info> </rpc-error> </rpc-reply>
In comparison, my get-config query has no problem with ASR 9000, IOS XR 6.1.4.
<?xml version="1.0" encoding="utf-8"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <data> ...
How can I walk around this error?
01-21-2018 05:13 PM
Answering to my own question.
Unlike other devices, NX-OS requires two xmlns's as attribute of rpc element, one for netconf base and the other for Cisco data store.
RPC message below got a response without errors. (However the result is not as what I expect. I'm going to post another question regarding it.) "urib" can be any other subtree defined by Cisco NX-OS.
<nf:get-config xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="http://www.cisco.com/nxos:7.3.1.D1.1.:urib"> <nf:source> <nf:running/> </nf:source> </nf:get-config>
05-14-2018 01:40 AM
I could make get-config RPC work in this way. "urib" can be replaced by any other defined subtree.
<nf:get-config
xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns="http://www.cisco.com/nxos:7.3.1.D1.1.:urib">
<nf:source>
<nf:running/>
</nf:source>
</nf:get-config>
However it lead me another issue that the result is in form of CLI commands, not XML-structured. So I asked to Cisco about it as this.
Result from NX-OS:
<?xml version="1.0" encoding="utf-8"?>
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns:pfx1="http://www.cisco.com/nxos:7.3.1.D1.1.:urib"
xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0">!Command: show running-config
!Time: Tue Jan 16 18:00:27 2018
version 7.3(1)D1(1)
hostname MASKED_FOR_ANONYMITY
feature telnet
feature ospf
......
xml server max-session 6
xml server validate all</data>
Result from IOS-XR:
<?xml version="1.0" encoding="utf-8"?>
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<aaa xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-locald-admin-cfg">
<usernames>
<username>
......
</data>
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide