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