- Category: Blog
- Published on Friday, 06 May 2011 17:13
- Written by Pantelis Sopasakis
- Hits: 1744
What happens in case you delete by mistake a model or other resource that you actually wanted? Jaqpot web services provide you the opportunity to recover it within 30 days from the time of deletion. This is what we call the rescue web service.
The rescue web service is mounted on /rescue and it's principle is quite simple. Let us assume that you delete your model at http://opentox.ntua.gr:8080/model/78afc90c-5f03-4575-abfd-2c0f99ec5fa6. To do so, apply a DELETE method on it providing your authentication token. Here is an example:
curl -X DELETE http://opentox.ntua.gr:8080/model/78afc90c-5f03-4575-abfd-2c0f99ec5fa6 \ -H subjectid:AQIC5wM2LY4SfcxI+m8fnHgGl9Fy75lHQBxEIn8wWZz9pqI=@AAJTSQACMDE=#
The web service returns the response message:
1 components were disabled.
After that if you try to access this model you get an error code 404 (not found). If you need to recover this model simply visit http://opentox.ntua.gr:8080/rescue?id=78afc90c-5f03-4575-abfd-2c0f99ec5fa6 where the URL parameter id is the ID of the model (or other resource) you want to restore. If you do it within the time interval of 1 month you'll get the message:
1 components were enabled.
And you'll have your model back! The whole procedure works in analogy to the Trash Bin we have on our computers (all operating systems support that). So you can now feel more safe about your models :-)