This document describes the on-demand operations available through mgob
's Web API endpoints.
Endpoint | Description |
---|---|
mgob-host:8090/storage |
File server |
mgob-host:8090/status |
Backup job statuses |
mgob-host:8090/metrics |
Prometheus metrics endpoint |
mgob-host:8090/version |
mgob version and runtime details |
mgob-host:8090/debug |
pprof debugging endpoint |
mgob-host:8090/restore |
Restore API |
Endpoint: HTTP POST mgob-host:8090/backup/:planID
Example:
curl -X POST http://mgob-host:8090/backup/mongo-debug
Response:
{
"plan": "mongo-debug",
"file": "mongo-debug-1494256295.gz",
"duration": "3.635186255s",
"size": "455 kB",
"timestamp": "2017-05-08T15:11:35.940141701Z"
}
Endpoint:
- HTTP GET
mgob-host:8090/status
- HTTP GET
mgob-host:8090/status/:planID
Example:
curl -X GET http://mgob-host:8090/status/mongo-debug
Response:
{
"plan": "mongo-debug",
"next_run": "2017-05-13T14:32:00+03:00",
"last_run": "2017-05-13T11:31:00.000622589Z",
"last_run_status": "200",
"last_run_log": "Backup finished in 2.339055539s archive mongo-debug-1494675060.gz size 527 kB"
}
To restore a backup from within the mgob container, use the on-demand /restore/:planID/:file API.
Endpoint: HTTP POST mgob-host:8090/restore/:planID/:file
Example:
curl -X POST http://mgob-host:8090/restore/mongo-test/mongo-test-1494056760.gz
Response:
{
"plan": "mongo-test",
"name": "mongo-test-1494056760.gz",
"duration": "2.4180213s",
"timestamp": "2017-05-06T14:52:40.000000001Z"
}
Special Thanks