Bug in WebApi for zone objects?

Started by Benjamin Dill, September 19, 2024, 02:27:00 PM

Previous topic - Next topic

Benjamin Dill

We are using the WebApi for creating different objects. Creating new nodes or containers works without problems, but the API returns an error when creating a new zone. We are sending this JSON:

{
    objectType: 6
    name: "NewZone"
    parentId: 1
}
We are setting parentId = 1, because the object "Entire Network" has object id 1. This returns an "Internal error" with code 46.

I did take a look at the code and it seems impossible to create a node with parentId = 1.
https://github.com/netxms/netxms/blob/62c5f9ec1837c93023a40a71781ea2c73037b4c9/src/client/nxapisrv/java/src/main/java/org/netxms/websvc/handlers/Objects.java#L377

Can you check this?


Victor Kirhenshtein

Just fixed it. Official fix will be in 5.1, but if you need it to work in 5.0, you can rebuild web API from source branch stable-5.0 - fix is backported here as well.

Best regards,
Victor