ConfD User Community

List with specific key enum or string

I’m looking to make a list with a known value set on an enumerated or a specific value set on a string node.
I’m trying to use grouping or choice case or a list with multi key, but it didn’t work.
How can I get a list with auto-completion on value or a specific value?
I want to choose my key between enum or string but only one can be set.

Here is my example :

list mylist
        choice foo-grouping {
          case foo-grouping1 {
		   leaf bar_enum {
                type enum  {
				 enum "both" {
                value 0;
              }
              enum "inbound" {
                value 1;
              }
              enum "outbound" {
                value 2;
              }
            }
            tailf:cli-drop-node-name;
            tailf:cli-optional-in-sequence;
            }
          }
          case foo-grouping2 {
              leaf bar_string {
                type string  {
                }
              }
              tailf:cli-drop-node-name;
              tailf:cli-optional-in-sequence;
            }
          }
        }
	 key "bar_string bar_enum"
}

Your data model cannot work - key lists must be direct children of the list, they cannot be in a choice or a container or anything like that (though they can be defined through a grouping).

Generally, with an enumeration-typed leaf (key or non-key), ConfD CLI is or should be able to tab-complete the enum names. If the automatic tab-completion provided by ConfD is not enough, you can code your own completion hints.