Adding nst.yang and nsi.yang to data model.
[osm/IM.git] / models / yang / nst.yang
1 //INFORMATION
2 //organization "CTTC";
3 //contact "Pol Alemany, Ricard Vilalta, Juan Luis de la Cruz";
4 //description "Network Slice components definition";
5
6 // MODULE STRUCTURE
7 module nst {
8   //header information
9   yang-version 1;
10   namespace "urn:ietf:params:xml:ns:yang:nfvo:nst";
11   prefix "nst";
12
13   import nsd-base{
14     prefix "nsd-base";
15   }
16
17   import nsd {
18     prefix "nsd";
19   }
20
21   import instantiation-parameters {
22     prefix "instantiation-parameters";
23   }
24
25   import ietf-inet-types {
26     prefix "inet";
27   }
28
29   //revision history
30   revision 2018-08-20 {
31     description "Initial version";
32   }
33
34   //typedef definitions
35   typedef connection-points {
36     description "";
37     type string;
38   }
39
40   typedef network-slice-type {
41     type enumeration {
42       enum eMBB {
43         description "enhanced Mobile Broadband slice";
44       }
45       enum URLLC {
46         description "Ultra Reliable Low Latency Communications slice";
47       }
48       enum mMTC {
49         description "massive Machine Type Communications slice";
50       }
51     }
52   }
53
54   typedef resource-type {
55     type enumeration {
56       enum delay-critical-GBR {
57         description "delay critical guaranted bit rate";
58       }
59       enum GBR {
60         description "guaranted bit rate";
61       }
62       enum non-GBR {
63         description "NON guaranted bit rate";
64       }
65     }
66   }
67
68   grouping nsvld {
69     description "List of NetSlice Subnet Virtual Link Descriptors.";
70
71     uses nsd-base:vld-common;
72
73     list nsd-connection-point-ref {
74       description
75           "A list of references to connection points.";
76       key "nsd-ref nsd-connection-point-ref";
77
78       leaf nsd-ref {
79         description "Reference to nsd";
80         type leafref {
81           path "/nsd:nsd-catalog/nsd:nsd/nsd:id";
82         }
83       }
84
85       leaf nsd-connection-point-ref {
86         description "A reference to a connection point name";
87         type leafref {
88           path "/nsd:nsd-catalog/nsd:nsd/nsd:connection-point/nsd:name";
89         }
90       }
91
92       leaf ip-address {
93         description "IP address of the connection point";
94         type inet:ip-address;
95       }
96
97     }
98   } // nsvld
99
100   grouping snssai {
101     description "";
102     leaf slice-service-type {
103       description "Network slice service type ";
104       type network-slice-type;
105       mandatory true;
106     }
107     leaf slice-differentiator {
108       description "Network slice differentiator";
109       type string;
110     }
111   } // snssai
112
113   grouping five-qi {
114     leaf id{
115       description "Quality of service identifier";
116       type uint16;
117       mandatory true;
118     }
119     leaf resource-type {
120       description "Quality of service resource type";
121       type resource-type;
122     }
123     leaf priority-level {
124       description "Priority level of the service";
125       type uint16;
126     }
127     leaf packet-delay-budget {
128       description "Packet delay budget in miliseconds (ms)";
129       type uint16;
130     }
131     leaf packet-error-rate {
132       description "Packet error rate (PER) given in powers of ten";
133       type uint16;
134     }
135     leaf default-max-data-burst {
136       description "Maximum data burst given in bytes (B)";
137       type uint16;
138     }
139   }
140
141   grouping netslice-subnet {
142     leaf id {
143       description "Identifier for the netslice-subnet.";
144       mandatory true;
145       type string {
146         length 1..63;
147       }
148     }
149     leaf name {
150       description "netslice-subnet name.";
151       mandatory true;
152       type string;
153     }
154     leaf short-name {
155       description "Short name to appear as label in the UI";
156       mandatory true;
157       type string;
158     }
159     leaf vendor {
160       description "Vendor of the NSD.";
161       mandatory true;
162       type string;
163     }
164     leaf is-shared-nss {
165       description "NSS is shared between NS";
166       mandatory true;
167       type boolean;
168     }
169     leaf description {
170       description "Description of the NSD.";
171       mandatory true;
172       type string;
173     }
174     leaf version {
175       description "Version of the NSD";
176       mandatory true;
177       type string;
178     }
179     leaf nsd-ref {
180       description "Reference to catalog NSD";
181       mandatory true;
182       type leafref{
183           path "/nsd:nsd-catalog/nsd:nsd/nsd:id";
184       }
185     }
186     container instantiation-parameters {
187       uses instantiation-parameters:ns_instantiate;
188     }
189
190   }
191
192   grouping slice-connection-points {
193     description "List for external connection points. Each NS has one or more external connection
194                 points. As the name implies that external connection points are used for connecting
195                 the NS to other NS or to external networks. Each NS exposes these connection points 
196                 to the orchestrator. The orchestrator can construct network service chains by 
197                 connecting the connection points between different NS.";
198
199     uses nsd-base:nsd-connection-point-common;
200
201     choice connection {
202       description "Logical connection of the CP to a NSVLD or to a NSD CP";
203       case netslice-vld-ref {
204         leaf netslice-vld-id-ref {
205           description "ID reference to a NSVLD in the NS";
206           type leafref {
207             path "../../netslice-vld/id";
208           }
209
210         }
211       }
212       case nsd-connection-point-ref {
213         leaf nsd-id-ref {
214           description "A reference to a nsd.";
215           type leafref {
216             path "/nsd:nsd-catalog/nsd:nsd/nsd:id";
217           }
218         }
219         leaf nsd-connection-point-ref {
220           description "";
221           type leafref {
222             path "/nsd:nsd-catalog/nsd:nsd/nsd:connection-point/nsd:name";
223            }
224         }
225       }
226     }
227   }
228
229   grouping rsp {
230
231     uses nsd-base:rsp-common;
232
233     list nsd-connection-point-ref {
234       description
235         "A list of references to connection points.";
236       key "nsd-ref";
237
238       leaf nsd-ref {
239         description "Reference to member-vnf within constituent-vnfds";
240         type leafref {
241           path "/nsd:nsd-catalog/nsd:nsd/nsd:id";
242         }
243       }
244       leaf order {
245         type uint8;
246         description
247           "A number that denotes the order of a NSD in a chain";
248       }
249       leaf nsd-connection-point-ref {    
250         type leafref {
251           path "/nsd:nsd-catalog/nsd:nsd/nsd:connection-point/nsd:name";
252          }
253       }
254     }  
255   }
256
257   grouping classifier {
258     uses nsd-base:classifier-common;
259
260     leaf nsd-ref {
261       type leafref {
262           path "/nsd:nsd-catalog/nsd:nsd/nsd:id";
263       }
264     }
265
266     leaf nsd-connection-point-ref {
267
268       type leafref {
269         path "/nsd:nsd-catalog/nsd:nsd/nsd:connection-point/nsd:name";
270        }
271     }
272   }
273
274   grouping netslicefgd {
275
276     uses nsd-base:fgd-common;
277
278     list rsp {
279       description
280         "List of Rendered Service Paths (RSP).";
281       key "id";
282       uses rsp;
283     } 
284
285     list classifier {
286       description
287           "List of classifier rules.";
288       key "id";
289       uses classifier;
290     } 
291   }
292   grouping network-slice{
293     leaf id {
294       mandatory true;
295       type string;
296     }
297
298     leaf name {
299       type string;
300     }
301
302     container SNSSAI-identifier {
303       uses snssai;
304     }
305     container quality-of-service {
306       uses five-qi;
307     }
308     list netslice-subnet {//list with multiple network service elements
309       key "id";
310       uses netslice-subnet;
311     }
312     list netslice-connection-point {
313       key "name";
314       uses slice-connection-points;
315     }
316     list netslice-vld {
317       key "id";
318       uses nsvld;
319     }
320     list netslicefgd{
321       key "id";
322       uses netslicefgd;
323     }
324   }
325
326   //containers definitions
327   list nst {
328     key "id";
329     uses network-slice;
330   }
331 }