Creating and editing data stores with REST

Data stores connect GeoServer to your data. You can't use data that is not supported by GeoServer without a built-in connector or a plugin. Of course, the REST interface supports all operations on data stores. If you plan to automate GeoServer configurations, it is very important to understand how data stores can be created and edited.

The resource exposed is in the following form:

/workspaces/<ws>/datastores

Here, ws stands for the workspace on which the data store is linked.

How to do it…

  1. As usual, you can use the GET operation to retrieve information about which data stores are available in the configuration for a specific workspace. Let's retrieve information in Python:
    >>> myUrl = 'http://localhost:8080/geoserver/rest/workspaces/NaturalEarth/datastores' ...

Get GeoServer Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.