Confd dyncfg default value

Hi,
I use confd dyncfg to support CLI session limit configuration.
I have created a model to link to confd confd_dyncfg.yang as below.

The sessionLimits/sessionLimt/maxCliSessions can be deleted. The question is how can I set the maxCliSessions as a given value, for example 16, after executing "no confdConfig sessionLimits sessionLimit cli " on confd CLI?
The intention is to set the dyncfg items to a customized default value after deleting it.

 container sessionLimits {
      presence "";
      container sessionLimit{
        presence "";
        leaf maxCliSessions {
          type dyncfg:limitType;
          tailf:link "/dyncfg:confdConfig/sessionLimits/sessionLimit[context='cli']/maxSessions";
        }
        leaf maxNetconfSessions {
          type dyncfg:limitType;
          tailf:link "/dyncfg:confdConfig/sessionLimits/sessionLimit[context='netconf']/maxSessions";
        }
      }

Thanks.

Hi,

You can add a default value to confd_dyncfg.yang or annotate that yang model if you wish, and then recompile the confd_dyncfg.yang pointing to the new fxs rather than the one that comes with the ConfD distribution.

In your use-case however, since the maxSessions leaf is mandatory, why not just make your leaf mandatory too?

Or, it seems it doesn’t matter. Deleting that leaf will not have any effect anyway

Hi cohult,

Thanks for the reply.

I can make the leaf in my model as mandatory. But as its ancestor is “presence” container, so this leaf can be deleted. The purpose is to set the session limit to a default value, for example 16, after deleting this leaf instance.

As sessionLimit is a list, I cannot add default value for the specific context ‘cli’ or ‘netconf’ maxSessions.

container sessionLimits {
      presence "";
      tailf:info
        "Parameters for limiting concurrent access to ConfD.";
      leaf maxSessions {
        type limitType;
        default unbounded;
        tailf:info
          "Puts a limit to the total number of concurrent sessions to ConfD.";
      }
      list sessionLimit {
        key context;
        tailf:info
          "Parameters for limiting concurrent access for a specific
           context to ConfD. There can be multiple instances of this
           container element, each one specifying parameters for a
           specific context.";
        leaf context {
          type xs:token;
          tailf:info
            "The context is either one of cli, netconf, webui, snmp
             or it can be any other context string defined through
             the use of MAAPI. As an example, if we use MAAPI to
             implement a CORBA interface to ConfD, our MAAPI program
             could send the string 'corba' as context.";
        }
        leaf maxSessions {
          type limitType;
          mandatory true;
          tailf:info
            "Puts a limit to the total number of concurrent sessions to
             ConfD.";
        }
      }

Hi,

You can use a tailf:set-hook that set the confd_dyncfg maxSessions value to your default value when your tailf:link maxCliSessions is deleted or when it’s presence container is deleted

Thanks for the suggestion.

Hi All i have small query.

I need to enable the clear command from the available confd.

How do i can do that…

When i enter in to my router node…
I have some standard command like show and config exit… i need to add/enable
new command “clear” how do i can do that … do i need to enable it in dyncfg.xml or aaa_init.xml
please suggest

Thanks
Ravi K

It’s best to post this question as a new topic.