Skip to content

Backup and Health Endpoints #528

Closed
Closed

Description

@gramian

Dear Developers,

I was thinking the following two HTTP endpoints could be useful (at least for me):

  1. Backup a database: /api/v1/backup/{database} (as a shortcut alternative for the BACKUP DATABASE [ <backup-file-url> ] command)
  2. Check status of server: /api/v1/health (returning a simple OK)

Thank you for considering this

Activity

  1. lvca commented on Sep 22, 2022

    @lvca
    Member

    @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 {}

  2. self-assigned this
    on Sep 22, 2022
  3. added
    question
    on Sep 22, 2022
  4. gramian commented on Sep 22, 2022

    @gramian
    CollaboratorAuthor

    OK, I understand this approach.

    Thanks for clarifying the use of /server.

  5. gramian commented on Sep 25, 2022

    @gramian
    CollaboratorAuthor

    @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.

  6. lvca commented on Sep 26, 2022

    @lvca
    Member

    @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.

  7. added this to the 22.9.1 milestone on Sep 26, 2022
  8. lvca commented on Sep 26, 2022

    @lvca
    Member

    Done, it's in the main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

question

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions