ONOS-7419 Compare and update TAPI yang currently in ONOS with TAPI 2.0 release

Change-Id: I009d4b9da4eea359a4ce164fd425769f68743c6b
diff --git a/models/tapi/src/main/yang/tapi-common@2017-05-31.yang b/models/tapi/src/main/yang/tapi-common@2017-05-31.yang
index fa7145e..b52896e 100644
--- a/models/tapi/src/main/yang/tapi-common@2017-05-31.yang
+++ b/models/tapi/src/main/yang/tapi-common@2017-05-31.yang
@@ -47,27 +47,6 @@
             }

             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. ";

         }

-        grouping layer-protocol {

-            leaf layer-protocol-name {

-                type layer-protocol-name;

-                description "Indicate the specific layer-protocol described by the LayerProtocol entity.";

-            }

-            leaf termination-direction {

-                type termination-direction;

-                description "The overall directionality of the LP. 

-                    - A BIDIRECTIONAL LP will have some SINK and/or SOURCE flowss.

-                    - A SINK LP can only contain elements with SINK flows or CONTRA_DIRECTION_SOURCE flows

-                    - A SOURCE LP can only contain SOURCE flows or CONTRA_DIRECTION_SINK flows";

-            }

-            leaf termination-state {

-                type termination-state;

-                description "Indicates whether the layer is terminated and if so how.";

-            }

-            uses local-class;

-            description "Each transport layer is represented by a LayerProtocol (LP) instance. The LayerProtocol instances it can be used for controlling termination and monitoring functionality. 

-                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. 

-                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. ";

-        }

         grouping lifecycle-state-pac {

             leaf lifecycle-state {

                 type lifecycle-state;

@@ -125,21 +104,15 @@
             description "none";

         }

         grouping service-interface-point {

-            list layer-protocol {

-                key 'local-id';

+            leaf-list layer-protocol-name {

+                type layer-protocol-name;

+                config false;

                 min-elements 1;

-                uses layer-protocol;

-                description "Usage of layerProtocol [>1]  in the ServiceInterfacePoint should be considered experimental";

-            }

-            container state {

-                uses admin-state-pac;

-                description "none";

-            }

-            container capacity {

-                uses capacity-pac;

-                description "none";

+                description "Usage of layerProtocolName [>1]  in the ServiceInterfacePoint should be considered experimental";

             }

             uses resource-spec;

+            uses tapi-common:admin-state-pac;

+            uses tapi-common:capacity-pac;

             description "The LogicalTerminationPoint (LTP) object class encapsulates the termination and adaptation functions of one or more transport layers. 

                 The structure of LTP supports all transport protocols including circuit and packet forms.";

         }

@@ -161,39 +134,34 @@
                 Represents the capacity available to user (client) along with client interaction and usage. 

                 A TopologicalEntity may reflect one or more client protocols and one or more members for each profile.";

         }

+        grouping termination-pac {

+            leaf termination-direction {

+                type termination-direction;

+                config false;

+                description "The overall directionality of the LP. 

+                    - A BIDIRECTIONAL LP will have some SINK and/or SOURCE flowss.

+                    - A SINK LP can only contain elements with SINK flows or CONTRA_DIRECTION_SOURCE flows

+                    - A SOURCE LP can only contain SOURCE flows or CONTRA_DIRECTION_SINK flows";

+            }

+            leaf termination-state {

+                type termination-state;

+                config false;

+                description "Indicates whether the layer is terminated and if so how.";

+            }

+            description "Each transport layer is represented by a LayerProtocol (LP) instance. The LayerProtocol instances it can be used for controlling termination and monitoring functionality. 

+                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. 

+                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. ";

+        }

 

     /***********************

     * package type-definitions

     **********************/ 

-        identity layer-protocol-name {

-            description "none";

-        }

-        identity otsi-a {

-            base layer-protocol-name;

-            description "none";

-        }

-        identity otu {

-            base layer-protocol-name;

-            description "none";

-        }

-        identity odu {

-            base layer-protocol-name;

-            description "none";

-        }

-        identity eth {

-            base layer-protocol-name;

-            description "none";

-        }

-        identity ety {

-            base layer-protocol-name;

-            description "none";

-        }

         typedef administrative-state {

             type enumeration {

-                enum locked {

+                enum LOCKED {

                     description "Users are administratively prohibited from making use of the resource.";

                 }

-                enum unlocked {

+                enum UNLOCKED {

                     description "Users are allowed to use the resource";

                 }

             }

@@ -217,19 +185,19 @@
         }

         typedef directive-value {

             type enumeration {

-                enum minimize {

+                enum MINIMIZE {

                     description "none";

                 }

-                enum maximize {

+                enum MAXIMIZE {

                     description "none";

                 }

-                enum allow {

+                enum ALLOW {

                     description "none";

                 }

-                enum disallow {

+                enum DISALLOW {

                     description "none";

                 }

-                enum dont-care {

+                enum DONT_CARE {

                     description "none";

                 }

             }

@@ -237,21 +205,38 @@
         }

         typedef forwarding-direction {

             type enumeration {

-                enum bidirectional {

+                enum BIDIRECTIONAL {

                     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)";

                 }

-                enum unidirectional {

+                enum UNIDIRECTIONAL {

                     description "The Forwarding entity has Ports that are either INPUT or OUTPUT. It has no BIDIRECTIONAL Ports.";

                 }

-                enum undefined-or-unknown {

+                enum UNDEFINED_OR_UNKNOWN {

                     description "Not a normal state. The system is unable to determine the correct value.";

                 }

             }

             description "The directionality of a Forwarding entity.";

         }

         typedef layer-protocol-name {

-            type identityref {

-                base layer-protocol-name;

+            type enumeration {

+                enum OTSiA {

+                    description "Models the OTSiA layer as per ITU-T G.872 (2017) version 4";

+                }

+                enum OCH {

+                    description "Models the legacy OCH layer as per ITU-T G.872";

+                }

+                enum OTU {

+                    description "Models the OTU layer as per ITU-T G.872";

+                }

+                enum ODU {

+                    description "Models the ODU layer as per ITU-T G.872";

+                }

+                enum ETH {

+                    description "Models the ETH layer as per ITU-T G.8010";

+                }

+                enum ETY {

+                    description "Models the ETY layer as per ITU-T G.8010";

+                }

             }

             description "Provides a controlled list of layer protocol names and indicates the naming authority.

                 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.

@@ -262,18 +247,23 @@
         }

         typedef lifecycle-state {

             type enumeration {

-                enum planned {

+                enum PLANNED {

                     description "The resource is planned but is not present in the network.";

                 }

-                enum potential {

+                enum POTENTIAL_AVAILABLE {

                     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.

                         o    When a potential resource is configured and allocated to a client it is moved to the “installed” state for that client.

                         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.";

                 }

-                enum installed {

+                enum POTENTIAL_BUSY {

+                    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.

+                        o    When a potential resource is configured and allocated to a client it is moved to the “installed” state for that client.

+                        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.";

+                }

+                enum INSTALLED {

                     description "The resource is present in the network and is capable of providing the service expected.";

                 }

-                enum pending-removal {

+                enum PENDING_REMOVAL {

                     description "The resource has been marked for removal";

                 }

             }

@@ -292,10 +282,10 @@
         }

         typedef operational-state {

             type enumeration {

-                enum disabled {

+                enum DISABLED {

                     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.";

                 }

-                enum enabled {

+                enum ENABLED {

                     description "The resource is partially or fully operable and available for use";

                 }

             }

@@ -303,16 +293,16 @@
         }

         typedef port-direction {

             type enumeration {

-                enum bidirectional {

+                enum BIDIRECTIONAL {

                     description "The Port has both an INPUT flow and an OUTPUT flow defined.";

                 }

-                enum input {

+                enum INPUT {

                     description "The Port only has definition for a flow into the Forwarding entity (i.e. an ingress flow).";

                 }

-                enum output {

+                enum OUTPUT {

                     description "The Port only has definition for a flow out of the Forwarding entity (i.e. an egress flow).";

                 }

-                enum unidentified-or-unknown {

+                enum UNIDENTIFIED_OR_UNKNOWN {

                     description "Not a normal state. The system is unable to determine the correct value.";

                 }

             }

@@ -320,19 +310,19 @@
         }

         typedef port-role {

             type enumeration {

-                enum symmetric {

+                enum SYMMETRIC {

                     description "none";

                 }

-                enum root {

+                enum ROOT {

                     description "none";

                 }

-                enum leaf {

+                enum LEAF {

                     description "none";

                 }

-                enum trunk {

+                enum TRUNK {

                     description "none";

                 }

-                enum unknown {

+                enum UNKNOWN {

                     description "none";

                 }

             }

@@ -340,10 +330,10 @@
         }

         typedef termination-direction {

             type enumeration {

-                enum bidirectional {

+                enum BIDIRECTIONAL {

                     description "A Termination with both SINK and SOURCE flows.";

                 }

-                enum sink {

+                enum SINK {

                     description "The flow is up the layer stack from the server side to the client side. 

                         Considering an example of a Termination function within the termination entity, a SINK flow:

                         - will arrive at at the base of the termination function (the server side) where it is essentially at an INPUT to the termination component

@@ -352,7 +342,7 @@
                         A SINK termination is one that only supports a SINK flow.

                         A SINK termiation can be bound to an OUTPUT Port of a Forwarding entity";

                 }

-                enum source {

+                enum SOURCE {

                     description "The flow is down the layer stack from the server side to the client side. 

                         Considering an example of a Termination function within the termination entity, a SOURCE flow:

                         - will arrive at at the top of the termination function (the client side) where it is essentially at an INPUT to the termination component

@@ -361,7 +351,7 @@
                         A SOURCE termination is one that only supports a SOURCE flow.

                         A SOURCE termiation can be bound to an INPUT Port of a Forwarding entity";

                 }

-                enum undefined-or-unknown {

+                enum UNDEFINED_OR_UNKNOWN {

                     description "Not a normal state. The system is unable to determine the correct value.";

                 }

             }

@@ -369,25 +359,25 @@
         }

         typedef termination-state {

             type enumeration {

-                enum lp-can-never-terminate {

+                enum LP_CAN_NEVER_TERMINATE {

                     description "A non-flexible case that can never be terminated.";

                 }

-                enum lt-not-terminated {

+                enum LT_NOT_TERMINATED {

                     description "A flexible termination that can terminate but is currently not terminated.";

                 }

-                enum terminated-server-to-client-flow {

+                enum TERMINATED_SERVER_TO_CLIENT_FLOW {

                     description "A flexible termination that is currently terminated for server to client flow only.";

                 }

-                enum terminated-client-to-server-flow {

+                enum TERMINATED_CLIENT_TO_SERVER_FLOW {

                     description "A flexible termination that is currently terminated for client to server flow only.";

                 }

-                enum terminated-bidirectional {

+                enum TERMINATED_BIDIRECTIONAL {

                     description "A flexible termination that is currently terminated in both directions of flow.";

                 }

-                enum lt-permenantly-terminated {

+                enum LT_PERMENANTLY_TERMINATED {

                     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).";

                 }

-                enum termination-state-unknown {

+                enum TERMINATION_STATE_UNKNOWN {

                     description "There TerminationState cannot be determined.";

                 }

             }

@@ -456,13 +446,28 @@
         }

         typedef capacity-unit {

             type enumeration {

-                enum gbps {

+                enum TB {

+                    description "Indicates that the integer CapacityValue is in TeraBytes";

+                }

+                enum TBPS {

+                    description "Indicates that the integer CapacityValue is in Terabit-per-second";

+                }

+                enum GB {

+                    description "Indicates that the integer CapacityValue is in GigaBytes";

+                }

+                enum GBPS {

                     description "Indicates that the integer CapacityValue is in Gigabit-per-second";

                 }

-                enum mbps {

+                enum MB {

+                    description "Indicates that the integer CapacityValue is in MegaBytes";

+                }

+                enum MBPS {

                     description "Indicates that the integer CapacityValue is in Megabit-per-second";

                 }

-                enum kbps {

+                enum KB {

+                    description "Indicates that the integer CapacityValue is in KiloBytes";

+                }

+                enum KBPS {

                     description "Indicates that the integer CapacityValue is in Kilobit-per-second";

                 }

             }

@@ -470,16 +475,16 @@
         }

         typedef bandwidth-profile-type {

             type enumeration {

-                enum mef-10.x {

+                enum MEF_10.x {

                     description "none";

                 }

-                enum rfc-2697 {

+                enum RFC_2697 {

                     description "none";

                 }

-                enum rfc-2698 {

+                enum RFC_2698 {

                     description "none";

                 }

-                enum rfc-4115 {

+                enum RFC_4115 {

                     description "none";

                 }

             }