Unique field moved to vnf policy 36/97336/2
authorLukasz Rajewski <lukasz.rajewski@orange.com>
Sun, 20 Oct 2019 19:36:37 +0000 (21:36 +0200)
committerLukasz Rajewski <lukasz.rajewski@orange.com>
Mon, 21 Oct 2019 06:53:22 +0000 (08:53 +0200)
Unique req field was moved from OSDF request
to VNF policy -> content -> vnfProperties

Change-Id: I96b8a2bb881370cdb8d86b52ad4798e24e98425d
Issue-ID: OPTFRA-482
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
osdf/models/api/placementRequest.py
osdf/models/policy/placement/tosca/vnfPolicy-v20181031.yml
osdf/models/policy/placement/tosca_upload/onap.policies.optimization.VnfPolicy.yaml
osdf/optimizers/placementopt/conductor/translation.py
test/placement-tests/request_placement_vfmod.json
test/placement-tests/request_vfmod.json
test/policy-local-files/vnfPolicy_vPGN_TD.json

index 7d6bde4..a10ddc3 100644 (file)
@@ -71,7 +71,6 @@ class PlacementDemand(OSDFModel):
     resourceModuleName = StringType(required=True)
     serviceResourceId = StringType(required=True)
     tenantId = StringType()
-    unique = BooleanType() # to be implemented on the policy level
     resourceModelInfo = ModelType(ModelMetaData, required=True)
     existingCandidates = ListType(ModelType(Candidates))
     excludedCandidates = ListType(ModelType(Candidates))
index 4ce3b9f..46d8c32 100644 (file)
@@ -66,3 +66,6 @@ data_types:
             customerId:
                 type: string
                 required: true
+            unique:
+                type: string
+                required: false
index 13d4f13..e1ec36d 100644 (file)
@@ -70,4 +70,7 @@ data_types:
             customerId:
                 type: string
                 required: true
+            unique:
+                type: string
+                required: false
 
index d14f3e1..046e6e8 100644 (file)
@@ -229,7 +229,8 @@ def get_demand_properties(demand, policies):
                     service_type=demand['serviceResourceId'],
                     service_resource_id=demand['serviceResourceId'])
 
-        prop.update({'unique': demand['unique']} if demand.get('unique') else {})
+        prop.update({'unique': policy_property['unique']} if 'unique' in policy_property and
+                                                             policy_property['unique'] else {})
         prop['attributes'] = dict()
         prop['attributes'].update({'global-customer-id': policy_property['customerId']}
                                   if policy_property['customerId'] else {})
index 7c3a2e1..e9f1966 100644 (file)
@@ -74,7 +74,7 @@
                 },
                 "inventory_provider": "aai",
                 "service_resource_id": "vPGN-XX",
-                "unique": "false",
+                "unique": "False",
                 "inventory_type": "vfmodule",
                 "service_type": "vPGN-XX"
             }]
index 1e95e22..1a8a462 100644 (file)
@@ -39,7 +39,6 @@
             {
                 "resourceModuleName": "vPGN",
                 "serviceResourceId": "vPGN-XX",
-                "unique": "false",
                 "resourceModelInfo": {
                     "modelInvariantId": "762472ef-5284-4daa-ab32-3e7bee2ec355",
                     "modelVersionId": "e02a7e5c-9d27-4360-ab7c-73bb83b07e3b"
index 7b374b4..3724f8a 100644 (file)
@@ -26,6 +26,7 @@
                 "get_param": "chosen_customer_id"
             },
             "equipmentRole": "",
+            "unique": "False",
             "attributes": {
                 "orchestrationStatus": ["active"],
                 "provStatus": "ACTIVE",