PANTHEONtech / lighty

Lightweight OpenDaylight runtime library
https://lighty.io
Eclipse Public License 1.0
134 stars 74 forks source link

gNMI simulator: Error when trying to set augmented data #848

Closed Fenrock closed 2 years ago

Fenrock commented 2 years ago

Describe the bug

Can`t update data added by augmentation. Error: Instance identifier references (http://openconfig.net/yang/vxlan/extension?revision=2019-12-03)vxlan-vni-instances but data identifier is AugmentationIdentifier{childNames=[(http://openconfig.net/yang/vxlan/extension?revision=2019-12-03)vxlan-vni-instances]}

Branch

15.0.1

To Reproduce

Start gNMI simulator with these yang files: yangs.zip Send gNMI set requests: Payload: { "vni-instance": [ { "config": { "source-nve": "vtepbrcm", "vni-id": 10 }, "source-nve": "vtepbrcm", "vni-id": 10 } ] } Request: gnmic set --update-path openconfig-network-instance:network-instances/network-instance[name=Vlan10]/openconfig-vxlan:vxlan-vni-instances --update-file $file --encoding json_ietf

Expected behavior

Successful gnmi request

Environment

PeterSuna commented 2 years ago

Hello Fenrock, You are missing a list element in path with key elements. Try this:

gnmic request gnmic set --update-path openconfig-network-instance:network-instances/network-instance[name=Vlan10]/openconfig-vxlan:vxlan-vni-instances/vni-instance[vni-id=10][source-nve=vtepbrcm] --update-file vxlan-vni-instances.json --encoding json_ietf

vxlan-vni-instances.json body: { "config": { "source-nve": "vtepbrcm", "vni-id": 10 }, "source-nve": "vtepbrcm", "vni-id": 10 }

Hope this helps.