noc.dns.models.dnszone

Module Contents

noc.dns.models.dnszone.logger
noc.dns.models.dnszone.id_lock
noc.dns.models.dnszone.ZONE_FORWARD = F
noc.dns.models.dnszone.ZONE_REVERSE_IPV4 = 4
noc.dns.models.dnszone.ZONE_REVERSE_IPV6 = 6
class noc.dns.models.dnszone.DNSZone

Bases: noc.core.model.base.NOCModel

DNS Zone

class Meta

Bases: object

verbose_name
verbose_name_plural
ordering = ['name']
db_table = dns_dnszone
app_label = dns
name
type
description
project
is_auto_generated
serial
profile
notification_group
paid_till
tags
objects
zone
_id_cache
_name_cache
rx_rzone
reverse_prefix

Appropriative prefix for reverse zone

Returns:IPv4 or IPv6 prefix
Return type:String
children

List of next-level nested zones

ns_list

Sorted list of zone NSes. NSes are properly formatted and have ‘.’ at the end.

Returns:List of zone NSes
Return type:List of string
masters

Sorted list of zone master NSes. NSes are properly formatted and have ‘.’ at the end.

Returns:List of zone master NSes
Return type:List of string
Returns:
slaves

Sorted list of zone slave NSes. NSes are properly formatted and have ‘.’ at the end.

Returns:List of zone slave NSes
Return type:List of string
Returns:
rpsl

RPSL for reverse zone. RPSL contains domain: and nserver: attributes

Returns:RPSL
Return type:String
is_forward
is_reverse_ipv4
is_reverse_ipv6
__str__(self)
classmethod get_by_id(cls, id)
classmethod get_by_name(cls, name)
iter_changed_datastream(self, changed_fields=None)
clean(self)
save(self, *args, **kwargs)
static get_type_for_zone(name)

Zone type. One of:

  • R4 - IPv4 reverse
  • R6 - IPv6 reverse
  • F - forward zone
Returns:Zone type
Return type:String
classmethod get_reverse_for_address(cls, address)

Return reverse zone holding address :param address: Address (as a string) :return: DNSZone instance or None

classmethod _get_reverse_for_ipv4_address(cls, address)

Get reverze zone holding IPv4 address :param address: Address (as a string) :return: DNSZone instance or None

classmethod _get_reverse_for_ipv6_address(cls, address)

Get reverze zone holding IPv6 address :param address: Address (as a string) :return: DNSZone instance or None

get_next_serial(self)

Next zone serial number. Next serial is greater than current one. Serial is built using current data to follow common practive.

Returns:Zone serial number
Return type:int
set_next_serial(self)
classmethod get_ns_name(cls, ns)

Add missed ‘.’ to the end of NS name, if given as FQDN

static to_idna(n)
classmethod get_zone(cls, name)

Resolve name to zone object :return:

get_notification_groups(self)

Get a list of notification groups to notify about zone changes :return: