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

Reminder

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

upgrade

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

binary

Any binary data

bits

Set of bits or flags

boolean

"true" or "false"

decimal64

64-bit signed decimal number

empty

Leaf node without a value

enumeration

Enumerated strings

identityref

Reference to an abstract identity

instance-identifier

Reference to a data tree node

int8

8-bit signed integer

int16

16-bit signed integer

int32

32-bit signed integer

int64

64-bit signed integer

leafref

Reference to a leaf instance

string

Human-readable string

uint8

8-bit unsigned integer

uint16

16-bit unsigned integer

uint32

32-bit unsigned integer

uint64

64-bit unsigned integer

union

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:

<completed>20</completed>

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".

Translation
Download
Updated: 2019-01-04

Document ID: EDOC1100059466

Views: 11708

Downloads: 7

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