Package dns :: Module node :: Class Node
[show private | hide private]
[frames | no frames]

Type Node

object --+
         |
        Node


A DNS node.

A node is a set of rdatasets
Method Summary
  __init__(self)
Initialize a DNS node.
bool __eq__(self, other)
Two nodes are equal if they have the same rdatasets.
  __iter__(self)
  __len__(self)
  __ne__(self, other)
  __repr__(self)
  delete_rdataset(self, rdclass, rdtype, covers)
Delete the rdataset matching the specified properties in the current node.
dns.rdataset.Rdataset object find_rdataset(self, rdclass, rdtype, covers, create)
Find an rdataset matching the specified properties in the current node.
dns.rdataset.Rdataset object or None get_rdataset(self, rdclass, rdtype, covers, create)
Get an rdataset matching the specified properties in the current node.
  replace_rdataset(self, replacement)
Replace an rdataset.
string to_text(self, name, **kw)
Convert a node to text format.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Instance Variable Summary
list of dns.rdataset.Rdataset objects rdatasets: the node's rdatasets

Class Variable Summary
list __slots__ = ['rdatasets']

Method Details

__init__(self)
(Constructor)

Initialize a DNS node.
Overrides:
__builtin__.object.__init__

__eq__(self, other)
(Equality operator)

Two nodes are equal if they have the same rdatasets.
Returns:
bool

delete_rdataset(self, rdclass, rdtype, covers=0)

Delete the rdataset matching the specified properties in the current node.

If a matching rdataset does not exist, it is not an error.
Parameters:
rdclass - The class of the rdataset
           (type=int)
rdtype - The type of the rdataset
           (type=int)
covers - The covered type.
           (type=int)

find_rdataset(self, rdclass, rdtype, covers=0, create=False)

Find an rdataset matching the specified properties in the current node.
Parameters:
rdclass - The class of the rdataset
           (type=int)
rdtype - The type of the rdataset
           (type=int)
covers - The covered type. Usually this value is dns.rdatatype.NONE, but if the rdtype is dns.rdatatype.SIG or dns.rdatatype.RRSIG, then the covers value will be the rdata type the SIG/RRSIG covers. The library treats the SIG and RRSIG types as if they were a family of types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA). This makes RRSIGs much easier to work with than if RRSIGs covering different rdata types were aggregated into a single RRSIG rdataset.
           (type=int)
create - If True, create the rdataset if it is not found.
           (type=bool)
Returns:
dns.rdataset.Rdataset object
Raises:
KeyError - An rdataset of the desired type and class does not exist and create is not True.

get_rdataset(self, rdclass, rdtype, covers=0, create=False)

Get an rdataset matching the specified properties in the current node.

None is returned if an rdataset of the specified type and class does not exist and create is not True.
Parameters:
rdclass - The class of the rdataset
           (type=int)
rdtype - The type of the rdataset
           (type=int)
covers - The covered type.
           (type=int)
create - If True, create the rdataset if it is not found.
           (type=bool)
Returns:
dns.rdataset.Rdataset object or None

replace_rdataset(self, replacement)

Replace an rdataset.

It is not an error if there is no rdataset matching replacement.

Ownership of the replacement object is transferred to the node; in other words, this method does not store a copy of replacement at the node, it stores replacement itself.

to_text(self, name, **kw)

Convert a node to text format.

Each rdataset at the node is printed. Any keyword arguments to this method are passed on to the rdataset's to_text() method.
Parameters:
name - the owner name of the rdatasets
           (type=dns.name.Name object)
Returns:
string

Instance Variable Details

rdatasets

the node's rdatasets
Type:
list of dns.rdataset.Rdataset objects
Value:
<member 'rdatasets' of 'Node' objects>                                 

Class Variable Details

__slots__

Type:
list
Value:
['rdatasets']                                                          

Generated by Epydoc 2.1 on Fri Jun 2 14:38:18 2006 http://epydoc.sf.net