1

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.

2
  • 2
    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). Commented Aug 16, 2019 at 16:09
  • 1
    Thank you. That explains it.
    – sarao
    Commented Aug 19, 2019 at 13:13

1 Answer 1

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.

3
  • 1
    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
    Commented Aug 19, 2019 at 13:11
  • but you are using REST so it is all scripted
    – Ian Turton
    Commented Aug 19, 2019 at 13:16
  • 1
    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
    Commented Aug 19, 2019 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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