Skip to content

Commit

Permalink
Add DatabaseShow method
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneM committed Jul 22, 2019
1 parent 23b38a4 commit b2a1e39
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 b2a1e39

Please sign in to comment.