GeezerVison is showing github.com — Backup and Health Endpoints · Issue #528 · ArcadeData/arcadedb
Backup and Health Endpoints #528Labels questionFurther information is requested DescriptionDear Developers,
I was thinking the following two HTTP endpoints could be useful (at least for me):
- Backup a database:
/api/v1/backup/{database} (as a shortcut alternative for the BACKUP DATABASE [ <backup-file-url> ] command)
- Check status of server:
/api/v1/health (returning a simple OK)
Thank you for considering this Activitylvca commented on Sep 22, 2022 @gramian We try to keep the API strict to the minimum, to simplify things. So whatever you can do with SQL (or any supported language), it's better to use it instead of creating one API per command.
About /health, you could use /server to return if the server is ok. If runs distributed, it returns the cluster configuration, otherwise just {} gramian commented on Sep 22, 2022 CollaboratorAuthor More actions OK, I understand this approach.
Thanks for clarifying the use of /server. gramian commented on Sep 25, 2022 CollaboratorAuthor More actions @lvca
I have a brief follow-up question on the server endpoint: Using a GET request I get an empty response, but when using a POST request with empty payload, I get the empty JSON {} returned. Am I doing something wrong, is this working correctly, or should the server endpoint actually be a POST endpoint? I tested this using curl. lvca commented on Sep 26, 2022 @gramian you're totally right, the command handler is registered as a POST, but by looking at the code there are zero not-idempotent requests to the databases or server, so it could totally be a GET.
I guess the first idea was to put there some commands to manipulate the server/cluster.
I'm going to modify the current POST into a GET, updated the docs, and in the case we're going to provide new methods to change server settings, we could have a proper POST. It's going to be into 22.9.1 which will be released this week. lvca commented on Sep 26, 2022 Done, it's in the main branch.
MetadataMetadataquestionFurther information is requested DevelopmentNo branches or pull requestsIssue actions
|