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

Change-Id: Ia68c94bcfa67ccf529f0eb0f51faea0566b34ef6
diff --git a/config-models/aether-2.0.x/files/aether-2.0.0.tree b/config-models/aether-2.0.x/files/aether-2.0.0.tree
index 32b29fc..6648e7e 100644
--- a/config-models/aether-2.0.x/files/aether-2.0.0.tree
+++ b/config-models/aether-2.0.x/files/aether-2.0.0.tree
@@ -1,3 +1,12 @@
+module: onf-connectivity-service
+  +--rw connectivity-services
+     +--rw connectivity-service* [id]
+        +--rw id                    connectivity-service-id
+        +--rw display-name?         string
+        +--rw description?          at:description
+        +--rw core-5g-endpoint?     inet:uri
+        +--rw acc-prometheus-url?   inet:uri
+
 module: onf-enterprise
   +--rw enterprises
      +--rw enterprise* [ent-id]
@@ -44,8 +53,8 @@
         |  +--rw default-behavior    at:behavior
         |  +--rw description?        at:description
         +--rw site* [site-id]
-           +--rw site-id            site-id
-           +--rw display-name?      string
+           +--rw site-id                  site-id
+           +--rw display-name?            string
            +--rw small-cell* [small-cell-id]
            |  +--rw small-cell-id    yg:yang-identifier
            |  +--rw address?         inet:host
@@ -64,7 +73,32 @@
            |  +--rw mnc           at:mnc
            |  +--rw enterprise    at:ent
            |  +--rw format        string
-           +--rw description?       at:description
+           +--rw description?             at:description
+           +--rw device* [dev-id]
+           |  +--rw dev-id          device-id
+           |  +--rw imei?           at:imei
+           |  +--rw description?    at:description
+           |  +--rw display-name?   string
+           |  +--rw sim-card?       -> ../../sim-card/sim-id
+           +--rw priority-traffic-rule* [ptr-id]
+           |  +--rw ptr-id           priority-traffic-rule-id
+           |  +--rw display-name?    string
+           |  +--rw device           -> ../../device/dev-id
+           |  +--rw endpoint         -> ../../../application/endpoint/endpoint-id
+           |  +--rw mbr
+           |  |  +--rw uplink?     at:bitrate
+           |  |  +--rw downlink?   at:bitrate
+           |  +--rw gbr
+           |  |  +--rw uplink?     at:bitrate
+           |  |  +--rw downlink?   at:bitrate
+           |  +--rw traffic-class?   -> ../../../traffic-class/tc-id
+           |  +--rw description?     at:description
+           +--rw sim-card* [sim-id]
+           |  +--rw sim-id          sim-card-id
+           |  +--rw iccid?          at:iccid
+           |  +--rw description?    at:description
+           |  +--rw display-name?   string
+           |  +--rw imsi?           at:imsi
            +--rw upf* [upf-id]
            |  +--rw upf-id             upf-id
            |  +--rw address            inet:host
@@ -97,17 +131,14 @@
            |  +--rw dg-id           device-group-id
            |  +--rw description?    at:description
            |  +--rw display-name?   string
-           |  +--rw imsis* [imsi-id]
-           |  |  +--rw imsi-id            yg:yang-identifier
-           |  |  +--rw imsi-range-from?   uint64
-           |  |  +--rw imsi-range-to?     uint64
-           |  |  +--rw display-name?      string
+           |  +--rw device* [device-id]
+           |  |  +--rw device-id    -> ../../../device/dev-id
+           |  |  +--rw enable?      boolean
            |  +--rw ip-domain?      -> ../../ip-domain/ip-id
-           |  +--rw device
-           |     +--rw mbr
-           |     |  +--rw uplink      at:bitrate
-           |     |  +--rw downlink    at:bitrate
+           |  +--rw mbr
+           |     +--rw uplink           at:bitrate
            |     +--rw traffic-class    -> ../../../../traffic-class/tc-id
+           |     +--rw downlink         at:bitrate
            +--rw ip-domain* [ip-id]
               +--rw ip-id            ip-domain-id
               +--rw display-name?    string
@@ -119,11 +150,3 @@
               +--rw mtu?             at:mtu
               +--rw description?     at:description
 
-module: onf-connectivity-service
-  +--rw connectivity-services
-     +--rw connectivity-service* [id]
-        +--rw id                    connectivity-service-id
-        +--rw display-name?         string
-        +--rw description?          at:description
-        +--rw core-5g-endpoint?     inet:uri
-        +--rw acc-prometheus-url?   inet:uri
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;