MDNS

MDNS Base

class designate.mdns.base.BaseEndpoint(tg)[source]

Bases: object

RPC_API_NAMESPACE = None
RPC_API_VERSION = None
property central_api

MDNS Handler

class designate.mdns.handler.RequestHandler(storage, tg)[source]

Bases: designate.mdns.xfr.XFRMixin

property central_api

MDNS Notify

class designate.mdns.notify.NotifyEndpoint(tg)[source]

Bases: designate.mdns.base.BaseEndpoint

RPC_API_NAMESPACE = 'notify'
RPC_API_VERSION = '2.0'
get_serial_number(context, zone, host, port, timeout, retry_interval, max_retries, delay)[source]

Get zone serial number from a resolver using retries.

Parameters
  • context – The user context.

  • zone – The designate zone object. This contains the zone name. zone.serial = expected_serial

  • host – A notify is sent to this host.

  • port – A notify is sent to this port.

  • timeout – The time (in seconds) to wait for a SOA response from nameserver.

  • retry_interval – The time (in seconds) between retries.

  • max_retries – The maximum number of retries mindns would do for an expected serial number. After this many retries, mindns returns an ERROR.

  • delay – The time to wait before sending the first request.

Returns

a tuple of (status, actual_serial, retries) status is either “SUCCESS” or “ERROR”. actual_serial is either the serial number returned in the SOA message from the nameserver or None. retries is the number of retries left. The return value is just used for testing and not by pool manager. The pool manager is informed of the status with update_status.

notify_zone_changed(context, zone, host, port, timeout, retry_interval, max_retries, delay)[source]
Parameters
  • context – The user context.

  • zone – The designate zone object. This contains the zone name.

  • host – A notify is sent to this host.

  • port – A notify is sent to this port.

  • timeout – The time (in seconds) to wait for a NOTIFY response from server.

  • retry_interval – The time (in seconds) between retries.

  • max_retries – The maximum number of retries mindns would do for sending a NOTIFY message. After this many retries, mindns gives up.

  • delay – The time to wait before sending the first NOTIFY request.

Returns

a tuple of (response, current_retry) where response is the response on success or None on failure. current_retry is the current retry number. The return value is just used for testing and not by pool manager.

poll_for_serial_number(context, zone, nameserver, timeout, retry_interval, max_retries, delay)[source]

MDNS RPC API

class designate.mdns.rpcapi.MdnsAPI(topic=None)[source]

Bases: object

Client side of the mdns RPC API.

Notify API version history:

1.0 - Added notify_zone_changed and poll_for_serial_number. 1.1 - Added get_serial_number. 2.0 - Changed method signatures

XFR API version history:

1.0 - Added perform_zone_xfr.

RPC_NOTIFY_API_VERSION = '2.0'
RPC_XFR_API_VERSION = '1.0'
classmethod get_instance()[source]

The rpc.get_client() which is called upon the API object initialization will cause a assertion error if the designate.rpc.TRANSPORT isn’t setup by rpc.init() before.

This fixes that by creating the rpcapi when demanded.

get_serial_number(context, zone, host, port, timeout, retry_interval, max_retries, delay)[source]
notify_zone_changed(context, zone, host, port, timeout, retry_interval, max_retries, delay)[source]
perform_zone_xfr(context, zone)[source]
poll_for_serial_number(context, zone, nameserver, timeout, retry_interval, max_retries, delay)[source]
designate.mdns.rpcapi.reset()[source]

MDNS Service

class designate.mdns.service.Service[source]

Bases: designate.service.RPCService

property dns_application
property service_name
start()[source]

Start a service.

stop(graceful=False)[source]

Stop a service.

Parameters

graceful – indicates whether to wait for all threads to finish or terminate them instantly

property storage

MDNS XFR

class designate.mdns.xfr.XFRMixin[source]

Bases: object

Utility mixin that holds common methods for XFR functionality.

zone_sync(context, zone, servers=None)[source]
class designate.mdns.xfr.XfrEndpoint(tg)[source]

Bases: designate.mdns.base.BaseEndpoint, designate.mdns.xfr.XFRMixin

RPC_API_NAMESPACE = 'xfr'
RPC_API_VERSION = '1.0'
perform_zone_xfr(context, zone)[source]