Adding force snapshot and force backup APIs (#73)

* Adding force snapshot and force backup APIs.
This commit is contained in:
Renan DelValle 2018-09-14 15:04:16 -07:00 committed by GitHub
parent 0f2ece10ac
commit 5099d7e6ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 64 additions and 2 deletions

View file

@ -644,12 +644,28 @@ func main() {
fmt.Println("GetJobs...role: ", role)
_, result, err := r.GetJobs(role)
if err != nil {
fmt.Print("error: %+v\n", err.Error())
fmt.Printf("error: %+v\n", err.Error())
os.Exit(1)
}
fmt.Println("map size: ", len(result.Configs))
fmt.Println(result.String())
case "snapshot":
fmt.Println("Forcing scheduler to write snapshot to mesos replicated log")
err := r.Snapshot()
if err != nil {
fmt.Printf("error: %+v\n", err.Error())
os.Exit(1)
}
case "performBackup":
fmt.Println("Writing Backup of Snapshot to file system")
err := r.PerformBackup()
if err != nil {
fmt.Printf("error: %+v\n", err.Error())
os.Exit(1)
}
default:
fmt.Println("Command not supported")
os.Exit(1)