add aggregation policy for NSI selection
[optf/osdf.git] / test / policy-local-files / hpa_policy_vG_1.json
index f50ed6d..59ba4b1 100644 (file)
@@ -1,26 +1,48 @@
 {
-    "service": "hpaPolicy",
-    "policyName": "OSDF_R2.hpa_policy_vG_1",
-    "description": "HPA policy for vG",
-    "templateVersion": "OpenSource.version.1",
-    "version": "test1",
-    "priority": "3",
-    "riskType": "test",
-    "riskLevel": "2",
-    "guard": "False",
-    "content": {
-      "resources": "vG",
-      "identity": "hpaPolicy_vG",
-      "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"],
-      "policyType": "hpaPolicy",
+  "OSDF_FRANKFURT.hpa_policy_vG_1": {
+    "type": "onap.policies.optimization.resource.HpaPolicy",
+    "version": "1.0.0",
+    "type_version": "1.0.0",
+    "metadata": {
+      "policy-id": "OSDF_FRANKFURT.hpa_policy_vG_1",
+      "policy-version": 1
+    },
+    "properties": {
+      "scope": [
+        "OSDF_FRANKFURT" 
+      ],
+      "services": [
+        "vCPE"
+      ],
+      "resources": [
+        "vG"
+      ],
+      "geography": [
+        "US",
+        "INTERNATIONAL"
+      ],
+      "identity": "hpa-vG",
       "flavorFeatures": [
         {
-          "flavorLabel": "flavor_label_vm_01",
-          "flavorProperties":[
+          "id": "vg_1",
+          "type": "vnfc",
+          "directives": [
             {
+              "type": "flavor_directives",
+              "attributes": [
+                {
+                  "attribute_name": "flavor_label_vm_01",
+                  "attribute_value": ""
+                }
+              ]
+            }
+          ],
+          "flavorProperties": [
+           {  
               "hpa-feature" : "cpuTopology",
               "mandatory" : "True",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                 {"hpa-attribute-key":"numCpuSockets", "hpa-attribute-value": "2","operator": ">=", "unit": ""},
                 {"hpa-attribute-key":"numCpuSockets", "hpa-attribute-value": "4","operator": "<=", "unit": ""},
                 {"hpa-attribute-key":"numCpuThreads", "hpa-attribute-value": "8", "operator":"<=", "unit": ""}
               ]
             },
-            {
-              "hpa-feature" : "basicCapabilities",
-              "mandatory" : "True",
+           {
+              "hpa-feature": "basicCapabilities",
+              "mandatory": true,
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
-                {"hpa-attribute-key": "numVirtualCpu", "hpa-attribute-value": "6", "operator": "=", "unit": ""},
-                {"hpa-attribute-key": "virtualMemSize", "hpa-attribute-value":"6", "operator": "=", "unit": "GB"}
+                {
+                  "hpa-attribute-key": "numVirtualCpu",
+                  "hpa-attribute-value": 6,
+                  "operator": [
+                    "="
+                  ],
+                  "unit": ""
+                },
+                {
+                  "hpa-attribute-key": "virtualMemSize",
+                  "hpa-attribute-value": 6,
+                  "operator": [
+                    "="
+                  ],
+                  "unit": ""
+                }
               ]
             },
             {
-              "hpa-feature" : "ovsDpdk",
-              "mandatory" : "False",
-              "score" : "3",
+              "hpa-feature": "ovsDpdk",
+              "mandatory": false,
+              "score": 3,
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
-                 {"hpa-attribute-key":"dataProcessingAccelerationLibrary", "hpa-attribute-value":"ovsDpdk_version", "operator": "=", "unit":""}
+                {
+                  "hpa-attribute-key": "dataProcessingAccelerationLibrary",
+                  "hpa-attribute-value": "ovsDpdk_version",
+                  "operator": [
+                    "="
+                  ],
+                  "unit": ""
+                }
               ]
             },
             {
-              "hpa-feature" : "cpuInstructionSetExtensions",
-              "mandatory" : "True",
+              "hpa-feature": "cpuInstructionSetExtensions",
+              "mandatory": true,
               "architecture": "INTEL-64",
+              "directives": [],
               "hpa-feature-attributes": [
-                {"hpa-attribute-key":"instructionSetExtensions", "hpa-attribute-value":["<CPUINST>", "<CPUINST>"], "operator": "ALL", "unit":""}
+                {
+                  "hpa-attribute-key": "instructionSetExtensions",
+                  "hpa-attribute-value": [
+                    "<CPUINST>",
+                    "<CPUINST>"
+                  ],
+                  "operator": [
+                    "ALL"
+                  ],
+                  "unit": ""
+                }
               ]
             }
           ]
         },
         {
-          "flavorLabel": "flavor_label_vm_02",
+          "id": "vg_2",
+          "type": "vnfc",
+          "directives": [
+            {
+              "type": "flavor_directives",
+              "attributes": [
+                {
+                  "attribute_name": "flavor_label_vm_02",
+                  "attribute_value": ""
+                }
+              ]
+            }
+          ],
           "flavorProperties":[
             {
               "hpa-feature" : "cpuPinningy",
               "mandatory" : "True",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                 {"hpa-attribute-key":"logicalCpuThreadPinningPolicy", "hpa-attribute-value":"<CPUTHREADPOLICY>", "operator": "=", "unit":""},
                 {"hpa-attribute-key":"logicalCpuPinningPolicy", "hpa-attribute-value": "<CPUPOLICY>","operator": "=", "unit":""}
               ]
             },
           {
+ {
               "hpa-feature" : "basicCapabilities",
               "mandatory" : "True",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                 {"hpa-attribute-key": "numVirtualCpu", "hpa-attribute-value": "6", "operator": "=", "unit": ""},
                 {"hpa-attribute-key": "virtualMemSize", "hpa-attribute-value":"6", "operator": "=", "unit": "GB"}
               "mandatory" : "False",
               "score" : "5",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                 {"hpa-attribute-key": "diskSize", "hpa-attribute-value": "2", "operator": "=", "unit": "GB"},
                 {"hpa-attribute-key": "ephemeralDiskSize", "hpa-attribute-value": "2", "operator": "=", "unit": "GB"},
               ]
             },
             {
-              "hpa-feature" : "pcie",
+              "hpa-feature" : "pciePassthrough",
               "mandatory" : "True",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                 {"hpa-attribute-key": "pciCount", "hpa-attribute-value": "2", "operator": "=", "unit": ""},
                 {"hpa-attribute-key": "pciVendorId", "hpa-attribute-value":"8086", "operator": "=", "unit": ""},
-                {"hpa-attribute-key": "pciDeviceId", "hpa-attribute-value": "2", "operator": "=", "unit": ""},
-                {"hpa-attribute-key": "functionType", "hpa-attribute-value": "<PCITYPEVALUE>","operator": "=", "unit": ""}
+                {"hpa-attribute-key": "pciDeviceId", "hpa-attribute-value": "2", "operator": "=", "unit": ""}
               ]
             }
-          ]
+]
         },
         {
-          "flavorLabel": "flavor_label_vm_03",
+          "id": "vg_3",
+          "type": "vnfc",
+          "directives": [
+            {
+              "type": "flavor_directives",
+              "attributes": [
+                {
+                  "attribute_name": "flavor_label_vm_03",
+                  "attribute_value": ""
+                }
+              ]
+            }
+          ],
           "flavorProperties":[
             {
               "hpa-feature" : "numa",
               "mandatory" : "False",
               "score" : "5",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                 {"hpa-attribute-key": "numaNodes", "hpa-attribute-value": "2", "operator": "=", "unit": ""},
                 {"hpa-attribute-key": "numaCpu-0", "hpa-attribute-value":"2", "operator": "=", "unit": ""},
                 {"hpa-attribute-key": "numaCpu-1", "hpa-attribute-value":"4", "operator": "=", "unit": ""},
                 {"hpa-attribute-key": "numaMem-1", "value": "4096", "operator": "=", "unit": "MB"}
               ]
-            },
+},
             {
               "hpa-feature" : "basicCapabilities",
               "mandatory" : "True",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                 {"hpa-attribute-key": "numVirtualCpu", "hpa-attribute-value": "6", "operator": "=", "unit": ""},
                 {"hpa-attribute-key": "virtualMemSize", "hpa-attribute-value":"6", "operator": "=", "unit": "GB"}
               "mandatory" : "False",
               "score" : "7",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                  {"hpa-attribute-key": "memoryPageSize", "hpa-attribute-value": "<MEMORYPAGESIZE>", "operator": "=", "unit": ""}
               ]
         }
       ]
     }
+  }
 }