I was wondering if there is any example of using REST API with curl to delete a coverage store?
I looked at the examples at the boundless website http://docs.geoserver.org/2.5.x/en/user/rest/examples/curl.html, and there doesn't seem to be any.
I tried:
curl -v -u admin:geoserver -X DELETE http://localhost:8080/geoserver/rest/my_ws/coveragestores/my_cover
and
curl -v -u admin:geoserver -X DELETE http://localhost:8080/geoserver/rest/my_ws/coveragestores/my_cover?recurse=true
In each case, I get an 405 Method Not Allowed
.
Can anyone advise how to fix this?
Output error was:
> DELETE /geoserver/rest/my_ws/coveragestores/my_cover?recurse=true&purge=all HTTP/1.1
> Authorization: Basic YWRtaW46Z2Vvc2VydmVy
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 405 Method Not Allowed
< Allow: GET
< Date: Mon, 20 Oct 2014 01:24:28 GMT
< Server: Noelios-Restlet-Engine/1.0..8
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
--- EDIT ---
Additional Info:
$curl -v -u admin:geoserver -XGET -H "Accept: text/xml" http://localhost:8080/geoserver/rest/workspaces/my_ws/coveragestores.xml
returns:
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1... connected
* Server auth using Basic with user 'admin'
> GET /geoserver/rest/workspaces/my_ws/coveragestores.xml HTTP/1.1
> Authorization: Basic YWRtaW46Z2Vvc2VydmVy
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:8080
> Accept: text/xml
>
< HTTP/1.1 200 OK
< Date: Mon, 20 Oct 2014 02:53:53 GMT
< Server: Noelios-Restlet-Engine/1.0..8
< Content-Type: application/xml
< Transfer-Encoding: chunked
<
<coverageStores>
<coverageStore>
<name>my_cover</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/my_ws/coveragestores/my_cover.xml" type="application/xml"/>
</coverageStore>
* Connection #0 to host localhost left intact
* Closing connection #0
</coverageStores>