[Geoserver-users] REST API - Put datastore behavior

Hello,

Currently, if you send a PUT request on a datastore with a totally different definition of the datastore (for example, migrating from a directory of shapefile to a pregen feature datastore), GeoServer accepts the request and you got a 200 return code.

But the GS configuration is totally broken then: the previously created feature types and layers are still listed but when you try to use them you got error messages.

Shouldn’t the endpoint raise an error when we try to change the type of a datastore with a PUT method?

···

Alexandre Gacon

The REST api is simple.

I would expect you are making that call as part of migrating a dataset from oracle to postgis and will be cleaning up the feature types next.

···


Jody Garnett

Or just not cleaning them at all… Pretty common use case: migrate lots of separate JDBC stores from stand alone to JNDI, to save on connections. Different store factory, exactly the same feature types.

If one wants wipe out everything, it’s simple: delete the store with recurse first, then recreate everything anew.

Cheers

Andrea

Il dom 23 apr 2023, 18:31 Jody Garnett <jody.garnett@anonymised.com> ha scritto:

The REST api is simple.

I would expect you are making that call as part of migrating a dataset from oracle to postgis and will be cleaning up the feature types next.

On Sun, Apr 23, 2023 at 1:51 AM Alexandre Gacon <alexandre.gacon@anonymised.com> wrote:

Hello,

Currently, if you send a PUT request on a datastore with a totally different definition of the datastore (for example, migrating from a directory of shapefile to a pregen feature datastore), GeoServer accepts the request and you got a 200 return code.

But the GS configuration is totally broken then: the previously created feature types and layers are still listed but when you try to use them you got error messages.

Shouldn’t the endpoint raise an error when we try to change the type of a datastore with a PUT method?

Alexandre Gacon


Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Jody Garnett


Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Good spot Andrea, it was indeed the migration we did.

Alexandre

Le dim. 23 avr. 2023 à 20:13, Andrea Aime <andrea.aime@anonymised.com> a écrit :

Or just not cleaning them at all… Pretty common use case: migrate lots of separate JDBC stores from stand alone to JNDI, to save on connections. Different store factory, exactly the same feature types.

If one wants wipe out everything, it’s simple: delete the store with recurse first, then recreate everything anew.

Cheers

Andrea

Il dom 23 apr 2023, 18:31 Jody Garnett <jody.garnett@…84…> ha scritto:

The REST api is simple.

I would expect you are making that call as part of migrating a dataset from oracle to postgis and will be cleaning up the feature types next.

On Sun, Apr 23, 2023 at 1:51 AM Alexandre Gacon <alexandre.gacon@anonymised.com> wrote:

Hello,

Currently, if you send a PUT request on a datastore with a totally different definition of the datastore (for example, migrating from a directory of shapefile to a pregen feature datastore), GeoServer accepts the request and you got a 200 return code.

But the GS configuration is totally broken then: the previously created feature types and layers are still listed but when you try to use them you got error messages.

Shouldn’t the endpoint raise an error when we try to change the type of a datastore with a PUT method?

Alexandre Gacon


Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Jody Garnett


Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users