urlchecks.rst 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. .. _rest_urlchecks:
  2. URL Checks
  3. ==========
  4. This REST API allows you to create and manage URL External Access Checks in GeoServer.
  5. .. note:: Read the :api:`API reference for /urlchecks <urlchecks.yaml>`.
  6. Listing all URL Checks
  7. ----------------------
  8. **List all URL Checks on the server, in JSON format:**
  9. *Request*
  10. .. admonition:: curl
  11. ::
  12. curl -u admin:geoserver -XGET http://localhost:8080/geoserver/rest/urlchecks.json
  13. *Response*
  14. .. code-block:: json
  15. {"urlchecks":{"urlcheck":[
  16. {"name":"external","href":"http:\/\/localhost:8080\/geoserver\/rest\/urlchecks\/external.json"},
  17. {"name":"icons","href":"http:\/\/localhost:8080\/geoserver\/rest\/urlchecks\/icons.json"},
  18. {"name":"safeWFS","href":"http:\/\/localhost:8080\/geoserver\/rest\/urlchecks\/safeWFS.json"}]}}
  19. **List all URL Checks, in XML format:**
  20. *Request*
  21. .. admonition:: curl
  22. ::
  23. curl -u admin:geoserver -XGET http://localhost:8080/geoserver/rest/urlchecks.xml
  24. *Response*
  25. .. code-block:: xml
  26. <urlChecks>
  27. <urlCheck>
  28. <name>external</name>
  29. <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"/>
  30. </urlCheck>
  31. <urlCheck>
  32. <name>icons</name>
  33. <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"/>
  34. </urlCheck>
  35. <urlCheck>
  36. <name>safeWFS</name>
  37. <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"/>
  38. </urlCheck>
  39. </urlChecks>
  40. Listing URL Check details
  41. -------------------------
  42. **Retrieve information about a specific URL Check:**
  43. *Request*
  44. .. admonition:: curl
  45. ::
  46. curl -u admin:geoserver -XGET http://localhost:8080/geoserver/rest/urlchecks/icons.xml
  47. *Response*
  48. .. code-block:: xml
  49. <regexUrlCheck>
  50. <name>icons</name>
  51. <description>External graphic icons</description>
  52. <enabled>true</enabled>
  53. <regex>^https://styles.server.net/icons/.*$</regex>
  54. </regexUrlCheck>
  55. Creating a URL Check
  56. --------------------
  57. **Create a new URL Check:**
  58. *Request*
  59. .. admonition:: curl
  60. ::
  61. curl -u admin:geoserver -XPOST -H "Content-type: text/xml" \
  62. -d "<regexUrlCheck> \
  63. <name>icons</name> \
  64. <description>External graphic icons</description> \
  65. <enabled>true</enabled> \
  66. <regex>^https://styles\.server\.net/icons/.*$</regex> \
  67. </regexUrlCheck>" \
  68. http://localhost:8080/geoserver/rest/urlchecks
  69. *Response*
  70. ::
  71. 201 Created
  72. Changing an existing URL Check
  73. ------------------------------
  74. **Edit the configuration of an existing URL Check:**
  75. *Request*
  76. .. admonition:: curl
  77. ::
  78. curl -u admin:geoserver -XPUT -H "Content-type: text/xml" \
  79. -d "<regexUrlCheck> \
  80. <description>External graphic icons (disabled) </description> \
  81. <enabled>false</enabled> \
  82. <regex>^https://styles\.server\.com/icons/.*$</regex> \
  83. </regexUrlCheck>" \
  84. http://localhost:8080/geoserver/rest/urlchecks/icons
  85. *Response*
  86. ::
  87. 200 OK
  88. Deleting a URL Check
  89. --------------------
  90. **Remove a URL Check:**
  91. *Request*
  92. .. admonition:: curl
  93. ::
  94. curl -u admin:geoserver -XDELETE http://localhost:8080/geoserver/rest/urlchecks/icons
  95. *Response*
  96. ::
  97. 200 OK