+++ /dev/null
-module types2 {
- yang-version 1;
- namespace "urn:simple.types.data.demo";
- prefix "t2";
-
- organization "opendaylight";
- contact "http://www.opendaylight.org/";
-
- description "This is types-data test description";
-
- revision "2013-02-27" {
- reference " WILL BE DEFINED LATER";
- }
-
- typedef my-base-int32-type {
- type int32 {
- range "2..20";
- }
- }
-
- typedef my-type1 {
- type my-base-int32-type {
- range "11..max";
- }
- units "mile";
- default "11";
- }
-
- typedef my-custom-string {
- type string {
- pattern "[a-k]*";
- length "5..11";
- }
- }
-
- typedef my-string-type {
- type my-custom-string {
- length "5..10";
- }
- }
-
- typedef my-string-type2 {
- type my-string-type {
- pattern "[b-u]*";
- }
- }
-
- typedef my-string-type-ext {
- type my-string-type2 {
- pattern "[e-z]*";
- }
- }
-
- typedef my-int-type {
- type int32 {
- range "10..20";
- }
- }
-
- typedef my-int-type2 {
- type my-int-type {
- range "12..18";
- }
- }
-
- typedef my-int-type-ext {
- type my-int-type2 {
- range "14..16";
- }
- }
-
- typedef my-decimal-type {
- type decimal64 {
- fraction-digits 6;
- }
- }
-
- typedef my-decimal-type-ext {
- type decimal64 {
- fraction-digits 5;
- }
- }
-
- typedef my-union {
- type union {
- type int16 {
- range "1..100";
- }
- type int32;
- }
- }
-
- typedef my-union-ext {
- type my-union;
- }
-
- typedef nested-union1 {
- type nested-union2;
- }
-
- typedef nested-union2 {
- type union {
- type my-union-ext;
- type string;
- }
- }
-
- leaf if-name {
- type leafref {
- path "/interface/name";
- }
- }
-
- leaf name {
- type string;
- }
-
- leaf nested-type-leaf {
- type my-type1;
- }
-
- extension c-define {
- description
- "Takes as argument a name string.
- Makes the code generator use the given name in the
- #define.";
- argument "name" {
- yin-element "true";
- }
- }
-
- container system {
- leaf user {
- type string;
- }
- }
-
- grouping target {
- leaf address {
- type string;
- description "Target IP address";
- }
- container port {
- description "Target port container";
- }
- }
-
- container peer {
- container destination {
- uses target {
- refine address {
- default "1.2.3.4";
- }
- refine port {
- description "new port description updated by refine";
- }
- }
- }
- }
-
- container interfaces {
- list ifEntry {
- key "ifIndex";
-
- leaf ifIndex {
- type uint32;
- units minutes;
- }
-
- leaf ifMtu {
- type int32;
- }
- }
- }
-
-}