forked from corenova/yang-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyang-meta-types.yang
111 lines (107 loc) · 2.29 KB
/
yang-meta-types.yang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
module yang-meta-types {
namespace "urn:corenova:yang:yang-meta-types";
prefix meta;
yang-version 1.1;
import ietf-yang-types { prefix yang; }
import ietf-inet-types { prefix inet; }
import iana-crypt-hash { prefix ianach; }
organization
"Corenova Technologies, Inc.";
contact
"Peter K. Lee <[email protected]>";
description
"This module provides common metadata type definitions";
revision 2016-09-14 {
description
"Initial revision.";
}
/*
* Type Definitions
*/
typedef meta-identifier {
type yang:yang-identifier;
}
typedef title {
type string {
length 1..255;
}
}
typedef description {
type string;
}
typedef person-name {
type string {
length 1..255;
}
}
typedef email-address {
type string {
pattern "[\\-_.a-zA-Z0-9]+@[\\-_.a-zA-Z0-9]+(\\.[\\-_.a-zA-Z0-9]+)*";
}
description
"Valid format of an email address.";
}
typedef person-contact {
type string {
pattern '^["-\w,. ]+\s*(<.+?@.+?>)?\s*(\(.+?\))?$';
}
}
typedef phone-number {
type string {
pattern "\\+?[0-9]+(-[0-9]+)*";
}
description
"Valid format of a phone number.";
}
typedef timezone {
type string;
}
typedef password {
type ianach:crypt-hash;
}
typedef empty-string {
type string {
length 0;
}
}
typedef wildcard {
type string {
pattern '^\*$';
}
}
typedef semantic-version {
type string {
pattern '^\d+\.\d+\.\d+(-.+)?$';
}
}
typedef semantic-version-match {
type union {
type semantic-version;
type string {
pattern '^([><~^]|<=|>=)\s*\d+\.[\dx]+(\.[\dx]+)?$';
}
type string {
pattern '^\d+\.[\dx]+(\.[\dx]+)?$';
}
type string {
pattern '^([><]|<=|>=)\s*\d+\.[\dx]+\.[\dx]+ ([><]|<=|>=)\s*\d+\.?[\dx]*\.?[\dx]*$';
}
// TODO: add support composite ranges with ||
}
}
typedef api-version {
type string {
pattern '^\d+\.\d+$';
}
}
typedef license {
type yang:yang-identifier;
description "TODO: should reference https://spdx.org/licenses for complete enumeration.";
}
typedef file-name {
type string {
length 0..255;
//pattern '^[\\\/\-\w\.]+$'; // might be too restrictive...
}
}
}