namespaces.yaml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. ---
  2. swagger: '2.0'
  3. info:
  4. version: 1.0.0
  5. title: GeoServer Namespace
  6. description: A namespace is a uniquely identifiable grouping of feature types. It is identified by a prefix and a URI.
  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. /namespaces:
  15. get:
  16. operationId: getNamespaces
  17. tags:
  18. - "Namespaces"
  19. summary: Get a list of namespaces
  20. description: Displays a list of all namespaces on the server. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/namespaces.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/NamespacesResponse"
  30. examples:
  31. application/xml: |
  32. <namespaces>
  33. <namespace>
  34. <name>topp</name>
  35. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/namespaces/topp.xml" type="application/xml"/>
  36. </namespace>
  37. <namespace>
  38. <name>it.geosolutions</name>
  39. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/namespaces/it.geosolutions.xml" type="application/xml"/>
  40. </namespace>
  41. </namespaces>
  42. application/json: |
  43. {
  44. "namespaces": {
  45. "namespace": [
  46. {
  47. "name": "topp",
  48. "href": "http://localhost:8080/geoserver/rest/namespaces/topp.json"
  49. },
  50. {
  51. "name": "it.geosolutions",
  52. "href": "http://localhost:8080/geoserver/rest/namespaces/it.geosolutions.json"
  53. }
  54. ]
  55. }
  56. }
  57. 401:
  58. description: Unauthorized
  59. post:
  60. operationId: postNamespaces
  61. tags:
  62. - "Namespaces"
  63. summary: Add a new namespace to GeoServer
  64. description: Adds a new namespace to the server
  65. parameters:
  66. - name: namespaceBody
  67. description: The layer group body information to upload.
  68. in: body
  69. required: true
  70. schema:
  71. $ref: "#/definitions/Namespace"
  72. consumes:
  73. - application/json
  74. - application/xml
  75. produces:
  76. - text/html
  77. - application/json
  78. - application/xml
  79. responses:
  80. 201:
  81. description: Created
  82. schema:
  83. type: string
  84. headers:
  85. Location:
  86. description: URL where the newly created namespace can be found
  87. type: string
  88. 401:
  89. description: Unable to add namespace as it already exists
  90. put:
  91. operationId: putNamespaces
  92. tags:
  93. - "Namespaces"
  94. responses:
  95. 405:
  96. description: Not permitted
  97. delete:
  98. operationId: deleteNamespaces
  99. tags:
  100. - "Namespaces"
  101. responses:
  102. 405:
  103. description: Not permitted
  104. /namespaces/{namespaceName}:
  105. get:
  106. operationId: getNamespace
  107. tags:
  108. - "Namespaces"
  109. summary: Retrieve a namespace
  110. description: Retrieves a single namespace definition. Use the "Accept:" header to specify format or
  111. append an extension to the endpoint (example "/namespaces/{namespace}.xml" for XML).
  112. produces:
  113. - application/xml
  114. - application/json
  115. - text/html
  116. parameters:
  117. - name: namespaceName
  118. description: The name of the namespace to fetch, or "default" to get the default namespace.
  119. in: path
  120. required: true
  121. type: string
  122. responses:
  123. 200:
  124. description: OK
  125. schema:
  126. $ref: "#/definitions/NamespaceResponse"
  127. examples:
  128. application/xml:
  129. '<namespace>
  130. <prefix>topp</prefix>
  131. <uri>http://www.openplans.org/topp</uri>
  132. <featureTypes>
  133. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/topp/featuretypes.xml" type="application/xml"/>
  134. </featureTypes>
  135. </namespace>'
  136. application/json:
  137. '{
  138. "namespace": {
  139. "prefix": "topp",
  140. "uri": "http://www.openplans.org/topp",
  141. "featureTypes": "http://localhost:8080/geoserver/rest/workspaces/topp/featuretypes.json"
  142. }
  143. }'
  144. 404:
  145. description: namespace does not exist
  146. put:
  147. summary: Update a namespace
  148. tags:
  149. - "Namespaces"
  150. description: Takes the body of the put and modifies the namespace from it.
  151. operationId: putNamespace
  152. consumes:
  153. - application/json
  154. - application/xml
  155. responses:
  156. 200:
  157. description: Modified
  158. 405:
  159. description: Forbidden to change the name of the namespace
  160. 404:
  161. description: Namespace not found
  162. parameters:
  163. - name: namespaceName
  164. in: path
  165. description: Name of namespace, or "default" to set the default namespace using the namespace prefix in the body of the post.
  166. required: true
  167. type: string
  168. post:
  169. operationId: postNamespace
  170. tags:
  171. - "Namespaces"
  172. responses:
  173. 405:
  174. description: Forbidden to post to an existing namespace (use PUT)
  175. delete:
  176. operationId: deleteNamespace
  177. tags:
  178. - "Namespaces"
  179. summary: Delete a namespace
  180. parameters:
  181. - name: namespaceName
  182. in: path
  183. description: Name of the namespace
  184. required: true
  185. type: string
  186. responses:
  187. 200:
  188. description: Success. Namespace deleted
  189. 404:
  190. description: Namespace doesn't exist
  191. 405:
  192. description: Can't delete default namespace
  193. 403:
  194. description: Namespace or related Workspace is not empty (and recurse not true)
  195. definitions:
  196. Namespace:
  197. title: Namespace
  198. xml:
  199. name: namespace
  200. type: object
  201. properties:
  202. prefix:
  203. type: string
  204. description: Name/prefix of the namespace
  205. uri:
  206. type: string
  207. description: URI that identifies the namespace
  208. NamespacesResponse:
  209. title: Namespaces
  210. type: object
  211. properties:
  212. namespaces:
  213. $ref: "#/definitions/NamespaceResponse"
  214. NamespaceResponse:
  215. title: Namespace Response
  216. type: object
  217. properties:
  218. prefix:
  219. type: string
  220. description: Name of namespace
  221. uri:
  222. type: string
  223. description: URI of the namespace
  224. featureTypes:
  225. type: string
  226. description: URL to featureTypes associated with this namespace