blob: 12cd65dfcbbadf7db935bd9ec4fb01fc6c6885dc [file] [log] [blame]
Peter K. Lee2bade4d2016-07-14 16:19:56 -07001module xos-core {
Peter K. Lee55395802016-07-15 18:25:40 -07002 namespace "urn:onlab:xos:core";
Peter K. Lee2bade4d2016-07-14 16:19:56 -07003 prefix xos;
4 yang-version 1.1;
5
6 organization
7 "Open Networking Lab (XOS) / 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 a collection of core models for XOS.
15
16 Copyright (c) 2016 ON.LAB and the persons identified as authors of
17 the code. All rights reserved.
18
19 Redistribution and use in source and binary forms, with or without
20 modification, is permitted pursuant to, and subject to the license
21 terms of the Apache License, Version 2.0 which accompanies this
22 distribution, and is available at
23 (http://www.apache.org/licenses/LICENSE-2.0).";
24
25 revision 2016-07-14 {
26 description "Initial revision.";
27 }
28
Peter K. Lee2bade4d2016-07-14 16:19:56 -070029 import ietf-yang-types { prefix yang; }
Peter K. Lee55395802016-07-15 18:25:40 -070030 import ietf-inet-types { prefix inet; }
Peter K. Lee2bade4d2016-07-14 16:19:56 -070031
Peter K. Leef4d38d32016-07-23 02:47:38 -070032 feature synchronizer {
33 description
34 "Enables configuration synchronization to the distributed store.";
Peter K. Lee2bade4d2016-07-14 16:19:56 -070035 }
36
37 identity kind;
38 identity generic { base kind; }
39 identity subscriber { base kind; }
40
41 typedef unique-identifier {
42 description "defines valid formats for external reference id";
43 type union {
Peter K. Lee4302f472016-07-28 03:51:39 -070044 type uint32 { range 1..max; }
Peter K. Lee2bade4d2016-07-14 16:19:56 -070045 type yang:uuid;
46 type inet:uri;
Peter K. Lee2bade4d2016-07-14 16:19:56 -070047 }
48 }
49
Peter K. Leecb2eb922016-09-01 18:02:31 -070050 grouping service-attribute {
51 leaf name { type string { length 0..128; } }
52 leaf value { type string; }
53 // don't need pointer back to service
54 }
55
56 grouping xos-base {
Peter K. Lee2bade4d2016-07-14 16:19:56 -070057 leaf id {
58 type unique-identifier;
Peter K. Lee2bade4d2016-07-14 16:19:56 -070059 mandatory true;
60 }
61 leaf kind {
62 type identityref {
63 base kind;
64 }
65 default generic;
66 }
67 leaf name {
68 type string {
69 length 0..255;
70 }
Peter K. Lee2bade4d2016-07-14 16:19:56 -070071 }
Peter K. Leecb2eb922016-09-01 18:02:31 -070072 // NOTE: this used to be service-specific-attribute
73 //leaf service-specific-attribute { type string; }
74 list attribute { uses service-attribute; }
75 // TODO: service-specific-id should be one of the attributes above?
Peter K. Lee2bade4d2016-07-14 16:19:56 -070076 leaf service-specific-id {
77 type unique-identifier;
78 mandatory true;
79 }
Peter K. Leecb2eb922016-09-01 18:02:31 -070080 }
81
82 grouping tenant-root {
83 uses xos-base {
84 refine 'name' {
85 description "Specify name of the TenantRoot";
86 }
87 }
88 description
89 "A Tenant Root is one of the things that can sit at the root of a chain
90 of tenancy. This object represents a node.";
Peter K. Lee2bade4d2016-07-14 16:19:56 -070091
Peter K. Leeaf777da2016-08-17 04:33:00 -070092 list subscribed-tenant {
Peter K. Lee2bade4d2016-07-14 16:19:56 -070093 config false;
94 // not exactly clear how this is populated
95 }
Peter K. Lee2bade4d2016-07-14 16:19:56 -070096 }
97
98 grouping subscriber {
99 uses tenant-root {
100 refine kind { default subscriber; }
101 }
102 // seems we should have interesting attributes specific to subscriber?
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700103 }
Peter K. Leecb2eb922016-09-01 18:02:31 -0700104
105 grouping provider {
106 uses tenant-root {
107 refine kind { default provider; }
108 }
109 // seems we should have interesting attributes specific to provider?
110 }
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700111
Peter K. Leecb2eb922016-09-01 18:02:31 -0700112 grouping service {
113 uses xos-base {
114 refine 'name' {
115 description "Name of the Service";
116 }
117 }
118 leaf description {
119 type string {
120 length 0..254;
121 }
122 description "Description of the Service";
123 }
124 leaf version {
125 type string { length 0..30; }
126 description "Version of Service Definition";
127 }
128
129 leaf enabled { type boolean; default true; }
130 leaf published { type boolean; default true; }
131
132 container external-assets {
133 leaf view { type inet:uri; }
134 leaf icon { type inet:uri; }
135 }
136
137 list keypair {
138 description "collection of public/private key pair(s)";
139 leaf public { type string { length 0..1024; } }
140 leaf private { type string { length 0..1024; } }
141 }
142
143 // TOOD: need to better understand relationship between Service and Slice
144 action scale {
145 description "Adjust scale for slice(s)";
146 }
147
148 // TODO: need to better understand relationship between Service and VTN
149 }
150
151 grouping tenancy {
152 uses xos-base;
153
154 choice provider {
155 description "only one type of provider node is valid.";
156 case service { leaf provider-service { type instance-identifier; } }
157 }
158
159 choice subscriber {
160 description "only one type of subscriber node is valid.";
161 case service { leaf subscriber-service { type instance-identifier; } }
162 case tenant { leaf subscriber-tenant { type instance-identifier; } }
163 case user { leaf subscriber-user { type instance-identifier; } }
164 case root { leaf subscriber-root { type instance-identifier; } }
165 case network { leaf subscriber-network { type instance-identifier; } }
166 }
167
168 leaf connect-method {
169 //when "../kind == 'static-tenant'";
170
171 type enumeration {
172 enum public { description "Public"; }
173 enum private { description "Private"; }
174 enum private-unidirectional { description "Private Uni-directional"; }
175 enum na { description "Not Applicable"; }
176 }
177 default na;
178 }
179
180 // TODO: should be able to deal with TenantWithContainer here
181
182 }
183
Peter K. Leef4d38d32016-07-23 02:47:38 -0700184 /*** main configuration tree for XOS ***/
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700185
186 container api {
Peter K. Leef4d38d32016-07-23 02:47:38 -0700187 description
188 "The primary configuration interaction endpoint";
189
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700190 container service {
Peter K. Leef4d38d32016-07-23 02:47:38 -0700191 description
192 "placeholder endpoint for services to augment";
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700193 }
194 container tenant {
Peter K. Leef4d38d32016-07-23 02:47:38 -0700195 description
196 "placeholder endpoint for tenants to augment";
Peter K. Lee2bade4d2016-07-14 16:19:56 -0700197 }
198 }
199
200}