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>

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.2b2.tar.gz (21.2 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.2b2-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cloudyns-0.0.2b2.tar.gz
  • Upload date:
  • Size: 21.2 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.2b2.tar.gz
Algorithm Hash digest
SHA256 7e2830606841c4637d8c7abb9fffedc7da02d54f96bf0c0234858225787f16b0
MD5 29632b3457356b26f9ed03c2b5340ec1
BLAKE2b-256 91378119e8508d1f440ceb0be71d3d2fdbe28da75b8c32abc73a54b7c408bcac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloudyns-0.0.2b2-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.2b2-py3-none-any.whl
Algorithm Hash digest
SHA256 0ffabbc79bbedbe559beb607061772cff3337b38a7fa23065790b39ae3bd21c8
MD5 d749e21f9a630ba1fe9fb7677800acf8
BLAKE2b-256 0e606d4d628a8d66ecd2696e042e26c4ad9539ac43165827c9386768d485e927

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