Aether-3082 Move PTR inside of slice

Also made MBR/GBR a choice

And changed "id"s to a consistent naming scheme

Made a grouping for "description" and "display-name"

Change-Id: I99492fd371a687469a08f1216b2cd729cc940fd4
diff --git a/config-models/aether-2.0.x/files/yang/onf-aether-types.yang b/config-models/aether-2.0.x/files/yang/onf-aether-types.yang
index 908c8b2..e0d655d 100755
--- a/config-models/aether-2.0.x/files/yang/onf-aether-types.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-aether-types.yang
@@ -174,4 +174,19 @@
     }
     description "The typedef for description";
   }
+
+  grouping desc-display-name {
+    description "reusable leafs for description and display-name";
+    leaf display-name {
+      type string {
+          length 1..80;
+      }
+      description "display name to use in GUI or CLI";
+    }
+
+    leaf description {
+      type description;
+      description "long description field";
+    }
+  }
 }
diff --git a/config-models/aether-2.0.x/files/yang/onf-application.yang b/config-models/aether-2.0.x/files/yang/onf-application.yang
index c81c501..31aa19d 100755
--- a/config-models/aether-2.0.x/files/yang/onf-application.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-application.yang
@@ -39,26 +39,16 @@
     description "The application grouping";
 
     list application {
-      key "app-id";
+      key "application-id";
       description
         "List of applications";
 
-      leaf app-id {
+      leaf application-id {
         type application-id;
         description "ID for this application.";
       }
 
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
-
-      leaf description {
-        type at:description;
-        description "description of this application";
-      }
+      uses at:desc-display-name;
 
       leaf address {
         type ietf:host;
@@ -74,6 +64,9 @@
           description
               "Id of this endpoint";
         }
+
+        uses at:desc-display-name;
+
         leaf port-start {
           type ietf:port-number;
           description
@@ -105,17 +98,12 @@
         }
         leaf traffic-class {
           type leafref {
-            path "../../../traffic-class/tc-id";
+            path "../../../traffic-class/traffic-class-id";
           }
           description
             "Link to traffic class";
         }
-        leaf display-name {
-          type string {
-              length 1..80;
-          }
-          description "display name to use in GUI or CLI";
-        }
+
         description "list for endpoint";
       }
     }
diff --git a/config-models/aether-2.0.x/files/yang/onf-connectivity-service.yang b/config-models/aether-2.0.x/files/yang/onf-connectivity-service.yang
index 183be39..33c63a1 100755
--- a/config-models/aether-2.0.x/files/yang/onf-connectivity-service.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-connectivity-service.yang
@@ -37,26 +37,16 @@
     description "The connectivity-services top level container";
 
     list connectivity-service {
-      key "id";
+      key "connectivity-service-id";
       description
         "List of connectivity services";
 
-      leaf id {
+      leaf connectivity-service-id {
         type connectivity-service-id;
         description "ID for this connectivity service.";
       }
 
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
-
-      leaf description {
-        type at:description;
-        description "description of this connectivity service";
-      }
+      uses at:desc-display-name;
 
       leaf core-5g-endpoint {
         type inet:uri;
diff --git a/config-models/aether-2.0.x/files/yang/onf-device-group.yang b/config-models/aether-2.0.x/files/yang/onf-device-group.yang
index 2e01e17..41f0b70 100755
--- a/config-models/aether-2.0.x/files/yang/onf-device-group.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-device-group.yang
@@ -46,32 +46,22 @@
     description "The device-group grouping";
 
     list device-group {
-      key "dg-id";
+      key "device-group-id";
       description
         "List of device groups";
 
-      leaf dg-id {
+      leaf device-group-id {
         type device-group-id;
         description "ID for this device group.";
       }
 
-      leaf description {
-        type at:description;
-        description "description of this device group";
-      }
-
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
+      uses at:desc-display-name;
 
       list device {
         key "device-id";
         leaf device-id {
           type leafref {
-            path "../../../device/dev-id";
+            path "../../../device/device-id";
           }
           description
              "Link to device";
@@ -87,7 +77,7 @@
 
       leaf ip-domain {
         type leafref {
-          path "../../ip-domain/ip-id";
+          path "../../ip-domain/ip-domain-id";
         }
         description
           "Link to ip-domain settings that determine the pool of IP addresses,
@@ -113,7 +103,7 @@
 
       leaf traffic-class {
         type leafref {
-          path "../../../traffic-class/tc-id";
+          path "../../../traffic-class/traffic-class-id";
         }
         mandatory true;
         description
diff --git a/config-models/aether-2.0.x/files/yang/onf-device.yang b/config-models/aether-2.0.x/files/yang/onf-device.yang
index ce49e2c..b79844a 100644
--- a/config-models/aether-2.0.x/files/yang/onf-device.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-device.yang
@@ -30,34 +30,24 @@
     description "The top level container";
 
     list device {
-      key "dev-id";
+      key "device-id";
       unique "imei";
       description
         "List of devices";
 
-      leaf dev-id {
+      leaf device-id {
         type device-id;
         description "ID for this device.";
       }
 
+      uses at:desc-display-name;
+
       leaf imei {
         type at:imei;
         description
            "IMEI for this device";
       }
 
-      leaf description {
-        type at:description;
-        description "description of this device";
-      }
-
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
-
       // TODO: Device Type
 
       leaf sim-card {
diff --git a/config-models/aether-2.0.x/files/yang/onf-enterprise.yang b/config-models/aether-2.0.x/files/yang/onf-enterprise.yang
index 4cb25fa..7b83595 100755
--- a/config-models/aether-2.0.x/files/yang/onf-enterprise.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-enterprise.yang
@@ -54,32 +54,22 @@
     description "The top level enterprises container";
 
     list enterprise {
-      key "ent-id";
+      key "enterprise-id";
       description
         "List of enterprises";
 
-      leaf ent-id {
+      leaf enterprise-id {
         type enterprise-id;
         description "ID for this enterprise.";
       }
 
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
-
-      leaf description {
-        type at:description;
-        description "description of this enterprise";
-      }
+      uses at:desc-display-name;
 
       list connectivity-service {
         key "connectivity-service";
         leaf connectivity-service {
           type leafref {
-            path "/cs:connectivity-services/cs:connectivity-service/cs:id";
+            path "/cs:connectivity-services/cs:connectivity-service/cs:connectivity-service-id";
           }
           description
             "Link to connectivity services where configuration should be pushed for this enterprise's devices";
diff --git a/config-models/aether-2.0.x/files/yang/onf-ip-domain.yang b/config-models/aether-2.0.x/files/yang/onf-ip-domain.yang
index b5fb974..287122e 100755
--- a/config-models/aether-2.0.x/files/yang/onf-ip-domain.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-ip-domain.yang
@@ -37,21 +37,16 @@
     description "The ip-domain grouping";
 
     list ip-domain {
-      key "ip-id";
+      key "ip-domain-id";
       description
         "List of ip domains";
 
-      leaf ip-id {
+      leaf ip-domain-id {
         type ip-domain-id;
         description "ID for this ip domain.";
       }
 
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
+      uses at:desc-display-name;
 
       leaf dnn {
         type at:dnn;
@@ -86,11 +81,6 @@
         type at:mtu;
         description "maximum transmission unit";
       }
-
-      leaf description {
-        type at:description;
-        description "description of this ip domain";
-      }
     }
   }
 }
diff --git a/config-models/aether-2.0.x/files/yang/onf-priority-traffic-rule.yang b/config-models/aether-2.0.x/files/yang/onf-priority-traffic-rule.yang
index f8fe5bd..e73cdf7 100755
--- a/config-models/aether-2.0.x/files/yang/onf-priority-traffic-rule.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-priority-traffic-rule.yang
@@ -33,26 +33,21 @@
     description "The top level container";
 
     list priority-traffic-rule {
-      key "ptr-id";
+      key "priority-traffic-rule-id";
       unique "device endpoint";
       description
         "List of priority traffic rules";
 
-      leaf ptr-id {
+      leaf priority-traffic-rule-id {
         type priority-traffic-rule-id;
         description "ID for this priority traffic class.";
       }
 
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
+      uses at:desc-display-name;
 
       leaf device {
         type leafref {
-          path "../../device/dev-id";
+          path "../../../device/device-id";
         }
         mandatory true;
         description
@@ -61,7 +56,7 @@
 
       leaf application {
         type leafref {
-          path "../../../application/app-id";
+          path "../../../../application/application-id";
         }
         mandatory true;
         description
@@ -70,55 +65,51 @@
 
       leaf endpoint {
         type leafref {
-          path "../../../application/endpoint/endpoint-id";
+          path "../../../../application/endpoint/endpoint-id";
         }
         mandatory true;
         description
           "Link to endpoint in application";
       }
 
-      container mbr {
-        description "Maximum bitrate";
-        leaf uplink {
-          type at:bitrate;
-          units bps;
-          description "Per-Device per-Application MBR uplink data rate in bps";
+      choice bitrate {
+        description "Either an GBR or an MBR can be specified, but not both";
+        case mbr-case {
+          container mbr {
+            description "Per-Device per-Application MBR (Maximum BitRate) in bps";
+            uses bitrate;
+          }
         }
-
-        leaf downlink {
-          type at:bitrate;
-          units bps;
-          description "Per-Device per application MBR downlink data rate in bps";
-        }
-      }
-
-      container gbr {
-        description "Guaranteed bitrate";
-        leaf uplink {
-          type at:bitrate;
-          units bps;
-          description "Per-Device per-Application GBR uplink data rate in bps";
-        }
-
-        leaf downlink {
-          type at:bitrate;
-          units bps;
-          description "Per-Device per application GBR downlink data rate in bps";
+        case gbr-case {
+          container gbr {
+            description "Per-Device per-Application GBR (Guaranteed BitRate) in bps";
+            uses bitrate;
+          }
         }
       }
 
       leaf traffic-class {
         type leafref {
-          path "../../../traffic-class/tc-id";
+          path "../../../../traffic-class/traffic-class-id";
         }
         description
           "Link to traffic class";
       }
-
-      leaf description {
-        type at:description;
-        description "description of this priority traffic rule";
-      }
     }
   }
+
+  grouping bitrate {
+      description "uplink and downlink leafs for GBR and MBR";
+      leaf uplink {
+        type at:bitrate;
+        units bps;
+        description "Per-Device per-Application uplink data rate in bps";
+      }
+
+      leaf downlink {
+        type at:bitrate;
+        units bps;
+        description "Per-Device per application downlink data rate in bps";
+      }
+  }
 }
diff --git a/config-models/aether-2.0.x/files/yang/onf-sim-card.yang b/config-models/aether-2.0.x/files/yang/onf-sim-card.yang
index 1b7fe8a..cf2ed86 100644
--- a/config-models/aether-2.0.x/files/yang/onf-sim-card.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-sim-card.yang
@@ -39,24 +39,14 @@
         description "ID for this sim card.";
       }
 
+      uses at:desc-display-name;
+
       leaf iccid {
         type at:iccid;
         description
            "ICCID for this sim card";
       }
 
-      leaf description {
-        type at:description;
-        description "description of this sim card";
-      }
-
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
-
       leaf imsi {
           type at:imsi;
           description
diff --git a/config-models/aether-2.0.x/files/yang/onf-site.yang b/config-models/aether-2.0.x/files/yang/onf-site.yang
index 8e63c00..3a4e333 100755
--- a/config-models/aether-2.0.x/files/yang/onf-site.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-site.yang
@@ -10,7 +10,6 @@
   import onf-aether-types{ prefix at; }
 
   include onf-device;
-  include onf-priority-traffic-rule;
   include onf-sim-card;
   include onf-upf;
   include onf-slice;
@@ -52,12 +51,7 @@
         description "ID for this site.";
       }
 
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
+      uses at:desc-display-name;
 
       list small-cell {
         key "small-cell-id";
@@ -66,6 +60,9 @@
           description
             "Id of small cell";
         }
+
+        uses at:desc-display-name;
+
         leaf address {
           type inet:host;
           description
@@ -83,12 +80,6 @@
           description
             "Enable this small cell";
         }
-        leaf display-name {
-          type string {
-              length 1..80;
-          }
-          description "display name to use in GUI or CLI";
-        }
         description
           "List of small cell addresses";
       }
@@ -111,16 +102,8 @@
             description
               "Id of edge monitoring device";
           }
-          leaf display-name {
-            type string {
-                length 1..80;
-            }
-            description "display name to use in GUI or CLI";
-          }
-          leaf description {
-            type at:description;
-            description "description of this site";
-          }
+          uses at:desc-display-name;
+
           description
             "List of edge monitoring devices";
         }
@@ -165,15 +148,8 @@
         description "container for imsi-defination";
       }
 
-      leaf description {
-        type at:description;
-        description "description of this site";
-      }
-
       uses device;
 
-      uses priority-traffic-rule;
-
       uses sim-card;
 
       uses upf;
diff --git a/config-models/aether-2.0.x/files/yang/onf-slice.yang b/config-models/aether-2.0.x/files/yang/onf-slice.yang
index 98bfdd8..2965f86 100755
--- a/config-models/aether-2.0.x/files/yang/onf-slice.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-slice.yang
@@ -11,6 +11,7 @@
   include onf-upf;
   include onf-device-group;
   include onf-application;
+  include onf-priority-traffic-rule;
 
   organization "Open Networking Foundation.";
   contact "Scott Baker";
@@ -48,18 +49,13 @@
         description "ID for this slice.";
       }
 
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
+      uses at:desc-display-name;
 
       list device-group {
         key "device-group";
         leaf device-group {
           type leafref {
-            path "../../../device-group/dg-id";
+            path "../../../device-group/device-group-id";
           }
           description
             "Link to device group";
@@ -86,7 +82,7 @@
         key "application";
         leaf application {
           type leafref {
-            path "../../../../application/app-id";
+            path "../../../../application/application-id";
           }
           mandatory true;
           description
@@ -118,11 +114,6 @@
           "Link to user plane that implements this vcf";
       }
 
-      leaf description {
-        type at:description;
-        description "description of this slice";
-      }
-
       // the following are populated from the template
       leaf sst {
         type at:sst;
@@ -164,6 +155,8 @@
       }
 
       // end of items populated from the template
+      uses priority-traffic-rule;
+
     }
   }
 }
diff --git a/config-models/aether-2.0.x/files/yang/onf-template.yang b/config-models/aether-2.0.x/files/yang/onf-template.yang
index 2dd853c..518d8b9 100755
--- a/config-models/aether-2.0.x/files/yang/onf-template.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-template.yang
@@ -36,21 +36,16 @@
     description "The template grouping";
 
     list template {
-      key "tp-id";
+      key "template-id";
       description
         "List of slice templates";
 
-      leaf tp-id {
+      leaf template-id {
         type template-id;
         description "ID for this slice template.";
       }
 
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
+      uses at:desc-display-name;
 
       leaf sst {
         type at:sst;
@@ -95,11 +90,6 @@
         description
           "Default behavior if no filter rules match";
       }
-
-      leaf description {
-        type at:description;
-        description "description of this slice template";
-      }
     }
   }
 }
diff --git a/config-models/aether-2.0.x/files/yang/onf-traffic-class.yang b/config-models/aether-2.0.x/files/yang/onf-traffic-class.yang
index 4a4a96d..69ae702 100755
--- a/config-models/aether-2.0.x/files/yang/onf-traffic-class.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-traffic-class.yang
@@ -35,21 +35,16 @@
     description "The traffic-class grouping";
 
     list traffic-class {
-      key "tc-id";
+      key "traffic-class-id";
       description
         "List of traffic class";
 
-      leaf tc-id {
+      leaf traffic-class-id {
         type traffic-class-id;
         description "ID for this traffic class.";
       }
 
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
+      uses at:desc-display-name;
 
       leaf arp {
         type at:arp;
@@ -70,11 +65,6 @@
         type at:pdb;
         description "PDB";
       }
-
-      leaf description {
-        type at:description;
-        description "description of this traffic class";
-      }
     }
   }
 }
diff --git a/config-models/aether-2.0.x/files/yang/onf-upf.yang b/config-models/aether-2.0.x/files/yang/onf-upf.yang
index 4d27f31..32bee7a 100755
--- a/config-models/aether-2.0.x/files/yang/onf-upf.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-upf.yang
@@ -43,6 +43,8 @@
         description "ID for this upf.";
       }
 
+      uses at:desc-display-name;
+
       leaf address {
         type inet:host;
         mandatory true;
@@ -61,18 +63,6 @@
         type inet:uri;
         description "url for configuring the UPF";
       }
-
-      leaf display-name {
-        type string {
-            length 1..80;
-        }
-        description "display name to use in GUI or CLI";
-      }
-
-      leaf description {
-        type at:description;
-        description "description of this UPF";
-      }
     }
   }
 }