I have 200+ SLD's I would like to upload to Geoserver using the REST API. I successfully uploaded an SLD using the gsconfig Python module.

However, I would like to be able to set the workspace when I upload. Is this possible? Below is my script so far.

from geoserver.catalog import Catalog

cat = Catalog("http://chchchch:8080/geoserver/rest", "username", "pw")

with open("C:\Users\Documents\SLD\my_sld.sld") as f:
    cat.create_style("my_sld", f.read())

Solved. Downloaded master from here. Then...

cat.create_style("my_sld", f.read(), overwrite=False, workspace='workspacename')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.