Extend data-type to initial-config-primitive 41/6341/2
authorAdam Israel <adam.israel@canonical.com>
Wed, 18 Jul 2018 17:06:29 +0000 (13:06 -0400)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 23 Aug 2018 14:42:49 +0000 (15:42 +0100)
The config-primitive defines a data-type, which is an enumerator of
STRING, INTEGER, and BOOLEAN, that informs consumers of the VNFD of what
type to treat the value as.

Yang itself is loosely typed, treating everything as a string, but
specifying the data-type is required when integrating with
strongly-typed languages. We've experienced this issue, documented in
bug #502, where the service primitives defined via the VCA are
strongly-typed and will fail if used with a primitive expecting a
non-STRING value.

This extends the data-type key to initial-config-primitive, allowing the
operator to define what type of data is expected. This will then be
consumed by N2VC to properly convert the value appropriately.

Signed-off-by: Adam Israel <adam.israel@canonical.com>
models/yang/mano-types.yang

index ba917c0..9fb3713 100644 (file)
@@ -78,6 +78,12 @@ module mano-types
         type string;
       }
 
         type string;
       }
 
+      leaf data-type {
+        description
+            "Data type associated with the value.";
+        type manotypes:parameter-data-type;
+      }
+
       leaf value {
         description
             "Value associated with the name.";
       leaf value {
         description
             "Value associated with the name.";