flexmeasures.api.play.routes

Functions

flexmeasures.api.play.routes.restore_data()

API endpoint to restore the database to one of the saved backups.

Example request

This message restores the database to a backup named demo_v0.

{
    "backup": "demo_v0"
}

Example response

This message indicates that the backup has been restored without any error.

{
    "message": "Request has been processed. Database restored to demo_v0.",
    "status": "PROCESSED"
}
Reqheader Authorization:

The authentication token

Reqheader Content-Type:

application/json

Resheader Content-Type:

application/json

Status 200:

PROCESSED

Status 400:

NO_BACKUP, UNRECOGNIZED_BACKUP

Status 401:

UNAUTHORIZED

Status 405:

INVALID_METHOD