ConfD User Community

Reordering of a list



I need to reorder my list because I need to save a part of my configuration in a non-alphabetical order.
I already have a set-hook defined for the list. Set-hook handles create and delete callbacks.
I have trouble understanding which other callbacks i need to implement. to me it makes sense to only implement get_next(), looking at the user guide I see that callback move_after is mentioned.
I could not find any CDB API examples with “ordered-by user”.
Can you please help?
BR Jaka


For plain “ordered-by user” you should not need to define any callbacks. The list instances are stored in the order as they are entered, you may reorder them if needed. Have a look at the “ordered” example.

Or is your use-case more complex?


Hi mvf and sorry for late reply!

I can’t grasp the whole picture regarding the reordering of a list. As I read the user manual i got a couple of ideas how I think confd can be made to do reordering. Can you please comment on the list bellow regarding if the points are feasible?

  • create get_next cb via set hook or transaction hook?

  • create move_after cb via set hook or transaction hook?

  • use maapi_move_after inside create cb?

p.s. I haven’t tried your suggestion yet and will reply when I do.


Yes reordered-by user is a fine solution, thank you. There is only one problem which is that upgrade fails. Is this something that is very possible or is it just a bug in our implementation.
p.s. could you please elaborate a bit on the points from the previous comment


I am not aware of any issues with upgrading lists configurations from ordered-by system (the default) to ordered-by user; so I’d say it is something in your application.

As for the callbacks - I still fail to see why you think you need them. Once your list is ordered-by user, you may order the list entries from CLI, using NETCONF, or from an application, no callbacks of any sort needed.


The upgrade fail is due to our validation. Must statement references leaves that are defined further down the container and the must statement sees them as “not set”.
The reason i’m mentioning callbacks is because I think that the cases I mentioned (if they are feasible) are not very well elaborated in the User Guide (still a huge fan of User Guide). I wanted to know if they are wrong without having to implement a test case.