libcloud.dns.drivers package¶
Submodules¶
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'¶
libcloud.dns.drivers.buddyns module¶
BuddyNS DNS Driver
- class libcloud.dns.drivers.buddyns.BuddyNSDNSDriver(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
- connectionCls¶
alias of
BuddyNSDNSConnection
- create_zone(domain, type='master', ttl=None, extra=None)[source]¶
- Parameters:
domain (
str
) – Zone domain name (e.g. example.com)type (
str
) – Zone type (This is not really used. See API docs for extra parameters)ttl (
int
) – TTL for new records (This is used through the extra param)extra – Extra attributes that are specific to the driver
such as ttl. :type extra:
dict
- Return type:
Zone
Do not forget to pass the master in extra, extra = {‘master’:’65.55.37.62’} for example.
- type = 'buddyns'¶
libcloud.dns.drivers.cloudflare module¶
- class libcloud.dns.drivers.cloudflare.CloudFlareDNSDriver(key, secret=None, secure=True, host=None, port=None, **kwargs)[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
- MEMBERSHIPS_PAGE_SIZE = 50¶
- RECORDS_PAGE_SIZE = 100¶
- RECORD_TYPE_MAP: Dict[RecordType, str] = {'A': 'A', 'AAAA': 'AAAA', 'CNAME': 'CNAME', 'MX': 'MX', 'NS': 'NS', 'SPF': 'SPF', 'SRV': 'SRV', 'TXT': 'TXT', 'URL': 'LOC'}¶
- ZONES_PAGE_SIZE = 50¶
- connectionCls¶
alias of
GlobalAPIKeyDNSConnection
- create_record(name, zone, type, data, extra=None)[source]¶
@inherits:
DNSDriver.create_record
Note that for
extra
record properties, only the ones specified inRECORD_CREATE_ATTRIBUTES
can be set at creation time. Any non-settable properties are ignored.NOTE: For CAA RecordType, data needs to be in the following format: <flags> <tag> <ca domain name> where the tag can be issue, issuewild or iodef.
For example: 0 issue test.caa.com
NOTE: For SSHFP RecordType, data need to be in the format: <algorithm> <type> <fingerprint>
- create_zone(domain, type='master', ttl=None, extra=None)[source]¶
@inherits:
DNSDriver.create_zone
Note that for users who have more than one account membership, the id of the account in which to create the zone must be specified via the
extra
keyaccount
.Note that for
extra
zone properties, only the ones specified inZONE_CREATE_ATTRIBUTES
can be set at creation time. Additionally, setting the ``ttl` property is not supported.
- 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
- 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
- type = 'cloudflare'¶
- update_record(record, name=None, type=None, data=None, extra=None)[source]¶
@inherits:
DNSDriver.update_record
Note that for
extra
record properties, only the ones specified inRECORD_UPDATE_ATTRIBUTES
can be updated. Any non-updatable properties are ignored.
- update_zone(zone, domain, type='master', ttl=None, extra=None)[source]¶
@inherits:
DNSDriver.update_zone
Note that the
zone
,type
andttl
properties can’t be updated. The only updatable properties are theextra
zone properties specified inZONE_UPDATE_ATTRIBUTES
. Only one property may be updated at a time. Any non-updatable properties are ignored.
libcloud.dns.drivers.digitalocean module¶
Digital Ocean DNS Driver
- class libcloud.dns.drivers.digitalocean.DigitalOceanDNSDriver(key, secret=None, api_version='v2', **kwargs)[source]¶
Bases:
DigitalOcean_v2_BaseDriver
,DNSDriver
- Parameters:
key (
str
) – API key or username to be 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.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- RECORD_TYPE_MAP: Dict[RecordType, str] = {'A': 'A', 'AAAA': 'AAAA', 'CNAME': 'CNAME', 'MX': 'MX', 'NS': 'NS', 'SRV': 'SRV', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
DigitalOcean_v2_Connection
- 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 for MX and SRV. (Depends on record) {“priority” : 0, “port” : 443, “weight” : 100}
- 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) (does nothing).ttl (
int
) – TTL for new records. (does nothing)extra (
dict
) – Extra attributes (to set ip). (optional) Note: This can be used to set the default A record with {“ip” : “IP.AD.DR.ESS”} otherwise 127.0.0.1 is used
- 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 = 'digitalocean'¶
- update_record(record, name=None, type=None, data=None, extra=None)[source]¶
Update an existing record.
- Parameters:
record (
Record
) – Record to update.name (
str
) – Record name without the domain name (e.g. www). (Ignored) Note: The value is pulled from the record being updatedtype (
RecordType
) – DNS record type (A, AAAA, …). (Ignored) Note: Updating records does not support changing type so this value is ignoreddata (
str
) – Data for the record (depends on the record type).extra (
dict
) – (optional) Extra attributes (driver specific).
- Return type:
Record
libcloud.dns.drivers.dnsimple module¶
DNSimple DNS Driver
- class libcloud.dns.drivers.dnsimple.DNSimpleDNSDriver(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', 'ALIAS': 'ALIAS', 'CNAME': 'CNAME', 'HINFO': 'HINFO', 'MX': 'MX', 'NAPTR': 'NAPTR', 'NS': 'NS', 'POOL': 'POOL', 'SOA': 'SOA', 'SPF': 'SPF', 'SRV': 'SRV', 'SSHFP': 'SSHFP', 'TXT': 'TXT', 'URL': 'URL'}¶
- connectionCls¶
alias of
DNSimpleDNSConnection
- 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 (All zones are master by design).ttl (
int
) – TTL for new records. (This is not really used)extra (
dict
) – Extra attributes (driver specific). (optional)
- Return type:
Zone
For more info, please see: http://developer.dnsimple.com/v1/domains/
- 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 = 'dnsimple'¶
- 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
libcloud.dns.drivers.dnspod module¶
- class libcloud.dns.drivers.dnspod.DNSPodDNSDriver(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', 'MX': 'MX', 'NS': 'NS', 'PTR': 'PTR', 'SOA': 'SOA', 'SRV': 'SRV', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
DNSPodDNSConnection
- create_record(name, zone, type, data, extra=None)[source]¶
Create a 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 which the records will be created for.type (
RecordType
) – DNS record type ( ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’).data (
str
) – Data for the record (depends on the record type).extra (
dict
) – (optional) Extra attributes (‘prio’, ‘ttl’).
- Return type:
Record
- create_zone(domain, type='master', ttl=None, extra=None)[source]¶
- Parameters:
domain (
str
) – Zone domain name (e.g. example.com)type (
str
) – Zone type (This is not really used. See API docs for extra parameters)ttl (
int
) – TTL for new records (This is used through the extra param)extra – Extra attributes that are specific to the driver
such as ttl. :type extra:
dict
- Return type:
Zone
- delete_record(record)[source]¶
Delete a record.
- Parameters:
record (
Record
) – Record 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
- 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 = 'dnspod'¶
libcloud.dns.drivers.dummy module¶
- class libcloud.dns.drivers.dummy.DummyDNSDriver(api_key, api_secret)[source]¶
Bases:
DNSDriver
Dummy DNS driver.
>>> from libcloud.dns.drivers.dummy import DummyDNSDriver >>> driver = DummyDNSDriver('key', 'secret') >>> driver.name 'Dummy DNS Provider'
- Parameters:
api_key (
str
) – API key or username to used (required)api_secret (
str
) – Secret password to be used (required)
- Return type:
None
- create_record(name, zone, type, data, extra=None)[source]¶
>>> driver = DummyDNSDriver('key', 'secret') >>> zone = driver.create_zone(domain='apache.org', type='master', ... ttl=100) >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') >>> record <Record: zone=apache.org, name=libcloud, type=A, data=127.0.0.1...> >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') ... Traceback (most recent call last): RecordAlreadyExistsError:
@inherits:
DNSDriver.create_record
- create_zone(domain, type='master', ttl=None, extra=None)[source]¶
>>> driver = DummyDNSDriver('key', 'secret') >>> zone = driver.create_zone(domain='apache.org', type='master', ... ttl=100) >>> zone <Zone: domain=apache.org, ttl=100, provider=Dummy DNS Provider ...> >>> zone = driver.create_zone(domain='apache.org', type='master', ... ttl=100) ... Traceback (most recent call last): ZoneAlreadyExistsError:
@inherits:
DNSDriver.create_zone
- delete_record(record)[source]¶
>>> driver = DummyDNSDriver('key', 'secret') >>> zone = driver.create_zone(domain='apache.org', type='master', ... ttl=100) >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') >>> driver.delete_record(record) True >>> driver.delete_record(record) Traceback (most recent call last): RecordDoesNotExistError:
@inherits:
DNSDriver.delete_record
- delete_zone(zone)[source]¶
>>> driver = DummyDNSDriver('key', 'secret') >>> zone = driver.create_zone(domain='apache.org', type='master', ... ttl=100) >>> driver.delete_zone(zone) True >>> driver.delete_zone(zone) Traceback (most recent call last): ZoneDoesNotExistError:
@inherits:
DNSDriver.delete_zone
- get_record(zone_id, record_id)[source]¶
>>> driver = DummyDNSDriver('key', 'secret') >>> driver.get_record(zone_id='doesnotexist', record_id='exists') ... Traceback (most recent call last): ZoneDoesNotExistError:
@inherits:
DNSDriver.get_record
- get_zone(zone_id)[source]¶
>>> driver = DummyDNSDriver('key', 'secret') >>> driver.get_zone(zone_id='foobar') ... Traceback (most recent call last): ZoneDoesNotExistError:
@inherits:
DNSDriver.get_zone
- list_record_types()[source]¶
>>> driver = DummyDNSDriver('key', 'secret') >>> driver.list_record_types() ['A']
@inherits:
DNSDriver.list_record_types
- list_records(zone)[source]¶
>>> driver = DummyDNSDriver('key', 'secret') >>> zone = driver.create_zone(domain='apache.org', type='master', ... ttl=100) >>> list(zone.list_records()) [] >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') >>> list(zone.list_records()) [<Record: zone=apache.org, name=libcloud, type=A...>]
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.
libcloud.dns.drivers.gandi module¶
- class libcloud.dns.drivers.gandi.GandiDNSDriver(key: str, secret: str | None = None, secure: bool = True, host: str | None = None, port: int | None = None, **kwargs: Any | None)[source]¶
Bases:
BaseGandiDriver
,DNSDriver
API reference can be found at:
http://doc.rpc.gandi.net/domain/reference.html
- 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', 'LOC': 'LOC', 'MX': 'MX', 'NS': 'NS', 'SPF': 'SPF', 'SRV': 'SRV', 'TXT': 'TXT', 'WKS': 'WKS'}¶
- connectionCls¶
alias of
GandiDNSConnection
- 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
- 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 = 'gandi'¶
- update_record(record, name, type, data, extra)[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=None, type=None, ttl=None, extra=None)[source]¶
Update an existing zone.
- Parameters:
zone (
Zone
) – Zone to update.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
libcloud.dns.drivers.gandi_live module¶
- class libcloud.dns.drivers.gandi_live.GandiLiveDNSDriver(key: str, secret: str | None = None, secure: bool = True, host: str | None = None, port: int | None = None, **kwargs: Any | None)[source]¶
Bases:
BaseGandiLiveDriver
,DNSDriver
API reference can be found at:
https://doc.livedns.gandi.net/
Please note that the Libcloud paradigm of one zone per domain does not match exactly with Gandi LiveDNS. For Gandi, a “zone” can apply to multiple domains. This driver behaves as if the domain is a zone, but be warned that modifying a domain means modifying the zone. Iif you have a zone associated with mutiple domains, all of those domains will be modified as well.
- 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', 'ALIAS': 'ALIAS', 'CAA': 'CAA', 'CNAME': 'CNAME', 'DNAME': 'DNAME', 'DS': 'DS', 'KEY': 'KEY', 'LOC': 'LOC', 'MX': 'MX', 'NS': 'NS', 'PTR': 'PTR', 'SPF': 'SPF', 'SRV': 'SRV', 'SSHFP': 'SSHFP', 'TLSA': 'TLSA', 'TXT': 'TXT', 'WKS': 'WKS'}¶
- connectionCls¶
alias of
GandiLiveDNSConnection
- 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
- export_zone_to_bind_format(zone)[source]¶
Export Zone object to the BIND compatible format.
- Parameters:
zone (
Zone
) – Zone to export.- Returns:
Zone data in BIND compatible format.
- Return type:
str
- 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 = 'gandi'¶
- update_record(record, name, type, data, extra)[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
libcloud.dns.drivers.godaddy module¶
- class libcloud.dns.drivers.godaddy.GoDaddyDNSDriver(shopper_id, key, secret, secure=True, host=None, port=None)[source]¶
Bases:
DNSDriver
A driver for GoDaddy DNS.
This is for customers of GoDaddy who wish to purchase, update existing domains and manage records for DNS zones owned by GoDaddy NS servers.
Instantiate a new GoDaddyDNSDriver
- Parameters:
shopper_id (
str
) – Your customer ID or shopper ID with GoDaddykey (
str
) – Your access key from developer.godaddy.comsecret (
str
) – Your access key secret
- RECORD_TYPE_MAP: Dict[RecordType, str] = {'A': 'A', 'AAAA': 'AAAA', 'CNAME': 'CNAME', 'MX': 'MX', 'NS': 'SPF', 'SRV': 'SRV', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
GoDaddyDNSConnection
- 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
- delete_zone(zone)[source]¶
Delete a zone.
Note: This will CANCEL a purchased domain
- Parameters:
zone (
Zone
) – Zone to delete.- Return type:
bool
- ex_check_availability(domain, for_transfer=False)[source]¶
Check the availability of the domain
- Parameters:
domain (
str
) – the domain name e.g. wazzlewobbleflooble.comfor_transfer (
bool
) – Check if domain is available for transfer
- Return type:
list of
GoDaddyAvailability
- ex_get_agreements(tld, privacy=True)[source]¶
Get the legal agreements for a tld Use this in conjunction with ex_purchase_domain
- Parameters:
tld (
str
) – The top level domain e.g com, eu, uk- Return type:
dict the JSON Schema
- ex_get_purchase_schema(tld)[source]¶
Get the schema that needs completing to purchase a new domain Use this in conjunction with ex_purchase_domain
- Parameters:
tld (
str
) – The top level domain e.g com, eu, uk- Return type:
dict the JSON Schema
- ex_purchase_domain(purchase_request)[source]¶
Purchase a domain with GoDaddy
- Parameters:
purchase_request (
dict
) – The completed document from ex_get_purchase_schema- Return type:
GoDaddyDomainPurchaseResponse
Your order
- 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]¶
Get a zone (by domain)
- Parameters:
zone_id (
str
) – The domain, not the ID- 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 = 'godaddy'¶
- 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
libcloud.dns.drivers.google module¶
- class libcloud.dns.drivers.google.GoogleDNSDriver(user_id, key, project=None, auth_type=None, scopes=None, **kwargs)[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', 'CAA': 'CAA', 'CNAME': 'CNAME', 'MX': 'MX', 'NS': 'NS', 'PTR': 'PTR', 'SOA': 'SOA', 'SPF': 'SPF', 'SRV': 'SRV', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
GoogleDNSConnection
- create_record(name, zone, type, data, extra=None)[source]¶
Create a new record.
- Parameters:
name (
str
) – Record name fully qualified, with a ‘.’ at the end.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. (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.) with a ‘.’ at the end.type (
str
) – Zone type (master is the only one supported).ttl (
int
) – TTL for new records. (unused)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_bulk_record_changes(zone, records)[source]¶
Bulk add and delete records.
- Parameters:
zone (
Zone
) – Zone where the requested record changes are done.records – Dictionary of additions list or deletions list, or both
- of resourceRecordSets. For example:
- {‘additions’: [{‘rrdatas’: [‘127.0.0.1’],
‘kind’: ‘dns#resourceRecordSet’, ‘type’: ‘A’, ‘name’: ‘www.example.com.’, ‘ttl’: ‘300’}],
- ‘deletions’: [{‘rrdatas’: [‘127.0.0.1’],
‘kind’: ‘dns#resourceRecordSet’, ‘type’: ‘A’, ‘name’: ‘www2.example.com.’, ‘ttl’: ‘300’}]}
- Returns:
A dictionary of Record additions and deletions.
- Return type:
dict
of additions and deletions ofRecord
- 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
- type = 'google'¶
libcloud.dns.drivers.linode module¶
- class libcloud.dns.drivers.linode.LinodeDNSDriver(key, secret=None, secure=True, host=None, port=None, api_version='4.0', **kwargs)[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
- type = 'linode'¶
libcloud.dns.drivers.liquidweb module¶
Liquid Web DNS Driver
- class libcloud.dns.drivers.liquidweb.LiquidWebDNSDriver(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', 'MX': 'MX', 'NS': 'NS', 'PTR': 'PTR', 'SOA': 'SOA', 'SRV': 'SRV', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
LiquidWebDNSConnection
- create_record(name, zone, type, data, extra=None)[source]¶
Create a 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 which the records will be created for.type (
RecordType
) – DNS record type ( ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’).data (
str
) – Data for the record (depends on the record type).extra (
dict
) – (optional) Extra attributes (‘prio’, ‘ttl’).
- 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 (This is not really used. See API docs for extra parameters).ttl (
int
) – TTL for new records. (This is not really used)extra (
dict
) – Extra attributes (driver specific). (‘region_support’, ‘zone_data’)
- Return type:
Zone
For more info, please see: https://www.liquidweb.com/storm/api/docs/v1/Network/DNS/Zone.html
- 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 = 'liquidweb'¶
- 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’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’).data (
str
) – Data for the record (depends on the record type).extra (
dict
) – (optional) Extra attributes (‘name’, ‘rdata’, ‘prio’, ‘ttl’).
- Return type:
Record
libcloud.dns.drivers.luadns module¶
- class libcloud.dns.drivers.luadns.LuadnsDNSDriver(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', 'MX': 'MX', 'NS': 'NS', 'PTR': 'PTR', 'SOA': 'SOA', 'SRV': 'SRV', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
LuadnsDNSConnection
- create_record(name, zone, type, data, extra=None)[source]¶
Create a 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 which the records will be created for.type (
RecordType
) – DNS record type ( ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’).data (
str
) – Data for the record (depends on the record type).extra (
dict
) – (optional) Extra attributes (‘prio’, ‘ttl’).
- 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 (This is not really used. See API docs for extra parameters).ttl (
int
) – TTL for new records. (This is not really used)extra (
dict
) – Extra attributes (driver specific). (‘region_support’, ‘zone_data’)
- 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 = 'luadns'¶
libcloud.dns.drivers.nfsn module¶
NFSN DNS Driver
- class libcloud.dns.drivers.nfsn.NFSNDNSDriver(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', 'MX': 'MX', 'NS': 'NS', 'PTR': 'PTR', 'SRV': 'SRV', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
NFSNConnection
- 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, MX, TXT).data (
str
) – Data for the record (depends on the record type).extra (
dict
) – Extra attributes (driver specific, e.g. ‘ttl’). (optional)
- Return type:
Record
- delete_record(record)[source]¶
Use this method to delete a record.
- Parameters:
record (Record) – record to delete
- Return type:
Bool
- ex_get_records_by(zone, name=None, type=None)[source]¶
Return a list of records for the provided zone, filtered by name and/or type.
- Parameters:
zone (
Zone
) – Zone to list records for.zone – Zone where the requested records are found.
name (
str
) – name of the records, for example “www”. (optional)type (
RecordType
) – DNS record type (A, MX, TXT). (optional)
- Returns:
list
ofRecord
- get_zone(zone_id)[source]¶
Return a Zone instance.
- Parameters:
zone_id (
str
) – name of the required zone, for example “example.com”.- Return type:
Zone
- Raises:
ZoneDoesNotExistError: If no zone could be found.
- list_records(zone)[source]¶
Return a list of all records for the provided zone.
- Parameters:
zone (
Zone
) – Zone to list records for.- Returns:
list
ofRecord
- type = 'nfsn'¶
libcloud.dns.drivers.nsone module¶
- class libcloud.dns.drivers.nsone.NsOneDNSDriver(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', 'MX': 'MX', 'NS': 'NS', 'PTR': 'PTR', 'SOA': 'SOA', 'SRV': 'SRV', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
NsOneDNSConnection
- create_record(name, zone, type, data, extra=None)[source]¶
- Parameters:
name (
str
) – Name of the record to create (e.g. foo).zone (
Zone
) – Zone where the record should be created.type (
str
) – Type of record (e.g. A, MX etc)data (
str
) – Data of the record (e.g. 127.0.0.1 for the A record)extra (
dict
) – Extra data needed to create different types of records
- Returns:
Record
- create_zone(domain, type='master', ttl=None, extra=None)[source]¶
- Parameters:
domain (
str
) – Zone domain name (e.g. example.com)type (
str
) – Zone type (This is not really used. See API docs for extra parameters)ttl (
int
) – TTL for new records (This is used through the extra param)extra – Extra attributes that are specific to the driver
such as ttl. :type extra:
dict
- Return type:
Zone
- ex_zone_exists(zone_id, zones_list)[source]¶
Function to check if a Zone object exists. :param zone_id: ID of the Zone object. :type zone_id:
str
- Parameters:
zones_list (
list
.) – A list containing Zone objects.- Return type:
Returns True or False.
- get_record(zone_id, record_id)[source]¶
- Parameters:
zone_id – The id of the zone where to search for
the record (e.g. example.com) :type zone_id:
str
:param record_id: The type of record to search for (e.g. A, AAA, MX etc)- Returns:
Record
- list_records(zone)[source]¶
- Parameters:
zone (
Zone
) – Zone to list records for.- Returns:
list
ofRecord
- type = 'nsone'¶
- update_record(record, name, type, data, extra=None)[source]¶
- Parameters:
record (
Record
) – Record to updatename (
str
) – Name of the record to update (e.g. foo).type (
str
) – Type of record (e.g. A, MX etc)data (
str
) – Data of the record (e.g. 127.0.0.1 for the A record)extra (
dict
) – Extra data needed to create different types of records
- Returns:
Record
libcloud.dns.drivers.onapp module¶
OnApp DNS Driver
- class libcloud.dns.drivers.onapp.OnAppDNSDriver(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', 'MX': 'MX', 'NS': 'NS', 'SOA': 'SOA', 'SRV': 'SRV', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
OnAppConnection
- 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 – Data for the record (depends on the record type).
Used only for A and AAAA record types. :type data:
str
- Parameters:
extra (
dict
) – Extra attributes (driver specific). (optional)- Return type:
Record
For more info, please see: https://docs.onapp.com/display/52API/Add+DNS+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 (All zones are master by design).ttl (
int
) – TTL for new records. (This is not really used)extra – Extra attributes (set auto_populate: 0 if you
don’t want to auto populate with existing DNS records). (optional) :type extra:
dict
- Return type:
Zone
For more info, please see: https://docs.onapp.com/display/52API/Add+DNS+Zone
- delete_record(record)[source]¶
Delete a record.
- Parameters:
record (
Record
) – Record to delete.- Return type:
bool
For more info, please see: https://docs.onapp.com/display/52API/Delete+DNS+Record
- delete_zone(zone)[source]¶
Delete a zone.
Note: This will also 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 = 'onapp'¶
- 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 – Data for the record (depends on the record type).
Used only for A and AAAA record types. :type data:
str
- Parameters:
extra (
dict
) – (optional) Extra attributes (driver specific).- Return type:
Record
For more info, please see: https://docs.onapp.com/display/52API/Edit+DNS+Records
libcloud.dns.drivers.pointdns module¶
Point DNS Driver
- class libcloud.dns.drivers.pointdns.MailRedirect(id, source, destination, zone, driver)[source]¶
Bases:
object
Point DNS mail redirect.
- Parameters:
id (
str
) – MailRedirect id.source (
str
) – The source address of mail redirect.destination (
str
) – The destination address of mail redirect.zone (
Zone
) – Zone where mail redirect belongs.driver (
DNSDriver
) – DNSDriver instance.
- class libcloud.dns.drivers.pointdns.PointDNSDriver(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', 'ALIAS': 'ALIAS', 'CNAME': 'CNAME', 'MX': 'MX', 'NS': 'NS', 'PTR': 'PTR', 'SRV': 'SRV', 'SSHFP': 'SSHFP', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
PointDNSConnection
- 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 (All zones are master by design).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_mail_redirect(destination, source, zone)[source]¶
- Parameters:
destination (
str
) – The destination address of mail redirect.source (
str
) – The source address of mail redirect.zone (
Zone
) – Zone to list redirects for.
- Return type:
list
ofMailRedirect
- ex_create_redirect(redirect_to, name, type, zone, iframe=None, query=None)[source]¶
- Parameters:
redirect_to (
str
) – The data field. (redirect_to)name (
str
) – The FQDN for the record.type (
str
) – The type of redirects 301, 302 or 0 for iframes.zone (
Zone
) – Zone to list redirects for.iframe (
str
) – Title of iframe (optional).query (
bool
) – boolean Information about including query string when redirecting. (optional).
- Return type:
Record
- ex_delete_mail_redirect(mail_r)[source]¶
- Parameters:
mail_r (
MailRedirect
) – Mail redirect to update- Return type:
bool
- ex_delete_redirect(redirect)[source]¶
- Parameters:
mail_r (
Redirect
) – Redirect to delete- Return type:
bool
- ex_get_mail_redirects(zone_id, mail_r_id)[source]¶
- Parameters:
zone (
Zone
) – Zone to list redirects for.mail_r_id (
str
) – Mail redirect id.
- Return type:
list
ofMailRedirect
- ex_get_redirect(zone_id, redirect_id)[source]¶
- Parameters:
zone (
Zone
) – Zone to list redirects for.redirect_id (
str
) – Redirect id.
- Return type:
list
ofRedirect
- ex_list_mail_redirects(zone)[source]¶
- Parameters:
zone (
Zone
) – Zone to list redirects for.- Return type:
list
ofMailRedirect
- ex_list_redirects(zone)[source]¶
- Parameters:
zone (
Zone
) – Zone to list redirects for.- Return type:
list
ofRecord
- ex_update_mail_redirect(mail_r, destination, source=None)[source]¶
- Parameters:
mail_r (
MailRedirect
) – Mail redirect to updatedestination (
str
) – The destination address of mail redirect.source (
str
) – The source address of mail redirect. (optional)
- Return type:
list
ofMailRedirect
- ex_update_redirect(redirect, redirect_to=None, name=None, type=None, iframe=None, query=None)[source]¶
- Parameters:
redirect – Record to update
redirect_to (
str
) – The data field. (optional).name (
str
) – The FQDN for the record.type (
str
) – The type of redirects 301, 302 or 0 for iframes. (optional).iframe (
str
) – Title of iframe (optional).query (
bool
) – boolean Information about including query string when redirecting. (optional).
- Return type:
list
ofRedirect
- 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 = 'pointdns'¶
- 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
) – Zone domain name (e.g. example.com)type (
str
) – Zone type (All zones are master by design).ttl (
int
) – TTL for new records. (optional)extra (
dict
) – Extra attributes (group, user-id). (optional)
- Return type:
Zone
- exception libcloud.dns.drivers.pointdns.PointDNSException(value, http_code, driver=None)[source]¶
Bases:
ProviderError
- class libcloud.dns.drivers.pointdns.Redirect(id, name, data, type, driver, zone, iframe=None, query=False)[source]¶
Bases:
object
Point DNS redirect.
- Parameters:
id (
str
) – Redirect id.name (
str
) – The FQDN for the record.data (
str
) – The data field. (redirect_to)type (
str
) – The type of redirects 301, 302 or 0 for iframes.driver (
DNSDriver
) – DNSDriver instance.zone (
Zone
) – Zone where redirect belongs.iframe (
str
) – Title of iframe (optional).query (
bool
) – boolean Information about including query string when redirecting. (optional).
libcloud.dns.drivers.powerdns module¶
PowerDNS Driver
- class libcloud.dns.drivers.powerdns.PowerDNSDriver(key, secret=None, secure=False, host=None, port=None, api_version='experimental', **kwargs)[source]¶
Bases:
DNSDriver
PowerDNS Driver defaulting to using PowerDNS 3.x API (ie “experimental”).
- Parameters:
key (
str
) – API key or username to used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Off by default for PowerDNS.host (
str
) – Hostname used for connections.port (
int
) – Port used for connections.api_version (
str
) – Specifies the API version to use.experimental
andv1
are the only valid options. Defaults to usingexperimental
(optional)
- Returns:
None
- RECORD_TYPE_MAP: Dict[RecordType, str] = {'A': 'AFSDB', 'AAAA': 'AAAA', 'CERT': 'CERT', 'CNAME': 'CNAME', 'DNSKEY': 'DNSKEY', 'DS': 'DS', 'HINFO': 'HINFO', 'KEY': 'KEY', 'LOC': 'LOC', 'MX': 'MX', 'NAPTR': 'NAPTR', 'NS': 'NS', 'NSEC': 'NSEC', 'OPENPGPKEY': 'OPENPGPKEY', 'PTR': 'PTR', 'RP': 'RP', 'RRSIG': 'RRSIG', 'SOA': 'SOA', 'SPF': 'SPF', 'SRV': 'SRV', 'SSHFP': 'SSHFP', 'TLSA': 'TLSA', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
PowerDNSConnection
- create_record(name, zone, type, data, extra=None)[source]¶
Create a new record.
There are two PowerDNS-specific quirks here. Firstly, this method will silently clobber any pre-existing records that might already exist. For example, if PowerDNS already contains a “test.example.com” A record, and you create that record using this function, then the old A record will be replaced with your new one.
Secondly, PowerDNS requires that you provide a ttl for all new records. In other words, the “extra” parameter must be
{'ttl': <some-integer>}
at a minimum.- Parameters:
name (
str
) – FQDN of the new record, for example “www.example.com”.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, e.g. ‘ttl’). Note that PowerDNS requires a ttl value for every record.
- Return type:
Record
- create_zone(domain, type=None, ttl=None, extra={})[source]¶
Create a new zone.
There are two PowerDNS-specific quirks here. Firstly, the “type” and “ttl” parameters are ignored (no-ops). The “type” parameter is simply not implemented, and PowerDNS does not have an ability to set a zone-wide default TTL. (TTLs must be set per-record.)
Secondly, PowerDNS requires that you provide a list of nameservers for the zone upon creation. In other words, the “extra” parameter must be
{'nameservers': ['ns1.example.org']}
at a minimum.- Parameters:
name (
str
) – Zone domain name (e.g. example.com)domain (
Zone
) – Zone type (master / slave). (optional). Note that the PowerDNS driver does nothing with this parameter.ttl (
int
) – TTL for new records. (optional). Note that the PowerDNS driver does nothing with this parameter.extra (
dict
) – Extra attributes (driver specific). For example, specifyextra={'nameservers': ['ns1.example.org']}
to set a list of nameservers for this new zone.
- Return type:
Zone
- delete_record(record)[source]¶
Use this method to delete a record.
- Parameters:
record (Record) – record to delete
- Return type:
bool
- delete_zone(zone)[source]¶
Use this method to delete a zone.
- Parameters:
zone (Zone) – zone to delete
- Return type:
bool
- get_zone(zone_id)[source]¶
Return a Zone instance.
(Note that PowerDNS does not support per-zone TTL defaults, so all Zone objects will have
ttl=None
.)- Parameters:
zone_id (
str
) – name of the required zone with the trailing period, for example “example.com.”.- Return type:
Zone
- Raises:
ZoneDoesNotExistError: If no zone could be found.
- list_records(zone)[source]¶
Return a list of all records for the provided zone.
- Parameters:
zone (
Zone
) – Zone to list records for.- Returns:
list
ofRecord
- type = 'powerdns'¶
- update_record(record, name, type, data, extra=None)[source]¶
Update an existing record.
- Parameters:
record (
Record
) – Record to update.name (
str
) – FQDN of the new record, for example “www.example.com”.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
libcloud.dns.drivers.rackspace module¶
- class libcloud.dns.drivers.rackspace.RackspaceDNSConnection(*args, **kwargs)[source]¶
Bases:
OpenStack_1_1_Connection
,PollingConnection
Rackspace DNS Connection class.
Initialize user_id and key; set secure to an
int
based on passed value.- XML_NAMESPACE = None¶
- get_endpoint()[source]¶
Selects the endpoint to use based on provider specific values, or overrides passed in by the user when setting up the driver.
- Returns:
url of the relevant endpoint for the driver
- get_poll_request_kwargs(response, context, request_kwargs)[source]¶
Return keyword arguments which are passed to the request() method when polling for the job status.
- Parameters:
response (
dict
) – Response object returned by poll request.request_kwargs – Kwargs previously used to initiate the poll request.
:return
dict
Keyword arguments
- has_completed(response)[source]¶
Return job completion status.
- Parameters:
response (
HTTPResponse
) – Response object returned by poll request.
:return
bool
True if the job has completed, False otherwise.
- poll_interval = 2.5¶
- responseCls¶
alias of
RackspaceDNSResponse
- class libcloud.dns.drivers.rackspace.RackspaceDNSResponse(*args, **kwargs)[source]¶
Bases:
OpenStack_1_1_Response
Rackspace DNS Response class.
- Parameters:
response (
httplib.HTTPResponse
) – HTTP response object. (optional)connection (
Connection
) – Parent connection object.
libcloud.dns.drivers.rcodezero module¶
RcodeZero DNS Driver
- class libcloud.dns.drivers.rcodezero.RcodeZeroDNSDriver(key, secret=None, secure=True, host=None, port=None, api_version='v1', **kwargs)[source]¶
Bases:
DNSDriver
- Parameters:
key (
str
) – API token to be used (required)secret – Password to be used, ignored by RcodeZero
secure (
bool
) – Whether to use HTTPS (default) or HTTP.host (
str
) – Hostname used for connections.port (
int
) – Port used for connections.api_version (
str
) – Specifies the API version to use.v1
is currently the only valid option (and default)
- Returns:
None
- RECORD_TYPE_MAP: Dict[RecordType, str] = {'A': 'AFSDB', 'AAAA': 'AAAA', 'ALIAS': 'ALIAS', 'CERT': 'CERT', 'CNAME': 'CNAME', 'DNAME': 'DNAME', 'DNSKEY': 'DNSKEY', 'DS': 'DS', 'HINFO': 'HINFO', 'KEY': 'KEY', 'LOC': 'LOC', 'MX': 'MX', 'NAPTR': 'NAPTR', 'NS': 'NS', 'NSEC': 'NSEC', 'OPENPGPKEY': 'OPENPGPKEY', 'PTR': 'PTR', 'RP': 'RP', 'RRSIG': 'RRSIG', 'SOA': 'SOA', 'SPF': 'SPF', 'SRV': 'SRV', 'SSHFP': 'SSHFP', 'TLSA': 'TLSA', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
RcodeZeroConnection
- create_record(name, zone, type, data, extra=None)[source]¶
Create a new record in a given, existing zone.
- Parameters:
name (
str
) – name of the new record without the domain name, for example “www”.zone (
Zone
) – Zone in which the requested record is created.type (
RecordType
) – DNS resource record type (A, AAAA, …).data (
str
) – Data for the record (depending on the record type).extra (
dict
) – Extra attributes: ‘ttl’, ‘disabled’
- Return type:
Record
- create_zone(domain, type='master', ttl=None, extra={})[source]¶
Create a new zone.
- Parameters:
name (
str
) – Zone domain name (e.g. example.com)domain (
Zone
) – Zone type (‘master’ / ‘slave’). (required).ttl (
int
) – TTL for new records. (optional). Ignored by RcodeZero. RcodeZero uses record specific TTLs.extra (
dict
) – Extra attributes: ‘masters’ (for type=slave):extra={'masters': ['193.0.2.2','2001:db8::2']}
sets the Master nameservers for a type=slave zone.
- Return type:
Zone
- delete_record(record)[source]¶
Delete a record in a given zone.
- Parameters:
record (Record) – record to delete (record object)
- Return type:
bool
- delete_zone(zone)[source]¶
Delete a zone and all its records.
- 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]¶
Get a Zone object.
- Parameters:
zone_id (
str
) – name of the zone, for example “example.com”.- Return type:
Zone
- Raises:
ZoneDoesNotExistError: if zone could not be found.
- list_records(zone)[source]¶
Return a list of all record objects for the given zone.
- Parameters:
zone (
Zone
) – Zone object to list records for.- Returns:
list
ofRecord
- type = 'rcodezero'¶
- update_record(record, name, type, data, extra=None)[source]¶
Update an existing record.
- Parameters:
record (
Record
) – Record object to update.name (
str
) – name of the new record, for example “www”.type (
RecordType
) – DNS resource record type (A, AAAA, …).data (
str
) – Data for the record (depending on the record type).extra (
dict
) – Extra attributes: ‘ttl’,’disabled’ (optional)
- Return type:
Record
- update_zone(zone, domain, type=None, ttl=None, extra=None)[source]¶
Update an existing zone.
- Parameters:
zone (
Zone
) – Zone to update.domain (
str
) – Zone domain name (e.g. example.com)type (
str
) – Zone type (‘master’ / ‘slave’).ttl (
int
) – not supported. RcodeZero uses RRSet-specific TTLsextra (
dict
) – Extra attributes: ‘masters’ (for type=slave)extra={'masters': ['193.0.2.2','2001:db8::2']}
sets the Master nameserver addresses for a type=slave zone
- Return type:
Zone
libcloud.dns.drivers.route53 module¶
- class libcloud.dns.drivers.route53.Route53DNSDriver(*args, **kwargs)[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', 'MX': 'MX', 'NS': 'NS', 'PTR': 'PTR', 'SOA': 'SOA', 'SPF': 'SPF', 'SRV': 'SRV', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
Route53Connection
- 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, ex_delete_records=False)[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_multi_value_record(name, zone, type, data, extra=None)[source]¶
Create a record with multiple values with a single call.
- Returns:
A list of created records.
- Return type:
list
oflibcloud.dns.base.Record
- ex_delete_all_records(zone)[source]¶
Remove all the records for the provided zone.
- Parameters:
zone (
Zone
) – Zone to delete records for.
- 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
- type = 'route53'¶
- update_record(record, name=None, type=None, data=None, 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
libcloud.dns.drivers.vultr module¶
Vultr DNS Driver
- class libcloud.dns.drivers.vultr.VultrDNSConnection(key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, backoff=None, retry_delay=None)[source]¶
Bases:
VultrConnection
Initialize user_id and key; set secure to an
int
based on passed value.- responseCls¶
alias of
VultrDNSResponse
- class libcloud.dns.drivers.vultr.VultrDNSDriver(key, secret=None, secure=True, host=None, port=None, api_version='2', region=None, **kwargs)[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
- type = 'vultr'¶
- class libcloud.dns.drivers.vultr.VultrDNSResponse(response, connection)[source]¶
Bases:
VultrResponse
- Parameters:
response (
httplib.HTTPResponse
) – HTTP response object. (optional)connection (
Connection
) – Parent connection object.
libcloud.dns.drivers.worldwidedns module¶
World Wide DNS Driver
- class libcloud.dns.drivers.worldwidedns.WorldWideDNSDriver(key, secret=None, reseller_id=None, secure=True, host=None, port=None, **kwargs)[source]¶
Bases:
DNSDriver
- Parameters:
key (
str
) – API key or username to used (required)secret (
str
) – Secret password to be used (required)reseller_id (
str
) – Reseller ID for reseller accountssecure (
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', 'CNAME': 'CNAME', 'MX': 'MX', 'NS': 'NS', 'SRV': 'SRV', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
WorldWideDNSConnection
- create_record(name, zone, type, data, extra=None)[source]¶
Create a new record.
We can create 40 record per domain. If all slots are full, we can replace one of them by choosing a specific entry in
extra
argument.- 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 (MX, CNAME, A, NS, SRV, TXT).data (
str
) – Data for the record (depends on the record type).extra (
dict
) – Contains ‘entry’ Entry position (1 thru 40)
- 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). Possible parameter in here should be DYN which values should be 1 for standart and 2 for dynamic. Default is 1.
- Return type:
Zone
For more info, please see https://www.worldwidedns.net/dns_api_protocol_new_domain.asp or https://www.worldwidedns.net/dns_api_protocol_new_domain_reseller.asp
- 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
For more information, please see https://www.worldwidedns.net/dns_api_protocol_delete_domain.asp or https://www.worldwidedns.net/dns_api_protocol_delete_domain_reseller.asp
- ex_transfer_domain(domain, user_id)[source]¶
This command will allow you, if you are a reseller, to change the userid on a domain name to another userid in your account ONLY if that new userid is already created.
- Parameters:
domain (
str
) – Domain name.user_id (
str
) – The new userid to connect to the domain name.
- Return type:
bool
For more info, please see: https://www.worldwidedns.net/dns_api_protocol_transfer.asp
- ex_view_zone(domain, name_server)[source]¶
View zone file from a name server
- Parameters:
domain (
str
) – Domain name.name_server (
int
) – Name server to check. (1, 2 or 3)
- Return type:
str
For more info, please see: https://www.worldwidedns.net/dns_api_protocol_viewzone.asp or https://www.worldwidedns.net/dns_api_protocol_viewzone_reseller.asp
- get_record(zone_id, record_id)[source]¶
Return a Record instance.
- Parameters:
zone_id (
str
) – ID of the required zonerecord_id (
str
) – ID number 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
- list_zones()[source]¶
Return a list of zones.
- Returns:
list
ofZone
For more info, please see: https://www.worldwidedns.net/dns_api_protocol_list.asp or https://www.worldwidedns.net/dns_api_protocol_list_reseller.asp
- type = 'worldwidedns'¶
- 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 (MX, CNAME, A, NS, SRV, TXT).data (
str
) – Data for the record (depends on the record type).extra (
dict
) – Contains ‘entry’ Entry position (1 thru 40)
- Return type:
Record
- update_zone(zone, domain, type='master', ttl=None, extra=None, ex_raw=False)[source]¶
Update an existing zone.
- Parameters:
zone (
Zone
) – Zone to update.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). Values not specified such as SECURE, IP, FOLDER, HOSTMASTER, REFRESH, RETRY and EXPIRE will be kept as already is. The same will be for S(1 to 40), T(1 to 40) and D(1 to 40) if not in raw mode and for ZONENS and ZONEDATA if it is.ex_raw (
bool
) – Mode we use to do the update using zone file or not.
- Return type:
Zone
For more info, please see https://www.worldwidedns.net/dns_api_protocol_list_domain.asp or https://www.worldwidedns.net/dns_api_protocol_list_domain_raw.asp or https://www.worldwidedns.net/dns_api_protocol_list_domain_reseller.asp or https://www.worldwidedns.net/dns_api_protocol_list_domain_raw_reseller.asp
libcloud.dns.drivers.zerigo module¶
- class libcloud.dns.drivers.zerigo.ZerigoDNSDriver(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', 'GEO': 'GEO', 'MX': 'MX', 'NAPTR': 'NAPTR', 'NS': 'NS', 'PTR': 'PTR', 'REDIRECT': 'REDIRECT', 'SPF': 'SPF', 'SRV': 'SRV', 'TXT': 'TXT', 'URL': 'URL'}¶
- connectionCls¶
alias of
ZerigoDNSConnection
- create_record(name, zone, type, data, extra=None)[source]¶
Create a new record.
Provider API docs: https://www.zerigo.com/docs/apis/dns/1.1/hosts/create
@inherits:
DNSDriver.create_record
- create_zone(domain, type='master', ttl=None, extra=None)[source]¶
Create a new zone.
Provider API docs: https://www.zerigo.com/docs/apis/dns/1.1/zones/create
@inherits:
DNSDriver.create_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_force_slave_axfr(zone)[source]¶
Force a zone transfer.
- Parameters:
zone (
Zone
) – Zone which should be used.- Return type:
Zone
- ex_get_zone_by_domain(domain)[source]¶
Retrieve a zone object by the domain name.
- Parameters:
domain (
str
) – The domain which should be used- Return type:
Zone
- 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
- type = 'zerigo'¶
- update_record(record, name=None, type=None, data=None, 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=None, type=None, ttl=None, extra=None)[source]¶
Update an existing zone.
Provider API docs: https://www.zerigo.com/docs/apis/dns/1.1/zones/update
@inherits:
DNSDriver.update_zone
libcloud.dns.drivers.zonomi module¶
Zonomi DNS Driver
- class libcloud.dns.drivers.zonomi.ZonomiDNSDriver(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', 'MX': 'MX', 'TXT': 'TXT'}¶
- connectionCls¶
alias of
ZonomiDNSConnection
- 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, MX, TXT).data (
str
) – Data for the record (depends on the record type).extra (
dict
) – Extra attributes (driver specific, e.g. ‘prio’ or ‘ttl’). (optional)
- Return type:
Record
- create_zone(domain, type='master', ttl=None, extra=None)[source]¶
Create a new zone.
- Parameters:
zone_id (
str
) – Zone domain name (e.g. example.com)- Return type:
Zone
- delete_record(record)[source]¶
Use this method to 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_convert_to_master(zone)[source]¶
Convert existent zone to master.
- Parameters:
zone (
Zone
) – Zone to convert.- Return type:
Bool
- ex_convert_to_secondary(zone, master)[source]¶
Convert existent zone to slave.
- Parameters:
zone (
Zone
) – Zone to convert.master (
str
) – the specified master name server IP address.
- 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 = 'zonomi'¶