Preface
Following a few previous articles, this article shares its own understanding of the Yang model.
Read the first few articles on how to build your environment and how to write apps. one, the source of Yang
As early as 2003, the IETF set up a netconf workgroup to propose an xml-based network configuration Management Protocol, the NETCONF (Network Configuration Protocol), because the protocol's configuration is very powerful, At the same time, both monitoring and fault management, security verification and access control, so the industry has been unanimously recognized, so widely used netconfig to configure the network.
The NETCONF protocol is divided into transport layer, RPC layer, operation layer and content layer. Among them, the content layer is the only not standardized layer, so a new modeling language Yang produced, its goal is to netconf data model, operation modeling, covering the NETCONF protocol of the operating layer and the content layer
second, the basic elements of Yang Module
Module is the basic unit of Yang, is the basic framework for writing Yang files, including the following types of statements:
1, head statement (Yang-version/namespace/prefix)
2, the connection statement (Import/include),
3, Meta information (organization/contract),
4, Revision statements,
5, define the statement (container/leaf/leaf-list/grouping, etc.).
The Yang module has the following layout:
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21-22 |
Module < module-name > {//header Information yang-version statement namespace statement prefix statement//L Inkage Statements Import statements include statements//META Information Organization statement CONTACT Statement DESC Ription Statement Reference statement//Revision History revision statements//module definitions other statements} |
For example:
submodule
Submodule is part of the module definition that is used to support modules.
The Submodule file content is laid out as follows: