sonu gupta | 1bb37b8 | 2016-11-11 16:51:18 +0530 | [diff] [blame^] | 1 | module decimal64 { |
| 2 | |
| 3 | yang-version 1; |
| 4 | |
| 5 | namespace "ydt.decimal64"; |
| 6 | |
| 7 | prefix "decimal64"; |
| 8 | |
| 9 | organization "ON-LAB"; |
| 10 | |
| 11 | description "This module defines for decimal64 classifier."; |
| 12 | |
| 13 | revision "2016-05-24" { |
| 14 | description "Initial revision."; |
| 15 | } |
| 16 | leaf negInt { |
| 17 | type decimal64 { |
| 18 | fraction-digits 2; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | leaf negIntWithMaxFraction { |
| 23 | type decimal64 { |
| 24 | fraction-digits 18; |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | leaf negIntWithMinFraction { |
| 29 | type decimal64 { |
| 30 | fraction-digits 1; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | leaf posInt { |
| 35 | type decimal64 { |
| 36 | fraction-digits 2; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | leaf posIntWithMaxFraction { |
| 41 | type decimal64 { |
| 42 | fraction-digits 18; |
| 43 | } |
| 44 | |
| 45 | } |
| 46 | |
| 47 | leaf posIntWithMinFraction { |
| 48 | type decimal64 { |
| 49 | fraction-digits 1; |
| 50 | } |
| 51 | |
| 52 | } |
| 53 | |
| 54 | leaf minIntWithRange { |
| 55 | type decimal64 { |
| 56 | fraction-digits 2; |
| 57 | range "10 .. 100"; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | leaf midIntWithRange { |
| 62 | type decimal64 { |
| 63 | fraction-digits 2; |
| 64 | range "10 .. 100"; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | leaf maxIntWithRange { |
| 69 | type decimal64 { |
| 70 | fraction-digits 2; |
| 71 | range "10 .. 100"; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | list multiRangeValidation { |
| 76 | config false; |
| 77 | leaf decimal { |
| 78 | type decimal64 { |
| 79 | fraction-digits 2; |
| 80 | range "10..40 | 50..100"; |
| 81 | } |
| 82 | } |
| 83 | leaf revDecimal { |
| 84 | type decimal64 { |
| 85 | fraction-digits 2; |
| 86 | range "min .. 3.14 | 10 | 20..max"; |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | } |