Geoserver 2.0.2 programming to add a new data warehouse and tier without a user interface

I have a catalog of images that will be constantly updated. From these images, I create Image Pyramids using the Geotool PyramidBuilder utility. I need to configure the cron job to automatically add new datastores and layers in Geoserver without using the user interface.

After viewing the REST section of the Geoserver manual , I was able to add my “testWS” workspace, but trying to create the ImagePyramid datastore did not work.

Since I have access to the data store, I expanded the sample form file and tried

curl -u admin:geoserver -XPUT -H 'Content-type: text/plain' \ 
   -d '/opt/geoserver_data_dir/2.0.2/data/test_pyramid.pyr' \
    "http://localhost:8080/geoserver/rest/workspaces/testWS/datastores/test_pyramid.pyr external.imagepyramid?configure=all"

Where test_pyramid.pyr is the base of my ImagePyramid in this place.

This gave me the error "There is no such data store: test_pyramid"

Is there a better way to add a new datastore and layer to Geoserver without manually adding each user interface? I need help creating the right REST statement that will add Extract ImagePyramid as a data and level storage.

Is there any java code that could do this? I looked at the Geoserver python extensions, but they didn't have that either.

+3
source share
1 answer

You need to study the RESTConfig module. It is part of GeoServer 2.1, but is a separate plugin for 2.0. See http://docs.geoserver.org/2.0.0/user/extensions/rest/index.html for more details .

+2
source

Source: https://habr.com/ru/post/1794205/


All Articles