Backend

Backend

Backend Base

class designate.backend.base.Backend(target)[source]

Bases: designate.plugin.DriverPlugin

Base class for backend implementations

create_zone(context, zone)[source]

Create a DNS zone.

Parameters:
  • context – Security context information.
  • zone – the DNS zone.
delete_zone(context, zone)[source]

Delete a DNS zone.

Parameters:
  • context – Security context information.
  • zone – the DNS zone.
mdns_api
ping(context)[source]

Ping the Backend service

start()[source]
stop()[source]
update_zone(context, zone)[source]

Update a DNS zone.

Parameters:
  • context – Security context information.
  • zone – the DNS zone.

Backend Akamai

class designate.backend.impl_akamai.AkamaiBackend(target)[source]

Bases: designate.backend.base.Backend

create_zone(context, zone)[source]

Create a DNS zone

delete_zone(context, zone)[source]

Delete a DNS zone

classmethod get_cfg_opts()[source]
exception designate.backend.impl_akamai.DelegationExists(*args, **kwargs)[source]

Bases: designate.exceptions.BadRequest, designate.backend.impl_akamai.EnhancedDNSException

Raised when an attempt to delete a zone which is still delegated to Akamai is made

error_type = 'delegation_exists'
exception designate.backend.impl_akamai.DuplicateZone(*args, **kwargs)[source]

Bases: designate.exceptions.DuplicateZone, designate.backend.impl_akamai.EnhancedDNSException

Raised when an attempt to create a zone which is registered to another Akamai account is made

class designate.backend.impl_akamai.EnhancedDNSClient(username, password)[source]

Bases: object

EnhancedDNS SOAP API Client

buildZone(zoneName, masters, endCustomerId, tsigKeyName=None, tsigKey=None, tsigAlgorithm=None)[source]
deleteZone(zoneName)[source]
deleteZones(zoneNames)[source]
getZone(zoneName)[source]
setZone(zone)[source]
setZones(zones)[source]
exception designate.backend.impl_akamai.EnhancedDNSException[source]

Bases: designate.exceptions.Backend

class designate.backend.impl_akamai.EnhancedDNSHttpAuthenticated(**kwargs)[source]

Bases: suds.transport.https.HttpAuthenticated

addenhanceddnsheaders(request)[source]
logenhanceddnsheaders(response)[source]
send(request)[source]
exception designate.backend.impl_akamai.Forbidden(*args, **kwargs)[source]

Bases: designate.exceptions.Forbidden, designate.backend.impl_akamai.EnhancedDNSException

Raised when an attempt to modify a zone which is registered to another Akamai account is made.

This appears to be returned when creating a new subzone of zone which already exists in another Akamai account.

designate.backend.impl_akamai.build_zone(client, target, zone)[source]

Backend Bind9

Bind 9 backend. Create and delete zones by executing rndc

class designate.backend.impl_bind9.Bind9Backend(target)[source]

Bases: designate.backend.base.Backend

create_zone(context, zone)[source]

Create a new Zone by executin rndc, then notify mDNS Do not raise exceptions if the zone already exists.

delete_zone(context, zone)[source]

Delete a new Zone by executin rndc Do not raise exceptions if the zone does not exist.

Backend Designate

class designate.backend.impl_designate.DesignateBackend(target)[source]

Bases: designate.backend.base.Backend

Support for Designate to Designate using Secondary zones.

client
create_zone(context, zone)[source]
delete_zone(context, zone)[source]

Backend Dynect

class designate.backend.impl_dynect.DynClient(customer_name, user_name, password, endpoint='https://api.dynect.net:443', api_version='3.5.6', headers=None, verify=True, retries=1, timeout=10, timings=False, pool_maxsize=10, pool_connections=10)[source]

Bases: object

DynECT service client.

https://help.dynect.net/rest/

delete(*args, **kwargs)[source]
get(*args, **kwargs)[source]
get_timings()[source]
login()[source]
logout()[source]
patch(*args, **kwargs)[source]
poll_response(response)[source]

The API might return a job nr in the response in case of a async response: https://github.com/fog/fog/issues/575

post(*args, **kwargs)[source]
put(*args, **kwargs)[source]
request(method, url, retries=2, **kwargs)[source]
reset_timings()[source]
exception designate.backend.impl_dynect.DynClientAuthError(data=None, job_id=None, msgs=None, http_status=None, url=None, method=None, details=None)[source]

Bases: designate.backend.impl_dynect.DynClientError

exception designate.backend.impl_dynect.DynClientError(data=None, job_id=None, msgs=None, http_status=None, url=None, method=None, details=None)[source]

Bases: designate.exceptions.Backend

The base exception class for all HTTP exceptions.

static from_response(response, details=None)[source]
exception designate.backend.impl_dynect.DynClientOperationBlocked(*args, **kwargs)[source]

Bases: designate.exceptions.BadRequest, designate.backend.impl_dynect.DynClientError

error_type = 'operation_blocked'
class designate.backend.impl_dynect.DynECTBackend(target)[source]

Bases: designate.backend.base.Backend

Support for DynECT as a secondary DNS.

create_zone(context, zone)[source]
delete_zone(context, zone)[source]
classmethod get_cfg_opts()[source]
get_client()[source]
exception designate.backend.impl_dynect.DynTimeoutError[source]

Bases: designate.exceptions.Backend

A job timedout.

error_code = 408
error_type = 'dyn_timeout'

Backend Infoblox

class designate.backend.impl_infoblox.InfobloxBackend(*args, **kwargs)[source]

Bases: designate.backend.base.Backend

Provides a Designate Backend for Infoblox

create_zone(context, zone)[source]
delete_zone(context, zone)[source]
ping(context)[source]

Backend Nsd4

class designate.backend.impl_nsd4.NSD4Backend(target)[source]

Bases: designate.backend.base.Backend

NSDCT_VERSION = 'NSDCT1'
create_zone(context, zone)[source]
delete_zone(context, zone)[source]

Backend Fake

class designate.backend.impl_fake.FakeBackend(target)[source]

Bases: designate.backend.base.Backend

create_zone(context, zone)[source]
delete_zone(context, zone)[source]

Backend Powerdns

class designate.backend.impl_powerdns.PowerDNSBackend(target)[source]

Bases: designate.backend.base.Backend

create_zone(context, zone)[source]
delete_zone(context, zone)[source]
classmethod get_cfg_opts()[source]
get_session()[source]

Agent Backend KnotDNS

backend.agent_backend.impl_knot2

Knot DNS agent backend

Create, update, delete zones locally on a Knot DNS resolver using the knotc utility.

Supported Knot versions: >= 2.1, < 3

Knot DNS 2 User documentation

Warning

Untested, do not use in production.

Note

If the backend is killed during a configuration transaction it might be required to manually abort the transaction with sudo knotc conf-abort

Configured in [service:agent:knot2]

designate.backend.agent_backend.impl_knot2.KNOTC_DEFAULT_PATH = 'knotc'

GROUP = backend:agent:knot2

class designate.backend.agent_backend.impl_knot2.Knot2Backend(*a, **kw)[source]

Bases: designate.backend.agent_backend.base.AgentBackend

__abstractmethods__ = frozenset([])
__backend_status__ = 'untested'
__init__(*a, **kw)[source]

Configure the backend

__module__ = 'designate.backend.agent_backend.impl_knot2'
__plugin_name__ = 'knot2'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 75
_abc_registry = <_weakrefset.WeakSet object>
_execute_knotc(*knotc_args, **kw)[source]

Run the Knot client and check the output

Parameters:
  • expected_output (str) – expected output (default: ‘OK’)
  • expected_error (str) – expected alternative output, will be logged as info(). Default: not set.
_lock_name = 'knot2.lock'
_modify_zone(*knotc_args, **kw)[source]

Create or delete a zone while locking, and within a Knot transaction. Knot supports only one config transaction at a time.

Raises:exceptions.Backend
_start_minidns_to_knot_axfr(zone_name)[source]

Instruct Knot to request an AXFR from MiniDNS. No need to lock or enter a configuration transaction.

create_zone(zone)[source]

Create a new Zone by executing knotc Do not raise exceptions if the zone already exists.

Parameters:zone (raw pythondns Zone) – zone to be created
delete_zone(zone_name)[source]

Delete a new Zone by executing knotc Do not raise exceptions if the zone does not exist.

Parameters:zone_name (str) – zone name
find_zone_serial(zone_name)[source]

Get serial from a zone by running knotc

Returns:serial (int or None)
Raises:exceptions.Backend
classmethod get_cfg_opts()[source]
start()[source]

Start the backend

update_zone(zone)[source]

Instruct Knot DNS to perform AXFR from MiniDNS

Parameters:zone (raw pythondns Zone) – zone to be created
designate.backend.agent_backend.impl_knot2.knot2_opts = [<oslo_config.cfg.StrOpt object>, <oslo_config.cfg.StrOpt object>]

GROUP = backend:agent:msdns

Agent Backend gdnsd

backend.agent_backend.impl_gdnsd

gdnsd agent backend

Create, update, delete zones locally on a gdnsd resolver using the gdnsd utility.

Supported Knot versions: >= 2.1, < 3

User documentation

Warning

Untested, do not use in production.

Note

If the backend is killed during a configuration transaction it might be required to manually abort the transaction with sudo gdnsd conf-abort

Configured in [service:agent:gdnsd]

class designate.backend.agent_backend.impl_gdnsd.GdnsdBackend(*a, **kw)[source]

Bases: designate.backend.agent_backend.base.AgentBackend

__abstractmethods__ = frozenset([])
__backend_status__ = 'experimental'
__init__(*a, **kw)[source]

Configure the backend

__module__ = 'designate.backend.agent_backend.impl_gdnsd'
__plugin_name__ = 'gdnsd'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 75
_abc_registry = <_weakrefset.WeakSet object>
_check_conf()[source]

Run gdnsd to check its configuration

_check_dirs(*dirnames)[source]

Check if directories are writable

_generate_zone_filename(zone_name)[source]

Generate a filename for a zone file “/” is traslated into “@” Non-valid characters are translated into NNN where NNN is a decimal integer in the range 0 - 255 The filename is lowercase

Returns:valid filename (string)
_write_zone_file(zone)[source]

Create or update a zone file atomically. The zone file is written to a unique temp file and then renamed

create_zone(*a, **kw)[source]
delete_zone(*a, **kw)[source]
find_zone_serial(zone_name)[source]

Query the local resolver for a zone Times out after SOA_QUERY_TIMEOUT

classmethod get_cfg_opts()[source]
start()[source]

Start the backend, check gdnsd configuration

Raises:exception.Backend on invalid configuration
update_zone(*a, **kw)[source]
designate.backend.agent_backend.impl_gdnsd.ZONE_FILE_PERMISSIONS = 420

GROUP = backend:agent:gdnsd

designate.backend.agent_backend.impl_gdnsd.filter_exceptions(fn)[source]

Agent Backend Djbdns

backend.agent_backend.impl_djbdns

Djbdns DNS agent backend

Create, update, delete zones locally on a Djbdns DNS resolver using the axfr-get utility.

Djbdns User documentation

Warning

Untested, do not use in production.

Configured in [service:agent:djbdns]

Requires rootwrap (or equivalent sudo privileges) to execute:
  • tcpclient
  • axfr-get
  • tinydns-data
class designate.backend.agent_backend.impl_djbdns.DjbdnsBackend(*a, **kw)[source]

Bases: designate.backend.agent_backend.base.AgentBackend

__abstractmethods__ = frozenset([])
__backend_status__ = 'experimental'
__init__(*a, **kw)[source]

Configure the backend

__module__ = 'designate.backend.agent_backend.impl_djbdns'
__plugin_name__ = 'djbdns'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 75
_abc_registry = <_weakrefset.WeakSet object>
static _check_dirs(*dirnames)[source]

Check if directories are writable

static _concatenate_zone_datafiles(data_fn, path_glob)[source]

Concatenate all zone datafiles into ‘data’

_perform_axfr_from_minidns(zone_name)[source]

Instruct axfr-get to request an AXFR from MiniDNS.

Raises:exceptions.Backend on error
_rebuild_data_cdb()[source]

Rebuild data.cdb file from zone datafiles Requires global lock

On zone creation, axfr-get creates datafiles atomically by doing rename. On zone deletion, os.remove deletes the file atomically Globbing and reading the datafiles can be done without locking on them. The data and data.cdb files are written into a unique temp directory

create_zone(*a, **kw)[source]
delete_zone(*a, **kw)[source]
find_zone_serial(zone_name)[source]

Query the local resolver for a zone Times out after SOA_QUERY_TIMEOUT

classmethod get_cfg_opts()[source]
start()[source]

Start the backend

update_zone(*a, **kw)[source]
designate.backend.agent_backend.impl_djbdns.SOA_QUERY_TIMEOUT = 1

GROUP = backend:agent:djbdns

designate.backend.agent_backend.impl_djbdns.filter_exceptions(fn)[source]

Agent Backend MSDNS

designate.backend.agent_backend.impl_msdns.CFG_GROUP = 'backend:agent:msdns'

GROUP = backend:agent:msdns

class designate.backend.agent_backend.impl_msdns.MSDNSBackend(agent_service)[source]

Bases: designate.backend.agent_backend.base.AgentBackend

__abstractmethods__ = frozenset([])
__backend_status__ = 'experimental'
__init__(agent_service)[source]

Configure the backend

__module__ = 'designate.backend.agent_backend.impl_msdns'
__plugin_name__ = 'msdns'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 75
_abc_registry = <_weakrefset.WeakSet object>
create_zone(zone)[source]

Create a new DNS Zone

delete_zone(zone_name)[source]

Delete a DNS Zone Do not raise exception if the zone does not exist.

find_zone_serial(zone_name)[source]

Return the zone’s serial

classmethod get_cfg_opts()[source]
start()[source]

Start the backend

update_zone(zone)[source]

Instruct MSDNS to request an AXFR from MiniDNS.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.