Add latest MEF NRP yang modules.
[unimgr.git] / nrp-api / src / main / yang / tapi-common.yang
1 module tapi-common {
2     namespace "urn:mef:yang:TapiCommon";
3     prefix tapi-common;
4     organization "Metro Ethernet Forum (MEF)";
5     contact "MEF";
6     description "none";
7     revision 2017-02-27 {
8         description "MEF NRP 1.0.alpha";
9         reference "ONF-TR-527, ONF-TR-512, ONF-TR-531, RFC 6020 and RFC 6087";
10     }
11     /***********************
12     * package object-classes
13     **********************/
14         grouping admin-state-pac {
15             leaf administrative-state {
16                 type administrative-state;
17                 description "none";
18             }
19             leaf operational-state {
20                 type operational-state;
21                 description "none";
22             }
23             leaf lifecycle-state {
24                 type lifecycle-state;
25                 description "none";
26             }
27             description "Provides state attributes that are applicable to an entity that can be administered. Such an entity also has operational and lifecycle aspects.";
28         }
29         grouping global-class {
30             leaf uuid {
31                 type universal-id;
32                 description "UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity.
33                     UUID here uses string representation as defined in RFC 4122.  The canonical representation uses lowercase characters.
34                     Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} 
35                     Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6";
36             }
37             list name {
38                 key 'value-name';
39                 uses name-and-value;
40                 description "List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity.";
41             }
42             list label {
43                 key 'value-name';
44                 uses name-and-value;
45                 description "List of labels.A property of an entity with a value that is not expected to be unique and is allowed to change. A label carries no semantics with respect to the purpose of the entity and has no effect on the entity behavior or state.";
46             }
47             description "The TAPI GlobalComponent serves as the super class for all TAPI entities that can be directly retrieved by their ID. As such, these are first class entities and their ID is expected to be globally unique. ";
48         }
49         grouping layer-protocol {
50             leaf layer-protocol-name {
51                 type layer-protocol-name;
52                 description "Indicate the specific layer-protocol described by the LayerProtocol entity.";
53             }
54             leaf termination-direction {
55                 type termination-direction;
56                 description "The overall directionality of the LP. 
57                     - A BIDIRECTIONAL LP will have some SINK and/or SOURCE flowss.
58                     - A SINK LP can only contain elements with SINK flows or CONTRA_DIRECTION_SOURCE flows
59                     - A SOURCE LP can only contain SOURCE flows or CONTRA_DIRECTION_SINK flows";
60             }
61             leaf termination-state {
62                 type termination-state;
63                 description "Indicates whether the layer is terminated and if so how.";
64             }
65             uses local-class;
66             description "Each transport layer is represented by a LayerProtocol (LP) instance. The LayerProtocol instances it can be used for controlling termination and monitoring functionality. 
67                 It can also be used for controlling the adaptation (i.e. encapsulation and/or multiplexing of client signal), tandem connection monitoring, traffic conditioning and/or shaping functionality at an intermediate point along a connection. 
68                 Where the client – server relationship is fixed 1:1 and immutable, the layers can be encapsulated in a single LTP instance. Where the is a n:1 relationship between client and server, the layers must be split over two separate instances of LTP. ";
69         }
70         grouping lifecycle-state-pac {
71             leaf lifecycle-state {
72                 type lifecycle-state;
73                 description "none";
74             }
75             description "Provides state attributes for an entity that has lifeccycle aspects only.";
76         }
77         grouping local-class {
78             leaf local-id {
79                 type string;
80                 description "none";
81             }
82             list name {
83                 key 'value-name';
84                 uses name-and-value;
85                 description "List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity.";
86             }
87             description "The TAPI GlobalComponent serves as the super class for all TAPI entities that can be directly retrieved by their ID. As such, these are first class entities and their ID is expected to be globally unique. ";
88         }
89         grouping operational-state-pac {
90             leaf operational-state {
91                 type operational-state;
92                 description "none";
93             }
94             leaf lifecycle-state {
95                 type lifecycle-state;
96                 description "none";
97             }
98             description "Provides state attributes that are applicable to an entity that reflects operational aspects. Such an entity is expected to also have lifecycle aspects.";
99         }
100         grouping time-range {
101             leaf end-time {
102                 type date-and-time;
103                 description "none";
104             }
105             leaf start-time {
106                 type date-and-time;
107                 description "none";
108             }
109             description "none";
110         }
111         container context {
112             uses context-attrs;
113             description "none";
114         }
115         grouping context-attrs {
116             list service-interface-point {
117                 key 'uuid';
118                 config false;
119                 min-elements 2;
120                 uses service-interface-point;
121                 description "none";
122             }
123             uses global-class;
124             description "The Network Control Domain (NCD) object class represents the scope of control that a particular SDN controller has with respect to a particular network, (i.e., encompassing a designated set of interconnected (virtual) network elements).";
125         }
126         grouping resource-spec {
127             uses global-class;
128             description "none";
129         }
130         grouping service-spec {
131             uses global-class;
132             description "none";
133         }
134         grouping service-interface-point {
135             list layer-protocol {
136                 key 'local-id';
137                 config false;
138                 min-elements 1;
139                 uses layer-protocol;
140                 description "none";
141             }
142             container state {
143                 config false;
144                 uses lifecycle-state-pac;
145                 description "none";
146             }
147             leaf direction {
148                 type termination-direction;
149                 config false;
150                 description "none";
151             }
152             uses resource-spec;
153             description "The LogicalTerminationPoint (LTP) object class encapsulates the termination and adaptation functions of one or more transport layers. 
154                 The structure of LTP supports all transport protocols including circuit and packet forms.";
155         }
156
157     /***********************
158     * package type-definitions
159     **********************/
160         typedef administrative-state {
161             type enumeration {
162                 enum locked {
163                     description "Users are administratively prohibited from making use of the resource.";
164                 }
165                 enum unlocked {
166                     description "Users are allowed to use the resource";
167                 }
168             }
169             description "The possible values of the administrativeState.";
170         }
171         typedef date-and-time {
172             type string;
173             description "This primitive type defines the date and time according to the following structure:
174                 yyyyMMddhhmmss.s[Z|{+|-}HHMm] where:
175                 yyyy    0000..9999    year
176                 MM    01..12            month
177                 dd        01..31            day
178                 hh        00..23            hour
179                 mm    00..59            minute
180                 ss        00..59            second
181                 s        .0...9            tenth of second (set to .0 if EMS or NE cannot support this granularity)
182                 Z        Z                indicates UTC (rather than local time)
183                 {+|-}    + or -            delta from UTC
184                 HH        00..23            time zone difference in hours
185                 Mm    00..59            time zone difference in minutes.";
186         }
187         typedef directive-value {
188             type enumeration {
189                 enum minimize {
190                     description "none";
191                 }
192                 enum maximize {
193                     description "none";
194                 }
195                 enum allow {
196                     description "none";
197                 }
198                 enum disallow {
199                     description "none";
200                 }
201                 enum dont-care {
202                     description "none";
203                 }
204             }
205             description "none";
206         }
207         typedef forwarding-direction {
208             type enumeration {
209                 enum bidirectional {
210                     description "The Fowarding entity supports both BIDIRECTIONAL flows at all Ports (i.e. all Ports have both an INPUT flow and an OUTPUT flow defined)";
211                 }
212                 enum unidirectional {
213                     description "The Forwarding entity has Ports that are either INPUT or OUTPUT. It has no BIDIRECTIONAL Ports.";
214                 }
215                 enum undefined-or-unknown {
216                     description "Not a normal state. The system is unable to determine the correct value.";
217                 }
218             }
219             description "The directionality of a Forwarding entity.";
220         }
221         typedef layer-protocol-name {
222             type enumeration {
223                 enum och {
224                     description "none";
225                 }
226                 enum odu {
227                     description "none";
228                 }
229                 enum eth {
230                     description "none";
231                 }
232                 enum mpls-tp {
233                     description "none";
234                 }
235             }
236             description "Provides a controlled list of layer protocol names and indicates the naming authority.
237                 Note that it is expected that attributes will be added to this structure to convey the naming authority name, the name of the layer protocol using a human readable string and any particular standard reference.
238                 Layer protocol names include:
239                 -    Layer 1 (L1): OTU, ODU
240                 -    Layer 2 (L2): Carrier Grade Ethernet (ETY, ETH), MPLS-TP (MT)
241                 ";
242         }
243         typedef lifecycle-state {
244             type enumeration {
245                 enum planned {
246                     description "The resource is planned but is not present in the network.";
247                 }
248                 enum potential {
249                     description "The supporting resources are present in the network but are shared with other clients; or require further configuration before they can be used; or both.
250                         o    When a potential resource is configured and allocated to a client it is moved to the “installed” state for that client.
251                         o    If the potential resource has been consumed (e.g. allocated to another client) it is moved to the “planned” state for all other clients.";
252                 }
253                 enum installed {
254                     description "The resource is present in the network and is capable of providing the service expected.";
255                 }
256                 enum pending-removal {
257                     description "The resource has been marked for removal";
258                 }
259             }
260             description "The possible values of the lifecycleState.";
261         }
262         grouping name-and-value {
263             leaf value-name {
264                 type string;
265                 description "The name of the value. The value need not have a name.";
266             }
267             leaf value {
268                 type string;
269                 description "The value";
270             }
271             description "A scoped name-value pair";
272         }
273         typedef operational-state {
274             type enumeration {
275                 enum disabled {
276                     description "The resource is unable to meet the SLA of the user of the resource. If no (explicit) SLA is defined the resource is disabled if it is totally inoperable and unable to provide service to the user.";
277                 }
278                 enum enabled {
279                     description "The resource is partially or fully operable and available for use";
280                 }
281             }
282             description "The possible values of the operationalState.";
283         }
284         typedef port-direction {
285             type enumeration {
286                 enum bidirectional {
287                     description "The Port has both an INPUT flow and an OUTPUT flow defined.";
288                 }
289                 enum input {
290                     description "The Port only has definition for a flow into the Forwarding entity (i.e. an ingress flow).";
291                 }
292                 enum output {
293                     description "The Port only has definition for a flow out of the Forwarding entity (i.e. an egress flow).";
294                 }
295                 enum unidentified-or-unknown {
296                     description "Not a normal state. The system is unable to determine the correct value.";
297                 }
298             }
299             description "The orientation of flow at the Port of a Forwarding entity";
300         }
301         typedef port-role {
302             type enumeration {
303                 enum symmetric {
304                     description "none";
305                 }
306                 enum root {
307                     description "none";
308                 }
309                 enum leaf {
310                     description "none";
311                 }
312                 enum unknown {
313                     description "none";
314                 }
315             }
316             description "The role of an end in the context of the function of the forwarding entity that it bounds";
317         }
318         typedef termination-direction {
319             type enumeration {
320                 enum bidirectional {
321                     description "A Termination with both SINK and SOURCE flows.";
322                 }
323                 enum sink {
324                     description "The flow is up the layer stack from the server side to the client side. 
325                         Considering an example of a Termination function within the termination entity, a SINK flow:
326                         - will arrive at at the base of the termination function (the server side) where it is essentially at an INPUT to the termination component
327                         - then will be decoded and deconstructed 
328                         - then relevant parts of the flow will be sent out of the termination function (the client side) where it is essentially at an OUTPUT from the termination component
329                         A SINK termination is one that only supports a SINK flow.
330                         A SINK termiation can be bound to an OUTPUT Port of a Forwarding entity";
331                 }
332                 enum source {
333                     description "The flow is down the layer stack from the server side to the client side. 
334                         Considering an example of a Termination function within the termination entity, a SOURCE flow:
335                         - will arrive at at the top of the termination function (the client side) where it is essentially at an INPUT to the termination component
336                         - then will be assembled with various overheads etc and will be coded 
337                         - then coded form of the assembly of flow will be sent out of the termination function (the server side) where it is essentially at an OUTPUT from the termination component
338                         A SOURCE termination is one that only supports a SOURCE flow.
339                         A SOURCE termiation can be bound to an INPUT Port of a Forwarding entity";
340                 }
341                 enum undefined-or-unknown {
342                     description "Not a normal state. The system is unable to determine the correct value.";
343                 }
344             }
345             description "The directionality of a termination entity";
346         }
347         typedef termination-state {
348             type enumeration {
349                 enum lp-can-never-terminate {
350                     description "A non-flexible case that can never be terminated.";
351                 }
352                 enum lt-not-terminated {
353                     description "A flexible termination that can terminate but is currently not terminated.";
354                 }
355                 enum terminated-server-to-client-flow {
356                     description "A flexible termination that is currently terminated for server to client flow only.";
357                 }
358                 enum terminated-client-to-server-flow {
359                     description "A flexible termination that is currently terminated for client to server flow only.";
360                 }
361                 enum terminated-bidirectional {
362                     description "A flexible termination that is currently terminated in both directions of flow.";
363                 }
364                 enum lt-permenantly-terminated {
365                     description "A non-flexible termination that is always terminated (in both directions of flow for a bidirectional case and in the one direction of flow for both unidirectional cases).";
366                 }
367                 enum termination-state-unknown {
368                     description "There TerminationState cannot be determined.";
369                 }
370             }
371             description "Provides support for the range of behaviours and specific states that an LP can take with respect to termination of the signal.
372                 Indicates to what degree the LayerTermination is terminated.";
373         }
374         typedef universal-id {
375             type string;
376             description "The univeral ID value where the mechanism for generation is defned by some authority not directly referenced in the structure.
377                 UUID here uses string representation as defined in RFC 4122.  The canonical representation uses lowercase characters.
378                 Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} 
379                 Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6";
380         }
381
382     /***********************
383     * package interfaces
384     **********************/
385         rpc get-service-interface-point-details {
386             description "none";
387             input {
388                 leaf sip-id-or-name {
389                     type string;
390                     description "none";
391                 }
392             }
393             output {
394                 container sip {
395                     uses service-interface-point;
396                     description "none";
397                 }
398             }
399         }
400         rpc get-service-interface-point-list {
401             description "none";
402             output {
403                 list sip {
404                     uses service-interface-point;
405                     description "none";
406                 }
407             }
408         }
409
410 }