blob: 7fa098eef89c7204a6d61ae608ac30087866c7c9 [file] [log] [blame]
Peter K. Lee2bade4d2016-07-14 16:19:56 -07001module cord-subscriber {
Peter K. Leef4d38d32016-07-23 02:47:38 -07002
Peter K. Lee55395802016-07-15 18:25:40 -07003 namespace "urn:onlab:cord:subscriber";
Peter K. Leef4d38d32016-07-23 02:47:38 -07004 prefix csub;
Peter K. Lee2bade4d2016-07-14 16:19:56 -07005 yang-version 1.1;
6
7 organization
8 "Open Networking Lab (CORD) / Corenova Technologies";
9
10 contact
11 "Larry Peterson <llp@onlab.us>
12 Peter K. Lee <peter@corenova.com>";
13
Peter K. Leef4d38d32016-07-23 02:47:38 -070014 description
15 "This module contains CORD Subscriber model representing its
16 relationship to features, services, and devices.
Peter K. Lee2bade4d2016-07-14 16:19:56 -070017
Peter K. Leef4d38d32016-07-23 02:47:38 -070018 Copyright (c) 2016 ON.LAB and the persons identified as authors of
19 the code. All rights reserved.
20
21 Redistribution and use in source and binary forms, with or without
22 modification, is permitted pursuant to, and subject to the license
23 terms of the Apache License, Version 2.0 which accompanies this
24 distribution, and is available at
25 (http://www.apache.org/licenses/LICENSE-2.0).";
26
Peter K. Lee2bade4d2016-07-14 16:19:56 -070027 revision 2016-07-14 {
28 description "Initial revision.";
29 }
30
Peter K. Leef4d38d32016-07-23 02:47:38 -070031 import xos-core { prefix xos; }
32 import cord-device { prefix dev; }
33 import ietf-yang-types { prefix yang; }
34 import corenova-node { prefix node; }
35
Peter K. Lee2bade4d2016-07-14 16:19:56 -070036 identity cord-subscriber { base xos:subscriber; }
37
38 grouping subscriber {
39 uses xos:subscriber {
40 refine kind { default cord-subscriber; }
41 }
42 leaf status {
43 type enumeration {
44 enum "enabled" {
45 description "Enabled";
46 value 1;
47 }
48 enum "suspended" {
49 description "Suspended";
50 }
51 enum "delinquent" {
52 description "Delinquent";
53 }
54 enum "violation" {
55 description "Copyright Violation";
56 }
57 }
58 default enabled;
59 }
60 leaf demo { type boolean; default false; }
61 leaf uplink-speed {
62 type dev:bandwidth;
63 default 1000000000;
64 }
65 leaf downlink-speed {
66 type dev:bandwidth;
67 default 1000000000;
68 }
69
70 container services {
71 description
72 "Contains various services available to the subscriber";
73
74 container cdn {
75 leaf enabled { type boolean; default false; }
76 }
77 container firewall {
78 leaf enabled { type boolean; default false; }
79 leaf-list rules {
80 // should qualify further
81 type string;
82 }
83 }
84 container url-filter {
85 leaf enabled { type boolean; default false; }
86 leaf level {
87 type enumeration {
88 enum "PG";
89 // other types of level...
90 }
91 }
92 leaf-list rules {
93 // should qualify further
94 type string;
95 }
96 }
97 container uverse {
98 leaf enabled { type boolean; default false; }
99 }
100 }
101
Peter K. Leef4d38d32016-07-23 02:47:38 -0700102 list device {
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700103 uses dev:device;
Peter K. Leef4d38d32016-07-23 02:47:38 -0700104 key "mac";
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700105
106 action create {
Peter K. Leef4d38d32016-07-23 02:47:38 -0700107 input { uses dev:device; }
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700108 }
109 action update {
Peter K. Leef4d38d32016-07-23 02:47:38 -0700110 input { uses dev:device; }
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700111 }
Peter K. Leef4d38d32016-07-23 02:47:38 -0700112 action delete;
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700113 }
114 }
115
116 grouping subscriber-controller {
117 uses subscriber;
118
Peter K. Leef4d38d32016-07-23 02:47:38 -0700119 node:view "features identity related";
120
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700121 container features {
Peter K. Lee4302f472016-07-28 03:51:39 -0700122 node:link cdn { path "../services/cdn/enabled"; }
123 node:link uplink-speed { path "../uplink-speed"; }
124 node:link downlink-speed { path "../downlink-speed"; }
125 node:link uverse { path "../services/uverse/enabled"; }
126 node:link status { path "../status"; }
Peter K. Leef4d38d32016-07-23 02:47:38 -0700127
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700128 action update {
129 description "when invoked, updates the features container (PUT)";
130 }
131 }
132
133 container identity {
Peter K. Lee4302f472016-07-28 03:51:39 -0700134 node:link account-num { path "../service-specific-id"; }
135 node:link name { path "../name"; }
Peter K. Leef4d38d32016-07-23 02:47:38 -0700136
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700137 action update {
138 description "when invoked, updates the identity container (PUT)";
139 }
140 }
141
142 container related {
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700143 config false;
Peter K. Leef4d38d32016-07-23 02:47:38 -0700144 description
145 "placeholder where other services can augment for info they want to
146 share (READ-ONLY)";
Peter K. Leecfb1e6f2016-07-19 10:01:45 -0700147 }
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700148 }
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700149}