summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Varma <vikas.varma@att.com>2020-04-22 01:33:52 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-22 01:33:52 +0000
commitd4a0085a8f75c62912d19613459ad1bc3dce3e73 (patch)
treec357a3584ba8bdbd63bedef17011bbf37143c17b
parent2ac2b0c1c177dfec588b9c3439a41340d555897b (diff)
parent2754404822b496392717d260681946debecf8648 (diff)
Merge "add aggregation policy for NSI selection"
-rw-r--r--apps/slice_selection/optimizers/conductor/remote_opt_processor.py7
-rw-r--r--config/common_config.yaml6
-rw-r--r--osdf/adapters/conductor/api_builder.py32
-rw-r--r--osdf/adapters/conductor/translation.py52
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.AffinityPolicy.yaml62
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.DistancePolicy.yaml82
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.HpaPolicy.yaml131
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.OptimizationPolicy.yaml89
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.PciPolicy.yaml58
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.QueryPolicy.yaml47
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.SubscriberPolicy.yaml51
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.Vim_fit.yaml56
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.VnfPolicy.yaml90
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.AffinityPolicy.yaml31
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.AggregationPolicy.yaml42
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.DistancePolicy.yaml56
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.HpaPolicy.yaml103
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.OptimizationPolicy.yaml66
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.PciPolicy.yaml30
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.ThresholdPolicy.yaml37
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.Vim_fit.yaml28
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.VnfPolicy.yaml44
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.service.QueryPolicy.yaml24
-rw-r--r--osdf/models/policy/placement/tosca_upload/onap.policies.optimization.service.SubscriberPolicy.yaml34
-rw-r--r--test/apps/slice_selection/slice_policies.txt6
-rw-r--r--test/policy-local-files/Affinity_vCPE_1.json2
-rw-r--r--test/policy-local-files/Affinity_vFW_TD.json2
-rw-r--r--test/policy-local-files/Attribute_vNS_1.json2
-rw-r--r--test/policy-local-files/Capacity_vGMuxInfra.json2
-rw-r--r--test/policy-local-files/Capacity_vG_1.json2
-rw-r--r--test/policy-local-files/Distance_vGMuxInfra_1.json2
-rw-r--r--test/policy-local-files/Distance_vG_1.json2
-rw-r--r--test/policy-local-files/Placement_Optimization_1.json2
-rw-r--r--test/policy-local-files/QueryPolicy_vCPE.json2
-rw-r--r--test/policy-local-files/QueryPolicy_vCPE_2.json2
-rw-r--r--test/policy-local-files/QueryPolicy_vFW_TD.json2
-rw-r--r--test/policy-local-files/aggregationPolicy_URLLC_1.json37
-rw-r--r--test/policy-local-files/hpa_policy_vGMuxInfra_1.json2
-rw-r--r--test/policy-local-files/hpa_policy_vG_1.json2
-rw-r--r--test/policy-local-files/queryPolicy_URLLC_.json29
-rw-r--r--test/policy-local-files/subscriber_policy_URLLC_1.json12
-rw-r--r--test/policy-local-files/subscriber_policy_vCPE.json2
-rw-r--r--test/policy-local-files/thresholdPolicy_URLLC_Core_1.json41
-rw-r--r--test/policy-local-files/thresholdPolicy_URLLC_Core_1_latency.json32
-rw-r--r--test/policy-local-files/thresholdPolicy_URLLC_Core_1_reliability.json32
-rw-r--r--test/policy-local-files/vnfPolicy_URLLC_Core_1.json6
-rw-r--r--test/policy-local-files/vnfPolicy_vFW_TD.json2
-rw-r--r--test/policy-local-files/vnfPolicy_vG.json2
-rw-r--r--test/policy-local-files/vnfPolicy_vGMuxInfra.json2
-rw-r--r--test/policy-local-files/vnfPolicy_vPGN_TD.json2
-rw-r--r--test/test_PolicyCalls.py2
51 files changed, 683 insertions, 808 deletions
diff --git a/apps/slice_selection/optimizers/conductor/remote_opt_processor.py b/apps/slice_selection/optimizers/conductor/remote_opt_processor.py
index a44fc4e..edad9ba 100644
--- a/apps/slice_selection/optimizers/conductor/remote_opt_processor.py
+++ b/apps/slice_selection/optimizers/conductor/remote_opt_processor.py
@@ -59,7 +59,7 @@ def process_nsi_selection_opt(request_json, osdf_config):
demands = get_slice_demands(nst_name, policies, osdf_config.core)
- request_parameters = {}
+ request_parameters = request_json.get('serviceProfile',{})
service_info = {}
req_info['numSolutions'] = 'all'
resp = conductor.request(req_info, demands, request_parameters, service_info, False,
@@ -90,15 +90,14 @@ def get_slice_demands(model_name, policies, config):
:return: list of demands for the request
"""
group_policies = group_policies_gen(policies, config)
- subscriber_policy_list = group_policies["onap.policies.optimization.SubscriberPolicy"]
+ subscriber_policy_list = group_policies["onap.policies.optimization.service.SubscriberPolicy"]
slice_demands = list()
for subscriber_policy in subscriber_policy_list:
policy_properties = subscriber_policy[list(subscriber_policy.keys())[0]]['properties']
if model_name in policy_properties["services"]:
- subnet_attributes = policy_properties["properties"]["subscriberRole"][0]
for subnet in policy_properties["properties"]["subscriberName"]:
slice_demand = dict()
slice_demand["resourceModuleName"] = subnet
- slice_demand['resourceModelInfo'] = subnet_attributes[subnet]
+ slice_demand['resourceModelInfo'] = {}
slice_demands.append(slice_demand)
return slice_demands
diff --git a/config/common_config.yaml b/config/common_config.yaml
index 835ade5..97bfcca 100644
--- a/config/common_config.yaml
+++ b/config/common_config.yaml
@@ -40,13 +40,13 @@ osdf_temp: # special configuration required for "workarounds" or testing
- vnfPolicy_vPGN_TD.json
- affinity_vFW_TD.json
- QueryPolicy_vFW_TD.json
-
slice_selection_policy_dir_urllc_1: "./test/policy-local-files/"
slice_selection_policy_files_urllc_1:
- vnfPolicy_URLLC_Core_1.json
- - thresholdPolicy_URLLC_Core_1_reliability.json
- - thresholdPolicy_URLLC_Core_1_latency.json
- subscriber_policy_URLLC_1.json
+ - thresholdPolicy_URLLC_Core_1.json
+ - aggregationPolicy_URLLC_1.json
+ - queryPolicy_URLLC_.json
service_info:
vCPE:
diff --git a/osdf/adapters/conductor/api_builder.py b/osdf/adapters/conductor/api_builder.py
index c99c5eb..daf8e54 100644
--- a/osdf/adapters/conductor/api_builder.py
+++ b/osdf/adapters/conductor/api_builder.py
@@ -34,7 +34,7 @@ def _build_parameters(group_policies, service_info, request_parameters):
:return:
"""
initial_params = tr.get_opt_query_data(request_parameters,
- group_policies['onap.policies.optimization.QueryPolicy'])
+ group_policies['onap.policies.optimization.service.QueryPolicy'])
params = dict()
params.update({"REQUIRED_MEM": initial_params.pop("requiredMemory", "")})
params.update({"REQUIRED_DISK": initial_params.pop("requiredDisk", "")})
@@ -46,7 +46,6 @@ def _build_parameters(group_policies, service_info, request_parameters):
for key, val in initial_params.items():
if val and val != "":
params.update({key: val})
-
return params
@@ -71,35 +70,38 @@ def conductor_api_builder(req_info, demands, request_parameters, service_info,
demand_name_list = []
for demand in demands:
demand_name_list.append(demand['resourceModuleName'].lower())
- demand_list = tr.gen_demands(demands, gp['onap.policies.optimization.VnfPolicy'])
+ demand_list = tr.gen_demands(demands, gp['onap.policies.optimization.resource.VnfPolicy'])
attribute_policy_list = tr.gen_attribute_policy(
- demand_name_list, gp['onap.policies.optimization.AttributePolicy'])
+ demand_name_list, gp['onap.policies.optimization.resource.AttributePolicy'])
distance_to_location_policy_list = tr.gen_distance_to_location_policy(
- demand_name_list, gp['onap.policies.optimization.DistancePolicy'])
+ demand_name_list, gp['onap.policies.optimization.resource.DistancePolicy'])
inventory_policy_list = tr.gen_inventory_group_policy(
- demand_name_list, gp['onap.policies.optimization.InventoryGroupPolicy'])
+ demand_name_list, gp['onap.policies.optimization.resource.InventoryGroupPolicy'])
resource_instance_policy_list = tr.gen_resource_instance_policy(
- demand_name_list, gp['onap.policies.optimization.ResourceInstancePolicy'])
+ demand_name_list, gp['onap.policies.optimization.resource.ResourceInstancePolicy'])
resource_region_policy_list = tr.gen_resource_region_policy(
- demand_name_list, gp['onap.policies.optimization.ResourceRegionPolicy'])
+ demand_name_list, gp['onap.policies.optimization.resource.ResourceRegionPolicy'])
zone_policy_list = tr.gen_zone_policy(
- demand_name_list, gp['onap.policies.optimization.AffinityPolicy'])
+ demand_name_list, gp['onap.policies.optimization.resource.AffinityPolicy'])
optimization_policy_list = tr.gen_optimization_policy(
- demand_name_list, gp['onap.policies.optimization.OptimizationPolicy'])
+ demand_name_list, gp['onap.policies.optimization.resource.OptimizationPolicy'])
reservation_policy_list = tr.gen_reservation_policy(
- demand_name_list, gp['onap.policies.optimization.InstanceReservationPolicy'])
+ demand_name_list, gp['onap.policies.optimization.resource.InstanceReservationPolicy'])
capacity_policy_list = tr.gen_capacity_policy(
- demand_name_list, gp['onap.policies.optimization.Vim_fit'])
+ demand_name_list, gp['onap.policies.optimization.resource.Vim_fit'])
hpa_policy_list = tr.gen_hpa_policy(
- demand_name_list, gp['onap.policies.optimization.HpaPolicy'])
+ demand_name_list, gp['onap.policies.optimization.resource.HpaPolicy'])
threshold_policy_list = tr.gen_threshold_policy(demand_name_list,
- gp['onap.policies.optimization.'
+ gp['onap.policies.optimization.resource.'
'ThresholdPolicy'])
+ aggregation_policy_list = tr.gen_aggregation_policy(demand_name_list,
+ gp['onap.policies.optimization.resource.'
+ 'AggregationPolicy'])
req_params_dict = _build_parameters(gp, service_info, request_parameters)
conductor_policies = [attribute_policy_list, distance_to_location_policy_list,
inventory_policy_list, resource_instance_policy_list,
resource_region_policy_list, zone_policy_list, reservation_policy_list,
- capacity_policy_list, hpa_policy_list, threshold_policy_list]
+ capacity_policy_list, hpa_policy_list, threshold_policy_list, aggregation_policy_list]
filtered_policies = [x for x in conductor_policies if len(x) > 0]
policy_groups = list_flatten(filtered_policies)
request_type = req_info.get('requestType', None)
diff --git a/osdf/adapters/conductor/translation.py b/osdf/adapters/conductor/translation.py
index 002af88..4b012f5 100644
--- a/osdf/adapters/conductor/translation.py
+++ b/osdf/adapters/conductor/translation.py
@@ -21,22 +21,22 @@ import json
import re
import yaml
-
from osdf.utils.programming_utils import dot_notation
policy_config_mapping = yaml.safe_load(open('config/has_config.yaml')).get('policy_config_mapping')
-CONSTRAINT_TYPE_MAP = {"onap.policies.optimization.AttributePolicy": "attribute",
- "onap.policies.optimization.DistancePolicy": "distance_to_location",
- "onap.policies.optimization.InventoryGroupPolicy": "inventory_group",
- "onap.policies.optimization.ResourceInstancePolicy": "instance_fit",
- "onap.policies.optimization.ResourceRegionPolicy": "region_fit",
- "onap.policies.optimization.AffinityPolicy": "zone",
- "onap.policies.optimization.InstanceReservationPolicy":
+CONSTRAINT_TYPE_MAP = {"onap.policies.optimization.resource.AttributePolicy": "attribute",
+ "onap.policies.optimization.resource.DistancePolicy": "distance_to_location",
+ "onap.policies.optimization.resource.InventoryGroupPolicy": "inventory_group",
+ "onap.policies.optimization.resource.ResourceInstancePolicy": "instance_fit",
+ "onap.policies.optimization.resource.ResourceRegionPolicy": "region_fit",
+ "onap.policies.optimization.resource.AffinityPolicy": "zone",
+ "onap.policies.optimization.resource.InstanceReservationPolicy":
"instance_reservation",
- "onap.policies.optimization.Vim_fit": "vim_fit",
- "onap.policies.optimization.HpaPolicy": "hpa",
- "onap.policies.optimization.ThresholdPolicy": "threshold"
+ "onap.policies.optimization.resource.Vim_fit": "vim_fit",
+ "onap.policies.optimization.resource.HpaPolicy": "hpa",
+ "onap.policies.optimization.resource.ThresholdPolicy": "threshold",
+ "onap.policies.optimization.resource.AggregationPolicy": "aggregation"
}
@@ -233,8 +233,16 @@ def gen_hpa_policy(vnf_list, hpa_policy):
def gen_threshold_policy(vnf_list, threshold_policy):
cur_policies, related_policies = gen_policy_instance(vnf_list, threshold_policy, rtype=None)
for p_new, p_main in zip(cur_policies, related_policies):
- pmz = p_main[list(p_main.keys())[0]]['properties']['thresholdProperty']
- p_new[p_main[list(p_main.keys())[0]]['properties']['identity']]['properties'] = pmz
+ pmz = p_main[list(p_main.keys())[0]]['properties']['thresholdProperties']
+ p_new[p_main[list(p_main.keys())[0]]['properties']['identity']]['properties'] = {'evaluate': pmz}
+ return cur_policies
+
+
+def gen_aggregation_policy(vnf_list, cross_policy):
+ cur_policies, related_policies = gen_policy_instance(vnf_list, cross_policy, rtype=None)
+ for p_new, p_main in zip(cur_policies, related_policies):
+ pmz = p_main[list(p_main.keys())[0]]['properties']['aggregationProperties']
+ p_new[p_main[list(p_main.keys())[0]]['properties']['identity']]['properties'] = {'evaluate': pmz}
return cur_policies
@@ -281,15 +289,6 @@ def get_demand_properties(demand, policies):
prop.update({'unique': policy_property['unique']} if 'unique' in policy_property and
policy_property['unique'] else {})
prop['filtering_attributes'] = dict()
- prop['filtering_attributes'].update({'global-customer-id': policy_property['customerId']}
- if 'customerId' in policy_property and policy_property['customerId'] else {})
- prop['filtering_attributes'].update({'model-invariant-id': demand['resourceModelInfo']['modelInvariantId']}
- if demand['resourceModelInfo']['modelInvariantId'] else {})
- prop['filtering_attributes'].update({'model-version-id': demand['resourceModelInfo']['modelVersionId']}
- if demand['resourceModelInfo']['modelVersionId'] else {})
- prop['filtering_attributes'].update({'equipment-role': policy_property['equipmentRole']}
- if 'equipmentRole' in policy_property and policy_property['equipmentRole'] else {})
-
if policy_property.get('attributes'):
for attr_key, attr_val in policy_property['attributes'].items():
update_converted_attribute(attr_key, attr_val, prop, 'filtering_attributes')
@@ -298,6 +297,15 @@ def get_demand_properties(demand, policies):
for attr_key, attr_val in policy_property['passthroughAttributes'].items():
update_converted_attribute(attr_key, attr_val, prop, 'passthrough_attributes')
+ prop['filtering_attributes'].update({'global-customer-id': policy_property['customerId']}
+ if 'customerId' in policy_property and policy_property['customerId'] else {})
+ prop['filtering_attributes'].update({'model-invariant-id': demand['resourceModelInfo']['modelInvariantId']}
+ if 'modelInvariantId' in demand['resourceModelInfo'] and demand['resourceModelInfo']['modelInvariantId'] else {})
+ prop['filtering_attributes'].update({'model-version-id': demand['resourceModelInfo']['modelVersionId']}
+ if 'modelVersionId' in demand['resourceModelInfo'] and demand['resourceModelInfo']['modelVersionId'] else {})
+ prop['filtering_attributes'].update({'equipment-role': policy_property['equipmentRole']}
+ if 'equipmentRole' in policy_property and policy_property['equipmentRole'] else {})
+
prop.update(get_candidates_demands(demand))
demand_properties.append(prop)
return demand_properties
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.AffinityPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.AffinityPolicy.yaml
deleted file mode 100644
index c2fd504..0000000
--- a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.AffinityPolicy.yaml
+++ /dev/null
@@ -1,62 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-policy_types:
- - onap.policies.Optimization:
- derived_from: tosca.policies.Root
- version: 1.0.0
- description: a base policy type for all policies that govern optimization
- - onap.policies.optimization.AffinityPolicy:
- derived_from: onap.policies.Optimization
- 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:
- - zone
- 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_upload/onap.policies.optimization.DistancePolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.DistancePolicy.yaml
deleted file mode 100644
index 93ddd63..0000000
--- a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.DistancePolicy.yaml
+++ /dev/null
@@ -1,82 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-policy_types:
- - onap.policies.Optimization:
- derived_from: tosca.policies.Root
- version: 1.0.0
- description: a base policy type for all policies that govern optimization
- - onap.policies.optimization.DistancePolicy:
- derived_from: onap.policies.Optimization
- 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:
- - distance_to_location
- 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_upload/onap.policies.optimization.HpaPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.HpaPolicy.yaml
deleted file mode 100644
index 63f0d8a..0000000
--- a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.HpaPolicy.yaml
+++ /dev/null
@@ -1,131 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-policy_types:
- - onap.policies.Optimization:
- derived_from: tosca.policies.Root
- version: 1.0.0
- description: a base policy type for all policies that govern optimization
- - onap.policies.optimization.HpaPolicy:
- derived_from: onap.policies.Optimization
- 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:
- - hpa
- resources:
- type: list
- required: true
- entry_schema:
- type: string
- 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:
- id:
- type: string
- required: true
- type:
- type: string
- required: true
- directives:
- type: list
- required: true
- entry_schema:
- type: policy.data.directives_properties
- flavorProperties:
- type: list
- required: true
- entry_schema:
- type: policy.data.flavorProperties_properties
- policy.data.directives_properties:
- derived_from: tosca.nodes.Root
- properties:
- type:
- type: string
- attributes:
- type: list
- entry_schema:
- type: policy.data.directives_attributes_properties
- policy.data.directives_attributes_properties:
- derived_from: tosca.nodes.Root
- properties:
- attribute_name:
- type: string
- attribute_value:
- type: string
- 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: false
- architecture:
- type: string
- required: true
- hpa-version:
- type: string
- required: true
- directives:
- type: list
- required: true
- entry_schema:
- type: policy.data.directives_properties
- 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: false
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.OptimizationPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.OptimizationPolicy.yaml
deleted file mode 100644
index edfac14..0000000
--- a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.OptimizationPolicy.yaml
+++ /dev/null
@@ -1,89 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-policy_types:
- - onap.policies.Optimization:
- derived_from: tosca.policies.Root
- version: 1.0.0
- description: a base policy type for all policies that govern optimization
- - onap.policies.optimization.OptimizationPolicy:
- derived_from: onap.policies.Optimization
- 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:
- - placement_optimization
- identity:
- type: string
- required: true
- objective:
- type: list
- required: true
- entry_schema:
- type: string
- constraints:
- - valid_values:
- - minimize
- - maximize
- objectiveParameter:
- type: policy.data.objectiveParameter_properties
- required: true
-data_types:
- policy.data.objectiveParameter_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
- customerLocationInfo:
- 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_upload/onap.policies.optimization.PciPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.PciPolicy.yaml
deleted file mode 100644
index 1355eb0..0000000
--- a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.PciPolicy.yaml
+++ /dev/null
@@ -1,58 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-policy_types:
- - onap.policies.Optimization:
- derived_from: tosca.policies.Root
- version: 1.0.0
- description: a base policy type for all policies that govern optimization
- - onap.policies.optimization.PciPolicy:
- derived_from: onap.policies.Optimization
- 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:
- - pciPolicy
- identity:
- type: string
- required: true
- resources:
- type: list
- required: true
- entry_schema:
- type: string
- pciProperties:
- type: list
- required: false
- entry_schema:
- - type:policy.data.pciProperties_properties
-data_types:
- policy.data.pciProperties_properties:
- derived_from: tosca.nodes.Root
- properties:
- algoCategory:
- type: string
- required: false
- pciOptmizationAlgoName:
- type: string
- required: false
- pciOptimizationNwConstraint:
- type: string
- required: false
- pciOptimizationPriority:
- type: string
- required: false
- pciOptimizationTimeConstraint:
- type: string
- required: false
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.QueryPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.QueryPolicy.yaml
deleted file mode 100644
index f7036dc..0000000
--- a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.QueryPolicy.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-policy_types:
- - onap.policies.Optimization:
- derived_from: tosca.policies.Root
- version: 1.0.0
- description: a base policy type for all policies that govern optimization
- - onap.policies.optimization.QueryPolicy:
- derived_from: onap.policies.Optimization
- 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:
- - request_param_query
- 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_upload/onap.policies.optimization.SubscriberPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.SubscriberPolicy.yaml
deleted file mode 100644
index 3c2c2b2..0000000
--- a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.SubscriberPolicy.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-policy_types:
- - onap.policies.Optimization:
- derived_from: tosca.policies.Root
- version: 1.0.0
- description: a base policy type for all policies that govern optimization
- - onap.policies.optimization.SubscriberPolicy:
- derived_from: onap.policies.Optimization
- 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_upload/onap.policies.optimization.Vim_fit.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.Vim_fit.yaml
deleted file mode 100644
index 860c37f..0000000
--- a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.Vim_fit.yaml
+++ /dev/null
@@ -1,56 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-policy_types:
- - onap.policies.Optimization:
- derived_from: tosca.policies.Root
- version: 1.0.0
- description: a base policy type for all policies that govern optimization
- - onap.policies.optimization.Vim_fit:
- derived_from: onap.policies.Optimization
- 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_upload/onap.policies.optimization.VnfPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.VnfPolicy.yaml
deleted file mode 100644
index e242a92..0000000
--- a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.VnfPolicy.yaml
+++ /dev/null
@@ -1,90 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-policy_types:
- - onap.policies.Optimization:
- derived_from: tosca.policies.Root
- version: 1.0.0
- description: a base policy type for all policies that govern optimization
- - onap.policies.optimization.VnfPolicy:
- derived_from: onap.policies.Optimization
- 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
- unique:
- type: string
- required: false
- attributes:
- type: list
- required: false
- entry_schema:
- type:policy.data.vnfProperties_filteringAttributes
- passthroughAttributes:
- type: list
- required: false
- entry_schema:
- type:policy.data.vnfProperties_passthroughAttributes
- policy.data.vnfProperties_filteringAttributes:
- derived_from: tosca.nodes.Root
- policy.data.vnfProperties_passthroughAttributes:
- derived_from: tosca.nodes.Root
-
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.AffinityPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.AffinityPolicy.yaml
new file mode 100644
index 0000000..3fb8525
--- /dev/null
+++ b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.AffinityPolicy.yaml
@@ -0,0 +1,31 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+policy_types:
+ onap.policies.optimization.resource.AffinityPolicy:
+ derived_from: onap.policies.optimization.Resource
+ version: 1.0.0
+ properties:
+ applicableResources:
+ type: list
+ required: true
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - any
+ - all
+ affinityProperties:
+ type: policy.data.affinityProperties_properties
+ required: true
+data_types:
+ policy.data.affinityProperties_properties:
+ derived_from: tosca.nodes.Root
+ properties:
+ qualifier:
+ type: string
+ constraints:
+ - valid_values:
+ - same
+ - different
+ category:
+ type: string
+ required: true \ No newline at end of file
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.AggregationPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.AggregationPolicy.yaml
new file mode 100644
index 0000000..1e3c813
--- /dev/null
+++ b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.AggregationPolicy.yaml
@@ -0,0 +1,42 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+policy_types:
+ onap.policies.optimization.resource.AggregationPolicy:
+ derived_from: onap.policies.optimization.Resource
+ version: 1.0.0
+ properties:
+ applicableResources:
+ type: list
+ required: true
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - any
+ - all
+ aggregationProperties:
+ type: list
+ required: true
+ entry_schema:
+ type: policy.data.aggregationProperties_properties
+data_types:
+ policy.data.aggregationProperties_properties:
+ derived_from: tosca.nodes.Root
+ properties:
+ attribute:
+ type: string
+ required: true
+ operator:
+ type: string
+ required: true
+ threshold:
+ type: policy.data.thresh_properties
+ required: true
+ unit:
+ type: string
+ required: false
+ function:
+ type: string
+ required: true
+ policy.data.thresh_properties:
+ derived_from: tosca.nodes.Root
+
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.DistancePolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.DistancePolicy.yaml
new file mode 100644
index 0000000..196ba9e
--- /dev/null
+++ b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.DistancePolicy.yaml
@@ -0,0 +1,56 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+policy_types:
+ onap.policies.optimization.resource.DistancePolicy:
+ derived_from: onap.policies.optimization.Resource
+ version: 1.0.0
+ properties:
+ 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
+ entry_schema:
+ type: policy.data.distance_properties
+ 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 \ No newline at end of file
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.HpaPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.HpaPolicy.yaml
new file mode 100644
index 0000000..fe7b864
--- /dev/null
+++ b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.HpaPolicy.yaml
@@ -0,0 +1,103 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+policy_types:
+ onap.policies.optimization.resource.HpaPolicy:
+ derived_from: onap.policies.optimization.Resource
+ version: 1.0.0
+ properties:
+ flavorFeatures:
+ type: list
+ required: true
+ entry_schema:
+ type: policy.data.flavorFeatures_properties
+data_types:
+ policy.data.flavorFeatures_properties:
+ derived_from: tosca.nodes.Root
+ properties:
+ id:
+ type: string
+ required: true
+ type:
+ type: string
+ required: true
+ directives:
+ type: list
+ required: true
+ entry_schema:
+ type: policy.data.directives_properties
+ flavorProperties:
+ type: list
+ required: true
+ entry_schema:
+ type: policy.data.flavorProperties_properties
+ policy.data.directives_properties:
+ derived_from: tosca.nodes.Root
+ properties:
+ type:
+ type: string
+ attributes:
+ type: list
+ entry_schema:
+ type: policy.data.directives_attributes_properties
+ policy.data.directives_attributes_properties:
+ derived_from: tosca.nodes.Root
+ properties:
+ attribute_name:
+ type: string
+ attribute_value:
+ type: string
+ 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: false
+ architecture:
+ type: string
+ required: true
+ hpa-version:
+ type: string
+ required: true
+ directives:
+ type: list
+ required: true
+ entry_schema:
+ type: policy.data.directives_properties
+ 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: false
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.OptimizationPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.OptimizationPolicy.yaml
new file mode 100644
index 0000000..fae050b
--- /dev/null
+++ b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.OptimizationPolicy.yaml
@@ -0,0 +1,66 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+policy_types:
+ onap.policies.optimization.resource.OptimizationPolicy:
+ derived_from: onap.policies.optimization.Resource
+ version: 1.0.0
+ properties:
+ objective:
+ type: list
+ required: true
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - minimize
+ - maximize
+ objectiveParameter:
+ type: policy.data.objectiveParameter_properties
+ required: true
+data_types:
+ policy.data.objectiveParameter_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
+ customerLocationInfo:
+ 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:
+ - '*'
+ - +
+ - '-'
+ - /
+ - '%' \ No newline at end of file
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.PciPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.PciPolicy.yaml
new file mode 100644
index 0000000..021cff9
--- /dev/null
+++ b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.PciPolicy.yaml
@@ -0,0 +1,30 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+policy_types:
+ onap.policies.optimization.resource.PciPolicy:
+ derived_from: onap.policies.optimization.Resource
+ version: 1.0.0
+ properties:
+ pciProperties:
+ type: list
+ required: false
+ entry_schema:
+ type: policy.data.pciProperties_properties
+data_types:
+ policy.data.pciProperties_properties:
+ derived_from: tosca.nodes.Root
+ properties:
+ algoCategory:
+ type: string
+ required: false
+ pciOptmizationAlgoName:
+ type: string
+ required: false
+ pciOptimizationNwConstraint:
+ type: string
+ required: false
+ pciOptimizationPriority:
+ type: string
+ required: false
+ pciOptimizationTimeConstraint:
+ type: string
+ required: false \ No newline at end of file
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.ThresholdPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.ThresholdPolicy.yaml
new file mode 100644
index 0000000..ab400dd
--- /dev/null
+++ b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.ThresholdPolicy.yaml
@@ -0,0 +1,37 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+policy_types:
+ onap.policies.optimization.resource.ThresholdPolicy:
+ derived_from: onap.policies.optimization.Resource
+ version: 1.0.0
+ properties:
+ applicableResources:
+ type: list
+ required: true
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - any
+ - all
+ thresholdProperties:
+ type: list
+ required: true
+ entry_schema:
+ type: policy.data.thresholdProperties_properties
+data_types:
+ policy.data.thresholdProperties_properties:
+ derived_from: tosca.nodes.Root
+ properties:
+ attribute:
+ type: string
+ required: true
+ operator:
+ type: string
+ required: true
+ threshold:
+ type: float
+ required: true
+ unit:
+ type: string
+ required: false
+
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.Vim_fit.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.Vim_fit.yaml
new file mode 100644
index 0000000..6ba2ae1
--- /dev/null
+++ b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.Vim_fit.yaml
@@ -0,0 +1,28 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+policy_types:
+ onap.policies.optimization.resource.Vim_fit:
+ derived_from: onap.policies.optimization.Resource
+ version: 1.0.0
+ properties:
+ applicableResources:
+ type: list
+ required: true
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - any
+ - all
+ 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 \ No newline at end of file
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.VnfPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.VnfPolicy.yaml
new file mode 100644
index 0000000..1c7d3b6
--- /dev/null
+++ b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.resource.VnfPolicy.yaml
@@ -0,0 +1,44 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+policy_types:
+ onap.policies.optimization.resource.VnfPolicy:
+ derived_from: onap.policies.optimization.Resource
+ version: 1.0.0
+ properties:
+ 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 \ No newline at end of file
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.service.QueryPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.service.QueryPolicy.yaml
new file mode 100644
index 0000000..2a615ab
--- /dev/null
+++ b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.service.QueryPolicy.yaml
@@ -0,0 +1,24 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+policy_types:
+ onap.policies.optimization.service.QueryPolicy:
+ derived_from: onap.policies.optimization.Service
+ version: 1.0.0
+ properties:
+ 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 \ No newline at end of file
diff --git a/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.service.SubscriberPolicy.yaml b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.service.SubscriberPolicy.yaml
new file mode 100644
index 0000000..60da742
--- /dev/null
+++ b/osdf/models/policy/placement/tosca_upload/onap.policies.optimization.service.SubscriberPolicy.yaml
@@ -0,0 +1,34 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+policy_types:
+ onap.policies.optimization.service.SubscriberPolicy:
+ derived_from: onap.policies.optimization.Service
+ version: 1.0.0
+ properties:
+ subscriberProperties:
+ type: policy.data.subscriberProperties_properties
+ required: true
+data_types:
+ policy.data.subscriberProperties_properties:
+ derived_from: tosca.nodes.Root
+ properties:
+ subscriberName:
+ type: list
+ required: true
+ metadata:
+ contextProvider: true
+ entry_schema:
+ type: string
+ subscriberRole:
+ type: list
+ required: true
+ metadata:
+ contextMatchable: scope
+ entry_schema:
+ type: string
+ provStatus:
+ type: list
+ required: true
+ metadata:
+ contextAttribute: true
+ entry_schema:
+ type: string \ No newline at end of file
diff --git a/test/apps/slice_selection/slice_policies.txt b/test/apps/slice_selection/slice_policies.txt
index e4ccb65..55c934b 100644
--- a/test/apps/slice_selection/slice_policies.txt
+++ b/test/apps/slice_selection/slice_policies.txt
@@ -1,4 +1,4 @@
subscriber_policy_URLLC_1.json
-thresholdPolicy_URLLC_Core_1_latency.json
-thresholdPolicy_URLLC_Core_1_reliability.json
-vnfPolicy_URLLC_Core_1.json \ No newline at end of file
+thresholdPolicy_URLLC_Core_1.json
+vnfPolicy_URLLC_Core_1.json
+aggregationPolicy_URLLC_1.json
diff --git a/test/policy-local-files/Affinity_vCPE_1.json b/test/policy-local-files/Affinity_vCPE_1.json
index 4f111eb..5364d5d 100644
--- a/test/policy-local-files/Affinity_vCPE_1.json
+++ b/test/policy-local-files/Affinity_vCPE_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Affinity_vCPE_1": {
- "type": "onap.policies.optimization.AffinityPolicy",
+ "type": "onap.policies.optimization.resource.AffinityPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Affinity_vFW_TD.json b/test/policy-local-files/Affinity_vFW_TD.json
index 53bb31b..5df3bf4 100644
--- a/test/policy-local-files/Affinity_vFW_TD.json
+++ b/test/policy-local-files/Affinity_vFW_TD.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Affinity_vFW_TD": {
- "type": "onap.policies.optimization.AffinityPolicy",
+ "type": "onap.policies.optimization.resource.AffinityPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Attribute_vNS_1.json b/test/policy-local-files/Attribute_vNS_1.json
index 35b3c74..97c967c 100644
--- a/test/policy-local-files/Attribute_vNS_1.json
+++ b/test/policy-local-files/Attribute_vNS_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Attribute_vNS_1": {
- "type": "onap.policies.optimization.AttributePolicy",
+ "type": "onap.policies.optimization.resource.AttributePolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Capacity_vGMuxInfra.json b/test/policy-local-files/Capacity_vGMuxInfra.json
index 1d6d26d..7ce02bf 100644
--- a/test/policy-local-files/Capacity_vGMuxInfra.json
+++ b/test/policy-local-files/Capacity_vGMuxInfra.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Capacity_vGMuxInfra": {
- "type": "onap.policies.optimization.Vim_fit",
+ "type": "onap.policies.optimization.resource.Vim_fit",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Capacity_vG_1.json b/test/policy-local-files/Capacity_vG_1.json
index f07e7bc..c897a87 100644
--- a/test/policy-local-files/Capacity_vG_1.json
+++ b/test/policy-local-files/Capacity_vG_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Capacity_vG_1": {
- "type": "onap.policies.optimization.Vim_fit",
+ "type": "onap.policies.optimization.resource.Vim_fit",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Distance_vGMuxInfra_1.json b/test/policy-local-files/Distance_vGMuxInfra_1.json
index 7de102e..163d0df 100644
--- a/test/policy-local-files/Distance_vGMuxInfra_1.json
+++ b/test/policy-local-files/Distance_vGMuxInfra_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Distance_vGMuxInfra": {
- "type": "onap.policies.optimization.DistancePolicy",
+ "type": "onap.policies.optimization.resource.DistancePolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Distance_vG_1.json b/test/policy-local-files/Distance_vG_1.json
index dcb45b2..aa6badc 100644
--- a/test/policy-local-files/Distance_vG_1.json
+++ b/test/policy-local-files/Distance_vG_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Distance_vG_1": {
- "type": "onap.policies.optimization.DistancePolicy",
+ "type": "onap.policies.optimization.resource.DistancePolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Placement_Optimization_1.json b/test/policy-local-files/Placement_Optimization_1.json
index b3efa64..62b024c 100644
--- a/test/policy-local-files/Placement_Optimization_1.json
+++ b/test/policy-local-files/Placement_Optimization_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Placement_optimization_1": {
- "type": "onap.policies.optimization.OptimizationPolicy",
+ "type": "onap.policies.optimization.resource.OptimizationPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/QueryPolicy_vCPE.json b/test/policy-local-files/QueryPolicy_vCPE.json
index 1a8d205..3bcc67e 100644
--- a/test/policy-local-files/QueryPolicy_vCPE.json
+++ b/test/policy-local-files/QueryPolicy_vCPE.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.queryPolicy_vCPE": {
- "type": "onap.policies.optimization.QueryPolicy",
+ "type": "onap.policies.optimization.service.QueryPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/QueryPolicy_vCPE_2.json b/test/policy-local-files/QueryPolicy_vCPE_2.json
index 7a4d227..3d9f4ca 100644
--- a/test/policy-local-files/QueryPolicy_vCPE_2.json
+++ b/test/policy-local-files/QueryPolicy_vCPE_2.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.queryPolicy_vCPE": {
- "type": "onap.policies.optimization.QueryPolicy",
+ "type": "onap.policies.optimization.service.QueryPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/QueryPolicy_vFW_TD.json b/test/policy-local-files/QueryPolicy_vFW_TD.json
index 1a6eb21..ab199ac 100644
--- a/test/policy-local-files/QueryPolicy_vFW_TD.json
+++ b/test/policy-local-files/QueryPolicy_vFW_TD.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.queryPolicy_vFW_TD": {
- "type": "onap.policies.optimization.QueryPolicy",
+ "type": "onap.policies.optimization.service.QueryPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/aggregationPolicy_URLLC_1.json b/test/policy-local-files/aggregationPolicy_URLLC_1.json
new file mode 100644
index 0000000..13014c1
--- /dev/null
+++ b/test/policy-local-files/aggregationPolicy_URLLC_1.json
@@ -0,0 +1,37 @@
+{
+ "OSDF_FRANKFURT.Aggregation_URLLC_1":{
+ "type":"onap.policies.optimization.resource.AggregationPolicy",
+ "version":"1.0.0",
+ "type_version":"1.0.0",
+ "metadata":{
+ "policy-id":"OSDF_FRANKFURT.Aggregation_URLLC_1",
+ "policy-version":1
+ },
+ "properties":{
+ "scope":[
+ "OSDF_FRANKFURT",
+ "URLLC_1"
+ ],
+ "geography": [],
+ "resources":[
+ "URLLC_Core_1"
+ ],
+ "services":[
+ "URLLC_1"
+ ],
+ "identity":"Aggregation_URLLC_1",
+ "applicableResources":"any",
+ "aggregationProperties":[
+ {
+ "attribute":"latency",
+ "function":"sum",
+ "operator":"lte",
+ "threshold":{
+ "get_param": "latency"
+ },
+ "unit":"ms"
+ }
+ ]
+ }
+ }
+} \ No newline at end of file
diff --git a/test/policy-local-files/hpa_policy_vGMuxInfra_1.json b/test/policy-local-files/hpa_policy_vGMuxInfra_1.json
index c233c5f..b6317f8 100644
--- a/test/policy-local-files/hpa_policy_vGMuxInfra_1.json
+++ b/test/policy-local-files/hpa_policy_vGMuxInfra_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.hpa_policy_vGMuxInfra_1": {
- "type": "onap.policies.optimization.HpaPolicy",
+ "type": "onap.policies.optimization.resource.HpaPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/hpa_policy_vG_1.json b/test/policy-local-files/hpa_policy_vG_1.json
index 4f9a7b4..59ba4b1 100644
--- a/test/policy-local-files/hpa_policy_vG_1.json
+++ b/test/policy-local-files/hpa_policy_vG_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.hpa_policy_vG_1": {
- "type": "onap.policies.optimization.HpaPolicy",
+ "type": "onap.policies.optimization.resource.HpaPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/queryPolicy_URLLC_.json b/test/policy-local-files/queryPolicy_URLLC_.json
new file mode 100644
index 0000000..3114234
--- /dev/null
+++ b/test/policy-local-files/queryPolicy_URLLC_.json
@@ -0,0 +1,29 @@
+{
+ "OSDF_FRANKFURT.queryPolicy_URLLC_1": {
+ "type": "onap.policies.optimization.service.QueryPolicy",
+ "version": "1.0.0",
+ "type_version": "1.0.0",
+ "metadata": {
+ "policy-id": "OSDF_FRANKFURT.queryPolicy_URLLC_1",
+ "policy-version": 1
+ },
+ "properties": {
+ "scope": [
+ "OSDF_FRANKFURT"
+ ],
+ "services": [
+ "URLLC_1"
+ ],
+ "geography": [
+ "US"
+ ],
+ "identity": "queryPolicy_URLLC_1",
+ "queryProperties": [
+ {
+ "attribute": "latency",
+ "attribute_location": "latency"
+ }
+ ]
+ }
+ }
+}
diff --git a/test/policy-local-files/subscriber_policy_URLLC_1.json b/test/policy-local-files/subscriber_policy_URLLC_1.json
index ffa4d79..d147273 100644
--- a/test/policy-local-files/subscriber_policy_URLLC_1.json
+++ b/test/policy-local-files/subscriber_policy_URLLC_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.SubscriberPolicy_URLLC_1": {
- "type": "onap.policies.optimization.SubscriberPolicy",
+ "type": "onap.policies.optimization.service.SubscriberPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
@@ -19,16 +19,8 @@
"properties": {
"subscriberName": [
"URLLC_Core_1"
- ],
- "subscriberRole": [
- {
- "URLLC_Core_1": {
- "modelInvariantId": "21d57d4b-52ad-4d3c-a798-248b5bb9124a",
- "modelVersionId": "bfba363e-e39c-4bd9-a9d5-1371c28f4d22"
- }
- }
]
- }
}
}
}
+}
diff --git a/test/policy-local-files/subscriber_policy_vCPE.json b/test/policy-local-files/subscriber_policy_vCPE.json
index 305ce58..c02d8d6 100644
--- a/test/policy-local-files/subscriber_policy_vCPE.json
+++ b/test/policy-local-files/subscriber_policy_vCPE.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.SubscriberPolicy_v1": {
- "type": "onap.policies.optimization.SubscriberPolicy",
+ "type": "onap.policies.optimization.service.SubscriberPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/thresholdPolicy_URLLC_Core_1.json b/test/policy-local-files/thresholdPolicy_URLLC_Core_1.json
new file mode 100644
index 0000000..6c602ee
--- /dev/null
+++ b/test/policy-local-files/thresholdPolicy_URLLC_Core_1.json
@@ -0,0 +1,41 @@
+{
+ "OSDF_FRANKFURT.Threshold_URLLC_Core_1":{
+ "type":"onap.policies.optimization.resource.ThresholdPolicy",
+ "version":"1.0.0",
+ "type_version":"1.0.0",
+ "metadata":{
+ "policy-id":"OSDF_FRANKFURT.Threshold_URLLC_Core_1",
+ "policy-version":1
+ },
+ "properties":{
+ "scope":[
+ "OSDF_FRANKFURT",
+ "URLLC_1",
+ "URLLC_Core_1"
+ ],
+ "resources":[
+ "URLLC_Core_1"
+ ],
+ "services":[
+ "URLLC_1"
+ ],
+ "geography": [],
+ "identity":"Threshold_URLLC_Core_1",
+ "thresholdProperties":[
+ {
+ "attribute":"latency",
+ "operator":"lte",
+ "threshold":5,
+ "unit":"ms"
+ },
+ {
+ "attribute":"reliability",
+ "operator":"gte",
+ "threshold":99.999,
+ "unit":""
+ }
+
+ ]
+ }
+ }
+} \ No newline at end of file
diff --git a/test/policy-local-files/thresholdPolicy_URLLC_Core_1_latency.json b/test/policy-local-files/thresholdPolicy_URLLC_Core_1_latency.json
deleted file mode 100644
index 35106f6..0000000
--- a/test/policy-local-files/thresholdPolicy_URLLC_Core_1_latency.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "OSDF_FRANKFURT.Threshold_URLLC_Core_1": {
- "type": "onap.policies.optimization.ThresholdPolicy",
- "version": "1.0.0",
- "type_version": "1.0.0",
- "metadata": {
- "policy-id": "OSDF_FRANKFURT.Threshold_URLLC_Core_1_latency",
- "policy-version": 1
- },
- "properties": {
- "scope": [
- "OSDF_FRANKFURT",
- "URLLC_1",
- "URLLC_Core_1"
- ],
- "resources": [
- "URLLC_Core_1"
- ],
- "services": [
- "URLLC_1"
- ],
- "identity": "Threshold_URLLC_Core_1_latency",
- "applicableResources": "any",
- "thresholdProperty": {
- "attribute": "latency",
- "operator": "lte",
- "threshold": 5,
- "unit": "ms"
- }
- }
- }
-} \ No newline at end of file
diff --git a/test/policy-local-files/thresholdPolicy_URLLC_Core_1_reliability.json b/test/policy-local-files/thresholdPolicy_URLLC_Core_1_reliability.json
deleted file mode 100644
index 56089f0..0000000
--- a/test/policy-local-files/thresholdPolicy_URLLC_Core_1_reliability.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "OSDF_FRANKFURT.Threshold_URLLC_Core_1": {
- "type": "onap.policies.optimization.ThresholdPolicy",
- "version": "1.0.0",
- "type_version": "1.0.0",
- "metadata": {
- "policy-id": "OSDF_FRANKFURT.Threshold_URLLC_Core_1_reliability",
- "policy-version": 1
- },
- "properties": {
- "scope": [
- "OSDF_FRANKFURT",
- "URLLC_1",
- "URLLC_Core_1"
- ],
- "resources": [
- "URLLC_Core_1"
- ],
- "services": [
- "URLLC_1"
- ],
- "identity": "Threshold_URLLC_Core_1_reliability",
- "applicableResources": "any",
- "thresholdProperty": {
- "attribute":"reliability",
- "operator":"gte",
- "threshold":99.999,
- "unit":""
- }
- }
- }
-} \ No newline at end of file
diff --git a/test/policy-local-files/vnfPolicy_URLLC_Core_1.json b/test/policy-local-files/vnfPolicy_URLLC_Core_1.json
index 6582c17..0fa69fa 100644
--- a/test/policy-local-files/vnfPolicy_URLLC_Core_1.json
+++ b/test/policy-local-files/vnfPolicy_URLLC_Core_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.vnfPolicy_URLLC_Core_1": {
- "type": "onap.policies.optimization.VnfPolicy",
+ "type": "onap.policies.optimization.resource.VnfPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
@@ -28,7 +28,9 @@
"region": "RegionOne",
"attributes": {
"orchestrationStatus": "active",
- "service-role": "nssi"
+ "service-role": "nssi",
+ "modelInvariantId":"bfbg3636-e39c-iidd-0987-27c28f4oo3",
+ "modelVersionId":"bfbg3636-e39c-iidd-0987-27c28f4d33"
}
}
]
diff --git a/test/policy-local-files/vnfPolicy_vFW_TD.json b/test/policy-local-files/vnfPolicy_vFW_TD.json
index 387ed56..e63e2c2 100644
--- a/test/policy-local-files/vnfPolicy_vFW_TD.json
+++ b/test/policy-local-files/vnfPolicy_vFW_TD.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.vnfPolicy_vFW_TD": {
- "type": "onap.policies.optimization.VnfPolicy",
+ "type": "onap.policies.optimization.resource.VnfPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/vnfPolicy_vG.json b/test/policy-local-files/vnfPolicy_vG.json
index 786ffc2..2dea670 100644
--- a/test/policy-local-files/vnfPolicy_vG.json
+++ b/test/policy-local-files/vnfPolicy_vG.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.vnfPolicy_vG": {
- "type": "onap.policies.optimization.VnfPolicy",
+ "type": "onap.policies.optimization.resource.VnfPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/vnfPolicy_vGMuxInfra.json b/test/policy-local-files/vnfPolicy_vGMuxInfra.json
index deb34fd..65475a9 100644
--- a/test/policy-local-files/vnfPolicy_vGMuxInfra.json
+++ b/test/policy-local-files/vnfPolicy_vGMuxInfra.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.vnfPolicy_vGMuxInfra": {
- "type": "onap.policies.optimization.VnfPolicy",
+ "type": "onap.policies.optimization.resource.VnfPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/vnfPolicy_vPGN_TD.json b/test/policy-local-files/vnfPolicy_vPGN_TD.json
index c441156..077901a 100644
--- a/test/policy-local-files/vnfPolicy_vPGN_TD.json
+++ b/test/policy-local-files/vnfPolicy_vPGN_TD.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.vnfPolicy_vPGN_TD": {
- "type": "onap.policies.optimization.VnfPolicy",
+ "type": "onap.policies.optimization.resource.VnfPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/test_PolicyCalls.py b/test/test_PolicyCalls.py
index c41c487..d4dc37f 100644
--- a/test/test_PolicyCalls.py
+++ b/test/test_PolicyCalls.py
@@ -101,7 +101,7 @@ class TestPolicyCalls(unittest.TestCase):
req_json = json.loads(open(req_json).read())
# need to run this only on vnf policies
vnf_policies = [x for x in self.policies if x[list(x.keys())[0]]["type"] ==
- "onap.policies.optimization.VnfPolicy"]
+ "onap.policies.optimization.resource.VnfPolicy"]
gen_demands = translation.gen_demands(req_json['placementInfo']['placementDemands'], vnf_policies)
for action in req_json['placementInfo']['placementDemands']: