'feature' enabling by the server

how do i ‘enable’ a feature in my server based on the below yang? and how those the if-feature mechanism works?

 module syslog {
     ...
     feature local-storage {
         description
             "This feature means the device supports local
              storage (memory, flash or disk) that can be used to
              store syslog messages.";
     }

     container syslog {
         leaf local-storage-limit {
             if-feature local-storage;
             type uint64;
             units "kilobyte";
             config false;
             description
                 "The amount of local storage that can be
                  used to hold syslog messages.";
         }
     }
 }

When you compile the YANG file using the ConfD compiler. From the confdc(1) man page:

   -Ffeatures, --feature features
       Indicates that support for the YANG features should be present in
       the fxs file.  features is a string on the form
       modulename:[feature(,feature)*]

       This option is used to prune the data model by removing all nodes
       that are defined with a "if-feature" that is not listed as feature.

       This option can be given multiple times.

       If this option is not given, nothing is pruned, i.e., it works as
       if all features were explicitly listed.

       If the module uses a feature defined in an imported YANG module, it
       must be given as modulename:feature.

   --no-features
       Indicates that no YANG features from the given module are
       supported.
1 Like