I've thought of something similar before - in fact here's a (anonymized)
script I use to copy a layergroup + styles between servers:
https://github.com/dwins/gsconfig.py/blob/master/examples/copy_layergroup.py

It expects the datastores to already be configured though.

I don't think it's a bad idea and I also don't know of a general tool for
doing this.  However as you say the documentation around the REST API is
currently not very complete.  As a workaround I generally set up a single
layer/store/style and then inspect the document the REST API produces for a
GET request.  It would be good to have more complete documentation about
the details of the different datastore types.

hint: A common place to look for parameters other than the datastore
connection parameters is the metadata map found on most GeoServer entities.

Another idea I had for dealing with this sort of issue is to inspect the
configuration (possibly offline) and try to identify portability issues
such as absolute paths before copying them around.  I haven't investigated
that approach at all so I'm not sure what trouble you'd run into.  If
you're going to do it, it probably it makes sense to link the GeoServer
main module for parsing the config options since the config format isn't
well documented or stable either.

--
David Winslow
OpenGeo - http://opengeo.org/

On Tue, Nov 8, 2011 at 2:36 PM, Jesse Eichar <[email protected]>wrote:

> Hi all,
>
> I have found that it is often useful to install a vanilla Geoserver on,
> say an Amazon instance, then configure it using REST.  For some reason I
> don't fully understand this is more reliable that simply copying a
> workspace to the instance and using that.  I wish I knew why that was for
> sure, but I suspect that overtime if you allow users to configure Geoserver
> who are not experts, the configuration can begin to gather cruft and
> perhaps get less stable or maybe simply less portable.
>
> So one solution I thought of is to create a little program that can read a
> JSON file and make all the REST requests to configure Geoserver.
>
> Two problems:
>
>    1. Maybe it is the wrong solution or someone has already done this
>    2. The way to configure the different datastores is a little
>    mysterious.  For example if I want to configure a Postgis, I can use the
>    Geotools connection params for most of the settings on the datastore, but
>    some like "fetch size" are harder to figure out how to set them.  Is there
>    a place/way I can look this information up?
>
> Thanks,
>
> Jesse
>
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
>
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to