dyn.tm.zones.SecondaryZone
The following examples highlight how to use the SecondaryZone
class to get/create SecondaryZone
's on the dyn.tm System and how to edit these objects from within a Python script.
The following example shows how to create a new SecondaryZone
on the dyn.tm System and how to edit some of the fields using the returned SecondaryZone
object. :
>>> from dyn.tm.zones import SecondaryZone
>>> # Create a dyn.tmSession
>>> new_zone = SecondaryZone('myzone.com', '127.0.0.1', 'mynickame')
>>> new_zone.active
'Y'
>>> new_zone.retransfer()
>>> new_zone.serial
1
The following example shows how to get an existing SecondaryZone
from the dyn.tm System. :
>>> from dyn.tm.zones import SecondaryZone
>>> # Create a dyn.tmSession
>>> my_zone = SecondaryZone('myzone.com')
>>> my_zone.serial
5
>>> my_zone.contact_nickname
u'mynickname'
>>> my_zone.deactivate()
>>> my_zone.active
'N'
The following example shows how to use the results of a call to the get_all_secondary_zones
functions :
>>> from dyn.tm.zones import get_all_secondary_zones
>>> my_sec_zones = get_all_secondary_zones()
>>> for zone in my_sec_zones:
... zone.activate()