A very simple python client used to update the IP address in A records for GoDaddy managed domains.
Project description
GoDaddyPy
Python library useful for updating DNS settings through the GoDaddy v1 API.
Migrated from: https://github.com/eXamadeus-zz/godaddypy
Concept originated from observerss’ pygodaddy @ https://github.com/observerss/pygodaddy.
Setup
First, go to https://developer.godaddy.com/keys/ and request a production API key and secret.
Note: Sometimes the production API keys don’t seem to work correctly. Just delete it and request another one.
Second, install GoDaddyPy with pip.
$ pip install godaddypy
Examples
Also see /examples for more examples.
>>> from godaddypy import Client, Account
>>>
>>> my_acct = Account(api_key='PUBLIC_KEY', api_secret='SECRET_KEY')
>>> delegate_acct = Account(api_key='PUBLIC_KEY', api_secret='SECRET_KEY', delegate='DELEGATE_ID')
>>> client = Client(my_acct)
>>> delegate_client = Client(delegate_acct)
>>>
>>> client.get_domains()
['domain1.example', 'domain2.example']
>>>
>>> client.get_records('domain1.example', record_type='A')
[{'name': 'dynamic', 'ttl': 3600, 'data': '1.1.1.1', 'type': 'A'}]
>>>
>>> client.update_ip('2.2.2.2', domains=['domain1.example'])
True
>>>
>>> client.get_records('domain1.example')
[{'name': 'dynamic', 'ttl': 3600, 'data': '2.2.2.2', 'type': 'A'}, {'name': 'dynamic', 'ttl': 3600, 'data': '::1',
'type': 'AAAA'},]
>>>
>>> client.get_records('apple.com', record_type='A', name='@')
[{u'data': u'1.2.3.4', u'type': u'A', u'name': u'@', u'ttl': 3600}]
>>>
>>> client.update_record_ip('3.3.3.3', 'domain1.example', 'dynamic', 'A')
True
>>>
>>> client.add_record('apple.com', {'data':'1.2.3.4','name':'test','ttl':3600, 'type':'A'})
True
>>>
>>> client.delete_records('apple.com', name='test')
True
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
GoDaddyPy-2.4.1.tar.gz
(8.8 kB
view hashes)
Built Distribution
Close
Hashes for GoDaddyPy-2.4.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d0fc09325cdd762145f0332ec1e492234151a604aac60b18c9826114899125a |
|
MD5 | 5e9e76425b31a3537317fe91d1f17341 |
|
BLAKE2b-256 | 5601ca3a077690c4ca23b4b73fdce7f312c8251c40b2b36c34d9b19c7990c769 |