diff options
author | Ankitkumar Patel <ankit@research.att.com> | 2018-05-19 12:47:27 -0400 |
---|---|---|
committer | Ankitkumar Patel <ankit@research.att.com> | 2018-05-19 12:48:14 -0400 |
commit | 8ea30a38468373dfd9715d720c085c8a6ac4ee29 (patch) | |
tree | 7d6bac9fdc2b963b9960962ffa5b04c167d3f055 | |
parent | 12f9060558172ee282c6fb1b18e9955f00a41807 (diff) |
Fix the bug in translating a policy
Fix the bug in translating the VNF policy
Issue-ID: OPTFRA-239
Change-Id: I0c9f678f22fec4eb3f5e190ea0080c899fb95445
Signed-off-by: Ankitkumar Patel <ankit@research.att.com>
26 files changed, 182 insertions, 189 deletions
diff --git a/config/common_config.yaml b/config/common_config.yaml index 36cbde0..c91433f 100644 --- a/config/common_config.yaml +++ b/config/common_config.yaml @@ -9,9 +9,9 @@ osdf_system: osdf_temp: # special configuration required for "workarounds" or testing local_policies: - global_disabled: True + global_disabled: False local_placement_policies_enabled: True - placement_policy_dir_vcpe: "../test/policy-local-files/" + placement_policy_dir_vcpe: "./test/policy-local-files/" placement_policy_files_vcpe: # workaroud for policy platform glitches (or "work-arounds" for other components) - Affinity_vCPE_1.json - Capacity_vGMuxInfra.json @@ -20,7 +20,6 @@ osdf_temp: # special configuration required for "workarounds" or testing - Distance_vG_1.json - Placement_Optimization_1.json - QueryPolicy_vCPE.json - - QueryPolicy_vCPE_2.json - hpa_policy_vGMuxInfra_1.json - hpa_policy_vG_1.json - vnfPolicy_vG.json diff --git a/config/has_config.yaml b/config/has_config.yaml index 8cbeda2..9200daf 100644 --- a/config/has_config.yaml +++ b/config/has_config.yaml @@ -11,7 +11,9 @@ policy_config_mapping: geo_region: geoRegion, exclusivity_groups: exclusivityGroups, replication_role: replicationRole, - remapping: + customer-id: customerId, + service-type: serviceResourceId, + equipment-role: equipmentRole, model-invariant-id: modelInvariantId, model-version-id: modelVersionId candidates: diff --git a/osdf/adapters/local_data/local_policies.py b/osdf/adapters/local_data/local_policies.py index e722fe2..6e49388 100644 --- a/osdf/adapters/local_data/local_policies.py +++ b/osdf/adapters/local_data/local_policies.py @@ -33,11 +33,14 @@ def get_local_policies(local_policy_folder, local_policy_list, policy_id_list=No :return: get policies """ policies = [] - for fname in local_policy_list: # ugly removal of .json from file name - if policy_id_list and fname[:-5] not in policy_id_list: - continue - with open(os.path.join(local_policy_folder, fname)) as fid: - policies.append(json.load(fid)) + if policy_id_list: + for policy_id in policy_id_list: + with open(os.path.join(local_policy_folder, policy_id + ".json")) as fid: + policies.append(json.load(fid)) + else: + for fname in local_policy_list: + with open(os.path.join(local_policy_folder, fname)) as fid: + policies.append(json.load(fid)) return policies diff --git a/osdf/optimizers/placementopt/conductor/translation.py b/osdf/optimizers/placementopt/conductor/translation.py index 5f44c83..e703c36 100644 --- a/osdf/optimizers/placementopt/conductor/translation.py +++ b/osdf/optimizers/placementopt/conductor/translation.py @@ -221,12 +221,21 @@ def get_demand_properties(demand, policies): for policy_property in get_policy_properties(demand, policies): prop = dict(inventory_provider=policy_property['inventoryProvider'], inventory_type=policy_property['inventoryType'], - service_resource_id=demand['serviceResourceId']) - if 'attributes' in policy_property: - prop['attributes'] = get_augmented_policy_attributes(policy_property, demand) - for k1, v1, k2, v2 in policy_config_mapping['extra_fields']: - if k1 == v1: - prop[k2] = v2 + service_type=demand['serviceResourceId']) + attributes = policy_config_mapping['attributes'] + prop['attributes'] = { + 'customer-id': policy_property['customerId'], + 'orchestration-status': "", + 'model-invariant-id': demand['resourceModelInfo']['modelInvariantId'], + 'model-version-id': demand['resourceModelInfo']['modelVersionId'], + 'service-type': demand['serviceResourceId'], + 'equipment-role': policy_property['equipmentRole'] + } + # if 'attributes' in policy_property: + # prop['attributes'] = get_augmented_policy_attributes(policy_property, demand) + # for k1, v1, k2, v2 in policy_config_mapping['extra_fields']: + # if k1 == v1: + # prop[k2] = v2 prop.update(get_candidates_demands(demand)) # for excluded and partial-rehoming cases demand_properties.append(prop) return demand_properties diff --git a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Affinity_vCPE_1.json b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Affinity_vCPE_1.json index 4a3e086..c9046dd 100644 --- a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Affinity_vCPE_1.json +++ b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Affinity_vCPE_1.json @@ -1,10 +1,10 @@ { - "service": "affinityPolicy", - "policyName": "oofBeijing.affinityPolicy_vcpe", - "description": "Affinity policy for vCPE", - "templateVersion": "1702.03", - "version": "oofBeijing", - "priority": "5", + "service": "zone", + "policyName": "OSDF_R2.Affinity_vCPE_1", + "description": "Optimization query policy for vCPE", + "templateVersion": "OpenSource.version.1", + "version": "test1", + "priority": "3", "riskType": "test", "riskLevel": "2", "guard": "False", @@ -16,7 +16,6 @@ "category": "complex" }, "policyType": "zone", - "resources": ["vGMuxInfra", "vG"], - "applicableResources": "all" + "resources": ["vGMuxInfra", "vG"] } -}
\ No newline at end of file +} diff --git a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Capacity_vGMuxInfra.json b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Capacity_vGMuxInfra.json index 0225d40..2578544 100644 --- a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Capacity_vGMuxInfra.json +++ b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Capacity_vGMuxInfra.json @@ -1,20 +1,20 @@ { - "service": "capacityPolicy", - "policyName": "oofBeijing.capacityPolicy_vGMuxInfra", + "service": "vim_fit", + "policyName": "OSDF_R2.Capacity_vGMuxInfra", "description": "Capacity policy for vGMuxInfra", - "templateVersion": "1702.03", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "5", "riskType": "test", "riskLevel": "2", "guard": "False", "content": { "identity": "capacity_vGMuxInfra", - "policyScope": ["VCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vim_fit"], + "policyScope": ["VCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"], "resources": ["vGMuxInfra"], "capacityProperty": { "controller": "multicloud", - "request": "{\"vCPU\": 10, \"Memory\": {\"quantity\": 16, \"unit\": \"GB\"}, \"Storage\": {\"quantity\": 40, \"unit\": \"GB\"}}" + "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/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Capacity_vG_1.json b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Capacity_vG_1.json index f311650..c1682fa 100644 --- a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Capacity_vG_1.json +++ b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Capacity_vG_1.json @@ -1,20 +1,20 @@ { - "service": "capacityPolicy", - "policyName": "oofBeijing.capacityPolicy_vG", + "service": "vim_fit", + "policyName": "OSDF_R2.Capacity_vG_1", "description": "Capacity policy for vG", - "templateVersion": "1702.03", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "5", "riskType": "test", "riskLevel": "2", "guard": "False", "content": { "identity": "capacity_vG", - "policyScope": ["VCPE", "US", "INTERNATIONAL", "ip", "vG", "vim_fit"], + "policyScope": ["VCPE", "US", "INTERNATIONAL", "ip", "vG"], "resources": ["vG"], "capacityProperty": { "controller": "multicloud", - "request": "{\"vCPU\": 10, \"Memory\": {\"quantity\": 16, \"unit\": \"GB\"}, \"Storage\": {\"quantity\": 40, \"unit\": \"GB\"}}" + "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/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Distance_vGMuxInfra_1.json b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Distance_vGMuxInfra_1.json index 992e9ec..61ec500 100644 --- a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Distance_vGMuxInfra_1.json +++ b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Distance_vGMuxInfra_1.json @@ -1,9 +1,9 @@ { - "service": "distancePolicy", - "policyName": "oofBeijing.distancePolicy_vGMuxInfra", + "service": "distance_to_location", + "policyName": "OSDF_R2.Distance_vGMuxInfra", "description": "Distance Policy for vGMuxInfra", - "templateVersion": "0.0.1", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "3", "riskType": "test", "riskLevel": "2", @@ -15,8 +15,8 @@ }, "identity": "distance-vGMuxInfra", "resources": ["vGMuxInfra"], - "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "distancePolicy"], - "policyType": "distance_to_location", + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"], + "policyType": "distancePolicy", "applicableResources": "any" } } diff --git a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Distance_vG_1.json b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Distance_vG_1.json index 07baabd..06c3ada 100644 --- a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Distance_vG_1.json +++ b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Distance_vG_1.json @@ -1,9 +1,9 @@ { - "service": "distancePolicy", - "policyName": "oofBeijing.distancePolicy_vG", + "service": "distance_to_location", + "policyName": "OSDF_R2.Distance_vG_1", "description": "Distance Policy for vG", - "templateVersion": "0.0.1", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "3", "riskType": "test", "riskLevel": "2", @@ -15,8 +15,8 @@ }, "identity": "distance-vG", "resources": ["vG"], - "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG", "distancePolicy"], - "policyType": "distance_to_location", + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"], + "policyType": "distancePolicy", "applicableResources": "any" } } diff --git a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Placement_Optimization_1.json b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Placement_Optimization_1.json index 6d09b82..b81b15f 100644 --- a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Placement_Optimization_1.json +++ b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Placement_Optimization_1.json @@ -1,9 +1,9 @@ { - "service": "PlacementOptimizationPolicy", - "policyName": "oofBeijing.PlacementOptimizationPolicy_vGMuxInfra", + "service": "placementOptimization", + "policyName": "OSDF_R2.Placement_Optimization_1", "description": "Placement Optimization Policy for vGMuxInfra", - "templateVersion": "1702.03", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "5", "riskType": "test", "riskLevel": "3", @@ -29,7 +29,7 @@ "operator": "sum" }, "identity": "optimization", - "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG", "placementOptimization"], + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"], "policyType": "placementOptimization", "objective": "minimize" } diff --git a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/QueryPolicy_vCPE.json b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/QueryPolicy_vCPE.json index 03c457e..27f49d2 100644 --- a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/QueryPolicy_vCPE.json +++ b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/QueryPolicy_vCPE.json @@ -1,23 +1,21 @@ { "service": "optimizationQueryPolicy", - "policyName": "oofBeijing.queryPolicy_vCPE", + "policyName": "OSDF_R2.QueryPolicy_vCPE", "description": "Optimization query policy for vCPE", - "templateVersion": "0.0.1", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "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} + {"attribute":"customerLatitude", "attribute_location": "customerLatitude"}, + {"attribute":"customerLongitude", "attribute_location": "customerLongitude"} ], + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"], + "policyType": "optimizationQueryPolicy", "serviceName": "vCPE", - "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG", "optimizationQueryPolicy"], - "policyType": "optimizationQueryPolicy" + "identity": "vCPE_Query_Policy" } } diff --git a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/hpa_policy_vGMuxInfra_1.json b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/hpa_policy_vGMuxInfra_1.json index a3403f0..da4ef03 100644 --- a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/hpa_policy_vGMuxInfra_1.json +++ b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/hpa_policy_vGMuxInfra_1.json @@ -1,18 +1,18 @@ { "service": "hpaPolicy", - "policyName": "oofBeijing.hpaPolicy_vGMuxInfra", + "policyName": "OSDF_R2.hpa_policy_vGMuxInfra_1", "description": "HPA policy for vGMuxInfra", - "templateVersion": "0.0.1", - "version": "1.0", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "3", "riskType": "test", "riskLevel": "2", "guard": "False", "content": { - "resources": ["vGMuxInfra"], + "resources": "vGMuxInfra", "identity": "hpaPolicy_vGMuxInfra", - "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "hpaPolicy"], - "policyType": "hpa", + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"], + "policyType": "hpaPolicy", "flavorFeatures": [ { "flavorLabel": "flavor_label_vm_01", diff --git a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/hpa_policy_vG_1.json b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/hpa_policy_vG_1.json index 9b832f6..f50ed6d 100644 --- a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/hpa_policy_vG_1.json +++ b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/hpa_policy_vG_1.json @@ -1,18 +1,18 @@ { "service": "hpaPolicy", - "policyName": "oofBeijing.hpaPolicy_vG", + "policyName": "OSDF_R2.hpa_policy_vG_1", "description": "HPA policy for vG", - "templateVersion": "0.0.1", - "version": "1.0", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "3", "riskType": "test", "riskLevel": "2", "guard": "False", "content": { - "resources": ["vG"], + "resources": "vG", "identity": "hpaPolicy_vG", - "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG", "hpaPolicy"], - "policyType": "hpa", + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"], + "policyType": "hpaPolicy", "flavorFeatures": [ { "flavorLabel": "flavor_label_vm_01", @@ -85,7 +85,7 @@ "score" : "5", "architecture": "generic", "hpa-feature-attributes": [ - {"hpa-attribute-key": "diskSize", "hpa-attribute-value": "2", "operator": "=", "unit": "GB"}, + {"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"} ] diff --git a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/vnfPolicy_vG.json b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/vnfPolicy_vG.json index c77cdc7..d215078 100644 --- a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/vnfPolicy_vG.json +++ b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/vnfPolicy_vG.json @@ -1,16 +1,16 @@ { - "service": "VnfPolicy", - "policyName": "oofBeijing.vnfPolicy_vG", + "service": "vnfPolicy", + "policyName": "OSDF_R2.vnfPolicy_vG", "description": "vnfPolicy", - "templateVersion": "1702.03", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "6", "riskType": "test", "riskLevel": "3", "guard": "False", "content": { "identity": "vnf_vG", - "policyScope": ["vCPE", "INTERNATIONAL", "ip", "vG", "vnf_policy"], + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"], "policyType": "vnfPolicy", "resources": ["vG"], "applicableResources": "any", @@ -19,13 +19,10 @@ "inventoryProvider": "aai", "serviceType": "", "inventoryType": "cloud", - "customerId": "" - }, - { - "inventoryProvider": "multicloud", - "serviceType": "HNGATEWAY", - "inventoryType": "service", - "customerId": "21014aa2-526b-11e6-beb8-9e71128cae77" + "customerId": "", + "orchestrationStatus": "", + "equipmentRole": "" + } ] } diff --git a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/vnfPolicy_vGMuxInfra.json b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/vnfPolicy_vGMuxInfra.json index 3971519..7ac6dff 100644 --- a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/vnfPolicy_vGMuxInfra.json +++ b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/vnfPolicy_vGMuxInfra.json @@ -1,31 +1,27 @@ { - "service": "VnfPolicy", - "policyName": "oofBeijing.vnfPolicy_vGMuxInfra", + "service": "vnfPolicy", + "policyName": "OSDF_R2.vnfPolicy_vGMuxInfra", "description": "vnfPolicy", - "templateVersion": "1702.03", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "6", "riskType": "test", "riskLevel": "3", "guard": "False", "content": { "identity": "vnf_vGMuxInfra", - "policyScope": ["vCPE", "INTERNATIONAL", "ip", "vGMuxInfra", "vnf_policy"], + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"], "policyType": "vnfPolicy", "resources": ["vGMuxInfra"], "applicableResources": "any", - "vnfProperties": [ + "vnfProperties": [ { "inventoryProvider": "aai", - "serviceType": "", - "inventoryType": "cloud", - "customerId": "" - }, - { - "inventoryProvider": "multicloud", - "serviceType": "HNGATEWAY", + "serviceType": "vGMuxInfra", "inventoryType": "service", - "customerId": "21014aa2-526b-11e6-beb8-9e71128cae77" + "customerId": "", + "orchestrationStatus": "", + "equipmentRole": "" } ] } diff --git a/test/policy-local-files/Affinity_vCPE_1.json b/test/policy-local-files/Affinity_vCPE_1.json index 4a3e086..c9046dd 100644 --- a/test/policy-local-files/Affinity_vCPE_1.json +++ b/test/policy-local-files/Affinity_vCPE_1.json @@ -1,10 +1,10 @@ { - "service": "affinityPolicy", - "policyName": "oofBeijing.affinityPolicy_vcpe", - "description": "Affinity policy for vCPE", - "templateVersion": "1702.03", - "version": "oofBeijing", - "priority": "5", + "service": "zone", + "policyName": "OSDF_R2.Affinity_vCPE_1", + "description": "Optimization query policy for vCPE", + "templateVersion": "OpenSource.version.1", + "version": "test1", + "priority": "3", "riskType": "test", "riskLevel": "2", "guard": "False", @@ -16,7 +16,6 @@ "category": "complex" }, "policyType": "zone", - "resources": ["vGMuxInfra", "vG"], - "applicableResources": "all" + "resources": ["vGMuxInfra", "vG"] } -}
\ No newline at end of file +} diff --git a/test/policy-local-files/Capacity_vGMuxInfra.json b/test/policy-local-files/Capacity_vGMuxInfra.json index 0225d40..2578544 100644 --- a/test/policy-local-files/Capacity_vGMuxInfra.json +++ b/test/policy-local-files/Capacity_vGMuxInfra.json @@ -1,20 +1,20 @@ { - "service": "capacityPolicy", - "policyName": "oofBeijing.capacityPolicy_vGMuxInfra", + "service": "vim_fit", + "policyName": "OSDF_R2.Capacity_vGMuxInfra", "description": "Capacity policy for vGMuxInfra", - "templateVersion": "1702.03", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "5", "riskType": "test", "riskLevel": "2", "guard": "False", "content": { "identity": "capacity_vGMuxInfra", - "policyScope": ["VCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vim_fit"], + "policyScope": ["VCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"], "resources": ["vGMuxInfra"], "capacityProperty": { "controller": "multicloud", - "request": "{\"vCPU\": 10, \"Memory\": {\"quantity\": 16, \"unit\": \"GB\"}, \"Storage\": {\"quantity\": 40, \"unit\": \"GB\"}}" + "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/Capacity_vG_1.json b/test/policy-local-files/Capacity_vG_1.json index f311650..c1682fa 100644 --- a/test/policy-local-files/Capacity_vG_1.json +++ b/test/policy-local-files/Capacity_vG_1.json @@ -1,20 +1,20 @@ { - "service": "capacityPolicy", - "policyName": "oofBeijing.capacityPolicy_vG", + "service": "vim_fit", + "policyName": "OSDF_R2.Capacity_vG_1", "description": "Capacity policy for vG", - "templateVersion": "1702.03", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "5", "riskType": "test", "riskLevel": "2", "guard": "False", "content": { "identity": "capacity_vG", - "policyScope": ["VCPE", "US", "INTERNATIONAL", "ip", "vG", "vim_fit"], + "policyScope": ["VCPE", "US", "INTERNATIONAL", "ip", "vG"], "resources": ["vG"], "capacityProperty": { "controller": "multicloud", - "request": "{\"vCPU\": 10, \"Memory\": {\"quantity\": 16, \"unit\": \"GB\"}, \"Storage\": {\"quantity\": 40, \"unit\": \"GB\"}}" + "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/Distance_vGMuxInfra_1.json b/test/policy-local-files/Distance_vGMuxInfra_1.json index 992e9ec..61ec500 100644 --- a/test/policy-local-files/Distance_vGMuxInfra_1.json +++ b/test/policy-local-files/Distance_vGMuxInfra_1.json @@ -1,9 +1,9 @@ { - "service": "distancePolicy", - "policyName": "oofBeijing.distancePolicy_vGMuxInfra", + "service": "distance_to_location", + "policyName": "OSDF_R2.Distance_vGMuxInfra", "description": "Distance Policy for vGMuxInfra", - "templateVersion": "0.0.1", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "3", "riskType": "test", "riskLevel": "2", @@ -15,8 +15,8 @@ }, "identity": "distance-vGMuxInfra", "resources": ["vGMuxInfra"], - "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "distancePolicy"], - "policyType": "distance_to_location", + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"], + "policyType": "distancePolicy", "applicableResources": "any" } } diff --git a/test/policy-local-files/Distance_vG_1.json b/test/policy-local-files/Distance_vG_1.json index 07baabd..06c3ada 100644 --- a/test/policy-local-files/Distance_vG_1.json +++ b/test/policy-local-files/Distance_vG_1.json @@ -1,9 +1,9 @@ { - "service": "distancePolicy", - "policyName": "oofBeijing.distancePolicy_vG", + "service": "distance_to_location", + "policyName": "OSDF_R2.Distance_vG_1", "description": "Distance Policy for vG", - "templateVersion": "0.0.1", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "3", "riskType": "test", "riskLevel": "2", @@ -15,8 +15,8 @@ }, "identity": "distance-vG", "resources": ["vG"], - "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG", "distancePolicy"], - "policyType": "distance_to_location", + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"], + "policyType": "distancePolicy", "applicableResources": "any" } } diff --git a/test/policy-local-files/Placement_Optimization_1.json b/test/policy-local-files/Placement_Optimization_1.json index 6d09b82..b81b15f 100644 --- a/test/policy-local-files/Placement_Optimization_1.json +++ b/test/policy-local-files/Placement_Optimization_1.json @@ -1,9 +1,9 @@ { - "service": "PlacementOptimizationPolicy", - "policyName": "oofBeijing.PlacementOptimizationPolicy_vGMuxInfra", + "service": "placementOptimization", + "policyName": "OSDF_R2.Placement_Optimization_1", "description": "Placement Optimization Policy for vGMuxInfra", - "templateVersion": "1702.03", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "5", "riskType": "test", "riskLevel": "3", @@ -29,7 +29,7 @@ "operator": "sum" }, "identity": "optimization", - "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG", "placementOptimization"], + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"], "policyType": "placementOptimization", "objective": "minimize" } diff --git a/test/policy-local-files/QueryPolicy_vCPE.json b/test/policy-local-files/QueryPolicy_vCPE.json index 03c457e..27f49d2 100644 --- a/test/policy-local-files/QueryPolicy_vCPE.json +++ b/test/policy-local-files/QueryPolicy_vCPE.json @@ -1,23 +1,21 @@ { "service": "optimizationQueryPolicy", - "policyName": "oofBeijing.queryPolicy_vCPE", + "policyName": "OSDF_R2.QueryPolicy_vCPE", "description": "Optimization query policy for vCPE", - "templateVersion": "0.0.1", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "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} + {"attribute":"customerLatitude", "attribute_location": "customerLatitude"}, + {"attribute":"customerLongitude", "attribute_location": "customerLongitude"} ], + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"], + "policyType": "optimizationQueryPolicy", "serviceName": "vCPE", - "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG", "optimizationQueryPolicy"], - "policyType": "optimizationQueryPolicy" + "identity": "vCPE_Query_Policy" } } diff --git a/test/policy-local-files/hpa_policy_vGMuxInfra_1.json b/test/policy-local-files/hpa_policy_vGMuxInfra_1.json index a3403f0..da4ef03 100644 --- a/test/policy-local-files/hpa_policy_vGMuxInfra_1.json +++ b/test/policy-local-files/hpa_policy_vGMuxInfra_1.json @@ -1,18 +1,18 @@ { "service": "hpaPolicy", - "policyName": "oofBeijing.hpaPolicy_vGMuxInfra", + "policyName": "OSDF_R2.hpa_policy_vGMuxInfra_1", "description": "HPA policy for vGMuxInfra", - "templateVersion": "0.0.1", - "version": "1.0", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "3", "riskType": "test", "riskLevel": "2", "guard": "False", "content": { - "resources": ["vGMuxInfra"], + "resources": "vGMuxInfra", "identity": "hpaPolicy_vGMuxInfra", - "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "hpaPolicy"], - "policyType": "hpa", + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"], + "policyType": "hpaPolicy", "flavorFeatures": [ { "flavorLabel": "flavor_label_vm_01", diff --git a/test/policy-local-files/hpa_policy_vG_1.json b/test/policy-local-files/hpa_policy_vG_1.json index 9b832f6..f50ed6d 100644 --- a/test/policy-local-files/hpa_policy_vG_1.json +++ b/test/policy-local-files/hpa_policy_vG_1.json @@ -1,18 +1,18 @@ { "service": "hpaPolicy", - "policyName": "oofBeijing.hpaPolicy_vG", + "policyName": "OSDF_R2.hpa_policy_vG_1", "description": "HPA policy for vG", - "templateVersion": "0.0.1", - "version": "1.0", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "3", "riskType": "test", "riskLevel": "2", "guard": "False", "content": { - "resources": ["vG"], + "resources": "vG", "identity": "hpaPolicy_vG", - "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG", "hpaPolicy"], - "policyType": "hpa", + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"], + "policyType": "hpaPolicy", "flavorFeatures": [ { "flavorLabel": "flavor_label_vm_01", @@ -85,7 +85,7 @@ "score" : "5", "architecture": "generic", "hpa-feature-attributes": [ - {"hpa-attribute-key": "diskSize", "hpa-attribute-value": "2", "operator": "=", "unit": "GB"}, + {"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"} ] diff --git a/test/policy-local-files/vnfPolicy_vG.json b/test/policy-local-files/vnfPolicy_vG.json index c77cdc7..d215078 100644 --- a/test/policy-local-files/vnfPolicy_vG.json +++ b/test/policy-local-files/vnfPolicy_vG.json @@ -1,16 +1,16 @@ { - "service": "VnfPolicy", - "policyName": "oofBeijing.vnfPolicy_vG", + "service": "vnfPolicy", + "policyName": "OSDF_R2.vnfPolicy_vG", "description": "vnfPolicy", - "templateVersion": "1702.03", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "6", "riskType": "test", "riskLevel": "3", "guard": "False", "content": { "identity": "vnf_vG", - "policyScope": ["vCPE", "INTERNATIONAL", "ip", "vG", "vnf_policy"], + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"], "policyType": "vnfPolicy", "resources": ["vG"], "applicableResources": "any", @@ -19,13 +19,10 @@ "inventoryProvider": "aai", "serviceType": "", "inventoryType": "cloud", - "customerId": "" - }, - { - "inventoryProvider": "multicloud", - "serviceType": "HNGATEWAY", - "inventoryType": "service", - "customerId": "21014aa2-526b-11e6-beb8-9e71128cae77" + "customerId": "", + "orchestrationStatus": "", + "equipmentRole": "" + } ] } diff --git a/test/policy-local-files/vnfPolicy_vGMuxInfra.json b/test/policy-local-files/vnfPolicy_vGMuxInfra.json index 3971519..7ac6dff 100644 --- a/test/policy-local-files/vnfPolicy_vGMuxInfra.json +++ b/test/policy-local-files/vnfPolicy_vGMuxInfra.json @@ -1,31 +1,27 @@ { - "service": "VnfPolicy", - "policyName": "oofBeijing.vnfPolicy_vGMuxInfra", + "service": "vnfPolicy", + "policyName": "OSDF_R2.vnfPolicy_vGMuxInfra", "description": "vnfPolicy", - "templateVersion": "1702.03", - "version": "oofBeijing", + "templateVersion": "OpenSource.version.1", + "version": "test1", "priority": "6", "riskType": "test", "riskLevel": "3", "guard": "False", "content": { "identity": "vnf_vGMuxInfra", - "policyScope": ["vCPE", "INTERNATIONAL", "ip", "vGMuxInfra", "vnf_policy"], + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"], "policyType": "vnfPolicy", "resources": ["vGMuxInfra"], "applicableResources": "any", - "vnfProperties": [ + "vnfProperties": [ { "inventoryProvider": "aai", - "serviceType": "", - "inventoryType": "cloud", - "customerId": "" - }, - { - "inventoryProvider": "multicloud", - "serviceType": "HNGATEWAY", + "serviceType": "vGMuxInfra", "inventoryType": "service", - "customerId": "21014aa2-526b-11e6-beb8-9e71128cae77" + "customerId": "", + "orchestrationStatus": "", + "equipmentRole": "" } ] } |