[Geoserver-users] Enable workspace specific service through REST

Hi all,

I would like to configure the service settings per workspace through the REST interface, but when I try to access the service settings (through GET http://localhost:8080/geoserver/rest/services/wms/workspaces/gemeenten/settings.xml) for a workspace that does not have a workspace specific service defined I receive the folllowing response:

Service for workspace gemeenten does not exist

In the GeoServer web interface I can enable workspace specific settings for each of the OGC webservices (WCS,WFS,WMS), by checking the service in the workspace overview (see screenshot ), but I would like to do this through the REST interface. Is there a way to enable a workspace specific service through the REST API? I looked through the docs and searched the internet, but I could not find anything.

In the docs there is information on how to retrieve and modify the workspace specific service settings:
http://docs.geoserver.org/stable/en/user/rest/api/services.html#services-wms-workspaces-ws-settings-format
But not on how to enable a workspace specific service through the REST interface.

I by the way tested this all on GeoServer 2.9.1.

Any thoughts on this are highly appreciated.

Kind regards,

Anton Bakker
software developer@geocat

tel. +31 318 416 664

Hi,

I just discovered that it is possible to user /rest/resource endpoint to create a WMS service configuration file in a workspace. See the docs here: http://docs.geoserver.org/stable/en/user/rest/api/resources.html#resource-path-to-resource.

A PUT request with the settings file in the body (https://gist.github.com/arbakker/c9ca04dc5c2d9b1c9b697329fda7ef50) at /rest/resource/workspaces/cite/wms.xml, will create the wms.xml settings file in the cite workspace folder. After reloading the configuration, through /rest/reload a workspace specific service is created.

For this to work I need to reliably generate the WMS service ID:
WMSInfoImpl—6d507638:13a005ea3a2:-7ff3

Does anyone know what requirements the id needs to fulfil for it to be valid?

Kind regards,
Anton

On 15 Sep 2016, at 16:15, Anton Bakker <anton.bakker@anonymised.com> wrote:

Hi all,

I would like to configure the service settings per workspace through the REST interface, but when I try to access the service settings (through GET http://localhost:8080/geoserver/rest/services/wms/workspaces/gemeenten/settings.xml) for a workspace that does not have a workspace specific service defined I receive the folllowing response:

Service for workspace gemeenten does not exist

In the GeoServer web interface I can enable workspace specific settings for each of the OGC webservices (WCS,WFS,WMS), by checking the service in the workspace overview (see screenshot ), but I would like to do this through the REST interface. Is there a way to enable a workspace specific service through the REST API? I looked through the docs and searched the internet, but I could not find anything.

In the docs there is information on how to retrieve and modify the workspace specific service settings:
http://docs.geoserver.org/stable/en/user/rest/api/services.html#services-wms-workspaces-ws-settings-format
But not on how to enable a workspace specific service through the REST interface.

I by the way tested this all on GeoServer 2.9.1.

Any thoughts on this are highly appreciated.

Kind regards,

Anton Bakker
software developer@geocat

tel. +31 318 416 664