Add swagger.json to main/resources.
[aai/esr-server.git] / esr-mgr / src / main / java / org / onap / aai / esr / resource / ThirdpatySdncManager.java
index 4a72261..8660ade 100644 (file)
@@ -21,6 +21,7 @@ import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
+import io.swagger.annotations.SwaggerDefinition;
 
 import org.eclipse.jetty.http.HttpStatus;
 import org.onap.aai.esr.entity.rest.ThirdpartySdncRegisterInfo;
@@ -40,16 +41,17 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+@SwaggerDefinition
 @Path("/sdncontrollers")
 @Api(tags = {"ThirdParty sdnc Management     "})
 public class ThirdpatySdncManager {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(ThirdpatySdncManager.class);
 
+  private static ExtsysUtil extsysUtil = new ExtsysUtil();
   /**
    *query all thirdParty sdnc.
    */
-  @Path("")
   @GET
   @ApiOperation(value = "get all thirdParty sdnc ")
   @Produces(MediaType.APPLICATION_JSON)
@@ -123,15 +125,14 @@ public class ThirdpatySdncManager {
   @Timed
   public Response updateThirdpartySdnc(@ApiParam(value = "thirdpartySdnc", required = true) ThirdpartySdncRegisterInfo thirdPartySdnc,
       @ApiParam(value = "sdnc id", required = true) @PathParam("thirdPartySdncId") String thirdPartySdncId) {
-    LOGGER.info("start update sdnc .id:" + thirdPartySdncId + " info:" + ExtsysUtil.objectToString(thirdPartySdnc));
-    return ThirdpatySdncWrapper.getInstance().updateThirdpartySdnc(thirdPartySdnc);
+    LOGGER.info("start update sdnc .id:" + thirdPartySdncId + " info:" + extsysUtil.objectToString(thirdPartySdnc));
+    return ThirdpatySdncWrapper.getInstance().updateThirdpartySdnc(thirdPartySdnc, thirdPartySdncId);
   }
   
   /**
    *thirdParty sdnc register.
    */
   @POST
-  @Path("")
   @Consumes(MediaType.APPLICATION_JSON)
   @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
   @ApiOperation(value = "register a thirdparty sdnc")
@@ -144,7 +145,7 @@ public class ThirdpatySdncManager {
           response = String.class)})
   @Timed
   public Response registerThirdpatySdnc(@ApiParam(value = "thirdPartySdnc", required = true) ThirdpartySdncRegisterInfo thirdPartySdnc) {
-    LOGGER.info("start register sdnc" + " info:" + ExtsysUtil.objectToString(thirdPartySdnc));
+    LOGGER.info("start register sdnc" + " info:" + extsysUtil.objectToString(thirdPartySdnc));
     return ThirdpatySdncWrapper.getInstance().registerThirdpartySdnc(thirdPartySdnc);
   }
 }