diff --git a/http/handler.go b/http/handler.go index 2fe22d26d..3c5033dda 100644 --- a/http/handler.go +++ b/http/handler.go @@ -340,13 +340,13 @@ func newRouter(handler *Handler) *mux.Router { router.HandleFunc("/schema", handler.handleGetSchema).Methods("GET").Name("GetSchema") router.HandleFunc("/schema", handler.handlePostSchema).Methods("POST").Name("PostSchema") router.HandleFunc("/status", handler.handleGetStatus).Methods("GET").Name("GetStatus") - router.HandleFunc("/version", handler.handleGetVersion).Methods("GET").Name("GetVersion") - router.HandleFunc("/transactions", handler.handleGetTransactions).Methods("GET").Name("GetTransactions") - router.HandleFunc("/transaction/{id}", handler.handleGetTransaction).Methods("GET").Name("GetTransaction") - router.HandleFunc("/transaction/", handler.handlePostTransaction).Methods("POST").Name("PostTransaction") router.HandleFunc("/transaction", handler.handlePostTransaction).Methods("POST").Name("PostTransaction") + router.HandleFunc("/transaction/", handler.handlePostTransaction).Methods("POST").Name("PostTransaction") + router.HandleFunc("/transaction/{id}", handler.handleGetTransaction).Methods("GET").Name("GetTransaction") router.HandleFunc("/transaction/{id}", handler.handlePostTransaction).Methods("POST").Name("PostTransaction") router.HandleFunc("/transaction/{id}/finish", handler.handlePostFinishTransaction).Methods("POST").Name("PostFinishTransaction") + router.HandleFunc("/transactions", handler.handleGetTransactions).Methods("GET").Name("GetTransactions") + router.HandleFunc("/version", handler.handleGetVersion).Methods("GET").Name("GetVersion") // /internal endpoints are for internal use only; they may change at any time. // DO NOT rely on these for external applications! diff --git a/transaction.md b/transaction.md index 86c2c54dc..f8f7f5723 100644 --- a/transaction.md +++ b/transaction.md @@ -200,10 +200,11 @@ And body like: } ``` -You may choose any timeout you like, though it's better to err on the -longer side of how long you expect the backup to take. You explicitly -finish the transaction once you're done, so the timeout exists solely -for cleanup in the case of failures. +You MUST specify a timeout. You may choose any timeout you like, +though it's better to err on the longer side of how long you expect +the backup to take. You explicitly finish the transaction once you're +done, so the timeout exists solely for cleanup in the case of +failures. This will return a JSON "transaction response" object. ``` @@ -245,3 +246,11 @@ with headers: Accept: application/json ``` +Finishing the transaction removes it from the transaction store +completely. A 200 response indicates that this was completed +successfully. The "finish" request will also return a Transaction +response object which contains the transaction as it looked at the +time of its removal. Notably, if the transaction was active, it will +contain `active: true` though it does not exist any more and cannot be +used. +