blob: 469cb841f01392fc9729f3f1f29f318fc6dfcc0e [file] [log] [blame]
Khen Nursimuluf8abbc92016-11-04 19:56:45 -04001module xos-topology {
2 namespace "urn:ietf:params:xml:ns:yang:xos-topology";
3 prefix xtop;
4 yang-version 1.1;
5
6 import ietf-yang-types { prefix yang; }
7 import ietf-inet-types { prefix inet; }
8 import yang-meta-types { prefix meta; }
9 import xos-controller { prefix xos; }
10 import xos-types { prefix xtype; }
11
12 organization
13 "Open Networking Lab (XOS) / 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 Topology models for XOS.
21
22 Copyright (c) 2016 ON.LAB and the persons identified as authors of
23 the code. All rights reserved.
24
25 Redistribution and use in source and binary forms, with or without
26 modification, is permitted pursuant to, and subject to the license
27 terms of the Apache License, Version 2.0 which accompanies this
28 distribution, and is available at
29 (http://www.apache.org/licenses/LICENSE-2.0).";
30
31 revision 2016-09-13 {
32 description "Initial revision.";
33 }
34
35 grouping deployment {
36 uses xos:provider {
37 refine "name" { description "Name of the deployment"; }
38 }
39 leaf-list sites {
40 config false;
41 type leafref {
42 path "/xos:core/site/id";
43 }
44 }
45 leaf-list templates {
46 type leafref {
47 path "/xos:core/template/id";
48 }
49 }
50 }
51 grouping site {
52 uses xos:provider {
53 refine "name" { description "Name of the site"; }
54 }
55 leaf site-url {
56 description "A URL describing the purpose of this site";
57 type inet:uri;
58 }
59 container location {
60 leaf geoposition {
61 type string; // what is this data format?
62 }
63 leaf longitude {
64 type decimal64;
65 }
66 leaf latitude {
67 type decimal64;
68 }
69 }
70 leaf is-public {
71 type boolean;
72 }
73 leaf login-base {
74 type string;
75 }
76 leaf deployment {
77 type leafref {
78 path "/xos:core/deployment/id";
79 }
80 }
81 leaf-list nodes {
82 config false;
83 type leafref {
84 path "/xos:core/node/id";
85 }
86 }
87 leaf-list users {
88 config false;
89 type leafref {
90 path "/xos:core/user/id";
91 }
92 }
93 leaf hosts-nodes {
94 config false;
95 type boolean;
96 }
97 leaf hosts-users {
98 config false;
99 type boolean;
100 }
101 container synchronizer {
102 if-feature xos:synchronizer;
103 leaf availability-zone {
104 type string;
105 }
106 }
107 }
108 grouping node {
109 uses xos:tenant;
110 leaf site {
111 type leafref {
112 path "/xos:core/site/id";
113 }
114 }
115 leaf deployment {
116 config false;
117 type leafref {
118 path "/xos:core/deployment/id";
119 }
120 }
121 }
122 grouping user {
123 uses xos:tenant {
124 refine 'name' {
125 config false;
126 description "Name of the user";
127 }
128 }
129 leaf firstname {
130 type meta:person-name;
131 }
132 leaf lastname {
133 type meta:person-name;
134 }
135 leaf email {
136 type meta:email-address;
137 }
138 leaf phone {
139 type meta:phone-number;
140 }
141 leaf timezone {
142 type meta:timezone;
143 }
144 leaf site {
145 type leafref {
146 path "/xos:core/site/id";
147 }
148 }
149 container credential {
150 leaf username {
151 type yang:yang-identifier;
152 }
153 leaf password {
154 type meta:password;
155 }
156 leaf role {
157 type xtype:access-role;
158 }
159 leaf public-key {
160 type string;
161 }
162 leaf login-page {
163 type inet:uri;
164 }
165 leaf last-login {
166 config false;
167 type yang:date-and-time;
168 }
169 }
170 }
171 grouping network-template {
172 uses xos:tenant;
173 leaf guaranteed-bandwidth {
174 type uint32;
175 }
176 leaf visibility {
177 type string;
178 }
179 leaf translation {
180 type string;
181 }
182 leaf access {
183 type string;
184 }
185 leaf shared-network-name {
186 type string;
187 }
188 leaf shared-network-id {
189 type string;
190 }
191 leaf topology-kind {
192 type string;
193 }
194 leaf controller-kind {
195 type string;
196 }
197 }
198
199 /*
200 * Augmentations to XOS core
201 */
202 augment "/xos:core" {
203 list template {
204 key id;
205 uses xtop:network-template;
206 }
207 list deployment {
208 key id;
209 uses xtop:deployment;
210 }
211 list site {
212 key id;
213 uses xtop:site;
214 }
215 list node {
216 key id;
217 uses xtop:node;
218 }
219 list user {
220 key id;
221 uses xtop:user;
222 }
223 }
224}