From 1d0a19c28f4729cc9c3d4ac8e3677920dfa60649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Michon?= Date: Wed, 17 Jul 2019 11:05:37 +0200 Subject: [PATCH 1/2] Add BackupCreate method --- backups.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backups.go b/backups.go index 933288da..b40f7e0e 100644 --- a/backups.go +++ b/backups.go @@ -9,7 +9,8 @@ import ( ) type BackupsService interface { - BackupList(app string, addonID string) ([]Backup, error) + BackupList(app, addonID string) ([]Backup, error) + BackupCreate(app, addonID string) error BackupShow(app, addonID, backupID string) (*Backup, error) BackupDownloadURL(app, addonID, backupID string) (string, error) } @@ -54,6 +55,14 @@ func (c *Client) BackupList(app string, addonID string) ([]Backup, error) { return backupRes.Backups, nil } +func (c *Client) BackupCreate(app, addonID string) error { + err := c.DBAPI(app, addonID).SubresourceAdd("databases", addonID, "backups", nil, nil) + if err != nil { + return errgo.Notef(err, "fail to order a new backup creation") + } + return nil +} + func (c *Client) BackupShow(app, addonID, backup string) (*Backup, error) { var backupRes BackupRes err := c.DBAPI(app, addonID).ResourceGet("backups", backup, nil, &backupRes) From d2428d4ee113d9234da66fe4215ce886895af030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Michon?= Date: Wed, 17 Jul 2019 11:09:50 +0200 Subject: [PATCH 2/2] Update the CHANGELOG --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9133f894..fb5b0a54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## To Be Released + +* Add `RegionMigrationsService` +* Add `BackupCreate` method + ## v2.4.8 * Avoid using `errgo.Mask`