libcloud.dns.drivers.auroradns module

AuroraDNS DNS Driver

class libcloud.dns.drivers.auroradns.AuroraDNSConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, backoff=None, retry_delay=None)[source]

Bases: ConnectionUserAndKey

Initialize user_id and key; set secure to an int based on passed value.

calculate_auth_signature(secret_key, method, url, timestamp)[source]
gen_auth_header(api_key, secret_key, method, url, timestamp)[source]
host: str = 'api.auroradns.eu'
request(action, params=None, data='', headers=None, method='GET')[source]

Request a given action.

Basically a wrapper around the connection object’s request that does some helpful pre-processing.

Parameters:
  • action (str) – A path. This can include arguments. If included, any extra parameters are appended to the existing ones.

  • params (dict) – Optional mapping of additional parameters to send. If None, leave as an empty dict.

  • data (unicode) – A body of data to send with the request.

  • headers (dict) – Extra headers to add to the request None, leave as an empty dict.

  • method (str) – An HTTP method such as “GET” or “POST”.

  • raw (bool) – True to perform a “raw” request aka only send the headers and use the rawResponseCls class. This is used with storage API when uploading a file.

  • stream (bool) – True to return an iterator in Response.iter_content and allow streaming of the response data (for downloading large files)

  • retry_failed – True if failed requests should be retried. This argument can override module level constant and environment variable value on per-request basis.

Returns:

An Response instance.

Return type:

Response instance

responseCls

alias of AuroraDNSResponse

class libcloud.dns.drivers.auroradns.AuroraDNSDriver(key: str, secret: str | None = None, secure: bool = True, host: str | None = None, port: int | None = None, **kwargs: Any | None)[source]

Bases: DNSDriver

Parameters:
  • key (str) – API key or username to used (required)

  • secret (str) – Secret password to be used (required)

  • secure (bool) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.

  • host (str) – Override hostname used for connections.

  • port (int) – Override port used for connections.

Returns:

None

HEALTHCHECK_TYPE_MAP = {'HTTP': 'HTTP', 'HTTPS': 'HTTPS', 'TCP': 'TCP'}
RECORD_TYPE_MAP: Dict[RecordType, str] = {'A': 'A', 'AAAA': 'AAAA', 'CNAME': 'CNAME', 'DS': 'DS', 'MX': 'MX', 'NS': 'NS', 'PTR': 'PTR', 'SOA': 'SOA', 'SRV': 'SRV', 'SSHFP': 'SSHFP', 'TLSA': 'TLSA', 'TXT': 'TXT'}
connectionCls

alias of AuroraDNSConnection

create_record(name, zone, type, data, extra=None)[source]

Create a new record.

Parameters:
  • name (str) – Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify empty string (‘’) for this argument.

  • zone (Zone) – Zone where the requested record is created.

  • type (RecordType) – DNS record type (A, AAAA, …).

  • data (str) – Data for the record (depends on the record type).

  • extra (dict) – Extra attributes (driver specific). (optional)

Return type:

Record

create_zone(domain, type='master', ttl=None, extra=None)[source]

Create a new zone.

Parameters:
  • domain (str) – Zone domain name (e.g. example.com)

  • type (str) – Zone type (master / slave).

  • ttl (int) – TTL for new records. (optional)

  • extra (dict) – Extra attributes (driver specific). (optional)

Return type:

Zone

delete_record(record)[source]

Delete a record.

Parameters:

record (Record) – Record to delete.

Return type:

bool

delete_zone(zone)[source]

Delete a zone.

Note: This will delete all the records belonging to this zone.

Parameters:

zone (Zone) – Zone to delete.

Return type:

bool

ex_create_healthcheck(zone, type, hostname, port, path, interval, threshold, ipaddress=None, enabled=True, extra=None)[source]

Create a new Health Check in a zone

Parameters:
  • zone (Zone) – Zone in which the health check should be created

  • type (AuroraDNSHealthCheckType) – The type of health check to be created

  • hostname (str) – The hostname of the target to monitor

  • port (int) – The port of the target to monitor. E.g. 80 for HTTP

  • path (str) – The path of the target to monitor. Only used by HTTP at this moment. Usually this is simple /.

  • interval (int) – The interval of checks. 10, 30 or 60 seconds.

  • threshold (int) – The threshold of failures before the healthcheck is marked as failed.

  • ipaddress (str) – (optional) The IP Address of the target to monitor. You can pass a empty string if this is not required.

  • enabled (bool) – (optional) If this healthcheck is enabled to run

  • extra (dict) – (optional) Extra attributes (driver specific).

Returns:

AuroraDNSHealthCheck

ex_delete_healthcheck(healthcheck)[source]

Remove an existing Health Check

Parameters:

zone (AuroraDNSHealthCheck) – The healthcheck which has to be removed

ex_get_healthcheck(zone, health_check_id)[source]

Get a single Health Check from a zone

Parameters:
  • zone (Zone) – Zone in which the health check is

  • health_check_id (str) – ID of the required health check

Returns:

AuroraDNSHealthCheck

ex_list_healthchecks(zone)[source]

List all Health Checks in a zone.

Parameters:

zone (Zone) – Zone to list health checks for.

Returns:

list of AuroraDNSHealthCheck

ex_update_healthcheck(healthcheck, type=None, hostname=None, ipaddress=None, port=None, path=None, interval=None, threshold=None, enabled=None, extra=None)[source]

Update an existing Health Check

Parameters:
  • zone (AuroraDNSHealthCheck) – The healthcheck which has to be updated

  • type (AuroraDNSHealthCheckType) – (optional) The type of health check to be created

  • hostname (str) – (optional) The hostname of the target to monitor

  • ipaddress (str) – (optional) The IP Address of the target to monitor. You can pass a empty string if this is not required.

  • port (int) – (optional) The port of the target to monitor. E.g. 80 for HTTP

  • path (str) – (optional) The path of the target to monitor. Only used by HTTP at this moment. Usually just ‘/’.

  • interval (int) – (optional) The interval of checks. 10, 30 or 60 seconds.

  • threshold (int) – (optional) The threshold of failures before the healthcheck is marked as failed.

  • enabled (bool) – (optional) If this healthcheck is enabled to run

  • extra (dict) – (optional) Extra attributes (driver specific).

Returns:

AuroraDNSHealthCheck

get_record(zone_id, record_id)[source]

Return a Record instance.

Parameters:
  • zone_id (str) – ID of the required zone

  • record_id (str) – ID of the required record

Return type:

Record

get_zone(zone_id)[source]

Return a Zone instance.

Parameters:

zone_id (str) – ID of the required zone

Return type:

Zone

iterate_records(zone)[source]

Return a generator to iterate over records for the provided zone.

Parameters:

zone (Zone) – Zone to list records for.

Return type:

generator of Record

iterate_zones()[source]

Return a generator to iterate over available zones.

Return type:

generator of Zone

list_record_types()[source]

Return a list of RecordType objects supported by the provider.

Returns:

list of RecordType

name: str = 'AuroraDNS'
update_record(record, name, type, data, extra=None)[source]

Update an existing record.

Parameters:
  • record (Record) – Record to update.

  • name (str) – Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify empty string (‘’) for this argument.

  • type (RecordType) – DNS record type (A, AAAA, …).

  • data (str) – Data for the record (depends on the record type).

  • extra (dict) – (optional) Extra attributes (driver specific).

Return type:

Record

website: str = 'https://www.pcextreme.nl/en/aurora/dns'
class libcloud.dns.drivers.auroradns.AuroraDNSHealthCheck(id, type, hostname, ipaddress, port, interval, path, threshold, health, enabled, zone, driver, extra=None)[source]

Bases: object

AuroraDNS Healthcheck resource.

Parameters:
  • id (str) – Healthcheck id

  • hostname (str) – Hostname or FQDN of the target

  • ipaddress (str) – IPv4 or IPv6 address of the target

  • port (int) – The port on the target to monitor

  • interval (int) – The interval of the health check

  • path (str) – The path to monitor on the target

  • threshold (int) – The threshold of before marking a check as failed

  • health (bool) – The current health of the health check

  • enabled (bool) – If the health check is currently enabled

  • zone (Zone) – Zone instance.

  • driver (DNSDriver) – DNSDriver instance.

  • extra (dict) – (optional) Extra attributes (driver specific).

delete()[source]
update(type=None, hostname=None, ipaddress=None, port=None, interval=None, path=None, threshold=None, enabled=None, extra=None)[source]
class libcloud.dns.drivers.auroradns.AuroraDNSHealthCheckType[source]

Bases: object

Healthcheck type.

HTTP = 'HTTP'
HTTPS = 'HTTPS'
TCP = 'TCP'
class libcloud.dns.drivers.auroradns.AuroraDNSResponse(response, connection)[source]

Bases: JsonResponse

Parameters:
  • response (httplib.HTTPResponse) – HTTP response object. (optional)

  • connection (Connection) – Parent connection object.

parse_error()[source]

Parse the error messages.

Override in a provider’s subclass.

Returns:

Parsed error.

Return type:

str

success()[source]

Determine if our request was successful.

The meaning of this can be arbitrary; did we receive OK status? Did the node get created? Were we authenticated?

Return type:

bool

Returns:

True or False

exception libcloud.dns.drivers.auroradns.HealthCheckDoesNotExistError(value, driver, health_check_id)[source]

Bases: HealthCheckError

error_type = 'HealthCheckDoesNotExistError'
exception libcloud.dns.drivers.auroradns.HealthCheckError(value, driver, health_check_id)[source]

Bases: LibcloudError

error_type = 'HealthCheckError'