mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-07 13:44:18 +08:00
GCORE: Implement ListZones to allow auto create zones (#3588)
This commit is contained in:
parent
1d148f430b
commit
113c1ac13b
3 changed files with 39 additions and 6 deletions
26
commands/types/dnscontrol.d.ts
vendored
26
commands/types/dnscontrol.d.ts
vendored
|
@ -1131,7 +1131,13 @@ declare function DefaultTTL(ttl: Duration): DomainModifier;
|
|||
declare function DnsProvider(name: string, nsCount?: number): DomainModifier;
|
||||
|
||||
/**
|
||||
* Documentation needed.
|
||||
* This is provider specific type of record and not a DNS standard. It may behave differently for each provider that handles it.
|
||||
*
|
||||
* ### Namecheap
|
||||
*
|
||||
* This is a URL Redirect record with a type of "Masked", it creates a framed HTML page to the target.
|
||||
*
|
||||
* You can read more at the [Namecheap documentation](https://www.namecheap.com/support/knowledgebase/article.aspx/385/2237/how-to-set-up-a-url-redirect-for-a-domain/).
|
||||
*
|
||||
* @see https://docs.dnscontrol.org/language-reference/domain-modifiers/frame
|
||||
*/
|
||||
|
@ -3256,18 +3262,30 @@ declare function TTL(ttl: Duration): RecordModifier;
|
|||
declare function TXT(name: string, contents: string, ...modifiers: RecordModifier[]): DomainModifier;
|
||||
|
||||
/**
|
||||
* Documentation needed.
|
||||
* This is provider specific type of record and not a DNS standard. It may behave differently for each provider that handles it.
|
||||
*
|
||||
* ### Namecheap
|
||||
*
|
||||
* This is a URL Redirect record with a type of "Unmasked", it creates a 302 redirect to the target.
|
||||
*
|
||||
* You can read more at the [Namecheap documentation](https://www.namecheap.com/support/knowledgebase/article.aspx/385/2237/how-to-set-up-a-url-redirect-for-a-domain/)
|
||||
*
|
||||
* @see https://docs.dnscontrol.org/language-reference/domain-modifiers/url
|
||||
*/
|
||||
declare function URL(name: string, target: string, ...modifiers: RecordModifier[]): DomainModifier;
|
||||
|
||||
/**
|
||||
* Documentation needed.
|
||||
* This is provider specific type of record and not a DNS standard. It may behave differently for each provider that handles it.
|
||||
*
|
||||
* ### Namecheap
|
||||
*
|
||||
* This is a URL Redirect record with a type of "Permanent", it creates a 301 redirect to the target.
|
||||
*
|
||||
* You can read more at the [Namecheap documentation](https://www.namecheap.com/support/knowledgebase/article.aspx/385/2237/how-to-set-up-a-url-redirect-for-a-domain/).
|
||||
*
|
||||
* @see https://docs.dnscontrol.org/language-reference/domain-modifiers/url301
|
||||
*/
|
||||
declare function URL301(name: string, ...modifiers: RecordModifier[]): DomainModifier;
|
||||
declare function URL301(name: string, target: string, ...modifiers: RecordModifier[]): DomainModifier;
|
||||
|
||||
/**
|
||||
* `getConfiguredDomains` getConfiguredDomains is a helper function that returns the domain names
|
||||
|
|
|
@ -36,7 +36,7 @@ If a feature is definitively not supported for whatever reason, we would also li
|
|||
| [`EXOSCALE`](exoscale.md) | ❌ | ✅ | ❌ | ❔ | ✅ | ✅ | ❔ | ❔ | ❌ | ❔ | ✅ | ❔ | ✅ | ❔ | ❔ | ❌ | ❔ | ❔ | ❔ | ❔ | ❌ | ❌ | ❔ |
|
||||
| [`GANDI_V5`](gandi_v5.md) | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ❔ | ❔ | ❌ | ❔ | ✅ | ❔ | ✅ | ✅ | ❔ | ✅ | ❌ | ❔ | ❔ | ❔ | ❔ | ❌ | ✅ |
|
||||
| [`GCLOUD`](gcloud.md) | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❔ | ✅ | ❌ | ❔ | ✅ | ❔ | ✅ | ✅ | ✅ | ✅ | ❔ | ❔ | ❔ | ❔ | ✅ | ✅ | ✅ |
|
||||
| [`GCORE`](gcore.md) | ❌ | ✅ | ❌ | ❔ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ❔ | ✅ | ❌ | ✅ | ❌ | ❌ | ❔ | ❔ | ❔ | ✅ | ✅ | ✅ |
|
||||
| [`GCORE`](gcore.md) | ❌ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ❔ | ✅ | ❌ | ✅ | ❌ | ❌ | ❔ | ❔ | ❔ | ✅ | ✅ | ✅ |
|
||||
| [`HEDNS`](hedns.md) | ❌ | ✅ | ❌ | ❔ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ❔ | ❔ | ❔ | ✅ | ✅ | ✅ |
|
||||
| [`HETZNER`](hetzner.md) | ❌ | ✅ | ❌ | ✅ | ❌ | ✅ | ❌ | ❔ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❔ | ✅ | ✅ | ❔ | ❔ | ❔ | ✅ | ✅ | ✅ |
|
||||
| [`HEXONET`](hexonet.md) | ❌ | ✅ | ✅ | ❔ | ❌ | ✅ | ❔ | ❔ | ❔ | ❔ | ✅ | ❔ | ✅ | ❔ | ❔ | ✅ | ❔ | ❔ | ❔ | ❔ | ✅ | ✅ | ❔ |
|
||||
|
|
|
@ -46,7 +46,7 @@ var features = providers.DocumentationNotes{
|
|||
// See providers/capabilities.go for the entire list of capabilities.
|
||||
providers.CanAutoDNSSEC: providers.Can(),
|
||||
providers.CanGetZones: providers.Can(),
|
||||
providers.CanConcur: providers.Unimplemented(),
|
||||
providers.CanConcur: providers.Can(),
|
||||
providers.CanUseAlias: providers.Can(),
|
||||
providers.CanUseCAA: providers.Can(),
|
||||
providers.CanUseDS: providers.Cannot(),
|
||||
|
@ -227,6 +227,21 @@ func (c *gcoreProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, exist
|
|||
return result, actualChangeCount, nil
|
||||
}
|
||||
|
||||
// ListZones return all the zones in the account
|
||||
func (c *gcoreProvider) ListZones() ([]string, error) {
|
||||
zones, err := c.provider.Zones(c.ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var zoneList []string
|
||||
for _, zone := range zones {
|
||||
zoneList = append(zoneList, zone.Name)
|
||||
}
|
||||
|
||||
return zoneList, nil
|
||||
}
|
||||
|
||||
func comparableFunc(rec *models.RecordConfig) string {
|
||||
if len(rec.Metadata) == 0 {
|
||||
return ""
|
||||
|
|
Loading…
Add table
Reference in a new issue