-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open API for use with third party applications (Home Assistant, Node-RED, etc) #587
Comments
Look at this: |
I know this exists. I want something that can query backrest since it already has all of this data available. Ideally the same info I can see via the web UI on backrest should also be available via API. I did get the webhooks setup and working nicely but that is still just data being pushed out of backrest whereas I need to be able to query backrest for data directly. For example: I would like to be able to query for info about a currently running backup to get the complete percentage and other info. Another example: I want to setup a script to query the API and check previous backups to make sure all backups ran and completed successfully. Sort of like another tool that audits my backups to make sure things are running as it should. I currently have it message me every time a backup finishes but this is error prone since I have to manually verify them. The idea is to make this process automatic and an API would be perfect for this. |
It's great to see the interest in scripting / additional automation around backrest, this is certainly something I'd like to support. Putting out more formal docs covering Backrest's architecture and API are on my road map -- hopefully some of which can be code-generated. Today however you'll need to read the proto definitions to understand the API. Today the API is defined formally as a gRPC service https://github.com/garethgeorge/backrest/blob/main/proto/v1/service.proto#L14-L63 which backrest makes accessible over an HTTP gateway which accepts binary requests OR protojson formatted requests. E.g.
is a valid request to the Backup endpoint on the service to start a Backup. Beyond this, for query support I suspect something like
should return the full operation history for your install, which may be quite a bit of JSON data. You can provide optional parameters i.e.
should return the last few thousand operations from the targeted repo |
@garethgeorge thank you! This is exactly what I needed. Here is a flow for an example of how to do this in Node-RED (import using the hamburger menu in NR):
Now I am looking into creating a module for Node-RED to make integrating with backrest much easier for people in the future. Should make scripting a bit easier. Keeping an eye out for the docs update :) |
Is your feature request related to a problem? Please describe.
I want to use Node-RED to communicate with backrest via some sort of API.
Currently I have webhooks that fire off to Node-RED and I use that to send messages to my matrix room with updates about the backups. I want to be able to track the progress of the backup by making calls to some sort of endpoint to get information (similar to how the WebUI works currently).
This would also be really handy because we can build an integration for Home Assistant which would allow people to monitor/trigger their backups from their existing home automation platform.
Describe the solution you'd like
Create an open API and document it so people can build cool stuff off it.
The text was updated successfully, but these errors were encountered: