proxy-base-ext.yaml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. ---
  2. swagger: '2.0'
  3. info:
  4. version: 1.0.0
  5. title: GeoServer Proxy Base Extension
  6. description: A Proxy Base Extension rule allows to rewrite the links returned by
  7. the REST API to point to a different host and/or port. This is useful when GeoServer
  8. is behind a reverse proxy, and the proxy is configured to rewrite the host and/or
  9. port in the request URL.
  10. contact:
  11. name: GeoServer
  12. email: 'geoserver-users@osgeo.org'
  13. url: 'https://geoserver.org/comm/'
  14. host: localhost:8080
  15. basePath: /geoserver/rest
  16. paths:
  17. /proxy-base-ext:
  18. get:
  19. operationId: getProxyBaseExtensionRules
  20. summary: Get the Proxy Base Extension rules
  21. description: Returns the list of Proxy Base Extension rules.
  22. tags:
  23. - ProxyBaseExtension
  24. produces:
  25. - application/xml
  26. - application/json
  27. responses:
  28. 200:
  29. description: OK
  30. schema:
  31. $ref: '#/definitions/Rules'
  32. examples:
  33. application/xml: |
  34. <ProxyBaseExtensionRules>
  35. <ProxyBaseExtensionRule>
  36. <id>9d6fc373-f109-4a9c-9417-dbd0bc821ae9</id>
  37. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/proxy-base-ext/rules/9d6fc373-f109-4a9c-9417-dbd0bc821ae9.xml" type="application/atom+xml"/>
  38. </ProxyBaseExtensionRule>
  39. </ProxyBaseExtensionRules>
  40. application/json: |
  41. {"ProxyBaseExtensionRules":{"ProxyBaseExtensionRule":[
  42. {
  43. "id":"9d6fc373-f109-4a9c-9417-dbd0bc821ae9",
  44. "href":"http://localhost:8080/geoserver/rest/proxy-base-ext/rules/9d6fc373-f109-4a9c-9417-dbd0bc821ae9.json"
  45. }
  46. ]}}
  47. post:
  48. operationId: postProxyBaseExtensionRule
  49. summary: Create a Proxy Base Extension rule
  50. description: Creates a new Proxy Base Extension rule.
  51. tags:
  52. - ProxyBaseExtension
  53. produces:
  54. - application/xml
  55. - application/json
  56. parameters:
  57. - $ref: '#/parameters/ruleBodyParameter'
  58. responses:
  59. 201:
  60. description: Created
  61. schema:
  62. type: string
  63. headers:
  64. Location:
  65. description: URL where the newly created rule can be found
  66. type: string
  67. /proxy-base-ext/rules/{id}:
  68. get:
  69. operationId: getProxyBaseExtensionRule
  70. summary: Get a Proxy Base Extension rule
  71. description: Returns the Proxy Base Extension rule with the given id.
  72. tags:
  73. - ProxyBaseExtension
  74. produces:
  75. - application/xml
  76. - application/json
  77. parameters:
  78. - name: id
  79. in: path
  80. description: The id of the rule
  81. required: true
  82. type: string
  83. responses:
  84. 200:
  85. description: OK
  86. schema:
  87. $ref: '#/definitions/Rule'
  88. examples:
  89. application/xml: |
  90. <ProxyBaseExtensionRule>
  91. <id>9d6fc373-f109-4a9c-9417-dbd0bc821ae9</id>
  92. <activated>true</activated>
  93. <position>0</position>
  94. <transformer>http://localhost:8080/geoserver</transformer>
  95. <matcher>.*</matcher>
  96. </ProxyBaseExtensionRule>
  97. application/json: |
  98. {"ProxyBaseExtensionRule":{
  99. "id":"9d6fc373-f109-4a9c-9417-dbd0bc821ae9",
  100. "activated":true,
  101. "position":0,
  102. "transformer":"http://localhost:8080/geoserver",
  103. "matcher":".*"
  104. }}
  105. put:
  106. operationId: putProxyBaseExtensionRule
  107. summary: Update a Proxy Base Extension rule
  108. description: Updates the Proxy Base Extension rule with the given id.
  109. tags:
  110. - ProxyBaseExtension
  111. produces:
  112. - application/xml
  113. - application/json
  114. parameters:
  115. - name: id
  116. in: path
  117. description: The id of the rule
  118. required: true
  119. type: string
  120. - $ref: '#/parameters/ruleBodyParameter'
  121. consumes:
  122. - application/xml
  123. - application/json
  124. responses:
  125. 200:
  126. description: The rule was updated
  127. delete:
  128. operationId: deleteProxyBaseExtensionRule
  129. summary: Delete a Proxy Base Extension rule
  130. description: Deletes the Proxy Base Extension rule with the given id.
  131. tags:
  132. - ProxyBaseExtension
  133. parameters:
  134. - name: id
  135. in: path
  136. description: The id of the rule
  137. required: true
  138. type: string
  139. responses:
  140. 200:
  141. description: The rule was deleted
  142. parameters:
  143. ruleBodyParameter:
  144. name: body
  145. in: body
  146. description: The rule to be created
  147. required: true
  148. schema:
  149. $ref: '#/definitions/Rule'
  150. definitions:
  151. Rules:
  152. title: Rule link list
  153. type: array
  154. items:
  155. title: ruleListItem
  156. type: object
  157. properties:
  158. id:
  159. type: string
  160. description: Identifeir of the rule
  161. link:
  162. type: string
  163. description: URL to the rule definition
  164. Rule:
  165. title: Rule
  166. type: object
  167. properties:
  168. id:
  169. type: string
  170. description: identifier of the rule
  171. activated:
  172. type: boolean
  173. description: Whether or not the Proxy Base Extension rule is active
  174. position:
  175. type: integer
  176. description: The priority of the rule, the lower the number the higher the priority
  177. transformer:
  178. type: string
  179. description: The transformer to be used to rewrite the links
  180. matcher:
  181. type: string
  182. description: The path matcher to be used to match the links for rewriting, works with regular expressions