blob: ec37eb3e53cceed30e05b2b447810173135b14a2 [file] [log] [blame]
Peter K. Lee2bade4d2016-07-14 16:19:56 -07001module cord-subscriber {
Peter K. Lee55395802016-07-15 18:25:40 -07002 namespace "urn:onlab:cord:subscriber";
Peter K. Lee2bade4d2016-07-14 16:19:56 -07003 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 }
Peter K. Lee3145d032016-07-14 17:24:57 -0700122
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700123 action save {
124 description "when invoked, saves the model to a safe place";
125 }
126 }
127
128 grouping subscriber-controller {
129 uses subscriber;
130
131 container features {
132 node:link cdn {
133 path "../../services/cdn/enabled";
134 }
135 node:link uplink-speed {
136 path "../../uplink-speed";
137 }
138 node:link downlink-speed {
139 path "../../downlink-speed";
140 }
141 node:link uverse {
142 path "../../services/uverse/enabled";
143 }
144 node:link status {
145 path "../../status";
146 }
147 action update {
148 description "when invoked, updates the features container (PUT)";
149 }
150 }
151
152 container identity {
153 node:link account-num {
154 path "../../service-specific-id";
155 }
156 node:link name {
157 path "../../name";
158 }
159 action update {
160 description "when invoked, updates the identity container (PUT)";
161 }
162 }
163
164 container related {
165 // placeholder where other services can augment for their info
166 }
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700167 }
168
169 // primary configuration tree for this module
170 list subscriber {
171 uses subscriber-controller;
172 key 'id';
173
174 description
175 "Authorative list of all subscriber instances";
176
177 leaf humanReadableName {
178 config false;
179 type string {
180 pattern '^cordSubscriber-\w+$';
181 }
182 }
Peter K. Lee3145d032016-07-14 17:24:57 -0700183 action create;
184 action delete;
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700185 }
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}