A python interface to the ClouDNS.net API
Project description
A python interface to the ClouDNS.net API
Please note that this is still in Beta. Use at your own risk.
This project is an independent project and is not endorsed by CloudNS.net.
The interface is designed to be simple and intuitive. Entities are represented as modules and there is a simple list, create, update, and delete function (when appropriate, ie, you cannot delete an SOA record) for each entity. Some entities have functions specific to them, but whenever possible, the arguments are consistent. The code reads pretty clearly.
For information on the CloudNS.net API see here.
Installing and including in projects
Installing cloudns_api
$ pip install cloudns_api
In order to authenticate correctly, create the following environment variables (using your own credentials):
export CLOUDNS_API_AUTH_USER=my_user
export CLOUDNS_API_AUTH_PASSWORD=my_password
# When you are debugging:
export CLOUDNS_API_DEBUG=True
Running Tests
$ cd <project directory>
$ py.test
Importing and Basic Usage
>>> import cloudns_api
>>> response = cloudns_api.soa.get('example.com')
>>> print(response.json())
{
'success' : True,
'status_code' : 200,
'payload' : {
'admin_mail' : 'admin@example.com',
'default_ttl' : '3600',
'expire' : '1209600',
'primary_ns' : 'ns1.example.com',
'refresh' : '7200',
'retry' : '1800',
'serial_number' : '2019060601'},
}
}
>>> cloudns_api.soa.update(
'example.com',
admin_mail='admin@example.com,
default_ttl=3600,
expire='1209600', # You can use strings or integers
primary_ns='ns1.example.com',
refresh=7200,
retry=1800,
serial_number=2019060601
)
API Reference
TODO
Soli Deo gloria.
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
Built Distribution
Hashes for cloudns_api-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6137988b51c5bae83bf6de03b696fd84fd695d6f85dc3552f3b8f2a57dcacc2 |
|
MD5 | 7403ae5105645060ee9f7508408cf6ae |
|
BLAKE2b-256 | a1fe38757a8266505f3633b17fcd48dad95c0e27d0143a98953984b73e6d0829 |