blob: 40ce8a6a380d0fb749884dfa32fd18081ce8fa05 [file] [log] [blame]
Khen Nursimuluf8abbc92016-11-04 19:56:45 -04001module xos-controller {
2 namespace "urn:ietf:params:xml:ns:yang:xos-controller";
3 prefix xos;
4 yang-version 1.1;
5
6 import ietf-yang-types { prefix yang; }
7 import ietf-inet-types { prefix inet; }
8 import iana-crypt-hash { prefix ianach; }
9 import yang-meta-types { prefix meta; }
10 import xos-types { prefix xtype; }
11
12 organization
13 "Open Networking Lab / Corenova Technologies";
14
15 contact
16 "Larry Peterson <llp@onlab.us>
17 Peter K. Lee <peter@corenova.com>";
18
19 description
20 "This module contains a collection of core models for XOS. The core
21 models represent primary first-order entities such as Tenant,
22 Subscriber, Provider, and Service.
23
24 Copyright (c) 2016 ON.LAB and the persons identified as authors of
25 the code. All rights reserved.
26
27 Redistribution and use in source and binary forms, with or without
28 modification, is permitted pursuant to, and subject to the license
29 terms of the Apache License, Version 2.0 which accompanies this
30 distribution, and is available at
31 (http://www.apache.org/licenses/LICENSE-2.0).";
32
33 revision 2016-07-14 {
34 description "Initial revision.";
35 }
36
37 identity xos-tenant {
38 description "Describes the type of tenant within XOS";
39 }
40 identity xos-subscriber {
41 base xos-tenant;
42 }
43 identity xos-provider {
44 base xos-tenant;
45 }
46 identity xos-service {
47 base xos-provider;
48 }
49
50 feature synchronizer {
51 description
52 "Enables configuration synchronization to the distributed store.";
53 }
54 /*
55 * Groupings
56 */
57 grouping record {
58 description "Synchronizer-specific properties for model entities";
59
60 leaf created { type yang:date-and-time; }
61 leaf updated { type yang:date-and-time; }
62 leaf enacted { type yang:date-and-time; }
63 leaf policed { type yang:date-and-time; }
64
65 leaf writable { type boolean; default true; }
66 leaf locked { type boolean; default false; }
67 leaf deleted { type boolean; default false; }
68
69 leaf dirty {
70 config false;
71 type boolean;
72 default false;
73 }
74
75 container sync {
76 anydata register {
77 description "scratchpad used by the Observer";
78 }
79 leaf progress {
80 type enumeration {
81 enum provisioning {
82 value 0;
83 description "Provisioning in progress";
84 }
85 }
86 }
87 leaf disabled { type boolean; default false; }
88 leaf enforced { type boolean; default true; }
89
90 list policy {
91 // TODO: how are policy defined/enforced?
92 }
93 }
94 action diff {
95 description "retrieve diff of model state if dirty";
96 }
97 action save {
98 description "trigger save into data store via synchronizer";
99 }
100 }
101 grouping credentials-list {
102 list credential {
103 key token;
104 leaf token {
105 type string;
106 }
107 leaf password {
108 type meta:password;
109 }
110 leaf user {
111 type xtype:unique-identifier;
112 }
113 leaf role {
114 type xtype:access-role;
115 }
116 }
117 }
118 grouping parameter {
119 leaf name { type yang:yang-identifier; }
120 leaf value { type string; }
121 leaf content-type { type string; }
122 leaf object-id { type uint32; }
123 }
124 grouping tenant {
125 leaf id {
126 type xtype:unique-identifier;
127 mandatory true;
128 }
129 leaf name { type string { length 0..255; } }
130 leaf kind {
131 config false;
132 type identityref {
133 base xos-tenant;
134 }
135 }
136 leaf description { type meta:description; }
137 leaf enabled { type boolean; default true; }
138 container record {
139 if-feature synchronizer;
140 uses xos:record;
141 }
142 }
143 grouping subscriber {
144 uses xos:tenant {
145 refine kind { default xos-subscriber; }
146 }
147 leaf connectivity {
148 type enumeration {
149 enum public { description "Public"; }
150 enum private { description "Private"; }
151 enum private-unidirectional { description "Private Uni-directional"; }
152 enum na { description "Not Applicable"; }
153 }
154 default na;
155 }
156 }
157 grouping provider {
158 uses xos:tenant {
159 refine kind { default xos-provider; }
160 }
161 uses xos:credentials-list;
162 }
163 grouping service {
164 uses xos:provider {
165 refine 'name' {
166 description "Name of the Service";
167 }
168 }
169 leaf view-url {
170 type inet:uri;
171 }
172 leaf icon-url {
173 type inet:uri;
174 }
175 leaf published {
176 type boolean;
177 default true;
178 }
179 list keypair {
180 description "collection of public/private key pair(s)";
181 // should be a specific typedef for storing this content
182 leaf public { type string { length 0..1024; } }
183 leaf private { type string { length 0..1024; } }
184 }
185 list attribute {
186 key name;
187 leaf name { type string { length 0..128; } }
188 leaf value { type string; }
189 status deprecated;
190 reference "XOS: service-specific-attribute";
191 description "backwards-compatible attribute association";
192 }
193 leaf service-specific-id {
194 type xtype:unique-identifier;
195 status deprecated;
196 }
197 list subscriber {
198 description
199 "Each entry represents a subscriber of the service. Each unique service
200 provider should augment this block with service specific
201 attributes.";
202 key id;
203 uses xos:subscriber;
204 notification subscriber-added;
205 notification subscriber-deleted;
206 }
207 // TODO: need to better understand relationship between Service and VTN
208 }
209 /*
210 * Configuration data nodes (main configuration tree for XOS)
211 */
212 container core {
213 description
214 "Primary endpoint for additional core entities to augment";
215 uses xos:provider;
216 }
217 container service {
218 description
219 "Primary endpoint for services to augment";
220 }
221 container tenant {
222 description
223 "Primary endpoint for tenants to augment";
224 }
225}