Issue in configuration

Hi,

I have a config command as follows:

list organisation{
      key name;
      leaf name{
           typedef String;
      }
      list employee{
        key name;
        leaf name {
            type string;
        }
     }
}

The above is a config command, when i render the CLI - and given config the prompt changes as

petsmx-test(config)#

Now I can give the command as

petsmx-test(config)#organisation TEST
petsmx-test(config-organisation-TEST)# 
At this point I expect go give values for employee name directly. 
petsmx-test(config-organisation-TEST)# employee EMPTEST
But it expects me to give the command from the beginning as 
petsmx-test(config-organisation-TEST)# organisation TEST employee EMPTEST

How to make it give command only from the sub level and not include the whole command from first level. Is there any confd.conf settings to be changed for this.

Kindly help.

Hello,

I cannot reproduce your issue. I’m using following data model:

module datamodel {
    namespace "http://tail-f.com/ns/example/datamodel";
    prefix datamodel;

    list organisation{
        key name;
        leaf name{
            type string;
        }
        list employee{
            key name;
            leaf name {
                type string;
            }
        }
    }
}

and in CLI (Cisco style) I have following behavior:

# config
Entering configuration mode terminal
(config)# organisation TEST
(config-organisation-TEST)# employee EMPTEST
(config-employee-EMPTEST)#

Is there some difference in your setup?

Thanks for your reply.
After your reply I did some debugging and found the issue.

I have a callpoint defined. and the callpoint was returning proper values. After fixing that it worked.

I was under the assumption that for config we need not implement the get_next, get_elem,… call backs.
We will only be getting the values as input from user and send it to a backend application which will take care.

Once i implemented the callbacks it works. So are the callbacks mandatory for the config commands as well. Can we do some thing to ignore them or have a kind of default implementation.

Hello,

I believe get_next, get_elem callbacks are not needed for config only. Please can you check if all elements in the path are config only. I.e that you do not mix config and oper elements. If you mix, of course oper elements need callbacks.

that really depends on what kind of callback we’re talking about - if it’s callpoint on configuration part of model - i assume we’re talking either transformation or external database, and get_() callbacks are necessary as well…
(for ConfD to be able to tell if something is being changed compared to existing config or not)

+1. And of course most users/clients will expect to be able to see what is configured, via “show configuration”, <get-config> or whatever. If this really isn’t needed, and it is acceptable for the data provider to get create(), set_elem() etc callbacks for configuration that already exists, it might be possible to register a get_next() that always does confd_data_reply_next_key(tctx, NULL, 0, 0), a get_elem() that always does confd_data_reply_not_found(tctx) and so on. But it would be pretty “weird”.:slight_smile:

Addendum: it would be particularly “weird” for a management application (NMS / OSS / Controller / Orchestrator) that keeps track of the device configuration, and thus expects that whatever it configures actually becomes part of that configuration - not that it just disappears down a black hole…

Hi, As suggested by @josephm I have added a callpoint in the config yang. They are all config only, but with callpoint. So in this case I guess the get_next() and get_elem() are mandatory.

Also the config values will be sent to an external application in our case. So I had used a callpoint.