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:
@@ -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
|
||||
|
Reference in New Issue
Block a user