blob: 86fa0e8d3eb260a5946fe5a09563793c3fc98d4a [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. Leef4d38d32016-07-23 02:47:38 -07003 prefix csub;
Peter K. Lee2bade4d2016-07-14 16:19:56 -07004 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
Peter K. Leef4d38d32016-07-23 02:47:38 -070013 description
14 "This module contains CORD Subscriber model representing its
Peter K. Lee0db45ac2016-09-13 00:30:37 -070015 relationship to features and services.
Peter K. Lee2bade4d2016-07-14 16:19:56 -070016
Peter K. Leef4d38d32016-07-23 02:47:38 -070017 Copyright (c) 2016 ON.LAB and the persons identified as authors of
18 the code. All rights reserved.
19
20 Redistribution and use in source and binary forms, with or without
21 modification, is permitted pursuant to, and subject to the license
22 terms of the Apache License, Version 2.0 which accompanies this
23 distribution, and is available at
24 (http://www.apache.org/licenses/LICENSE-2.0).";
25
Peter K. Lee2bade4d2016-07-14 16:19:56 -070026 revision 2016-07-14 {
27 description "Initial revision.";
28 }
29
Peter K. Leef4d38d32016-07-23 02:47:38 -070030 import xos-core { prefix xos; }
31 import cord-device { prefix dev; }
32 import ietf-yang-types { prefix yang; }
33 import corenova-node { prefix node; }
34
Peter K. Lee2bade4d2016-07-14 16:19:56 -070035 identity cord-subscriber { base xos:subscriber; }
36
37 grouping subscriber {
38 uses xos:subscriber {
39 refine kind { default cord-subscriber; }
40 }
41 leaf status {
42 type enumeration {
43 enum "enabled" {
44 description "Enabled";
45 value 1;
46 }
47 enum "suspended" {
48 description "Suspended";
49 }
50 enum "delinquent" {
51 description "Delinquent";
52 }
53 enum "violation" {
54 description "Copyright Violation";
55 }
56 }
57 default enabled;
58 }
59 leaf demo { type boolean; default false; }
60 leaf uplink-speed {
61 type dev:bandwidth;
62 default 1000000000;
63 }
64 leaf downlink-speed {
65 type dev:bandwidth;
66 default 1000000000;
67 }
68
69 container services {
70 description
71 "Contains various services available to the subscriber";
72
73 container cdn {
74 leaf enabled { type boolean; default false; }
75 }
76 container firewall {
77 leaf enabled { type boolean; default false; }
78 leaf-list rules {
79 // should qualify further
80 type string;
81 }
82 }
83 container url-filter {
84 leaf enabled { type boolean; default false; }
85 leaf level {
86 type enumeration {
87 enum "PG";
88 // other types of level...
89 }
90 }
91 leaf-list rules {
92 // should qualify further
93 type string;
94 }
95 }
96 container uverse {
97 leaf enabled { type boolean; default false; }
98 }
99 }
100
Peter K. Leef4d38d32016-07-23 02:47:38 -0700101 list device {
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700102 uses dev:device;
Peter K. Leef4d38d32016-07-23 02:47:38 -0700103 key "mac";
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700104
105 action create {
Peter K. Leef4d38d32016-07-23 02:47:38 -0700106 input { uses dev:device; }
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700107 }
108 action update {
Peter K. Leef4d38d32016-07-23 02:47:38 -0700109 input { uses dev:device; }
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700110 }
Peter K. Leef4d38d32016-07-23 02:47:38 -0700111 action delete;
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700112 }
113 }
114
115 grouping subscriber-controller {
116 uses subscriber;
117
Peter K. Leef4d38d32016-07-23 02:47:38 -0700118 node:view "features identity related";
119
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700120 container features {
Peter K. Lee4302f472016-07-28 03:51:39 -0700121 node:link cdn { path "../services/cdn/enabled"; }
122 node:link uplink-speed { path "../uplink-speed"; }
123 node:link downlink-speed { path "../downlink-speed"; }
124 node:link uverse { path "../services/uverse/enabled"; }
125 node:link status { path "../status"; }
Peter K. Leef4d38d32016-07-23 02:47:38 -0700126
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700127 action update {
128 description "when invoked, updates the features container (PUT)";
129 }
130 }
131
132 container identity {
Peter K. Lee4302f472016-07-28 03:51:39 -0700133 node:link account-num { path "../service-specific-id"; }
134 node:link name { path "../name"; }
Peter K. Leef4d38d32016-07-23 02:47:38 -0700135
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700136 action update {
137 description "when invoked, updates the identity container (PUT)";
138 }
139 }
140
141 container related {
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700142 config false;
Peter K. Leef4d38d32016-07-23 02:47:38 -0700143 description
144 "placeholder where other services can augment for info they want to
145 share (READ-ONLY)";
Peter K. Leecfb1e6f2016-07-19 10:01:45 -0700146 }
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700147 }
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700148}