Refactor manotypes:vnf-configuration
authorAdam Israel <adam.israel@canonical.com>
Wed, 28 Jun 2017 18:31:45 +0000 (14:31 -0400)
committerAdam Israel <adam.israel@canonical.com>
Tue, 19 Sep 2017 21:05:21 +0000 (17:05 -0400)
1) Rename manotypes:vnf-configuration to manotypes:vca-configuration
2) Add manotypes:vca-configuration to the VDU to support multi-VDU scenarios
3) Add support for relations to the juju container

Signed-off-by: Adam Israel <adam.israel@canonical.com>
Change-Id: I3ac6d483284dcf68141d5031ce94e8b915d35107

models/yang/mano-types.yang
models/yang/vnfd.yang
models/yang/vnfr.yang

index ebd24a9..3c820e3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
 
 /*
- * 
+ *
  *   Copyright 2016 RIFT.IO Inc
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   Copyright 2016 RIFT.IO Inc
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
@@ -118,26 +118,26 @@ module mano-types
       type boolean;
     }
   }
       type boolean;
     }
   }
-  
+
   grouping ui-primitive-group {
     list parameter-group {
       description
             "Grouping of parameters which are logically grouped in UI";
       key "name";
   grouping ui-primitive-group {
     list parameter-group {
       description
             "Grouping of parameters which are logically grouped in UI";
       key "name";
+
       leaf name {
         description
             "Name of the parameter group";
         type string;
       }
       leaf name {
         description
             "Name of the parameter group";
         type string;
       }
+
       list parameter {
         description
             "List of parameters for the service primitive.";
         key "name";
         uses manotypes:primitive-parameter;
       }
       list parameter {
         description
             "List of parameters for the service primitive.";
         key "name";
         uses manotypes:primitive-parameter;
       }
+
       leaf mandatory {
         description "Is this parameter group mandatory";
         type boolean;
       leaf mandatory {
         description "Is this parameter group mandatory";
         type boolean;
@@ -165,7 +165,7 @@ module mano-types
             identifies an image uploaded to the CAL.
             ";
       type string;
             identifies an image uploaded to the CAL.
             ";
       type string;
-    } 
+    }
   }
   grouping initial-config {
     leaf seq {
   }
   grouping initial-config {
     leaf seq {
@@ -200,52 +200,75 @@ module mano-types
     }
   }
 
     }
   }
 
-  grouping vnf-configuration {
-    container vnf-configuration {
-      rwpb:msg-new VnfConfiguration;
-      description
-          "Information about the VNF configuration. Note: 
-           If the NS contains multiple instances of the
-           same VNF, each instance could have a different
-           configuration.";
+  grouping vca-relationships {
+    container vca-relationships {
+      list relation {
+        description "List of relations between VCA componets.";
 
 
-      choice config-method {
-        description
-            "Defines the configuration method for the VNF.";
-        case script {
+        key "requires provides";
+
+        leaf requires {
           description
           description
-              "Use custom script for configuring the VNF.
-               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;
-              }
-            }
-          }
+            "Name of the required relation.";
+          type string;
         }
 
         }
 
-        case juju {
+        leaf provides {
           description
           description
-            "Configure the VNF through Juju.";
-          container juju {
-            leaf charm {
-              description "Juju charm to use with the VNF.";
-              type string;
+            "Name of the provided relation.";
+          type string;
+        }
+      }
+    }
+  }
+
+
+  grouping vca-configuration {
+    description
+        "Information about the VNF or VDU configuration. Note:
+         If the NS contains multiple instances of the
+         same VNF or VDU, each instance could have a different
+         configuration.";
+
+    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;
+          }
+          uses manotypes:vca-relationships;
+
+        }
+      }
+
+
       list service-primitive {
         rwpb:msg-new ServicePrimitive;
         description
           "List of service primitives supported by the
       list service-primitive {
         rwpb:msg-new ServicePrimitive;
         description
           "List of service primitives supported by the
-          configuration agent for this VNF.";
+          configuration agent for this VNF or VDU.";
         key "name";
 
         leaf name {
         key "name";
 
         leaf name {
@@ -270,7 +293,7 @@ module mano-types
         uses initial-config;
       }
     }
         uses initial-config;
       }
     }
-  } // END - grouping vnf-configuration
+  } // END - grouping vca-configuration
 
   typedef virtual-link-type {
     description
 
   typedef virtual-link-type {
     description
@@ -694,7 +717,7 @@ module mano-types
         description "Number of threads per cores on the host.";
         type uint64;
       }
         description "Number of threads per cores on the host.";
         type uint64;
       }
-      
+
       list cpu-feature {
         key "feature";
         description "List of CPU features.";
       list cpu-feature {
         key "feature";
         description "List of CPU features.";
@@ -704,7 +727,7 @@ module mano-types
         }
       }
 
         }
       }
 
-      
+
       leaf om-cpu-model-string {
         description "OpenMANO CPU model string";
         type string;
       leaf om-cpu-model-string {
         description "OpenMANO CPU model string";
         type string;
@@ -938,7 +961,7 @@ module mano-types
         description
             "Type of the overlay network.
              LOCAL - Provider network implemented in a single compute node
         description
             "Type of the overlay network.
              LOCAL - Provider network implemented in a single compute node
-             FLAT - Provider network shared by all tenants 
+             FLAT - Provider network shared by all tenants
              VLAN - Provider network implemented using 802.1Q tagging
              VXLAN - Provider networks implemented using RFC 7348
              GRE - Provider networks implemented using GRE tunnels";
              VLAN - Provider network implemented using 802.1Q tagging
              VXLAN - Provider networks implemented using RFC 7348
              GRE - Provider networks implemented using GRE tunnels";
@@ -1666,7 +1689,7 @@ module mano-types
     leaf operation {
       description
           "The relational operator used to define whether an alarm should be
     leaf operation {
       description
           "The relational operator used to define whether an alarm should be
-           triggered in certain scenarios, such as if the metric statistic 
+           triggered in certain scenarios, such as if the metric statistic
            goes above or below a specified value.";
       type alarm-operation-type;
     }
            goes above or below a specified value.";
       type alarm-operation-type;
     }
@@ -1709,12 +1732,12 @@ module mano-types
       enum openvim;
     }
   }
       enum openvim;
     }
   }
-  
+
   grouping host-aggregate {
     list host-aggregate {
       description "Name of the Host Aggregate";
       key "metadata-key";
   grouping host-aggregate {
     list host-aggregate {
       description "Name of the Host Aggregate";
       key "metadata-key";
-      
+
       leaf metadata-key {
         description
             "Name of the additional information attached to the host-aggregate";
       leaf metadata-key {
         description
             "Name of the additional information attached to the host-aggregate";
@@ -1727,13 +1750,13 @@ module mano-types
       }
     }
   }
       }
     }
   }
-  
+
   grouping placement-group-input {
     leaf cloud-type {
       type manotypes:cloud-account-type;
     }
     choice cloud-provider {
   grouping placement-group-input {
     leaf cloud-type {
       type manotypes:cloud-account-type;
     }
     choice cloud-provider {
-      case openstack {           
+      case openstack {
         container availability-zone {
           description "Name of the Availability Zone";
           leaf name {
         container availability-zone {
           description "Name of the Availability Zone";
           leaf name {
@@ -1756,7 +1779,7 @@ module mano-types
       case openmano {
         leaf openmano-construct {
           type empty;
       case openmano {
         leaf openmano-construct {
           type empty;
-        }        
+        }
       }
       case vsphere {
         leaf vsphere-construct {
       }
       case vsphere {
         leaf vsphere-construct {
@@ -1775,7 +1798,7 @@ module mano-types
       }
     }
   }
       }
     }
   }
-  
+
   grouping placement-group-info {
     description "";
 
   grouping placement-group-info {
     description "";
 
@@ -1791,7 +1814,7 @@ module mano-types
                    behind this placement group. This is for human consumption only";
       type string;
     }
                    behind this placement group. This is for human consumption only";
       type string;
     }
-    
+
     leaf strategy {
       description
           "Strategy associated with this placement group
     leaf strategy {
       description
           "Strategy associated with this placement group
@@ -1814,7 +1837,7 @@ module mano-types
   grouping ip-profile-info {
     description "Grouping for IP-Profile";
     container ip-profile-params {
   grouping ip-profile-info {
     description "Grouping for IP-Profile";
     container ip-profile-params {
-      
+
       leaf ip-version {
         type inet:ip-version;
         default ipv4;
       leaf ip-version {
         type inet:ip-version;
         default ipv4;
@@ -1843,7 +1866,7 @@ module mano-types
         }
       }
 
         }
       }
 
-      container dhcp-params {  
+      container dhcp-params {
         leaf enabled {
           description "This flag indicates if DHCP is enabled or not";
           type boolean;
         leaf enabled {
           description "This flag indicates if DHCP is enabled or not";
           type boolean;
@@ -1873,19 +1896,19 @@ module mano-types
       description
           "List of IP Profiles.
              IP Profile describes the IP characteristics for the Virtual-Link";
       description
           "List of IP Profiles.
              IP Profile describes the IP characteristics for the Virtual-Link";
-    
+
       key "name";
 
       leaf name {
         description "Name of the IP-Profile";
         type string;
       }
       key "name";
 
       leaf name {
         description "Name of the IP-Profile";
         type string;
       }
-      
+
       leaf description {
         description "Description for IP profile";
         type string;
       }
       leaf description {
         description "Description for IP profile";
         type string;
       }
-      
+
       uses ip-profile-info;
     }
   }
       uses ip-profile-info;
     }
   }
@@ -1915,7 +1938,7 @@ module mano-types
         description "Some VIMs implement additional drives to host config-files or meta-data";
         type boolean;
         default false;
         description "Some VIMs implement additional drives to host config-files or meta-data";
         type boolean;
         default false;
-      } 
+      }
     }
   }
 
     }
   }
 
index b3f820d..60fc757 100644 (file)
@@ -149,7 +149,9 @@ module vnfd
         type string;
       }
 
         type string;
       }
 
-      uses manotypes:vnf-configuration;
+      container vnf-configuration {
+        uses manotypes:vca-configuration;
+      }
 
       container mgmt-interface {
         description
 
       container mgmt-interface {
         description
@@ -355,6 +357,10 @@ module vnfd
 
         uses manotypes:image-properties;
 
 
         uses manotypes:image-properties;
 
+        container vdu-configuration {
+          uses manotypes:vca-configuration;
+        }
+
         choice cloud-init-input {
           description
               "Indicates how the contents of cloud-init script are provided.
         choice cloud-init-input {
           description
               "Indicates how the contents of cloud-init script are provided.
index f228f1d..773cc95 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
 
 /*
- * 
+ *
  *   Copyright 2016 RIFT.IO Inc
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   Copyright 2016 RIFT.IO Inc
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
@@ -69,10 +69,10 @@ module vnfr
       key "name";
       uses manotypes:placement-group-info;
       uses manotypes:placement-group-input;
       key "name";
       uses manotypes:placement-group-info;
       uses manotypes:placement-group-input;
-    }  
+    }
   }
   }
-  
-  
+
+
   grouping virtual-interface {
     container virtual-interface {
       description
   grouping virtual-interface {
     container virtual-interface {
       description
@@ -192,8 +192,8 @@ module vnfr
 
       leaf create-time {
         description
 
       leaf create-time {
         description
-          "Creation timestamp of this Virtual Network 
-          Function.  The timestamp is expressed as 
+          "Creation timestamp of this Virtual Network
+          Function.  The timestamp is expressed as
           seconds since unix epoch - 1970-01-01T00:00:00Z";
 
         type uint32;
           seconds since unix epoch - 1970-01-01T00:00:00Z";
 
         type uint32;
@@ -213,7 +213,9 @@ module vnfr
       }
 
       // Use parameters provided here to configure this VNF
       }
 
       // Use parameters provided here to configure this VNF
-      uses manotypes:vnf-configuration;
+      container vnf-configuration {
+        uses manotypes:vca-configuration;
+      }
 
       // Mainly used by Mon-params & dashboard url
       container mgmt-interface {
 
       // Mainly used by Mon-params & dashboard url
       container mgmt-interface {
@@ -351,6 +353,10 @@ module vnfr
 
         uses manotypes:supplemental-boot-data;
 
 
         uses manotypes:supplemental-boot-data;
 
+        container vdu-configuration {
+          uses manotypes:vca-configuration;
+        }
+
         list volumes {
           key "name";
 
         list volumes {
           key "name";
 
@@ -445,7 +451,7 @@ module vnfr
         }
         leaf operational-status {
           description
         }
         leaf operational-status {
           description
-            "The operational status of the VDU 
+            "The operational status of the VDU
               init                : The VDU has just started.
               vm-init-phase       : The VDUs in the VNF is being created in VIM.
               vm-alloc-pending    : The  VM alloc is pending in VIM
               init                : The VDU has just started.
               vm-init-phase       : The VDUs in the VNF is being created in VIM.
               vm-alloc-pending    : The  VM alloc is pending in VIM
@@ -566,4 +572,3 @@ module vnfr
     }
   }
 }
     }
   }
 }
-