03-23-2018 04:51 PM - edited 03-01-2019 04:07 AM
I Wanted to set the values for the each items in the List entry .I knew there are many way to do that but for the current situation i should only use setLeaf .
Is it possible to set values using setLeaf to the List by iterating the List .Appreciate quick answer.
I wanted to Call setLeaf for the each of the list item below and that should update the value for "nnn-name" in each iteration.
[
{
"nnn-name": "RCBHY70029",
"ip-version": "IPv4",
"abc-address": "10.32.128.96",
"xx-number": "65377"
},
{
"nnn-name": "ABCCY70029",
"ip-version": "IPv4",
"abc-address": "10.32.128.56",
"xx-number": "65379"
},
{
"nnn-name": "ombdb65",
"ip-version": "IPv6",
"abc-address": "2001:8004:ff00:4000:0:7:e1c1:a8d3",
"xx-number": "65380"
}
]
Solved! Go to Solution.
03-26-2018 05:02 AM
Well, you didn't provide the YANG file for this data, so I can't tell for sure. I would guess the nnn-name is the key of the list. If so, you'd use create() to create list instances, then setElem() on each of the non-key leafs.
If on the other hand this is a config false keyless list, you could use setElem to set each leaf.
03-26-2018 05:02 AM
Well, you didn't provide the YANG file for this data, so I can't tell for sure. I would guess the nnn-name is the key of the list. If so, you'd use create() to create list instances, then setElem() on each of the non-key leafs.
If on the other hand this is a config false keyless list, you could use setElem to set each leaf.
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