Add Day-1 and Day-2 configuration augment 31/8531/2
authorTomás Villaseca <tvillaseca@whitestack.com>
Tue, 28 Jan 2020 19:27:35 +0000 (16:27 -0300)
committerTomás Villaseca <tvillaseca@whitestack.com>
Mon, 30 Mar 2020 18:33:21 +0000 (15:33 -0300)
Change-Id: I264fe9a6febb432ef39a9b16bd5204ae1c230588
Signed-off-by: Tomás Villaseca <tvillaseca@whitestack.com>
augments/cloud-init.yang
augments/common-augments.yang [new file with mode: 0644]
augments/day1-2.yang [new file with mode: 0644]
augments/ip-profiles.yang

index bec9ac0..73bc723 100644 (file)
@@ -17,7 +17,7 @@
 
 module cloud-init {
     yang-version 1.1;
-    namespace "urn:etsi:osm:yang:nsd:augments:cloud-init";
+    namespace "urn:etsi:osm:yang:augments";
     prefix "cloud-init";
 
     import etsi-nfv-vnfd {
diff --git a/augments/common-augments.yang b/augments/common-augments.yang
new file mode 100644 (file)
index 0000000..3b2b51f
--- /dev/null
@@ -0,0 +1,318 @@
+/*
+  Copyright 2020 Whitestack LLC
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+  implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+*/
+
+module common-augments {
+    yang-version 1.1;
+    namespace "urn:etsi:osm:yang:augments";
+    prefix "common";
+
+    typedef parameter-data-type {
+        type enumeration {
+            enum STRING;
+            enum INTEGER;
+            enum BOOLEAN;
+        }
+    }
+
+    grouping primitive-parameter-value {
+        list parameter {
+            description
+              "List of parameters to the configuration primitive.";
+            key "name";
+            leaf name {
+                description
+                  "Name of the parameter.";
+                type string;
+            }
+
+            leaf data-type {
+                description
+                  "Data type associated with the value.";
+                type common:parameter-data-type;
+            }
+
+            leaf value {
+                description
+                  "Value associated with the name.";
+                type string;
+            }
+        }
+    }
+
+    grouping primitive-parameter {
+        leaf name {
+            description
+              "Name of the parameter.";
+            type string;
+        }
+
+        leaf data-type {
+            description
+              "Data type associated with the name.";
+            type common:parameter-data-type;
+        }
+
+        leaf mandatory {
+            description
+              "Is this field mandatory";
+            type boolean;
+            default false;
+        }
+
+        leaf default-value {
+            description
+              "The default value for this field";
+            type string;
+        }
+
+        leaf parameter-pool {
+            description
+              "NSD parameter pool name to use for this parameter";
+            type string;
+        }
+
+        leaf read-only {
+            description
+              "The value should be dimmed by the UI.
+               Only applies to parameters with default values.";
+            type boolean;
+            default false;
+        }
+
+        leaf hidden {
+            description
+              "The value should be hidden by the UI.
+               Only applies to parameters with default values.";
+            type boolean;
+            default false;
+        }
+    }
+
+    grouping vnfc-relations {
+        list relation {
+            description
+              "List of relations between elements in this descriptor.";
+            key "name";
+
+            leaf name {
+                description
+                  "Name of the relation.";
+
+                type string;
+            }
+
+            list entities {
+                description
+                  "List of two elements to be related.
+                   Elements to be related are identified by a pair (id, endpoint).
+                   The relation will relate (id1, endpoint1) to (id2, endpoint2).";
+                key "id";
+
+                leaf id {
+                    description
+                      "A string, reference to the element id in the descriptor.
+                       It could be a vnfd-id or a vdu-id in a VNFD,
+                       or a nsd-id or member-vnf-index in a NSD.";
+                    type string;
+                }
+
+                leaf endpoint {
+                    description
+                      "Endpoint name defining the relation.";
+                    type string;
+                }
+            }
+        }
+    }
+
+    grouping vnfc-metrics {
+        description
+          "Information about the VNF or VDU metrics";
+        list metrics {
+            description
+              "List of VNFC related metrics";
+            key "name";
+            leaf name {
+                description
+                  "Name of the metric, as defined in the Juju charm.";
+                type string;
+            }
+        }
+    } 
+
+    grouping configuration-method {
+        choice config-method {
+            description
+              "Defines the configuration method for the VNF or VDU.";
+            case script {
+                description
+                  "Use custom script for configuring the VNF or VDU.
+                   This script is executed in the context of
+                   Orchestrator (The same system and environment
+                   as the Launchpad).";
+                container script {
+                    leaf script-type {
+                        description
+                          "Script type - currently supported - Scripts confirming to Rift CA plugin";
+                        type enumeration {
+                            enum rift;
+                        }
+                    }
+                }
+            }
+
+            case juju {
+                description
+                  "Configure the VNF or VDU through Juju.";
+                container juju {
+                    leaf charm {
+                        description
+                          "Juju charm to use with the VNF or VDU.";
+                        type string;
+                    }
+                    leaf proxy {
+                        description
+                          "Is this a proxy charm?";
+                        type boolean;
+                        default true;
+                    }
+                }
+            }
+        }
+    }
+
+    grouping vdu-config-access {
+
+        container config-access {
+
+            description
+              "Indicates the way to access to the xNF or xDU for VCA configuration.
+               For the moment there is a single way (ssh-access).";
+
+            container ssh-access {
+
+                description
+                  "If the xNF requires ssh and this parameter is set, SSH keys
+                   will be injected so that VCA can configure the xNF or xDU via ssh.";
+
+                leaf required {
+                    description
+                      "whether ssh access is needed or not";
+                    type boolean;
+                    default false;
+                }
+
+                leaf default-user {
+                    description
+                      "Default user for ssh";
+                    type string;
+                }
+            }
+        }
+    }
+    
+    grouping vnfc-configuration {
+        description
+          "Common information in the descriptors for NS, VNF or VDU configuration.
+           Note: If the NS contains multiple instances of the
+           same VNF or VDU, each instance could have a different
+           configuration.";
+
+        uses common:configuration-method;
+
+        list config-primitive {
+            description
+              "List of config primitives supported by the
+               configuration agent for this VNF or VDU.";
+            key "name";
+
+            leaf name {
+                description
+                  "Name of the config primitive.";
+                type string;
+            }
+
+            list parameter {
+                description
+                  "List of parameters to the config primitive.";
+                key "name";
+                uses primitive-parameter;
+            }
+
+            leaf user-defined-script {
+                description
+                  "A user defined script. If user defined script is defined,
+                   the script will be executed using bash";
+                type string;
+            }
+        }
+
+        list initial-config-primitive {
+            description
+              "Initial set of configuration primitives.";
+            key "seq";
+            leaf seq {
+                description
+                  "Sequence number for the configuration primitive.";
+                type uint64;
+            }
+
+            choice primitive-type {
+                case primitive-definition {
+                    leaf name {
+                        description
+                          "Name of the configuration primitive.";
+                        type string;
+                    }
+
+                    uses primitive-parameter-value;
+
+                    leaf user-defined-script {
+                        description
+                          "A user defined script.";
+                        type string;
+                    }
+                }
+            }
+        }
+
+        list terminate-config-primitive {
+            description
+              "Terminate set of configuration primitives.";
+            key "seq";
+            leaf seq {
+                description
+                  "Sequence number for the configuration primitive.";
+                type uint64;
+            }
+            leaf name {
+                description
+                  "Name of the configuration primitive.";
+                type string;
+            }
+
+            uses primitive-parameter-value;
+
+            leaf user-defined-script {
+                description
+                  "A user defined script.";
+                type string;
+            }
+        }
+        uses common:vnfc-metrics;
+    }
+}
diff --git a/augments/day1-2.yang b/augments/day1-2.yang
new file mode 100644 (file)
index 0000000..78029e1
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+  Copyright 2020 Whitestack LLC
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+  implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+*/
+
+module day1-2 {
+    yang-version 1.1;
+    namespace "urn:etsi:osm:yang:augments";
+    prefix "day1-2";
+
+    import etsi-nfv-vnfd {
+        prefix vnfd;
+    }
+
+    import common-augments {
+        prefix common;
+    }
+
+    grouping extended-vnf-configuration {
+        container vnf-configuration {
+            uses common:vnfc-configuration;
+            uses common:vnfc-relations;
+            uses common:vdu-config-access;
+        }
+    }
+
+    grouping extended-vdu-configuration {
+        container vdu-configuration {
+            uses common:vnfc-configuration;
+            uses common:vdu-config-access;
+        }
+    }
+
+    augment "/vnfd:vnfd" {
+        uses extended-vnf-configuration;
+    }
+
+    augment "/vnfd:vnfd/vnfd:vdu" {
+        uses extended-vdu-configuration;
+    }
+}
\ No newline at end of file
index 661bb3e..3744c79 100644 (file)
@@ -16,7 +16,7 @@
 */
 module ip-profiles {
     yang-version 1.1;
-    namespace "urn:etsi:osm:yang:nsd:augments:ip-profiles";
+    namespace "urn:etsi:osm:yang:augments";
     prefix "ip-profiles";
 
     import etsi-nfv-nsd {