0

So, it appears that I can rename a store name (both DataStores and CoverageStores) from the WebUI (v2.13.2 and 2.15.2) but I cannot do it via the REST API.

It returns a 403 error when I do this: curl -v -u admin:password -XPUT -H "Content-type: application/xml" -d "my_new_store" http://geoserver:8080/geoserver/rest/workspaces/my_workspace/datastores/mystore.xml

As this (https://docs.geoserver.org/stable/en/user/rest/api/datastores.html) states, you cant do a rename: PUT that changes name of data store returns 403.

So, how is the WebUI doing it? Is there any way, I can use that functionality.

And, the same question applies to renaming workspace as well. Works in WebUI. Returns 403 in REST API.

  • The UI is interacting directly with the configuration subsytem, without going through the REST API (it's written in server side Java, Wicket in particular), so there is no fixed relationship between what the UI and REST can do (though it would be good if they had the exact same abilities). – Andrea Aime Aug 16 at 16:09
  • Thank you. That explains it. – sarao Aug 19 at 13:13
0

As the documentation states there is no way to change the name of a Datastore using the REST API.

I guess that the thinking is that if you are creating Datastores using the REST API you can just delete the store and re-create it rather than renaming.

  • True..I could just delete the store (or workspace) and re-create it. But I have cascaded servers, group layers, and regular layers and am wondering if replicating the store or workspace is going to be a lot of work. Right? – sarao Aug 19 at 13:11
  • but you are using REST so it is all scripted – Ian Turton Aug 19 at 13:16
  • I'm sorry but I dont understand how that helps. It still means that each user-programmer needs to implement his/her own rename function for workspaces and stores. Its doable but non-trivial is what I am saying, and it should be a feature of the GeoServer REST API support. – sarao Aug 19 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.