alternative way to use boolean container

258 Views Asked by At
container first{       
        container second{
            type boolean;
        }
}

how can i do something like this.(My error:i can't boolean a container/error: unexpected keyword "type") I don't want to use leaf. Is there an alternative ?

1

There are 1 best solutions below

0
On

As per RFC 6020. For storing single data we have to use leaf. Using containers to store boolean data, I don't think would be possible.

As per RFC6020 section 7.5.1, Containers are used to organize the hierarchy of data nodes, and those whose presence in the configuration has an explicit meaning.It means we can't use container to store the data.

If you don't want to use boolean then you can try to use "enum" like this:

 leaf myenum {
     type enumeration {
         enum zero {
              value 0;
         }   
         enum one {
             value 1;
         }
     }
 }

.