Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloudyns-0.0.2b3.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloudyns-0.0.2b3-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file cloudyns-0.0.2b3.tar.gz.

File metadata

  • Download URL: cloudyns-0.0.2b3.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for cloudyns-0.0.2b3.tar.gz
Algorithm Hash digest
SHA256 15b2fae8180edcd90cdd1a696501efb6c6cec2db1ef631f2fd7769bb28c5b372
MD5 e027757ca2a92d5ca906f6c800a68f23
BLAKE2b-256 48f939e715fc7db2723e22bb773642341a54aa394dc3bf39d146b22b7e9963a2

See more details on using hashes here.

File details

Details for the file cloudyns-0.0.2b3-py3-none-any.whl.

File metadata

  • Download URL: cloudyns-0.0.2b3-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for cloudyns-0.0.2b3-py3-none-any.whl
Algorithm Hash digest
SHA256 34b181fa9518d33b775bd3ef66e68cc73261e200d0e39a7aebea5ecce56a271d
MD5 6a6016690b202ea38832b4292999cf9b
BLAKE2b-256 002f9ec1f0946a3dec77a2c916fe103c194ba1aeecc01462046effe407d236cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page