-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the backups-create command #452
Changes from 6 commits
0fbb528
e64c5cc
85c025a
bc00e69
a06f27a
ac0bf49
fc0648d
54c7a0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package db | ||
|
||
import ( | ||
"github.com/Scalingo/cli/config" | ||
"github.com/Scalingo/cli/io" | ||
errgo "gopkg.in/errgo.v1" | ||
) | ||
|
||
func CreateBackup(app, addon string) error { | ||
client, err := config.ScalingoClient() | ||
if err != nil { | ||
return errgo.Notef(err, "fail to get Scalingo client") | ||
} | ||
err = client.BackupCreate(app, addon) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
io.Status("Successfully ordered to make a backup") | ||
return nil | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could follow the backup progression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well actually it was not really well designed. The backend should have returned
202
and an operation URL in theLocation
header. Then we could have follow the process... ^^That being said I can add a
backups-show
command and update the status message to state:Successfully scheduled a new backup. Type "scalingo backups-show backup-id" to follow the progress
If it's what you want, I would prefer to do it in a separate PR. OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what i did for the db-cli. I think that this might be enough no ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean
BackupGet
orGetBackup
? 😆There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But yes, good idea!