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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cloudyns-0.0.3b2.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

Hashes for cloudyns-0.0.3b2.tar.gz
Algorithm Hash digest
SHA256 713c98c2ca36b12f95f80f8b527c66437fab8699654d0e3cf4987f8808ebf3ed
MD5 1a1f41666742194b5d78e7e3965d6c7e
BLAKE2b-256 3251801229ec5593d33b81244cecf776c4ba9ec99302de7e24d54caf2fd152d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloudyns-0.0.3b2-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

Hashes for cloudyns-0.0.3b2-py3-none-any.whl
Algorithm Hash digest
SHA256 b23f52008d4b9f818e37a83513871d21f9854bec4c379bf62e2b15c0dab9829f
MD5 d89d59ac46f2d6671b70b424ccc7c9a3
BLAKE2b-256 09317f8853e3a161ed1692151bd2d33750f9d60779d61b5962224ad3decce24b

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