Placeholder for YANG used in Restconfapicallnode
[sdnc/oam.git] / platform-logic / restconfapi-yang / src / main / yang / ietf-eth-tran-service@2018-03-01.yang
1 module ietf-eth-tran-service {
2
3   namespace "urn:ietf:params:xml:ns:yang:ietf-eth-tran-service";
4
5   prefix "ethtsvc";
6
7         import ietf-yang-types {
8                 prefix "yang";
9         }
10
11   import ietf-te-types {
12     prefix "te-types";
13   }
14
15   import ietf-eth-tran-types {
16     prefix "etht-types";
17   }
18
19         organization
20                 "Internet Engineering Task Force (IETF) CCAMP WG";
21   contact
22     "
23       WG List: <mailto:ccamp@ietf.org>
24       ID-draft editor:
25         Haomian Zheng (zhenghaomian@huawei.com);
26         Italo Busi (italo.busi@huawei.com);
27         Aihua Guo (aihuaguo@huawei.com);
28         Yunbin Xu (xuyunbin@ritt.cn);
29         Yang Zhao (zhaoyangyjy@chinamobile.com);
30         Xufeng Liu (Xufeng_Liu@jabil.com);
31         Giuseppe Fioccola (giuseppe.fioccola@telecomitalia.it);
32     ";
33
34   description
35     "This module defines a YANG data model for describing
36      the Ethernet transport services.";
37
38         revision 2018-03-01 {
39                 description
40                         "Initial revision";
41                 reference
42                         "draft-zheng-ccamp-client-signal-yang";
43         }
44
45   /*
46   Groupings
47   */
48
49   grouping vlan-classification {
50     description
51       "A grouping which represents classification on an 802.1Q VLAN tag.";
52
53     leaf tag-type {
54       type etht-types:eth-tag-classify;
55       description
56         "The tag type used for VLAN classification.";
57     }
58     choice individual-bundling-vlan {
59       description
60         "VLAN based classification can be individual
61          or bundling.";
62       case individual-vlan {
63         leaf vlan-value {
64           type etht-types:vlanid;
65           description
66             "VLAN ID value.";
67         }
68       }
69
70       case vlan-bundling {
71         leaf vlan-range {
72           type etht-types:vid-range-type;
73           description
74             "List of VLAN ID values.";
75         }
76       }
77     }
78   }
79
80   grouping vlan-write {
81     description
82       "A grouping which represents push/pop operations
83        of an 802.1Q VLAN tag.";
84
85     leaf tag-type {
86       type etht-types:eth-tag-type;
87       description
88         "The VLAN tag type to push/swap.";
89     }
90     leaf vlan-value {
91       type etht-types:vlanid;
92       description
93         "The VLAN ID value to push/swap.";
94     }
95   }
96
97   grouping vlan-operations {
98     description
99       "A grouping which represents VLAN operations.";
100
101       leaf pop-tags {
102       type uint8 {
103         range "1..2";
104       }
105       description
106         "The number of VLAN tags to pop (or swap if used in
107          conjunction with push-tags)";
108     }
109     container push-tags {
110       description
111         "The VLAN tags to push (or swap if used in
112          conjunction with pop-tags)";
113
114       container outer-tag {
115         presence
116           "Indicates existence of the outermost VLAN tag to
117            push/swap";
118
119         description
120           "The outermost VLAN tag to push/swap.";
121
122         uses vlan-write;
123       }
124       container second-tag {
125         must
126                                         '../outer-tag/tag-type = "s-vlan-tag-type" and ' +
127                                         'tag-type = "c-vlan-tag-type"'
128         {
129
130           error-message
131             "
132               When pushing/swapping two tags, the outermost tag must
133               be specified and of S-VLAN type and the second
134               outermost tag must be of C-VLAN tag type.
135             ";
136           description
137             "
138               For IEEE 802.1Q interoperability, when pushing/swapping
139               two tags, it is required that the outermost tag exists
140               and is an S-VLAN, and the second outermost tag is a
141               C-VLAN.
142             ";
143         }
144
145         presence
146           "Indicates existence of a second outermost VLAN tag to
147            push/swap";
148
149         description
150           "The second outermost VLAN tag to push/swap.";
151
152         uses vlan-write;
153       }
154     }
155   }
156
157   grouping bandwidth-profiles {
158     description
159       "A grouping which represent bandwidth profile configuration.";
160
161     choice direction {
162       description
163         "Whether the bandwidth profiles are symmetrical or
164          asymmetrical";
165       case symmetrical {
166         description
167           "The same bandwidth profile is used to describe the ingress
168           and the egress bandwidth profile.";
169
170         leaf ingress-egress-bandwidth-profile-name {
171           type "string";
172           description
173             "Name of the bandwidth profile.";
174         }
175       }
176       case asymmetrical {
177         description
178           "Ingress and egress bandwidth profiles can be specified.";
179         leaf ingress-bandwidth-profile-name {
180           type "string";
181           description
182             "Name of the bandwidth profile used in
183              the ingress direction.";
184         }
185         leaf egress-bandwidth-profile-name {
186           type "string";
187           description
188             "Name of the bandwidth profile used in
189              the egress direction.";
190         }
191       }
192     }
193   }
194
195   grouping etht-svc-access-parameters {
196     description
197       "ETH transport services access parameters";
198
199     leaf access-node-id {
200       type te-types:te-node-id;
201       description
202         "The identifier of the access node in
203          the ETH transport topology.";
204     }
205     leaf access-ltp-id {
206       type te-types:te-tp-id;
207       description
208         "The TE link termination point identifier, used
209          together with access-node-id to identify the
210          access LTP.";
211     }
212     leaf service-classification-type {
213       type identityref {
214         base etht-types:service-classification-type;
215       }
216       description
217         "Service classification type.";
218     }
219
220     choice service-classification {
221       description
222         "Access classification can be port-based or
223          VLAN based.";
224
225       case port-classification {
226         /* no additional information */
227       }
228
229       case vlan-classification {
230         container outer-tag {
231           presence "The outermost VLAN tag exists";
232           description
233             "Classifies traffic using the outermost VLAN tag.";
234
235           uses vlan-classification;
236         }
237         container second-tag {
238           must
239                                                 '../outer-tag/tag-type = "classify-s-vlan" and ' +
240                                                 'tag-type = "classify-c-vlan"'
241           {
242
243             error-message
244               "
245                 When matching two tags, the outermost tag must be
246                 specified and of S-VLAN type and the second
247                 outermost tag must be of C-VLAN tag type.
248               ";
249             description
250               "
251                 For IEEE 802.1Q interoperability, when matching two
252                 tags, it is required that the outermost tag exists
253                 and is an S-VLAN, and the second outermost tag is a
254                 C-VLAN.
255               ";
256           }
257           presence "The second outermost VLAN tag exists";
258
259           description
260             "Classifies traffic using the second outermost VLAN tag.";
261
262           uses vlan-classification;
263         }
264       }
265     }
266
267 /*
268         Open issue: can we constraints it to be used only with mp services?
269 */
270                 leaf split-horizon-group {
271                         type string;
272                         description "Identify a split horizon group";
273                 }
274
275     uses bandwidth-profiles;
276
277     container vlan-operations {
278         description
279           "include parameters for vlan-operation";
280       choice direction {
281         description
282           "Whether the VLAN operations are symmetrical or
283            asymmetrical";
284         case symmetrical {
285           container symmetrical-operation {
286             uses vlan-operations;
287             description
288               "Symmetrical operations.
289                Expressed in the ingress direction, but
290                the reverse operation is applied to egress traffic";
291           }
292         }
293         case asymmetrical {
294           container asymmetrical-operation {
295             description "Asymmetrical operations";
296             container ingress {
297               uses vlan-operations;
298               description "Ingress operations";
299             }
300             container egress {
301               uses vlan-operations;
302               description "Egress operations";
303             }
304           }
305         }
306       }
307     }
308   }
309
310   grouping etht-svc-tunnel-parameters {
311     description
312       "ETH transport services tunnel parameters";
313
314     leaf tunnel-name {
315       type string;
316       description
317         "TE service tunnel instance name.";
318     }
319     choice svc-multiplexing-tag {
320       description
321         "Service multiplexing is optional and flexible.";
322
323       case other {
324         /*
325          placeholder to support proprietary multiplexing
326          (for further discussion)
327         */
328                         }
329
330       case none {
331         /* no additional information is needed */
332                         }
333
334       case vlan-tag {
335         /*
336           No additional information is needed
337           The C-Tag or S-Tag used for service mulitplexing is defined
338           by the VLAN classification and operations configured in the
339           etht-svc-access-parameters grouping
340         */
341                         }
342
343       case pw {
344         /* to be completed (for further discussion) */
345                         }
346     }
347
348 /*
349         Open issue: can we constraints it to be used only with mp services?
350 */
351                 leaf src-split-horizon-group {
352                         type string;
353                         description "Identify a split horizon group at the Tunnel source TTP";
354                 }
355                 leaf dst-split-horizon-group {
356                         type string;
357                         description "Identify a split horizon group at the Tunnel destination TTP";
358                 }
359   }
360
361   grouping te-topology-identifier {
362                 description
363         "An identifier to uniquely identify the TE topology.";
364     leaf access-provider-id {
365       type te-types:te-global-id;
366       description
367         "An identifier to uniquely identify a provider.";
368     }
369     leaf access-client-id {
370       type te-types:te-global-id;
371       description
372         "An identifier to uniquely identify a client.";
373     }
374     leaf access-topology-id {
375       type te-types:te-topology-id;
376       description
377         "Identifies the topology the
378         service access ports belong to.";
379     }
380   }
381
382         grouping  etht-svc-pm-threshold_config {
383                 description
384                         "Configuraiton parameters for Ethernet service PM thresholds.";
385
386                 leaf sending-rate-high {
387                         type uint64;
388                         description
389                                 "High threshold of packet sending rate in kbps.";
390                 }
391                 leaf sending-rate-low {
392                         type uint64;
393                         description
394                                 "Low threshold of packet sending rate in kbps.";
395                 }
396                 leaf receiving-rate-high {
397                         type uint64;
398                         description
399                                 "High threshold of packet receiving rate in kbps.";
400                 }
401                 leaf receiving-rate-low {
402                         type uint64;
403                         description
404                                 "Low threshold of packet receiving rate in kbps.";
405                 }
406         }
407
408         grouping  etht-svc-pm-stats {
409                 description
410                         "Ethernet service PM statistics.";
411
412                 leaf sending-rate-too-high {
413                         type uint32;
414                         description
415                                 "Counter that indicates the number of times the sending rate is above the high threshold";
416                 }
417                 leaf sending-rate-too-low {
418                         type uint32;
419                         description
420                                 "Counter that indicates the number of times the sending rate is below the low threshold";
421                 }
422                 leaf receiving-rate-too-high {
423                         type uint32;
424                         description
425                                 "Counter that indicates the number of times the receiving rate is above the high threshold";
426                 }
427                 leaf receiving-rate-too-low {
428                         type uint32;
429                         description
430                                 "Counter that indicates the number of times the receiving rate is below the low threshold";
431                 }
432         }
433
434   grouping  etht-svc-instance_config {
435     description
436       "Configuraiton parameters for Ethernet services.";
437
438     leaf etht-svc-name {
439       type string;
440       description
441         "Name of the p2p ETH transport service.";
442     }
443
444                 leaf etht-svc-descr {
445                         type string;
446                         description
447                                 "Description of the ETH transport service.";
448                 }
449
450                 leaf etht-svc-type {
451                         type etht-types:service-type;
452                         description
453                                 "Type of Ethernet service (p2p, mp2mp or rmp).";
454                         /* Add default as p2p */
455                 }
456
457                 uses te-topology-identifier;
458
459     list etht-svc-access-ports {
460       key access-port-id;
461       min-elements "1";
462 /*
463         Open Issue:
464                 Is it possible to limit the max-elements only for p2p services?
465                         max-elements "2";
466 */
467       description
468         "List of the ETH trasport services access port instances.";
469
470       leaf access-port-id {
471         type uint16;
472         description
473           "ID of the service access port instance";
474       }
475         uses etht-svc-access-parameters;
476     }
477     list etht-svc-tunnels {
478       key tunnel-name;
479       description
480         "List of the TE Tunnels supporting the ETH
481         transport service.";
482
483       uses etht-svc-tunnel-parameters;
484     }
485                 container pm-config {
486                         description
487                                 "ETH service performance monitoring";
488
489                         leaf pm-enable {
490                                 type boolean;
491                                 description
492                                         "Boolean value indicating whether PM is enabled.";
493                         }
494                         uses etht-svc-pm-threshold_config;
495                 }
496     leaf admin-status {
497       type identityref {
498         base te-types:tunnel-state-type;
499       }
500       default te-types:tunnel-state-up;
501       description "ETH service administrative state.";
502     }
503         }
504
505   grouping  etht-svc-instance_state {
506     description
507       "State parameters for Ethernet services.";
508
509     leaf operational-state {
510           type identityref {
511         base te-types:tunnel-state-type;
512       }
513       default te-types:tunnel-state-up;
514           description "ETH service operational state.";
515     }
516     leaf provisioning-state {
517       type identityref {
518         base te-types:lsp-state-type;
519       }
520       description "ETH service provisioning state.";
521     }
522                 leaf creation-time {
523                         type yang:date-and-time;
524                         description
525                                 "Time of ETH service creation.";
526                 }
527                 leaf last-updated-time {
528                         type yang:date-and-time;
529                         description
530                                 "Time of ETH service last update.";
531                 }
532                 uses etht-svc-pm-stats;
533   }
534
535   /*
536   Data nodes
537   */
538
539   container etht-svc {
540     description
541       "ETH transport services.";
542
543     container globals {
544       description
545       "ETH profile information.";
546       list etht-svc-bandwidth-profiles {
547         key bandwidth-profile-name;
548         description
549           "List of bandwidth profile templates used by
550            Ethernet services.";
551
552         uses etht-types:etht-bandwidth-profiles;
553       }
554     }
555
556     list etht-svc-instances {
557       key etht-svc-name;
558       description
559         "The list of p2p ETH transport service instances";
560
561       uses etht-svc-instance_config;
562
563       container state {
564         config false;
565         description
566           "Ethernet Service states.";
567
568         uses etht-svc-instance_state;
569       }
570     }
571   }
572 }