[NETCONF-367] Error parsing namespace when using YANG PATCH with absolute target path Created: 09/Mar/17 Updated: 31/Jan/22 Resolved: 31/Jan/22 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | None |
| Fix Version/s: | 2.0.13 |
| Type: | Bug | ||
| Reporter: | Wenbo Hu | Assignee: | Samuel Schneider |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 7949 |
| Description |
|
When we try to create and merge with an absolute target path, it works well. However, when we try to delete or remove with an absolute target path, restconf returns an error of 400. Message is "Error parsing input: null". According to my inspection, it can be located to org.opendaylight.netconf.sal.rest.impl.XmlToPATCHBodyReader:147-154 |
| Comments |
| Comment by Wenbo Hu [ 09/Mar/17 ] |
|
It only happens when parsing xml payload. Json payload as below: ] |
| Comment by Samuel Schneider [ 31/Jan/22 ] |
|
Bug-fix for odl-restconf-nb-bierman02 will not be done.
You should use odl-restconf-nb-rfc8040 instead. Given examples would looks like this: Payload: <yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> <patch-id>VPN-CREATION-1</patch-id> <comment>Create VPN-1</comment> <edit> <edit-id>1</edit-id> <operation>create</operation> <target>/Cisco-IOS-XR-infra-rsi-cfg:vrfs/vrf=vpn-78</target> <value> <vrf xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-infra-rsi-cfg"> <vrf-name>vpn-78</vrf-name> <create></create> <afs> <af> <af-name>ipv6</af-name> <saf-name>unicast</saf-name> <topology-name>default</topology-name> <create></create> </af> <af> <af-name>ipv4</af-name> <saf-name>unicast</saf-name> <topology-name>default</topology-name> <create></create> <bgp xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-bgp-cfg"> <import-route-targets> <route-targets> <route-target> <type>as</type> <as-or-four-byte-as> <as-xx>0</as-xx> <as>4804</as> <as-index>1</as-index> <stitching-rt>0</stitching-rt> </as-or-four-byte-as> </route-target> </route-targets> </import-route-targets> <export-route-targets> <route-targets> <route-target> <type>as</type> <as-or-four-byte-as> <as-xx>0</as-xx> <as>4804</as> <as-index>1</as-index> <stitching-rt>0</stitching-rt> </as-or-four-byte-as> </route-target> </route-targets> </export-route-targets> </bgp> </af> </afs> <description>vrf for VPN which connects each site from iosxrv-7 and iosxrv-8</description> <vpn-id> <vpn-oui>4804</vpn-oui> <vpn-index>1</vpn-index> </vpn-id> </vrf> </value> </edit> <edit> <edit-id>2</edit-id> <operation>create</operation> <target>/Cisco-IOS-XR-ifmgr-cfg:interface-configurations/interface-configuration=act,Loopback1</target> <value> <interface-configuration xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"> <active>act</active> <interface-name>Loopback1</interface-name> <interface-virtual></interface-virtual> <ipv4-network xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-io-cfg"> <addresses> <primary> <address>7.7.7.7</address> <netmask>255.255.255.255</netmask> </primary> </addresses> </ipv4-network> <vrf xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-infra-rsi-cfg">vpn-78</vrf> </interface-configuration> </value> </edit> <edit> <edit-id>3</edit-id> <operation>merge</operation> <target>/Cisco-IOS-XR-ipv4-bgp-cfg:bgp/instance=default/instance-as=0/four-byte-as=4804/vrfs/vrf=vpn-78</target> <value> <vrf xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-bgp-cfg"> <vrf-name>vpn-78</vrf-name> <vrf-global> <route-distinguisher> <as-xx>0</as-xx> <as>4804</as> <type>as</type> <as-index>1</as-index> </route-distinguisher> <exists></exists> <vrf-global-afs> <vrf-global-af> <af-name>ipv4-unicast</af-name> <enable></enable> <connected-routes></connected-routes> <static-routes></static-routes> </vrf-global-af> </vrf-global-afs> </vrf-global> </vrf> </value> </edit> </yang-patch> Remove: Payload: <yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> <patch-id>VPN-DELETION-1</patch-id> <comment>Delete VPN-1</comment> <edit> <edit-id>1</edit-id> <operation>remove</operation> <target>/Cisco-IOS-XR-ipv4-bgp-cfg:bgp/instance=default/instance-as=0/four-byte-as=4804/vrfs/vrf=vpn-78</target> </edit> </yang-patch> |