libcloud.dns.drivers.durabledns module
DurableDNS Driver
- class libcloud.dns.drivers.durabledns.DurableDNSConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, backoff=None, retry_delay=None)[source]
Bases:
DurableConnection
Initialize user_id and key; set secure to an
int
based on passed value.- responseCls
alias of
DurableDNSResponse
- class libcloud.dns.drivers.durabledns.DurableDNSDriver(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
- RECORD_TYPE_MAP: Dict[RecordType, str] = {'A': 'A', 'AAAA': 'AAAA', 'CNAME': 'CNAME', 'HINFO': 'HINFO', 'MX': 'MX', 'NS': 'NS', 'PTR': 'PTR', 'RP': 'RP', 'SRV': 'SRV', 'TXT': 'TXT'}
- connectionCls
alias of
DurableDNSConnection
- 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 (e.g. ‘aux’, ‘ttl’). (optional)
- Return type:
Record
- create_zone(domain, type='master', ttl=None, extra=None)[source]
Create a new zone.
- Parameters:
domain (
str
) – Name of zone, followed by a dot (.) (e.g. example.com.)type (
str
) – Zone type (Only master available). (optional)ttl (
int
) – TTL for new records. (optional)extra (
dict
) –- Extra attributes (‘mbox’, ‘ns’, ‘minimum’, ‘refresh’,
’expire’, ‘update_acl’, ‘xfer’).
(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
- 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
- list_records(zone)[source]
Return a list of records for the provided zone.
- Parameters:
zone (
Zone
) – Zone to list records for.- Returns:
list
ofRecord
- type = 'durabledns'
- 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
- update_zone(zone, domain, type='master', ttl=None, extra=None)[source]
Update an existing zone.
- Parameters:
zone (
Zone
) – Zone to update.domain (
str
) – Name of zone, followed by a dot (.) (e.g. example.com.)type (
str
) – Zone type (master / slave).ttl (
int
) – TTL for new records. (optional)extra (
dict
) – Extra attributes (‘ns’, ‘mbox’, ‘refresh’, ‘retry’, ‘expire’, ‘minimum’, ‘xfer’, ‘update_acl’). (optional)
- Return type:
Zone
- class libcloud.dns.drivers.durabledns.DurableDNSResponse(response, connection)[source]
Bases:
DurableResponse
- Parameters:
response (
httplib.HTTPResponse
) – HTTP response object. (optional)connection (
Connection
) – Parent connection object.