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

Add "get-zone" command (#613)

* Add GetZoneRecords to DNSProvider interface
* dnscontrol now uses ufave/cli/v2
* NEW: get-zones.md
* HasRecordTypeName should be a method on models.Records not models.DomainConfig
* Implement BIND's GetZoneRecords
* new WriteZoneFile implemented
* go mod vendor
* Update docs to use get-zone instead of convertzone
* Add CanGetZone capability and update all providers.
* Get all zones for a provider at once (#626)
* implement GetZoneRecords for cloudflare
* munge cloudflare ttls
* Implement GetZoneRecords for cloudflare (#625)

Co-authored-by: Craig Peterson <192540+captncraig@users.noreply.github.com>
This commit is contained in:
Tom Limoncelli
2020-02-18 08:59:18 -05:00
committed by GitHub
parent cd680cc738
commit 87ad01d194
49 changed files with 1327 additions and 612 deletions

View File

@@ -33,6 +33,7 @@ var features = providers.DocumentationNotes{
providers.CantUseNOPURGE: providers.Cannot(),
providers.DocCreateDomains: providers.Cannot("Can only manage domains registered through their service"),
providers.DocOfficiallySupported: providers.Cannot(),
providers.CanGetZones: providers.Unimplemented(),
}
func init() {
@@ -58,7 +59,7 @@ func (c *GandiApi) getDomainInfo(domain string) (*gandidomain.DomainInfo, error)
}
_, ok := c.domainIndex[domain]
if !ok {
return nil, fmt.Errorf("%s not listed in zones for gandi account", domain)
return nil, fmt.Errorf("'%s' not a zone in gandi account", domain)
}
return c.fetchDomainInfo(domain)
}
@@ -76,6 +77,14 @@ func (c *GandiApi) GetNameservers(domain string) ([]*models.Nameserver, error) {
return ns, nil
}
// GetZoneRecords gets the records of a zone and returns them in RecordConfig format.
func (client *GandiApi) GetZoneRecords(domain string) (models.Records, error) {
return nil, fmt.Errorf("not implemented")
// This enables the get-zones subcommand.
// Implement this by extracting the code from GetDomainCorrections into
// a single function. For most providers this should be relatively easy.
}
// GetDomainCorrections returns a list of corrections recommended for this domain.
func (c *GandiApi) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
dc.Punycode()

View File

@@ -85,6 +85,14 @@ func (c *liveClient) GetNameservers(domain string) ([]*models.Nameserver, error)
return ns, nil
}
// GetZoneRecords gets the records of a zone and returns them in RecordConfig format.
func (client *liveClient) GetZoneRecords(domain string) (models.Records, error) {
return nil, fmt.Errorf("not implemented")
// This enables the get-zones subcommand.
// Implement this by extracting the code from GetDomainCorrections into
// a single function. For most providers this should be relatively easy.
}
// GetDomainCorrections returns a list of corrections recommended for this domain.
func (c *liveClient) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
dc.Punycode()