No way at the moment to retrieve all the layers in a workspace.
Retrieving all the layers and then performing the filtering client side won't work, as of:
- https://osgeo-org.atlassian.net/browse/GEOS-6227 (Layer info is missing workspace name)
- https://osgeo-org.atlassian.net/browse/GEOS-7682 (Layers with the same name from different workspaces cannot be distinguished in a layers.xml call)
The only way at the moment is:
1) find all stores in a workspace
2) for each store, find all resources
which is not an optimal procedure.
It would be nice to have a REST operation which, given a workspace, would return all the layers in it. The linked tickets already contain some comments about this topic.
Main concern is about how to map this operation in a REST path without breaking backward compatibility.