octodns.processor.ownership
Classes
|
- class octodns.processor.ownership.OwnershipProcessor(name, txt_name='_owner', txt_value='*octodns*', txt_ttl=60, should_replace=False, **kwargs)[source]
Bases:
BaseProcessor- __init__(name, txt_name='_owner', txt_value='*octodns*', txt_ttl=60, should_replace=False, **kwargs)[source]
Initialize the processor.
- Parameters:
Note
The
nameparameter is deprecated and will be removed in version 2.0. Useidinstead.
- process_source_zone(desired, sources, lenient=False)[source]
Process the desired zone after all sources have populated.
Called after all sources have completed populate. Provides an opportunity for the processor to modify the desired zone that targets will receive.
- Parameters:
desired (octodns.zone.Zone) – The desired zone state after all sources have populated. This zone will be used as the target state for planning.
sources (list[octodns.provider.base.BaseProvider]) – List of source providers that populated the zone. May be empty for aliased zones.
lenient (bool) – When True, relaxed validation rules should be applied when modifying zone records.
- Returns:
The modified desired zone, typically the same object passed in.
- Return type:
octodns.zone.Zone
Important
Will see
desiredafter any modifications done byProvider._process_desired_zoneand processors configured to run before this one.May modify
desireddirectly.Must return
desiredwhich will normally be thedesiredparam.Must not modify records directly;
record.copyshould be called, the results of which can be modified, and thenZone.add_recordmay be used withreplace=True.May call
Zone.remove_recordto remove records fromdesired.Sources may be empty, as will be the case for aliased zones.
Implementations should combine
self.lenient or lenientand pass the result to any record and zone calls that acceptlenientas a parameter, e.g.zone.add_record(..., lenient=lenient).
- process_plan(plan, sources, target, lenient=False)[source]
Process the plan after it has been computed.
Called after the planning phase has completed. Provides an opportunity for the processor to modify the plan, thus changing the actions that will be displayed and potentially applied.
- Parameters:
plan (octodns.provider.plan.Plan or None) – The computed plan containing the changes to be applied. May be None if no changes were detected.
sources (list[octodns.provider.base.BaseProvider]) – List of source providers for this zone. May be empty for aliased zones.
target (octodns.provider.base.BaseProvider) – The target provider for which the plan was created.
lenient (bool) – When True, relaxed validation rules should be applied when modifying zone records.
- Returns:
The modified plan, which may be the same object passed in, a newly created Plan, or None if no changes are needed.
- Return type:
octodns.provider.plan.Plan or None
Important
planmay be None if no changes were detected; if so, aPlanmay still be created and returned.May modify
plan.changesdirectly or create a newPlan.Does not have to modify
plan.desiredand/orplan.existingto line up with any modifications made toplan.changes.Should copy over
plan.exists,plan.update_pcent_threshold, andplan.delete_pcent_thresholdwhen creating a newPlan.Must return a
Planwhich may beplanor can be a newly created one withplan.desiredandplan.existingcopied over as-is or modified.Sources may be empty, as will be the case for aliased zones.
Implementations should combine
self.lenient or lenientand pass the result to any record and zone calls that acceptlenientas a parameter, e.g.zone.add_record(..., lenient=lenient).