Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auroradns: Add support for Health Checks #672

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/dns/drivers/auroradns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,31 @@ served.
Afterwards we enable the record and this make the DNS server serve this specific
record.

Health Checks
-------------

AuroraDNS has support for Health Checks which will disable all records attached
to that health check should it fail. With this you can create DNS based
loadbalancing over multiple records.

In the example below we create a health check and afterwards attach a newly
created record to this health check.

For example:

.. literalinclude:: /examples/dns/auroradns/health_checks.py
:language: python

API Docs
--------

.. autoclass:: libcloud.dns.drivers.auroradns.AuroraDNSDriver
:members:
:inherited-members:

.. autoclass:: libcloud.dns.drivers.auroradns.AuroraDNSHealthCheck
:members:
:inherited-members:

.. _`PCextreme B.V.`: https://www.pcextreme.nl/
.. _`AuroraDNS`: https://www.pcextreme.nl/en/aurora/dns
2 changes: 1 addition & 1 deletion docs/examples/dns/auroradns/enable_disable_record.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from libcloud.dns.types import Provider
from libcloud.dns.providers import get_driver
from libcloud.dns.types import RecordType
from libcloud.dns.providers import get_driver

cls = get_driver(Provider.AURORADNS)

Expand Down
21 changes: 21 additions & 0 deletions docs/examples/dns/auroradns/health_checks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from libcloud.dns.types import Provider, RecordType
from libcloud.dns.providers import get_driver
from libcloud.dns.drivers.auroradns import AuroraDNSHealthCheckType

cls = get_driver(Provider.AURORADNS)

driver = cls('myapikey', 'mysecret')

zone = driver.get_zone('auroradns.eu')

health_check = driver.ex_create_healthcheck(zone=zone,
type=AuroraDNSHealthCheckType.HTTP,
hostname='web01.auroradns.eu',
path='/',
port=80,
interval=10,
threshold=5)

record = zone.create_record(name='www', type=RecordType.AAAA,
data='2a00:f10:452::1',
extra={'health_check_id': health_check.id})
Loading