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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cloudyns-0.0.3b0.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.3b0.tar.gz
Algorithm Hash digest
SHA256 6384927d2b3387a9862b139b288acb787836985a424a4772880c0c2034b9e736
MD5 e2830e86562fd284d80e915462078379
BLAKE2b-256 8d8201559331bf028ee934df2cb77e5fefcd36b2fe365972ed31686190acd8c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloudyns-0.0.3b0-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.3b0-py3-none-any.whl
Algorithm Hash digest
SHA256 950bb4f9068a88866ac42de5ba706d5ad165469c11bdd566e00b1d9bd42c93ff
MD5 2518325facb7afe614fd03e19f25c6a3
BLAKE2b-256 3db100fcc2be0049a9a8035c090463d81a797f3a5dd1fe47104e6f6a9c11d54a

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