workspaces.yaml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. ---
  2. swagger: '2.0'
  3. info:
  4. version: 1.0.0
  5. title: GeoServer Workspace
  6. description: A workspace is a grouping of data stores. Similar to a namespace, it is used to group data that is related in some way.
  7. contact:
  8. name: GeoServer
  9. email: 'geoserver-users@osgeo.org'
  10. url: 'https://geoserver.org/comm/'
  11. host: localhost:8080
  12. basePath: /geoserver/rest
  13. paths:
  14. /workspaces:
  15. get:
  16. operationId: getWorkspaces
  17. tags:
  18. - "Workspaces"
  19. summary: Get a list of workspaces
  20. description: Displays a list of all workspaces on the server. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/workspaces.xml" for XML)
  21. produces:
  22. - text/html
  23. - application/json
  24. - application/xml
  25. responses:
  26. 200:
  27. description: OK
  28. schema:
  29. $ref: "#/definitions/WorkspacesResponse"
  30. examples:
  31. application/xml: |
  32. <workspaces>
  33. <workspace>
  34. <name>topp</name>
  35. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/topp.xml" type="application/xml"/>
  36. </workspace>
  37. <workspace>
  38. <name>it.geosolutions</name>
  39. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/it.geosolutions.xml" type="application/xml"/>
  40. </workspace>
  41. </workspaces>
  42. application/json: |
  43. {
  44. "workspaces": {
  45. "workspace": [
  46. {
  47. "name": "topp",
  48. "href": "http://localhost:8080/geoserver/rest/workspaces/topp.json"
  49. },
  50. {
  51. "name": "it.geosolutions",
  52. "href": "http://localhost:8080/geoserver/rest/workspaces/it.geosolutions.json"
  53. }
  54. ]
  55. }
  56. }
  57. 401:
  58. description: Unauthorized
  59. post:
  60. operationId: postWorkspaces
  61. tags:
  62. - "Workspaces"
  63. summary: add a new workspace to GeoServer
  64. description: Adds a new workspace to the server
  65. parameters:
  66. - name: workspaceBody
  67. description: The layer group body information to upload.
  68. in: body
  69. required: true
  70. schema:
  71. $ref: "#/definitions/Workspace"
  72. - name: default
  73. in: query
  74. description: New workspace will be the used as the default. Allowed values are true or false, The default value is false.
  75. required: false
  76. type: boolean
  77. default: false
  78. consumes:
  79. - application/json
  80. - application/xml
  81. produces:
  82. - text/html
  83. - application/json
  84. - application/xml
  85. responses:
  86. 201:
  87. description: Created
  88. schema:
  89. type: string
  90. headers:
  91. Location:
  92. description: URL where the newly created workspace can be found
  93. type: string
  94. 409:
  95. description: Unable to add workspace as it already exists
  96. put:
  97. operationId: putWorkspaces
  98. tags:
  99. - "Workspaces"
  100. responses:
  101. 405:
  102. description: Not permitted
  103. delete:
  104. operationId: deleteWorkspaces
  105. tags:
  106. - "Workspaces"
  107. responses:
  108. 405:
  109. description: Not permitted
  110. /workspaces/{workspaceName}:
  111. get:
  112. operationId: getWorkspace
  113. tags:
  114. - "Workspaces"
  115. summary: Retrieve a layer group
  116. description: Retrieves a single workspace definition. Use the "Accept:" header to specify format or
  117. append an extension to the endpoint (example "/workspaces/{workspace}.xml" for XML).
  118. produces:
  119. - application/xml
  120. - application/json
  121. - text/html
  122. parameters:
  123. - name: workspaceName
  124. description: the name of the workspace to fetch
  125. in: path
  126. required: true
  127. type: string
  128. - name: quietOnNotFound
  129. in: query
  130. required: false
  131. description: The quietOnNotFound parameter avoids logging an exception when the workspace is not present. Note that 404 status code will still be returned.
  132. type: boolean
  133. responses:
  134. 200:
  135. description: OK
  136. schema:
  137. $ref: "#/definitions/WorkspaceResponse"
  138. examples:
  139. application/xml: |
  140. <workspace>
  141. <name>topp</name>
  142. <dataStores>
  143. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/topp/datastores.xml" type="application/xml"/>
  144. </dataStores>
  145. <coverageStores>
  146. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/topp/coveragestores.xml" type="application/xml"/>
  147. </coverageStores>
  148. <wmsStores>
  149. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/topp/wmsstores.xml" type="application/xml"/>
  150. </wmsStores>
  151. </workspace>
  152. application/json: |
  153. {
  154. "workspace": {
  155. "name": "topp",
  156. "dataStores": "http://localhost:8080/geoserver/rest/workspaces/topp/datastores.json",
  157. "coverageStores": "http://localhost:8080/geoserver/rest/workspaces/topp/coveragestores.json",
  158. "wmsStores": "http://localhost:8080/geoserver/rest/workspaces/topp/wmsstores.json"
  159. }
  160. }
  161. 404:
  162. description: workspace does not exist
  163. put:
  164. summary: Update a workspace
  165. tags:
  166. - "Workspaces"
  167. description: takes the body of the post and modifies the workspace from it.
  168. operationId: putWorkspace
  169. consumes:
  170. - application/json
  171. - application/xml
  172. responses:
  173. 200:
  174. description: Modified
  175. 405:
  176. description: Forbidden to change the name of the workspace
  177. 404:
  178. description: Workspace not found
  179. parameters:
  180. - name: workspaceName
  181. in: path
  182. description: name of workspace
  183. required: true
  184. type: string
  185. - name: workspaceBody
  186. description: The layer group body information to upload.
  187. in: body
  188. required: true
  189. schema:
  190. $ref: "#/definitions/Workspace"
  191. post:
  192. operationId: postWorkspace
  193. tags:
  194. - "Workspaces"
  195. responses:
  196. 405:
  197. description: Forbidden to post to an existing workspace (use PUT)
  198. delete:
  199. operationId: deleteWorkspace
  200. tags:
  201. - "Workspaces"
  202. parameters:
  203. - name: workspaceName
  204. in: path
  205. description: name of workspace
  206. required: true
  207. type: string
  208. - name: recurse
  209. in: query
  210. description: delete workspace contents (default false)
  211. required: false
  212. type: boolean
  213. responses:
  214. 200:
  215. description: Success workspace deleted
  216. 404:
  217. description: Workspace doesn't exist
  218. 403:
  219. description: Workspace or related Namespace is not empty (and recurse not true)
  220. definitions:
  221. Workspace:
  222. title: Workspace
  223. xml:
  224. name: workspace
  225. type: object
  226. required:
  227. - workspace
  228. properties:
  229. workspace:
  230. type: object
  231. required:
  232. - name
  233. properties:
  234. name:
  235. type: string
  236. description: name of the workspace
  237. WorkspacesResponse:
  238. title: Workspaces
  239. type: object
  240. properties:
  241. workspaces:
  242. $ref: "#/definitions/WorkspaceResponse"
  243. WorkspaceResponse:
  244. title: Workspace Response
  245. type: object
  246. properties:
  247. name:
  248. type: string
  249. description: Name of workspace
  250. dataStores:
  251. type: string
  252. description: URL to Datas tores in this workspace
  253. coverageStores:
  254. type: string
  255. description: URL to Coverage stores in this workspace
  256. wmsStores:
  257. type: string
  258. description: URL to WMS stores in this workspace