Corrections for northbound 73/57573/3
authorgaurav <gaurav.agrawal@huawei.com>
Wed, 25 Jul 2018 17:33:00 +0000 (23:03 +0530)
committerGaurav Agrawal <gaurav.agrawal@huawei.com>
Mon, 30 Jul 2018 11:09:58 +0000 (11:09 +0000)
Changes includes:
1. Correcting connection-attachment topology container name.
2. Make the vnf-topology-operation implementation flexible to allow
SDNC generate vnf-id for assign/create operation rather then mandating
SO to provide it.

Change-Id: I8958a72a4ca2064b781d246e9329436848f578ad
Issue-ID: SDNC-384
Signed-off-by: Gaurav Agrawal <gaurav.agrawal@huawei.com>
generic-resource-api/model/src/main/yang/GENERIC-RESOURCE-API.yang
generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java
generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/VnfTopologyOperationRPCTest.java

index 7a0b52b..5e5fc15 100644 (file)
@@ -1977,7 +1977,7 @@ module GENERIC-RESOURCE-API {
    }\r
 \r
    grouping connection-attachment-topology {\r
-      container brg-topology {\r
+      container connection-attachment-topology {\r
          uses allotted-resource-identifiers;\r
          uses onap-model-information;\r
          uses connection-attachment-assignments;\r
index 02217b5..8946600 100644 (file)
@@ -807,6 +807,8 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
 
         trySetSvcRequestId(input, responseBuilder);
 
+        /* Comment out mandatory check for vnf id for scenario wherein for assign/create request vnf-id is generated by
+        SDNC itself.
         if (hasInvalidVnfId(input)) {
             log.debug("exiting {} because of null or empty vnf-id", svcOperation);
             responseBuilder.setResponseCode("404");
@@ -818,6 +820,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
 
             return Futures.immediateFuture(rpcResult);
         }
+        */
 
         String vnfId = input.getVnfInformation().getVnfId();
         ServiceDataBuilder serviceDataBuilder = new ServiceDataBuilder();
index 7e657dc..3c7b6ff 100644 (file)
@@ -57,6 +57,7 @@ public class VnfTopologyOperationRPCTest extends GenericResourceApiProviderTest
     }
 
 
+    /*
     @Test
     public void should_fail_when_invalid_vnf_id() throws Exception {
 
@@ -72,7 +73,7 @@ public class VnfTopologyOperationRPCTest extends GenericResourceApiProviderTest
         assertEquals("404", output.getResponseCode());
         assertEquals("invalid input, null or empty vnf-id", output.getResponseMessage());
         assertEquals("Y", output.getAckFinalIndicator());
-    }
+    }*/
 
 
     @Test