Table of Contents |
---|
Overview
...
- An XML-based equivalent version of YANG is called YIN
- YANG uses a tree to define the hierarchy of data wherein each ‘node’ has a value or/and a set of child nodes
- 4 types of nodes
container nodes
- list nodes
- leaf nodes
- leaf-list nodes
- 4 types of nodes
Basic YANG statements
Sample YANG (stores.yang) | Statements and Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
| module Statement see example from Line 1
see examples from Lines 2-16
typedef Statement see example from Line 12
container Statement see example from Line 18
leaf Statement see example from Line 27
list Statement see example from Line 35
leaf-list Statement see example from Line 41
|
...
Code Block | ||
---|---|---|
| ||
sampleExtension locations: +-- address* [state] +-- state string +-- city? string |
Existing YANG parser in CPS
(Please see https://wiki.onap.org/display/DW/Existing+Yang+Parser)
OpenDayLight Yang tools recognises YANG extensions
Contains interface which has methods to access data of a YANG extension statement
Code Block language java theme Eclipse title ExtensionDefinition package org.opendaylight.yangtools.yang.model.api;
import org.opendaylight.yangtools.yang.model.api.stmt.ExtensionEffectiveStatement;
public interface ExtensionDefinition extends SchemaNode, EffectiveStatementEquivalent<ExtensionEffectiveStatement> {
String getArgument();
boolean isYinElement();
}}
- Implementing Class
- Class
- Implementing Class