Home | Trees | Index | Help |
|
---|
Package dns :: Module zone :: Class Zone |
|
object
--+
|
Zone
A DNS zone.
A Zone is a mapping from names to nodes. The zone object may be treated like a Python dictionary, e.g. zone[name] will retrieve the node associated with that name. The name may be a dns.name.Name object, or it may be a string. In the either case, if the name is relative it is treated as relative to the origin of the zone.Method Summary | |
---|---|
Initialize a zone object. | |
__contains__(self,
other)
| |
__delitem__(self,
key)
| |
bool |
Two zones are equal if they have the same origin, class, and nodes. |
__getitem__(self,
key)
| |
__iter__(self)
| |
bool |
Are two zones not equal? |
__setitem__(self,
key,
value)
| |
Do some simple checking of the zone's origin. | |
Delete the specified node if it exists. | |
Delete the rdataset matching rdtype and covers, if it exists at the node specified by name. | |
Find a node in the zone, possibly creating it. | |
dns.rrset.RRset object |
Look for rdata with the specified name and type in the zone, and return an rdataset encapsulating it. |
dns.rrset.RRset object |
Look for rdata with the specified name and type in the zone, and return an RRset encapsulating it. |
get(self,
key)
| |
Get a node in the zone, possibly creating it. | |
dns.rrset.RRset object |
Look for rdata with the specified name and type in the zone, and return an rdataset encapsulating it. |
dns.rrset.RRset object |
Look for rdata with the specified name and type in the zone, and return an RRset encapsulating it. |
items(self)
| |
Return a generator which yields (name, ttl, rdata) tuples for all rdatas in the zone which have the specified rdtype and covers. | |
Return a generator which yields (name, rdataset) tuples for all rdatasets in the zone which have the specified rdtype and covers. | |
iteritems(self)
| |
iterkeys(self)
| |
itervalues(self)
| |
keys(self)
| |
Replace an rdataset at name. | |
Write a zone to a file. | |
values(self)
| |
_validate_name(self,
name)
| |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Instance Variable Summary | |
---|---|
dict | nodes : A dictionary mapping the names of nodes in the zone to the nodes
themselves. |
dns.name.Name object | origin : The origin of the zone. |
int | rdclass : The zone's rdata class; the default is class IN. |
bool | relativize : should names in the zone be relativized? |
Class Variable Summary | |
---|---|
list |
__slots__ = ['rdclass', 'origin', 'nodes', 'relativize']
|
class or callable | node_factory = dns.node.Node |
Method Details |
---|
__init__(self,
origin,
rdclass=1,
relativize=True)
Initialize a zone object.
|
__eq__(self,
other)
Two zones are equal if they have the same origin, class, and
nodes.
|
__ne__(self, other)Are two zones not equal?
|
check_origin(self)Do some simple checking of the zone's origin.
|
delete_node(self, name)Delete the specified node if it exists. It is not an error if the node does not exist. |
delete_rdataset(self, name, rdtype, covers=0)Delete the rdataset matching rdtype and covers, if it exists at the node specified by name. The name, rdtype, and covers parameters may be strings, in which case they will be converted to their proper type. It is not an error if the node does not exist, or if there is no matching rdataset at the node. If the node has no rdatasets after the deletion, it will itself be deleted.
|
find_node(self, name, create=False)Find a node in the zone, possibly creating it.
|
find_rdataset(self, name, rdtype, covers=0, create=False)Look for rdata with the specified name and type in the zone, and return an rdataset encapsulating it. The name, rdtype, and covers parameters may be strings, in which case they will be converted to their proper type. The rdataset returned is not a copy; changes to it will change the zone. KeyError is raised if the name or type are not found. Useget_rdataset if you want to have None
returned instead.
|
find_rrset(self, name, rdtype, covers=0)Look for rdata with the specified name and type in the zone, and return an RRset encapsulating it. The name, rdtype, and covers parameters may be strings, in which case they will be converted to their proper type. This method is less efficient than the similar This method may not be used to create new nodes or rdatasets; use get_rrset if you want to have None
returned instead.
|
get_node(self, name, create=False)Get a node in the zone, possibly creating it. This method is likefind_node , except it returns None instead
of raising an exception if the node does not exist and creation has not
been requested.
|
get_rdataset(self, name, rdtype, covers=0, create=False)Look for rdata with the specified name and type in the zone, and return an rdataset encapsulating it. The name, rdtype, and covers parameters may be strings, in which case they will be converted to their proper type. The rdataset returned is not a copy; changes to it will change the zone. None is returned if the name or type are not found. Usefind_rdataset if you want to have
KeyError raised instead.
|
get_rrset(self, name, rdtype, covers=0)Look for rdata with the specified name and type in the zone, and return an RRset encapsulating it. The name, rdtype, and covers parameters may be strings, in which case they will be converted to their proper type. This method is less efficient than the similar This method may not be used to create new nodes or rdatasets; use find_rrset if you want to have KeyError
raised instead.
|
iterate_rdatas(self, rdtype=None, covers=0)Return a generator which yields (name, ttl, rdata) tuples for all rdatas in the zone which have the specified rdtype and covers. If rdtype is dns.rdatatype.ANY, the default, then all rdatas will be matched.
|
iterate_rdatasets(self, rdtype=None, covers=0)Return a generator which yields (name, rdataset) tuples for all rdatasets in the zone which have the specified rdtype and covers. If rdtype is dns.rdatatype.ANY, the default, then all rdatasets will be matched.
|
replace_rdataset(self, name, replacement)Replace an rdataset at name. It is not an error if there is no rdataset matching replacement. Ownership of the replacement object is transferred to the zone; in other words, this method does not store a copy of replacement at the node, it stores replacement itself. If the name node does not exist, it is created.
|
to_file(self, f, sorted=True, relativize=True, nl=None)Write a zone to a file.
|
Instance Variable Details |
---|
nodesA dictionary mapping the names of nodes in the zone to the nodes themselves.
|
originThe origin of the zone.
|
rdclassThe zone's rdata class; the default is class IN.
|
relativizeshould names in the zone be relativized?
|
Class Variable Details |
---|
__slots__
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sun Jul 31 21:35:42 2005 | http://epydoc.sf.net |