[Geoserver-users] Toggle "Enabled" and "Advertised" attribute layer by Geoserver REST API

Hello everyone!

I want to know if it is possible to enable/disable a layer using the REST API.
I also want to toggle “Advertised” attribute by REST API, because I want to manage a lot of layers at the same time.

I couldn’t find anything about in docs, but I was trying sth like this:

PUT /geoserver/rest/layers/<layer_name>.xml

true false

PS: I know I can do it the hard way: make a script to search and modify xml layer files in data dir. I think it’s not the right approach.

···


JÔNATAS CASTRO
+55 (21) 99109-7575

The following works for me:

PUT
/geoserver/rest/workspaces/<workspace>/datastores/<data_store>/featuretypes/<layer_name>

<featureType>
  <enabled>true</enabled>
  <advertised>false</advertised>
</featureType>

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Toggle-Enabled-and-Advertised-attribute-layer-by-Geoserver-REST-API-tp5201881p5230043.html
Sent from the GeoServer - User mailing list archive at Nabble.com.