urlchecks.yaml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. ---
  2. swagger: '2.0'
  3. info:
  4. version: 1.0.0
  5. title: GeoServer UrlCheck
  6. description: An URL External Access Check is the check performed on user provided URLs that GeoServer will use to access remote resources.
  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. /urlchecks:
  15. get:
  16. operationId: getUrlChecks
  17. tags:
  18. - "UrlChecks"
  19. summary: Get a list of URL checks
  20. description: Displays a list of all URL checks on the server. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/urlchecks.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/urlChecks"
  30. examples:
  31. text/html: |
  32. <html>
  33. <head>
  34. <title>GeoServer Configuration</title>
  35. <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
  36. </head>
  37. <body>
  38. <ul>
  39. <li><a href="http://localhost:8080/geoserver/rest/urlchecks/external.html">external</a></li>
  40. <li><a href="http://localhost:8080/geoserver/rest/urlchecks/icons.html">icons</a></li>
  41. <li><a href="http://localhost:8080/geoserver/rest/urlchecks/safeWFS.html">safeWFS</a></li>
  42. </ul>
  43. </body>
  44. </html>
  45. application/xml: |
  46. <urlChecks>
  47. <urlCheck>
  48. <name>external</name>
  49. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/urlchecks/external.xml" type="application/atom+xml"/>
  50. </urlCheck>
  51. <urlCheck>
  52. <name>icons</name>
  53. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/urlchecks/icons.xml" type="application/atom+xml"/>
  54. </urlCheck>
  55. <urlCheck>
  56. <name>safeWFS</name>
  57. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/urlchecks/safeWFS.xml" type="application/atom+xml"/>
  58. </urlCheck>
  59. </urlChecks>
  60. application/json: |
  61. {"urlchecks":{"urlcheck":[
  62. {"name":"external","href":"http:\/\/localhost:8080\/geoserver\/rest\/urlchecks\/external.json"},
  63. {"name":"icons","href":"http:\/\/localhost:8080\/geoserver\/rest\/urlchecks\/icons.json"},
  64. {"name":"safeWFS","href":"http:\/\/localhost:8080\/geoserver\/rest\/urlchecks\/safeWFS.json"}]}}
  65. 401:
  66. description: Unauthorized
  67. post:
  68. operationId: postUrlChecks
  69. tags:
  70. - "UrlChecks"
  71. summary: add a new URL check to GeoServer
  72. description: Adds a new URL check to the server
  73. parameters:
  74. - name: urlcheckBody
  75. description: The url check body to upload.
  76. in: body
  77. required: true
  78. schema:
  79. $ref: "#/definitions/urlCheck"
  80. consumes:
  81. - application/json
  82. - application/xml
  83. produces:
  84. - text/html
  85. - application/json
  86. - application/xml
  87. responses:
  88. 201:
  89. description: Created
  90. schema:
  91. type: string
  92. headers:
  93. Location:
  94. description: URL where the newly created URL check can be found
  95. type: string
  96. 400:
  97. description: Unable to add provided URL check as it misses required fields
  98. 409:
  99. description: Unable to add URL check as it already exists
  100. put:
  101. operationId: putUrlChecks
  102. description: Not permitted.
  103. tags:
  104. - "UrlChecks"
  105. responses:
  106. 405:
  107. description: Not permitted
  108. delete:
  109. operationId: deleteUrlChecks
  110. description: Not permitted.
  111. tags:
  112. - "UrlChecks"
  113. responses:
  114. 405:
  115. description: Not permitted
  116. /urlchecks/{urlcheckname}:
  117. get:
  118. operationId: getUrlCheck
  119. tags:
  120. - "UrlChecks"
  121. summary: Retrieve a URL check
  122. description: Retrieves a single URL check definition. Use the "Accept:" header to specify format or
  123. append an extension to the endpoint (example "/urlchecks/{urlcheck}.xml" for XML).
  124. produces:
  125. - application/xml
  126. - application/json
  127. - text/html
  128. parameters:
  129. - name: urlcheckname
  130. description: the name of the URL check to fetch.
  131. in: path
  132. required: true
  133. type: string
  134. responses:
  135. 200:
  136. description: OK
  137. schema:
  138. $ref: "#/definitions/urlCheck"
  139. examples:
  140. application/xml: |
  141. <urlChecks>
  142. <urlCheck>
  143. <name>icons</name>
  144. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/urlchecks/icons.xml" type="application/atom+xml"/>
  145. </urlCheck>
  146. </urlChecks>
  147. application/json: |
  148. {
  149. "urlCheck": {
  150. "name": "icons",
  151. "description": "External graphic icons",
  152. "enabled": true,
  153. "regex": "^https://styles.server.net/icons/.*$"
  154. }
  155. }
  156. 404:
  157. description: URL check does not exist
  158. post:
  159. tags:
  160. - "UrlChecks"
  161. operationId: postUrlCheck
  162. description: Not permitted.
  163. parameters:
  164. - name: urlcheckname
  165. description: the name of the URL check to fetch.
  166. in: path
  167. required: true
  168. type: string
  169. responses:
  170. 405:
  171. description: Not permitted
  172. put:
  173. summary: Update a URL check
  174. tags:
  175. - "UrlChecks"
  176. description: Changes the URL check with the provided data.
  177. operationId: putUrlCheck
  178. consumes:
  179. - application/json
  180. - application/xml
  181. responses:
  182. 200:
  183. description: Modified
  184. 400:
  185. description: Cannot perform the change to the URL check as required fields are missing
  186. 404:
  187. description: Url check not found
  188. parameters:
  189. - name: urlcheckname
  190. in: path
  191. description: name of URL check.
  192. required: true
  193. type: string
  194. - name: urlcheckBody
  195. description: The url check body to perform the change against.
  196. in: body
  197. required: true
  198. schema:
  199. $ref: "#/definitions/urlCheck"
  200. delete:
  201. operationId: deleteUrlCheck
  202. tags:
  203. - "UrlChecks"
  204. parameters:
  205. - name: urlcheckname
  206. in: path
  207. description: name of URL check to delete.
  208. required: true
  209. type: string
  210. responses:
  211. 200:
  212. description: Successfully deleted URL check
  213. 404:
  214. description: Url check doesn't exist
  215. definitions:
  216. urlCheck:
  217. type: object
  218. description: >
  219. The body for a URL check request.
  220. For a PUT, only values which should be changed need to be included.
  221. JSON or XML style requests should follow the schemas below:
  222. - application/xml:
  223. ```
  224. <regexUrlCheck>
  225. <name>string</name>
  226. <description>string</description>
  227. <enabled>false</enabled>
  228. <regex>string</regex>
  229. </regexUrlCheck>
  230. ```
  231. - application/json:
  232. ```
  233. {
  234. "regexUrlCheck": {
  235. "name": "string",
  236. "description": "string",
  237. "enabled": false,
  238. "regex": "string"
  239. }
  240. }
  241. ```
  242. required:
  243. - name
  244. - regex
  245. properties:
  246. name:
  247. type: string
  248. description: name of the URL check
  249. description:
  250. type: string
  251. description: description for the URL check
  252. enabled:
  253. type: boolean
  254. description: enabled status of the URL check
  255. default: false
  256. regex:
  257. type: string
  258. description: regex to perform the check with
  259. urlChecks:
  260. type: array
  261. items:
  262. $ref: "#/definitions/urlCheck"