Adding force snapshot and force backup APIs.

This commit is contained in:
Renan DelValle 2018-09-14 13:02:15 -07:00
parent 0f2ece10ac
commit d6860e4ca4
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
3 changed files with 66 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)