workspaces.rst 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. .. _rest_workspaces:
  2. Workspaces
  3. ==========
  4. The REST API allows you to create and manage workspaces in GeoServer.
  5. .. note:: Read the :api:`API reference for /workspaces <workspaces.yaml>`.
  6. Adding a new workspace
  7. ----------------------
  8. **Creates a new workspace named "acme" with a POST request**
  9. *Request*
  10. .. admonition:: curl
  11. ::
  12. curl -v -u admin:geoserver -XPOST -H "Content-type: text/xml"
  13. -d "<workspace><name>acme</name></workspace>"
  14. http://localhost:8080/geoserver/rest/workspaces
  15. .. admonition:: python
  16. TBD
  17. .. admonition:: java
  18. TBD
  19. *Response*
  20. ::
  21. 201 Created
  22. .. note:: The ``Location`` response header specifies the location (URI) of the newly created workspace.
  23. Listing workspace details
  24. -------------------------
  25. **Retrieve information about a specific workspace**
  26. *Request*
  27. .. admonition:: curl
  28. ::
  29. curl -v -u admin:geoserver -XGET -H "Accept: text/xml"
  30. http://localhost:8080/geoserver/rest/workspaces/acme
  31. .. note:: The ``Accept`` header is optional.
  32. .. admonition:: python
  33. TBD
  34. .. admonition:: java
  35. TBD
  36. *Response*
  37. .. code-block:: xml
  38. <workspace>
  39. <name>acme</name>
  40. <dataStores>
  41. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate"
  42. href="http://localhost:8080/geoserver/rest/workspaces/acme/datastores.xml"
  43. type="application/xml"/>
  44. </dataStores>
  45. <coverageStores>
  46. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate"
  47. href="http://localhost:8080/geoserver/rest/workspaces/acme/coveragestores.xml"
  48. type="application/xml"/>
  49. </coverageStores>
  50. <wmsStores>
  51. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate"
  52. href="http://localhost:8080/geoserver/rest/workspaces/acme/wmsstores.xml"
  53. type="application/xml"/>
  54. </wmsStores>
  55. </workspace>
  56. This shows that the workspace can contain "``dataStores``" (for :ref:`vector data <data_vector>`), "``coverageStores``" (for :ref:`raster data <data_raster>`), and "``wmsStores``" (for :ref:`cascaded WMS servers <data_external_wms>`).