diff options
author | Sastry Isukapalli <sastry@research.att.com> | 2018-03-26 18:06:23 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-03-26 18:06:23 +0000 |
commit | 215b19360f73242f2348c812c0afab7d77c083a8 (patch) | |
tree | 7673df4f4d235e02dc0f565d72a8726a5175065f | |
parent | 1989be6667eeb3b70e959c688c6b423b30dde78a (diff) | |
parent | dcdf9d8f98b6f472b37a264d93ede2845e39853c (diff) |
Merge "Inserted policy tosca models and examples"
21 files changed, 1105 insertions, 0 deletions
diff --git a/osdf/models/policy/placement/tosca/affinityPolicy-v20180326.yml b/osdf/models/policy/placement/tosca/affinityPolicy-v20180326.yml new file mode 100644 index 0000000..4db64db --- /dev/null +++ b/osdf/models/policy/placement/tosca/affinityPolicy-v20180326.yml @@ -0,0 +1,58 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + policy.nodes.affinityPolicy: + derived_from: policy.nodes.Root + properties: + policyScope: + type: list + description: scope where the policy is applicable + required: true + matchable: true + entry_schema: + type: string + policyType: + type: list + description: type of a policy + required: true + matchable: true + entry_schema: + type: string + consraints: + - valid_values: + - affinityPolicy + identity: + type: string + required: true + applicableResources: + type: list + required: true + entry_schema: + type: string + constraints: + - valid_values: + - any + - all + affinityProperties: + type: policy.data.affinityProperties_properties + required: true + resources: + type: list + required: true + entry_schema: + type: string +data_types: + policy.data.affinityProperties_properties: + derived_from: tosca.nodes.Root + properties: + qualifier: + type: list + required: true + entry_schema: + type: string + constraints: + - valid_values: + - same + - different + category: + type: string + required: true diff --git a/osdf/models/policy/placement/tosca/distancePolicy-v20180326.yml b/osdf/models/policy/placement/tosca/distancePolicy-v20180326.yml new file mode 100644 index 0000000..53d15dd --- /dev/null +++ b/osdf/models/policy/placement/tosca/distancePolicy-v20180326.yml @@ -0,0 +1,78 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + policy.nodes.distancePolicy: + derived_from: policy.nodes.Root + properties: + policyScope: + type: list + description: scope where the policy is applicable + required: true + matchable: true + entry_schema: + type: string + policyType: + type: list + description: type of a policy + required: true + matchable: true + entry_schema: + type: string + consraints: + - valid_values: + - distancePolicy + identity: + type: string + required: true + resources: + type: list + required: true + entry_schema: + type: string + applicableResources: + type: list + required: true + entry_schema: + type: string + constraints: + - valid_values: + - any + - all + distanceProperties: + type: policy.data.distanceProperties_properties + required: true +data_types: + policy.data.distanceProperties_properties: + derived_from: tosca.nodes.Root + properties: + locationInfo: + type: string + required: true + distance: + type: policy.data.distance_properties + required: true + policy.data.distance_properties: + derived_from: tosca.nodes.Root + properties: + value: + type: string + required: true + operator: + type: list + required: true + entry_schema: + type: string + constraints: + - valid_values: + - < + - <= + - '>' + - '>=' + - '=' + unit: + type: list + required: true + entry_schema: + type: string + constraints: + - valid_values: + - km diff --git a/osdf/models/policy/placement/tosca/hpaPolicy-v20180326.yml b/osdf/models/policy/placement/tosca/hpaPolicy-v20180326.yml new file mode 100644 index 0000000..24906a6 --- /dev/null +++ b/osdf/models/policy/placement/tosca/hpaPolicy-v20180326.yml @@ -0,0 +1,96 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + policy.nodes.hpaPolicy: + derived_from: policy.nodes.Root + properties: + policyScope: + type: list + description: scope where the policy is applicable + required: true + matchable: true + entry_schema: + type: string + policyType: + type: list + description: type of a policy + required: true + matchable: true + entry_schema: + type: string + consraints: + - valid_values: + - hpaPolicy + resource: + type: string + required: true + identity: + type: string + required: true + flavorFeatures: + type: list + required: true + entry_schema: + - type: policy.data.flavorFeatures_properties +data_types: + policy.data.flavorFeatures_properties: + derived_from: tosca.nodes.Root + properties: + flavorLabel: + type: string + required: true + flavorProperties: + type: list + required: true + entry_schema: + type: policy.data.flavorProperties_properties + policy.data.flavorProperties_properties: + derived_from: tosca.nodes.Root + properties: + hpa-feature: + type: string + required: true + mandatory: + type: string + required: true + score: + type: string + required: true + architecture: + type: string + required: true + hpa-version: + type: string + required: true + hpa-feature-attributes: + type: list + required: true + entry_schema: + type: policy.data.hpa-feature-attributes_properties + policy.data.hpa-feature-attributes_properties: + derived_from: tosca.nodes.Root + properties: + hpa-attribute-key: + type: string + required: true + hpa-attribute-value: + type: string + required: true + operator: + type: list + required: true + entry_schema: + type: string + constraints: + - valid_values: + - < + - <= + - '>' + - '>=' + - '=' + - '!=' + - any + - all + - subset + unit: + type: string + required: true diff --git a/osdf/models/policy/placement/tosca/optimizationPolicy-v20180326.yml b/osdf/models/policy/placement/tosca/optimizationPolicy-v20180326.yml new file mode 100644 index 0000000..0a3b94f --- /dev/null +++ b/osdf/models/policy/placement/tosca/optimizationPolicy-v20180326.yml @@ -0,0 +1,85 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + policy.nodes.optimizationPolicy: + derived_from: policy.nodes.Root + properties: + policyScope: + type: list + description: scope where the policy is applicable + required: true + matchable: true + entry_schema: + type: string + policyType: + type: list + description: type of a policy + required: true + matchable: true + entry_schema: + type: string + consraints: + - valid_values: + - optimizationPolicy + identity: + type: string + required: true + objective: + type: list + required: true + entry_schema: + type: string + constraints: + - valid_values: + - minimize + - maximize + objectiveParameters: + type: policy.data.objectiveParameters_properties + required: true +data_types: + policy.data.objectiveParameters_properties: + derived_from: tosca.nodes.Root + properties: + parameterAttributes: + type: list + required: true + entry_schema: + type: policy.data.parameterAttributes_properties + operator: + type: list + required: true + entry_schema: + type: string + constraints: + - valid_values: + - '*' + - + + - '-' + - / + - '%' + policy.data.parameterAttributes_properties: + derived_from: tosca.nodes.Root + properties: + resources: + type: string + required: true + customerLocation: + type: string + required: true + parameter: + type: string + required: true + weight: + type: string + required: true + operator: + type: list + required: true + entry_schema: + type: string + constraints: + - valid_values: + - '*' + - + + - '-' + - / + - '%' diff --git a/osdf/models/policy/placement/tosca/queryPolicy-v20180326.yml b/osdf/models/policy/placement/tosca/queryPolicy-v20180326.yml new file mode 100644 index 0000000..2488769 --- /dev/null +++ b/osdf/models/policy/placement/tosca/queryPolicy-v20180326.yml @@ -0,0 +1,43 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + policy.nodes.queryPolicy: + derived_from: policy.nodes.Root + properties: + policyScope: + type: list + description: scope where the policy is applicable + required: true + matchable: true + entry_schema: + type: string + policyType: + type: list + description: type of a policy + required: true + matchable: true + entry_schema: + type: string + consraints: + - valid_values: + - queryPolicy + identity: + type: string + required: true + queryProperties: + type: list + required: true + entry_schema: + - type: policy.data.queryProperties_properties +data_types: + policy.data.queryProperties_properties: + derived_from: tosca.nodes.Root + properties: + attribute: + type: string + required: true + value: + type: string + required: true + attribute_location: + type: string + required: true diff --git a/osdf/models/policy/placement/tosca/subscriberPolicy-v20180326.yml b/osdf/models/policy/placement/tosca/subscriberPolicy-v20180326.yml new file mode 100644 index 0000000..4658f77 --- /dev/null +++ b/osdf/models/policy/placement/tosca/subscriberPolicy-v20180326.yml @@ -0,0 +1,47 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + policy.nodes.subscriberPolicy: + derived_from: policy.nodes.Root + properties: + policyScope: + type: list + description: scope where the policy is applicable + required: true + matchable: true + entry_schema: + type: string + policyType: + type: list + description: type of a policy + required: true + matchable: true + entry_schema: + type: string + consraints: + - valid_values: + - subscriberPolicy + identity: + type: string + required: true + properties: + type: policy.data.properties_properties + required: true +data_types: + policy.data.properties_properties: + derived_from: tosca.nodes.Root + properties: + subscriberName: + type: list + required: true + entry_schema: + type: string + subscriberRole: + type: list + required: true + entry_schema: + type: string + provStatus: + type: list + required: true + entry_schema: + type: string diff --git a/osdf/models/policy/placement/tosca/vim_fit-v20180326.yml b/osdf/models/policy/placement/tosca/vim_fit-v20180326.yml new file mode 100644 index 0000000..d857a2d --- /dev/null +++ b/osdf/models/policy/placement/tosca/vim_fit-v20180326.yml @@ -0,0 +1,52 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + policy.nodes.vim_fit: + derived_from: policy.nodes.Root + properties: + policyScope: + type: list + description: scope where the policy is applicable + required: true + matchable: true + entry_schema: + type: string + policyType: + type: list + description: type of a policy + required: true + matchable: true + entry_schema: + type: string + consraints: + - valid_values: + - vim_fit + identity: + type: string + required: true + applicableResources: + type: list + required: true + entry_schema: + type: string + constraints: + - valid_values: + - any + - all + resources: + type: list + required: true + entry_schema: + type: string + capacityProperties: + type: policy.data.capacityProperties_properties + required: true +data_types: + policy.data.capacityProperties_properties: + derived_from: tosca.nodes.Root + properties: + controller: + type: string + required: true + request: + type: string + required: true diff --git a/osdf/models/policy/placement/tosca/vnfPolicy-v20180326.yml b/osdf/models/policy/placement/tosca/vnfPolicy-v20180326.yml new file mode 100644 index 0000000..3880cea --- /dev/null +++ b/osdf/models/policy/placement/tosca/vnfPolicy-v20180326.yml @@ -0,0 +1,68 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + policy.nodes.vnfPolicy: + derived_from: policy.nodes.Root + properties: + policyScope: + type: list + description: scope where the policy is applicable + required: true + matchable: true + entry_schema: + type: string + policyType: + type: list + description: type of a policy + required: true + matchable: true + entry_schema: + type: string + consraints: + - valid_values: + - vnfPolicy + identity: + type: string + required: true + resources: + type: list + required: true + entry_schema: + type: string + applicableResources: + type: list + required: true + entry_schema: + type: string + constraints: + - valid_values: + - any + - all + vnfProperties: + type: list + required: true + entry_schema: + - type: policy.data.vnfProperties_properties +data_types: + policy.data.vnfProperties_properties: + derived_from: tosca.nodes.Root + properties: + inventoryProvider: + type: string + required: true + serviceType: + type: string + required: true + inventoryType: + type: list + required: true + entry_schema: + type: string + constraints: + - valid_values: + - serviceInstanceId + - vnfName + - cloudRegionId + - vimId + customerId: + type: string + required: true diff --git a/test/policy-local-files/has_policies_r2/Affinity_vCPE_1.json b/test/policy-local-files/has_policies_r2/Affinity_vCPE_1.json new file mode 100644 index 0000000..9a9de6b --- /dev/null +++ b/test/policy-local-files/has_policies_r2/Affinity_vCPE_1.json @@ -0,0 +1,37 @@ +{ + "service": "optimizationQueryPolicy", + "policyName": "oofBeijing.queryPolicy_vCPE", + "description": "Optimization query policy for vCPE", + "templateVersion": "0.0.1", + "version": "oofBeijing", + "priority": "3", + "riskType": "test", + "riskLevel": "2", + "guard": "False", + "content": { + "queryProperties": [ + { + "attribute": "locationId", + "value": "orderInfo.customerLocation" + }, + { + "attribute": "id", + "value": "orderInfo.vpnInfo" + }, + { + "attribute": "upstreamBW", + "value": "orderInfo.vpnInfo" + } + ], + "policyScope": [ + "vCPE", + "US", + "INTERNATIONAL", + "ip", + "vGMuxInfra", + "vG", + "optimizationQueryPolicy" + ], + "policyType": "optimizationQueryPolicy" + } +} diff --git a/test/policy-local-files/has_policies_r2/Capacity_vGMuxInfra.json b/test/policy-local-files/has_policies_r2/Capacity_vGMuxInfra.json new file mode 100644 index 0000000..06896c3 --- /dev/null +++ b/test/policy-local-files/has_policies_r2/Capacity_vGMuxInfra.json @@ -0,0 +1,22 @@ +{ + "service": "capacityPolicy", + "policyName": "oofBeijing.capacityPolicy_vGMuxInfra", + "description": "Capacity policy for vGMuxInfra", + "templateVersion": "1702.03", + "version": "oofBeijing", + "priority": "5", + "riskType": "test", + "riskLevel": "2", + "guard": "False", + "content": { + "identity": "capacity_vGMuxInfra", + "policyScope": ["VCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vim_fit"], + "resources": ["vGMuxInfra"], + "capacityProperty": { + "controller": "multicloud", + "request": "{\"vCPU\": 10, \"Memory\": {\"quantity\": {\"get_param\": \"REQUIRED_MEM\"}, \"unit\": \"GB\"}, \"Storage\": {\"quantity\": {\"get_param\": \"REQUIRED_DISK\", \"unit\": \"GB\"}}}" + }, + "policyType": "vim_fit", + "applicableResources": "any" + } +} diff --git a/test/policy-local-files/has_policies_r2/Capacity_vG_1.json b/test/policy-local-files/has_policies_r2/Capacity_vG_1.json new file mode 100644 index 0000000..851ea49 --- /dev/null +++ b/test/policy-local-files/has_policies_r2/Capacity_vG_1.json @@ -0,0 +1,22 @@ +{ + "service": "capacityPolicy", + "policyName": "oofBeijing.capacityPolicy_vG", + "description": "Capacity policy for vG", + "templateVersion": "1702.03", + "version": "oofBeijing", + "priority": "5", + "riskType": "test", + "riskLevel": "2", + "guard": "False", + "content": { + "identity": "capacity_vG", + "policyScope": ["VCPE", "US", "INTERNATIONAL", "ip", "vG", "vim_fit"], + "resources": ["vG"], + "capacityProperty": { + "controller": "multicloud", + "request": "{\"vCPU\": 10, \"Memory\": {\"quantity\": {\"get_param\": \"REQUIRED_MEM\"}, \"unit\": \"GB\"}, \"Storage\": {\"quantity\": {\"get_param\": \"REQUIRED_DISK\", \"unit\": \"GB\"}}}" + }, + "policyType": "vim_fit", + "applicableResources": "any" + } +} diff --git a/test/policy-local-files/has_policies_r2/Distance_vGMuxInfra_1.json b/test/policy-local-files/has_policies_r2/Distance_vGMuxInfra_1.json new file mode 100644 index 0000000..ee7d89e --- /dev/null +++ b/test/policy-local-files/has_policies_r2/Distance_vGMuxInfra_1.json @@ -0,0 +1,22 @@ +{ + "service": "distancePolicy", + "policyName": "oofBeijing.distancePolicy_vGMuxInfra", + "description": "Distance Policy for vGMuxInfra", + "templateVersion": "0.0.1", + "version": "oofBeijing", + "priority": "3", + "riskType": "test", + "riskLevel": "2", + "guard": "False", + "content": { + "distanceProperties": { + "locationInfo": "customer_location", + "distance": { "value": "500", "operator": "<", "unit": "km" } + }, + "identity": "distance-vGMuxInfra", + "resources": ["vGMuxInfra"], + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "distancePolicy"], + "policyType": "distancePolicy", + "applicableResources": "any" + } +} diff --git a/test/policy-local-files/has_policies_r2/Distance_vG_1.json b/test/policy-local-files/has_policies_r2/Distance_vG_1.json new file mode 100644 index 0000000..953dcc3 --- /dev/null +++ b/test/policy-local-files/has_policies_r2/Distance_vG_1.json @@ -0,0 +1,22 @@ +{ + "service": "distancePolicy", + "policyName": "oofBeijing.distancePolicy_vG", + "description": "Distance Policy for vG", + "templateVersion": "0.0.1", + "version": "oofBeijing", + "priority": "3", + "riskType": "test", + "riskLevel": "2", + "guard": "False", + "content": { + "distanceProperties": { + "locationInfo": "customer_location", + "distance": { "value": "1500", "operator": "<", "unit": "km" } + }, + "identity": "distance-vG", + "resources": ["vG"], + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG", "distancePolicy"], + "policyType": "distancePolicy", + "applicableResources": "any" + } +} diff --git a/test/policy-local-files/has_policies_r2/Min_Guarantee_vGMuxInfra_1.json b/test/policy-local-files/has_policies_r2/Min_Guarantee_vGMuxInfra_1.json new file mode 100644 index 0000000..b8f958d --- /dev/null +++ b/test/policy-local-files/has_policies_r2/Min_Guarantee_vGMuxInfra_1.json @@ -0,0 +1,22 @@ +{ + "service": "minGuaranteePolicy", + "policyName": "oofBeijing.minGuaranee_vGMuxInfra", + "description": "Min guarantee policy for vGMuxInfra", + "templateVersion": "1702.03", + "version": "oofBeijing", + "priority": "5", + "riskType": "test", + "riskLevel": "2", + "guard": "False", + "content": { + "identity": "minGuarantee_vGMuxInfra", + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "minGuaranteePolicy"], + "minGuaranteeProperty": { + "cpu": "true", + "memory": "false", + }, + "policyType": "minGuaranteePolicy", + "resources": ["vGMuxInfra"], + "applicableResources": "any" + } +}
\ No newline at end of file diff --git a/test/policy-local-files/has_policies_r2/Placement_Optimization_1.json b/test/policy-local-files/has_policies_r2/Placement_Optimization_1.json new file mode 100644 index 0000000..f8b0a6f --- /dev/null +++ b/test/policy-local-files/has_policies_r2/Placement_Optimization_1.json @@ -0,0 +1,36 @@ +{ + "service": "PlacementOptimizationPolicy", + "policyName": "oofBeijing.PlacementOptimizationPolicy_vGMuxInfra", + "description": "Placement Optimization Policy for vGMuxInfra", + "templateVersion": "1702.03", + "version": "oofBeijing", + "priority": "5", + "riskType": "test", + "riskLevel": "3", + "guard": "False", + "content": { + "objectiveParameter": { + "parameterAttributes": [ + { + "resource": ["vGMuxInfra"], + "customerLocationInfo": "customer_loc", + "parameter": "distance", + "weight": "1", + "operator": "product" + }, + { + "resource": ["vG"], + "customerLocationInfo": "customer_loc", + "parameter": "distance", + "weight": "1", + "operator": "product" + } + ], + "operator": "sum" + }, + "identity": "optimization", + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG", "placementOptimization"], + "policyType": "placementOptimization", + "objective": "minimize" + } +} diff --git a/test/policy-local-files/has_policies_r2/QueryPolicy_vCPE.json b/test/policy-local-files/has_policies_r2/QueryPolicy_vCPE.json new file mode 100644 index 0000000..508d7d6 --- /dev/null +++ b/test/policy-local-files/has_policies_r2/QueryPolicy_vCPE.json @@ -0,0 +1,22 @@ +{ + "service": "optimizationQueryPolicy", + "policyName": "oofBeijing.queryPolicy_vCPE", + "description": "Optimization query policy for vCPE", + "templateVersion": "0.0.1", + "version": "oofBeijing", + "priority": "3", + "riskType": "test", + "riskLevel": "2", + "guard": "False", + "content": { + "queryProperties": [ + {"attribute":"locationId", "attribute_location": "customerLocation", "value": ""}, + {"attribute":"id", "attribute_location": "vpnInfo.vpnId", "value": ""}, + {"attribute":"upstreamBW", "attribute_location": "vpnInfo.upstreamBW", "value": ""}, + {"attribute":"customerLatitude", "attribute_location": "customerLatitude", "value": 32.89748}, + {"attribute":"customerLongitude", "attribute_location": "customerLongitude", "value": -97.040443} + ], + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG", "optimizationQueryPolicy"], + "policyType": "optimizationQueryPolicy" + } +} diff --git a/test/policy-local-files/has_policies_r2/hpa_policy_vGMuxInfra_1.json b/test/policy-local-files/has_policies_r2/hpa_policy_vGMuxInfra_1.json new file mode 100644 index 0000000..7b68578 --- /dev/null +++ b/test/policy-local-files/has_policies_r2/hpa_policy_vGMuxInfra_1.json @@ -0,0 +1,144 @@ +{ + "service": "hpaPolicy", + "policyName": "oofBeijing.hpaPolicy_vGMuxInfra", + "description": "HPA policy for vGMuxInfra", + "templateVersion": "0.0.1", + "version": "1.0", + "priority": "3", + "riskType": "test", + "riskLevel": "2", + "guard": "False", + "content": { + "resources": "vGMuxInfra", + "identity": "hpaPolicy_vGMuxInfra", + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "hpaPolicy"], + "policyType": "hpaPolicy", + "flavorFeatures": [ + { + "flavorLabel": "flavor_label_vm_01", + "flavorProperties":[ + { + "hpa-feature" : "cpuTopology", + "mandatory" : "True", + "architecture": "generic", + "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":"numCpuCores", "hpa-attribute-value": "2", "operator":">=", "unit": ""}, + {"hpa-attribute-key":"numCpuCores", "hpa-attribute-value": "4", "operator":"<=", "unit": ""}, + {"hpa-attribute-key":"numCpuThreads", "hpa-attribute-value": "4", "operator":">=", "unit": ""}, + {"hpa-attribute-key":"numCpuThreads", "hpa-attribute-value": "8", "operator":"<=", "unit": ""} + ] + }, + { + "hpa-feature" : "basicCapabilities", + "mandatory" : "True", + "architecture": "generic", + "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-feature" : "ovsDpdk", + "mandatory" : "False", + "score" : "3", + "architecture": "generic", + "hpa-feature-attributes": [ + {"hpa-attribute-key":"dataProcessingAccelerationLibrary", "hpa-attribute-value":"ovsDpdk_version", "operator": "=", "unit":""} + ] + }, + { + "hpa-feature" : "cpuInstructionSetExtensions", + "mandatory" : "True", + "architecture": "INTEL-64", + "hpa-feature-attributes": [ + {"hpa-attribute-key":"instructionSetExtensions", "hpa-attribute-value":["<CPUINST>", "<CPUINST>"], "operator": "ALL", "unit":""} + ] + } + ] + }, + { + "flavorLabel": "flavor_label_vm_02", + "flavorProperties":[ + { + "hpa-feature" : "cpuPinningy", + "mandatory" : "True", + "architecture": "generic", + "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", + "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-feature" : "localStorage", + "mandatory" : "False", + "score" : "5", + "architecture": "generic", + "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-attribute-key": "swapMemSize", "hpa-attribute-value":"16", "operator": "=", "unit": "MB"} + ] + }, + { + "hpa-feature" : "pcie", + "mandatory" : "True", + "architecture": "generic", + "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": ""} + ] + } + ] + }, + { + "flavorLabel": "flavor_label_vm_03", + "flavorProperties":[ + { + "hpa-feature" : "numa", + "mandatory" : "False", + "score" : "5", + "architecture": "generic", + "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": "numaMem-0", "hpa-attribute-value": "2048", "operator": "=", "unit": "MB"}, + {"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", + "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-feature" : "hugePages", + "mandatory" : "False", + "score" : "7", + "architecture": "generic", + "hpa-feature-attributes": [ + {"hpa-attribute-key": "memoryPageSize", "hpa-attribute-value": "<MEMORYPAGESIZE>", "operator": "=", "unit": ""} + ] + } + ] + } + ] + } +} diff --git a/test/policy-local-files/has_policies_r2/hpa_policy_vG_1.json b/test/policy-local-files/has_policies_r2/hpa_policy_vG_1.json new file mode 100644 index 0000000..95f9247 --- /dev/null +++ b/test/policy-local-files/has_policies_r2/hpa_policy_vG_1.json @@ -0,0 +1,144 @@ +{ + "service": "hpaPolicy", + "policyName": "oofBeijing.hpaPolicy_vG", + "description": "HPA policy for vG", + "templateVersion": "0.0.1", + "version": "1.0", + "priority": "3", + "riskType": "test", + "riskLevel": "2", + "guard": "False", + "content": { + "resources": "vG", + "identity": "hpaPolicy_vG", + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG", "hpaPolicy"], + "policyType": "hpaPolicy", + "flavorFeatures": [ + { + "flavorLabel": "flavor_label_vm_01", + "flavorProperties":[ + { + "hpa-feature" : "cpuTopology", + "mandatory" : "True", + "architecture": "generic", + "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":"numCpuCores", "hpa-attribute-value": "2", "operator":">=", "unit": ""}, + {"hpa-attribute-key":"numCpuCores", "hpa-attribute-value": "4", "operator":"<=", "unit": ""}, + {"hpa-attribute-key":"numCpuThreads", "hpa-attribute-value": "4", "operator":">=", "unit": ""}, + {"hpa-attribute-key":"numCpuThreads", "hpa-attribute-value": "8", "operator":"<=", "unit": ""} + ] + }, + { + "hpa-feature" : "basicCapabilities", + "mandatory" : "True", + "architecture": "generic", + "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-feature" : "ovsDpdk", + "mandatory" : "False", + "score" : "3", + "architecture": "generic", + "hpa-feature-attributes": [ + {"hpa-attribute-key":"dataProcessingAccelerationLibrary", "hpa-attribute-value":"ovsDpdk_version", "operator": "=", "unit":""} + ] + }, + { + "hpa-feature" : "cpuInstructionSetExtensions", + "mandatory" : "True", + "architecture": "INTEL-64", + "hpa-feature-attributes": [ + {"hpa-attribute-key":"instructionSetExtensions", "hpa-attribute-value":["<CPUINST>", "<CPUINST>"], "operator": "ALL", "unit":""} + ] + } + ] + }, + { + "flavorLabel": "flavor_label_vm_02", + "flavorProperties":[ + { + "hpa-feature" : "cpuPinningy", + "mandatory" : "True", + "architecture": "generic", + "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", + "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-feature" : "localStorage", + "mandatory" : "False", + "score" : "5", + "architecture": "generic", + "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-attribute-key": "swapMemSize", "hpa-attribute-value":"16", "operator": "=", "unit": "MB"} + ] + }, + { + "hpa-feature" : "pcie", + "mandatory" : "True", + "architecture": "generic", + "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": ""} + ] + } + ] + }, + { + "flavorLabel": "flavor_label_vm_03", + "flavorProperties":[ + { + "hpa-feature" : "numa", + "mandatory" : "False", + "score" : "5", + "architecture": "generic", + "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": "numaMem-0", "hpa-attribute-value": "2048", "operator": "=", "unit": "MB"}, + {"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", + "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-feature" : "hugePages", + "mandatory" : "False", + "score" : "7", + "architecture": "generic", + "hpa-feature-attributes": [ + {"hpa-attribute-key": "memoryPageSize", "hpa-attribute-value": "<MEMORYPAGESIZE>", "operator": "=", "unit": ""} + ] + } + ] + } + ] + } +} diff --git a/test/policy-local-files/has_policies_r2/subscriber_policy.json b/test/policy-local-files/has_policies_r2/subscriber_policy.json new file mode 100644 index 0000000..f237f79 --- /dev/null +++ b/test/policy-local-files/has_policies_r2/subscriber_policy.json @@ -0,0 +1,21 @@ +{ + "service": "SubscriberPolicy", + "policyName": "oofBeijing.SubscriberPolicy_v1", + "description": "Subscriber Policy", + "templateVersion": "0.0.1", + "version": "oofBeijing", + "priority": "1", + "riskType": "test", + "riskLevel": "3", + "guard": "False", + "content": { + "identity": "subscriber", + "policyScope": ["vCPE", "subscriber_x", "subscriber_y", "subscriberPolicy"], + "properties": { + "subscriberName": ["subscriber_x", "subscriber_y"], + "subscriberRole": ["PVT Homing"], + "provStatus": ["CAPPED"] + }, + "policyType": "subscriberPolicy" + } +}
\ No newline at end of file diff --git a/test/policy-local-files/has_policies_r2/vnfPolicy_vG.json b/test/policy-local-files/has_policies_r2/vnfPolicy_vG.json new file mode 100644 index 0000000..a5694a3 --- /dev/null +++ b/test/policy-local-files/has_policies_r2/vnfPolicy_vG.json @@ -0,0 +1,32 @@ +{ + "service": "VnfPolicy", + "policyName": "oofBeijing.vnfPolicy_vG", + "description": "vnfPolicy", + "templateVersion": "1702.03", + "version": "oofBeijing", + "priority": "6", + "riskType": "test", + "riskLevel": "3", + "guard": "False", + "content": { + "identity": "vnf_vG", + "policyScope": ["vCPE", "INTERNATIONAL", "ip", "vG", "vnf_policy"], + "policyType": "vnf_policy", + "resources": ["vG"], + "applicableResources": "any", + "vnfProperties": [ + { + "inventoryProvider": "aai", + "serviceType": "", + "inventoryType": "cloud", + "customerId": "" + }, + { + "inventoryProvider": "multicloud", + "serviceType": "HNGATEWAY", + "inventoryType": "service", + "customerId": "21014aa2-526b-11e6-beb8-9e71128cae77" + } + ] + } +} diff --git a/test/policy-local-files/has_policies_r2/vnfPolicy_vGMuxInfra.json b/test/policy-local-files/has_policies_r2/vnfPolicy_vGMuxInfra.json new file mode 100644 index 0000000..682fb62 --- /dev/null +++ b/test/policy-local-files/has_policies_r2/vnfPolicy_vGMuxInfra.json @@ -0,0 +1,32 @@ +{ + "service": "VnfPolicy", + "policyName": "oofBeijing.vnfPolicy_vGMuxInfra", + "description": "vnfPolicy", + "templateVersion": "1702.03", + "version": "oofBeijing", + "priority": "6", + "riskType": "test", + "riskLevel": "3", + "guard": "False", + "content": { + "identity": "vnf_vGMuxInfra", + "policyScope": ["vCPE", "INTERNATIONAL", "ip", "vGMuxInfra", "vnf_policy"], + "policyType": "vnf_policy", + "resources": ["vGMuxInfra"], + "applicableResources": "any", + "vnfProperties": [ + { + "inventoryProvider": "aai", + "serviceType": "", + "inventoryType": "cloud", + "customerId": "" + }, + { + "inventoryProvider": "multicloud", + "serviceType": "HNGATEWAY", + "inventoryType": "service", + "customerId": "21014aa2-526b-11e6-beb8-9e71128cae77" + } + ] + } +} |