summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--osdf/models/policy/placement/tosca/optimizationPolicy-v20181031.yml2
-rw-r--r--test/policy-local-files/Distance_vFW_1.json2
-rw-r--r--test/policy-local-files/QueryPolicy_vFW.json2
-rw-r--r--test/policy-local-files/hpa_policy_vFW_1.json27
-rwxr-xr-xtest/policy-local-files/pwt-it-policies/Distance_vFW_1.json22
-rwxr-xr-xtest/policy-local-files/pwt-it-policies/Placement_Optimization_1.json55
-rwxr-xr-xtest/policy-local-files/pwt-it-policies/QueryPolicy_vFW.json21
-rwxr-xr-xtest/policy-local-files/pwt-it-policies/hpa_policy_vFW_1.json214
-rwxr-xr-xtest/policy-local-files/pwt-it-policies/vnfPolicy_vFW.json29
-rw-r--r--test/policy-local-files/vnfPolicy_vFW.json4
10 files changed, 372 insertions, 6 deletions
diff --git a/osdf/models/policy/placement/tosca/optimizationPolicy-v20181031.yml b/osdf/models/policy/placement/tosca/optimizationPolicy-v20181031.yml
index 2c7e6c7..40678c3 100644
--- a/osdf/models/policy/placement/tosca/optimizationPolicy-v20181031.yml
+++ b/osdf/models/policy/placement/tosca/optimizationPolicy-v20181031.yml
@@ -62,7 +62,7 @@ data_types:
resources:
type: string
required: true
- customerLocation:
+ customerLocationInfo:
type: string
required: true
parameter:
diff --git a/test/policy-local-files/Distance_vFW_1.json b/test/policy-local-files/Distance_vFW_1.json
index 8c94f37..f6cb198 100644
--- a/test/policy-local-files/Distance_vFW_1.json
+++ b/test/policy-local-files/Distance_vFW_1.json
@@ -15,7 +15,7 @@
},
"identity": "distance-vFW",
"resources": ["vFW"],
- "policyScope": ["vFW", "US", "INTERNATIONAL", "ip"],
+ "policyScope": ["vfw", "us", "international", "ip"],
"policyType": "distance_to_location",
"applicableResources": "any"
}
diff --git a/test/policy-local-files/QueryPolicy_vFW.json b/test/policy-local-files/QueryPolicy_vFW.json
index 75ed450..443a82a 100644
--- a/test/policy-local-files/QueryPolicy_vFW.json
+++ b/test/policy-local-files/QueryPolicy_vFW.json
@@ -13,7 +13,7 @@
{"attribute":"customerLatitude", "attribute_location": "customerLatitude"},
{"attribute":"customerLongitude", "attribute_location": "customerLongitude"}
],
- "policyScope": ["vFW", "US", "INTERNATIONAL", "ip"],
+ "policyScope": ["vfw", "us", "international", "ip"],
"policyType": "request_param_query",
"serviceName": "vFW",
"identity": "vFW_Query_Policy"
diff --git a/test/policy-local-files/hpa_policy_vFW_1.json b/test/policy-local-files/hpa_policy_vFW_1.json
index f2306d3..4a81dc3 100644
--- a/test/policy-local-files/hpa_policy_vFW_1.json
+++ b/test/policy-local-files/hpa_policy_vFW_1.json
@@ -11,7 +11,7 @@
"content": {
"resources": ["vFW"],
"identity": "hpa-vFW",
- "policyScope": ["vFW", "US", "INTERNATIONAL", "ip"],
+ "policyScope": ["vfw", "us", "international", "ip"],
"policyType": "hpa",
"flavorFeatures": [
{
@@ -183,6 +183,31 @@
]
}
]
+ },
+ {
+ "id": "vfw_3",
+ "type": "vnfc",
+ "directives": [
+ {
+ "type": "flavor_directives",
+ "attributes": [
+ {
+ "attribute_name": "label_3",
+ "attribute_value": ""
+ }
+ ]
+ }
+ ],
+ "flavorProperties": [
+ {
+ "hpa-feature": "basicCapabilities",
+ "hpa-version": "v1",
+ "architecture": "generic",
+ "mandatory": "True",
+ "directives": [],
+ "hpa-feature-attributes": []
+ }
+ ]
}
]
}
diff --git a/test/policy-local-files/pwt-it-policies/Distance_vFW_1.json b/test/policy-local-files/pwt-it-policies/Distance_vFW_1.json
new file mode 100755
index 0000000..12c24da
--- /dev/null
+++ b/test/policy-local-files/pwt-it-policies/Distance_vFW_1.json
@@ -0,0 +1,22 @@
+{
+ "service": "distancePolicy",
+ "policyName": "OSDF_CASABLANCA.Distance_vFW_1",
+ "description": "Distance Policy for vFW",
+ "templateVersion": "OpenSource.version.1",
+ "version": "test1",
+ "priority": "3",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "distanceProperties": {
+ "locationInfo": "customer_loc",
+ "distance": { "value": "100", "operator": "<", "unit": "km" }
+ },
+ "identity": "distance-vFW",
+ "resources": ["vFW", "7400fd06C75f4a44A68f"],
+ "policyScope": ["vfw", "us", "international", "ip"],
+ "policyType": "distance_to_location",
+ "applicableResources": "any"
+ }
+}
diff --git a/test/policy-local-files/pwt-it-policies/Placement_Optimization_1.json b/test/policy-local-files/pwt-it-policies/Placement_Optimization_1.json
new file mode 100755
index 0000000..8701497
--- /dev/null
+++ b/test/policy-local-files/pwt-it-policies/Placement_Optimization_1.json
@@ -0,0 +1,55 @@
+{
+ "service": "optimizationPolicy",
+ "policyName": "OSDF_CASABLANCA.Placement_Optimization_1",
+ "description": "Placement Optimization Policy for vGMuxInfra",
+ "templateVersion": "OpenSource.version.1",
+ "version": "test1",
+ "priority": "5",
+ "riskType": "test",
+ "riskLevel": "3",
+ "guard": "False",
+ "content": {
+ "objectiveParameter": {
+ "parameterAttributes": [
+ {
+ "resources": ["vGMuxInfra"],
+ "customerLocationInfo": "customer_loc",
+ "parameter": "distance",
+ "weight": "1",
+ "operator": "product"
+ },
+ {
+ "resources": ["vG"],
+ "customerLocationInfo": "customer_loc",
+ "parameter": "distance",
+ "weight": "1",
+ "operator": "product"
+ },
+ {
+ "resources": ["vG"],
+ "parameter": "hpa_score",
+ "weight": "200",
+ "operator": "product"
+ },
+ {
+ "resources": ["vFW", "7400fd06C75f4a44A68f"],
+ "customerLocationInfo": "customer_loc",
+ "parameter": "distance",
+ "weight": "100",
+ "operator": "product"
+ },
+ {
+ "resources": ["vFW", "7400fd06C75f4a44A68f"],
+ "parameter": "hpa_score",
+ "weight": "200",
+ "operator": "product"
+ }
+ ],
+ "operator": "sum"
+ },
+ "identity": "optimization",
+ "policyScope": ["vcpe", "us", "international", "ip", "vGMuxInfra", "vG", "vfw"],
+ "policyType": "placement_optimization",
+ "objective": "minimize"
+ }
+}
diff --git a/test/policy-local-files/pwt-it-policies/QueryPolicy_vFW.json b/test/policy-local-files/pwt-it-policies/QueryPolicy_vFW.json
new file mode 100755
index 0000000..443a82a
--- /dev/null
+++ b/test/policy-local-files/pwt-it-policies/QueryPolicy_vFW.json
@@ -0,0 +1,21 @@
+{
+ "service": "queryPolicy",
+ "policyName": "OSDF_CASABLANCA.QueryPolicy_vFW",
+ "description": "Query policy for vFW",
+ "templateVersion": "OpenSource.version.1",
+ "version": "test1",
+ "priority": "3",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "queryProperties": [
+ {"attribute":"customerLatitude", "attribute_location": "customerLatitude"},
+ {"attribute":"customerLongitude", "attribute_location": "customerLongitude"}
+ ],
+ "policyScope": ["vfw", "us", "international", "ip"],
+ "policyType": "request_param_query",
+ "serviceName": "vFW",
+ "identity": "vFW_Query_Policy"
+ }
+}
diff --git a/test/policy-local-files/pwt-it-policies/hpa_policy_vFW_1.json b/test/policy-local-files/pwt-it-policies/hpa_policy_vFW_1.json
new file mode 100755
index 0000000..7d72485
--- /dev/null
+++ b/test/policy-local-files/pwt-it-policies/hpa_policy_vFW_1.json
@@ -0,0 +1,214 @@
+{
+ "service": "hpaPolicy",
+ "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_1",
+ "description": "HPA policy for vFW",
+ "templateVersion": "OpenSource.version.1",
+ "version": "test1",
+ "priority": "3",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "resources": ["vFW", "7400fd06C75f4a44A68f"],
+ "identity": "hpa-vFW",
+ "policyScope": ["vfw", "us", "international", "ip"],
+ "policyType": "hpa",
+ "flavorFeatures": [
+ {
+ "flavorProperties": [
+ {
+ "architecture": "generic",
+ "directives": [],
+ "hpa-version": "v1",
+ "hpa-feature-attributes": [
+ {
+ "unit": "",
+ "operator": ">=",
+ "hpa-attribute-value": "2",
+ "hpa-attribute-key": "numVirtualCpu"
+ },
+ {
+ "unit": "MB",
+ "operator": ">=",
+ "hpa-attribute-value": "8",
+ "hpa-attribute-key": "virtualMemSize"
+ }
+ ],
+ "hpa-feature": "basicCapabilities",
+ "mandatory": "True"
+ },
+ {
+ "architecture": "generic",
+ "directives": [],
+ "hpa-version": "v1",
+ "hpa-feature-attributes": [
+ {
+ "unit": "",
+ "operator": "=",
+ "hpa-attribute-value": "2",
+ "hpa-attribute-key": "numaNodes"
+ },
+ {
+ "operator": "=",
+ "hpa-attribute-value": "2",
+ "hpa-attribute-key": "numaCpu-0"
+ },
+ {
+ "operator": "=",
+ "hpa-attribute-value": "4",
+ "hpa-attribute-key": "numaCpu-1"
+ },
+ {
+ "unit": "GB",
+ "operator": "=",
+ "hpa-attribute-value": "2",
+ "hpa-attribute-key": "numaMem-0"
+ },
+ {
+ "unit": "GB",
+ "operator": "=",
+ "hpa-attribute-value": "4",
+ "hpa-attribute-key": "numaMem-1"
+ }
+ ],
+ "hpa-feature": "numa",
+ "mandatory": "True"
+ },
+ {
+ "architecture": "generic",
+ "directives": [],
+ "hpa-version": "v1",
+ "hpa-feature-attributes": [
+ {
+ "unit": "MB",
+ "operator": "=",
+ "hpa-attribute-value": "2",
+ "hpa-attribute-key": "memoryPageSize"
+ },
+ {
+ "operator": "=",
+ "hpa-attribute-value": "4",
+ "hpa-attribute-key": "numberOfPages"
+ }
+ ],
+ "hpa-feature": "hugePages",
+ "mandatory": "True"
+ },
+ {
+ "architecture": "Intel64",
+ "hpa-feature": "sriovNICNetwork",
+ "hpa-version": "v1",
+ "directives": [
+ {
+ "type": "sriovNICNetwork_directives",
+ "attributes": [
+ {
+ "attribute_name": "oof_returned_vnic_type_for_firewall_protected",
+ "attribute_value": "direct"
+ }
+ ]
+ }
+ ],
+ "hpa-feature-attributes": [
+ {
+ "unit": "",
+ "operator": "=",
+ "hpa-attribute-value": "1",
+ "hpa-attribute-key": "pciCount"
+ },
+ {
+ "unit": "",
+ "operator": "=",
+ "hpa-attribute-value": "1234",
+ "hpa-attribute-key": "pciVendorId"
+ },
+ {
+ "unit": "",
+ "operator": "=",
+ "hpa-attribute-value": "7890",
+ "hpa-attribute-key": "pciDeviceId"
+ }
+ ],
+ "score": "100",
+ "mandatory": "False"
+ }
+ ],
+ "type": "vnfc",
+ "id": "vfw_1",
+ "directives": [
+ {
+ "type": "flavor_directives",
+ "attributes": [
+ {
+ "attribute_name": "label_1",
+ "attribute_value": ""
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "flavorProperties": [
+ {
+ "architecture": "generic",
+ "directives": [],
+ "hpa-version": "v1",
+ "hpa-feature-attributes": [
+ {
+ "operator": ">=",
+ "hpa-attribute-value": "1",
+ "hpa-attribute-key": "numVirtualCpu"
+ },
+ {
+ "unit": "GB",
+ "operator": ">=",
+ "hpa-attribute-value": "7",
+ "hpa-attribute-key": "virtualMemSize"
+ }
+ ],
+ "hpa-feature": "basicCapabilities",
+ "mandatory": "True"
+ }
+ ],
+ "type": "vnfc",
+ "id": "vfw_2",
+ "directives": [
+ {
+ "type": "flavor_directives",
+ "attributes": [
+ {
+ "attribute_name": "label_2",
+ "attribute_value": ""
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "id": "vfw_3",
+ "type": "vnfc",
+ "directives": [
+ {
+ "type": "flavor_directives",
+ "attributes": [
+ {
+ "attribute_name": "label_3",
+ "attribute_value": ""
+ }
+ ]
+ }
+ ],
+ "flavorProperties": [
+ {
+ "hpa-feature": "basicCapabilities",
+ "hpa-version": "v1",
+ "architecture": "generic",
+ "mandatory": "True",
+ "directives": [],
+ "hpa-feature-attributes": []
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/test/policy-local-files/pwt-it-policies/vnfPolicy_vFW.json b/test/policy-local-files/pwt-it-policies/vnfPolicy_vFW.json
new file mode 100755
index 0000000..7180345
--- /dev/null
+++ b/test/policy-local-files/pwt-it-policies/vnfPolicy_vFW.json
@@ -0,0 +1,29 @@
+{
+ "service": "vnfPolicy",
+ "policyName": "OSDF_CASABLANCA.vnfPolicy_vFW",
+ "description": "vnfPolicy",
+ "templateVersion": "OpenSource.version.1",
+ "version": "test1",
+ "priority": "6",
+ "riskType": "test",
+ "riskLevel": "3",
+ "guard": "False",
+ "content": {
+ "identity": "vnf_vFW",
+ "policyScope": ["vfw", "us", "international", "ip"],
+ "policyType": "vnfPolicy",
+ "resources": ["vFW", "7400fd06C75f4a44A68f"],
+ "applicableResources": "any",
+ "vnfProperties": [
+ {
+ "inventoryProvider": "aai",
+ "serviceType": "",
+ "inventoryType": "cloud",
+ "customerId": "",
+ "orchestrationStatus": "",
+ "equipmentRole": ""
+
+ }
+ ]
+ }
+}
diff --git a/test/policy-local-files/vnfPolicy_vFW.json b/test/policy-local-files/vnfPolicy_vFW.json
index 4336aef..a29d927 100644
--- a/test/policy-local-files/vnfPolicy_vFW.json
+++ b/test/policy-local-files/vnfPolicy_vFW.json
@@ -10,11 +10,11 @@
"guard": "False",
"content": {
"identity": "vnf_vFW",
- "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vFW"],
+ "policyScope": ["vfw", "us", "international", "ip"],
"policyType": "vnfPolicy",
"resources": ["vFW"],
"applicableResources": "any",
- "vnfProperties": [
+ "vnfProperties": [
{
"inventoryProvider": "aai",
"serviceType": "",