Skip to content

Workspaces

The REST API allows you to create and manage workspaces in GeoServer.

Adding a new workspace

Creates a new workspace named "acme" with a POST request

Request

curl

curl -v -u admin:geoserver -XPOST -H "Content-type: text/xml" -d "acme" http://localhost:8080/geoserver/rest/workspaces

python

TBD

java

TBD

Response

201 Created

Note

The Location response header specifies the location (URI) of the newly created workspace.

Listing workspace details

Retrieve information about a specific workspace

Request

curl

curl -v -u admin:geoserver -XGET -H "Accept: text/xml" http://localhost:8080/geoserver/rest/workspaces/acme

Note

The Accept header is optional.

python

TBD

java

TBD

Response

<workspace>
  <name>acme</name>
  <dataStores>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" 
     href="http://localhost:8080/geoserver/rest/workspaces/acme/datastores.xml" 
     type="application/xml"/>
  </dataStores>
  <coverageStores>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" 
     href="http://localhost:8080/geoserver/rest/workspaces/acme/coveragestores.xml" 
     type="application/xml"/>
  </coverageStores>
  <wmsStores>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" 
     href="http://localhost:8080/geoserver/rest/workspaces/acme/wmsstores.xml" 
     type="application/xml"/>
  </wmsStores>
</workspace>

This shows that the workspace can contain "dataStores" (for vector data), "coverageStores" (for raster data), and "wmsStores" (for cascaded WMS servers).