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 zone

  • record_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 of Record

list_zones()[source]

Return a list of zones.

Returns:

list of Zone

name: str = 'OnApp'
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

website: str = 'http://onapp.com/'