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.- 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 emptydict
.data (
unicode
) – A body of data to send with the request.headers (
dict
) – Extra headers to add to the request None, leave as an emptydict
.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 createdtype (
AuroraDNSHealthCheckType
) – The type of health check to be createdhostname (
str
) – The hostname of the target to monitorport (
int
) – The port of the target to monitor. E.g. 80 for HTTPpath (
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 runextra (
dict
) – (optional) Extra attributes (driver specific).
- Returns:
- 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 ishealth_check_id (
str
) – ID of the required health check
- Returns:
- ex_list_healthchecks(zone)[source]¶
List all Health Checks in a zone.
- Parameters:
zone (
Zone
) – Zone to list health checks for.- Returns:
list
ofAuroraDNSHealthCheck
- 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 updatedtype (
AuroraDNSHealthCheckType
) – (optional) The type of health check to be createdhostname (
str
) – (optional) The hostname of the target to monitoripaddress (
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 HTTPpath (
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 runextra (
dict
) – (optional) Extra attributes (driver specific).
- Returns:
- get_record(zone_id, record_id)[source]¶
Return a Record instance.
- Parameters:
zone_id (
str
) – ID of the required zonerecord_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
ofRecord
- iterate_zones()[source]¶
Return a generator to iterate over available zones.
- Return type:
generator
ofZone
- list_record_types()[source]¶
Return a list of RecordType objects supported by the provider.
- Returns:
list
ofRecordType
- 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
- 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 idhostname (
str
) – Hostname or FQDN of the targetipaddress (
str
) – IPv4 or IPv6 address of the targetport (
int
) – The port on the target to monitorinterval (
int
) – The interval of the health checkpath (
str
) – The path to monitor on the targetthreshold (
int
) – The threshold of before marking a check as failedhealth (
bool
) – The current health of the health checkenabled (
bool
) – If the health check is currently enabledzone (
Zone
) – Zone instance.driver (
DNSDriver
) – DNSDriver instance.extra (
dict
) – (optional) Extra attributes (driver specific).
- 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.
- 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'¶