Container Node

A container node is used to group related nodes in a subtree. A container node has only child nodes and no value. A container node may contain any number of child nodes of any type (including the leaf, leaf-list, container, and list nodes).

Containers are classified into existent containers or non-existent containers:
  • Existent container: The existence of a container is meaningful. For configuration data, a container node provides a configuration button and is also a method of organizing relevant configurations.

    Take an existent container node named system as an example. The node contains another container node named services. YANG example:

    container system {
     container services{  
       container ssh{
      presence "Enables SSH";     
        // more leafs, containers and stuff here... 
      }
     }
    }

    NETCONF XML example:

    <system>
     <services>
      <ssh/>
     </services>
    </system>
  • Non-existent container: A container itself is meaningless. It functions as a hierarchy for organizing data nodes and accommodating child nodes. By default, a container is in the format of non-existent container.

    Take a non-existent container node named system as an example. The node contains another container node named login, which contains a leaf node named message. YANG example:

    container system {
     container login {
      leaf message {
       type string;
       description
       "Message given at start of login session";
      }
     }
    }

    NETCONF XML example:

    <system>
     <login>
      <message>Good morning</message>
     </login>
    </system>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >