mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
add DnsMadeEasy to README, sandbox environment toggle
This commit is contained in:
@@ -152,6 +152,7 @@ The above command pulled the existing data out of Route53 and placed the results
|
|||||||
| [AzureProvider](/octodns/provider/azuredns.py) | A, AAAA, CNAME, MX, NS, PTR, SRV, TXT | No | |
|
| [AzureProvider](/octodns/provider/azuredns.py) | A, AAAA, CNAME, MX, NS, PTR, SRV, TXT | No | |
|
||||||
| [CloudflareProvider](/octodns/provider/cloudflare.py) | A, AAAA, ALIAS, CAA, CNAME, MX, NS, SPF, TXT | No | CAA tags restricted |
|
| [CloudflareProvider](/octodns/provider/cloudflare.py) | A, AAAA, ALIAS, CAA, CNAME, MX, NS, SPF, TXT | No | CAA tags restricted |
|
||||||
| [DigitalOceanProvider](/octodns/provider/digitalocean.py) | A, AAAA, CAA, CNAME, MX, NS, TXT, SRV | No | CAA tags restricted |
|
| [DigitalOceanProvider](/octodns/provider/digitalocean.py) | A, AAAA, CAA, CNAME, MX, NS, TXT, SRV | No | CAA tags restricted |
|
||||||
|
| [DnsMadeEasyProvider](/octodns/provider/dnsmadeeasy.py) | A, AAAA, CAA, CNAME, MX, NS, PTR, SPF, SRV, TXT | No | CAA tags restricted |
|
||||||
| [DnsimpleProvider](/octodns/provider/dnsimple.py) | All | No | CAA tags restricted |
|
| [DnsimpleProvider](/octodns/provider/dnsimple.py) | All | No | CAA tags restricted |
|
||||||
| [DynProvider](/octodns/provider/dyn.py) | All | Yes | |
|
| [DynProvider](/octodns/provider/dyn.py) | All | Yes | |
|
||||||
| [GoogleCloudProvider](/octodns/provider/googlecloud.py) | A, AAAA, CAA, CNAME, MX, NAPTR, NS, PTR, SPF, SRV, TXT | No | |
|
| [GoogleCloudProvider](/octodns/provider/googlecloud.py) | A, AAAA, CAA, CNAME, MX, NAPTR, NS, PTR, SPF, SRV, TXT | No | |
|
||||||
|
|||||||
@@ -51,11 +51,15 @@ class DnsMadeEasyClientNotFound(DnsMadeEasyClientException):
|
|||||||
|
|
||||||
|
|
||||||
class DnsMadeEasyClient(object):
|
class DnsMadeEasyClient(object):
|
||||||
BASE = 'https://api.dnsmadeeasy.com/V2.0/dns/managed'
|
PRODUCTION = 'https://api.dnsmadeeasy.com/V2.0/dns/managed'
|
||||||
|
SANDBOX = 'https://api.sandbox.dnsmadeeasy.com/V2.0/dns/managed'
|
||||||
|
|
||||||
def __init__(self, api_key, secret_key):
|
def __init__(self, api_key, secret_key, sandbox=False):
|
||||||
self.api_key = api_key
|
self.api_key = api_key
|
||||||
self.secret_key = secret_key
|
self.secret_key = secret_key
|
||||||
|
self._base = self.PRODUCTION
|
||||||
|
if sandbox:
|
||||||
|
self._base = self.SANDBOX
|
||||||
self._sess = Session()
|
self._sess = Session()
|
||||||
self._domains = None
|
self._domains = None
|
||||||
|
|
||||||
@@ -77,7 +81,7 @@ class DnsMadeEasyClient(object):
|
|||||||
}
|
}
|
||||||
self._sess.headers.update(headers)
|
self._sess.headers.update(headers)
|
||||||
|
|
||||||
url = '{}{}'.format(self.BASE, path)
|
url = '{}{}'.format(self._base, path)
|
||||||
resp = self._sess.request(method, url, params=params, json=data)
|
resp = self._sess.request(method, url, params=params, json=data)
|
||||||
if resp.status_code == 400:
|
if resp.status_code == 400:
|
||||||
raise DnsMadeEasyClientBadRequest(resp)
|
raise DnsMadeEasyClientBadRequest(resp)
|
||||||
@@ -148,18 +152,25 @@ class DnsMadeEasyProvider(BaseProvider):
|
|||||||
|
|
||||||
dnsmadeeasy:
|
dnsmadeeasy:
|
||||||
class: octodns.provider.dnsmadeeasy.DnsMadeEasyProvider
|
class: octodns.provider.dnsmadeeasy.DnsMadeEasyProvider
|
||||||
|
# Your DnsMadeEasy api key (required)
|
||||||
api_key: env/DNSMADEEASY_API_KEY
|
api_key: env/DNSMADEEASY_API_KEY
|
||||||
|
# Your DnsMadeEasy secret key (required)
|
||||||
secret_key: env/DNSMADEEASY_SECRET_KEY
|
secret_key: env/DNSMADEEASY_SECRET_KEY
|
||||||
|
# Whether or not to use Sandbox environment
|
||||||
|
# (optional, default is false)
|
||||||
|
sandbox: true
|
||||||
'''
|
'''
|
||||||
SUPPORTS_GEO = False
|
SUPPORTS_GEO = False
|
||||||
SUPPORTS = set(('A', 'AAAA', 'CAA', 'CNAME', 'MX',
|
SUPPORTS = set(('A', 'AAAA', 'CAA', 'CNAME', 'MX',
|
||||||
'NS', 'PTR', 'SPF', 'SRV', 'TXT'))
|
'NS', 'PTR', 'SPF', 'SRV', 'TXT'))
|
||||||
|
|
||||||
def __init__(self, id, api_key, secret_key, *args, **kwargs):
|
def __init__(self, id, api_key, secret_key, sandbox=False,
|
||||||
|
*args, **kwargs):
|
||||||
self.log = logging.getLogger('DnsMadeEasyProvider[{}]'.format(id))
|
self.log = logging.getLogger('DnsMadeEasyProvider[{}]'.format(id))
|
||||||
self.log.debug('__init__: id=%s, api_key=***, secret_key=***', id)
|
self.log.debug('__init__: id=%s, api_key=***, secret_key=***, '
|
||||||
|
'sandbox=%s', id, sandbox)
|
||||||
super(DnsMadeEasyProvider, self).__init__(id, *args, **kwargs)
|
super(DnsMadeEasyProvider, self).__init__(id, *args, **kwargs)
|
||||||
self._client = DnsMadeEasyClient(api_key, secret_key)
|
self._client = DnsMadeEasyClient(api_key, secret_key, sandbox)
|
||||||
|
|
||||||
self._zone_records = {}
|
self._zone_records = {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user