Skip to content

Commit

Permalink
Merge pull request #120 from Scalingo/fix/455/backup_config
Browse files Browse the repository at this point in the history
Add DatabaseShow method
  • Loading branch information
Soulou authored Jul 22, 2019
2 parents 23b38a4 + b2a1e39 commit 478378b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## To Be Released

* Add `DatabaseShow`

## v2.5.0

* Add periodic backups configuration method
Expand Down
9 changes: 9 additions & 0 deletions databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ type DatabaseRes struct {
Database Database `json:"database"`
}

func (c *Client) DatabaseShow(app, addonID string) (Database, error) {
var db Database
err := c.DBAPI(app, addonID).ResourceGet("databases", addonID, nil, &db)
if err != nil {
return Database{}, errgo.Notef(err, "fail to get the database")
}
return db, nil
}

type PeriodicBackupsConfigParams struct {
ScheduledAt *int `json:"periodic_backups_scheduled_at,omitempty"`
Enabled *bool `json:"periodic_backups_enabled,omitempty"`
Expand Down

0 comments on commit 478378b

Please sign in to comment.