blob: 72185f832d8c2831e58894e93a7ba46820cca507 [file] [log] [blame]
Peter K. Lee2bade4d2016-07-14 16:19:56 -07001module cord-subscriber {
2 namespace "urn:cord:subscriber";
3 prefix cord-sub;
4 yang-version 1.1;
5
6 organization
7 "Open Networking Lab (CORD) / Corenova Technologies";
8
9 contact
10 "Larry Peterson <llp@onlab.us>
11 Peter K. Lee <peter@corenova.com>";
12
13 import xos-core { prefix xos; }
14 import cord-device { prefix dev; }
15 import ietf-yang-types { prefix yang; }
16 import yang-node-link { prefix node; }
17
18 revision 2016-07-14 {
19 description "Initial revision.";
20 }
21
22 identity cord-subscriber { base xos:subscriber; }
23
24 grouping subscriber {
25 uses xos:subscriber {
26 refine kind { default cord-subscriber; }
27 }
28 leaf status {
29 type enumeration {
30 enum "enabled" {
31 description "Enabled";
32 value 1;
33 }
34 enum "suspended" {
35 description "Suspended";
36 }
37 enum "delinquent" {
38 description "Delinquent";
39 }
40 enum "violation" {
41 description "Copyright Violation";
42 }
43 }
44 default enabled;
45 }
46 leaf demo { type boolean; default false; }
47 leaf uplink-speed {
48 type dev:bandwidth;
49 default 1000000000;
50 }
51 leaf downlink-speed {
52 type dev:bandwidth;
53 default 1000000000;
54 }
55
56 container services {
57 description
58 "Contains various services available to the subscriber";
59
60 container cdn {
61 leaf enabled { type boolean; default false; }
62 }
63 container firewall {
64 leaf enabled { type boolean; default false; }
65 leaf-list rules {
66 // should qualify further
67 type string;
68 }
69 }
70 container url-filter {
71 leaf enabled { type boolean; default false; }
72 leaf level {
73 type enumeration {
74 enum "PG";
75 // other types of level...
76 }
77 }
78 leaf-list rules {
79 // should qualify further
80 type string;
81 }
82 }
83 container uverse {
84 leaf enabled { type boolean; default false; }
85 }
86 }
87
88 list devices {
89 uses dev:device;
90 key 'mac';
91
92 action create {
93 input {
94 leaf mac {
95 type yang:mac-address;
96 mandatory true;
97 }
98 // other acceptable attributes that can be used during create
99 }
100 }
101 action update {
102 input {
103 leaf mac {
104 type yang:mac-address;
105 //must "../.[mac = current()]";
106 mandatory true;
107 }
108 // other acceptable attributes for updating
109 }
110 }
111 action delete {
112 input {
113 leaf mac {
114 type yang:mac-address;
115 //must "../.[mac = current()]";
116 mandatory true;
117 }
118 // other acceptable attributes for updating
119 }
120 }
121 }
122 action save {
123 description "when invoked, saves the model to a safe place";
124 }
125 }
126
127 grouping subscriber-controller {
128 uses subscriber;
129
130 container features {
131 node:link cdn {
132 path "../../services/cdn/enabled";
133 }
134 node:link uplink-speed {
135 path "../../uplink-speed";
136 }
137 node:link downlink-speed {
138 path "../../downlink-speed";
139 }
140 node:link uverse {
141 path "../../services/uverse/enabled";
142 }
143 node:link status {
144 path "../../status";
145 }
146 action update {
147 description "when invoked, updates the features container (PUT)";
148 }
149 }
150
151 container identity {
152 node:link account-num {
153 path "../../service-specific-id";
154 }
155 node:link name {
156 path "../../name";
157 }
158 action update {
159 description "when invoked, updates the identity container (PUT)";
160 }
161 }
162
163 container related {
164 // placeholder where other services can augment for their info
165 }
166
167 action create;
168 action delete;
169 }
170
171 // primary configuration tree for this module
172 list subscriber {
173 uses subscriber-controller;
174 key 'id';
175
176 description
177 "Authorative list of all subscriber instances";
178
179 leaf humanReadableName {
180 config false;
181 type string {
182 pattern '^cordSubscriber-\w+$';
183 }
184 }
185 }
186
187 // here we augment the /api/tenant/cord API configuration tree in 'xos' module
188 augment "/xos:api/xos:tenant/xos:cord" {
189 node:link subscriber { path "/subscriber"; }
190 }
191
192}