1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

GANDI_V5 & OVH: Implement ZoneLister (#1117)

* GANDI_V5: implement ZoneLister

* OVH: implement ZoneLister
This commit is contained in:
nemunaire
2021-04-03 16:31:25 +02:00
committed by GitHub
parent 877d54879e
commit ce6006cce7
2 changed files with 24 additions and 0 deletions

View File

@@ -98,6 +98,22 @@ func newHelper(m map[string]string, metadata json.RawMessage) (*gandiv5Provider,
// Section 3: Domain Service Provider (DSP) related functions
// ListZones lists the zones on this account.
func (client *gandiv5Provider) ListZones() ([]string, error) {
g := gandi.NewLiveDNSClient(client.apikey, gandi.Config{SharingID: client.sharingid, Debug: client.debug})
listResp, err := g.ListDomains()
if err != nil {
return nil, err
}
zones := make([]string, len(listResp))
for i, zone := range listResp {
zones[i] = zone.FQDN
}
return zones, nil
}
// NB(tal): To future-proof your code, all new providers should
// implement GetDomainCorrections exactly as you see here
// (byte-for-byte the same). In 3.0