aether-2.0.0 models: Reorganize the YANG tree as submodules

Change-Id: I5c41899b466f7ece528d5e078924589118441104
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 c48cab1..c81c501 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
@@ -2,15 +2,14 @@
 //
 // SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
 
-module onf-application {
-  namespace "http://opennetworking.org/enterprise/application";
-  prefix app;
+submodule onf-application {
+  belongs-to onf-enterprise { prefix ent; }
 
   import ietf-inet-types{ prefix ietf; }
   import ietf-yang-types{ prefix yg; }
   import onf-aether-types{ prefix at; }
-  import onf-enterprise{ prefix ent; }
-  import onf-traffic-class{ prefix tc; }
+
+  include onf-traffic-class;
 
   organization "Open Networking Foundation.";
   contact "Scott Baker";
@@ -19,6 +18,11 @@
      connect to. Includes a set of endpoints where services are
      provided.";
 
+  revision "2022-01-14" {
+    description "Refactored as submodule";
+    reference "RFC 6020";
+  }
+
   revision "2021-09-10" {
     description "Aether Application.";
     reference "RFC 6087";
@@ -31,15 +35,15 @@
     description "The typedef for application-id";
   }
 
-  container application {
-    description "The top level container";
+  grouping application {
+    description "The application grouping";
 
     list application {
-      key "id";
+      key "app-id";
       description
         "List of applications";
 
-      leaf id {
+      leaf app-id {
         type application-id;
         description "ID for this application.";
       }
@@ -101,7 +105,7 @@
         }
         leaf traffic-class {
           type leafref {
-            path "/tc:traffic-class/tc:traffic-class/tc:id";
+            path "../../../traffic-class/tc-id";
           }
           description
             "Link to traffic class";
@@ -114,15 +118,6 @@
         }
         description "list for endpoint";
       }
-
-      leaf enterprise {
-        type leafref {
-          path "/ent:enterprise/ent:enterprise/ent:id";
-        }
-        mandatory true;
-        description
-          "Link to enterprise that owns this Application. May be set to None if the application is global to all Enterprises.";
-      }
     }
   }
 }
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 e1d53b6..183be39 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
@@ -16,6 +16,11 @@
     "An Aether Connectivity service is the linkage between the
      ROC and a core that provides connectivity.";
 
+  revision "2022-01-14" {
+    description "Renamed top level container as plural";
+    reference "RFC 6020";
+  }
+
   revision "2021-10-21" {
     description "An Aether Connectivity Service. Specifies the endpoints where the sdcore-adapter should push configuration to. A single connectivity service may be attached to multiple Enterprises.";
     reference "RFC 6087";
@@ -28,8 +33,8 @@
    description "The typedef for connectivity-service-id";
   }
 
-  container connectivity-service {
-    description "The top level container";
+  container connectivity-services {
+    description "The connectivity-services top level container";
 
     list connectivity-service {
       key "id";
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 a93c295..4b5371b 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
@@ -2,15 +2,14 @@
 //
 // SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
 
-module onf-device-group {
-  namespace "http://opennetworking.org/aether/device-group";
-  prefix dg;
+submodule onf-device-group {
+  belongs-to onf-enterprise { prefix ent; }
 
   import ietf-yang-types{ prefix yg; }
   import onf-aether-types { prefix at; }
-  import onf-ip-domain{ prefix ipd; }
-  import onf-site{ prefix st; }
-  import onf-traffic-class{ prefix tc; }
+
+  include onf-ip-domain;
+  include onf-traffic-class;
 
   organization "Open Networking Foundation.";
   contact "Scott Baker";
@@ -25,6 +24,11 @@
      and DNS settings that apply to devices within the
      group";
 
+  revision "2022-01-14" {
+    description "Refactored as submodule";
+    reference "RFC 6020";
+  }
+
   revision "2021-06-02" {
     description "An Aether Device Group";
     reference "RFC 6087";
@@ -37,15 +41,15 @@
     description "The typedef for device-group-id";
   }
 
-  container device-group {
-    description "The top level container";
+  grouping device-group {
+    description "The device-group grouping";
 
     list device-group {
-      key "id";
+      key "dg-id";
       description
         "List of device groups";
 
-      leaf id {
+      leaf dg-id {
         type device-group-id;
         description "ID for this device group.";
       }
@@ -93,7 +97,7 @@
 
       leaf ip-domain {
         type leafref {
-          path "/ipd:ip-domain/ipd:ip-domain/ipd:id";
+          path "../../ip-domain/ip-id";
         }
         description
           "Link to ip-domain settings that determine the pool of IP addresses,
@@ -120,22 +124,13 @@
         }
         leaf traffic-class {
           type leafref {
-            path "/tc:traffic-class/tc:traffic-class/tc:id";
+            path "../../../../traffic-class/tc-id";
           }
           mandatory true;
           description
             "Link to traffic class";
         }
       }
-
-      leaf site {
-        type leafref {
-          path "/st:site/st:site/st:id";
-        }
-        mandatory true;
-        description
-          "Link to site";
-      }
     }
   }
 }
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 16ad5f9..95e691e 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
@@ -10,12 +10,26 @@
   import onf-aether-types { prefix at; }
   import onf-connectivity-service { prefix cs; }
 
+  include onf-site;
+  include onf-upf;
+  include onf-vcs;
+  include onf-device-group;
+  include onf-ip-domain;
+  include onf-application;
+  include onf-traffic-class;
+  include onf-template;
+
   organization "Open Networking Foundation.";
   contact "Scott Baker";
   description
     "An Aether Enterprise is an administration entity that
      has ownership of resrouces.";
 
+  revision "2022-01-14" {
+    description "Refactored to work with submodules";
+    reference "RFC 6020";
+  }
+
   revision "2021-06-02" {
     description "An Aether Enterprise. Used to distinguish ownership of devices and other resources as well as a domain of configuration.";
     reference "RFC 6087";
@@ -28,15 +42,15 @@
    description "The typedef for enterprise-id";
   }
 
-  container enterprise {
-    description "The top level container";
+  container enterprises {
+    description "The top level enterprises container";
 
     list enterprise {
-      key "id";
+      key "ent-id";
       description
         "List of enterprises";
 
-      leaf id {
+      leaf ent-id {
         type enterprise-id;
         description "ID for this enterprise.";
       }
@@ -57,7 +71,7 @@
         key "connectivity-service";
         leaf connectivity-service {
           type leafref {
-            path "/cs:connectivity-service/cs:connectivity-service/cs:id";
+            path "/cs:connectivity-services/cs:connectivity-service/cs:id";
           }
           description
             "Link to connectivity services where configuration should be pushed for this enterprise's devices";
@@ -70,6 +84,14 @@
         }
         description "The list for connectivity-service";
       }
+
+      uses application;
+
+      uses traffic-class;
+
+      uses template;
+
+      uses site;
     }
   }
 }
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 e896cc5..b5fb974 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
@@ -2,14 +2,12 @@
 //
 // SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
 
-module onf-ip-domain {
-  namespace "http://opennetworking.org/aether/ip-domain";
-  prefix ipd;
+submodule onf-ip-domain {
+  belongs-to onf-enterprise { prefix ent; }
 
   import ietf-inet-types { prefix inet; }
   import ietf-yang-types{ prefix yg; }
   import onf-aether-types { prefix at; }
-  import onf-enterprise{ prefix ent; }
 
   organization "Open Networking Foundation.";
   contact "Scott Baker";
@@ -18,6 +16,11 @@
      that may be assigned to UEs, as well as DNS servers and other
      metadata";
 
+  revision "2022-01-14" {
+    description "Refactored as submodule";
+    reference "RFC 6020";
+  }
+
   revision "2021-06-02" {
     description "An Aether IP and Domain Specification";
     reference "RFC 6087";
@@ -30,15 +33,15 @@
     description "The typedef for ip-domain-id";
   }
 
-  container ip-domain {
-    description "The top level container";
+  grouping ip-domain {
+    description "The ip-domain grouping";
 
     list ip-domain {
-      key "id";
+      key "ip-id";
       description
         "List of ip domains";
 
-      leaf id {
+      leaf ip-id {
         type ip-domain-id;
         description "ID for this ip domain.";
       }
@@ -88,17 +91,6 @@
         type at:description;
         description "description of this ip domain";
       }
-
-      // Ip-Domain is always owned by an Enterprise, because it contains
-      // IP addresses relative to that Enterprise.
-      leaf enterprise {
-        type leafref {
-          path "/ent:enterprise/ent:enterprise/ent:id";
-        }
-        mandatory true;
-        description
-          "Link to enterprise that owns this IP-Domain";
-      }
     }
   }
 }
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 b5f22c4..2b782ff 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
@@ -2,20 +2,28 @@
 //
 // SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
 
-module onf-site {
-  namespace "http://opennetworking.org/aether/site";
-  prefix st;
+submodule onf-site {
+  belongs-to onf-enterprise { prefix ent; }
 
   import ietf-inet-types { prefix inet; }
   import ietf-yang-types{ prefix yg; }
   import onf-aether-types{ prefix at; }
-  import onf-enterprise{ prefix ent; }
+
+  include onf-upf;
+  include onf-vcs;
+  include onf-device-group;
+  include onf-ip-domain;
 
   organization "Open Networking Foundation.";
   contact "Scott Baker";
   description
     "An Aether site is a location where resources are deployed.";
 
+  revision "2022-01-14" {
+    description "Refactored as submodule";
+    reference "RFC 6020";
+  }
+
   revision "2021-09-10" {
     description "An Aether Site.";
     reference "RFC 6087";
@@ -28,15 +36,15 @@
     description "The typedef for site-id";
   }
 
-  container site {
-    description "The top level container";
+  grouping site {
+    description "The site grouping";
 
     list site {
-      key "id";
+      key "site-id";
       description
         "List of site";
 
-      leaf id {
+      leaf site-id {
         type site-id;
         description "ID for this site.";
       }
@@ -117,15 +125,6 @@
             "container for monitoring";
       }
 
-      leaf enterprise {
-        type leafref {
-          path "/ent:enterprise/ent:enterprise/ent:id";
-        }
-        mandatory true;
-        description
-          "Link to enterprise that owns this site";
-      }
-
       container imsi-definition {
         leaf mcc {
           type at:mcc;
@@ -167,6 +166,14 @@
         type at:description;
         description "description of this site";
       }
+
+      uses upf;
+
+      uses vcs;
+
+      uses device-group;
+
+      uses ip-domain;
     }
   }
 }
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 bbd94ef..7c1f1b9 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
@@ -2,9 +2,8 @@
 //
 // SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
 
-module onf-template {
-  namespace "http://opennetworking.org/aether/template";
-  prefix tp;
+submodule onf-template {
+  belongs-to onf-enterprise { prefix ent; }
 
   import ietf-yang-types{ prefix yg; }
   import onf-aether-types{ prefix at; }
@@ -16,6 +15,11 @@
      by a virtual connectivity service. Templates are used to
      populate a VCS.";
 
+  revision "2022-01-14" {
+    description "Refactored as submodule";
+    reference "RFC 6020";
+  }
+
   revision "2021-09-10" {
     description "An Aether Virtual Cellular Service Template";
     reference "RFC 6087";
@@ -28,15 +32,15 @@
     description "The typedef for template-id";
   }
 
-  container template {
-    description "The top level container";
+  grouping template {
+    description "The template grouping";
 
     list template {
-      key "id";
+      key "tp-id";
       description
         "List of vcs templates";
 
-      leaf id {
+      leaf tp-id {
         type template-id;
         description "ID for this vcs 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 a592267..4a4a96d 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
@@ -2,9 +2,8 @@
 //
 // SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
 
-module onf-traffic-class {
-  namespace "http://opennetworking.org/aether/traffic-class";
-  prefix tp;
+submodule onf-traffic-class {
+  belongs-to onf-enterprise { prefix ent; }
 
   import ietf-yang-types{ prefix yg; }
   import onf-aether-types{ prefix at; }
@@ -15,6 +14,11 @@
     "The aether traffic class associates qos constants
      with a named class of service";
 
+  revision "2022-01-14" {
+    description "Refactored as submodule";
+    reference "RFC 6020";
+  }
+
   revision "2021-09-10" {
     description "An Aether Traffic Class";
     reference "RFC 6087";
@@ -27,15 +31,15 @@
     description "The typedef for traffic-class-id";
   }
 
-  container traffic-class {
-    description "The top level container";
+  grouping traffic-class {
+    description "The traffic-class grouping";
 
     list traffic-class {
-      key "id";
+      key "tc-id";
       description
         "List of traffic class";
 
-      leaf id {
+      leaf tc-id {
         type traffic-class-id;
         description "ID for 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 5c8be50..4d27f31 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
@@ -2,20 +2,22 @@
 //
 // SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
 
-module onf-upf {
-  namespace "http://opennetworking.org/aether/upf";
-  prefix upf;
+submodule onf-upf {
+  belongs-to onf-enterprise { prefix ent; }
 
   import ietf-inet-types { prefix inet; }
   import ietf-yang-types{ prefix yg; }
   import onf-aether-types { prefix at; }
-  import onf-enterprise{ prefix ent; }
-  import onf-site{ prefix st; }
 
   organization "Open Networking Foundation.";
   contact "Scott Baker";
   description "A Aether UPF List is a named User Plane Function.";
 
+  revision "2022-01-14" {
+    description "Refactored as submodule";
+    reference "RFC 6020";
+  }
+
   revision "2021-09-16" {
     description "An Aether User Plane Function";
     reference "RFC 6087";
@@ -28,15 +30,15 @@
    description "The typedef for upf-id";
   }
 
-  container upf {
-    description "The top level container";
+  grouping upf {
+    description "The upf grouping";
 
     list upf {
-      key "id";
+      key "upf-id";
       description
         "A list of named upfs.";
 
-      leaf id {
+      leaf upf-id {
         type upf-id;
         description "ID for this upf.";
       }
@@ -71,28 +73,6 @@
         type at:description;
         description "description of this UPF";
       }
-
-      // UPFs are always owned by an Enterprise, since they typically exist on the
-      // Enterprise's edge.
-      leaf enterprise {
-        type leafref {
-          path "/ent:enterprise/ent:enterprise/ent:id";
-        }
-        mandatory true;
-        description
-          "Link to enterprise that owns this Access Point List";
-      }
-
-      // UPFs always reside at a site, as the exist on physical infrastructure. GUI
-      // will ensure that the tuple (DG, VCS, UPF) all exist on the same site.
-      leaf site {
-        type leafref {
-          path "/st:site/st:site/st:id";
-        }
-        mandatory true;
-        description
-          "Link to site";
-      }
     }
   }
 }
diff --git a/config-models/aether-2.0.x/files/yang/onf-vcs.yang b/config-models/aether-2.0.x/files/yang/onf-vcs.yang
index c275565..d050ed1 100755
--- a/config-models/aether-2.0.x/files/yang/onf-vcs.yang
+++ b/config-models/aether-2.0.x/files/yang/onf-vcs.yang
@@ -2,17 +2,15 @@
 //
 // SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
 
-module onf-vcs {
-  namespace "http://opennetworking.org/aether/vcs";
-  prefix sl;
+submodule onf-vcs {
+  belongs-to onf-enterprise { prefix ent; }
 
   import ietf-yang-types{ prefix yg; }
   import onf-aether-types{ prefix at; }
-  import onf-application{ prefix app; }
-  import onf-device-group{ prefix dg; }
-  import onf-enterprise{ prefix ent; }
-  import onf-upf { prefix upf; }
-  import onf-site{ prefix st; }
+
+  include onf-upf;
+  include onf-device-group;
+  include onf-application;
 
   organization "Open Networking Foundation.";
   contact "Scott Baker";
@@ -20,6 +18,11 @@
     "An Aether Virtual Cellular Service (VCS) is
      used to connect devices with applications";
 
+  revision "2022-01-14" {
+    description "Refactored as submodule";
+    reference "RFC 6020";
+  }
+
   revision "2021-09-10" {
     description "An Aether Virtual Cellular Service";
     reference "RFC 6087";
@@ -32,15 +35,15 @@
     description "The typedef for vcs-id";
   }
 
-  container vcs {
-    description "The top level container";
+  grouping vcs {
+    description "The vcs grouping";
 
     list vcs {
-      key "id";
+      key "vcs-id";
       description
         "List of virtual cellular services";
 
-      leaf id {
+      leaf vcs-id {
         type vcs-id;
         description "ID for this vcs.";
       }
@@ -56,7 +59,7 @@
         key "device-group";
         leaf device-group {
           type leafref {
-            path "/dg:device-group/dg:device-group/dg:id";
+            path "../../../device-group/dg-id";
           }
           description
             "Link to device group";
@@ -83,7 +86,7 @@
         key "application";
         leaf application {
           type leafref {
-            path "/app:application/app:application/app:id";
+            path "../../../../application/app-id";
           }
           mandatory true;
           description
@@ -109,7 +112,7 @@
 
       leaf upf {
         type leafref {
-          path "/upf:upf/upf:upf/upf:id";
+          path "../../upf/upf-id";
         }
         description
           "Link to user plane that implements this vcf";
@@ -120,24 +123,6 @@
         description "description of this vcs";
       }
 
-      leaf enterprise {
-        type leafref {
-          path "/ent:enterprise/ent:enterprise/ent:id";
-        }
-        mandatory true;
-        description
-          "Link to enterprise that owns this VCS";
-      }
-
-      leaf site {
-        type leafref {
-          path "/st:site/st:site/st:id";
-        }
-	mandatory true;
-        description
-          "Link to site where this VCS is deployed";
-      }
-
       // the following are populated from the template
       leaf sst {
         type at:sst;