Revisited KDU augment to follow previous structure in old IM
Change-Id: I37d5d4de757e25d64b446deb9e84630b42dbd8eb
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/models/augments/configuration.yang b/models/augments/configuration.yang
index 94a226d..8120c5a 100644
--- a/models/augments/configuration.yang
+++ b/models/augments/configuration.yang
@@ -28,9 +28,6 @@
prefix day1-2;
}
- import kdu {
- prefix kdu;
- }
grouping extended-vnf-configuration {
leaf vnf-configuration-id {
description
@@ -51,42 +48,11 @@
}
}
- 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
+}
diff --git a/models/augments/kdu.yang b/models/augments/kdu.yang
index 9e0021f..2800082 100644
--- a/models/augments/kdu.yang
+++ b/models/augments/kdu.yang
@@ -41,13 +41,7 @@
}
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 @@
}
}
- 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 @@
"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 @@
augment "/vnfd:vnfd" {
uses extended-kdu;
- uses extended-kdu-configuration;
- uses extended-kdu-model;
}
augment "/vnfd:vnfd/vnfd:ext-cpd/vnfd:cp-connection" {
diff --git a/tests/examples/magma_knf_sol006.yaml b/tests/examples/magma_knf_sol006.yaml
index 58bdb96..228e3a4 100644
--- a/tests/examples/magma_knf_sol006.yaml
+++ b/tests/examples/magma_knf_sol006.yaml
@@ -31,14 +31,5 @@
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