Managing Global Server Configuration through the REST API

The REST API for server configuration provides a RESTful interface through which clients can view and modify global server configuration.

Global Operations

/rest/global.xml

Method Action Return Code Formats
GET Return the XML representation of the global server configuration 200 XML, JSON
POST   405  
PUT Modify global server configuration 200 XML, JSON
DELETE   405  

Representations:

REST API for Global Server Configuration, cURL Examples

The examples in this section use the cURL utility, which is a handy command line tool for executing HTTP requests and transferring files. Though cURL is used the examples apply to any HTTP-capable tool or library.

Get Global Configuration

curl -v -u geowebcache:secured -XGET "http://localhost:8080/geowebcache/rest/global.xml"

Or if using the GeoServer integrated version of GeoWebCache:

curl -v -u user:password -XGET "http://localhost:8080/geoserver/gwc/rest/global.xml"

Modify Global Configuration

Sample request:

Given a global.xml file as the following:

<global>
  <backendTimeout>180</backendTimeout>
</global>
curl -v -u geowebcache:secured -XPUT -H "Content-type: text/xml" -d @global.xml  "http://localhost:8080/geowebcache/rest/global.xml"

This will modify the backend timeout of the server, leaving other global configuration values unchanged.

Note

If you modify the service provider, you will need to provide the entire serviceProvider structure - modifying single values within serviceProvider is not supported at this time.