Clean up API YANG models with the help of pyang
[transportpce.git] / api / src / main / yang / service_path / transportpce-pathDescription@2020-06-29.yang
1 module transportpce-pathDescription {
2   namespace "http://org/transportpce/B-C-interface/pathDescription";
3   prefix transportpce-pathDescription;
4
5   organization
6     "transportPCE";
7   contact
8     "transportPCE committers - ODL";
9   description
10     "YANG definitions of B interface (transportPCE). Adapted from service definition (openroadm)
11      Copyright © 2017 Orange, Inc. and others.  All rights reserved.
12
13      openroadm copyright:
14       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
15       AT&T Intellectual Property.  All other rights reserved.
16
17       Redistribution and use in source and binary forms, with or without modification,
18       are permitted provided that the following conditions are met:
19
20       * Redistributions of source code must retain the above copyright notice, this
21         list of conditions and the following disclaimer.
22       * Redistributions in binary form must reproduce the above copyright notice,
23         this list of conditions and the following disclaimer in the documentation and/or
24         other materials provided with the distribution.
25       * Neither the Members of the Open ROADM MSA Agreement nor the names of its
26         contributors may be used to endorse or promote products derived from this software
27         without specific prior written permission.
28
29       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
30       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
32       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
33       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
34       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
35       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
36       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38       POSSIBILITY OF SUCH DAMAGE";
39
40   revision 2020-06-29 {
41         description
42           "Version 1.6.1. To manage otn services";
43   }
44   revision 2017-10-17 {
45       description
46         "Version 1.6";
47   }
48   revision 2017-04-26 {
49     description
50       "Version 1.5";
51   }
52
53
54   grouping PCE-resource {
55     description
56       "This resource identifier is intended to provide a generic identifer
57        for any resource that can be used without specific knowledge of
58        the resource.";
59     container resource {
60       choice resource {
61         case termination-point {
62           leaf tp-id {
63             type string;
64             //to be clarified with topology model
65           }
66           leaf tp-node-id {
67             type string;
68             //to be clarified with topology model
69           }
70         }
71         case link {
72           leaf link-id {
73             type string;
74             //to be clarified with topology model
75           }
76         }
77         case node {
78           leaf node-id {
79             type string;
80             // to be clarified with topology model
81           }
82         }
83       }
84     }
85   }
86
87   grouping path-description {
88     description
89       "Topology reports the individual hops along the service in the A to Z direction and Z to A directions.  This includes both ports internal to a device and those
90        at its edge that are available for externally connections. It includes both physical and logical ports.
91        Physical ports are ordered with the logical ports that run over them as follows:
92        a.\tOn ingress to a node/card, physical then logical
93        b.\tOn egress to a node/card, logical then physical";
94     container aToZ-direction {
95       leaf aToZ-wavelength-number {
96         type uint32;
97       }
98       leaf trib-port-number {
99         type uint16;
100       }
101       leaf trib-slot-number {
102         type uint16;
103       }
104       leaf rate {
105         type uint32;
106         mandatory true;
107       }
108       leaf modulation-format {
109         type string;
110         // enum ?
111       }
112       list aToZ {
113         key "id";
114         leaf id {
115           type string;
116           description
117             "Unique identifier for this topology component within this service";
118         }
119         uses hop;
120       }
121     }
122     container zToA-direction {
123       leaf zToA-wavelength-number {
124         type uint32;
125       }
126       leaf trib-port-number {
127         type uint16;
128       }
129       leaf trib-slot-number {
130         type uint16;
131       }
132       leaf rate {
133         type uint32;
134         mandatory true;
135       }
136       leaf modulation-format {
137         type string;
138         // enum ?
139       }
140       list zToA {
141         key "id";
142         leaf id {
143           type string;
144           description
145             "Unigue identifier for this topology component within this service";
146         }
147         uses hop;
148       }
149     }
150   }
151
152   grouping hop {
153     uses PCE-resource;
154   }
155 }