octodns.zone

exception octodns.zone.SubzoneRecordException(msg, record)[source]

Bases: Exception

__init__(msg, record)[source]
exception octodns.zone.DuplicateRecordException(msg, existing, new)[source]

Bases: Exception

__init__(msg, existing, new)[source]
exception octodns.zone.InvalidNodeException(msg, record)[source]

Bases: Exception

__init__(msg, record)[source]
exception octodns.zone.InvalidNameError[source]

Bases: Exception

class octodns.zone.Zone(name, sub_zones, update_pcent_threshold=None, delete_pcent_threshold=None)[source]

Bases: object

log = <Logger Zone (WARNING)>
__init__(name, sub_zones, update_pcent_threshold=None, delete_pcent_threshold=None)[source]
property records
property root_ns
hostname_from_fqdn(fqdn)[source]
owns(_type, fqdn)[source]
add_record(record, replace=False, lenient=False)[source]
remove_record(record)[source]
_remove_record(record)[source]
changes(desired, target)[source]
apply(changes)[source]

Apply the provided changes to the zone.

hydrate()[source]

Take a shallow copy Zone and make it a deeper copy holding its own reference to records. These records will still be the originals and they should not be modified. Changes should be made by calling add_record, often with replace=True, and/or remove_record.

Note: This method does not need to be called under normal circumstances as add_record and remove_record will automatically call it when appropriate.

copy()[source]

Copy-on-write semantics support. This method will create a shallow clone of the zone which will be hydrated the first time add_record or remove_record is called.

This allows low-cost copies of things to be made in situations where changes are unlikely and only incurs the “expense” of actually copying the records when required. The actual record copy will not be “deep” meaning that records should not be modified directly.

__repr__()[source]

Return repr(self).