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'