func cmdVolumeRollback(c *cli.Context) { var req sfapi.RollbackToSnapshotRequest vid, _ := strconv.ParseInt(c.Args().First(), 10, 64) sid, _ := strconv.ParseInt(c.Args()[1], 10, 64) req.VolumeID = vid req.SnapshotID = sid _, err := client.RollbackToSnapshot(&req) if err != nil { fmt.Errorf("failed rollback to snapshot: %+v\n", err) } }
func cmdSnapshotRollback(c *cli.Context) { if len(c.Args()) < 2 { fmt.Println("Missing argument to rollback, requires <volumeID> <snapshotID>") return } vID, _ := strconv.ParseInt(c.Args().First(), 10, 64) sID, _ := strconv.ParseInt(c.Args()[1], 10, 64) var req sfapi.RollbackToSnapshotRequest req.VolumeID = vID req.SnapshotID = sID client.RollbackToSnapshot(&req) }