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

Class 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)
a new object with type S, a subtype of T __new__(S, ...)
  __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.

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

Method Details

__init__(self)
(Constructor)

Initialize a DNS node.

__eq__(self, other)
(Equality operator)

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

__new__(S, ...)

Returns:
a new object with type S, a subtype of T

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=0)

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, then the covers value will be the rdata type the SIG covers. The library treats the SIG type as if it were a family of types, e.g. SIG(A), SIG(NS), SIG(SOA). This makes SIGs much easier to work with than if SIGs covering different rdata types were aggregated into a single SIG 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=0)

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

Generated by Epydoc 1.1 on Sat Aug 2 15:09:34 2003 http://epydoc.sf.net