Can I have list inside action,whether it is possible

for more details pls see below example

tailf:action ccd {
tailf:info "Change ";
tailf:actionpoint c-point {
tailf:opaque ‘ur’;

                            list  PC {
                            key "Md";
                            leaf Md {
                                    type string;
                                    mandatory true;
                    input {

                            leaf Pad {
                                    description "Users ";
                                    type string;
                                    mandatory true;

                            leaf Npad {
                                    description "Users";
                                    type string;
                                    mandatory true;

                    output {}
         } }

You can’t!
But, can you compile this?

no,i’m unable to compile this YANG.

Good because a list inside of an action is not valid YANG.
You can have lists inside of the input or output if you want.


can we define a callpoint for a list if we have defined it inside an action just like normal list?

No you can’t - what would it mean? The ‘input’ statement defines the parameters to give to an action when invoked, ConfD will pass them to the action callback/executable. How would a callpoint for any of those parameters be interpreted?

Hi per,

as per our requirement i need to generate a command for something like changing the password for a particular user.

users user changepasswd [username] curpasswd **** newpasswd ****

here we want the usernames to be populated with a callpoint.

is it possible to do with actions?. please suggest if there is any alternative.


I’m not really sure what you mean here, but it certainly doesn’t seem to be the case of a list defined inside action ‘input’ - rather it seems to be a leaf in the action input that should have the value of one of the keys in a list. The “natural” way to model such a thing is to have the leaf be type leafref { path "/path/to/list/key"'; }. A leafref in action/rpc input is fully supported only in ConfD-6.5 or later, but it works for CLI completion also in earlier versions. (Whether the list is provided by CDB or by an external data provider via a callpoint doesn’t matter.)

But I also get the impression that the list in question is actually users user, in which case you can’t really have the action be invoked as users user changepasswd without a key after user (at least not unless you want it to be invoked for all users:-). I.e. if the changepasswd action is defined in the users user list, the way to invoke it would be

users user [username] changepasswd curpasswd **** newpasswd ****

where [username] is required to be the key of an existing entry in the list. This “just works”, and seems to me to be a clean solution for your requirement