[Geoserver-users] REST API: How do I see which workspace a layer is in

I have three workspaces, and each has a layer named Land_Cover_Vector. I’m trying to use the REST API to get a list of all layers, but when I request: http://localhost/geoserver/rest/layers.xml

The HTML or XML links to http://localhost/geoserver/rest/layers/Land_Cover_Vector.xml three times, not to each individual layer.

If I have to iterate through all workspaces to find all the actual layer links, what is the layers.xml endpoint for? Should layers.xml link to layers in their workspaces?

Similarly, I have a layergroup with each of the Land_Cover_Vector layers in it.

When I try to use the REST API to learn about the layergroup I request http://localhost/geoserver/rest/layergroups/All_Land_Cover.xml. It also links to http://flatrock2.mapfeeder.net/geoserver/rest/layers/Land_Cover_Vector.xml three times.

Is there a way to determine which layers are members of the layer group?

Thank you,
Michael Moore

On Tue, Aug 6, 2013 at 6:39 PM, Michael Moore <michael.moore@anonymised.com

wrote:

I have three workspaces, and each has a layer named Land_Cover_Vector. I'm
trying to use the REST API to get a list of all layers, but when I request:
http://localhost/geoserver/rest/layers.xml

The HTML or XML links to
http://localhost/geoserver/rest/layers/Land_Cover_Vector.xml three times,
not to each individual layer.

The layer links to the resource, and the url of the resource contains the
workspace.
If you just want to follow links get to the resource, then its store, and
then you have the link to the workspace.

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------