[GIS] How to get layers from a specific store of geoserver using python gsconfig

geoservergeoserver-rest-apipython-2.7

I'm using gsconfig python library to acess geoserver rest, my question is how can i get layers from a specific store ?

I'm tried as follow:

from geoserver.catalog import Catalog

cat=Catalog("http://localhost:8080/geoserver/rest")

layers=cat.get_layers('storename')

but it's giving all published layers from geoserver not from that particular store.

Please help me?

Best Answer

Try defining the resource first and pulling the layers from it:

myResource = cat.get_resources(store='storeName', workspace='workspaceName')
layers = cat.get_layers(myResource)
Related Question