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

Configuration Guide - Network Management and Monitoring

CloudEngine 12800 and 12800E V200R005C10

This document describes the configurations of Network Management and Monitoring, including SNMP, RMON, LLDP, NQA, Service Diagnosis, Mirroring, Packet Capture, sFlow, and NETCONF.
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).
Data Modeling Basics

Data Modeling Basics

Leaf Node

A leaf node contains simple data such as an integer or a character string. It has exactly one value of a particular type and no child nodes.

Take a leaf node named host-name as an example. The name is a character string. YANG example:

leaf host-name {
 type string;
 description "Hostname for this system";
}

NETCONF XML example:

<host-name>my.example.com</host-name>

Leaf-List Node

A leaf-list is a set of leaf nodes with exactly one value of a particular type per leaf.

The following takes a leaf-list node named domain-search as an example. The node is a set of leaf nodes of the character string type. YANG example:

leaf-list domain-search {
 type string;
 description "List of domain names to search";
}

NETCONF XML example (containing three leaf nodes):

<domain-search>high.example.com</domain-search>
<domain-search>low.example.com</domain-search>
<domain-search>everywhere.example.com</domain-search>

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

List Node

A list node defines a sequence of list entries. Each entry is like a structure or a record instance, and is uniquely identified by the values of its key leaf nodes. A list node can define multiple key leaf nodes and may contain any number of child nodes of any type (such as the leaf, list, and container nodes).

Take a list node named user as an example. The list node includes three leaf nodes, whose key value is name. YANG example:

list user {
 key "name";
 leaf name {
  type string;
 }
 leaf full-name {
  type string;
 }
 leaf class {
  type string;
 }
}

NETCONF XML example:

<user>
 <name>glocks</name>
 <full-name>Goldie Locks</full-name>
 <class>intruder</class>
</user>
<user>
 <name>snowey</name>
 <full-name>Snow White</full-name>
 <class>free-loader</class>
</user>
<user>
 <name>rzell</name>
 <full-name>Rapun Zell</full-name>
 <class>tower</class>
</user>

Reusable Node Group (Grouping)

Groups of nodes can be assembled into reusable collections using the "grouping" statement. A grouping defines a set of nodes that are instantiated using the "uses" statement.

YANG example:

grouping target {
 leaf address {
  type inet:ip-address;
  description "Target IP address";
 }
 leaf port {
  type inet:port-number;
  description "Target port number";
 }
}
container peer {
 container destination {
  uses target;
 }
}

NETCONF XML example:

<peer>
 <destination>
  <address>192.168.2.1</address>
  <port>830</port>
 </destination>
</peer>

The grouping can be refined as it is used, allowing certain statements to be overridden. The following example shows how the description is refined:

container connection {
 container source {
  uses target {
   refine "address" {
    description "Source IP address";
   }
   refine "port" {
    description "Source port number";
   }
  }
 }
 container destination {
  uses target {
   refine "address" {
    description "Destination IP address";
   }
   refine "port" {
    description "Destination port number";
   }
  }
 }
}

Choice Node

YANG allows the data model to segregate incompatible nodes into distinct choices using the "choice" and "case" statements. The "choice" statement contains a set of "case" statements that define sets of schema nodes that cannot appear together. Each "case" statement may contain multiple nodes, but each node may only appear in one "case" under a "choice".

When an element from one case is created, all elements from the other cases are implicitly deleted. The device handles the enforcement of the constraint, preventing incompatibilities from existing in the configuration.

The choice and case nodes only appear in the schema tree, not in the data tree or NETCONF messages.

YANG example:

container food {
 choice snack {
  case sports-arena {
   leaf pretzel {
    type empty;
   }
   leaf beer {
    type empty;
   }
  }
  case late-night {
   leaf chocolate {
    type enumeration {
     enum dark;
     enum milk;
     enum first-available;
    }
   }
  }
 }
}

NETCONF XML example (excluding the choice and case nodes):

<food>
 <pretzel/>
 <beer/>
</food>
Translation
Download
Updated: 2019-04-20

Document ID: EDOC1100075344

Views: 30018

Downloads: 29

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