No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search


To have a better experience, please upgrade your IE browser.


ME60 V800R010C10SPC500 Feature Description - System Management 01

This is ME60 V800R010C10SPC500 Feature Description - System Management
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
YANG Data Types

YANG Data Types

Configuration and State Data

YANG can model state data and configuration data based on the "config" statement. If a node is tagged with "config false", its subhierarchy is flagged as state data. If a node is tagged with "config true", its subhierarchy is flagged as configuration data. When state data is queried using NETCONF's <get> operation, parent containers, lists, and key leaf nodes are also reported, providing a specific context for the state data.

In the following example, two leaf nodes are defined for each interface, a configured speed and an observed speed. The observed speed is not configurable, so it can be returned with NETCONF's <get> operations, but not with <get-config> operations.

list interface {
 leaf configured-speed {
  key "name";
  config true;

  leaf name {
   type string;
  leaf speed {
   enum 10m;
   enum 100m;
   enum auto;
 leaf observed-speed {
  type unit32
  config false;

Built-in Types

Like many programming languages, YANG has a set of built-in types, but differs in terms of special requirements from the management domain. Table 8-8 summarizes the built-in types.

Table 8-8 Built-in types
Type Name Description


Any binary data


Set of bits or flags


"true" or "false"


64-bit signed decimal number


Leaf node without a value


Enumerated strings


Reference to an abstract identity


Reference to a data tree node


8-bit signed integer


16-bit signed integer


32-bit signed integer


64-bit signed integer


Reference to a leaf instance


Human-readable string


8-bit unsigned integer


16-bit unsigned integer


32-bit unsigned integer


64-bit unsigned integer


Choice of member types

Derived Types

YANG can define derived types from base types using the "typedef" statement. Base types can be built-in types or derived types.

YANG example:

typedef percent {
 type uint8 {
  range "0 .. 100";
 description "Percentage";
leaf completed {
 type percent;

NETCONF XML example:


Extending Data Models

Extending data models (augment)

YANG allows a module to insert additional nodes into data models. This is useful for helping vendors to add vendor-specific parameters to standard data models in an interoperable way.

The "augment" statement defines the location in the data model hierarchy where new nodes are inserted, and the "when" statement defines the conditions when the new nodes are valid.

YANG example:

augment /system/login/user {
 when "class != 'wheel'";
 leaf uid {
  type uint16 {
   range "1000 .. 30000";

This example defines a "uid" node that is valid only when the user's "class" is not "wheel".

Updated: 2019-01-04

Document ID: EDOC1100059466

Views: 11708

Downloads: 7

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Previous Next