diff --git a/afs/afs-ws/afs-ws-server/src/main/java/com/powsybl/afs/ws/server/AppStorageServer.java b/afs/afs-ws/afs-ws-server/src/main/java/com/powsybl/afs/ws/server/AppStorageServer.java index 509f0aa521b..c825910a83d 100644 --- a/afs/afs-ws/afs-ws-server/src/main/java/com/powsybl/afs/ws/server/AppStorageServer.java +++ b/afs/afs-ws/afs-ws-server/src/main/java/com/powsybl/afs/ws/server/AppStorageServer.java @@ -104,12 +104,9 @@ public Response getInconsistentChildrenNodes(@ApiParam(value = "File system name public Response createNode(@ApiParam(value = "File system name") @PathParam("fileSystemName") String fileSystemName, @ApiParam(value = "Node ID") @PathParam("nodeId") String nodeId, @ApiParam(value = "Child Name") @PathParam("childName") String childName, - @ApiParam(value = "Description") @QueryParam("description") String description, - @ApiParam(value = "Node Pseudo Class") @QueryParam("nodePseudoClass") String nodePseudoClass, - @ApiParam(value = "Version") @QueryParam("version") int version, - @ApiParam(value = "Node Meta Data") NodeGenericMetadata nodeMetadata) { + @ApiParam(value = "Node Meta Data") NodeInfo nodeInfo) { AppStorage storage = appDataBean.getStorage(fileSystemName); - NodeInfo newNodeInfo = storage.createNode(nodeId, childName, nodePseudoClass, description, version, nodeMetadata, new NodeAccessRights()); + NodeInfo newNodeInfo = storage.createNode(nodeId, childName, nodeInfo.getPseudoClass(), nodeInfo.getDescription(), nodeInfo.getVersion(), nodeInfo.getGenericMetadata(), nodeInfo.getAccessRights()); return Response.ok().entity(newNodeInfo).build(); } diff --git a/afs/afs-ws/afs-ws-storage/src/main/java/com/powsybl/afs/ws/storage/RemoteAppStorage.java b/afs/afs-ws/afs-ws-storage/src/main/java/com/powsybl/afs/ws/storage/RemoteAppStorage.java index 79fbae45079..753f5951039 100644 --- a/afs/afs-ws/afs-ws-storage/src/main/java/com/powsybl/afs/ws/storage/RemoteAppStorage.java +++ b/afs/afs-ws/afs-ws-storage/src/main/java/com/powsybl/afs/ws/storage/RemoteAppStorage.java @@ -8,11 +8,7 @@ import com.google.common.io.ByteStreams; import com.google.common.util.concurrent.UncheckedExecutionException; -import com.powsybl.afs.storage.AppStorage; -import com.powsybl.afs.storage.NodeDependency; -import com.powsybl.afs.storage.NodeGenericMetadata; -import com.powsybl.afs.storage.NodeAccessRights; -import com.powsybl.afs.storage.NodeInfo; +import com.powsybl.afs.storage.*; import com.powsybl.afs.storage.buffer.StorageChangeBuffer; import com.powsybl.afs.ws.client.utils.ClientUtils; import com.powsybl.afs.ws.utils.AfsRestApi; @@ -36,6 +32,7 @@ import javax.ws.rs.core.*; import java.io.*; import java.net.URI; +import java.time.ZonedDateTime; import java.util.*; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; @@ -321,14 +318,12 @@ public NodeInfo createNode(String parentNodeId, String name, String nodePseudoCl .resolveTemplate(FILE_SYSTEM_NAME, fileSystemName) .resolveTemplate(NODE_ID, parentNodeId) .resolveTemplate("childName", name) - .queryParam("nodePseudoClass", nodePseudoClass) - .queryParam("description", description) - .queryParam(VERSION, version) .request(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, token) .header(HttpHeaders.CONTENT_ENCODING, "gzip") .acceptEncoding("gzip") - .post(Entity.json(genericMetadata)); + .post(Entity.json(new NodeInfo(parentNodeId, name, nodePseudoClass, description, ZonedDateTime.now().toInstant().toEpochMilli(), + ZonedDateTime.now().toInstant().toEpochMilli(), version, genericMetadata, accessRights))); try { return readEntityIfOk(response, NodeInfo.class); } finally {