cloudyns is a mini tool for managing cloud dns, mainly DigitalOcean, support for other services is expected to be added soon
Project description
Cloudyns
cloudyns is a mini tool for managing cloud dns, mainly DigitalOcean, support for other services is expected to be added soon
Create a record dns in domain hosted DigitalOcean
Script for creating and deleting a record in a DigitalOcean dns domain
Step 1:
you need to create the configuration for the provider
from cloudyns.base.dataclasses import CloudynsConf
cloudyns_conf = CloudynsConf(
provider="digitalocean",
token="add_your_api_key_here"
)
Step 2:
Now you need to import build_provider_manager to build your DigitalOcean provider manager you must give it the configuration created before as parameter
from cloudyns.builder import build_provider_manager
do_manager = build_provider_manager(conf=cloudyns_conf)
Step 3:
You can get the configured zones or domains using do_manager.get_zones()
Output:
['fake-domain.com']
Manage a specific Domain
If you need manage a specific domain, use get_domain method
fake_domain = do_manager.get_domain(domain_name="fake-domain.com")
Get domain records
fake_domain.get_records()
Output:
<DoRecord: domain=fake-domain.com name=@ type=SOA data=1800>
<DoRecord: domain=fake-domain.com name=@ type=NS data=ns1.digitalocean.com>
<DoRecord: domain=fake-domain.com name=@ type=NS data=ns2.digitalocean.com>
<DoRecord: domain=fake-domain.com name=@ type=NS data=ns3.digitalocean.com>
<DoRecord: domain=fake-domain.com name=@ type=A data=127.0.0.1>
<DoRecord: domain=fake-domain.com name=www type=CNAME data=@>
<DoRecord: domain=fake-domain.com name=static type=A data=1.1.1.1>
Add new A record
If you need to add a record of type "A" you must use the domain method add_a_record()
This method use parameter name, data and optional ttl
new_record = fake_domain.add_a_record(name='test-record', data='127.0.0.2')
Output:
<DoRecord: domain=fake-domain.com name=test-record type=A data=127.0.0.2>
Update record
If you need update the data of your record you must use the method update_record in your record instance
This method does not return any output
new_record.update_record(data='127.0.0.3')
Delete record
If you need to delete a record just use the delete_record() methode embedded in each record
This method does not return any output
new_record.delete_record()
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cloudyns-0.0.3b1.tar.gz.
File metadata
- Download URL: cloudyns-0.0.3b1.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6710658c34ba5785f8ec623d04de7cbbab5c378e0d0067065089bf7442fea020
|
|
| MD5 |
2f475079f28873f37d9ea29a6834e950
|
|
| BLAKE2b-256 |
0b80fd0def2d2e2d2f062194b95a81205ad6494afff5fef55a51e83be17a01e4
|
File details
Details for the file cloudyns-0.0.3b1-py3-none-any.whl.
File metadata
- Download URL: cloudyns-0.0.3b1-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5675280dbe96e325576dfc9cfa066c60bd99f661d82fe95d4956937d3eefa50d
|
|
| MD5 |
50ab2b1bcf6fe3d3019a7d9d823fd6f0
|
|
| BLAKE2b-256 |
115372c1f725721a5263ae25a745e2f464eebe80a58c7d57bb3e97a17004ae5c
|