Add /serviceInstances/ to SO URL for scale-out 95/71595/1
authorJim Hahn <jrh3@att.com>
Wed, 31 Oct 2018 22:09:19 +0000 (18:09 -0400)
committerJim Hahn <jrh3@att.com>
Wed, 31 Oct 2018 22:47:44 +0000 (22:47 +0000)
Also reformatted line that was subsequently too long.

Change-Id: I5c634c5157f18de64d37a0f451cd65f3002f35d3
Issue-ID: POLICY-1238
Signed-off-by: Jim Hahn <jrh3@att.com>
controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOManager.java
controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoDummyServer.java
controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java

index 20b1ac5..6557be4 100644 (file)
@@ -179,8 +179,8 @@ public final class SOManager {
 
             if (request.getOperationType() != null && request.getOperationType()
                     .equals(SoOperationType.SCALE_OUT)) {
-                url = urlBase + "/serviceInstantiation/v7/" + serviceInstanceId + "/vnfs/" + vnfInstanceId
-                        + "/vfModules/scaleOut";
+                url = urlBase + "/serviceInstantiation/v7/serviceInstances/" + serviceInstanceId + "/vnfs/"
+                                + vnfInstanceId + "/vfModules/scaleOut";
                 netLogger.info("[OUT|{}|{}|]{}{}", "SO", url, LINE_SEPARATOR, soJson);
                 httpResponse = restManager.post(url, username, password, createSimpleHeaders(), MEDIA_TYPE, soJson);
             } else if (request.getOperationType() != null && request.getOperationType()
index 0d719e5..2a352b0 100644 (file)
@@ -93,7 +93,7 @@ public class TestSoDummyServer {
      * @return http response
      */
     @POST
-    @Path("/serviceInstantiation/v7/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut")
+    @Path("/serviceInstantiation/v7/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut")
     public Response servicePostRequestVfModules(@PathParam("serviceInstanceId") final String serviceInstanceId,
                     @PathParam("vnfInstanceId") final String vnfInstanceId, final String jsonString) {
         postMessagesReceived++;
index 8bab8bb..c99fc12 100644 (file)
@@ -44,7 +44,7 @@ public class SoSimulatorJaxRs {
      * @return the response
      */
     @POST
-    @Path("/v7/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut")
+    @Path("/v7/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces("application/json")
     public String soPostQuery(@PathParam("serviceInstanceId") final String serviceInstanceId,
index 772dd7f..86f7b3e 100644 (file)
@@ -139,7 +139,8 @@ public class SoSimulatorTest {
     public void testResponse() {
         final String request = Serialization.gsonPretty.toJson(this.createTestRequest());
         final Pair<Integer, String> httpDetails = new RESTManager().post(
-                        "http://localhost:6667/serviceInstantiation/v7/12345/vnfs/12345/vfModules/scaleOut", "username",
+                        "http://localhost:6667/serviceInstantiation/v7/serviceInstances/12345/vnfs/12345/vfModules/scaleOut",
+                        "username",
                         "password", new HashMap<>(), "application/json", request);
         assertNotNull(httpDetails);
         final SOResponse response = Serialization.gsonPretty.fromJson(httpDetails.second, SOResponse.class);