Revisited KDU augment to follow previous structure in old IM 95/10095/8 release-v9.0-start v9.0.0 v9.0.0rc1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 10 Dec 2020 17:32:36 +0000 (17:32 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 15 Dec 2020 12:08:22 +0000 (12:08 +0000)
Change-Id: I37d5d4de757e25d64b446deb9e84630b42dbd8eb
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
models/augments/configuration.yang
models/augments/kdu.yang
tests/examples/magma_knf_sol006.yaml

index 94a226d..8120c5a 100644 (file)
@@ -28,9 +28,6 @@ module configuration {
         prefix day1-2;
     }
 
-    import kdu {
-        prefix kdu;
-    }
     grouping extended-vnf-configuration {
         leaf vnf-configuration-id {
             description
@@ -51,42 +48,11 @@ module configuration {
         }
     }
 
-    grouping extended-kdu-configuration {
-        list kdu-profile {
-            key "name";
-
-            leaf name {
-                description
-                  "Reference to the KDU";
-                type leafref {
-                    path "/vnfd:vnfd/kdu:kdu/kdu:name";
-                }
-            }
-
-            leaf kdu-configuration-id {
-                description
-                  "Reference to the KDU configuration to use in this DF";
-                type leafref {
-                    path "/vnfd:vnfd/kdu:kdu-configuration/kdu:id";
-                }
-            }
-
-            leaf kdu-model-id {
-                description
-                  "Reference to the KDU model to use in this DF";
-                type leafref {
-                    path "/vnfd:vnfd/kdu:kdu-model/kdu:id";
-                }
-            }
-        }
-    }
-
     augment "/vnfd:vnfd/vnfd:df" {
         uses extended-vnf-configuration;
-        uses extended-kdu-configuration;
     }
 
     augment "/vnfd:vnfd/vnfd:df/vnfd:vdu-profile" {
         uses extended-vdu-configuration;
     }
-}
\ No newline at end of file
+}
index 9e0021f..2800082 100644 (file)
@@ -41,13 +41,7 @@ module kdu {
     }
 
     grouping extended-kdu-configuration {
-        list kdu-configuration {
-            key "id";
-            leaf id {
-                description
-                  "Internal identifier for the KDU configuration";
-                type string;
-            }
+        container kdu-configuration {
             uses common:vnfc-configuration;
             uses common:vdu-config-access;
 
@@ -64,47 +58,6 @@ module kdu {
         }
     }
 
-    grouping extended-kdu-model {
-        list kdu-model {
-            key "id";
-
-            leaf id {
-                description
-                  "Internal identifier for the KDU model";
-                type string;
-            }
-
-            leaf kdu-model-type {
-                description
-                  "Indicates the KDU model, either as a helm-chart or as a juju-bundle.";
-
-                type enumeration {
-                    enum helm-chart;
-                    enum juju-bundle;
-                }
-            }
-
-            leaf kdu-model-helm-version {
-                description
-                  "Helm version to use for this helm-chart, v3 by default.";
-
-                type enumeration {
-                    enum v2;
-                    enum v3;
-                }
-                default v3;
-            }
-
-            leaf kdu-model-locator {
-                description
-                  "Indicates the KDU model location, either as a path to a folder in the 
-                   package or as a URL where to fetch the model.";
-
-                type string;
-            }
-        }
-    }
-
     grouping extended-kdu {
         list kdu {
             description
@@ -122,6 +75,50 @@ module kdu {
                   "Description of the KDU.";
                 type string;
             }
+
+            choice kdu-model {
+                description
+                  "Indicates the KDU model, either as a helm-chart or as a juju-bundle.";
+
+                case helm-chart {
+                    leaf helm-chart {
+                        description
+                          "Helm chart that models the KDU, in any of the following ways:
+                           - <helm-repo>/<helm-chart>
+                           - <helm-chart folder under k8s_models folder in the package>
+                           - <helm-chart tgz file (w/ or w/o extension) under k8s_models folder in the package>
+                           - <URL_where_to_fetch_chart>
+                          ";
+                        type string;
+                    }
+
+                    leaf helm-version {
+                        description
+                          "Helm version to use for this helm-chart, v3 by default";
+                        type enumeration {
+                            enum v2;
+                            enum v3;
+                        }
+                        default v3;
+                    }
+                }
+
+                case juju-bundle {
+                    leaf juju-bundle {
+                        description
+                          "Juju bundle that models the KDU, in any of the following ways:
+                           - <juju-repo>/<juju-bundle>
+                           - <juju-bundle folder under k8s_models folder in the package>
+                           - <juju-bundle tgz file (w/ or w/o extension) under k8s_models folder in the package>
+                           - <URL_where_to_fetch_juju_bundle>
+                          ";
+                        type string;
+                    }
+                }
+            }
+
+            uses extended-kdu-configuration;
+
         }
 
         container k8s-cluster {
@@ -166,8 +163,6 @@ module kdu {
 
     augment "/vnfd:vnfd" {
         uses extended-kdu;
-        uses extended-kdu-configuration;
-        uses extended-kdu-model;
     }
 
     augment "/vnfd:vnfd/vnfd:ext-cpd/vnfd:cp-connection" {
index 58bdb96..228e3a4 100644 (file)
@@ -31,14 +31,5 @@ vnfd:
 
   kdu:
     - name: orc8r
+      helm-chart: magma/orc8r
 
-  kdu-model:
-    - id: orc8r-model
-      kdu-model-type: helm-chart
-      kdu-model-locator: magma/orc8r
-
-  df:
-    - id: kdu-df
-      kdu-profile:
-        - name: orc8r
-          kdu-model-id: orc8r-model
\ No newline at end of file