Closed kathryn-baker closed 3 weeks ago
I'm afraid the documentation lags behind a bit. I will update as soon as possible, but in the meanwhile:
Delete endpoint is http://service-save-and-restore:8080/save-restore/node
, but you need to send a body containing a list of the node ids to be deleted, e.g. ["id_1","id_2"]
I am aware that a body with DELETE is discouraged :-).
There are more updates to the documentation pending, e.g. the return value from /restore/node
.
Thanks, that's worked! I can delete the nodes with this function now :)
def delete_folder(settings: dict, node_id: NodeId):
r = requests.delete(settings["save_restore_url"], auth=(settings["username"], settings["password"]), json=[node_id])
r.raise_for_status()
Does this apply to the other endpoints like PUT and POST etc as well or just DELETE?
Difficult to answer with yes/no...
On top of the (somewhat crippled) documentation, there is also the Swagger UI which by definition should be correct:
http://service-save-and-restore:8080/swagger-ui/index.html
Thanks, I'll have a look through the swagger UI to see if I can find what I need, that looks very useful.
Just to correct the link to save anyone else confusion, the swagger UI docs are actually at http://service-save-and-restore:8080/save-restore/swagger-ui/index.html
with the additional save-restore
in the middle
You are right, by default /save-restore
needs to be there in the URL, but this is configurable. We use just /
as context root.
Can we close this?
Yep this can be closed, thanks again!
I am trying to modify some code that interacts with the save and restore service via Python using the
requests
library. I am working in Docker, running the save and restore service with the following configuration / start up script.Where
applications.properties
is as follows:I believe this means I should have minimal authentication required as this is purely a test environment, not production.
However, when trying to delete a node using the following commands:
I get a 405 status code, suggesting that the delete method is not allowed.
Is there something missing in the configuration file that is preventing the deletion?
The version of the save-and-restore service was built from the Phoebus repo yesterday (21st October 2024) and I am running a python:3.11-slim container with save and restore built using
openjdk:22-jdk-slim
and elasticsearch 8.12.0Thanks for your help 😄