ROUTE53: Fully implement get-zones (#638)

* ROUTE53: Implement ListZones

* DNSIMPLE: Fix comment
This commit is contained in:
Tom Limoncelli 2020-02-20 15:07:34 -05:00 committed by GitHub
parent b45c6b6b6c
commit 386275fde1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -377,7 +377,7 @@ func (c *DnsimpleApi) updateRecordFunc(old *dnsimpleapi.ZoneRecord, rc *models.R
}
}
// Returns all the zones in an account
// ListZones returns all the zones in an account
func (c *DnsimpleApi) ListZones() ([]string, error) {
client := c.getClient()
accountID, err := c.getAccountID()

View file

@ -110,6 +110,16 @@ func withRetry(f func() error) {
}
}
// ListZones lists the zones on this account.
func (r *route53Provider) ListZones() ([]string, error) {
var zones []string
// Assumes r.zones was filled already by newRoute53().
for i := range r.zones {
zones = append(zones, i)
}
return zones, nil
}
func (r *route53Provider) getZones() error {
var nextMarker *string
r.zones = make(map[string]*r53.HostedZone)