AETHER-2752 Priority Traffic Rule, Device, Sim-Card

Change-Id: Ia68c94bcfa67ccf529f0eb0f51faea0566b34ef6
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 679648e..908c8b2 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
@@ -17,6 +17,24 @@
     reference "RFC 6087";
   }
 
+  typedef imsi {
+      type uint64 {
+      }
+    description "International Mobile Subscriber Identity";
+  }
+
+  typedef imei {
+      type uint64 {
+      }
+    description "International Mobile Equipment Identity";
+  }
+
+  typedef iccid {
+      type uint64 {
+      }
+    description "Integrated Circuit Card ID";
+  }
+
   typedef bitrate {
       type uint64 {
       }
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 4b5371b..b57e8db 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
@@ -10,6 +10,7 @@
 
   include onf-ip-domain;
   include onf-traffic-class;
+  include onf-device;
 
   organization "Open Networking Foundation.";
   contact "Scott Baker";
@@ -66,33 +67,22 @@
         description "display name to use in GUI or CLI";
       }
 
-      list imsis {
-        // TODO: imsi-range-from cannot be used as a list index
-        key "imsi-id";
-        leaf imsi-id {
-          type yg:yang-identifier;
-          description
-              "Id of this imsi-range";
-        }
-        leaf imsi-range-from {
-          type uint64;
-          description
-              "value of imsi-range-from";
-        }
-        leaf imsi-range-to {
-          type uint64;
-          description
-              "value of imsi-range-to";
-        }
-        leaf display-name {
-          type string {
-              length 1..80;
+      list device {
+        key "device-id";
+        leaf device-id {
+          type leafref {
+            path "../../../device/dev-id";
           }
-          description "display name to use in GUI or CLI";
+          description
+             "Link to device";
         }
-        description
-          "List of imsi ranges that comprise this group. It's acceptable for
-           a range to degenerate to being a singleton";
+        leaf enable {
+          type boolean;
+          default true;
+          description
+            "Enable this device";
+        }
+        description "list of devices in this device-group";
       }
 
       leaf ip-domain {
@@ -104,24 +94,15 @@
            as well as the domain resolver settings to use";
       }
 
-      container device {
-        description "Per-device QOS Settings";
-        container mbr {
-          description "Maximum bitrate";
-          leaf uplink {
-            type at:bitrate;
-            units bps;
-            mandatory true;
-            description "Per-device MBR uplink data rate in bps";
-          }
-
-          leaf downlink {
-            type at:bitrate;
-            units bps;
-            mandatory true;
-            description "Per-device MBR downlink data rate in bps";
-          }
+      container mbr {
+        description "Maximum bitrate";
+        leaf uplink {
+          type at:bitrate;
+          units bps;
+          mandatory true;
+          description "Per-device MBR uplink data rate in bps";
         }
+
         leaf traffic-class {
           type leafref {
             path "../../../../traffic-class/tc-id";
@@ -130,6 +111,13 @@
           description
             "Link to traffic class";
         }
+
+        leaf downlink {
+          type at:bitrate;
+          units bps;
+          mandatory true;
+          description "Per-device MBR downlink data rate in bps";
+        }
       }
     }
   }
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
new file mode 100644
index 0000000..ce49e2c
--- /dev/null
+++ b/config-models/aether-2.0.x/files/yang/onf-device.yang
@@ -0,0 +1,72 @@
+// SPDX-FileCopyrightText: 2021 Open Networking Foundation
+//
+// SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+submodule onf-device {
+  belongs-to onf-enterprise { prefix ent; }
+
+  import ietf-yang-types{ prefix yg; }
+  import onf-aether-types { prefix at; }
+  include onf-sim-card;
+
+  organization "Open Networking Foundation.";
+    contact "Scott Baker";
+    description
+      "A Aether Device...";
+
+  revision "2022-01-19" {
+    description "An Aether Device";
+    reference "RFC 6087";
+  }
+
+  typedef device-id {
+        type yg:yang-identifier {
+            length 1..32;
+        }
+    description "The typedef for device-id";
+  }
+
+  grouping device {
+    description "The top level container";
+
+    list device {
+      key "dev-id";
+      unique "imei";
+      description
+        "List of devices";
+
+      leaf dev-id {
+        type device-id;
+        description "ID for this device.";
+      }
+
+      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 {
+        type leafref {
+            path "../../sim-card/sim-id";
+        }
+        description
+          "Link to simcard";
+      }
+    }
+  }
+}
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 95e691e..aba447f 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
@@ -16,8 +16,11 @@
   include onf-device-group;
   include onf-ip-domain;
   include onf-application;
+  include onf-sim-card;
   include onf-traffic-class;
   include onf-template;
+  include onf-device;
+  include onf-priority-traffic-rule;
 
   organization "Open Networking Foundation.";
   contact "Scott Baker";
@@ -25,6 +28,11 @@
     "An Aether Enterprise is an administration entity that
      has ownership of resrouces.";
 
+  revision "2022-01-19" {
+    description "Sim-card, Device, and Priority-Traffic-Rule Support";
+    reference "RFC 6020";
+  }
+
   revision "2022-01-14" {
     description "Refactored to work with submodules";
     reference "RFC 6020";
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
new file mode 100755
index 0000000..68f862c
--- /dev/null
+++ b/config-models/aether-2.0.x/files/yang/onf-priority-traffic-rule.yang
@@ -0,0 +1,115 @@
+// SPDX-FileCopyrightText: 2021 Open Networking Foundation
+//
+// SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+submodule onf-priority-traffic-rule {
+  belongs-to onf-enterprise { prefix ent; }
+
+  import ietf-yang-types{ prefix yg; }
+  import onf-aether-types{ prefix at; }
+  include onf-device;
+  include onf-traffic-class;
+  include onf-application;
+
+  organization "Open Networking Foundation.";
+  contact "Scott Baker";
+  description
+    "The aether traffic class associates qos constants
+     with a named class of service";
+
+  revision "2022-01-19" {
+    description "An Aether Priority Traffic Rule";
+    reference "RFC 6087";
+  }
+
+  typedef priority-traffic-rule-id {
+        type yg:yang-identifier {
+            length 1..32;
+        }
+    description "The typedef for priority traffic rule id";
+  }
+
+  grouping priority-traffic-rule {
+    description "The top level container";
+
+    list priority-traffic-rule {
+      key "ptr-id";
+      unique "device endpoint";
+      description
+        "List of priority traffic rules";
+
+      leaf ptr-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";
+      }
+
+      leaf device {
+        type leafref {
+          path "../../device/dev-id";
+        }
+        mandatory true;
+        description
+          "Link to device";
+      }
+
+      leaf endpoint {
+        type leafref {
+          path "../../../application/endpoint/endpoint-id";
+        }
+        mandatory true;
+        description
+          "Link to application";
+      }
+
+      container mbr {
+        description "Maximum bitrate";
+        leaf uplink {
+          type at:bitrate;
+          units bps;
+          description "Per-Device per-Application MBR uplink data rate in bps";
+        }
+
+        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";
+        }
+      }
+
+      leaf traffic-class {
+        type leafref {
+          path "../../../traffic-class/tc-id";
+        }
+        description
+          "Link to traffic class";
+      }
+
+      leaf description {
+        type at:description;
+        description "description of this priority traffic rule";
+      }
+    }
+  }
+}
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
new file mode 100644
index 0000000..1b7fe8a
--- /dev/null
+++ b/config-models/aether-2.0.x/files/yang/onf-sim-card.yang
@@ -0,0 +1,67 @@
+// SPDX-FileCopyrightText: 2021 Open Networking Foundation
+//
+// SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+submodule onf-sim-card {
+  belongs-to onf-enterprise { prefix ent; }
+
+  import ietf-yang-types{ prefix yg; }
+  import onf-aether-types { prefix at; }
+
+  organization "Open Networking Foundation.";
+    contact "Scott Baker";
+    description
+      "A Aether Device...";
+
+  revision "2022-01-19" {
+    description "An Aether Device";
+    reference "RFC 6087";
+  }
+
+  typedef sim-card-id {
+        type yg:yang-identifier {
+            length 1..32;
+        }
+    description "The typedef for device-id";
+  }
+
+  grouping sim-card {
+    description "The top level container";
+
+    list sim-card {
+      key "sim-id";
+      unique "iccid";
+      description
+        "List of sim cards";
+
+      leaf sim-id {
+        type sim-card-id;
+        description "ID for this sim card.";
+      }
+
+      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
+              "IMSI for this sim card";
+      }
+    }
+  }
+}
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 2b782ff..17cf478 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
@@ -9,6 +9,9 @@
   import ietf-yang-types{ prefix yg; }
   import onf-aether-types{ prefix at; }
 
+  include onf-device;
+  include onf-priority-traffic-rule;
+  include onf-sim-card;
   include onf-upf;
   include onf-vcs;
   include onf-device-group;
@@ -167,6 +170,12 @@
         description "description of this site";
       }
 
+      uses device;
+
+      uses priority-traffic-rule;
+
+      uses sim-card;
+
       uses upf;
 
       uses vcs;