Yang 1.1 says the implementation is free to define sort order when populating a leaf-list when using “ordered-by system”. which is the default. IE clients don’t specify order, the implementation is free to decide order.
I’m populating an array of IPs, and then using CONFD_SET_TAG_LIST to push them into the DB, into a leaf-list that is marked config false.
The DB is then sorting them using internal rules before serving them up to someone who queries that leaf-list.
How do I insert them into the DB and preserve insertion order? (Note this is not a client pushing to the server, this is me inserting items into the DB to be served up to a client)
It seems counter-intuitive to use “ordered-by user”, because this data is operational. As the server I’m trying to communicate order through the list, I don’t need the client to send me back a list in a particular order.
Does that make sense? RFC for 1.1 implies that as the server I should be able to serve up the list in the order I choose, but when I import the yang model into confd, it doesn’t preserve the order I inserted entries in.
I’ve asked this in a different form before, and was told to use “ordered-by user”, but that seems counter-intuitive to how 1.1 defines ordering. I’m the server in this case, because I’m serving up operational data. How do I control the order of the operational leaf-list I’m populating?
For reference, I’m initializing the DB with a list from a DHCP response, so I’m trying to report the same order that the DHCP contained. The yang model says the leaf-list is a default list, ie “ordered-by system”, which in this case is me, because I’m the server.
ie: If DHCP contains 192.168.2.101, 192.168.2.1 and 192.168.2.10, and someone reads my config-false leaf list, I want to report back 192.168.2.101, 1, 10, but if I use CONFD_SET_TAG_LIST, it sorts the items as they are inserted, so my list ends up being reports as 192.168.2.1, 10, 101
Is the DB just overriding my insertion order because it’s treating my CDB call as being the same as one from a client sending me a RESTCONF set?