Backend

Backend

Backend Base

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

Bases: DriverPlugin

Base class for backend implementations

abstract create_zone(context, zone)[source]

Create a DNS zone.

Parameters:
  • context – Security context information.

  • zone – the DNS zone.

abstract delete_zone(context, zone)[source]

Delete a DNS zone.

Parameters:
  • context – Security context information.

  • zone – the DNS zone.

update_zone(context, zone)[source]

Update a DNS zone.

Parameters:
  • context – Security context information.

  • zone – the DNS zone.

Backend Bind9

Bind 9 backend. Create and delete zones by executing rndc

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

Bases: 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.

get_zone(context, zone)[source]

Returns True if zone exists and False if not

update_zone(context, zone)[source]

Update a DNS zone.

This will execute a rndc modzone if the zone already exists but masters might need to be refreshed. Or, will create the zone if it does not exist.

Parameters:
  • context – Security context information.

  • zone – the DNS zone.

Backend Designate

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

Bases: Backend

Support for Designate to Designate using Secondary zones.

property client
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.

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: 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: 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: BadRequest, DynClientError

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

Bases: Backend

Support for DynECT as a secondary DNS.

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.

get_client()[source]
exception designate.backend.impl_dynect.DynTimeoutError[source]

Bases: Backend

A job timedout.

error_code = 408
error_type = 'dyn_timeout'

Backend Infoblox

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

Bases: Backend

Provides a Designate Backend for Infoblox

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.

Backend Nsd4

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

Bases: Backend

NSDCT_VERSION = 'NSDCT1'
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.

Backend Fake

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

Bases: Backend

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.

Backend PowerDNS 4

class designate.backend.impl_pdns4.PDNS4Backend(target)[source]

Bases: Backend

create_zone(context, zone)[source]

Create a DNS zone

delete_zone(context, zone)[source]

Delete a DNS zone

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]

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

Bases: AgentBackend

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

Configure the backend

__module__ = 'designate.backend.agent_backend.impl_knot2'
__plugin_name__ = 'knot2'
_abc_impl = <_abc._abc_data 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

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

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: AgentBackend

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

Configure the backend

__module__ = 'designate.backend.agent_backend.impl_gdnsd'
__plugin_name__ = 'gdnsd'
_abc_impl = <_abc._abc_data 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(**kw)[source]

Create a DNS zone

delete_zone(**kw)[source]

Delete a DNS zone

find_zone_serial(zone_name)[source]

Query the local resolver for a zone Times out after SOA_QUERY_TIMEOUT

start()[source]

Start the backend, check gdnsd configuration

Raises:

exception.Backend on invalid configuration

update_zone(**kw)[source]

Update a DNS zone

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: AgentBackend

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

Configure the backend

__module__ = 'designate.backend.agent_backend.impl_djbdns'
__plugin_name__ = 'djbdns'
_abc_impl = <_abc._abc_data 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(**kw)[source]

Create a DNS zone

delete_zone(**kw)[source]

Delete a DNS zone

find_zone_serial(zone_name)[source]

Query the local resolver for a zone Times out after SOA_QUERY_TIMEOUT

start()[source]

Start the backend

update_zone(**kw)[source]

Update a DNS zone

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

Agent Backend MSDNS

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

Bases: AgentBackend

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

Configure the backend

__module__ = 'designate.backend.agent_backend.impl_msdns'
__plugin_name__ = 'msdns'
_abc_impl = <_abc._abc_data 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

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.

Page Contents