Refactor manotypes:vnf-configuration
[osm/IM.git] / models / yang / mano-types.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");
@@ -118,26 +118,26 @@ module mano-types
       type boolean;
     }
   }
-  
+
   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;
       }
+
       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;
@@ -165,7 +165,7 @@ module mano-types
             identifies an image uploaded to the CAL.
             ";
       type string;
-    } 
+    }
   }
   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
-              "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
-            "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
-          configuration agent for this VNF.";
+          configuration agent for this VNF or VDU.";
         key "name";
 
         leaf name {
@@ -270,7 +293,7 @@ module mano-types
         uses initial-config;
       }
     }
-  } // END - grouping vnf-configuration
+  } // END - grouping vca-configuration
 
   typedef virtual-link-type {
     description
@@ -694,7 +717,7 @@ module mano-types
         description "Number of threads per cores on the host.";
         type uint64;
       }
-      
+
       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;
@@ -938,7 +961,7 @@ module mano-types
         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";
@@ -1666,7 +1689,7 @@ module mano-types
     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;
     }
@@ -1709,12 +1732,12 @@ module mano-types
       enum openvim;
     }
   }
-  
+
   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";
@@ -1727,13 +1750,13 @@ module mano-types
       }
     }
   }
-  
+
   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 {
@@ -1756,7 +1779,7 @@ module mano-types
       case openmano {
         leaf openmano-construct {
           type empty;
-        }        
+        }
       }
       case vsphere {
         leaf vsphere-construct {
@@ -1775,7 +1798,7 @@ module mano-types
       }
     }
   }
-  
+
   grouping placement-group-info {
     description "";
 
@@ -1791,7 +1814,7 @@ module mano-types
                    behind this placement group. This is for human consumption only";
       type string;
     }
-    
+
     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 {
-      
+
       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;
@@ -1873,19 +1896,19 @@ module mano-types
       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;
       }
-      
+
       leaf description {
         description "Description for IP profile";
         type string;
       }
-      
+
       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;
-      } 
+      }
     }
   }