Realize the update PNF API.
[aai/esr-server.git] / esr-mgr / src / main / java / org / onap / aai / esr / wrapper / PnfManagerWrapper.java
index 0683769..7b5cf29 100644 (file)
@@ -145,9 +145,17 @@ public class PnfManagerWrapper {
      * @param pnfId
      * @return
      */
-    public Response updatePnf(PnfRegisterInfo pnf, String pnfId) {
-        // TODO Auto-generated method stub
-        return null;
+    public Response updatePnf(PnfRegisterInfo pnfRegisterInfo, String pnfId) {
+        String resourceVersion = getResourceVersion(pnfId);
+        Pnf pnf = pnfManagerUtil.pnfRegisterInfo2pnf(pnfRegisterInfo);
+        pnf.setResourceVersion(resourceVersion);
+        try {
+            networkProxy.registerPnf(pnfId, pnf);
+            return Response.ok().build();
+        } catch (ExtsysException e) {
+            LOG.error("Update PNF failed !", e);
+            throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+        }
     }
 
     /**