Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 1 | module cord-subscriber { |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 2 | |
Peter K. Lee | 5539580 | 2016-07-15 18:25:40 -0700 | [diff] [blame] | 3 | namespace "urn:onlab:cord:subscriber"; |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 4 | prefix csub; |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 5 | 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. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 14 | description |
| 15 | "This module contains CORD Subscriber model representing its |
| 16 | relationship to features, services, and devices. |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 17 | |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 18 | 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. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 27 | revision 2016-07-14 { |
| 28 | description "Initial revision."; |
| 29 | } |
| 30 | |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 31 | 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. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 36 | 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. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 102 | list device { |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 103 | uses dev:device; |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 104 | key "mac"; |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 105 | |
| 106 | action create { |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 107 | input { uses dev:device; } |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 108 | } |
| 109 | action update { |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 110 | input { uses dev:device; } |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 111 | } |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 112 | action delete; |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 113 | } |
| 114 | } |
| 115 | |
| 116 | grouping subscriber-controller { |
| 117 | uses subscriber; |
| 118 | |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 119 | node:view "features identity related"; |
| 120 | |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 121 | container features { |
Peter K. Lee | 4302f47 | 2016-07-28 03:51:39 -0700 | [diff] [blame^] | 122 | 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. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 127 | |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 128 | action update { |
| 129 | description "when invoked, updates the features container (PUT)"; |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | container identity { |
Peter K. Lee | 4302f47 | 2016-07-28 03:51:39 -0700 | [diff] [blame^] | 134 | node:link account-num { path "../service-specific-id"; } |
| 135 | node:link name { path "../name"; } |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 136 | |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 137 | action update { |
| 138 | description "when invoked, updates the identity container (PUT)"; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | container related { |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 143 | config false; |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 144 | description |
| 145 | "placeholder where other services can augment for info they want to |
| 146 | share (READ-ONLY)"; |
Peter K. Lee | cfb1e6f | 2016-07-19 10:01:45 -0700 | [diff] [blame] | 147 | } |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 148 | } |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 149 | } |